Merge lp:~boiko/telephony-service/rtm-dont_crash_no_dbus into lp:telephony-service/rtm-14.09

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Bill Filler
Approved revision: 908
Merged at revision: 907
Proposed branch: lp:~boiko/telephony-service/rtm-dont_crash_no_dbus
Merge into: lp:telephony-service/rtm-14.09
Diff against target: 76 lines (+20/-14)
2 files modified
libtelephonyservice/telepathyhelper.cpp (+19/-13)
libtelephonyservice/telepathyhelper.h (+1/-1)
To merge this branch: bzr merge lp:~boiko/telephony-service/rtm-dont_crash_no_dbus
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
Review via email: mp+240717@code.launchpad.net

Commit message

Do not crash if the account manager preparation job does not succeed.

Description of the change

Do not crash if the account manager preparation job does not succeed.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N//A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
908. By Gustavo Pichorim Boiko

Do not try to connect signals of an observer that didn't get registered.

Revision history for this message
Bill Filler (bfiller) wrote :

approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libtelephonyservice/telepathyhelper.cpp'
--- libtelephonyservice/telepathyhelper.cpp 2014-10-04 02:23:07 +0000
+++ libtelephonyservice/telepathyhelper.cpp 2014-11-05 20:43:30 +0000
@@ -201,17 +201,17 @@
201 }201 }
202202
203 mChannelObserver = new ChannelObserver(this);203 mChannelObserver = new ChannelObserver(this);
204 registerClient(mChannelObserver, name);204 if (registerClient(mChannelObserver, name)) {
205205 // messages
206 // messages206 connect(mChannelObserver, SIGNAL(textChannelAvailable(Tp::TextChannelPtr)),
207 connect(mChannelObserver, SIGNAL(textChannelAvailable(Tp::TextChannelPtr)),207 ChatManager::instance(), SLOT(onTextChannelAvailable(Tp::TextChannelPtr)));
208 ChatManager::instance(), SLOT(onTextChannelAvailable(Tp::TextChannelPtr)));208
209209 // calls
210 // calls210 connect(mChannelObserver, SIGNAL(callChannelAvailable(Tp::CallChannelPtr)),
211 connect(mChannelObserver, SIGNAL(callChannelAvailable(Tp::CallChannelPtr)),211 CallManager::instance(), SLOT(onCallChannelAvailable(Tp::CallChannelPtr)));
212 CallManager::instance(), SLOT(onCallChannelAvailable(Tp::CallChannelPtr)));212
213213 Q_EMIT channelObserverCreated(mChannelObserver);
214 Q_EMIT channelObserverCreated(mChannelObserver);214 }
215}215}
216216
217void TelepathyHelper::unregisterChannelObserver()217void TelepathyHelper::unregisterChannelObserver()
@@ -245,7 +245,7 @@
245 SLOT(onAccountReady()));245 SLOT(onAccountReady()));
246}246}
247247
248void TelepathyHelper::registerClient(Tp::AbstractClient *client, QString name)248bool TelepathyHelper::registerClient(Tp::AbstractClient *client, QString name)
249{249{
250 Tp::AbstractClientPtr clientPtr(client);250 Tp::AbstractClientPtr clientPtr(client);
251 bool succeeded = mClientRegistrar->registerClient(clientPtr, name);251 bool succeeded = mClientRegistrar->registerClient(clientPtr, name);
@@ -267,6 +267,8 @@
267 object->setProperty("clientName", TP_QT_IFACE_CLIENT + "." + name );267 object->setProperty("clientName", TP_QT_IFACE_CLIENT + "." + name );
268 }268 }
269 }269 }
270
271 return succeeded;
270}272}
271273
272AccountEntry *TelepathyHelper::accountForConnection(const Tp::ConnectionPtr &connection) const274AccountEntry *TelepathyHelper::accountForConnection(const Tp::ConnectionPtr &connection) const
@@ -329,7 +331,11 @@
329331
330void TelepathyHelper::onAccountManagerReady(Tp::PendingOperation *op)332void TelepathyHelper::onAccountManagerReady(Tp::PendingOperation *op)
331{333{
332 Q_UNUSED(op)334 // if the account manager ready job returns an error, just fail silently
335 if (op->isError()) {
336 qCritical() << "Failed to prepare Tp::AccountManager" << op->errorName() << op->errorMessage();
337 return;
338 }
333339
334 Tp::AccountSetPtr accountSet;340 Tp::AccountSetPtr accountSet;
335 QMap<QString, AccountEntry *> orderedAccounts;341 QMap<QString, AccountEntry *> orderedAccounts;
336342
=== modified file 'libtelephonyservice/telepathyhelper.h'
--- libtelephonyservice/telepathyhelper.h 2014-09-29 23:09:25 +0000
+++ libtelephonyservice/telepathyhelper.h 2014-11-05 20:43:30 +0000
@@ -80,7 +80,7 @@
80 bool emergencyCallsAvailable() const;80 bool emergencyCallsAvailable() const;
81 Q_INVOKABLE void unlockSimCards() const;81 Q_INVOKABLE void unlockSimCards() const;
8282
83 void registerClient(Tp::AbstractClient *client, QString name);83 bool registerClient(Tp::AbstractClient *client, QString name);
8484
85 // pre-populated channel class specs for conferences85 // pre-populated channel class specs for conferences
86 static Tp::ChannelClassSpec audioConferenceSpec();86 static Tp::ChannelClassSpec audioConferenceSpec();

Subscribers

People subscribed via source and target branches