void QServiceDiscovery::initializeNetworkSession()
{
    // now begin the process of opening the network link
    m_networkConfigManager = new QNetworkConfigurationManager(this);
    connect(m_networkConfigManager, SIGNAL(updateCompleted()),
            this, SLOT(openNetworkSession()));
    m_networkConfigManager->updateConfigurations();
    m_networkConfigTimer->start(); // update the connections cyclically
}
void ServiceDiscovery::networkConfigUpdateCompleted()
{
    if ((m_networkSession.isNull())
            || (!m_networkSession->isOpen())
            || (!m_networkReady))
    {
        openNetworkSession();
    }
}
Exemple #3
0
MainWindow::MainWindow() :
    serviceProvider(0),
    markerManager(0),
    positionSource(0),
    lastNavigator(0),
    tracking(true),
    firstUpdate(true)
{
    // our actual maps widget is the centre of the mainwindow
    mapsWidget = new MapsWidget;
    setCentralWidget(mapsWidget);

    // set up the menus
    QMenuBar *mbar = new QMenuBar(this);
    mbar->addAction("Quit", qApp, SLOT(quit()));
    mbar->addAction("My Location", this, SLOT(goToMyLocation()));

    QMenu *searchMenu = new QMenu("Search");
    mbar->addMenu(searchMenu);

    searchMenu->addAction("For address or name", this, SLOT(showSearchDialog()));

    QMenu *navigateMenu = new QMenu("Directions");
    mbar->addMenu(navigateMenu);

    navigateMenu->addAction("From here to address", this, SLOT(showNavigateDialog()));

    setMenuBar(mbar);
    setWindowTitle("Maps Demo");

    // now begin the process of opening the network link
    netConfigManager = new QNetworkConfigurationManager;
    connect(netConfigManager, SIGNAL(updateCompleted()),
            this, SLOT(openNetworkSession()));
    netConfigManager->updateConfigurations();
}