summaryrefslogtreecommitdiff
path: root/daemon/voicecallhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/voicecallhandler.cpp')
-rw-r--r--daemon/voicecallhandler.cpp33
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()));
}
}