Merge lp:~michael-sheldon/ubuntu-download-manager/expose-download-id into lp:ubuntu-download-manager

Proposed by Michael Sheldon
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 264
Merged at revision: 283
Proposed branch: lp:~michael-sheldon/ubuntu-download-manager/expose-download-id
Merge into: lp:ubuntu-download-manager
Diff against target: 53 lines (+12/-0)
2 files modified
ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.cpp (+9/-0)
ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.h (+3/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-download-manager/expose-download-id
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+212857@code.launchpad.net

Commit message

Expose the download id of a SingleDownload within the QML API.

Description of the change

Exposes the download id of a SingleDownload within the QML API. This then allows the id to be sent as part of a ContentTransfer when integrating with content-hub.

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
Manuel de la Peña (mandel) wrote :

Awesome!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.cpp'
2--- ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.cpp 2014-03-07 13:16:22 +0000
3+++ ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.cpp 2014-03-26 14:31:52 +0000
4@@ -100,6 +100,8 @@
5 connect(m_download, &Download::started, this, &SingleDownload::started);
6 connect(m_download, &Download::started, this, &SingleDownload::setDownloadStarted);
7
8+ emit downloadIdChanged();
9+
10 if (m_manager != nullptr && m_autoStart) {
11 startDownload();
12 }
13@@ -251,5 +253,12 @@
14 True if the file is currently being downloaded.
15 */
16
17+/*!
18+ \qmlproperty string SingleDownload::downloadId
19+
20+ This property provides the unique identifier that represents the download
21+ within the download manager.
22+*/
23+
24 }
25 }
26
27=== modified file 'ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.h'
28--- ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.h 2014-03-07 13:16:22 +0000
29+++ ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/single_download.h 2014-03-26 14:31:52 +0000
30@@ -22,6 +22,7 @@
31 Q_PROPERTY(qulonglong throttle READ throttle WRITE setThrottle NOTIFY throttleChanged)
32 Q_PROPERTY(int progress READ progress NOTIFY progressChanged)
33 Q_PROPERTY(bool downloading READ downloading NOTIFY downloadingChanged)
34+ Q_PROPERTY(QString downloadId READ downloadId NOTIFY downloadIdChanged)
35
36 public:
37 explicit SingleDownload(QObject *parent = 0);
38@@ -44,6 +45,7 @@
39 bool downloading() const { return m_downloading; }
40 bool downloadInProgress() const { return m_downloadInProgress; }
41 bool autoStart() const { return m_autoStart; }
42+ QString downloadId() const { return m_download->id(); }
43
44 // setters
45 void setAllowMobileDownload(bool value) { m_download->allowMobileDownload(value); emit allowMobileDownloadChanged(); }
46@@ -57,6 +59,7 @@
47 void progressChanged();
48 void downloadingChanged();
49 void downloadInProgressChanged();
50+ void downloadIdChanged();
51
52 void canceled(bool success);
53 void finished(const QString& path);

Subscribers

People subscribed via source and target branches