Merge lp:~michael-sheldon/content-hub/expose-transfer-source-destination into lp:content-hub

Proposed by Michael Sheldon
Status: Merged
Approved by: Ken VanDine
Approved revision: 134
Merged at revision: 134
Proposed branch: lp:~michael-sheldon/content-hub/expose-transfer-source-destination
Merge into: lp:content-hub
Diff against target: 139 lines (+64/-0)
6 files modified
import/Ubuntu/Content/contenttransfer.cpp (+23/-0)
import/Ubuntu/Content/contenttransfer.h (+5/-0)
include/com/ubuntu/content/transfer.h (+4/-0)
src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml (+6/-0)
src/com/ubuntu/content/transfer.cpp (+10/-0)
src/com/ubuntu/content/transfer_p.h (+16/-0)
To merge this branch: bzr merge lp:~michael-sheldon/content-hub/expose-transfer-source-destination
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+232413@code.launchpad.net

Commit message

Expose the source and destination app IDs on transfers.

Description of the change

Expose the source and destination app IDs on transfers.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'import/Ubuntu/Content/contenttransfer.cpp'
2--- import/Ubuntu/Content/contenttransfer.cpp 2014-08-05 20:03:08 +0000
3+++ import/Ubuntu/Content/contenttransfer.cpp 2014-08-27 13:54:21 +0000
4@@ -326,6 +326,29 @@
5 return ContentType::hubType2contentType(m_transfer->contentType());
6 }
7
8+
9+/*!
10+ * \qmlproperty QString ContentTransfer::source
11+ * Provides the app id of the source application for this transfer
12+ */
13+QString ContentTransfer::source()
14+{
15+ TRACE() << Q_FUNC_INFO;
16+
17+ return m_transfer->source();
18+}
19+
20+/*!
21+ * \qmlproperty QString ContentTransfer::destination
22+ * Provides the app id of the destination application for this transfer
23+ */
24+QString ContentTransfer::destination()
25+{
26+ TRACE() << Q_FUNC_INFO;
27+
28+ return m_transfer->destination();
29+}
30+
31 /*!
32 * \brief ContentTransfer::updateState update the state from the hub transfer object
33 * \internal
34
35=== modified file 'import/Ubuntu/Content/contenttransfer.h'
36--- import/Ubuntu/Content/contenttransfer.h 2014-08-04 17:57:26 +0000
37+++ import/Ubuntu/Content/contenttransfer.h 2014-08-27 13:54:21 +0000
38@@ -42,6 +42,8 @@
39 Q_PROPERTY(QQmlListProperty<ContentItem> items READ items NOTIFY itemsChanged)
40 Q_PROPERTY(QString downloadId READ downloadId WRITE setDownloadId NOTIFY downloadIdChanged)
41 Q_PROPERTY(ContentType::Type contentType READ contentType CONSTANT)
42+ Q_PROPERTY(QString source READ source)
43+ Q_PROPERTY(QString destination READ destination)
44
45 public:
46 enum State {
47@@ -93,6 +95,9 @@
48
49 ContentType::Type contentType() const;
50
51+ QString source();
52+ QString destination();
53+
54 Q_SIGNALS:
55 void stateChanged();
56 void itemsChanged();
57
58=== modified file 'include/com/ubuntu/content/transfer.h'
59--- include/com/ubuntu/content/transfer.h 2014-08-04 17:56:09 +0000
60+++ include/com/ubuntu/content/transfer.h 2014-08-27 13:54:21 +0000
61@@ -62,6 +62,8 @@
62 Q_PROPERTY(Direction direction READ direction)
63 Q_PROPERTY(QString downloadId READ downloadId WRITE setDownloadId NOTIFY downloadIdChanged)
64 Q_PROPERTY(QString contentType READ contentType)
65+ Q_PROPERTY(QString source READ source)
66+ Q_PROPERTY(QString destination READ destination)
67
68 public:
69 enum State
70@@ -111,6 +113,8 @@
71 Q_INVOKABLE virtual bool setDownloadId(const QString);
72 Q_INVOKABLE virtual bool download();
73 Q_INVOKABLE virtual QString contentType() const;
74+ Q_INVOKABLE virtual QString source() const;
75+ Q_INVOKABLE virtual QString destination() const;
76
77 Q_SIGNAL void stateChanged();
78 Q_SIGNAL void storeChanged();
79
80=== modified file 'src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml'
81--- src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml 2014-08-04 17:56:09 +0000
82+++ src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml 2014-08-27 13:54:21 +0000
83@@ -58,5 +58,11 @@
84 <method name="ContentType">
85 <arg name="content_type" type="s" direction="out" />
86 </method>
87+ <method name="source">
88+ <arg name="source" type="s" direction="out" />
89+ </method>
90+ <method name="destination">
91+ <arg name="destination" type="s" direction="out" />
92+ </method>
93 </interface>
94 </node>
95
96=== modified file 'src/com/ubuntu/content/transfer.cpp'
97--- src/com/ubuntu/content/transfer.cpp 2014-08-04 17:56:09 +0000
98+++ src/com/ubuntu/content/transfer.cpp 2014-08-27 13:54:21 +0000
99@@ -126,3 +126,13 @@
100 {
101 return d->contentType();
102 }
103+
104+QString cuc::Transfer::source() const
105+{
106+ return d->source();
107+}
108+
109+QString cuc::Transfer::destination() const
110+{
111+ return d->destination();
112+}
113
114=== modified file 'src/com/ubuntu/content/transfer_p.h'
115--- src/com/ubuntu/content/transfer_p.h 2014-08-04 17:56:09 +0000
116+++ src/com/ubuntu/content/transfer_p.h 2014-08-27 13:54:21 +0000
117@@ -227,6 +227,22 @@
118 return static_cast<QString>(reply.value());
119 }
120
121+ QString source()
122+ {
123+ auto reply = remote_transfer->source();
124+ reply.waitForFinished();
125+
126+ return static_cast<QString>(reply.value());
127+ }
128+
129+ QString destination()
130+ {
131+ auto reply = remote_transfer->destination();
132+ reply.waitForFinished();
133+
134+ return static_cast<QString>(reply.value());
135+ }
136+
137 com::ubuntu::content::dbus::Transfer* remote_transfer;
138 };
139 }

Subscribers

People subscribed via source and target branches