diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-12 02:10:03 +0200 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2014-07-12 02:10:03 +0200 |
| commit | 9d03d21ad9affb57d3bad486e92eecd6b2a1df08 (patch) | |
| tree | 296a751cef850011bab49e3d6cbacd2b413fba67 /daemon/voicecallhandler.cpp | |
| parent | 659037ba7c1d39b95164c86279c9e6ae355d8288 (diff) | |
(Possibly) Fix 'Unknown' call notifications
Diffstat (limited to 'daemon/voicecallhandler.cpp')
| -rw-r--r-- | daemon/voicecallhandler.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/daemon/voicecallhandler.cpp b/daemon/voicecallhandler.cpp index c8ffe89..428785f 100644 --- a/daemon/voicecallhandler.cpp +++ b/daemon/voicecallhandler.cpp @@ -66,7 +66,6 @@ VoiceCallHandler::~VoiceCallHandler() void VoiceCallHandler::initialize(bool notifyError) { Q_D(VoiceCallHandler); - bool success = false; /* method return sender=:1.13 -> dest=:1.150 reply_serial=2 @@ -154,24 +153,12 @@ method return sender=:1.13 -> dest=:1.150 reply_serial=2 " */ - if(d->interface->isValid()) - { - success = true; - success &= (bool)QObject::connect(d->interface, SIGNAL(error(QString)), SIGNAL(error(QString))); - success &= (bool)QObject::connect(d->interface, SIGNAL(statusChanged()), SLOT(onStatusChanged())); - success &= (bool)QObject::connect(d->interface, SIGNAL(lineIdChanged()), SLOT(onLineIdChanged())); - success &= (bool)QObject::connect(d->interface, SIGNAL(durationChanged()), SLOT(onDurationChanged())); - success &= (bool)QObject::connect(d->interface, SIGNAL(startedAtChanged()), SLOT(onStartedAtChanged())); - success &= (bool)QObject::connect(d->interface, SIGNAL(emergencyChanged()), SLOT(onEmergencyChanged())); - success &= (bool)QObject::connect(d->interface, SIGNAL(multipartyChanged()), SLOT(onMultipartyChanged())); - success &= (bool)QObject::connect(d->interface, SIGNAL(forwardedChanged()), SLOT(onForwardedChanged())); - } - - if(!(d->connected = success)) + if (not d->connected) { QTimer::singleShot(2000, this, SLOT(initialize())); if(notifyError) emit this->error("Failed to connect to VCM D-Bus service."); - } else { + } + else if (d->interface->isValid()) { QDBusInterface props(d->interface->service(), d->interface->path(), "org.freedesktop.DBus.Properties", d->interface->connection()); @@ -196,10 +183,20 @@ method return sender=:1.13 -> dest=:1.150 reply_serial=2 emit multipartyChanged(); emit emergencyChanged(); emit forwardedChanged(); - } else if (notifyError) { + } + else { logger()->error() << "Failed to get VoiceCall properties from VCM D-Bus service."; - emit this->error("Failed to get VoiceCall properties from VCM D-Bus service."); + if (notifyError) emit this->error("Failed to get VoiceCall properties from VCM D-Bus service."); } + + connect(d->interface, SIGNAL(error(QString)), SIGNAL(error(QString))); + connect(d->interface, SIGNAL(statusChanged()), SLOT(onStatusChanged())); + connect(d->interface, SIGNAL(lineIdChanged()), SLOT(onLineIdChanged())); + connect(d->interface, SIGNAL(durationChanged()), SLOT(onDurationChanged())); + connect(d->interface, SIGNAL(startedAtChanged()), SLOT(onStartedAtChanged())); + connect(d->interface, SIGNAL(emergencyChanged()), SLOT(onEmergencyChanged())); + connect(d->interface, SIGNAL(multipartyChanged()), SLOT(onMultipartyChanged())); + connect(d->interface, SIGNAL(forwardedChanged()), SLOT(onForwardedChanged())); } } |
