~ps-jenkins/libdbusmenu-qt/utopic-proposed

« back to all changes in this revision

Viewing changes to src/dbusmenuimporter.cpp

  • Committer: Pete Woods
  • Date: 2014-02-18 11:52:15 UTC
  • mto: This revision was merged to the branch mainline in revision 259.
  • Revision ID: pete.woods@canonical.com-20140218115215-1dzk9jlxgnrtst31
Respond to review comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
447
447
{
448
448
    QPointer<QDBusPendingCallWatcher> watcher(_watcher);
449
449
 
450
 
    QEventLoop loop;
451
 
    QTimer::singleShot(maxWait, &loop, SLOT(quit()));
452
 
    loop.connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher *)), SLOT(quit()));
453
 
    loop.exec();
 
450
    {
 
451
        QTimer timer;
 
452
        timer.setSingleShot(true);
 
453
        QEventLoop loop;
 
454
        loop.connect(&timer, SIGNAL(timeout()), SLOT(quit()));
 
455
        loop.connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher *)), SLOT(quit()));
 
456
        timer.start(maxWait);
 
457
        loop.exec();
 
458
        timer.stop();
 
459
    }
454
460
 
455
461
    if (!watcher) {
456
462
        // Watcher died. This can happen if importer got deleted while we were