summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworksession/lackey
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-13 00:16:48 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-14 03:01:37 (GMT)
commit08b6114240a6c02dbeb0297d0deeb538ebc3fde9 (patch)
tree8fc5b00d4cbb90861b2c34e49e0664f4f5e90468 /tests/auto/qnetworksession/lackey
parentb4c589868f278aa9a58ab9afa727dbf0a9442e22 (diff)
downloadQt-08b6114240a6c02dbeb0297d0deeb538ebc3fde9.zip
Qt-08b6114240a6c02dbeb0297d0deeb538ebc3fde9.tar.gz
Qt-08b6114240a6c02dbeb0297d0deeb538ebc3fde9.tar.bz2
Cherry pick fix for MOBILITY-828 from Qt Mobility.
Change e5f8e3069d0de428a751e8a1dd88f3585f2d3f5f from Qt Mobility.
Diffstat (limited to 'tests/auto/qnetworksession/lackey')
-rw-r--r--tests/auto/qnetworksession/lackey/main.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/auto/qnetworksession/lackey/main.cpp b/tests/auto/qnetworksession/lackey/main.cpp
index 8759b52..ec2fad9 100644
--- a/tests/auto/qnetworksession/lackey/main.cpp
+++ b/tests/auto/qnetworksession/lackey/main.cpp
@@ -47,6 +47,8 @@
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
+#include <QEventLoop>
+#include <QTimer>
#include <QDebug>
QT_USE_NAMESPACE
@@ -60,15 +62,14 @@ int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
- // Cannot read/write to processes on WinCE or Symbian.
- // Easiest alternative is to use sockets for IPC.
-
- QLocalSocket oopSocket;
-
- oopSocket.connectToServer("tst_qnetworksession");
- oopSocket.waitForConnected(-1);
-
+ // Update configurations so that everything is up to date for this process too.
+ // Event loop is used to wait for awhile.
QNetworkConfigurationManager manager;
+ manager.updateConfigurations();
+ QEventLoop iIgnoreEventLoop;
+ QTimer::singleShot(3000, &iIgnoreEventLoop, SLOT(quit()));
+ iIgnoreEventLoop.exec();
+
QList<QNetworkConfiguration> discovered =
manager.allConfigurations(QNetworkConfiguration::Discovered);
@@ -82,6 +83,13 @@ int main(int argc, char** argv)
return NO_DISCOVERED_CONFIGURATIONS_ERROR;
}
+ // Cannot read/write to processes on WinCE or Symbian.
+ // Easiest alternative is to use sockets for IPC.
+ QLocalSocket oopSocket;
+
+ oopSocket.connectToServer("tst_qnetworksession");
+ oopSocket.waitForConnected(-1);
+
qDebug() << "Lackey started";
QNetworkSession *session = 0;