From 763f16d504ab9667679aebdb461a0d365708938b Mon Sep 17 00:00:00 2001 From: Philipp Andreas Date: Tue, 28 Oct 2014 21:30:15 +0100 Subject: Fix for update9 dbus changes. --- daemon/voicecallhandler.cpp | 138 ++++++++++---------------------------------- 1 file changed, 30 insertions(+), 108 deletions(-) (limited to 'daemon/voicecallhandler.cpp') diff --git a/daemon/voicecallhandler.cpp b/daemon/voicecallhandler.cpp index d11ceb8..8b638b8 100644 --- a/daemon/voicecallhandler.cpp +++ b/daemon/voicecallhandler.cpp @@ -65,92 +65,6 @@ void VoiceCallHandler::initialize(bool notifyError) { Q_D(VoiceCallHandler); -/* -method return sender=:1.13 -> dest=:1.150 reply_serial=2 - string " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" -*/ - if (d->interface->isValid()) { if (getProperties()) { emit durationChanged(); @@ -162,13 +76,13 @@ method return sender=:1.13 -> dest=:1.150 reply_serial=2 emit forwardedChanged(); 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())); + connect(d->interface, SIGNAL(statusChanged(int, QString)), SLOT(onStatusChanged(int, QString))); + connect(d->interface, SIGNAL(lineIdChanged(QString)), SLOT(onLineIdChanged(QString))); + connect(d->interface, SIGNAL(durationChanged(int)), SLOT(onDurationChanged(int))); + connect(d->interface, SIGNAL(startedAtChanged(QDateTime)), SLOT(onStartedAtChanged(QDateTime))); + connect(d->interface, SIGNAL(emergencyChanged(bool)), SLOT(onEmergencyChanged(bool))); + connect(d->interface, SIGNAL(multipartyChanged(bool)), SLOT(onMultipartyChanged(bool))); + connect(d->interface, SIGNAL(forwardedChanged(bool)), SLOT(onForwardedChanged(bool))); } else { if (notifyError) emit this->error("Failed to get VoiceCall properties from VCM D-Bus service."); @@ -207,54 +121,62 @@ bool VoiceCallHandler::getProperties() } } -void VoiceCallHandler::onDurationChanged() +void VoiceCallHandler::onDurationChanged(int duration) { Q_D(VoiceCallHandler); - d->duration = d->interface->property("duration").toInt(); + //logger()->debug() <<"onDurationChanged"<duration = duration; emit durationChanged(); } -void VoiceCallHandler::onStatusChanged() +void VoiceCallHandler::onStatusChanged(int status, QString statusText) { - // a) initialize() might returned crap with STATUS_NULL (no lineId) - // b) we need to fetch two properties "status" and "statusText" - // so, we might aswell get them all + Q_D(VoiceCallHandler); + logger()->debug() <<"onStatusChanged" << status << statusText; + d->status = status; + d->statusText = statusText; + // we still fetch all properties to be sure all properties are present. getProperties(); emit statusChanged(); } -void VoiceCallHandler::onLineIdChanged() +void VoiceCallHandler::onLineIdChanged(QString lineId) { Q_D(VoiceCallHandler); - d->lineId = d->interface->property("lineId").toString(); + logger()->debug() << "onLineIdChanged" << lineId; + d->lineId = lineId; emit lineIdChanged(); } -void VoiceCallHandler::onStartedAtChanged() +void VoiceCallHandler::onStartedAtChanged(const QDateTime &startedAt) { Q_D(VoiceCallHandler); + logger()->debug() << "onStartedAtChanged" << startedAt; d->startedAt = d->interface->property("startedAt").toDateTime(); emit startedAtChanged(); } -void VoiceCallHandler::onEmergencyChanged() +void VoiceCallHandler::onEmergencyChanged(bool isEmergency) { Q_D(VoiceCallHandler); - d->emergency = d->interface->property("isEmergency").toBool(); + logger()->debug() << "onEmergencyChanged" << isEmergency; + d->emergency = isEmergency; emit emergencyChanged(); } -void VoiceCallHandler::onMultipartyChanged() +void VoiceCallHandler::onMultipartyChanged(bool isMultiparty) { Q_D(VoiceCallHandler); - d->multiparty = d->interface->property("isMultiparty").toBool(); + logger()->debug() << "onMultipartyChanged" << isMultiparty; + d->multiparty = isMultiparty; emit multipartyChanged(); } -void VoiceCallHandler::onForwardedChanged() +void VoiceCallHandler::onForwardedChanged(bool isForwarded) { Q_D(VoiceCallHandler); - d->forwarded = d->interface->property("isForwarded").toBool(); + logger()->debug() << "onForwardedChanged" << isForwarded; + d->forwarded = isForwarded; emit forwardedChanged(); } -- cgit v1.2.3