~ubuntu-branches/ubuntu/utopic/kactivities/utopic-proposed

« back to all changes in this revision

Viewing changes to src/lib/core/utils_p.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Rohan Garg, Jonathan Riddell
  • Date: 2014-06-18 11:42:14 UTC
  • mfrom: (1.1.41) (1.4.6 sid)
  • Revision ID: package-import@ubuntu.com-20140618114214-ggn9jzuv20z6rnuu
Tags: 4:4.13.2-0ubuntu1
[ Rohan Garg ]
* Merge with debian, no remaining changes

[ Jonathan Riddell ]
* new upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
// Creates an async call to retrieve a value from the dbus service
31
31
// and initializes the call watcher
32
32
#define KAMD_RETRIEVE_REMOTE_VALUE(Variable, MethodToCall, Target)                      \
33
 
    qDebug() << "Locking mutex for" << #Variable;                                       \
34
33
    Variable##Mutex.lock();                                                             \
35
34
    const QDBusPendingCall & Variable##Call = Manager::activities()->MethodToCall;      \
36
35
    Variable##CallWatcher = new QDBusPendingCallWatcher(Variable##Call, Target);        \
80
79
        Variable##CallWatcher = 0;                                               \
81
80
        Variable##Mutex.unlock();                                                \
82
81
        call->deleteLater();                                                     \
83
 
        qDebug() << "Unlocked mutex";                                            \
84
82
    }
85
83
 
86
84
// Implements a value getter
89
87
    {                                                                 \
90
88
        if (!Manager::isServicePresent()) return Default;             \
91
89
        waitForCallFinished(d->Variable##CallWatcher, &d->Variable##Mutex); \
92
 
        qDebug() << "Returning" << #Variable << d->Variable;          \
93
90
        return d->Variable;                                           \
94
91
    }
95
92
 
98
95
    if (watcher) {
99
96
        watcher->waitForFinished();
100
97
 
101
 
        qDebug() << "Trying to lock mutex";
102
98
        mutex->lock();
103
99
        mutex->unlock();
104
100
    }