Merge lp:~tiagosh/telephony-service/fix-1224082 into lp:telephony-service

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 746
Merged at revision: 744
Proposed branch: lp:~tiagosh/telephony-service/fix-1224082
Merge into: lp:telephony-service
Diff against target: 116 lines (+30/-15)
5 files modified
libtelephonyservice/callentry.cpp (+1/-1)
libtelephonyservice/callmanager.cpp (+26/-14)
libtelephonyservice/callmanager.h (+1/-0)
libtelephonyservice/telepathyhelper.cpp (+1/-0)
libtelephonyservice/telepathyhelper.h (+1/-0)
To merge this branch: bzr merge lp:~tiagosh/telephony-service/fix-1224082
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+186434@code.launchpad.net

Commit message

- exclude incoming calls from foregroundCalls().
- empty mCallEntries when the observer is unregistered.

Description of the change

- exclude incoming calls from foregroundCalls().
- empty mCallEntries when the observer is unregistered.

To post a comment you must log in.
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

61 + // incoming calls cant be considered foreground calls

Just to not cause confusion, can you replace "incoming calls" by "incoming but not yet answered calls"?
Because we also use the word "incoming" to differentiate from "outgoing" calls.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good and works as expected!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libtelephonyservice/callentry.cpp'
2--- libtelephonyservice/callentry.cpp 2013-07-30 18:20:45 +0000
3+++ libtelephonyservice/callentry.cpp 2013-09-18 21:30:40 +0000
4@@ -129,7 +129,7 @@
5
6 bool CallEntry::ringing() const
7 {
8- return mChannel->callFlags() & Tp::CallFlagLocallyRinging;
9+ return incoming() && (mChannel->callState() == Tp::CallStateInitialised);
10 }
11
12 QString CallEntry::phoneNumber() const
13
14=== modified file 'libtelephonyservice/callmanager.cpp'
15--- libtelephonyservice/callmanager.cpp 2013-07-18 17:02:10 +0000
16+++ libtelephonyservice/callmanager.cpp 2013-09-18 21:30:40 +0000
17@@ -41,6 +41,16 @@
18 : QObject(parent)
19 {
20 connect(TelepathyHelper::instance(), SIGNAL(connectedChanged()), SLOT(onConnectedChanged()));
21+ connect(TelepathyHelper::instance(), SIGNAL(channelObserverUnregistered()), SLOT(onChannelObserverUnregistered()));
22+}
23+
24+void CallManager::onChannelObserverUnregistered()
25+{
26+ mCallEntries.clear();
27+ Q_EMIT hasCallsChanged();
28+ Q_EMIT hasBackgroundCallChanged();
29+ Q_EMIT foregroundCallChanged();
30+ Q_EMIT backgroundCallChanged();
31 }
32
33 void CallManager::startCall(const QString &phoneNumber)
34@@ -76,19 +86,25 @@
35 // even if it is held
36 if (mCallEntries.count() == 1) {
37 call = mCallEntries.first();
38- }
39-
40- Q_FOREACH(CallEntry *entry, mCallEntries) {
41- if (entry->isActive() && !entry->isHeld()) {
42- call = entry;
43+ } else {
44+ Q_FOREACH(CallEntry *entry, mCallEntries) {
45+ if (entry->isActive() && !entry->isHeld()) {
46+ call = entry;
47+ break;
48+ }
49 }
50 }
51
52- if (call && (call->isActive() || call->isHeld() || !call->incoming())) {
53- return call;
54- }
55-
56- return 0;
57+ if (!call) {
58+ return 0;
59+ }
60+
61+ // incoming but not yet answered calls cant be considered foreground calls
62+ if (call->ringing()) {
63+ return 0;
64+ }
65+
66+ return call;
67 }
68
69 QObject *CallManager::backgroundCall() const
70@@ -125,10 +141,6 @@
71 entry->setVoicemail(true);
72 }
73
74- if (channel->isRequested()) {
75- entry->setSpeaker(true);
76- }
77-
78 mCallEntries.append(entry);
79 connect(entry,
80 SIGNAL(callEnded()),
81
82=== modified file 'libtelephonyservice/callmanager.h'
83--- libtelephonyservice/callmanager.h 2013-07-18 17:02:10 +0000
84+++ libtelephonyservice/callmanager.h 2013-09-18 21:30:40 +0000
85@@ -72,6 +72,7 @@
86
87 public Q_SLOTS:
88 void onCallChannelAvailable(Tp::CallChannelPtr channel);
89+ void onChannelObserverUnregistered();
90 void onCallEnded();
91 void onConnectedChanged();
92
93
94=== modified file 'libtelephonyservice/telepathyhelper.cpp'
95--- libtelephonyservice/telepathyhelper.cpp 2013-08-23 21:14:08 +0000
96+++ libtelephonyservice/telepathyhelper.cpp 2013-09-18 21:30:40 +0000
97@@ -144,6 +144,7 @@
98 }
99 mChannelObserver->deleteLater();
100 mChannelObserver = NULL;
101+ Q_EMIT channelObserverUnregistered();
102 }
103
104 QStringList TelepathyHelper::supportedProtocols() const
105
106=== modified file 'libtelephonyservice/telepathyhelper.h'
107--- libtelephonyservice/telepathyhelper.h 2013-08-23 20:39:04 +0000
108+++ libtelephonyservice/telepathyhelper.h 2013-09-18 21:30:40 +0000
109@@ -55,6 +55,7 @@
110
111 Q_SIGNALS:
112 void channelObserverCreated(ChannelObserver *observer);
113+ void channelObserverUnregistered();
114 void accountReady();
115 void connectionChanged();
116 void connectedChanged();

Subscribers

People subscribed via source and target branches