Merge lp:~phablet-team/telephony-service/qml-start-chat into lp:telephony-service/staging

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 1247
Merged at revision: 1249
Proposed branch: lp:~phablet-team/telephony-service/qml-start-chat
Merge into: lp:telephony-service/staging
Prerequisite: lp:~phablet-team/telephony-service/add-participants-model
Diff against target: 112 lines (+24/-2)
5 files modified
libtelephonyservice/accountentry.cpp (+8/-0)
libtelephonyservice/accountentry.h (+4/-0)
libtelephonyservice/accountlist.cpp (+9/-1)
libtelephonyservice/accountlist.h (+2/-0)
libtelephonyservice/chatmanager.h (+1/-1)
To merge this branch: bzr merge lp:~phablet-team/telephony-service/qml-start-chat
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+317494@code.launchpad.net

Commit message

Export startChat to QML.

To post a comment you must log in.
1244. By Renato Araujo Oliveira Filho

Notify individual accounts active change.

1245. By Tiago Salem Herrmann

merge parent branch

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Just one request.

review: Needs Fixing
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

> Just one request.
Fixed

1246. By Renato Araujo Oliveira Filho

Renamed activeAccountsChangedImpl function to match with the code style.

1247. By Renato Araujo Oliveira Filho

Rename missing function.

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good now!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libtelephonyservice/accountentry.cpp'
2--- libtelephonyservice/accountentry.cpp 2017-03-21 19:31:35 +0000
3+++ libtelephonyservice/accountentry.cpp 2017-03-21 19:31:36 +0000
4@@ -164,6 +164,11 @@
5 Q_EMIT accountPropertiesChanged();
6 }
7
8+QVariantMap AccountEntry::parameters() const
9+{
10+ return mAccount->parameters();
11+}
12+
13 Tp::AccountPtr AccountEntry::account() const
14 {
15 return mAccount;
16@@ -235,6 +240,9 @@
17 SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
18 SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)));
19
20+ connect(mAccount.data(), &Tp::Account::parametersChanged,
21+ this, &AccountEntry::parametersChanged);
22+
23 connect(this,
24 SIGNAL(connectedChanged()),
25 SIGNAL(activeChanged()));
26
27=== modified file 'libtelephonyservice/accountentry.h'
28--- libtelephonyservice/accountentry.h 2017-03-21 19:31:35 +0000
29+++ libtelephonyservice/accountentry.h 2017-03-21 19:31:36 +0000
30@@ -48,6 +48,7 @@
31 Q_PROPERTY(Protocol* protocolInfo READ protocolInfo CONSTANT)
32 Q_PROPERTY(Capabilities capabilities READ capabilities NOTIFY capabilitiesChanged)
33 Q_PROPERTY(QVariantMap accountProperties READ accountProperties WRITE setAccountProperties NOTIFY accountPropertiesChanged)
34+ Q_PROPERTY(QVariantMap parameters READ parameters NOTIFY parametersChanged)
35 Q_ENUMS(AccountType)
36 friend class AccountEntryFactory;
37
38@@ -86,6 +87,8 @@
39
40 QVariantMap accountProperties() const;
41 void setAccountProperties(const QVariantMap &properties);
42+
43+ QVariantMap parameters() const;
44
45 Protocol *protocolInfo() const;
46
47@@ -106,6 +109,7 @@
48 void connectionStatusChanged(Tp::ConnectionStatus status);
49 void capabilitiesChanged();
50 void accountPropertiesChanged();
51+ void parametersChanged();
52
53 protected Q_SLOTS:
54 virtual void initialize();
55
56=== modified file 'libtelephonyservice/accountlist.cpp'
57--- libtelephonyservice/accountlist.cpp 2017-03-21 19:31:35 +0000
58+++ libtelephonyservice/accountlist.cpp 2017-03-21 19:31:36 +0000
59@@ -115,6 +115,14 @@
60 this, &AccountList::filterAccounts);
61 }
62
63+void AccountList::onActiveAccountsChanged()
64+{
65+ AccountEntry *account = qobject_cast<AccountEntry*>(QObject::sender());
66+
67+ Q_EMIT accountChanged(account, account->active());
68+ Q_EMIT activeAccountsChanged();
69+}
70+
71 void AccountList::filterAccounts()
72 {
73 // FIXME: we need to watch for active changed on accounts
74@@ -135,7 +143,7 @@
75 }
76
77 connect(account, &AccountEntry::activeChanged,
78- this, &AccountList::activeAccountsChanged);
79+ this, &AccountList::onActiveAccountsChanged);
80 mAccounts << account;
81 }
82
83
84=== modified file 'libtelephonyservice/accountlist.h'
85--- libtelephonyservice/accountlist.h 2016-10-04 02:47:27 +0000
86+++ libtelephonyservice/accountlist.h 2017-03-21 19:31:36 +0000
87@@ -55,10 +55,12 @@
88 void allAccountsChanged();
89 void activeAccountsChanged();
90 void displayedAccountsChanged();
91+ void accountChanged(AccountEntry *entry, bool active);
92
93 protected Q_SLOTS:
94 void init();
95 void filterAccounts();
96+ void onActiveAccountsChanged();
97
98 private:
99 Protocol::Features mFeatures;
100
101=== modified file 'libtelephonyservice/chatmanager.h'
102--- libtelephonyservice/chatmanager.h 2017-03-21 19:31:35 +0000
103+++ libtelephonyservice/chatmanager.h 2017-03-21 19:31:36 +0000
104@@ -36,7 +36,7 @@
105 public:
106 static ChatManager *instance();
107
108- QString startChat(const QString &accountId, const QVariantMap &properties);
109+ Q_INVOKABLE QString startChat(const QString &accountId, const QVariantMap &properties);
110 QString sendMessage(const QString &accountId, const QString &message, const QVariant &attachments = QVariant(), const QVariantMap &properties = QVariantMap());
111 QList<Tp::TextChannelPtr> channelForProperties(const QVariantMap &properties);
112 Tp::TextChannelPtr channelForObjectPath(const QString &objectPath);

Subscribers

People subscribed via source and target branches

to all changes: