Merge lp:~michael-sheldon/ubuntu-download-manager/persistent-download-model into lp:ubuntu-download-manager
- persistent-download-model
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Scott Sweeny |
Approved revision: | 384 |
Merged at revision: | 341 |
Proposed branch: | lp:~michael-sheldon/ubuntu-download-manager/persistent-download-model |
Merge into: | lp:ubuntu-download-manager |
Diff against target: |
3593 lines (+1547/-515) 70 files modified
.bzrignore (+2/-0) CMakeLists.txt (+1/-1) HACKING (+36/-0) debian/changelog (+16/-0) debian/libubuntu-download-manager-client1.symbols (+0/-153) debian/libubuntu-download-manager-common-dev.install (+1/-0) debian/libubuntu-download-manager-common1.symbols (+0/-34) debian/libubuntu-upload-manager-common1.symbols (+0/-16) debian/libudm-common1.symbols (+0/-155) docs/dbus/com.canonical.applications.download.xml (+11/-0) docs/dbus/com.canonical.applications.download_manager.xml (+8/-0) docs/qml/pages/mainpage.qdoc (+3/-3) docs/qml/pages/moduledef.qdoc (+1/-1) src/common/priv/ubuntu/transfers/queue.cpp (+4/-0) src/common/priv/ubuntu/transfers/transfer.cpp (+7/-0) src/common/priv/ubuntu/transfers/transfer.h (+2/-0) src/common/public/ubuntu/transfers/metadata.cpp (+41/-1) src/common/public/ubuntu/transfers/metadata.h (+6/-1) src/downloads/client/ubuntu/download_manager/download.h (+53/-1) src/downloads/client/ubuntu/download_manager/download_impl.cpp (+66/-2) src/downloads/client/ubuntu/download_manager/download_impl.h (+5/-0) src/downloads/client/ubuntu/download_manager/download_interface.cpp (+1/-1) src/downloads/client/ubuntu/download_manager/download_interface.h (+40/-18) src/downloads/client/ubuntu/download_manager/manager.h (+16/-4) src/downloads/client/ubuntu/download_manager/manager_impl.cpp (+6/-6) src/downloads/client/ubuntu/download_manager/manager_impl.h (+4/-2) src/downloads/client/ubuntu/download_manager/manager_interface.h (+3/-1) src/downloads/common/CMakeLists.txt (+2/-0) src/downloads/common/ubuntu/download_manager/download_state_struct.cpp (+119/-0) src/downloads/common/ubuntu/download_manager/download_state_struct.h (+152/-0) src/downloads/common/ubuntu/download_manager/metatypes.h (+2/-0) src/downloads/priv/CMakeLists.txt (+2/-2) src/downloads/priv/ubuntu/downloads/download.cpp (+1/-1) src/downloads/priv/ubuntu/downloads/download.h (+19/-1) src/downloads/priv/ubuntu/downloads/download_adaptor.cpp (+31/-3) src/downloads/priv/ubuntu/downloads/download_adaptor.h (+17/-3) src/downloads/priv/ubuntu/downloads/download_manager_adaptor.cpp (+11/-3) src/downloads/priv/ubuntu/downloads/download_manager_adaptor.h (+10/-2) src/downloads/priv/ubuntu/downloads/downloads_db.cpp (+105/-0) src/downloads/priv/ubuntu/downloads/downloads_db.h (+9/-2) src/downloads/priv/ubuntu/downloads/factory.cpp (+7/-1) src/downloads/priv/ubuntu/downloads/file_download.cpp (+13/-1) src/downloads/priv/ubuntu/downloads/file_download.h (+3/-4) src/downloads/priv/ubuntu/downloads/group_download.cpp (+7/-0) src/downloads/priv/ubuntu/downloads/group_download.h (+1/-0) src/downloads/priv/ubuntu/downloads/manager.cpp (+80/-12) src/downloads/priv/ubuntu/downloads/manager.h (+13/-6) src/downloads/priv/ubuntu/downloads/state_machines/download_sm.h (+1/-0) src/downloads/qml/CMakeLists.txt (+2/-0) src/downloads/qml/backend.cpp (+4/-0) src/downloads/qml/download_history.cpp (+143/-0) src/downloads/qml/download_history.h (+69/-0) src/downloads/qml/single_download.cpp (+36/-16) src/downloads/qml/single_download.h (+1/-0) src/downloads/qml/ubuntu_download_manager.cpp (+78/-36) src/downloads/qml/ubuntu_download_manager.h (+8/-4) src/downloads/test-daemon/testing_manager.cpp (+2/-2) src/downloads/test-daemon/testing_manager.h (+2/-1) tests/CMakeLists.txt (+1/-0) tests/abi-compliance/CMakeLists.txt (+1/-0) tests/abi-compliance/abi.xml.in (+18/-0) tests/downloads/client/test_client_manager.cpp (+2/-2) tests/downloads/daemon/download.h (+1/-1) tests/downloads/daemon/test_download.cpp (+7/-7) tests/downloads/daemon/test_download_manager.cpp (+55/-1) tests/downloads/daemon/test_downloads_db.cpp (+73/-0) tests/downloads/daemon/test_downloads_db.h (+4/-1) tests/downloads/daemon/test_metadata.cpp (+90/-0) tests/downloads/daemon/test_metadata.h (+10/-1) tests/downloads/qml/manager.h (+2/-2) |
To merge this branch: | bzr merge lp:~michael-sheldon/ubuntu-download-manager/persistent-download-model |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Scott Sweeny (community) | Approve | ||
Ubuntu Phablet Team | Pending | ||
Review via email: mp+275553@code.launchpad.net |
Commit message
Provide a persistent download model available between application restarts.
Description of the change
Provide a persistent download model available between application restarts.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:363
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:364
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:365
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:366
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:367
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:368
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:369
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:370
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:373
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:374
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:376
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 377. By Michael Sheldon
-
Merge add-appid-metadata
- 378. By Michael Sheldon
-
Replace symbols files with abi-compliance-
checker for ABI checks
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:378
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 379. By Michael Sheldon
-
Don't delete internal download objects when they're complete, as wee still need access to them for the overall download model
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:379
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 380. By Michael Sheldon
-
Use getAllDownloads method dbus for retrieving uncollected downloads instead of introducing new API (which wouldn't be available in apparmor profiles until 16.04)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:380
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 381. By Michael Sheldon
-
Remove powerpc symbols
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:381
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 382. By Michael Sheldon
-
Fix transmission of download state information over dbus
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:382
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Scott Sweeny (ssweeny) wrote : | # |
Overall this LGTM. I'd rather be consistent with using #pragma vs #ifndef header guards though, so please revert those changes (or change all the headers if you prefer :) ).
- 383. By Michael Sheldon
-
Default to not showing transfers in the indicator unless explicitly requested by apps
- 384. By Michael Sheldon
-
Use #ifndef header guards instead of '#pragma once' for consistency
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:384
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 385. By Michael Sheldon
-
Default to not showing transfers in the indicator unless explicitly requested by apps
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2013-11-12 12:30:18 +0000 |
3 | +++ .bzrignore 2015-12-16 02:32:33 +0000 |
4 | @@ -12,3 +12,5 @@ |
5 | libubuntudownloadmanager-common/libubuntudownloadmanager-common.so.1 |
6 | libubuntudownloadmanager-common/libubuntudownloadmanager-common.so.1.0 |
7 | libubuntudownloadmanager-common/libubuntudownloadmanager-common.so.1.0.0 |
8 | +.idea |
9 | +build |
10 | |
11 | === modified file 'CMakeLists.txt' |
12 | --- CMakeLists.txt 2015-07-23 14:02:27 +0000 |
13 | +++ CMakeLists.txt 2015-12-16 02:32:33 +0000 |
14 | @@ -31,7 +31,7 @@ |
15 | ) |
16 | |
17 | set(UDM_VERSION_MAJOR 1) |
18 | -set(UDM_VERSION_MINOR 0) |
19 | +set(UDM_VERSION_MINOR 2) |
20 | set(UDM_VERSION_PATCH 0) |
21 | |
22 | find_package(Gtest REQUIRED) |
23 | |
24 | === added file 'HACKING' |
25 | --- HACKING 1970-01-01 00:00:00 +0000 |
26 | +++ HACKING 2015-12-16 02:32:33 +0000 |
27 | @@ -0,0 +1,36 @@ |
28 | +ABI compliance test |
29 | +------------------- |
30 | +To use this, install abi-compliance-checker package from the archives. |
31 | + |
32 | +You can use abi-compliance-checker to test whether a particular build |
33 | +is ABI compatible with another build. The tool does some source-level |
34 | +analysis in addition to checking library symbols, so it catches things |
35 | +that are potentially dangerous, but won't be picked up by just looking |
36 | +at the symbol table. |
37 | + |
38 | +Assume you have built trunk in "devel", and you have a later build |
39 | +in "mybranch" and want to check that "mybranch" is still compatible. |
40 | +To run the compliance test (example directories assume an arm build, |
41 | +change obj-arm-linux-gnueabihf where appropriate for other platforms): |
42 | + |
43 | +$ abi-compliance-checker -lib libubuntu-download-manager-client.so -old devel/obj-arm-linux-gnueabihf/tests/abi-compliance/abi.xml -new mybranch/obj-arm-linux-gnueabihf/tests/abi-compliance/abi.xml |
44 | + |
45 | +This should be run on all the public UDM libraries: |
46 | +libubuntu-download-manager-client.so |
47 | +libubuntu-download-manager-common.so |
48 | +libubuntu-upload-manager-common.so |
49 | +libudm-common.so |
50 | + |
51 | +You will get a message about compilation errors. These are caused by a Qt macro and |
52 | +can be ignored. (The log file in src/logs/libubuntu-download-manager-client.so/[version]/log.txt |
53 | +contains the details.) |
54 | + |
55 | +Now point your browser at |
56 | + |
57 | +compat_reports/libubuntu-download-manager-client.so/[version]_to_[version]/compat_report.html |
58 | + |
59 | +The report provides a nicely laid out page with all the details. |
60 | + |
61 | +If ABI changes are detected (and are intended) then the version number |
62 | +should be incremented, and when landing all packages that rdepend on |
63 | +UDM should be rebuilt. |
64 | |
65 | === modified file 'debian/changelog' |
66 | --- debian/changelog 2015-07-24 16:44:28 +0000 |
67 | +++ debian/changelog 2015-12-16 02:32:33 +0000 |
68 | @@ -1,3 +1,19 @@ |
69 | +ubuntu-download-manager (1.2) UNRELEASED; urgency=medium |
70 | + |
71 | + * Provide a shared download history for the downloads model that presents |
72 | + all uncollected downloads from previous app launches. |
73 | + * Update symbol files |
74 | + |
75 | + -- Michael Sheldon <michael.sheldon@canonical.com> Wed, 21 Oct 2015 10:03:21 +0100 |
76 | + |
77 | +ubuntu-download-manager (1.1) UNRELEASED; urgency=medium |
78 | + |
79 | + * Ensure that the app id of the application that created the download is |
80 | + present in the metadata and can be accessed via dbus. |
81 | + * Update the symbol files. |
82 | + |
83 | + -- Manuel de la Pena <manuel.delapena@canonical.com> Tue, 01 Sep 2015 17:07:58 +0100 |
84 | + |
85 | ubuntu-download-manager (1.0+15.10.20150724-0ubuntu1) wily; urgency=medium |
86 | |
87 | [ Manuel de la Pena ] |
88 | |
89 | === removed file 'debian/libubuntu-download-manager-client1.symbols' |
90 | --- debian/libubuntu-download-manager-client1.symbols 2015-07-24 16:44:28 +0000 |
91 | +++ debian/libubuntu-download-manager-client1.symbols 1970-01-01 00:00:00 +0000 |
92 | @@ -1,153 +0,0 @@ |
93 | -libubuntu-download-manager-client.so.1 libubuntu-download-manager-client1 #MINVER# |
94 | - (c++)"Ubuntu::DownloadManager::NetworkError::errorString()@Base" 0.4+14.10.20140618 |
95 | - (c++)"Ubuntu::DownloadManager::NetworkError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
96 | - (c++)"Ubuntu::DownloadManager::NetworkError::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
97 | - (c++)"Ubuntu::DownloadManager::NetworkError::staticMetaObject@Base" 0.4+14.10.20140618 |
98 | - (c++)"Ubuntu::DownloadManager::NetworkError::code()@Base" 0.4+14.10.20140618 |
99 | - (c++)"Ubuntu::DownloadManager::NetworkError::phrase()@Base" 0.4+14.10.20140618 |
100 | - (c++)"Ubuntu::DownloadManager::NetworkError::NetworkError(Ubuntu::Transfers::Errors::NetworkErrorStruct, QObject*)@Base" 0.4+14.10.20140618 |
101 | - (c++)"Ubuntu::DownloadManager::NetworkError::~NetworkError()@Base" 0.4+14.10.20140618 |
102 | - (c++)"Ubuntu::DownloadManager::ProcessError::errorString()@Base" 0.4+14.10.20140618 |
103 | - (c++)"Ubuntu::DownloadManager::ProcessError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
104 | - (c++)"Ubuntu::DownloadManager::ProcessError::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
105 | - (c++)"Ubuntu::DownloadManager::ProcessError::standardOut()@Base" 0.4+14.10.20140618 |
106 | - (c++)"Ubuntu::DownloadManager::ProcessError::standardError()@Base" 0.4+14.10.20140618 |
107 | - (c++)"Ubuntu::DownloadManager::ProcessError::staticMetaObject@Base" 0.4+14.10.20140618 |
108 | - (c++)"Ubuntu::DownloadManager::ProcessError::code()@Base" 0.4+14.10.20140618 |
109 | - (c++)"Ubuntu::DownloadManager::ProcessError::phrase()@Base" 0.4+14.10.20140618 |
110 | - (c++)"Ubuntu::DownloadManager::ProcessError::exitCode()@Base" 0.4+14.10.20140618 |
111 | - (c++)"Ubuntu::DownloadManager::ProcessError::ProcessError(Ubuntu::Transfers::Errors::ProcessErrorStruct, QObject*)@Base" 0.4+14.10.20140618 |
112 | - (c++)"Ubuntu::DownloadManager::ProcessError::~ProcessError()@Base" 0.4+14.10.20140618 |
113 | - (c++)"Ubuntu::DownloadManager::Logging::Logger::init(Ubuntu::DownloadManager::Logging::Logger::Level, QString const&)@Base" 0.6+14.10.20140707 |
114 | - (c++)"Ubuntu::DownloadManager::DownloadsList::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
115 | - (c++)"Ubuntu::DownloadManager::DownloadsList::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
116 | - (c++)"Ubuntu::DownloadManager::DownloadsList::staticMetaObject@Base" 0.4+14.10.20140618 |
117 | - (c++)"Ubuntu::DownloadManager::GroupDownload::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
118 | - (c++)"Ubuntu::DownloadManager::GroupDownload::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
119 | - (c++)"Ubuntu::DownloadManager::GroupDownload::staticMetaObject@Base" 0.4+14.10.20140618 |
120 | - (c++)"Ubuntu::DownloadManager::GroupDownload::error()@Base" 0.4+14.10.20140618 |
121 | - (c++)"Ubuntu::DownloadManager::GroupDownload::isError()@Base" 0.4+14.10.20140618 |
122 | - (c++)"Ubuntu::DownloadManager::GroupDownload::GroupDownload(QDBusObjectPath, QObject*)@Base" 0.4+14.10.20140618 |
123 | - (c++)"Ubuntu::DownloadManager::GroupDownload::GroupDownload(Ubuntu::DownloadManager::Error*, QObject*)@Base" 0.4+14.10.20140618 |
124 | - (c++)"Ubuntu::DownloadManager::GroupDownload::~GroupDownload()@Base" 0.4+14.10.20140618 |
125 | - (c++)"Ubuntu::DownloadManager::Error::errorString()@Base" 0.4+14.10.20140618 |
126 | - (c++)"Ubuntu::DownloadManager::Error::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
127 | - (c++)"Ubuntu::DownloadManager::Error::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
128 | - (c++)"Ubuntu::DownloadManager::Error::staticMetaObject@Base" 0.4+14.10.20140618 |
129 | - (c++)"Ubuntu::DownloadManager::Error::type()@Base" 0.4+14.10.20140618 |
130 | - (c++)"Ubuntu::DownloadManager::Error::Error(Ubuntu::DownloadManager::Error::Type, QObject*)@Base" 0.4+14.10.20140618 |
131 | - (c++)"Ubuntu::DownloadManager::Error::~Error()@Base" 0.4+14.10.20140618 |
132 | - (c++)"Ubuntu::DownloadManager::Manager::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
133 | - (c++)"Ubuntu::DownloadManager::Manager::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
134 | - (c++)"Ubuntu::DownloadManager::Manager::groupCreated(Ubuntu::DownloadManager::GroupDownload*)@Base" 0.4+14.10.20140618 |
135 | - (c++)"Ubuntu::DownloadManager::Manager::downloadsFound(Ubuntu::DownloadManager::DownloadsList*)@Base" 0.4+14.10.20140618 |
136 | - (c++)"Ubuntu::DownloadManager::Manager::downloadCreated(Ubuntu::DownloadManager::Download*)@Base" 0.4+14.10.20140618 |
137 | - (c++)"Ubuntu::DownloadManager::Manager::staticMetaObject@Base" 0.4+14.10.20140618 |
138 | - (c++)"Ubuntu::DownloadManager::Manager::createSystemManager(QString const&, QObject*)@Base" 0.4+14.10.20140618 |
139 | - (c++)"Ubuntu::DownloadManager::Manager::createSessionManager(QString const&, QObject*)@Base" 0.4+14.10.20140618 |
140 | - (c++)"Ubuntu::DownloadManager::Manager::downloadsWithMetadataFound(QString const&, QString const&, Ubuntu::DownloadManager::DownloadsList*)@Base" 0.4+14.10.20140618 |
141 | - (c++)"Ubuntu::DownloadManager::Download::processing(QString const&)@Base" 0.4+14.10.20140618 |
142 | - (c++)"Ubuntu::DownloadManager::Download::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
143 | - (c++)"Ubuntu::DownloadManager::Download::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
144 | - (c++)"Ubuntu::DownloadManager::Download::staticMetaObject@Base" 0.4+14.10.20140618 |
145 | - (c++)"Ubuntu::DownloadManager::Download::error(Ubuntu::DownloadManager::Error*)@Base" 0.4+14.10.20140618 |
146 | - (c++)"Ubuntu::DownloadManager::Download::paused(bool)@Base" 0.4+14.10.20140618 |
147 | - (c++)"Ubuntu::DownloadManager::Download::resumed(bool)@Base" 0.4+14.10.20140618 |
148 | - (c++)"Ubuntu::DownloadManager::Download::started(bool)@Base" 0.4+14.10.20140618 |
149 | - (c++)"Ubuntu::DownloadManager::Download::canceled(bool)@Base" 0.4+14.10.20140618 |
150 | - (c++)"Ubuntu::DownloadManager::Download::finished(QString const&)@Base" 0.4+14.10.20140618 |
151 | - (c++)"Ubuntu::DownloadManager::Download::progress(unsigned long long, unsigned long long)@Base" 0.4+14.10.20140618 |
152 | - (c++)"Ubuntu::DownloadManager::Download::titleChanged()@Base" 0.9+14.10.20141014.1 |
153 | - (c++)"Ubuntu::DownloadManager::Download::clickPackagedChanged()@Base" 0.9+14.10.20141014.1 |
154 | - (c++)"Ubuntu::DownloadManager::Download::showInIndicatorChanged()@Base" 0.9+14.10.20141014.1 |
155 | - (c++)"Ubuntu::DownloadManager::AuthError::errorString()@Base" 0.4+14.10.20140618 |
156 | - (c++)"Ubuntu::DownloadManager::AuthError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
157 | - (c++)"Ubuntu::DownloadManager::AuthError::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
158 | - (c++)"Ubuntu::DownloadManager::AuthError::staticMetaObject@Base" 0.4+14.10.20140618 |
159 | - (c++)"Ubuntu::DownloadManager::AuthError::type()@Base" 0.4+14.10.20140618 |
160 | - (c++)"Ubuntu::DownloadManager::AuthError::phrase()@Base" 0.4+14.10.20140618 |
161 | - (c++)"Ubuntu::DownloadManager::AuthError::AuthError(Ubuntu::Transfers::Errors::AuthErrorStruct, QObject*)@Base" 0.4+14.10.20140618 |
162 | - (c++)"Ubuntu::DownloadManager::AuthError::~AuthError()@Base" 0.4+14.10.20140618 |
163 | - (c++)"Ubuntu::DownloadManager::DBusError::errorString()@Base" 0.4+14.10.20140618 |
164 | - (c++)"Ubuntu::DownloadManager::DBusError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
165 | - (c++)"Ubuntu::DownloadManager::DBusError::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
166 | - (c++)"Ubuntu::DownloadManager::DBusError::staticMetaObject@Base" 0.4+14.10.20140618 |
167 | - (c++)"Ubuntu::DownloadManager::DBusError::name()@Base" 0.4+14.10.20140618 |
168 | - (c++)"Ubuntu::DownloadManager::DBusError::message()@Base" 0.4+14.10.20140618 |
169 | - (c++)"Ubuntu::DownloadManager::DBusError::DBusError(QDBusError, QObject*)@Base" 0.4+14.10.20140618 |
170 | - (c++)"Ubuntu::DownloadManager::DBusError::~DBusError()@Base" 0.4+14.10.20140618 |
171 | - (c++)"Ubuntu::DownloadManager::HttpError::errorString()@Base" 0.4+14.10.20140618 |
172 | - (c++)"Ubuntu::DownloadManager::HttpError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
173 | - (c++)"Ubuntu::DownloadManager::HttpError::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
174 | - (c++)"Ubuntu::DownloadManager::HttpError::staticMetaObject@Base" 0.4+14.10.20140618 |
175 | - (c++)"Ubuntu::DownloadManager::HttpError::code()@Base" 0.4+14.10.20140618 |
176 | - (c++)"Ubuntu::DownloadManager::HttpError::phrase()@Base" 0.4+14.10.20140618 |
177 | - (c++)"Ubuntu::DownloadManager::HttpError::HttpError(Ubuntu::Transfers::Errors::HttpErrorStruct, QObject*)@Base" 0.4+14.10.20140618 |
178 | - (c++)"Ubuntu::DownloadManager::HttpError::~HttpError()@Base" 0.4+14.10.20140618 |
179 | - (c++)"Ubuntu::DownloadManager::NetworkError::metaObject() const@Base" 0.4+14.10.20140618 |
180 | - (c++)"Ubuntu::DownloadManager::ProcessError::metaObject() const@Base" 0.4+14.10.20140618 |
181 | - (c++)"Ubuntu::DownloadManager::DownloadsList::metaObject() const@Base" 0.4+14.10.20140618 |
182 | - (c++)"Ubuntu::DownloadManager::GroupDownload::metaObject() const@Base" 0.4+14.10.20140618 |
183 | - (c++)"Ubuntu::DownloadManager::Error::metaObject() const@Base" 0.4+14.10.20140618 |
184 | - (c++)"Ubuntu::DownloadManager::Manager::metaObject() const@Base" 0.4+14.10.20140618 |
185 | - (c++)"Ubuntu::DownloadManager::Download::metaObject() const@Base" 0.4+14.10.20140618 |
186 | - (c++)"Ubuntu::DownloadManager::AuthError::metaObject() const@Base" 0.4+14.10.20140618 |
187 | - (c++)"Ubuntu::DownloadManager::DBusError::metaObject() const@Base" 0.4+14.10.20140618 |
188 | - (c++)"Ubuntu::DownloadManager::HttpError::metaObject() const@Base" 0.4+14.10.20140618 |
189 | - (c++)"std::function<void (Ubuntu::DownloadManager::DownloadsList*)>::operator()(Ubuntu::DownloadManager::DownloadsList*) const@Base" 0.4+14.10.20140618 |
190 | - (c++)"std::function<void (Ubuntu::DownloadManager::GroupDownload*)>::operator()(Ubuntu::DownloadManager::GroupDownload*) const@Base" 0.4+14.10.20140618 |
191 | - (c++)"std::function<void (Ubuntu::DownloadManager::Download*)>::operator()(Ubuntu::DownloadManager::Download*) const@Base" 0.4+14.10.20140618 |
192 | - (c++)"std::function<void (Ubuntu::DownloadManager::DownloadsList*)>::function(std::function<void (Ubuntu::DownloadManager::DownloadsList*)> const&)@Base" 0.4+14.10.20140618 |
193 | - (c++)"std::function<void (Ubuntu::DownloadManager::DownloadsList*)>::function(std::function<void (Ubuntu::DownloadManager::DownloadsList*)> const&)@Base" 0.4+14.10.20140618 |
194 | - (c++)"std::function<void (Ubuntu::DownloadManager::GroupDownload*)>::function(std::function<void (Ubuntu::DownloadManager::GroupDownload*)> const&)@Base" 0.4+14.10.20140618 |
195 | - (c++)"std::function<void (Ubuntu::DownloadManager::GroupDownload*)>::function(std::function<void (Ubuntu::DownloadManager::GroupDownload*)> const&)@Base" 0.4+14.10.20140618 |
196 | - (c++)"std::function<void (Ubuntu::DownloadManager::Download*)>::function(std::function<void (Ubuntu::DownloadManager::Download*)> const&)@Base" 0.4+14.10.20140618 |
197 | - (c++)"std::function<void (Ubuntu::DownloadManager::Download*)>::function(std::function<void (Ubuntu::DownloadManager::Download*)> const&)@Base" 0.4+14.10.20140618 |
198 | - (c++)"std::function<void (QString const&, QString const&, Ubuntu::DownloadManager::DownloadsList*)>::function(std::function<void (QString const&, QString const&, Ubuntu::DownloadManager::DownloadsList*)> const&)@Base" 0.4+14.10.20140618 |
199 | - (c++)"std::function<void (QString const&, QString const&, Ubuntu::DownloadManager::DownloadsList*)>::function(std::function<void (QString const&, QString const&, Ubuntu::DownloadManager::DownloadsList*)> const&)@Base" 0.4+14.10.20140618 |
200 | - (c++)"typeinfo for Ubuntu::DownloadManager::NetworkError@Base" 0.4+14.10.20140618 |
201 | - (c++)"typeinfo for Ubuntu::DownloadManager::ProcessError@Base" 0.4+14.10.20140618 |
202 | - (c++)"typeinfo for Ubuntu::DownloadManager::DownloadsList@Base" 0.4+14.10.20140618 |
203 | - (c++)"typeinfo for Ubuntu::DownloadManager::GroupDownload@Base" 0.4+14.10.20140618 |
204 | - (c++)"typeinfo for Ubuntu::DownloadManager::Error@Base" 0.4+14.10.20140618 |
205 | - (c++)"typeinfo for Ubuntu::DownloadManager::Manager@Base" 0.4+14.10.20140618 |
206 | - (c++)"typeinfo for Ubuntu::DownloadManager::Download@Base" 0.4+14.10.20140618 |
207 | - (c++)"typeinfo for Ubuntu::DownloadManager::AuthError@Base" 0.4+14.10.20140618 |
208 | - (c++)"typeinfo for Ubuntu::DownloadManager::DBusError@Base" 0.4+14.10.20140618 |
209 | - (c++)"typeinfo for Ubuntu::DownloadManager::HttpError@Base" 0.4+14.10.20140618 |
210 | - (c++)"typeinfo name for Ubuntu::DownloadManager::NetworkError@Base" 0.4+14.10.20140618 |
211 | - (c++)"typeinfo name for Ubuntu::DownloadManager::ProcessError@Base" 0.4+14.10.20140618 |
212 | - (c++)"typeinfo name for Ubuntu::DownloadManager::DownloadsList@Base" 0.4+14.10.20140618 |
213 | - (c++)"typeinfo name for Ubuntu::DownloadManager::GroupDownload@Base" 0.4+14.10.20140618 |
214 | - (c++)"typeinfo name for Ubuntu::DownloadManager::Error@Base" 0.4+14.10.20140618 |
215 | - (c++)"typeinfo name for Ubuntu::DownloadManager::Manager@Base" 0.4+14.10.20140618 |
216 | - (c++)"typeinfo name for Ubuntu::DownloadManager::Download@Base" 0.4+14.10.20140618 |
217 | - (c++)"typeinfo name for Ubuntu::DownloadManager::AuthError@Base" 0.4+14.10.20140618 |
218 | - (c++)"typeinfo name for Ubuntu::DownloadManager::DBusError@Base" 0.4+14.10.20140618 |
219 | - (c++)"typeinfo name for Ubuntu::DownloadManager::HttpError@Base" 0.4+14.10.20140618 |
220 | - (c++)"vtable for Ubuntu::DownloadManager::NetworkError@Base" 0.4+14.10.20140618 |
221 | - (c++)"vtable for Ubuntu::DownloadManager::ProcessError@Base" 0.4+14.10.20140618 |
222 | - (c++)"vtable for Ubuntu::DownloadManager::DownloadsList@Base" 0.4+14.10.20140618 |
223 | - (c++)"vtable for Ubuntu::DownloadManager::GroupDownload@Base" 0.4+14.10.20140618 |
224 | - (c++)"vtable for Ubuntu::DownloadManager::Error@Base" 0.4+14.10.20140618 |
225 | - (c++)"vtable for Ubuntu::DownloadManager::Manager@Base" 0.4+14.10.20140618 |
226 | - (c++)"vtable for Ubuntu::DownloadManager::Download@Base" 0.4+14.10.20140618 |
227 | - (c++)"vtable for Ubuntu::DownloadManager::AuthError@Base" 0.4+14.10.20140618 |
228 | - (c++)"vtable for Ubuntu::DownloadManager::DBusError@Base" 0.4+14.10.20140618 |
229 | - (c++)"vtable for Ubuntu::DownloadManager::HttpError@Base" 0.4+14.10.20140618 |
230 | - (c++)"Ubuntu::DownloadManager::HashError::errorString()@Base" 1.0+15.10.20150724 |
231 | - (c++)"Ubuntu::DownloadManager::HashError::qt_metacall(QMetaObject::Call, int, void**)@Base" 1.0+15.10.20150724 |
232 | - (c++)"Ubuntu::DownloadManager::HashError::qt_metacast(char const*)@Base" 1.0+15.10.20150724 |
233 | - (c++)"Ubuntu::DownloadManager::HashError::staticMetaObject@Base" 1.0+15.10.20150724 |
234 | - (c++)"Ubuntu::DownloadManager::HashError::method()@Base" 1.0+15.10.20150724 |
235 | - (c++)"Ubuntu::DownloadManager::HashError::checksum()@Base" 1.0+15.10.20150724 |
236 | - (c++)"Ubuntu::DownloadManager::HashError::expected()@Base" 1.0+15.10.20150724 |
237 | - (c++)"Ubuntu::DownloadManager::HashError::HashError(Ubuntu::Transfers::Errors::HashErrorStruct, QObject*)@Base" 1.0+15.10.20150724 |
238 | - (c++)"Ubuntu::DownloadManager::HashError::HashError(Ubuntu::Transfers::Errors::HashErrorStruct, QObject*)@Base" 1.0+15.10.20150724 |
239 | - (c++)"Ubuntu::DownloadManager::HashError::~HashError()@Base" 1.0+15.10.20150724 |
240 | - (c++)"Ubuntu::DownloadManager::HashError::~HashError()@Base" 1.0+15.10.20150724 |
241 | - (c++)"Ubuntu::DownloadManager::HashError::~HashError()@Base" 1.0+15.10.20150724 |
242 | - (c++)"Ubuntu::DownloadManager::HashError::metaObject() const@Base" 1.0+15.10.20150724 |
243 | - (c++)"typeinfo for Ubuntu::DownloadManager::HashError@Base" 1.0+15.10.20150724 |
244 | - (c++)"typeinfo name for Ubuntu::DownloadManager::HashError@Base" 1.0+15.10.20150724 |
245 | - (c++)"vtable for Ubuntu::DownloadManager::HashError@Base" 1.0+15.10.20150724 |
246 | |
247 | === modified file 'debian/libubuntu-download-manager-common-dev.install' |
248 | --- debian/libubuntu-download-manager-common-dev.install 2014-06-06 10:05:15 +0000 |
249 | +++ debian/libubuntu-download-manager-common-dev.install 2015-12-16 02:32:33 +0000 |
250 | @@ -1,4 +1,5 @@ |
251 | usr/include/ubuntu/download_manager/metatypes.h |
252 | +usr/include/ubuntu/download_manager/download_state_struct.h |
253 | usr/include/ubuntu/download_manager/download_struct.h |
254 | usr/include/ubuntu/download_manager/group_download_struct.h |
255 | usr/lib/*/pkgconfig/ubuntu-download-manager-common.pc |
256 | |
257 | === removed file 'debian/libubuntu-download-manager-common1.symbols' |
258 | --- debian/libubuntu-download-manager-common1.symbols 2015-07-23 14:02:27 +0000 |
259 | +++ debian/libubuntu-download-manager-common1.symbols 1970-01-01 00:00:00 +0000 |
260 | @@ -1,34 +0,0 @@ |
261 | -libubuntu-download-manager-common.so.1 libubuntu-download-manager-common1 #MINVER# |
262 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::getHeaders()@Base" 0.4+14.10.20140618 |
263 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::getMetadata()@Base" 0.4+14.10.20140618 |
264 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::getAlgorithm()@Base" 0.4+14.10.20140618 |
265 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::getUrl()@Base" 0.4+14.10.20140618 |
266 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::getHash()@Base" 0.4+14.10.20140618 |
267 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(QString const&)@Base" 0.4+14.10.20140618 |
268 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(QString const&, QMap<QString, QVariant> const&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
269 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(QString const&, QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
270 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(Ubuntu::DownloadManager::DownloadStruct const&)@Base" 0.4+14.10.20140618 |
271 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct()@Base" 0.4+14.10.20140618 |
272 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(QString const&)@Base" 0.4+14.10.20140618 |
273 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(QString const&, QMap<QString, QVariant> const&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
274 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(QString const&, QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
275 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct(Ubuntu::DownloadManager::DownloadStruct const&)@Base" 0.4+14.10.20140618 |
276 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::DownloadStruct()@Base" 0.4+14.10.20140618 |
277 | - (c++)"Ubuntu::DownloadManager::DownloadStruct::operator=(Ubuntu::DownloadManager::DownloadStruct const&)@Base" 0.4+14.10.20140618 |
278 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::GroupDownloadStruct(QString const&, QString const&, QString const&)@Base" 0.4+14.10.20140618 |
279 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::GroupDownloadStruct(Ubuntu::DownloadManager::GroupDownloadStruct const&)@Base" 0.4+14.10.20140618 |
280 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::GroupDownloadStruct()@Base" 0.4+14.10.20140618 |
281 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::GroupDownloadStruct(QString const&, QString const&, QString const&)@Base" 0.4+14.10.20140618 |
282 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::GroupDownloadStruct(Ubuntu::DownloadManager::GroupDownloadStruct const&)@Base" 0.4+14.10.20140618 |
283 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::GroupDownloadStruct()@Base" 0.4+14.10.20140618 |
284 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::~GroupDownloadStruct()@Base" 0.4+14.10.20140618 |
285 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::~GroupDownloadStruct()@Base" 0.4+14.10.20140618 |
286 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::operator=(Ubuntu::DownloadManager::GroupDownloadStruct const&)@Base" 0.4+14.10.20140618 |
287 | - (c++)"Ubuntu::DownloadManager::operator<<(QDBusArgument&, Ubuntu::DownloadManager::DownloadStruct const&)@Base" 0.4+14.10.20140618 |
288 | - (c++)"Ubuntu::DownloadManager::operator<<(QDBusArgument&, Ubuntu::DownloadManager::GroupDownloadStruct const&)@Base" 0.4+14.10.20140618 |
289 | - (c++)"Ubuntu::DownloadManager::operator>>(QDBusArgument const&, Ubuntu::DownloadManager::DownloadStruct&)@Base" 0.4+14.10.20140618 |
290 | - (c++)"Ubuntu::DownloadManager::operator>>(QDBusArgument const&, Ubuntu::DownloadManager::GroupDownloadStruct&)@Base" 0.4+14.10.20140618 |
291 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::getLocalFile() const@Base" 0.4+14.10.20140618 |
292 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::getUrl() const@Base" 0.4+14.10.20140618 |
293 | - (c++)"Ubuntu::DownloadManager::GroupDownloadStruct::getHash() const@Base" 0.4+14.10.20140618 |
294 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QList<Ubuntu::DownloadManager::GroupDownloadStruct>)@Base" 0.4+14.10.20140618 |
295 | |
296 | === removed file 'debian/libubuntu-upload-manager-common1.symbols' |
297 | --- debian/libubuntu-upload-manager-common1.symbols 2015-07-23 14:02:27 +0000 |
298 | +++ debian/libubuntu-upload-manager-common1.symbols 1970-01-01 00:00:00 +0000 |
299 | @@ -1,16 +0,0 @@ |
300 | -libubuntu-upload-manager-common.so.1 libubuntu-upload-manager-common1 #MINVER# |
301 | - (c++)"Ubuntu::UploadManager::UploadStruct::getHeaders()@Base" 0.4+14.10.20140618 |
302 | - (c++)"Ubuntu::UploadManager::UploadStruct::getFilePath()@Base" 0.4+14.10.20140618 |
303 | - (c++)"Ubuntu::UploadManager::UploadStruct::getMetadata()@Base" 0.4+14.10.20140618 |
304 | - (c++)"Ubuntu::UploadManager::UploadStruct::getUrl()@Base" 0.4+14.10.20140618 |
305 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct(QString const&, QString const&)@Base" 0.4+14.10.20140618 |
306 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct(QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
307 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct(Ubuntu::UploadManager::UploadStruct const&)@Base" 0.4+14.10.20140618 |
308 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct()@Base" 0.4+14.10.20140618 |
309 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct(QString const&, QString const&)@Base" 0.4+14.10.20140618 |
310 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct(QString const&, QString const&, QMap<QString, QVariant> const&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
311 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct(Ubuntu::UploadManager::UploadStruct const&)@Base" 0.4+14.10.20140618 |
312 | - (c++)"Ubuntu::UploadManager::UploadStruct::UploadStruct()@Base" 0.4+14.10.20140618 |
313 | - (c++)"Ubuntu::UploadManager::UploadStruct::operator=(Ubuntu::UploadManager::UploadStruct const&)@Base" 0.4+14.10.20140618 |
314 | - (c++)"Ubuntu::UploadManager::operator<<(QDBusArgument&, Ubuntu::UploadManager::UploadStruct const&)@Base" 0.4+14.10.20140618 |
315 | - (c++)"Ubuntu::UploadManager::operator>>(QDBusArgument const&, Ubuntu::UploadManager::UploadStruct&)@Base" 0.4+14.10.20140618 |
316 | |
317 | === removed file 'debian/libudm-common1.symbols' |
318 | --- debian/libudm-common1.symbols 2015-07-24 16:44:28 +0000 |
319 | +++ debian/libudm-common1.symbols 1970-01-01 00:00:00 +0000 |
320 | @@ -1,155 +0,0 @@ |
321 | -libudm-common.so.1 libudm-common1 #MINVER# |
322 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618 |
323 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct()@Base" 0.4+14.10.20140618 |
324 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618 |
325 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct()@Base" 0.4+14.10.20140618 |
326 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::operator=(Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618 |
327 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618 |
328 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct()@Base" 0.4+14.10.20140618 |
329 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618 |
330 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct()@Base" 0.4+14.10.20140618 |
331 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::operator=(Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618 |
332 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618 |
333 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int)@Base" 0.4+14.10.20140618 |
334 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct()@Base" 0.4+14.10.20140618 |
335 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618 |
336 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int)@Base" 0.4+14.10.20140618 |
337 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct()@Base" 0.4+14.10.20140618 |
338 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::operator=(Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618 |
339 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618 |
340 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct()@Base" 0.4+14.10.20140618 |
341 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618 |
342 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct()@Base" 0.4+14.10.20140618 |
343 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::operator=(Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618 |
344 | - (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618 |
345 | - (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618 |
346 | - (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618 |
347 | - (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618 |
348 | - (c++)"Ubuntu::Transfers::Errors::operator>>(QDBusArgument const&, Ubuntu::Transfers::Errors::AuthErrorStruct&)@Base" 0.4+14.10.20140618 |
349 | - (c++)"Ubuntu::Transfers::Errors::operator>>(QDBusArgument const&, Ubuntu::Transfers::Errors::HttpErrorStruct&)@Base" 0.4+14.10.20140618 |
350 | - (c++)"Ubuntu::Transfers::Errors::operator>>(QDBusArgument const&, Ubuntu::Transfers::Errors::NetworkErrorStruct&)@Base" 0.4+14.10.20140618 |
351 | - (c++)"Ubuntu::Transfers::Errors::operator>>(QDBusArgument const&, Ubuntu::Transfers::Errors::ProcessErrorStruct&)@Base" 0.4+14.10.20140618 |
352 | - (c++)"Ubuntu::Transfers::System::HashAlgorithm::getHashAlgo(QCryptographicHash::Algorithm)@Base" 0.4+14.10.20140618 |
353 | - (c++)"Ubuntu::Transfers::System::HashAlgorithm::getHashAlgo(QString const&)@Base" 0.4+14.10.20140618 |
354 | - (c++)"Ubuntu::Transfers::System::HashAlgorithm::isValidAlgo(QString const&)@Base" 0.4+14.10.20140618 |
355 | - (c++)"Ubuntu::Transfers::System::HashAlgorithm::algoList@Base" 0.4+14.10.20140618 |
356 | - (c++)"Ubuntu::Transfers::System::DBusConnection::connection()@Base" 0.4+14.10.20140618 |
357 | - (c++)"Ubuntu::Transfers::System::DBusConnection::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
358 | - (c++)"Ubuntu::Transfers::System::DBusConnection::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
359 | - (c++)"Ubuntu::Transfers::System::DBusConnection::registerObject(QString const&, QObject*, QFlags<QDBusConnection::RegisterOption>)@Base" 0.4+14.10.20140618 |
360 | - (c++)"Ubuntu::Transfers::System::DBusConnection::registerService(QString const&)@Base" 0.4+14.10.20140618 |
361 | - (c++)"Ubuntu::Transfers::System::DBusConnection::staticMetaObject@Base" 0.4+14.10.20140618 |
362 | - (c++)"Ubuntu::Transfers::System::DBusConnection::unregisterObject(QString const&, QDBusConnection::UnregisterMode)@Base" 0.4+14.10.20140618 |
363 | - (c++)"Ubuntu::Transfers::System::DBusConnection::unregisterService(QString const&)@Base" 0.4+14.10.20140618 |
364 | - (c++)"Ubuntu::Transfers::System::DBusConnection::DBusConnection(QDBusConnection, QObject*)@Base" 0.4+14.10.20140618 |
365 | - (c++)"Ubuntu::Transfers::System::DBusConnection::DBusConnection(QObject*)@Base" 0.4+14.10.20140618 |
366 | - (c++)"Ubuntu::Transfers::System::DBusConnection::DBusConnection(QDBusConnection, QObject*)@Base" 0.4+14.10.20140618 |
367 | - (c++)"Ubuntu::Transfers::System::DBusConnection::DBusConnection(QObject*)@Base" 0.4+14.10.20140618 |
368 | - (c++)"Ubuntu::Transfers::System::DBusConnection::~DBusConnection()@Base" 0.4+14.10.20140618 |
369 | - (c++)"Ubuntu::Transfers::System::DBusConnection::setInstance(Ubuntu::Transfers::System::DBusConnection*)@Base" 0.9+14.10.20141014.1 |
370 | - (c++)"Ubuntu::Transfers::System::DBusConnection::deleteInstance()@Base" 0.9+14.10.20141014.1 |
371 | - (c++)"Ubuntu::Transfers::System::DBusConnection::_mutex@Base" 0.9+14.10.20141014.1 |
372 | - (c++)"Ubuntu::Transfers::System::DBusConnection::instance(QDBusConnection)@Base" 0.9+14.10.20141014.1 |
373 | - (c++)"Ubuntu::Transfers::System::DBusConnection::instance()@Base" 0.9+14.10.20141014.1 |
374 | - (c++)"Ubuntu::Transfers::System::DBusConnection::_instance@Base" 0.9+14.10.20141014.1 |
375 | - (c++)"Ubuntu::Transfers::System::DBusConnection::send(QDBusMessage const&) const@Base" 0.9+14.10.20141014.1 |
376 | - (c++)"Ubuntu::Transfers::System::Logger::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618 |
377 | - (c++)"Ubuntu::Transfers::System::Logger::qt_metacast(char const*)@Base" 0.4+14.10.20140618 |
378 | - (c++)"Ubuntu::Transfers::System::Logger::setLogLevel(QtMsgType)@Base" 0.4+14.10.20140618 |
379 | - (c++)"Ubuntu::Transfers::System::Logger::toStdString(QString const&)@Base" 0.4+14.10.20140618 |
380 | - (c++)"Ubuntu::Transfers::System::Logger::setupLogging(QString)@Base" 0.4+14.10.20140618 |
381 | - (c++)"Ubuntu::Transfers::System::Logger::staticMetaObject@Base" 0.4+14.10.20140618 |
382 | - (c++)"Ubuntu::Transfers::System::Logger::getLogDir()@Base" 0.4+14.10.20140618 |
383 | - (c++)"Ubuntu::Transfers::System::Logger::~Logger()@Base" 0.4+14.10.20140618 |
384 | - (c++)"Ubuntu::Transfers::System::Logger::~Logger()@Base" 0.4+14.10.20140618 |
385 | - (c++)"Ubuntu::Transfers::System::Logger::~Logger()@Base" 0.4+14.10.20140618 |
386 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct::Type, QString const&)@Base" 1.0+15.10.20150724 |
387 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
388 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct::Type, QString const&)@Base" 1.0+15.10.20150724 |
389 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
390 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(QString const&, QString const&, QString const&)@Base" 1.0+15.10.20150724 |
391 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 1.0+15.10.20150724 |
392 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct()@Base" 1.0+15.10.20150724 |
393 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(QString const&, QString const&, QString const&)@Base" 1.0+15.10.20150724 |
394 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 1.0+15.10.20150724 |
395 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct()@Base" 1.0+15.10.20150724 |
396 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::operator=(Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 1.0+15.10.20150724 |
397 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
398 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
399 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
400 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
401 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
402 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&, int, QString const&, QString const&)@Base" 1.0+15.10.20150724 |
403 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, int, QString const&, QString const&)@Base" 1.0+15.10.20150724 |
404 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&)@Base" 1.0+15.10.20150724 |
405 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&, int, QString const&, QString const&)@Base" 1.0+15.10.20150724 |
406 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, int, QString const&, QString const&)@Base" 1.0+15.10.20150724 |
407 | - (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 1.0+15.10.20150724 |
408 | - (c++)"Ubuntu::Transfers::Errors::operator>>(QDBusArgument const&, Ubuntu::Transfers::Errors::HashErrorStruct&)@Base" 1.0+15.10.20150724 |
409 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::getType() const@Base" 1.0+15.10.20150724 |
410 | - (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::getPhrase() const@Base" 1.0+15.10.20150724 |
411 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::getChecksum() const@Base" 1.0+15.10.20150724 |
412 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::getExpected() const@Base" 1.0+15.10.20150724 |
413 | - (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::getMethod() const@Base" 1.0+15.10.20150724 |
414 | - (c++)"Ubuntu::Transfers::Metadata::Metadata()@Base" 0.9+14.10.20141014.1 |
415 | - (c++)"Ubuntu::Transfers::Metadata::Metadata(QMap<QString, QVariant>)@Base" 0.9+14.10.20141014.1 |
416 | - (c++)"Ubuntu::Transfers::Metadata::Metadata()@Base" 0.9+14.10.20141014.1 |
417 | - (c++)"Ubuntu::Transfers::Metadata::setClickPackage(QString const&)@Base" 0.9+14.10.20141014.1 |
418 | - (c++)"Ubuntu::Transfers::Metadata::CLICK_PACKAGE_KEY@Base" 0.9+14.10.20141014.1 |
419 | - (c++)"Ubuntu::Transfers::Metadata::setShowInIndicator(bool)@Base" 0.9+14.10.20141014.1 |
420 | - (c++)"Ubuntu::Transfers::Metadata::SHOW_IN_INDICATOR_KEY@Base" 0.9+14.10.20141014.1 |
421 | - (c++)"Ubuntu::Transfers::Metadata::setTitle(QString const&)@Base" 0.9+14.10.20141014.1 |
422 | - (c++)"Ubuntu::Transfers::Metadata::TITLE_KEY@Base" 0.9+14.10.20141014.1 |
423 | - (c++)"Ubuntu::Transfers::Metadata::clickPackage() const@Base" 0.9+14.10.20141014.1 |
424 | - (c++)"Ubuntu::Transfers::Metadata::hasClickPackage() const@Base" 0.9+14.10.20141014.1 |
425 | - (c++)"Ubuntu::Transfers::Metadata::showInIndicator() const@Base" 0.9+14.10.20141014.1 |
426 | - (c++)"Ubuntu::Transfers::Metadata::hasShowInIndicator() const@Base" 0.9+14.10.20141014.1 |
427 | - (c++)"Ubuntu::Transfers::Metadata::title() const@Base" 0.9+14.10.20141014.1 |
428 | - (c++)"Ubuntu::Transfers::Metadata::hasTitle() const@Base" 0.9+14.10.20141014.1 |
429 | - (c++)"Ubuntu::Transfers::Metadata::setCommand(QString const&)@Base" 0.4+14.10.20140618 |
430 | - (c++)"Ubuntu::Transfers::Metadata::COMMAND_KEY@Base" 0.4+14.10.20140618 |
431 | - (c++)"Ubuntu::Transfers::Metadata::setLocalPath(QString const&)@Base" 0.4+14.10.20140618 |
432 | - (c++)"Ubuntu::Transfers::Metadata::setObjectPath(QString const&)@Base" 0.4+14.10.20140618 |
433 | - (c++)"Ubuntu::Transfers::Metadata::LOCAL_PATH_KEY@Base" 0.4+14.10.20140618 |
434 | - (c++)"Ubuntu::Transfers::Metadata::OBJECT_PATH_KEY@Base" 0.4+14.10.20140618 |
435 | - (c++)"Ubuntu::Transfers::Metadata::COMMAND_FILE_KEY@Base" 0.4+14.10.20140618 |
436 | - (c++)"Ubuntu::Transfers::Metadata::setDeflate(bool)@Base" 0.9+14.10.20141014.1 |
437 | - (c++)"Ubuntu::Transfers::Metadata::DEFLATE_KEY@Base" 0.9+14.10.20141014.1 |
438 | - (c++)"Ubuntu::Transfers::Metadata::hasDeflate() const@Base" 0.9+14.10.20141014.1 |
439 | - (c++)"Ubuntu::Transfers::Metadata::deflate() const@Base" 0.9+14.10.20141014.1 |
440 | - (c++)"Ubuntu::Transfers::Metadata::setExtract(bool)@Base" 0.9+14.10.20141014.1 |
441 | - (c++)"Ubuntu::Transfers::Metadata::EXTRACT_KEY@Base" 0.9+14.10.20141014.1 |
442 | - (c++)"Ubuntu::Transfers::Metadata::hasExtract() const@Base" 0.9+14.10.20141014.1 |
443 | - (c++)"Ubuntu::Transfers::Metadata::extract() const@Base" 0.9+14.10.20141014.1 |
444 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::getCode() const@Base" 0.4+14.10.20140618 |
445 | - (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::getPhrase() const@Base" 0.4+14.10.20140618 |
446 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::getCode() const@Base" 0.4+14.10.20140618 |
447 | - (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::getPhrase() const@Base" 0.4+14.10.20140618 |
448 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::getExitCode() const@Base" 0.4+14.10.20140618 |
449 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::getStandardError() const@Base" 0.4+14.10.20140618 |
450 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::getStandardOutput() const@Base" 0.4+14.10.20140618 |
451 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::getCode() const@Base" 0.4+14.10.20140618 |
452 | - (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::getPhrase() const@Base" 0.4+14.10.20140618 |
453 | - (c++)"Ubuntu::Transfers::System::DBusConnection::metaObject() const@Base" 0.4+14.10.20140618 |
454 | - (c++)"Ubuntu::Transfers::System::Logger::metaObject() const@Base" 0.4+14.10.20140618 |
455 | - (c++)"Ubuntu::Transfers::Metadata::hasCommand() const@Base" 0.4+14.10.20140618 |
456 | - (c++)"Ubuntu::Transfers::Metadata::objectPath() const@Base" 0.4+14.10.20140618 |
457 | - (c++)"Ubuntu::Transfers::Metadata::hasLocalPath() const@Base" 0.4+14.10.20140618 |
458 | - (c++)"Ubuntu::Transfers::Metadata::hasObjectPath() const@Base" 0.4+14.10.20140618 |
459 | - (c++)"Ubuntu::Transfers::Metadata::command() const@Base" 0.4+14.10.20140618 |
460 | - (c++)"Ubuntu::Transfers::Metadata::localPath() const@Base" 0.4+14.10.20140618 |
461 | - (c++)"typeinfo for Ubuntu::Transfers::System::DBusConnection@Base" 0.4+14.10.20140618 |
462 | - (c++)"typeinfo for Ubuntu::Transfers::System::Logger@Base" 0.4+14.10.20140618 |
463 | - (c++)"typeinfo name for Ubuntu::Transfers::System::DBusConnection@Base" 0.4+14.10.20140618 |
464 | - (c++)"typeinfo name for Ubuntu::Transfers::System::Logger@Base" 0.4+14.10.20140618 |
465 | - (c++)"vtable for Ubuntu::Transfers::System::DBusConnection@Base" 0.4+14.10.20140618 |
466 | - (c++)"vtable for Ubuntu::Transfers::System::Logger@Base" 0.4+14.10.20140618 |
467 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QByteArray const&)@Base" 0.4+14.10.20140618 |
468 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QDBusError const&)@Base" 0.4+14.10.20140618 |
469 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QStringList const&)@Base" 0.4+14.10.20140618 |
470 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QMap<QString, QVariant> const&)@Base" 0.4+14.10.20140618 |
471 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QMap<QString, QString> const&)@Base" 0.4+14.10.20140618 |
472 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QUrl const&)@Base" 0.4+14.10.20140618 |
473 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QList<QSslError> const&)@Base" 0.4+14.10.20140618 |
474 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QString const&)@Base" 0.4+14.10.20140618 |
475 | - (c++)"operator<<(std::basic_ostream<char, std::char_traits<char> >&, QList<QByteArray> const&)@Base" 0.4+14.10.20140618 |
476 | |
477 | === modified file 'docs/dbus/com.canonical.applications.download.xml' |
478 | --- docs/dbus/com.canonical.applications.download.xml 2015-02-25 16:24:24 +0000 |
479 | +++ docs/dbus/com.canonical.applications.download.xml 2015-12-16 02:32:33 +0000 |
480 | @@ -49,10 +49,19 @@ |
481 | <arg name="allowed" type="b" direction="out"/> |
482 | </method> |
483 | |
484 | + <method name="filePath"> |
485 | + <arg name="filepath" type="s" direction="out"/> |
486 | + </method> |
487 | + |
488 | + <method name="state"> |
489 | + <arg name="state" type="i" direction="out"/> |
490 | + </method> |
491 | + |
492 | <method name="start" /> |
493 | <method name="pause" /> |
494 | <method name="resume" /> |
495 | <method name="cancel" /> |
496 | + <method name="collected" /> |
497 | |
498 | <signal name="started"> |
499 | <arg name="success" type="b" direction="out"/> |
500 | @@ -118,5 +127,7 @@ |
501 | |
502 | <property access="read" type="s" name="ClickPackage" /> |
503 | |
504 | + <property access="read" type="s" name="DestinationApp" /> |
505 | + |
506 | </interface> |
507 | </node> |
508 | |
509 | === modified file 'docs/dbus/com.canonical.applications.download_manager.xml' |
510 | --- docs/dbus/com.canonical.applications.download_manager.xml 2014-04-30 14:47:38 +0000 |
511 | +++ docs/dbus/com.canonical.applications.download_manager.xml 2015-12-16 02:32:33 +0000 |
512 | @@ -26,6 +26,8 @@ |
513 | </method> |
514 | |
515 | <method name="getAllDownloads"> |
516 | + <arg name="appId" type="s" direction="in"/> |
517 | + <arg name="uncollected" type="b" direction="in"/> |
518 | <arg name="downloads" type="ao" direction="out" /> |
519 | </method> |
520 | |
521 | @@ -35,6 +37,12 @@ |
522 | <arg name="downloads" type="ao" direction="out" /> |
523 | </method> |
524 | |
525 | + <method name="getDownloadState"> |
526 | + <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="DownloadStateStruct"/> |
527 | + <arg name="downloadId" type="s" direction="in"/> |
528 | + <arg name="state" type="(issss)" direction="out"/> |
529 | + </method> |
530 | + |
531 | <method name="setDefaultThrottle"> |
532 | <arg name="speed" type="t" direction="in"/> |
533 | </method> |
534 | |
535 | === modified file 'docs/qml/pages/mainpage.qdoc' |
536 | --- docs/qml/pages/mainpage.qdoc 2014-06-20 10:10:50 +0000 |
537 | +++ docs/qml/pages/mainpage.qdoc 2015-12-16 02:32:33 +0000 |
538 | @@ -35,7 +35,7 @@ |
539 | \section1 Components |
540 | Available through: |
541 | \code |
542 | - import Ubuntu.DownloadManager 0.1 |
543 | + import Ubuntu.DownloadManager 1.2 |
544 | \endcode |
545 | |
546 | \list |
547 | @@ -47,8 +47,8 @@ |
548 | |
549 | \qml |
550 | import QtQuick 2.0 |
551 | - import Ubuntu.Components 0.1 |
552 | - import Ubuntu.DownloadManager 0.1 |
553 | + import Ubuntu.Components 1.2 |
554 | + import Ubuntu.DownloadManager 1.2 |
555 | |
556 | Rectangle { |
557 | width: units.gu(100) |
558 | |
559 | === modified file 'docs/qml/pages/moduledef.qdoc' |
560 | --- docs/qml/pages/moduledef.qdoc 2014-06-20 10:10:50 +0000 |
561 | +++ docs/qml/pages/moduledef.qdoc 2015-12-16 02:32:33 +0000 |
562 | @@ -1,3 +1,3 @@ |
563 | /*! |
564 | - \qmlmodule Ubuntu.DownloadManager 0.1 |
565 | + \qmlmodule Ubuntu.DownloadManager 1.2 |
566 | */ |
567 | |
568 | === modified file 'src/common/priv/ubuntu/transfers/queue.cpp' |
569 | --- src/common/priv/ubuntu/transfers/queue.cpp 2014-11-24 16:39:17 +0000 |
570 | +++ src/common/priv/ubuntu/transfers/queue.cpp 2015-12-16 02:32:33 +0000 |
571 | @@ -127,6 +127,7 @@ |
572 | break; |
573 | case Transfer::ERROR: |
574 | case Transfer::FINISH: |
575 | + case Transfer::UNCOLLECTED: |
576 | // remove the registered object in dbus, remove the transfer |
577 | // and the adapter from the list |
578 | if (!_current.isEmpty() && _current == transfer->path()) |
579 | @@ -177,6 +178,9 @@ |
580 | LOG(INFO) << "State is CANCEL || FINISH || ERROR"; |
581 | remove(_current); |
582 | _current = ""; |
583 | + } else if (state == Transfer::UNCOLLECTED) { |
584 | + LOG(INFO) << "State is UNCOLLECTED"; |
585 | + _current = ""; |
586 | } else if (!currentTransfer->canTransfer() |
587 | || state == Transfer::PAUSE) { |
588 | LOG(INFO) << "States is Cannot Transfer || PAUSE"; |
589 | |
590 | === modified file 'src/common/priv/ubuntu/transfers/transfer.cpp' |
591 | --- src/common/priv/ubuntu/transfers/transfer.cpp 2014-11-26 12:21:53 +0000 |
592 | +++ src/common/priv/ubuntu/transfers/transfer.cpp 2015-12-16 02:32:33 +0000 |
593 | @@ -194,6 +194,13 @@ |
594 | startTransfer(); |
595 | } |
596 | |
597 | +void |
598 | +Transfer::collected() { |
599 | + if (state() == Transfer::UNCOLLECTED) { |
600 | + setState(Transfer::FINISH); |
601 | + } |
602 | +} |
603 | + |
604 | } // General |
605 | |
606 | } // Ubuntu |
607 | |
608 | === modified file 'src/common/priv/ubuntu/transfers/transfer.h' |
609 | --- src/common/priv/ubuntu/transfers/transfer.h 2015-02-02 11:05:15 +0000 |
610 | +++ src/common/priv/ubuntu/transfers/transfer.h 2015-12-16 02:32:33 +0000 |
611 | @@ -36,6 +36,7 @@ |
612 | PAUSE, |
613 | RESUME, |
614 | CANCEL, |
615 | + UNCOLLECTED, |
616 | FINISH, |
617 | ERROR |
618 | }; |
619 | @@ -78,6 +79,7 @@ |
620 | virtual void pause(); |
621 | virtual void resume(); |
622 | virtual void start(); |
623 | + virtual void collected(); |
624 | |
625 | signals: |
626 | void canceled(bool success); |
627 | |
628 | === modified file 'src/common/public/ubuntu/transfers/metadata.cpp' |
629 | --- src/common/public/ubuntu/transfers/metadata.cpp 2014-10-09 09:52:34 +0000 |
630 | +++ src/common/public/ubuntu/transfers/metadata.cpp 2015-12-16 02:32:33 +0000 |
631 | @@ -16,6 +16,10 @@ |
632 | * Boston, MA 02110-1301, USA. |
633 | */ |
634 | |
635 | +#include <QProcessEnvironment> |
636 | +#include <QCoreApplication> |
637 | +#include <QDebug> |
638 | + |
639 | #include "metadata.h" |
640 | |
641 | namespace Ubuntu { |
642 | @@ -31,12 +35,32 @@ |
643 | const QString Metadata::CLICK_PACKAGE_KEY = "click-package"; |
644 | const QString Metadata::DEFLATE_KEY = "deflate"; |
645 | const QString Metadata::EXTRACT_KEY = "extract"; |
646 | +const QString Metadata::APP_ID = "app-id"; |
647 | + |
648 | +namespace { |
649 | + const QString APP_ID_ENV = "APP_ID"; |
650 | +} |
651 | |
652 | Metadata::Metadata() { |
653 | + auto environment = QProcessEnvironment::systemEnvironment(); |
654 | + if (environment.contains(APP_ID_ENV)) { |
655 | + setOwner(environment.value(APP_ID_ENV)); |
656 | + } else { |
657 | + setOwner(QCoreApplication::applicationFilePath()); |
658 | + } |
659 | } |
660 | |
661 | Metadata::Metadata(const QVariantMap map) |
662 | : QVariantMap(map) { |
663 | + // check if the app id is present, if not, do it |
664 | + if (!hasOwner()) { |
665 | + auto environment = QProcessEnvironment::systemEnvironment(); |
666 | + if (environment.contains(APP_ID_ENV)) { |
667 | + setOwner(environment.value(APP_ID_ENV)); |
668 | + } else { |
669 | + setOwner(QCoreApplication::applicationFilePath()); |
670 | + } |
671 | + } |
672 | } |
673 | |
674 | QString |
675 | @@ -106,7 +130,7 @@ |
676 | bool |
677 | Metadata::showInIndicator() const { |
678 | return (contains(Metadata::SHOW_IN_INDICATOR_KEY))? |
679 | - value(Metadata::SHOW_IN_INDICATOR_KEY).toBool():true; |
680 | + value(Metadata::SHOW_IN_INDICATOR_KEY).toBool():false; |
681 | } |
682 | |
683 | void |
684 | @@ -167,6 +191,22 @@ |
685 | return contains(Metadata::EXTRACT_KEY); |
686 | } |
687 | |
688 | +QString |
689 | +Metadata::destinationApp() const { |
690 | + return (contains(Metadata::APP_ID))? |
691 | + value(Metadata::APP_ID).toString():""; |
692 | +} |
693 | + |
694 | +void |
695 | +Metadata::setOwner(const QString &id) { |
696 | + insert(Metadata::APP_ID, id); |
697 | +} |
698 | + |
699 | +bool |
700 | +Metadata::hasOwner() const { |
701 | + return contains(Metadata::APP_ID); |
702 | +} |
703 | + |
704 | } // DownloadManager |
705 | |
706 | } // Ubuntu |
707 | |
708 | === modified file 'src/common/public/ubuntu/transfers/metadata.h' |
709 | --- src/common/public/ubuntu/transfers/metadata.h 2014-10-09 09:52:34 +0000 |
710 | +++ src/common/public/ubuntu/transfers/metadata.h 2015-12-16 02:32:33 +0000 |
711 | @@ -41,6 +41,7 @@ |
712 | static const QString CLICK_PACKAGE_KEY; |
713 | static const QString DEFLATE_KEY; |
714 | static const QString EXTRACT_KEY; |
715 | + static const QString APP_ID; |
716 | |
717 | // accessors to simplify the use of the metadata |
718 | QString command() const; |
719 | @@ -74,10 +75,14 @@ |
720 | bool extract() const; |
721 | void setExtract(bool extract); |
722 | bool hasExtract() const; |
723 | + |
724 | + QString destinationApp() const; |
725 | + void setOwner(const QString &id); |
726 | + bool hasOwner() const; |
727 | }; |
728 | |
729 | } // DownloadManager |
730 | |
731 | } // Ubuntu |
732 | |
733 | -#endif // METADATA_H |
734 | +#endif |
735 | |
736 | === modified file 'src/downloads/client/ubuntu/download_manager/download.h' |
737 | --- src/downloads/client/ubuntu/download_manager/download.h 2014-09-24 09:10:39 +0000 |
738 | +++ src/downloads/client/ubuntu/download_manager/download.h 2015-12-16 02:32:33 +0000 |
739 | @@ -51,11 +51,23 @@ |
740 | Q_PROPERTY(QString ClickPackage READ clickPackage NOTIFY clickPackagedChanged) |
741 | Q_PROPERTY(bool ShowInIndicator READ showInIndicator NOTIFY showInIndicatorChanged) |
742 | Q_PROPERTY(QString Title READ title NOTIFY titleChanged) |
743 | + Q_PROPERTY(QString DownloadOwner READ destinationApp NOTIFY destinationAppChanged) |
744 | |
745 | public: |
746 | explicit Download(QObject* parent = 0) |
747 | : QObject(parent) {} |
748 | |
749 | + enum State { |
750 | + IDLE, |
751 | + START, |
752 | + PAUSE, |
753 | + RESUME, |
754 | + CANCEL, |
755 | + UNCOLLECTED, |
756 | + FINISH, |
757 | + ERROR |
758 | + }; |
759 | + |
760 | /*! |
761 | \fn void Download::start() |
762 | |
763 | @@ -97,6 +109,15 @@ |
764 | virtual void cancel() = 0; |
765 | |
766 | /*! |
767 | + \fn void Download::collected() |
768 | + |
769 | + Notifies the download manager that the finished signal for this |
770 | + download object has been received by the client. This allows UDM |
771 | + to report downloads that have finished while a client isn't running. |
772 | + */ |
773 | + virtual void collected() = 0; |
774 | + |
775 | + /*! |
776 | \fn void Download::allowMobileDownload(bool allowed) |
777 | |
778 | Notifies the download manager that the download represented by this |
779 | @@ -201,6 +222,21 @@ |
780 | virtual qulonglong totalSize() = 0; |
781 | |
782 | /*! |
783 | + \fn QString filePath() |
784 | + |
785 | + Returns the value of the downloaded file's location. This is only set once |
786 | + the download is complete. |
787 | + */ |
788 | + virtual QString filePath() = 0; |
789 | + |
790 | + /*! |
791 | + \fn State state() |
792 | + |
793 | + Returns the current state of the download. |
794 | + */ |
795 | + virtual State state() = 0; |
796 | + |
797 | + /*! |
798 | \fn bool isError() const |
799 | |
800 | Returns if the download represented by the object has had an error. |
801 | @@ -244,6 +280,14 @@ |
802 | */ |
803 | virtual QString title() const = 0; |
804 | |
805 | + /*! |
806 | + \fn QString destinationApp() const = 0; |
807 | + |
808 | + Returns the value of the destinationApp property of the download. The owner of the |
809 | + download is the application that created the download in the system. |
810 | + */ |
811 | + virtual QString destinationApp() const = 0; |
812 | + |
813 | signals: |
814 | |
815 | /*! |
816 | @@ -346,10 +390,18 @@ |
817 | */ |
818 | void titleChanged(); |
819 | |
820 | + /*! |
821 | + \fn void Download::destinationAppChanged(); |
822 | + |
823 | + This signal is emitted whenever the download owner property of the download |
824 | + has been updated. |
825 | + */ |
826 | + void destinationAppChanged(); |
827 | + |
828 | }; |
829 | |
830 | } // Ubuntu |
831 | |
832 | } // DownloadManager |
833 | |
834 | -#endif // UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_H |
835 | +#endif |
836 | |
837 | === modified file 'src/downloads/client/ubuntu/download_manager/download_impl.cpp' |
838 | --- src/downloads/client/ubuntu/download_manager/download_impl.cpp 2015-02-25 16:24:24 +0000 |
839 | +++ src/downloads/client/ubuntu/download_manager/download_impl.cpp 2015-12-16 02:32:33 +0000 |
840 | @@ -62,6 +62,13 @@ |
841 | "Could not connect to signal &DownloadInterface::finished"); |
842 | } |
843 | |
844 | + connected = connect(_dbusInterface, &DownloadInterface::finished, |
845 | + this, &DownloadImpl::onFinished); |
846 | + if (!connected) { |
847 | + Logger::log(Logger::Critical, |
848 | + "Could not connect to signal &DownloadInterface::finished"); |
849 | + } |
850 | + |
851 | connected = connect(_dbusInterface, &DownloadInterface::paused, |
852 | this, &Download::paused); |
853 | if (!connected) { |
854 | @@ -216,6 +223,19 @@ |
855 | } |
856 | |
857 | void |
858 | +DownloadImpl::collected() { |
859 | + Logger::log(Logger::Debug, QString("Download{%1} collected()").arg(_id)); |
860 | + QDBusPendingReply<> reply = |
861 | + _dbusInterface->collected(); |
862 | + // block, the call should be fast enough |
863 | + reply.waitForFinished(); |
864 | + if (reply.isError()) { |
865 | + Logger::log(Logger::Error, "Error when setting download collected"); |
866 | + setLastError(reply.error()); |
867 | + } |
868 | +} |
869 | + |
870 | +void |
871 | DownloadImpl::allowMobileDownload(bool allowed) { |
872 | Logger::log(Logger::Debug, |
873 | QString("Download{%1} allowMobileDownload%2())").arg(_id).arg(allowed)); |
874 | @@ -304,9 +324,7 @@ |
875 | // block, the call should be fast enough |
876 | reply.waitForFinished(); |
877 | if (reply.isError()) { |
878 | - qDebug() << "Error setting metadata"; |
879 | Logger::log(Logger::Error, "Error setting the download metadata"); |
880 | - qDebug() << reply.error(); |
881 | setLastError(reply.error()); |
882 | } |
883 | } |
884 | @@ -362,6 +380,40 @@ |
885 | } |
886 | |
887 | QString |
888 | +DownloadImpl::filePath() { |
889 | + Logger::log(Logger::Debug, QString("Download{%1} filePath()").arg(_id)); |
890 | + QDBusPendingReply<QString> reply = |
891 | + _dbusInterface->filePath(); |
892 | + // block, the call is fast enough |
893 | + reply.waitForFinished(); |
894 | + if (reply.isError()) { |
895 | + Logger::log(Logger::Error, "Error querying the download file path"); |
896 | + setLastError(reply.error()); |
897 | + return ""; |
898 | + } else { |
899 | + auto result = reply.value(); |
900 | + return result; |
901 | + } |
902 | +} |
903 | + |
904 | +Download::State |
905 | +DownloadImpl::state() { |
906 | + Logger::log(Logger::Debug, QString("Download{%1} state()").arg(_id)); |
907 | + QDBusPendingReply<int> reply = |
908 | + _dbusInterface->state(); |
909 | + // block, the call is fast enough |
910 | + reply.waitForFinished(); |
911 | + if (reply.isError()) { |
912 | + Logger::log(Logger::Error, "Error querying the download state"); |
913 | + setLastError(reply.error()); |
914 | + return Download::ERROR; |
915 | + } else { |
916 | + auto result = static_cast<Download::State>(reply.value()); |
917 | + return result; |
918 | + } |
919 | +} |
920 | + |
921 | +QString |
922 | DownloadImpl::id() const { |
923 | return _id; |
924 | } |
925 | @@ -425,6 +477,11 @@ |
926 | return _dbusInterface->title(); |
927 | } |
928 | |
929 | +QString |
930 | +DownloadImpl::destinationApp() const { |
931 | + return _dbusInterface->destinationApp(); |
932 | +} |
933 | + |
934 | void |
935 | DownloadImpl::onHttpError(HttpErrorStruct errStruct) { |
936 | auto err = new HttpError(errStruct, this); |
937 | @@ -476,6 +533,13 @@ |
938 | } |
939 | } |
940 | |
941 | +void DownloadImpl::onFinished(const QString &path) { |
942 | + Q_UNUSED(path); |
943 | + // Inform UDM that we've received the finished signal, so the download |
944 | + // can be considered completely finished. |
945 | + collected(); |
946 | +} |
947 | + |
948 | } // DownloadManager |
949 | |
950 | } // Ubuntu |
951 | |
952 | === modified file 'src/downloads/client/ubuntu/download_manager/download_impl.h' |
953 | --- src/downloads/client/ubuntu/download_manager/download_impl.h 2015-02-25 16:24:24 +0000 |
954 | +++ src/downloads/client/ubuntu/download_manager/download_impl.h 2015-12-16 02:32:33 +0000 |
955 | @@ -59,6 +59,7 @@ |
956 | void pause(); |
957 | void resume(); |
958 | void cancel(); |
959 | + void collected(); |
960 | |
961 | void allowMobileDownload(bool allowed); |
962 | bool isMobileDownloadAllowed(); |
963 | @@ -70,6 +71,8 @@ |
964 | void setMetadata(QVariantMap map); |
965 | void setThrottle(qulonglong speed); |
966 | qulonglong throttle(); |
967 | + QString filePath(); |
968 | + Download::State state(); |
969 | |
970 | QString id() const; |
971 | qulonglong progress(); |
972 | @@ -81,6 +84,7 @@ |
973 | QString clickPackage() const; |
974 | bool showInIndicator() const; |
975 | QString title() const; |
976 | + QString destinationApp() const; |
977 | |
978 | protected: |
979 | DownloadImpl(const QDBusConnection& conn, Error* err, QObject* parent = 0); |
980 | @@ -100,6 +104,7 @@ |
981 | void onPropertiesChanged(const QString& interfaceName, |
982 | const QVariantMap& changedProperties, |
983 | const QStringList& invalidatedProperties); |
984 | + void onFinished(const QString& path); |
985 | |
986 | private: |
987 | QString _id; |
988 | |
989 | === modified file 'src/downloads/client/ubuntu/download_manager/download_interface.cpp' |
990 | --- src/downloads/client/ubuntu/download_manager/download_interface.cpp 2015-02-25 16:24:24 +0000 |
991 | +++ src/downloads/client/ubuntu/download_manager/download_interface.cpp 2015-12-16 02:32:33 +0000 |
992 | @@ -2,7 +2,7 @@ |
993 | * This file was generated by qdbusxml2cpp version 0.8 |
994 | * Command line was: qdbusxml2cpp com.canonical.applications.download.xml -i metatypes.h -p download_interface -c DownloadInterface |
995 | * |
996 | - * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
997 | + * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
998 | * |
999 | * This is an auto-generated file. |
1000 | * This file may have been hand-edited. Look for HAND-EDIT comments |
1001 | |
1002 | === modified file 'src/downloads/client/ubuntu/download_manager/download_interface.h' |
1003 | --- src/downloads/client/ubuntu/download_manager/download_interface.h 2015-02-25 16:24:24 +0000 |
1004 | +++ src/downloads/client/ubuntu/download_manager/download_interface.h 2015-12-16 02:32:33 +0000 |
1005 | @@ -2,14 +2,14 @@ |
1006 | * This file was generated by qdbusxml2cpp version 0.8 |
1007 | * Command line was: qdbusxml2cpp com.canonical.applications.download.xml -i metatypes.h -p download_interface -c DownloadInterface |
1008 | * |
1009 | - * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
1010 | + * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
1011 | * |
1012 | * This is an auto-generated file. |
1013 | * Do not edit! All changes made to it will be lost. |
1014 | */ |
1015 | |
1016 | -#ifndef DOWNLOAD_INTERFACE_H_1392136772 |
1017 | -#define DOWNLOAD_INTERFACE_H_1392136772 |
1018 | +#ifndef DOWNLOAD_INTERFACE_H_1442932929 |
1019 | +#define DOWNLOAD_INTERFACE_H_1442932929 |
1020 | |
1021 | #include <QtCore/QObject> |
1022 | #include <QtCore/QByteArray> |
1023 | @@ -40,6 +40,10 @@ |
1024 | inline QString clickPackage() const |
1025 | { return qvariant_cast< QString >(property("ClickPackage")); } |
1026 | |
1027 | + Q_PROPERTY(QString DestinationApp READ destinationApp) |
1028 | + inline QString destinationApp() const |
1029 | + { return qvariant_cast< QString >(property("DestinationApp")); } |
1030 | + |
1031 | Q_PROPERTY(bool ShowInIndicator READ showInIndicator) |
1032 | inline bool showInIndicator() const |
1033 | { return qvariant_cast< bool >(property("ShowInIndicator")); } |
1034 | @@ -53,95 +57,113 @@ |
1035 | { |
1036 | QList<QVariant> argumentList; |
1037 | argumentList << QVariant::fromValue(allowed); |
1038 | - return asyncCallWithArgumentList(QLatin1String("allowGSMDownload"), argumentList); |
1039 | + return asyncCallWithArgumentList(QStringLiteral("allowGSMDownload"), argumentList); |
1040 | } |
1041 | |
1042 | inline QDBusPendingReply<> cancel() |
1043 | { |
1044 | QList<QVariant> argumentList; |
1045 | - return asyncCallWithArgumentList(QLatin1String("cancel"), argumentList); |
1046 | + return asyncCallWithArgumentList(QStringLiteral("cancel"), argumentList); |
1047 | + } |
1048 | + |
1049 | + inline QDBusPendingReply<> collected() |
1050 | + { |
1051 | + QList<QVariant> argumentList; |
1052 | + return asyncCallWithArgumentList(QStringLiteral("collected"), argumentList); |
1053 | + } |
1054 | + |
1055 | + inline QDBusPendingReply<QString> filePath() |
1056 | + { |
1057 | + QList<QVariant> argumentList; |
1058 | + return asyncCallWithArgumentList(QStringLiteral("filePath"), argumentList); |
1059 | } |
1060 | |
1061 | inline QDBusPendingReply<StringMap> headers() |
1062 | { |
1063 | QList<QVariant> argumentList; |
1064 | - return asyncCallWithArgumentList(QLatin1String("headers"), argumentList); |
1065 | + return asyncCallWithArgumentList(QStringLiteral("headers"), argumentList); |
1066 | } |
1067 | |
1068 | inline QDBusPendingReply<bool> isGSMDownloadAllowed() |
1069 | { |
1070 | QList<QVariant> argumentList; |
1071 | - return asyncCallWithArgumentList(QLatin1String("isGSMDownloadAllowed"), argumentList); |
1072 | + return asyncCallWithArgumentList(QStringLiteral("isGSMDownloadAllowed"), argumentList); |
1073 | } |
1074 | |
1075 | inline QDBusPendingReply<QVariantMap> metadata() |
1076 | { |
1077 | QList<QVariant> argumentList; |
1078 | - return asyncCallWithArgumentList(QLatin1String("metadata"), argumentList); |
1079 | + return asyncCallWithArgumentList(QStringLiteral("metadata"), argumentList); |
1080 | } |
1081 | |
1082 | inline QDBusPendingReply<> pause() |
1083 | { |
1084 | QList<QVariant> argumentList; |
1085 | - return asyncCallWithArgumentList(QLatin1String("pause"), argumentList); |
1086 | + return asyncCallWithArgumentList(QStringLiteral("pause"), argumentList); |
1087 | } |
1088 | |
1089 | inline QDBusPendingReply<qulonglong> progress() |
1090 | { |
1091 | QList<QVariant> argumentList; |
1092 | - return asyncCallWithArgumentList(QLatin1String("progress"), argumentList); |
1093 | + return asyncCallWithArgumentList(QStringLiteral("progress"), argumentList); |
1094 | } |
1095 | |
1096 | inline QDBusPendingReply<> resume() |
1097 | { |
1098 | QList<QVariant> argumentList; |
1099 | - return asyncCallWithArgumentList(QLatin1String("resume"), argumentList); |
1100 | + return asyncCallWithArgumentList(QStringLiteral("resume"), argumentList); |
1101 | } |
1102 | |
1103 | inline QDBusPendingReply<> setDestinationDir(const QString &path) |
1104 | { |
1105 | QList<QVariant> argumentList; |
1106 | argumentList << QVariant::fromValue(path); |
1107 | - return asyncCallWithArgumentList(QLatin1String("setDestinationDir"), argumentList); |
1108 | + return asyncCallWithArgumentList(QStringLiteral("setDestinationDir"), argumentList); |
1109 | } |
1110 | |
1111 | inline QDBusPendingReply<> setHeaders(StringMap headers) |
1112 | { |
1113 | QList<QVariant> argumentList; |
1114 | argumentList << QVariant::fromValue(headers); |
1115 | - return asyncCallWithArgumentList(QLatin1String("setHeaders"), argumentList); |
1116 | + return asyncCallWithArgumentList(QStringLiteral("setHeaders"), argumentList); |
1117 | } |
1118 | |
1119 | inline QDBusPendingReply<> setMetadata(const QVariantMap &data) |
1120 | { |
1121 | QList<QVariant> argumentList; |
1122 | argumentList << QVariant::fromValue(data); |
1123 | - return asyncCallWithArgumentList(QLatin1String("setMetadata"), argumentList); |
1124 | + return asyncCallWithArgumentList(QStringLiteral("setMetadata"), argumentList); |
1125 | } |
1126 | |
1127 | inline QDBusPendingReply<> setThrottle(qulonglong speed) |
1128 | { |
1129 | QList<QVariant> argumentList; |
1130 | argumentList << QVariant::fromValue(speed); |
1131 | - return asyncCallWithArgumentList(QLatin1String("setThrottle"), argumentList); |
1132 | + return asyncCallWithArgumentList(QStringLiteral("setThrottle"), argumentList); |
1133 | } |
1134 | |
1135 | inline QDBusPendingReply<> start() |
1136 | { |
1137 | QList<QVariant> argumentList; |
1138 | - return asyncCallWithArgumentList(QLatin1String("start"), argumentList); |
1139 | + return asyncCallWithArgumentList(QStringLiteral("start"), argumentList); |
1140 | + } |
1141 | + |
1142 | + inline QDBusPendingReply<int> state() |
1143 | + { |
1144 | + QList<QVariant> argumentList; |
1145 | + return asyncCallWithArgumentList(QStringLiteral("state"), argumentList); |
1146 | } |
1147 | |
1148 | inline QDBusPendingReply<qulonglong> throttle() |
1149 | { |
1150 | QList<QVariant> argumentList; |
1151 | - return asyncCallWithArgumentList(QLatin1String("throttle"), argumentList); |
1152 | + return asyncCallWithArgumentList(QStringLiteral("throttle"), argumentList); |
1153 | } |
1154 | |
1155 | inline QDBusPendingReply<qulonglong> totalSize() |
1156 | { |
1157 | QList<QVariant> argumentList; |
1158 | - return asyncCallWithArgumentList(QLatin1String("totalSize"), argumentList); |
1159 | + return asyncCallWithArgumentList(QStringLiteral("totalSize"), argumentList); |
1160 | } |
1161 | |
1162 | Q_SIGNALS: // SIGNALS |
1163 | |
1164 | === modified file 'src/downloads/client/ubuntu/download_manager/manager.h' |
1165 | --- src/downloads/client/ubuntu/download_manager/manager.h 2014-06-06 10:05:15 +0000 |
1166 | +++ src/downloads/client/ubuntu/download_manager/manager.h 2015-12-16 02:32:33 +0000 |
1167 | @@ -165,26 +165,38 @@ |
1168 | GroupCb cb, |
1169 | GroupCb errCb) = 0; |
1170 | /*! |
1171 | - \fn void getAllDownloads() |
1172 | + \fn void getAllDownloads(const QString& appId, bool uncollected) |
1173 | |
1174 | Returns all the downloads in the download manager that can be accessed |
1175 | by the calling client. If the client is not confined all downloads are |
1176 | returned, on the other hand if the client is confined the result will |
1177 | be only those downloads created by the client. The result of the method |
1178 | is returned via the downloadsFound signal. |
1179 | + |
1180 | + If appId is specified only downloads from that appId will be returned. |
1181 | + |
1182 | + If uncollected is true then only downloads that haven't yet been |
1183 | + collected by a client will be returned. |
1184 | */ |
1185 | - virtual void getAllDownloads() = 0; |
1186 | + virtual void getAllDownloads(const QString& appId, bool uncollected) = 0; |
1187 | |
1188 | /*! |
1189 | - \fn void getAllDownloads(DownloadsListCb cb, DownloadsListCb errCb) |
1190 | + \fn void getAllDownloads(QString& appId, bool uncollected, DownloadsListCb cb, DownloadsListCb errCb) |
1191 | |
1192 | Returns all the downloads in the download manager that can be accessed |
1193 | by the calling client. If the client is not confined all downloads are |
1194 | returned, on the other hand if the client is confined the result will |
1195 | be only those downloads created by the client. If the method is a |
1196 | success the \a cb is executed else \a errCb is executed. |
1197 | + |
1198 | + If appId is specified only downloads from that appId will be returned. |
1199 | + |
1200 | + If uncollected is true then only downloads that haven't yet been |
1201 | + collected by a client will be returned. |
1202 | */ |
1203 | - virtual void getAllDownloads(DownloadsListCb cb, |
1204 | + virtual void getAllDownloads(const QString& appId, |
1205 | + bool uncollected, |
1206 | + DownloadsListCb cb, |
1207 | DownloadsListCb errCb) = 0; |
1208 | /*! |
1209 | \fn void getAllDownloadsWithMetadata(const QString &name, const QString &value) |
1210 | |
1211 | === modified file 'src/downloads/client/ubuntu/download_manager/manager_impl.cpp' |
1212 | --- src/downloads/client/ubuntu/download_manager/manager_impl.cpp 2015-02-25 16:24:24 +0000 |
1213 | +++ src/downloads/client/ubuntu/download_manager/manager_impl.cpp 2015-12-16 02:32:33 +0000 |
1214 | @@ -145,16 +145,16 @@ |
1215 | } |
1216 | |
1217 | void |
1218 | -ManagerImpl::getAllDownloads() { |
1219 | - Logger::log(Logger::Debug, "Manager getAllDownloads()"); |
1220 | +ManagerImpl::getAllDownloads(const QString &appId, bool uncollected) { |
1221 | + Logger::log(Logger::Debug, QString("Manager getAllDownloads(%1, %2)").arg(appId).arg(uncollected)); |
1222 | DownloadsListCb cb = [](DownloadsList*){}; |
1223 | - getAllDownloads(cb, cb); |
1224 | + getAllDownloads(appId, uncollected, cb, cb); |
1225 | } |
1226 | |
1227 | void |
1228 | -ManagerImpl::getAllDownloads(DownloadsListCb cb, DownloadsListCb errCb) { |
1229 | - Logger::log(Logger::Debug, "Manager getAllDownloads()"); |
1230 | - QDBusPendingCall call = _dbusInterface->getAllDownloads(); |
1231 | +ManagerImpl::getAllDownloads(const QString &appId, bool uncollected, DownloadsListCb cb, DownloadsListCb errCb) { |
1232 | + Logger::log(Logger::Debug, QString("Manager getAllDownloads(%1, %2)").arg(appId).arg(uncollected)); |
1233 | + QDBusPendingCall call = _dbusInterface->getAllDownloads(appId, uncollected); |
1234 | auto watcher = new DownloadsListManagerPCW( |
1235 | _conn, _servicePath, call, cb, errCb, this); |
1236 | auto connected = connect(watcher, &GroupManagerPCW::callbackExecuted, |
1237 | |
1238 | === modified file 'src/downloads/client/ubuntu/download_manager/manager_impl.h' |
1239 | --- src/downloads/client/ubuntu/download_manager/manager_impl.h 2014-06-29 12:45:29 +0000 |
1240 | +++ src/downloads/client/ubuntu/download_manager/manager_impl.h 2015-12-16 02:32:33 +0000 |
1241 | @@ -72,8 +72,10 @@ |
1242 | StringMap headers, |
1243 | GroupCb cb, |
1244 | GroupCb errCb); |
1245 | - virtual void getAllDownloads(); |
1246 | - virtual void getAllDownloads(DownloadsListCb cb, |
1247 | + virtual void getAllDownloads(const QString &appId, bool uncollected); |
1248 | + virtual void getAllDownloads(const QString &appId, |
1249 | + bool uncollected, |
1250 | + DownloadsListCb cb, |
1251 | DownloadsListCb errCb); |
1252 | virtual void getAllDownloadsWithMetadata(const QString &name, |
1253 | const QString &value); |
1254 | |
1255 | === modified file 'src/downloads/client/ubuntu/download_manager/manager_interface.h' |
1256 | --- src/downloads/client/ubuntu/download_manager/manager_interface.h 2014-02-26 19:54:31 +0000 |
1257 | +++ src/downloads/client/ubuntu/download_manager/manager_interface.h 2015-12-16 02:32:33 +0000 |
1258 | @@ -76,9 +76,11 @@ |
1259 | return asyncCallWithArgumentList(QLatin1String("exit"), argumentList); |
1260 | } |
1261 | |
1262 | - inline QDBusPendingReply<QList<QDBusObjectPath> > getAllDownloads() |
1263 | + inline QDBusPendingReply<QList<QDBusObjectPath> > getAllDownloads(const QString &appId, bool uncollected) |
1264 | { |
1265 | QList<QVariant> argumentList; |
1266 | + argumentList << QVariant::fromValue(appId); |
1267 | + argumentList << QVariant::fromValue(uncollected); |
1268 | return asyncCallWithArgumentList(QLatin1String("getAllDownloads"), argumentList); |
1269 | } |
1270 | |
1271 | |
1272 | === modified file 'src/downloads/common/CMakeLists.txt' |
1273 | --- src/downloads/common/CMakeLists.txt 2014-06-16 12:38:08 +0000 |
1274 | +++ src/downloads/common/CMakeLists.txt 2015-12-16 02:32:33 +0000 |
1275 | @@ -1,12 +1,14 @@ |
1276 | set(TARGET ubuntu-download-manager-common) |
1277 | |
1278 | set(SOURCES |
1279 | + ubuntu/download_manager/download_state_struct.cpp |
1280 | ubuntu/download_manager/download_struct.cpp |
1281 | ubuntu/download_manager/group_download_struct.cpp |
1282 | ubuntu/download_manager/system/logger.cpp |
1283 | ) |
1284 | |
1285 | set(PUBLIC_HEADERS |
1286 | + ubuntu/download_manager/download_state_struct.h |
1287 | ubuntu/download_manager/download_struct.h |
1288 | ubuntu/download_manager/group_download_struct.h |
1289 | ubuntu/download_manager/metatypes.h |
1290 | |
1291 | === added file 'src/downloads/common/ubuntu/download_manager/download_state_struct.cpp' |
1292 | --- src/downloads/common/ubuntu/download_manager/download_state_struct.cpp 1970-01-01 00:00:00 +0000 |
1293 | +++ src/downloads/common/ubuntu/download_manager/download_state_struct.cpp 2015-12-16 02:32:33 +0000 |
1294 | @@ -0,0 +1,119 @@ |
1295 | +/* |
1296 | + * Copyright 2013-2014 Canonical Ltd. |
1297 | + * |
1298 | + * This library is free software; you can redistribute it and/or |
1299 | + * modify it under the terms of version 3 of the GNU Lesser General Public |
1300 | + * License as published by the Free Software Foundation. |
1301 | + * |
1302 | + * This program is distributed in the hope that it will be useful, |
1303 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1304 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1305 | + * General Public License for more details. |
1306 | + * |
1307 | + * You should have received a copy of the GNU Lesser General Public |
1308 | + * License along with this library; if not, write to the |
1309 | + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
1310 | + * Boston, MA 02110-1301, USA. |
1311 | + */ |
1312 | + |
1313 | +#include <QDBusArgument> |
1314 | +#include "download_state_struct.h" |
1315 | + |
1316 | +namespace Ubuntu { |
1317 | + |
1318 | +namespace DownloadManager { |
1319 | + |
1320 | +DownloadStateStruct::DownloadStateStruct() |
1321 | + : _state(-1), |
1322 | + _url(QString::null), |
1323 | + _filePath(QString::null), |
1324 | + _hash(QString::null) { |
1325 | + |
1326 | +} |
1327 | + |
1328 | +DownloadStateStruct::DownloadStateStruct(int state, const QString& url, const QString& hash) |
1329 | + : _state(state), |
1330 | + _url(url), |
1331 | + _filePath(QString::null), |
1332 | + _hash(hash) { |
1333 | + |
1334 | +} |
1335 | + |
1336 | +DownloadStateStruct::DownloadStateStruct(int state, const QString& url, const QString& filePath, |
1337 | + const QString& hash) |
1338 | + : _state(state), |
1339 | + _url(url), |
1340 | + _filePath(filePath), |
1341 | + _hash(hash) { |
1342 | + |
1343 | +} |
1344 | + |
1345 | +DownloadStateStruct::DownloadStateStruct(const DownloadStateStruct& other) |
1346 | + : _state(other._state), |
1347 | + _url(other._url), |
1348 | + _filePath(other._filePath), |
1349 | + _hash(other._hash) { |
1350 | +} |
1351 | + |
1352 | +DownloadStateStruct& DownloadStateStruct::operator=(const DownloadStateStruct& other) { |
1353 | + _state = other._state; |
1354 | + _url = other._url; |
1355 | + _filePath= other._filePath; |
1356 | + _hash = other._hash; |
1357 | + |
1358 | + return *this; |
1359 | +} |
1360 | + |
1361 | +QDBusArgument &operator<<(QDBusArgument &argument, |
1362 | + const DownloadStateStruct& download) { |
1363 | + argument.beginStructure(); |
1364 | + argument << download._state; |
1365 | + argument << download._url; |
1366 | + argument << download._filePath; |
1367 | + argument << download._hash; |
1368 | + argument.endStructure(); |
1369 | + |
1370 | + return argument; |
1371 | +} |
1372 | + |
1373 | +const QDBusArgument &operator>>(const QDBusArgument &argument, |
1374 | + DownloadStateStruct& download) { |
1375 | + argument.beginStructure(); |
1376 | + argument >> download._state; |
1377 | + argument >> download._url; |
1378 | + argument >> download._filePath; |
1379 | + argument >> download._hash; |
1380 | + argument.endStructure(); |
1381 | + |
1382 | + return argument; |
1383 | +} |
1384 | + |
1385 | +int |
1386 | +DownloadStateStruct::getState() const { |
1387 | + return _state; |
1388 | +} |
1389 | + |
1390 | +QString |
1391 | +DownloadStateStruct::getUrl() const { |
1392 | + return _url; |
1393 | +} |
1394 | + |
1395 | +QString |
1396 | +DownloadStateStruct::getFilePath() const { |
1397 | + return _filePath; |
1398 | +} |
1399 | + |
1400 | +QString |
1401 | +DownloadStateStruct::getHash() const { |
1402 | + return _hash; |
1403 | +} |
1404 | + |
1405 | +bool |
1406 | +DownloadStateStruct::isValid() { |
1407 | + return _url != QString::null; |
1408 | +} |
1409 | + |
1410 | +} // DownloadManager |
1411 | + |
1412 | +} // Ubuntu |
1413 | + |
1414 | |
1415 | === added file 'src/downloads/common/ubuntu/download_manager/download_state_struct.h' |
1416 | --- src/downloads/common/ubuntu/download_manager/download_state_struct.h 1970-01-01 00:00:00 +0000 |
1417 | +++ src/downloads/common/ubuntu/download_manager/download_state_struct.h 2015-12-16 02:32:33 +0000 |
1418 | @@ -0,0 +1,152 @@ |
1419 | +/* |
1420 | + * Copyright 2015 Canonical Ltd. |
1421 | + * |
1422 | + * This library is free software; you can redistribute it and/or |
1423 | + * modify it under the terms of version 3 of the GNU Lesser General Public |
1424 | + * License as published by the Free Software Foundation. |
1425 | + * |
1426 | + * This program is distributed in the hope that it will be useful, |
1427 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1428 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1429 | + * General Public License for more details. |
1430 | + * |
1431 | + * You should have received a copy of the GNU Lesser General Public |
1432 | + * License along with this library; if not, write to the |
1433 | + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
1434 | + * Boston, MA 02110-1301, USA. |
1435 | + */ |
1436 | + |
1437 | +#ifndef DOWNLOAD_STATE_STRUCT_H |
1438 | +#define DOWNLOAD_STATE_STRUCT_H |
1439 | + |
1440 | +#include <QString> |
1441 | + |
1442 | +class QDBusArgument; |
1443 | +namespace Ubuntu { |
1444 | + |
1445 | +namespace DownloadManager { |
1446 | + |
1447 | +namespace Daemon { |
1448 | +class DownloadsDb; |
1449 | +} |
1450 | + |
1451 | +/*! |
1452 | + \class DownloadStateStruct |
1453 | + \brief The DownloadStateStruct represents the dbus structure that is used |
1454 | + to communicate the download manager the details of a past or |
1455 | + current download. |
1456 | + \since 1.1 |
1457 | + |
1458 | + The DownloadStateStruct allows to get the basic information of a download that |
1459 | + was created by an application in the download manager. |
1460 | +*/ |
1461 | +class DownloadStateStruct { |
1462 | + Q_PROPERTY(int state READ getState) |
1463 | + Q_PROPERTY(QString url READ getUrl) |
1464 | + Q_PROPERTY(QString filePath READ getFilePath) |
1465 | + Q_PROPERTY(QString hash READ getHash) |
1466 | + |
1467 | + friend class Ubuntu::DownloadManager::Daemon::DownloadsDb; |
1468 | + |
1469 | + public: |
1470 | + |
1471 | + /* |
1472 | + Default constructor. |
1473 | + */ |
1474 | + DownloadStateStruct(); |
1475 | + |
1476 | + /* |
1477 | + Copy constructor. |
1478 | + */ |
1479 | + DownloadStateStruct(const DownloadStateStruct& other); |
1480 | + |
1481 | + /* |
1482 | + Assign operator. |
1483 | + */ |
1484 | + DownloadStateStruct& operator=(const DownloadStateStruct& other); |
1485 | + |
1486 | + /* |
1487 | + \internal |
1488 | + */ |
1489 | + friend QDBusArgument &operator<<(QDBusArgument &argument, const DownloadStateStruct& download); |
1490 | + |
1491 | + /* |
1492 | + \internal |
1493 | + */ |
1494 | + friend const QDBusArgument &operator>>(const QDBusArgument &argument, DownloadStateStruct& download); |
1495 | + |
1496 | + /* |
1497 | + \fn QString getUrl() |
1498 | + |
1499 | + Returns the url that points to the file that will be downloaded. |
1500 | + */ |
1501 | + int getState() const; |
1502 | + |
1503 | + /* |
1504 | + \fn QString getUrl() |
1505 | + |
1506 | + Returns the url that points to the file that will be downloaded. |
1507 | + */ |
1508 | + QString getUrl() const; |
1509 | + |
1510 | + /* |
1511 | + \fn QString getUrl() |
1512 | + |
1513 | + Returns the url that points to the file that will be downloaded. |
1514 | + */ |
1515 | + QString getFilePath() const; |
1516 | + |
1517 | + /* |
1518 | + \fn QString getUrl() |
1519 | + |
1520 | + Returns the url that points to the file that will be downloaded. |
1521 | + */ |
1522 | + QString getHash() const; |
1523 | + |
1524 | + /* |
1525 | + \fn bool isValid(); |
1526 | + |
1527 | + Returns if the download state if valid. |
1528 | + */ |
1529 | + bool isValid(); |
1530 | + |
1531 | + protected: |
1532 | + |
1533 | + /* |
1534 | + \internal |
1535 | + */ |
1536 | + DownloadStateStruct(int state, const QString& url, const QString& hash=QString::null); |
1537 | + |
1538 | + /* |
1539 | + \internal |
1540 | + */ |
1541 | + DownloadStateStruct(int state, const QString& url, const QString& filePath, const QString& hash=QString::null); |
1542 | + |
1543 | + private: |
1544 | + |
1545 | + /* |
1546 | + \internal |
1547 | + */ |
1548 | + int _state = -1; |
1549 | + |
1550 | + /* |
1551 | + \internal |
1552 | + */ |
1553 | + QString _url = QString::null; |
1554 | + |
1555 | + /* |
1556 | + \internal |
1557 | + */ |
1558 | + QString _filePath = QString::null; |
1559 | + |
1560 | + /* |
1561 | + \internal |
1562 | + */ |
1563 | + QString _hash = QString::null; |
1564 | +}; |
1565 | + |
1566 | +} |
1567 | + |
1568 | +} |
1569 | + |
1570 | +#endif |
1571 | |
1572 | === modified file 'src/downloads/common/ubuntu/download_manager/metatypes.h' |
1573 | --- src/downloads/common/ubuntu/download_manager/metatypes.h 2015-02-25 16:24:24 +0000 |
1574 | +++ src/downloads/common/ubuntu/download_manager/metatypes.h 2015-12-16 02:32:33 +0000 |
1575 | @@ -25,6 +25,7 @@ |
1576 | #include <ubuntu/transfers/errors/http_error_struct.h> |
1577 | #include <ubuntu/transfers/errors/network_error_struct.h> |
1578 | #include <ubuntu/transfers/errors/process_error_struct.h> |
1579 | +#include "download_state_struct.h" |
1580 | #include "download_struct.h" |
1581 | #include "group_download_struct.h" |
1582 | |
1583 | @@ -40,6 +41,7 @@ |
1584 | Q_DECLARE_METATYPE(NetworkErrorStruct) |
1585 | Q_DECLARE_METATYPE(ProcessErrorStruct) |
1586 | Q_DECLARE_METATYPE(DownloadStruct) |
1587 | +Q_DECLARE_METATYPE(DownloadStateStruct) |
1588 | Q_DECLARE_METATYPE(StringMap) |
1589 | Q_DECLARE_METATYPE(StructList) |
1590 | |
1591 | |
1592 | === modified file 'src/downloads/priv/CMakeLists.txt' |
1593 | --- src/downloads/priv/CMakeLists.txt 2014-11-17 23:07:13 +0000 |
1594 | +++ src/downloads/priv/CMakeLists.txt 2015-12-16 02:32:33 +0000 |
1595 | @@ -12,7 +12,7 @@ |
1596 | ubuntu/downloads/file_download.cpp |
1597 | ubuntu/downloads/group_download.cpp |
1598 | ubuntu/downloads/group_download_adaptor.cpp |
1599 | - ubuntu/downloads/header_parser.cpp |
1600 | + ubuntu/downloads/header_parser.cpp |
1601 | ubuntu/downloads/manager.cpp |
1602 | ubuntu/downloads/mms_file_download.cpp |
1603 | ubuntu/downloads/sm_file_download.cpp |
1604 | @@ -33,7 +33,7 @@ |
1605 | ubuntu/downloads/file_download.h |
1606 | ubuntu/downloads/group_download.h |
1607 | ubuntu/downloads/group_download_adaptor.h |
1608 | - ubuntu/downloads/header_parser.h |
1609 | + ubuntu/downloads/header_parser.h |
1610 | ubuntu/downloads/manager.h |
1611 | ubuntu/downloads/mms_file_download.h |
1612 | ubuntu/downloads/sm_file_download.h |
1613 | |
1614 | === modified file 'src/downloads/priv/ubuntu/downloads/download.cpp' |
1615 | --- src/downloads/priv/ubuntu/downloads/download.cpp 2014-09-17 15:42:53 +0000 |
1616 | +++ src/downloads/priv/ubuntu/downloads/download.cpp 2015-12-16 02:32:33 +0000 |
1617 | @@ -68,7 +68,7 @@ |
1618 | bool |
1619 | Download::showInIndicator() const { |
1620 | return (_metadata.contains(Metadata::SHOW_IN_INDICATOR_KEY))? |
1621 | - _metadata.value(Metadata::SHOW_IN_INDICATOR_KEY).toBool():true; |
1622 | + _metadata.value(Metadata::SHOW_IN_INDICATOR_KEY).toBool():false; |
1623 | } |
1624 | |
1625 | QString |
1626 | |
1627 | === modified file 'src/downloads/priv/ubuntu/downloads/download.h' |
1628 | --- src/downloads/priv/ubuntu/downloads/download.h 2014-12-01 09:20:00 +0000 |
1629 | +++ src/downloads/priv/ubuntu/downloads/download.h 2015-12-16 02:32:33 +0000 |
1630 | @@ -43,6 +43,7 @@ |
1631 | Q_PROPERTY(QString ClickPackage READ clickPackage) |
1632 | Q_PROPERTY(bool ShowInIndicator READ showInIndicator) |
1633 | Q_PROPERTY(QString Title READ title) |
1634 | + Q_PROPERTY(QString DownloadOwner READ destinationApp) |
1635 | |
1636 | public: |
1637 | Download(const QString& id, |
1638 | @@ -77,12 +78,15 @@ |
1639 | // rename the transfer method |
1640 | Transfer::allowGSMData(allowed); |
1641 | } |
1642 | + |
1643 | virtual bool isGSMDownloadAllowed() { |
1644 | return Transfer::isGSMDataAllowed(); |
1645 | } |
1646 | + |
1647 | virtual StringMap headers() const { |
1648 | return _headers; |
1649 | } |
1650 | + |
1651 | virtual void setHeaders(StringMap headers) { |
1652 | _headers = headers; |
1653 | } |
1654 | @@ -91,9 +95,22 @@ |
1655 | _metadata = data; |
1656 | } |
1657 | |
1658 | + virtual QString destinationApp() { |
1659 | + return _destinationApp; |
1660 | + } |
1661 | + |
1662 | + virtual void setDownloadOwner(const QString& owner) { |
1663 | + _destinationApp = owner; |
1664 | + } |
1665 | + |
1666 | + virtual int stateInt() const { |
1667 | + return Transfer::state(); |
1668 | + } |
1669 | + |
1670 | // slots to be implemented by the children |
1671 | virtual qulonglong progress() = 0; |
1672 | virtual qulonglong totalSize() = 0; |
1673 | + virtual QString filePath() = 0; |
1674 | |
1675 | signals: |
1676 | // signals that are exposed via dbus |
1677 | @@ -110,6 +127,7 @@ |
1678 | QVariantMap _metadata; |
1679 | |
1680 | private: |
1681 | + QString _destinationApp = QString::null; |
1682 | QMap<QString, QString> _headers; |
1683 | QMap<QString, QObject*> _adaptors; |
1684 | }; |
1685 | @@ -120,4 +138,4 @@ |
1686 | |
1687 | } // Ubuntu |
1688 | |
1689 | -#endif // DOWNLOADER_LIB_APP_DOWNLOAD_H |
1690 | +#endif |
1691 | |
1692 | === modified file 'src/downloads/priv/ubuntu/downloads/download_adaptor.cpp' |
1693 | --- src/downloads/priv/ubuntu/downloads/download_adaptor.cpp 2014-09-05 15:11:35 +0000 |
1694 | +++ src/downloads/priv/ubuntu/downloads/download_adaptor.cpp 2015-12-16 02:32:33 +0000 |
1695 | @@ -2,10 +2,9 @@ |
1696 | * This file was generated by qdbusxml2cpp version 0.8 |
1697 | * Command line was: qdbusxml2cpp -c DownloadAdaptor -a download_adaptor.h:download_adaptor.cpp com.canonical.applications.download.xml |
1698 | * |
1699 | - * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
1700 | + * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
1701 | * |
1702 | - * This is an auto-generated file. |
1703 | - * Do not edit! All changes made to it will be lost. |
1704 | + * This file has been manually edited to wrap the state -> stateInt methods |
1705 | */ |
1706 | |
1707 | #include "download_adaptor.h" |
1708 | @@ -39,6 +38,12 @@ |
1709 | return qvariant_cast< QString >(parent()->property("ClickPackage")); |
1710 | } |
1711 | |
1712 | +QString DownloadAdaptor::destinationApp() const |
1713 | +{ |
1714 | + // get the value of property DownloadOwner |
1715 | + return qvariant_cast< QString >(parent()->property("DownloadOwner")); |
1716 | +} |
1717 | + |
1718 | bool DownloadAdaptor::showInIndicator() const |
1719 | { |
1720 | // get the value of property ShowInIndicator |
1721 | @@ -63,6 +68,20 @@ |
1722 | QMetaObject::invokeMethod(parent(), "cancel"); |
1723 | } |
1724 | |
1725 | +void DownloadAdaptor::collected() |
1726 | +{ |
1727 | + // handle method call com.canonical.applications.Download.collected |
1728 | + QMetaObject::invokeMethod(parent(), "collected"); |
1729 | +} |
1730 | + |
1731 | +QString DownloadAdaptor::filePath() |
1732 | +{ |
1733 | + // handle method call com.canonical.applications.Download.filePath |
1734 | + QString filePath; |
1735 | + QMetaObject::invokeMethod(parent(), "filePath", Q_RETURN_ARG(QString, filePath)); |
1736 | + return filePath; |
1737 | +} |
1738 | + |
1739 | StringMap DownloadAdaptor::headers() |
1740 | { |
1741 | // handle method call com.canonical.applications.Download.headers |
1742 | @@ -137,6 +156,15 @@ |
1743 | QMetaObject::invokeMethod(parent(), "start"); |
1744 | } |
1745 | |
1746 | +int DownloadAdaptor::state() |
1747 | +{ |
1748 | + // handle method call com.canonical.applications.Download.state |
1749 | + int state; |
1750 | + QMetaObject::invokeMethod(parent(), "stateInt", Q_RETURN_ARG(int, state)); |
1751 | + |
1752 | + return state; |
1753 | +} |
1754 | + |
1755 | qulonglong DownloadAdaptor::throttle() |
1756 | { |
1757 | // handle method call com.canonical.applications.Download.throttle |
1758 | |
1759 | === modified file 'src/downloads/priv/ubuntu/downloads/download_adaptor.h' |
1760 | --- src/downloads/priv/ubuntu/downloads/download_adaptor.h 2015-02-25 16:24:24 +0000 |
1761 | +++ src/downloads/priv/ubuntu/downloads/download_adaptor.h 2015-12-16 02:32:33 +0000 |
1762 | @@ -2,15 +2,15 @@ |
1763 | * This file was generated by qdbusxml2cpp version 0.8 |
1764 | * Command line was: qdbusxml2cpp -c DownloadAdaptor -a download_adaptor.h:download_adaptor.cpp com.canonical.applications.download.xml |
1765 | * |
1766 | - * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
1767 | + * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
1768 | * |
1769 | * This is an auto-generated file. |
1770 | * This file may have been hand-edited. Look for HAND-EDIT comments |
1771 | * before re-generating it. |
1772 | */ |
1773 | |
1774 | -#ifndef DOWNLOAD_ADAPTOR_H_1392117488 |
1775 | -#define DOWNLOAD_ADAPTOR_H_1392117488 |
1776 | +#ifndef DOWNLOAD_ADAPTOR_H_1446124951 |
1777 | +#define DOWNLOAD_ADAPTOR_H_1446124951 |
1778 | |
1779 | #include <QtCore/QObject> |
1780 | #include <QtDBus/QtDBus> |
1781 | @@ -71,10 +71,17 @@ |
1782 | " <method name=\"isGSMDownloadAllowed\">\n" |
1783 | " <arg direction=\"out\" type=\"b\" name=\"allowed\"/>\n" |
1784 | " </method>\n" |
1785 | +" <method name=\"filePath\">\n" |
1786 | +" <arg direction=\"out\" type=\"s\" name=\"filepath\"/>\n" |
1787 | +" </method>\n" |
1788 | +" <method name=\"state\">\n" |
1789 | +" <arg direction=\"out\" type=\"i\" name=\"state\"/>\n" |
1790 | +" </method\n" |
1791 | " <method name=\"start\"/>\n" |
1792 | " <method name=\"pause\"/>\n" |
1793 | " <method name=\"resume\"/>\n" |
1794 | " <method name=\"cancel\"/>\n" |
1795 | +" <method name=\"collected\"/>\n" |
1796 | " <signal name=\"started\">\n" |
1797 | " <arg direction=\"out\" type=\"b\" name=\"success\"/>\n" |
1798 | " </signal>\n" |
1799 | @@ -123,6 +130,7 @@ |
1800 | " <property access=\"read\" type=\"b\" name=\"ShowInIndicator\"/>\n" |
1801 | " <property access=\"read\" type=\"s\" name=\"Title\"/>\n" |
1802 | " <property access=\"read\" type=\"s\" name=\"ClickPackage\"/>\n" |
1803 | +" <property access=\"read\" type=\"s\" name=\"DestinationApp\"/>\n" |
1804 | " </interface>\n" |
1805 | "") |
1806 | public: |
1807 | @@ -133,6 +141,9 @@ |
1808 | Q_PROPERTY(QString ClickPackage READ clickPackage) |
1809 | QString clickPackage() const; |
1810 | |
1811 | + Q_PROPERTY(QString DestinationApp READ destinationApp) |
1812 | + QString destinationApp() const; |
1813 | + |
1814 | Q_PROPERTY(bool ShowInIndicator READ showInIndicator) |
1815 | bool showInIndicator() const; |
1816 | |
1817 | @@ -142,6 +153,8 @@ |
1818 | public Q_SLOTS: // METHODS |
1819 | void allowGSMDownload(bool allowed); |
1820 | void cancel(); |
1821 | + void collected(); |
1822 | + QString filePath(); |
1823 | StringMap headers(); |
1824 | bool isGSMDownloadAllowed(); |
1825 | QVariantMap metadata(); |
1826 | @@ -153,6 +166,7 @@ |
1827 | void setMetadata(const QVariantMap &data); |
1828 | void setThrottle(qulonglong speed); |
1829 | void start(); |
1830 | + int state(); |
1831 | qulonglong throttle(); |
1832 | qulonglong totalSize(); |
1833 | Q_SIGNALS: // SIGNALS |
1834 | |
1835 | === modified file 'src/downloads/priv/ubuntu/downloads/download_manager_adaptor.cpp' |
1836 | --- src/downloads/priv/ubuntu/downloads/download_manager_adaptor.cpp 2014-03-18 12:07:06 +0000 |
1837 | +++ src/downloads/priv/ubuntu/downloads/download_manager_adaptor.cpp 2015-12-16 02:32:33 +0000 |
1838 | @@ -2,7 +2,7 @@ |
1839 | * This file was generated by qdbusxml2cpp version 0.8 |
1840 | * Command line was: qdbusxml2cpp -c DownloadManagerAdaptor -a download_manager_adaptor.h:download_manager_adaptor.cpp -i metatypes.h com.canonical.applications.download_manager.xml |
1841 | * |
1842 | - * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). |
1843 | + * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
1844 | * |
1845 | * This is an auto-generated file. |
1846 | * Do not edit! All changes made to it will be lost. |
1847 | @@ -83,11 +83,11 @@ |
1848 | QMetaObject::invokeMethod(parent(), "exit"); |
1849 | } |
1850 | |
1851 | -QList<QDBusObjectPath> DownloadManagerAdaptor::getAllDownloads() |
1852 | +QList<QDBusObjectPath> DownloadManagerAdaptor::getAllDownloads(const QString &appId, bool uncollected) |
1853 | { |
1854 | // handle method call com.canonical.applications.DownloadManager.getAllDownloads |
1855 | QList<QDBusObjectPath> downloads; |
1856 | - QMetaObject::invokeMethod(parent(), "getAllDownloads", Q_RETURN_ARG(QList<QDBusObjectPath>, downloads)); |
1857 | + QMetaObject::invokeMethod(parent(), "getAllDownloads", Q_RETURN_ARG(QList<QDBusObjectPath>, downloads), Q_ARG(QString, appId), Q_ARG(bool, uncollected)); |
1858 | return downloads; |
1859 | } |
1860 | |
1861 | @@ -99,6 +99,14 @@ |
1862 | return downloads; |
1863 | } |
1864 | |
1865 | +DownloadStateStruct DownloadManagerAdaptor::getDownloadState(const QString &downloadId) |
1866 | +{ |
1867 | + // handle method call com.canonical.applications.DownloadManager.getDownloadState |
1868 | + DownloadStateStruct state; |
1869 | + QMetaObject::invokeMethod(parent(), "getDownloadState", Q_RETURN_ARG(DownloadStateStruct, state), Q_ARG(QString, downloadId)); |
1870 | + return state; |
1871 | +} |
1872 | + |
1873 | bool DownloadManagerAdaptor::isGSMDownloadAllowed() |
1874 | { |
1875 | // handle method call com.canonical.applications.DownloadManager.isGSMDownloadAllowed |
1876 | |
1877 | === modified file 'src/downloads/priv/ubuntu/downloads/download_manager_adaptor.h' |
1878 | --- src/downloads/priv/ubuntu/downloads/download_manager_adaptor.h 2014-03-18 12:07:06 +0000 |
1879 | +++ src/downloads/priv/ubuntu/downloads/download_manager_adaptor.h 2015-12-16 02:32:33 +0000 |
1880 | @@ -2,7 +2,7 @@ |
1881 | * This file was generated by qdbusxml2cpp version 0.8 |
1882 | * Command line was: qdbusxml2cpp -c DownloadManagerAdaptor -a download_manager_adaptor.h:download_manager_adaptor.cpp -i metatypes.h com.canonical.applications.download_manager.xml |
1883 | * |
1884 | - * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). |
1885 | + * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
1886 | * |
1887 | * This is an auto-generated file. |
1888 | * This file may have been hand-edited. Look for HAND-EDIT comments |
1889 | @@ -63,6 +63,8 @@ |
1890 | " <arg direction=\"out\" type=\"o\" name=\"download\"/>\n" |
1891 | " </method>\n" |
1892 | " <method name=\"getAllDownloads\">\n" |
1893 | +" <arg direction=\"in\" type=\"s\" name=\"appId\"/>\n" |
1894 | +" <arg direction=\"in\" type=\"b\" name=\"uncollected\"/>\n" |
1895 | " <arg direction=\"out\" type=\"ao\" name=\"downloads\"/>\n" |
1896 | " </method>\n" |
1897 | " <method name=\"getAllDownloadsWithMetadata\">\n" |
1898 | @@ -70,6 +72,11 @@ |
1899 | " <arg direction=\"in\" type=\"s\" name=\"value\"/>\n" |
1900 | " <arg direction=\"out\" type=\"ao\" name=\"downloads\"/>\n" |
1901 | " </method>\n" |
1902 | +" <method name=\"getDownloadState\">\n" |
1903 | +" <annotation value=\"DownloadStateStruct\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n" |
1904 | +" <arg direction=\"in\" type=\"s\" name=\"downloadId\"/>\n" |
1905 | +" <arg direction=\"out\" type=\"(issss)\" name=\"state\"/>\n" |
1906 | +" </method>\n" |
1907 | " <method name=\"setDefaultThrottle\">\n" |
1908 | " <arg direction=\"in\" type=\"t\" name=\"speed\"/>\n" |
1909 | " </method>\n" |
1910 | @@ -100,8 +107,9 @@ |
1911 | QDBusObjectPath createMmsDownload(const QString &url, const QString &hostname, int port); |
1912 | qulonglong defaultThrottle(); |
1913 | void exit(); |
1914 | - QList<QDBusObjectPath> getAllDownloads(); |
1915 | + QList<QDBusObjectPath> getAllDownloads(const QString &appId, bool uncollected); |
1916 | QList<QDBusObjectPath> getAllDownloadsWithMetadata(const QString &name, const QString &value); |
1917 | + DownloadStateStruct getDownloadState(const QString &downloadId); |
1918 | bool isGSMDownloadAllowed(); |
1919 | void setDefaultThrottle(qulonglong speed); |
1920 | Q_SIGNALS: // SIGNALS |
1921 | |
1922 | === modified file 'src/downloads/priv/ubuntu/downloads/downloads_db.cpp' |
1923 | --- src/downloads/priv/ubuntu/downloads/downloads_db.cpp 2014-04-15 15:15:28 +0000 |
1924 | +++ src/downloads/priv/ubuntu/downloads/downloads_db.cpp 2015-12-16 02:32:33 +0000 |
1925 | @@ -29,6 +29,7 @@ |
1926 | #include <unistd.h> |
1927 | #include "ubuntu/transfers/system/logger.h" |
1928 | #include "downloads_db.h" |
1929 | +#include "download_adaptor.h" |
1930 | |
1931 | namespace { |
1932 | const QString SINGLE_DOWNLOAD_TABLE = "CREATE TABLE IF NOT EXISTS SingleDownload("\ |
1933 | @@ -75,14 +76,26 @@ |
1934 | "throttle=:throttle, metadata=:metadata, headers=:headers "\ |
1935 | "WHERE uuid=:uuid"; |
1936 | |
1937 | + const QString GET_SINGLE_DOWNLOAD_STATE = "SELECT state, url, local_path, hash FROM SingleDownload "\ |
1938 | + "WHERE uuid=:uuid"; |
1939 | + |
1940 | + const QString GET_UNCOLLECTED_DOWNLOADS = "SELECT uuid, appId, url, dbus_path, "\ |
1941 | + "local_path, hash, hash_algo, state FROM SingleDownload "\ |
1942 | + "WHERE appId=:appId AND state='uncoll'"; |
1943 | + |
1944 | + const QString UPDATE_UNCOLLECTED_DOWNLOADS = "UPDATE SingleDownload SET state='finish' "\ |
1945 | + "WHERE state='uncoll' AND appId=:appId"; |
1946 | + |
1947 | const QString IDLE_STRING = "idle"; |
1948 | const QString START_STRING = "start"; |
1949 | const QString PAUSE_STRING = "pause"; |
1950 | const QString RESUME_STRING = "resume"; |
1951 | const QString CANCEL_STRING = "cancel"; |
1952 | + const QString UNCOLLECTED_STRING = "uncoll"; |
1953 | const QString FINISH_STRING = "finish"; |
1954 | const QString ERROR_STRING = "error"; |
1955 | |
1956 | + const QString DOWNLOAD_INTERFACE = "com.canonical.applications.Download"; |
1957 | } |
1958 | |
1959 | namespace Ubuntu { |
1960 | @@ -178,6 +191,8 @@ |
1961 | return RESUME_STRING; |
1962 | case Download::CANCEL: |
1963 | return CANCEL_STRING; |
1964 | + case Download::UNCOLLECTED: |
1965 | + return UNCOLLECTED_STRING; |
1966 | case Download::FINISH: |
1967 | return FINISH_STRING; |
1968 | case Download::ERROR: |
1969 | @@ -200,6 +215,8 @@ |
1970 | return Download::RESUME; |
1971 | if (lowerState == CANCEL_STRING) |
1972 | return Download::CANCEL; |
1973 | + if (lowerState == UNCOLLECTED_STRING) |
1974 | + return Download::UNCOLLECTED; |
1975 | if (lowerState == FINISH_STRING) |
1976 | return Download::FINISH; |
1977 | if (lowerState == ERROR_STRING) |
1978 | @@ -235,6 +252,94 @@ |
1979 | return false; |
1980 | } |
1981 | |
1982 | +DownloadStateStruct |
1983 | +DownloadsDb::getDownloadState(const QString &downloadId) { |
1984 | + bool opened = _db.open(); |
1985 | + |
1986 | + if (!opened) { |
1987 | + LOG(ERROR) << _db.lastError().text(); |
1988 | + return DownloadStateStruct(); |
1989 | + } |
1990 | + |
1991 | + QSqlQuery query; |
1992 | + // QString GET_SINGLE_DOWNLOAD_STATE = "SELECT state, url, local_path, hash FROM SingleDownload " |
1993 | + // "WHERE uuid=:uuid"; |
1994 | + query.prepare(GET_SINGLE_DOWNLOAD_STATE); |
1995 | + query.bindValue(":uuid", downloadId); |
1996 | + |
1997 | + bool success = query.exec(); |
1998 | + if (success && query.next()) { |
1999 | + // grab the data and create the state structure |
2000 | + auto state = stringToState(query.value(0).toString()); |
2001 | + auto url = query.value(1).toString(); |
2002 | + auto localPath = query.value(2).toString(); |
2003 | + auto hash = query.value(3).isValid()?query.value(3).toString():""; |
2004 | + |
2005 | + DownloadStateStruct result(state, url, localPath, hash); |
2006 | + _db.close(); |
2007 | + |
2008 | + return result; |
2009 | + } |
2010 | + if (!success) { |
2011 | + LOG(ERROR) << query.lastError().text(); |
2012 | + } |
2013 | + return DownloadStateStruct(); |
2014 | +} |
2015 | + |
2016 | +QList<Download*> |
2017 | +DownloadsDb::getUncollectedDownloads(const QString &appId) { |
2018 | + bool opened = _db.open(); |
2019 | + QList<Download*> downloadList; |
2020 | + |
2021 | + if (!opened) { |
2022 | + LOG(ERROR) << _db.lastError().text(); |
2023 | + return downloadList; |
2024 | + } |
2025 | + |
2026 | + QSqlQuery query; |
2027 | + query.prepare(GET_UNCOLLECTED_DOWNLOADS); |
2028 | + query.bindValue(":appId", appId); |
2029 | + |
2030 | + bool success = query.exec(); |
2031 | + if (!success) { |
2032 | + LOG(ERROR) << query.lastError().text(); |
2033 | + _db.close(); |
2034 | + return downloadList; |
2035 | + } |
2036 | + while (query.next()) { |
2037 | + auto uuid = query.value(0).toString(); |
2038 | + auto appId = query.value(1).toString(); |
2039 | + auto url = query.value(2).toString(); |
2040 | + auto dbusPath = query.value(3).toString(); |
2041 | + auto filePath = query.value(4).toString(); |
2042 | + auto basePath = QFileInfo(filePath).absolutePath(); |
2043 | + auto hash = query.value(5).isValid() ? query.value(5).toString() : ""; |
2044 | + auto algo = query.value(6).isValid() ? query.value(6).toString() : ""; |
2045 | + auto state = stringToState(query.value(7).toString()); |
2046 | + QVariantMap metadata; |
2047 | + QMap<QString, QString> headers; |
2048 | + FileDownload *download = new FileDownload(uuid, appId, dbusPath, 1, basePath, url, hash, algo, metadata, headers); |
2049 | + download->setState(state); |
2050 | + download->setFilePath(filePath); |
2051 | + auto downAdaptor = new DownloadAdaptor(download); |
2052 | + download->setAdaptor(DOWNLOAD_INTERFACE, downAdaptor); |
2053 | + |
2054 | + downloadList << download; |
2055 | + |
2056 | + } |
2057 | + |
2058 | + QSqlQuery updateQuery; |
2059 | + updateQuery.prepare(UPDATE_UNCOLLECTED_DOWNLOADS); |
2060 | + updateQuery.bindValue(":appId", appId); |
2061 | + success = updateQuery.exec(); |
2062 | + if (!success) { |
2063 | + LOG(ERROR) << updateQuery.lastError().text(); |
2064 | + } |
2065 | + |
2066 | + _db.close(); |
2067 | + return downloadList; |
2068 | +} |
2069 | + |
2070 | bool |
2071 | DownloadsDb::storeSingleDownload(FileDownload* download) { |
2072 | // decide if we store it as a new download or update an existing one |
2073 | |
2074 | === modified file 'src/downloads/priv/ubuntu/downloads/downloads_db.h' |
2075 | --- src/downloads/priv/ubuntu/downloads/downloads_db.h 2014-02-26 16:23:46 +0000 |
2076 | +++ src/downloads/priv/ubuntu/downloads/downloads_db.h 2015-12-16 02:32:33 +0000 |
2077 | @@ -21,7 +21,10 @@ |
2078 | |
2079 | #include <QSqlDatabase> |
2080 | #include <QObject> |
2081 | -#include "ubuntu/transfers/system/file_manager.h" |
2082 | + |
2083 | +#include <ubuntu/transfers/system/file_manager.h> |
2084 | +#include <ubuntu/download_manager/download_state_struct.h> |
2085 | + |
2086 | #include "file_download.h" |
2087 | |
2088 | namespace Ubuntu { |
2089 | @@ -45,7 +48,11 @@ |
2090 | QString filename(); |
2091 | bool dbExists(); // return if the db is present and valid |
2092 | bool init(); // init or update the db |
2093 | + |
2094 | virtual bool store(Download* down); |
2095 | + virtual DownloadStateStruct getDownloadState(const QString &downloadId); |
2096 | + virtual QList<Download*> getUncollectedDownloads(const QString &appId); |
2097 | + |
2098 | bool storeSingleDownload(FileDownload* download); |
2099 | void connectToDownload(Download* download); |
2100 | void disconnectFromDownload(Download* download); |
2101 | @@ -79,4 +86,4 @@ |
2102 | |
2103 | } // Ubuntu |
2104 | |
2105 | -#endif // DOWNLOADER_LIB_DOWNLOADS_DATABASE_H |
2106 | +#endif |
2107 | |
2108 | === modified file 'src/downloads/priv/ubuntu/downloads/factory.cpp' |
2109 | --- src/downloads/priv/ubuntu/downloads/factory.cpp 2014-10-22 23:32:28 +0000 |
2110 | +++ src/downloads/priv/ubuntu/downloads/factory.cpp 2015-12-16 02:32:33 +0000 |
2111 | @@ -80,7 +80,13 @@ |
2112 | QScopedPointer<SecurityDetails> details( |
2113 | getSecurityDetails(dbusOwner, metadata)); |
2114 | auto dbusPath = details->dbusPath.arg("download"); |
2115 | - auto down = new FileDownload(details->id, details->appId, |
2116 | + QString appId = details->appId; |
2117 | + if (!details->isConfined && metadata.contains(Metadata::APP_ID)) { |
2118 | + // If we're unconfined use the metadata app id to |
2119 | + // distinguish between different unconfined apps |
2120 | + appId = metadata[Metadata::APP_ID].toString(); |
2121 | + } |
2122 | + auto down = new FileDownload(details->id, appId, |
2123 | dbusPath, details->isConfined, details->localPath, url, metadata, headers); |
2124 | auto downAdaptor = new DownloadAdaptor(down); |
2125 | down->setAdaptor(DOWNLOAD_INTERFACE, downAdaptor); |
2126 | |
2127 | === modified file 'src/downloads/priv/ubuntu/downloads/file_download.cpp' |
2128 | --- src/downloads/priv/ubuntu/downloads/file_download.cpp 2015-02-25 16:24:24 +0000 |
2129 | +++ src/downloads/priv/ubuntu/downloads/file_download.cpp 2015-12-16 02:32:33 +0000 |
2130 | @@ -1095,7 +1095,7 @@ |
2131 | } |
2132 | } |
2133 | |
2134 | - setState(Download::FINISH); |
2135 | + setState(Download::UNCOLLECTED); |
2136 | unlockFilePath(); |
2137 | |
2138 | DOWN_LOG(INFO) << "EMIT finished" << filePath(); |
2139 | @@ -1211,6 +1211,18 @@ |
2140 | Download::emitError(error); |
2141 | } |
2142 | |
2143 | +void |
2144 | +FileDownload::setFilePath(const QString& filePath) { |
2145 | + // Used to recreate downloads from the database with the correct path |
2146 | + _fileNameMutex->unlockFileName(_filePath); |
2147 | + _filePath = filePath; |
2148 | +} |
2149 | + |
2150 | +QString |
2151 | +FileDownload::filePath() { |
2152 | + return _filePath; |
2153 | +} |
2154 | + |
2155 | } // Daemon |
2156 | |
2157 | } // DownloadManager |
2158 | |
2159 | === modified file 'src/downloads/priv/ubuntu/downloads/file_download.h' |
2160 | --- src/downloads/priv/ubuntu/downloads/file_download.h 2015-02-25 16:24:24 +0000 |
2161 | +++ src/downloads/priv/ubuntu/downloads/file_download.h 2015-12-16 02:32:33 +0000 |
2162 | @@ -71,10 +71,6 @@ |
2163 | return _url; |
2164 | } |
2165 | |
2166 | - virtual QString filePath() const { |
2167 | - return _filePath; |
2168 | - } |
2169 | - |
2170 | virtual QString hash() const { |
2171 | return _hash; |
2172 | } |
2173 | @@ -89,6 +85,8 @@ |
2174 | virtual void resumeTransfer() override; |
2175 | virtual void startTransfer() override; |
2176 | |
2177 | + void setFilePath(const QString& path); |
2178 | + |
2179 | public slots: // NOLINT(whitespace/indent) |
2180 | qulonglong progress() override; |
2181 | qulonglong totalSize() override; |
2182 | @@ -96,6 +94,7 @@ |
2183 | virtual void setDestinationDir(const QString& path); |
2184 | virtual void setHeaders(StringMap headers) override; |
2185 | virtual void setMetadata(const QVariantMap& metadata) override; |
2186 | + virtual QString filePath() override; |
2187 | |
2188 | signals: |
2189 | void finished(const QString& path); |
2190 | |
2191 | === modified file 'src/downloads/priv/ubuntu/downloads/group_download.cpp' |
2192 | --- src/downloads/priv/ubuntu/downloads/group_download.cpp 2014-05-21 15:17:52 +0000 |
2193 | +++ src/downloads/priv/ubuntu/downloads/group_download.cpp 2015-12-16 02:32:33 +0000 |
2194 | @@ -275,6 +275,13 @@ |
2195 | return total; |
2196 | } |
2197 | |
2198 | +QString |
2199 | +GroupDownload::filePath() { |
2200 | + // A group download never has a file path of its own, each individual |
2201 | + // download within the group has its own path |
2202 | + return ""; |
2203 | +} |
2204 | + |
2205 | void |
2206 | GroupDownload::onError(const QString& error) { |
2207 | TRACE; |
2208 | |
2209 | === modified file 'src/downloads/priv/ubuntu/downloads/group_download.h' |
2210 | --- src/downloads/priv/ubuntu/downloads/group_download.h 2014-10-22 23:40:53 +0000 |
2211 | +++ src/downloads/priv/ubuntu/downloads/group_download.h 2015-12-16 02:32:33 +0000 |
2212 | @@ -63,6 +63,7 @@ |
2213 | virtual qulonglong progress(qulonglong &started, qulonglong &paused, |
2214 | qulonglong &finished); |
2215 | virtual qulonglong totalSize() override; |
2216 | + virtual QString filePath() override; |
2217 | |
2218 | signals: |
2219 | void finished(const QStringList &path); |
2220 | |
2221 | === modified file 'src/downloads/priv/ubuntu/downloads/manager.cpp' |
2222 | --- src/downloads/priv/ubuntu/downloads/manager.cpp 2015-02-25 16:24:24 +0000 |
2223 | +++ src/downloads/priv/ubuntu/downloads/manager.cpp 2015-12-16 02:32:33 +0000 |
2224 | @@ -133,8 +133,27 @@ |
2225 | return caller; |
2226 | } |
2227 | |
2228 | +QString |
2229 | +DownloadManager::getDownloadOwner(const QVariantMap& metadata) { |
2230 | + QScopedPointer<System::AppArmor> appArmor(new System::AppArmor(_conn)); |
2231 | + auto owner = getCaller(); |
2232 | + auto appId = appArmor->appId(owner); |
2233 | + if(appArmor->isConfined(appId)) { |
2234 | + return appId; |
2235 | + } else { |
2236 | + if (metadata.contains(Metadata::APP_ID)){ |
2237 | + return metadata[Metadata::APP_ID].toString(); |
2238 | + } else { |
2239 | + return ""; |
2240 | + } |
2241 | + } |
2242 | + return ""; |
2243 | +} |
2244 | + |
2245 | QDBusObjectPath |
2246 | DownloadManager::registerDownload(Download* download) { |
2247 | + download->setDownloadOwner(getDownloadOwner(download->metadata())); |
2248 | + |
2249 | download->setThrottle(_throttle); |
2250 | download->allowGSMDownload(_allowMobileData); |
2251 | if (!_db->store(download)) { |
2252 | @@ -262,25 +281,35 @@ |
2253 | } |
2254 | |
2255 | QList<QDBusObjectPath> |
2256 | -DownloadManager::getAllDownloads() { |
2257 | +DownloadManager::getAllDownloads(const QString& appId, bool uncollected) { |
2258 | // filter per app id if owner is not "" and the app is confined else |
2259 | // return all downloads |
2260 | QScopedPointer<System::AppArmor> appArmor(new System::AppArmor(_conn)); |
2261 | auto owner = getCaller(); |
2262 | - auto appId = appArmor->appId(owner); |
2263 | + auto ownerId = appArmor->appId(owner); |
2264 | + QString getId; |
2265 | + if (appArmor->isConfined(ownerId)) { |
2266 | + getId = ownerId; |
2267 | + } else { |
2268 | + getId = appId; |
2269 | + } |
2270 | QList<QDBusObjectPath> paths; |
2271 | - if (appArmor->isConfined(appId)) { |
2272 | - LOG(INFO) << "Returning downloads for api with id" << appId; |
2273 | - auto transfers = _queue->transfers(); |
2274 | - foreach(const QString& path, transfers.keys()) { |
2275 | - auto t = transfers[path]; |
2276 | - if (t->transferAppId() == appId) |
2277 | + if (uncollected) { |
2278 | + paths = getUncollectedDownloads(getId); |
2279 | + } else { |
2280 | + if (!getId.isEmpty()) { |
2281 | + LOG(INFO) << "Returning downloads for api with id" << getId; |
2282 | + auto transfers = _queue->transfers(); |
2283 | + foreach(const QString& path, transfers.keys()) { |
2284 | + auto t = transfers[path]; |
2285 | + if (t->transferAppId() == getId) |
2286 | + paths << QDBusObjectPath(path); |
2287 | + } |
2288 | + } else { |
2289 | + LOG(INFO) << "Returning all downloads for unconfined app"; |
2290 | + foreach(const QString& path, _queue->paths()) |
2291 | paths << QDBusObjectPath(path); |
2292 | } |
2293 | - } else { |
2294 | - LOG(INFO) << "Returning all downloads for unconfined app"; |
2295 | - foreach(const QString& path, _queue->paths()) |
2296 | - paths << QDBusObjectPath(path); |
2297 | } |
2298 | return paths; |
2299 | } |
2300 | @@ -315,6 +344,45 @@ |
2301 | return paths; |
2302 | } |
2303 | |
2304 | +QList<QDBusObjectPath> |
2305 | +DownloadManager::getUncollectedDownloads(const QString &appId) { |
2306 | + QScopedPointer<System::AppArmor> appArmor(new System::AppArmor(_conn)); |
2307 | + auto owner = getCaller(); |
2308 | + auto callerAppId = appArmor->appId(owner); |
2309 | + QList<QDBusObjectPath> paths; |
2310 | + QString testAppId = appId; |
2311 | + if (appArmor->isConfined(callerAppId)) { |
2312 | + // Confined apps always get their own downloads returned |
2313 | + testAppId = callerAppId; |
2314 | + } |
2315 | + |
2316 | + LOG(INFO) << "Returning uncollected downloads for app with id" << testAppId; |
2317 | + |
2318 | + // Fetch uncollected downloads that are still in memory |
2319 | + auto transfers = _queue->transfers(); |
2320 | + foreach(const QString& path, transfers.keys()) { |
2321 | + auto t = transfers[path]; |
2322 | + if (t->transferAppId() == testAppId && t->state() != Transfer::FINISH |
2323 | + && t->state() != Transfer::CANCEL |
2324 | + && t->state() != Transfer::ERROR) |
2325 | + paths << QDBusObjectPath(path); |
2326 | + } |
2327 | + |
2328 | + // Fetch uncollected downloads from previous UDM sessions that are |
2329 | + // in the database |
2330 | + foreach(Download *download, _db->getUncollectedDownloads(testAppId)) { |
2331 | + _conn->registerObject(download->path(), download); |
2332 | + paths << QDBusObjectPath(download->path()); |
2333 | + } |
2334 | + |
2335 | + return paths; |
2336 | +} |
2337 | + |
2338 | +DownloadStateStruct |
2339 | +DownloadManager::getDownloadState(const QString &downloadId) { |
2340 | + return _db->getDownloadState(downloadId); |
2341 | +} |
2342 | + |
2343 | } // Daemon |
2344 | |
2345 | } // DownloadManager |
2346 | |
2347 | === modified file 'src/downloads/priv/ubuntu/downloads/manager.h' |
2348 | --- src/downloads/priv/ubuntu/downloads/manager.h 2014-07-30 09:19:10 +0000 |
2349 | +++ src/downloads/priv/ubuntu/downloads/manager.h 2015-12-16 02:32:33 +0000 |
2350 | @@ -19,14 +19,17 @@ |
2351 | #ifndef DOWNLOADER_LIB_DOWNLOADER_H |
2352 | #define DOWNLOADER_LIB_DOWNLOADER_H |
2353 | |
2354 | +#include <functional> |
2355 | + |
2356 | +#include <QByteArray> |
2357 | +#include <QDBusObjectPath> |
2358 | #include <QObject> |
2359 | -#include <QByteArray> |
2360 | -#include <QtDBus/QDBusObjectPath> |
2361 | #include <QSslCertificate> |
2362 | + |
2363 | #include <ubuntu/transfers/queue.h> |
2364 | #include <ubuntu/transfers/system/dbus_connection.h> |
2365 | #include <ubuntu/download_manager/metatypes.h> |
2366 | -#include <functional> |
2367 | + |
2368 | #include "ubuntu/transfers/base_manager.h" |
2369 | #include "ubuntu/transfers/system/application.h" |
2370 | #include "download.h" |
2371 | @@ -80,10 +83,13 @@ |
2372 | virtual void setDefaultThrottle(qulonglong speed); |
2373 | virtual void allowGSMDownload(bool allowed); |
2374 | virtual bool isGSMDownloadAllowed(); |
2375 | - virtual QList<QDBusObjectPath> getAllDownloads(); |
2376 | + virtual QList<QDBusObjectPath> getAllDownloads(const QString& appId = "", bool uncollected = false); |
2377 | virtual QList<QDBusObjectPath> getAllDownloadsWithMetadata( |
2378 | const QString& name, |
2379 | const QString& value); |
2380 | + virtual QList<QDBusObjectPath> getUncollectedDownloads( |
2381 | + const QString& appId); |
2382 | + virtual DownloadStateStruct getDownloadState(const QString &downloadId); |
2383 | signals: |
2384 | void downloadCreated(const QDBusObjectPath& path); |
2385 | |
2386 | @@ -95,7 +101,6 @@ |
2387 | virtual QDBusObjectPath registerDownload(Download* download); |
2388 | |
2389 | private: |
2390 | - |
2391 | typedef std::function<Download*(QString)> DownloadCreationFunc; |
2392 | |
2393 | void init(); |
2394 | @@ -109,6 +114,7 @@ |
2395 | StringMap headers); |
2396 | void onDownloadsChanged(QString); |
2397 | QString getCaller(); |
2398 | + QString getDownloadOwner(const QVariantMap& metadata); |
2399 | |
2400 | private: |
2401 | Application* _app = nullptr; |
2402 | @@ -126,4 +132,5 @@ |
2403 | } // DownloadManager |
2404 | |
2405 | } // Manager |
2406 | -#endif // DOWNLOADER_LIB_DOWNLOADER_H |
2407 | + |
2408 | +#endif |
2409 | |
2410 | === modified file 'src/downloads/priv/ubuntu/downloads/state_machines/download_sm.h' |
2411 | --- src/downloads/priv/ubuntu/downloads/state_machines/download_sm.h 2014-02-21 12:46:26 +0000 |
2412 | +++ src/downloads/priv/ubuntu/downloads/state_machines/download_sm.h 2015-12-16 02:32:33 +0000 |
2413 | @@ -157,6 +157,7 @@ |
2414 | static QString POST_PROCESSING; |
2415 | static QString ERROR; |
2416 | static QString CANCELED; |
2417 | + static QString UNCOLLECTED; |
2418 | static QString FINISHED; |
2419 | |
2420 | signals: |
2421 | |
2422 | === modified file 'src/downloads/qml/CMakeLists.txt' |
2423 | --- src/downloads/qml/CMakeLists.txt 2014-09-05 14:40:54 +0000 |
2424 | +++ src/downloads/qml/CMakeLists.txt 2015-12-16 02:32:33 +0000 |
2425 | @@ -5,6 +5,7 @@ |
2426 | backend.cpp |
2427 | metadata.cpp |
2428 | download_error.cpp |
2429 | + download_history.cpp |
2430 | single_download.cpp |
2431 | ubuntu_download_manager.cpp |
2432 | ) |
2433 | @@ -13,6 +14,7 @@ |
2434 | backend.h |
2435 | metadata.h |
2436 | download_error.h |
2437 | + download_history.h |
2438 | single_download.h |
2439 | ubuntu_download_manager.h |
2440 | ) |
2441 | |
2442 | === modified file 'src/downloads/qml/backend.cpp' |
2443 | --- src/downloads/qml/backend.cpp 2014-09-23 10:38:11 +0000 |
2444 | +++ src/downloads/qml/backend.cpp 2015-12-16 02:32:33 +0000 |
2445 | @@ -15,6 +15,10 @@ |
2446 | qmlRegisterType<Ubuntu::DownloadManager::Metadata>(uri, 0, 1, "Metadata"); |
2447 | qmlRegisterType<Ubuntu::DownloadManager::SingleDownload>(uri, 0, 1, "SingleDownload"); |
2448 | qmlRegisterType<Ubuntu::DownloadManager::UbuntuDownloadManager>(uri, 0, 1, "DownloadManager"); |
2449 | + qmlRegisterType<Ubuntu::DownloadManager::DownloadError>(uri, 1, 2, "Error"); |
2450 | + qmlRegisterType<Ubuntu::DownloadManager::Metadata>(uri, 1, 2, "Metadata"); |
2451 | + qmlRegisterType<Ubuntu::DownloadManager::SingleDownload>(uri, 1, 2, "SingleDownload"); |
2452 | + qmlRegisterType<Ubuntu::DownloadManager::UbuntuDownloadManager>(uri, 1, 2, "DownloadManager"); |
2453 | } |
2454 | |
2455 | void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri) |
2456 | |
2457 | === added file 'src/downloads/qml/download_history.cpp' |
2458 | --- src/downloads/qml/download_history.cpp 1970-01-01 00:00:00 +0000 |
2459 | +++ src/downloads/qml/download_history.cpp 2015-12-16 02:32:33 +0000 |
2460 | @@ -0,0 +1,143 @@ |
2461 | +#include "download_history.h" |
2462 | +#include <glog/logging.h> |
2463 | +#include <ubuntu/download_manager/download_struct.h> |
2464 | +#include <QCoreApplication> |
2465 | + |
2466 | +namespace Ubuntu { |
2467 | + |
2468 | +namespace DownloadManager { |
2469 | + |
2470 | +DownloadHistory::DownloadHistory(QObject *parent) : |
2471 | + QObject(parent), |
2472 | + m_manager(nullptr) |
2473 | +{ |
2474 | + m_manager = Manager::createSessionManager("", this); |
2475 | + |
2476 | + CHECK(connect(m_manager, &Manager::downloadsFound, |
2477 | + this, &DownloadHistory::downloadsFound)) |
2478 | + << "Could not connect to signal"; |
2479 | + |
2480 | + // Get previous downloads for this app |
2481 | + auto environment = QProcessEnvironment::systemEnvironment(); |
2482 | + if (environment.contains("APP_ID")) { |
2483 | + m_manager->getAllDownloads(environment.value("APP_ID"), true); |
2484 | + } else { |
2485 | + m_manager->getAllDownloads(QCoreApplication::applicationFilePath(), true); |
2486 | + } |
2487 | +} |
2488 | + |
2489 | +DownloadHistory *DownloadHistory::instance() |
2490 | +{ |
2491 | + static DownloadHistory *downloadHistory = new DownloadHistory(); |
2492 | + return downloadHistory; |
2493 | +} |
2494 | + |
2495 | +QVariantList DownloadHistory::downloads() const |
2496 | +{ |
2497 | + return m_downloads; |
2498 | +} |
2499 | + |
2500 | +void DownloadHistory::addDownload(SingleDownload *singleDownload) |
2501 | +{ |
2502 | + m_downloads.append(QVariant::fromValue(singleDownload)); |
2503 | + CHECK(connect(singleDownload, &SingleDownload::finished, |
2504 | + this, &DownloadHistory::downloadCompleted)) |
2505 | + << "Could not connect to signal"; |
2506 | + CHECK(connect(singleDownload, &SingleDownload::errorFound, |
2507 | + this, &DownloadHistory::onError)) |
2508 | + << "Could not connect to signal"; |
2509 | + CHECK(connect(singleDownload, &SingleDownload::paused, |
2510 | + this, &DownloadHistory::onPaused)) |
2511 | + << "Could not connect to signal"; |
2512 | + CHECK(connect(singleDownload, &SingleDownload::resumed, |
2513 | + this, &DownloadHistory::onResumed)) |
2514 | + << "Could not connect to signal"; |
2515 | + CHECK(connect(singleDownload, &SingleDownload::canceled, |
2516 | + this, &DownloadHistory::onCanceled)) |
2517 | + << "Could not connect to signal"; |
2518 | + emit downloadsChanged(); |
2519 | +} |
2520 | + |
2521 | +void DownloadHistory::downloadsFound(DownloadsList* downloadsList) |
2522 | +{ |
2523 | + foreach(QSharedPointer<Download> download, downloadsList->downloads()) { |
2524 | + SingleDownload* singleDownload = new SingleDownload(this); |
2525 | + singleDownload->bindDownload(download.data()); |
2526 | + if (download.data()->state() == Download::UNCOLLECTED && !download.data()->filePath().isEmpty()) { |
2527 | + emit singleDownload->finished(download.data()->filePath()); |
2528 | + } |
2529 | + } |
2530 | + emit downloadsChanged(); |
2531 | +} |
2532 | + |
2533 | +bool DownloadHistory::cleanDownloads() const |
2534 | +{ |
2535 | + return m_cleanDownloads; |
2536 | +} |
2537 | + |
2538 | +void DownloadHistory::setCleanDownloads(bool value) |
2539 | +{ |
2540 | + m_cleanDownloads = value; |
2541 | + if (m_cleanDownloads) { |
2542 | + QVariantList newList; |
2543 | + foreach(QVariant var, m_downloads) { |
2544 | + SingleDownload *download = qobject_cast<SingleDownload*>(var.value<SingleDownload*>()); |
2545 | + if (download != nullptr && !download->isCompleted()) { |
2546 | + newList.append(QVariant::fromValue(download)); |
2547 | + } else { |
2548 | + download->deleteLater(); |
2549 | + } |
2550 | + } |
2551 | + m_downloads = newList; |
2552 | + emit downloadsChanged(); |
2553 | + } |
2554 | +} |
2555 | + |
2556 | +void DownloadHistory::downloadCompleted(const QString& path) |
2557 | +{ |
2558 | + SingleDownload* download = qobject_cast<SingleDownload*>(sender()); |
2559 | + if (download != nullptr) { |
2560 | + emit downloadFinished(download, path); |
2561 | + if (m_cleanDownloads) { |
2562 | + int index = m_downloads.indexOf(QVariant::fromValue(download)); |
2563 | + m_downloads.removeAt(index); |
2564 | + emit downloadsChanged(); |
2565 | + } |
2566 | + } |
2567 | +} |
2568 | + |
2569 | +void DownloadHistory::onError(DownloadError& downloadError) |
2570 | +{ |
2571 | + Q_UNUSED(downloadError); |
2572 | + SingleDownload* download = qobject_cast<SingleDownload*>(sender()); |
2573 | + if (download != nullptr) { |
2574 | + emit errorFound(download); |
2575 | + } |
2576 | +} |
2577 | + |
2578 | +void DownloadHistory::onPaused() |
2579 | +{ |
2580 | + SingleDownload* download = qobject_cast<SingleDownload*>(sender()); |
2581 | + if (download != nullptr) { |
2582 | + emit downloadPaused(download); |
2583 | + } |
2584 | +} |
2585 | + |
2586 | +void DownloadHistory::onResumed() |
2587 | +{ |
2588 | + SingleDownload* download = qobject_cast<SingleDownload*>(sender()); |
2589 | + if (download != nullptr) { |
2590 | + emit downloadResumed(download); |
2591 | + } |
2592 | +} |
2593 | + |
2594 | +void DownloadHistory::onCanceled() |
2595 | +{ |
2596 | + SingleDownload* download = qobject_cast<SingleDownload*>(sender()); |
2597 | + if (download != nullptr) { |
2598 | + emit downloadCanceled(download); |
2599 | + } |
2600 | +} |
2601 | + |
2602 | +} |
2603 | +} |
2604 | |
2605 | === added file 'src/downloads/qml/download_history.h' |
2606 | --- src/downloads/qml/download_history.h 1970-01-01 00:00:00 +0000 |
2607 | +++ src/downloads/qml/download_history.h 2015-12-16 02:32:33 +0000 |
2608 | @@ -0,0 +1,69 @@ |
2609 | +/* |
2610 | + * Copyright 2015 Canonical Ltd. |
2611 | + * |
2612 | + * This library is free software; you can redistribute it and/or |
2613 | + * modify it under the terms of version 3 of the GNU Lesser General Public |
2614 | + * License as published by the Free Software Foundation. |
2615 | + * |
2616 | + * This program is distributed in the hope that it will be useful, |
2617 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2618 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2619 | + * General Public License for more details. |
2620 | + * |
2621 | + * You should have received a copy of the GNU Lesser General Public |
2622 | + * License along with this library; if not, write to the |
2623 | + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
2624 | + * Boston, MA 02110-1301, USA. |
2625 | + */ |
2626 | + |
2627 | +#ifndef DOWNLOAD_HISTORY_H |
2628 | +#define DOWNLOAD_HISTORY_H |
2629 | + |
2630 | +#include <ubuntu/download_manager/manager.h> |
2631 | +#include <ubuntu/download_manager/downloads_list.h> |
2632 | + |
2633 | +#include "single_download.h" |
2634 | + |
2635 | +namespace Ubuntu { |
2636 | + |
2637 | +namespace DownloadManager { |
2638 | + |
2639 | +class DownloadHistory : public QObject { |
2640 | + Q_OBJECT |
2641 | + |
2642 | + public: |
2643 | + explicit DownloadHistory(QObject* parent=0); |
2644 | + static DownloadHistory *instance(); |
2645 | + |
2646 | + QVariantList downloads() const; |
2647 | + void downloadsFound(DownloadsList* downloadsList); |
2648 | + void addDownload(SingleDownload *singleDownload); |
2649 | + bool cleanDownloads() const; |
2650 | + void setCleanDownloads(bool value); |
2651 | + |
2652 | + signals: |
2653 | + void downloadsChanged(); |
2654 | + void downloadFinished(SingleDownload *singleDownload, const QString& path); |
2655 | + void errorFound(SingleDownload *download); |
2656 | + void downloadPaused(SingleDownload *singleDownload); |
2657 | + void downloadResumed(SingleDownload *singleDownload); |
2658 | + void downloadCanceled(SingleDownload *singleDownload); |
2659 | + |
2660 | + private slots: |
2661 | + void downloadCompleted(const QString& path); |
2662 | + void onError(DownloadError& error); |
2663 | + void onPaused(); |
2664 | + void onResumed(); |
2665 | + void onCanceled(); |
2666 | + |
2667 | + private: |
2668 | + Manager* m_manager; |
2669 | + QVariantList m_downloads; |
2670 | + bool m_cleanDownloads; |
2671 | +}; |
2672 | + |
2673 | +} // Ubuntu |
2674 | + |
2675 | +} // DownloadManager |
2676 | + |
2677 | +#endif |
2678 | |
2679 | === modified file 'src/downloads/qml/single_download.cpp' |
2680 | --- src/downloads/qml/single_download.cpp 2014-10-07 14:44:11 +0000 |
2681 | +++ src/downloads/qml/single_download.cpp 2015-12-16 02:32:33 +0000 |
2682 | @@ -20,6 +20,7 @@ |
2683 | #include <ubuntu/download_manager/download_struct.h> |
2684 | |
2685 | #include "single_download.h" |
2686 | +#include "download_history.h" |
2687 | |
2688 | namespace Ubuntu { |
2689 | |
2690 | @@ -28,7 +29,7 @@ |
2691 | /*! |
2692 | \qmltype SingleDownload |
2693 | \instantiates SingleDownload |
2694 | - \inqmlmodule Ubuntu.DownloadManager 0.1 |
2695 | + \inqmlmodule Ubuntu.DownloadManager 1.2 |
2696 | \ingroup download |
2697 | \brief Manage file downloads and tracking the progress. |
2698 | |
2699 | @@ -39,8 +40,8 @@ |
2700 | |
2701 | \qml |
2702 | import QtQuick 2.0 |
2703 | - import Ubuntu.Components 0.1 |
2704 | - import Ubuntu.DownloadManager 0.1 |
2705 | + import Ubuntu.Components 1.2 |
2706 | + import Ubuntu.DownloadManager 1.2 |
2707 | |
2708 | Rectangle { |
2709 | width: units.gu(100) |
2710 | @@ -152,8 +153,6 @@ |
2711 | &SingleDownload::onStarted)) |
2712 | << "Could not connect to signal"; |
2713 | |
2714 | - emit downloadIdChanged(); |
2715 | - |
2716 | // is the current in memory setting dirty, if they are, we do set the before we |
2717 | // start |
2718 | if (m_dirty) { |
2719 | @@ -169,6 +168,14 @@ |
2720 | if (m_manager != nullptr && m_autoStart) { |
2721 | startDownload(); |
2722 | } |
2723 | + |
2724 | + DownloadHistory::instance()->addDownload(this); |
2725 | + |
2726 | + // Keep a record of the downloadId so clients can still access the property |
2727 | + // after a download has finished |
2728 | + m_downloadId = m_download->id(); |
2729 | + |
2730 | + emit downloadIdChanged(); |
2731 | } |
2732 | |
2733 | void |
2734 | @@ -222,7 +229,9 @@ |
2735 | &SingleDownload::bindDownload)) |
2736 | << "Could not connect to signal"; |
2737 | } |
2738 | - DownloadStruct dstruct(url); |
2739 | + Metadata metadata; |
2740 | + QMap<QString, QString> headers; |
2741 | + DownloadStruct dstruct(url, metadata.map(), headers); |
2742 | m_manager->createDownload(dstruct); |
2743 | } else { |
2744 | m_error.setMessage("Current download still in progress."); |
2745 | @@ -258,7 +267,9 @@ |
2746 | void |
2747 | SingleDownload::pause() |
2748 | { |
2749 | - m_download->pause(); |
2750 | + if (m_download != nullptr) { |
2751 | + m_download->pause(); |
2752 | + } |
2753 | } |
2754 | |
2755 | /*! |
2756 | @@ -270,7 +281,9 @@ |
2757 | void |
2758 | SingleDownload::resume() |
2759 | { |
2760 | - m_download->resume(); |
2761 | + if (m_download != nullptr) { |
2762 | + m_download->resume(); |
2763 | + } |
2764 | } |
2765 | |
2766 | /*! |
2767 | @@ -281,7 +294,9 @@ |
2768 | void |
2769 | SingleDownload::cancel() |
2770 | { |
2771 | - m_download->cancel(); |
2772 | + if (m_download != nullptr) { |
2773 | + m_download->cancel(); |
2774 | + } |
2775 | } |
2776 | |
2777 | void |
2778 | @@ -301,8 +316,6 @@ |
2779 | |
2780 | // unbind the download so that we have no memory leaks due to the connections |
2781 | unbindDownload(m_download); |
2782 | - m_download->deleteLater(); |
2783 | - m_download = nullptr; |
2784 | emit finished(path); |
2785 | } |
2786 | |
2787 | @@ -346,15 +359,13 @@ |
2788 | |
2789 | // unbind the download so that we have no memory leaks due to the connections |
2790 | unbindDownload(m_download); |
2791 | - m_download->deleteLater(); |
2792 | - m_download = nullptr; |
2793 | emit canceled(wasCanceled); |
2794 | } |
2795 | |
2796 | bool |
2797 | SingleDownload::allowMobileDownload() const { |
2798 | if (m_download == nullptr) { |
2799 | - return m_mobile; |
2800 | + return m_mobile; |
2801 | } else { |
2802 | return m_download->isMobileDownloadAllowed(); |
2803 | } |
2804 | @@ -412,7 +423,7 @@ |
2805 | QString |
2806 | SingleDownload::downloadId() const { |
2807 | if (m_download == nullptr) { |
2808 | - return ""; |
2809 | + return m_downloadId; |
2810 | } else { |
2811 | return m_download->id(); |
2812 | } |
2813 | @@ -577,11 +588,20 @@ |
2814 | */ |
2815 | |
2816 | /*! |
2817 | - \qmlproperty QVariantMap SingleDownload:metadata: |
2818 | + \qmlproperty QVariantMap SingleDownload::metadata |
2819 | |
2820 | This property allows to get and set the metadata that will be linked to |
2821 | the download request. |
2822 | */ |
2823 | |
2824 | +/*! |
2825 | + \qmlsignal SingleDownload::downloadFinished(QString path) |
2826 | + |
2827 | + This signal is emitted when a download has finished. The downloaded file |
2828 | + path is provided via the 'path' paremeter. The corresponding handler is |
2829 | + \c onDownloadFinished |
2830 | +*/ |
2831 | + |
2832 | + |
2833 | } |
2834 | } |
2835 | |
2836 | === modified file 'src/downloads/qml/single_download.h' |
2837 | --- src/downloads/qml/single_download.h 2015-02-02 11:22:26 +0000 |
2838 | +++ src/downloads/qml/single_download.h 2015-12-16 02:32:33 +0000 |
2839 | @@ -171,6 +171,7 @@ |
2840 | DownloadError m_error; |
2841 | Download* m_download = nullptr; |
2842 | Manager* m_manager = nullptr; |
2843 | + QString m_downloadId; |
2844 | |
2845 | }; |
2846 | |
2847 | |
2848 | === modified file 'src/downloads/qml/ubuntu_download_manager.cpp' |
2849 | --- src/downloads/qml/ubuntu_download_manager.cpp 2014-05-07 12:27:08 +0000 |
2850 | +++ src/downloads/qml/ubuntu_download_manager.cpp 2015-12-16 02:32:33 +0000 |
2851 | @@ -1,6 +1,8 @@ |
2852 | #include "ubuntu_download_manager.h" |
2853 | +#include "download_history.h" |
2854 | #include <glog/logging.h> |
2855 | #include <ubuntu/download_manager/download_struct.h> |
2856 | +#include <QDebug> |
2857 | |
2858 | namespace Ubuntu { |
2859 | |
2860 | @@ -9,7 +11,7 @@ |
2861 | /*! |
2862 | \qmltype DownloadManager |
2863 | \instantiates DownloadManager |
2864 | - \inqmlmodule Ubuntu.DownloadManager 0.1 |
2865 | + \inqmlmodule Ubuntu.DownloadManager 1.2 |
2866 | \ingroup download |
2867 | \brief Manage downloads for several files. |
2868 | |
2869 | @@ -23,8 +25,8 @@ |
2870 | |
2871 | \qml |
2872 | import QtQuick 2.0 |
2873 | - import Ubuntu.Components 0.1 |
2874 | - import Ubuntu.DownloadManager 0.1 |
2875 | + import Ubuntu.Components 1.2 |
2876 | + import Ubuntu.DownloadManager 1.2 |
2877 | |
2878 | Rectangle { |
2879 | width: units.gu(100) |
2880 | @@ -89,6 +91,24 @@ |
2881 | CHECK(connect(m_manager, &Manager::downloadCreated, |
2882 | this, &UbuntuDownloadManager::downloadFileCreated)) |
2883 | << "Could not connect to signal"; |
2884 | + CHECK(connect(DownloadHistory::instance(), &DownloadHistory::downloadsChanged, |
2885 | + this, &UbuntuDownloadManager::downloadsChanged)) |
2886 | + << "Could not connect to signal"; |
2887 | + CHECK(connect(DownloadHistory::instance(), &DownloadHistory::downloadFinished, |
2888 | + this, &UbuntuDownloadManager::downloadFinished)) |
2889 | + << "Could not connect to signal"; |
2890 | + CHECK(connect(DownloadHistory::instance(), &DownloadHistory::downloadPaused, |
2891 | + this, &UbuntuDownloadManager::downloadPaused)) |
2892 | + << "Could not connect to signal"; |
2893 | + CHECK(connect(DownloadHistory::instance(), &DownloadHistory::downloadResumed, |
2894 | + this, &UbuntuDownloadManager::downloadResumed)) |
2895 | + << "Could not connect to signal"; |
2896 | + CHECK(connect(DownloadHistory::instance(), &DownloadHistory::downloadCanceled, |
2897 | + this, &UbuntuDownloadManager::downloadCanceled)) |
2898 | + << "Could not connect to signal"; |
2899 | + CHECK(connect(DownloadHistory::instance(), &DownloadHistory::errorFound, |
2900 | + this, &UbuntuDownloadManager::errorFound)) |
2901 | + << "Could not connect to signal"; |
2902 | } |
2903 | |
2904 | UbuntuDownloadManager::~UbuntuDownloadManager() |
2905 | @@ -96,7 +116,6 @@ |
2906 | if (m_manager != nullptr) { |
2907 | m_manager->deleteLater(); |
2908 | } |
2909 | - m_downloads.clear(); |
2910 | } |
2911 | |
2912 | /*! |
2913 | @@ -106,7 +125,9 @@ |
2914 | */ |
2915 | void UbuntuDownloadManager::download(QString url) |
2916 | { |
2917 | - DownloadStruct dstruct(url); |
2918 | + Metadata metadata; |
2919 | + QMap<QString, QString> headers; |
2920 | + DownloadStruct dstruct(url, metadata.map(), headers); |
2921 | m_manager->createDownload(dstruct); |
2922 | } |
2923 | |
2924 | @@ -116,12 +137,7 @@ |
2925 | CHECK(connect(singleDownload, &SingleDownload::errorFound, |
2926 | this, &UbuntuDownloadManager::registerError)) |
2927 | << "Could not connect to signal"; |
2928 | - CHECK(connect(singleDownload, &SingleDownload::finished, |
2929 | - this, &UbuntuDownloadManager::downloadCompleted)) |
2930 | - << "Could not connect to signal"; |
2931 | singleDownload->bindDownload(download); |
2932 | - m_downloads.append(QVariant::fromValue(singleDownload)); |
2933 | - emit downloadsChanged(); |
2934 | if (m_autoStart) { |
2935 | singleDownload->startDownload(); |
2936 | } |
2937 | @@ -132,41 +148,25 @@ |
2938 | Q_UNUSED(group); |
2939 | } |
2940 | |
2941 | -void UbuntuDownloadManager::registerError(DownloadError& error) |
2942 | +void UbuntuDownloadManager::registerError(DownloadError& downloadError) |
2943 | { |
2944 | - m_errorMessage = error.message(); |
2945 | + m_errorMessage = downloadError.message(); |
2946 | emit errorChanged(); |
2947 | } |
2948 | |
2949 | +bool UbuntuDownloadManager::cleanDownloads() const |
2950 | +{ |
2951 | + return DownloadHistory::instance()->cleanDownloads(); |
2952 | +} |
2953 | + |
2954 | void UbuntuDownloadManager::setCleanDownloads(bool value) |
2955 | { |
2956 | - m_cleanDownloads = value; |
2957 | - if (m_cleanDownloads) { |
2958 | - QVariantList newList; |
2959 | - foreach(QVariant var, m_downloads) { |
2960 | - SingleDownload *download = qobject_cast<SingleDownload*>(var.value<SingleDownload*>()); |
2961 | - if (download != nullptr && !download->isCompleted()) { |
2962 | - newList.append(QVariant::fromValue(download)); |
2963 | - } else { |
2964 | - download->deleteLater(); |
2965 | - } |
2966 | - } |
2967 | - m_downloads = newList; |
2968 | - emit downloadsChanged(); |
2969 | - } |
2970 | + DownloadHistory::instance()->setCleanDownloads(value); |
2971 | } |
2972 | |
2973 | -void UbuntuDownloadManager::downloadCompleted() |
2974 | +QVariantList UbuntuDownloadManager::downloads() |
2975 | { |
2976 | - if (m_cleanDownloads) { |
2977 | - SingleDownload* download = qobject_cast<SingleDownload*>(sender()); |
2978 | - if (download != nullptr) { |
2979 | - int index = m_downloads.indexOf(QVariant::fromValue(download)); |
2980 | - m_downloads.removeAt(index); |
2981 | - emit downloadsChanged(); |
2982 | - download->deleteLater(); |
2983 | - } |
2984 | - } |
2985 | + return DownloadHistory::instance()->downloads(); |
2986 | } |
2987 | |
2988 | /*! |
2989 | @@ -198,5 +198,47 @@ |
2990 | started, and let a custom delegate how to represent the UI for each download. |
2991 | */ |
2992 | |
2993 | +/*! |
2994 | + \qmlsignal DownloadManager::errorFound(SingleDownload download) |
2995 | + \since Ubuntu.DownloadManager 1.2 |
2996 | + |
2997 | + This signal is emitted when an error occurs in a download. The download in which the |
2998 | + error occurred is provided via the 'download' parameter, from which the error message |
2999 | + can be accessed via download.errorMessage. The corresponding handler is \c onErrorFound |
3000 | +*/ |
3001 | + |
3002 | +/*! |
3003 | + \qmlsignal DownloadManager::downloadFinished(SingleDownload download, QString path) |
3004 | + \since Ubuntu.DownloadManager 1.2 |
3005 | + |
3006 | + This signal is emitted when a download has finished. The finished download is provided |
3007 | + via the 'download' parameter and the downloaded file path is provided via the 'path' |
3008 | + paremeter. The corresponding handler is \c onDownloadFinished |
3009 | +*/ |
3010 | + |
3011 | +/*! |
3012 | + \qmlsignal DownloadManager::downloadPaused(SingleDownload download) |
3013 | + \since Ubuntu.DownloadManager 1.2 |
3014 | + |
3015 | + This signal is emitted when a download has been paused. The paused download is provided |
3016 | + via the 'download' parameter. The corresponding handler is \c onDownloadPaused |
3017 | +*/ |
3018 | + |
3019 | +/*! |
3020 | + \qmlsignal DownloadManager::downloadResumed(SingleDownload download) |
3021 | + \since Ubuntu.DownloadManager 1.2 |
3022 | + |
3023 | + This signal is emitted when a download has been resumed. The resumed download is provided |
3024 | + via the 'download' parameter. The corresponding handler is \c onDownloadResumed |
3025 | +*/ |
3026 | + |
3027 | +/*! |
3028 | + \qmlsignal DownloadManager::downloadCanceled(SingleDownload download) |
3029 | + \since Ubuntu.DownloadManager 1.2 |
3030 | + |
3031 | + This signal is emitted when a download has been canceled. The canceled download is provided |
3032 | + via the 'download' parameter. The corresponding handler is \c onDownloadCanceled |
3033 | +*/ |
3034 | } |
3035 | + |
3036 | } |
3037 | |
3038 | === modified file 'src/downloads/qml/ubuntu_download_manager.h' |
3039 | --- src/downloads/qml/ubuntu_download_manager.h 2014-06-25 08:46:25 +0000 |
3040 | +++ src/downloads/qml/ubuntu_download_manager.h 2015-12-16 02:32:33 +0000 |
3041 | @@ -45,27 +45,31 @@ |
3042 | |
3043 | Q_INVOKABLE void download(QString url); |
3044 | |
3045 | - QVariantList downloads() { return m_downloads; } |
3046 | + QVariantList downloads(); |
3047 | QString errorMessage() const { return m_errorMessage; } |
3048 | bool autoStart() const { return m_autoStart; } |
3049 | - bool cleanDownloads() const { return m_cleanDownloads; } |
3050 | + bool cleanDownloads() const; |
3051 | void setCleanDownloads(bool value); |
3052 | void setAutoStart(bool value) { m_autoStart = value; } |
3053 | |
3054 | signals: |
3055 | void errorChanged(); |
3056 | void downloadsChanged(); |
3057 | + void downloadFinished(SingleDownload *download, const QString& path); |
3058 | + void errorFound(SingleDownload *download); |
3059 | + void downloadPaused(SingleDownload *download); |
3060 | + void downloadResumed(SingleDownload *download); |
3061 | + void downloadCanceled(SingleDownload *download); |
3062 | |
3063 | private slots: |
3064 | void registerError(DownloadError& error); |
3065 | void downloadFileCreated(Download* download); |
3066 | void downloadGroupCreated(GroupDownload* group); |
3067 | - void downloadCompleted(); |
3068 | + void downloadsFound(DownloadsList* downloads); |
3069 | |
3070 | private: |
3071 | bool m_autoStart; |
3072 | bool m_cleanDownloads; |
3073 | - QVariantList m_downloads; |
3074 | QString m_errorMessage; |
3075 | Manager* m_manager; |
3076 | }; |
3077 | |
3078 | === modified file 'src/downloads/test-daemon/testing_manager.cpp' |
3079 | --- src/downloads/test-daemon/testing_manager.cpp 2015-02-25 16:24:24 +0000 |
3080 | +++ src/downloads/test-daemon/testing_manager.cpp 2015-12-16 02:32:33 +0000 |
3081 | @@ -176,12 +176,12 @@ |
3082 | } |
3083 | |
3084 | QList<QDBusObjectPath> |
3085 | -TestingManager::getAllDownloads() { |
3086 | +TestingManager::getAllDownloads(const QString& appId, bool uncollected) { |
3087 | if (calledFromDBus() && _returnErrors) { |
3088 | sendErrorReply(QDBusError::InvalidMember, |
3089 | "getAllDownloads"); |
3090 | } |
3091 | - return DownloadManager::getAllDownloads(); |
3092 | + return DownloadManager::getAllDownloads(appId, uncollected); |
3093 | } |
3094 | |
3095 | QList<QDBusObjectPath> |
3096 | |
3097 | === modified file 'src/downloads/test-daemon/testing_manager.h' |
3098 | --- src/downloads/test-daemon/testing_manager.h 2015-02-25 16:24:24 +0000 |
3099 | +++ src/downloads/test-daemon/testing_manager.h 2015-12-16 02:32:33 +0000 |
3100 | @@ -48,7 +48,8 @@ |
3101 | void setDefaultThrottle(qulonglong speed) override; |
3102 | void allowGSMDownload(bool allowed) override; |
3103 | bool isGSMDownloadAllowed() override; |
3104 | - QList<QDBusObjectPath> getAllDownloads() override; |
3105 | + QList<QDBusObjectPath> getAllDownloads(const QString& appId, |
3106 | + bool uncollected) override; |
3107 | QList<QDBusObjectPath> getAllDownloadsWithMetadata( |
3108 | const QString& name, |
3109 | const QString& value) override; |
3110 | |
3111 | === modified file 'tests/CMakeLists.txt' |
3112 | --- tests/CMakeLists.txt 2014-07-07 12:16:47 +0000 |
3113 | +++ tests/CMakeLists.txt 2015-12-16 02:32:33 +0000 |
3114 | @@ -23,3 +23,4 @@ |
3115 | add_subdirectory(common) |
3116 | add_subdirectory(downloads) |
3117 | add_subdirectory(uploads) |
3118 | +add_subdirectory(abi-compliance) |
3119 | |
3120 | === added directory 'tests/abi-compliance' |
3121 | === added file 'tests/abi-compliance/CMakeLists.txt' |
3122 | --- tests/abi-compliance/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
3123 | +++ tests/abi-compliance/CMakeLists.txt 2015-12-16 02:32:33 +0000 |
3124 | @@ -0,0 +1,1 @@ |
3125 | +configure_file(abi.xml.in ${CMAKE_CURRENT_BINARY_DIR}/abi.xml) |
3126 | |
3127 | === added file 'tests/abi-compliance/abi.xml.in' |
3128 | --- tests/abi-compliance/abi.xml.in 1970-01-01 00:00:00 +0000 |
3129 | +++ tests/abi-compliance/abi.xml.in 2015-12-16 02:32:33 +0000 |
3130 | @@ -0,0 +1,18 @@ |
3131 | +<version> |
3132 | +@UDM_VERSION_MAJOR@.@UDM_VERSION_MINOR@.@UDM_VERSION_PATCH@ |
3133 | +</version> |
3134 | + |
3135 | +<headers> |
3136 | +@CMAKE_SOURCE_DIR@/src |
3137 | +</headers> |
3138 | + |
3139 | +<libs> |
3140 | +@CMAKE_BINARY_DIR@/src/downloads/client/libubuntu-download-manager-client.so |
3141 | +@CMAKE_BINARY_DIR@/src/downloads/common/libubuntu-download-manager-common.so |
3142 | +@CMAKE_BINARY_DIR@/src/uploads/common/libubuntu-upload-manager-common.so |
3143 | +@CMAKE_BINARY_DIR@/src/common/public/libudm-common.so |
3144 | +</libs> |
3145 | + |
3146 | +<gcc_options> |
3147 | +-std=c++11 -fPIC |
3148 | +</gcc_options> |
3149 | |
3150 | === modified file 'tests/downloads/client/test_client_manager.cpp' |
3151 | --- tests/downloads/client/test_client_manager.cpp 2015-02-26 10:42:16 +0000 |
3152 | +++ tests/downloads/client/test_client_manager.cpp 2015-12-16 02:32:33 +0000 |
3153 | @@ -166,7 +166,7 @@ |
3154 | // ensure that all of the are created |
3155 | QVERIFY(managerSpy.ensureSignalEmitted()); |
3156 | QTRY_COMPARE_WITH_TIMEOUT(count, managerSpy.count(), 20000); |
3157 | - _man->getAllDownloads(); |
3158 | + _man->getAllDownloads("", false); |
3159 | |
3160 | QVERIFY(listSpy.ensureSignalEmitted()); |
3161 | QTRY_COMPARE_WITH_TIMEOUT(1, listSpy.count(), 20000); |
3162 | @@ -206,7 +206,7 @@ |
3163 | // ensure that all of the are created |
3164 | QVERIFY(managerSpy.ensureSignalEmitted()); |
3165 | QTRY_COMPARE_WITH_TIMEOUT(count, managerSpy.count(), 10000); |
3166 | - _man->getAllDownloads(cb, cb); |
3167 | + _man->getAllDownloads("", false, cb, cb); |
3168 | |
3169 | QVERIFY(listSpy.ensureSignalEmitted()); |
3170 | QTRY_COMPARE(1, listSpy.count()); |
3171 | |
3172 | === modified file 'tests/downloads/daemon/download.h' |
3173 | --- tests/downloads/daemon/download.h 2014-07-03 09:01:01 +0000 |
3174 | +++ tests/downloads/daemon/download.h 2015-12-16 02:32:33 +0000 |
3175 | @@ -84,8 +84,8 @@ |
3176 | MOCK_METHOD0(pauseTransfer, void()); |
3177 | MOCK_METHOD0(resumeTransfer, void()); |
3178 | MOCK_METHOD0(startTransfer, void()); |
3179 | + MOCK_METHOD0(filePath, QString()); |
3180 | MOCK_CONST_METHOD0(isValid, bool()); |
3181 | - MOCK_CONST_METHOD0(filePath, QString()); |
3182 | MOCK_CONST_METHOD0(state, Transfer::State()); |
3183 | MOCK_CONST_METHOD0(path, QString()); |
3184 | MOCK_CONST_METHOD0(metadata, QVariantMap()); |
3185 | |
3186 | === modified file 'tests/downloads/daemon/test_download.cpp' |
3187 | --- tests/downloads/daemon/test_download.cpp 2015-02-25 16:24:24 +0000 |
3188 | +++ tests/downloads/daemon/test_download.cpp 2015-12-16 02:32:33 +0000 |
3189 | @@ -1301,7 +1301,7 @@ |
3190 | QVERIFY(spy.ensureSignalEmitted()); |
3191 | QTRY_COMPARE(spy.count(), 1); |
3192 | QTRY_COMPARE(processingSpy.count(), 0); |
3193 | - QCOMPARE(download->state(), Download::FINISH); |
3194 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3195 | |
3196 | delete download; |
3197 | |
3198 | @@ -1481,7 +1481,7 @@ |
3199 | QVERIFY(spy.ensureSignalEmitted()); |
3200 | QTRY_COMPARE(spy.count(), 1); |
3201 | QTRY_COMPARE(processingSpy.count(), 1); |
3202 | - QCOMPARE(download->state(), Download::FINISH); |
3203 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3204 | |
3205 | delete download; |
3206 | |
3207 | @@ -2196,7 +2196,7 @@ |
3208 | |
3209 | QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000); |
3210 | QTRY_COMPARE_WITH_TIMEOUT(processingSpy.count(), 1, 20000); |
3211 | - QCOMPARE(download->state(), Download::FINISH); |
3212 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3213 | |
3214 | delete download; |
3215 | |
3216 | @@ -2309,7 +2309,7 @@ |
3217 | |
3218 | QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000); |
3219 | QTRY_COMPARE_WITH_TIMEOUT(processingSpy.count(), 1, 20000); |
3220 | - QCOMPARE(download->state(), Download::FINISH); |
3221 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3222 | |
3223 | delete download; |
3224 | |
3225 | @@ -2431,7 +2431,7 @@ |
3226 | QVERIFY(spy.ensureSignalEmitted()); |
3227 | QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000); |
3228 | QTRY_COMPARE_WITH_TIMEOUT(processingSpy.count(), 1, 20000); |
3229 | - QCOMPARE(download->state(), Download::FINISH); |
3230 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3231 | |
3232 | delete download; |
3233 | |
3234 | @@ -3735,7 +3735,7 @@ |
3235 | QVERIFY(spy.ensureSignalEmitted()); |
3236 | QCOMPARE(spy.count(), 1); |
3237 | QCOMPARE(processingSpy.count(), 1); |
3238 | - QCOMPARE(download->state(), Download::FINISH); |
3239 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3240 | |
3241 | delete download; |
3242 | |
3243 | @@ -4167,7 +4167,7 @@ |
3244 | |
3245 | QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 20000); |
3246 | QTRY_COMPARE_WITH_TIMEOUT(processingSpy.count(), 1, 20000); |
3247 | - QCOMPARE(download->state(), Download::FINISH); |
3248 | + QCOMPARE(download->state(), Download::UNCOLLECTED); |
3249 | |
3250 | delete download; |
3251 | |
3252 | |
3253 | === modified file 'tests/downloads/daemon/test_download_manager.cpp' |
3254 | --- tests/downloads/daemon/test_download_manager.cpp 2014-12-01 09:20:00 +0000 |
3255 | +++ tests/downloads/daemon/test_download_manager.cpp 2015-12-16 02:32:33 +0000 |
3256 | @@ -145,6 +145,27 @@ |
3257 | SignalBarrier spy(_man, SIGNAL(downloadCreated(QDBusObjectPath))); |
3258 | DownloadStruct downStruct(url, metadata, headers); |
3259 | |
3260 | + auto dbusProxy = new MockDBusProxy(); |
3261 | + auto reply = new MockPendingReply<QString>(); |
3262 | + EXPECT_CALL(*_dbusProxyFactory, createDBusProxy(_conn, _)) |
3263 | + .Times(1) |
3264 | + .WillOnce(Return(dbusProxy)); |
3265 | + |
3266 | + EXPECT_CALL(*dbusProxy, GetConnectionAppArmorSecurityContext(_)) |
3267 | + .Times(1) |
3268 | + .WillOnce(Return(reply)); |
3269 | + |
3270 | + EXPECT_CALL(*reply, waitForFinished()) |
3271 | + .Times(1); |
3272 | + |
3273 | + EXPECT_CALL(*reply, isError()) |
3274 | + .Times(1) |
3275 | + .WillOnce(Return(false)); |
3276 | + |
3277 | + EXPECT_CALL(*reply, value()) |
3278 | + .Times(1) |
3279 | + .WillOnce(Return("TEST_APP_ID")); |
3280 | + |
3281 | // set the expectations of the factory since is the one that |
3282 | // creates the downloads. The matchers will ensure that the |
3283 | // correct value is used. |
3284 | @@ -157,10 +178,18 @@ |
3285 | EXPECT_CALL(*down.data(), setThrottle(_man->defaultThrottle())) |
3286 | .Times(1); |
3287 | |
3288 | + EXPECT_CALL(*down.data(), allowGSMDownload(_)) |
3289 | + .Times(1); |
3290 | + |
3291 | + |
3292 | EXPECT_CALL(*down.data(), path()) |
3293 | .Times(1) |
3294 | .WillRepeatedly(Return(dbusPath)); |
3295 | |
3296 | + EXPECT_CALL(*down.data(), metadata()) |
3297 | + .Times(1) |
3298 | + .WillRepeatedly(Return(QVariantMap())); |
3299 | + |
3300 | // expected actions performed by the db |
3301 | EXPECT_CALL(*_database, store(down.data())) |
3302 | .Times(1) |
3303 | @@ -248,6 +277,27 @@ |
3304 | .Times(1) |
3305 | .WillRepeatedly(Return(down.data())); |
3306 | |
3307 | + auto dbusProxy = new MockDBusProxy(); |
3308 | + auto reply = new MockPendingReply<QString>(); |
3309 | + EXPECT_CALL(*_dbusProxyFactory, createDBusProxy(_conn, _)) |
3310 | + .Times(1) |
3311 | + .WillOnce(Return(dbusProxy)); |
3312 | + |
3313 | + EXPECT_CALL(*dbusProxy, GetConnectionAppArmorSecurityContext(_)) |
3314 | + .Times(1) |
3315 | + .WillOnce(Return(reply)); |
3316 | + |
3317 | + EXPECT_CALL(*reply, waitForFinished()) |
3318 | + .Times(1); |
3319 | + |
3320 | + EXPECT_CALL(*reply, isError()) |
3321 | + .Times(1) |
3322 | + .WillOnce(Return(false)); |
3323 | + |
3324 | + EXPECT_CALL(*reply, value()) |
3325 | + .Times(1) |
3326 | + .WillOnce(Return("TEST_APP_ID")); |
3327 | + |
3328 | // expected actions to be performed on the download |
3329 | EXPECT_CALL(*down.data(), setThrottle(_man->defaultThrottle())) |
3330 | .Times(1); |
3331 | @@ -259,6 +309,10 @@ |
3332 | .Times(1) |
3333 | .WillRepeatedly(Return(dbusPath)); |
3334 | |
3335 | + EXPECT_CALL(*down.data(), metadata()) |
3336 | + .Times(1) |
3337 | + .WillRepeatedly(Return(QVariantMap())); |
3338 | + |
3339 | // expected actions performed by the db |
3340 | EXPECT_CALL(*_database, store(down.data())) |
3341 | .Times(1) |
3342 | @@ -485,7 +539,7 @@ |
3343 | .Times(1) |
3344 | .WillRepeatedly(Return(expectedPaths)); |
3345 | |
3346 | - auto result = _man->getAllDownloads(); |
3347 | + auto result = _man->getAllDownloads("", false); |
3348 | QCOMPARE(3, result.count()); |
3349 | foreach(auto path, result) { |
3350 | QVERIFY(expectedPaths.contains(path.path())); |
3351 | |
3352 | === modified file 'tests/downloads/daemon/test_downloads_db.cpp' |
3353 | --- tests/downloads/daemon/test_downloads_db.cpp 2014-11-17 20:34:24 +0000 |
3354 | +++ tests/downloads/daemon/test_downloads_db.cpp 2015-12-16 02:32:33 +0000 |
3355 | @@ -351,4 +351,77 @@ |
3356 | QTRY_COMPARE(1, spy.count()); |
3357 | } |
3358 | |
3359 | +void |
3360 | +TestDownloadsDb::testGetStateMissingDownload() { |
3361 | + _db->init(); |
3362 | + auto result = _db->getDownloadState("random uuid"); |
3363 | + QVERIFY(!result.isValid()); |
3364 | +} |
3365 | + |
3366 | +void |
3367 | +TestDownloadsDb::testGetStateDownload_data() { |
3368 | + QTest::addColumn<QString>("id"); |
3369 | + QTest::addColumn<QString>("appId"); |
3370 | + QTest::addColumn<QString>("path"); |
3371 | + QTest::addColumn<QUrl>("url"); |
3372 | + QTest::addColumn<QString>("hash"); |
3373 | + QTest::addColumn<QString>("hashAlgoString"); |
3374 | + QTest::addColumn<QVariantMap>("metadata"); |
3375 | + QTest::addColumn<QMap<QString, QString> >("headers"); |
3376 | + |
3377 | + QTest::newRow("First Row") << UuidUtils::getDBusString(QUuid::createUuid()) |
3378 | + << "FIRST APP" << "first path" << QUrl("http://ubuntu.com") << "" |
3379 | + << "md5" << QVariantMap() << QMap<QString, QString>(); |
3380 | + |
3381 | + QVariantMap secondMetadata; |
3382 | + secondMetadata["test"] = 1; |
3383 | + secondMetadata["command"] = "cd"; |
3384 | + secondMetadata["hello"] = 23; |
3385 | + |
3386 | + QTest::newRow("Second Row") << UuidUtils::getDBusString(QUuid::createUuid()) |
3387 | + << "SECOND APP" << "second path" << QUrl("http://ubuntu.com/phone") |
3388 | + << "" << "sha512" << secondMetadata << QMap<QString, QString>(); |
3389 | + |
3390 | + QVariantMap thirdMetadata; |
3391 | + secondMetadata["test"] = 3; |
3392 | + secondMetadata["command"] = "return"; |
3393 | + secondMetadata["hello"] = 500; |
3394 | + |
3395 | + QMap<QString, QString> thirdHeaders; |
3396 | + thirdHeaders["my-header"] = "I do something cool"; |
3397 | + |
3398 | + QTest::newRow("Third Row") << UuidUtils::getDBusString(QUuid::createUuid()) |
3399 | + << "THIRD APP" << "third path" << QUrl("http://ubuntu.com/tablet") |
3400 | + << "" << "sha384" << thirdMetadata << thirdHeaders; |
3401 | +} |
3402 | + |
3403 | +void |
3404 | +TestDownloadsDb::testGetStateDownload() { |
3405 | + _db->init(); |
3406 | + QFETCH(QString, id); |
3407 | + QFETCH(QString, appId); |
3408 | + QFETCH(QString, path); |
3409 | + QFETCH(QUrl, url); |
3410 | + QFETCH(QString, hash); |
3411 | + QFETCH(QString, hashAlgoString); |
3412 | + QFETCH(QVariantMap, metadata); |
3413 | + QFETCH(StringMap, headers); |
3414 | + |
3415 | + QScopedPointer<FileDownload> download(new FileDownload(id, appId, path, true, "", url, hash, |
3416 | + hashAlgoString, metadata, headers)); |
3417 | + |
3418 | + _db->storeSingleDownload(download.data()); |
3419 | + |
3420 | + // create a second download with same id but a diff path to test is update |
3421 | + QString newPath = path + path; |
3422 | + QScopedPointer<FileDownload> secondDownload(new FileDownload(id, appId, |
3423 | + newPath, true, "", url, hash, hashAlgoString, metadata, headers)); |
3424 | + |
3425 | + _db->storeSingleDownload(secondDownload.data()); |
3426 | + auto state = _db->getDownloadState(id); |
3427 | + QVERIFY(state.isValid()); |
3428 | + QCOMPARE(state.getUrl(), url.toString()); |
3429 | + QCOMPARE(state.getHash(), state.getHash()); |
3430 | +} |
3431 | + |
3432 | QTEST_MAIN(TestDownloadsDb) |
3433 | |
3434 | === modified file 'tests/downloads/daemon/test_downloads_db.h' |
3435 | --- tests/downloads/daemon/test_downloads_db.h 2014-07-03 09:01:01 +0000 |
3436 | +++ tests/downloads/daemon/test_downloads_db.h 2015-12-16 02:32:33 +0000 |
3437 | @@ -65,9 +65,12 @@ |
3438 | void testStoreSingleDownloadPresent(); |
3439 | void testConnectedToDownload(); |
3440 | void testDisconnectedFromDownload(); |
3441 | + void testGetStateMissingDownload(); |
3442 | + void testGetStateDownload_data(); |
3443 | + void testGetStateDownload(); |
3444 | |
3445 | private: |
3446 | DownloadsDb* _db; |
3447 | }; |
3448 | |
3449 | -#endif // TEST_DOWNLOADS_DB_H |
3450 | +#endif |
3451 | |
3452 | === modified file 'tests/downloads/daemon/test_metadata.cpp' |
3453 | --- tests/downloads/daemon/test_metadata.cpp 2014-09-22 23:24:34 +0000 |
3454 | +++ tests/downloads/daemon/test_metadata.cpp 2015-12-16 02:32:33 +0000 |
3455 | @@ -16,6 +16,10 @@ |
3456 | * Boston, MA 02110-1301, USA. |
3457 | */ |
3458 | |
3459 | +#include <stdlib.h> |
3460 | + |
3461 | +#include <QProcessEnvironment> |
3462 | + |
3463 | #include "test_metadata.h" |
3464 | |
3465 | using namespace Ubuntu::Transfers; |
3466 | @@ -348,5 +352,91 @@ |
3467 | QVERIFY(!metadata.hasDeflate()); |
3468 | } |
3469 | |
3470 | +void |
3471 | +TestMetadata::testDownloadOwner_data() { |
3472 | + QTest::addColumn<QString>("owner"); |
3473 | + |
3474 | + QTest::newRow("First app") << "First app"; |
3475 | + QTest::newRow("Browser") << "Browser"; |
3476 | + QTest::newRow("Test") << "Test"; |
3477 | +} |
3478 | + |
3479 | +void |
3480 | +TestMetadata::testDownloadOwner() { |
3481 | + QFETCH(QString, owner); |
3482 | + |
3483 | + Metadata metadata; |
3484 | + metadata[Metadata::APP_ID] = owner; |
3485 | + QCOMPARE(owner, metadata.destinationApp()); |
3486 | +} |
3487 | + |
3488 | +void |
3489 | +TestMetadata::testSetDownloadDestinationApp_data() { |
3490 | + QTest::addColumn<QString>("owner"); |
3491 | + |
3492 | + QTest::newRow("First app") << "First app"; |
3493 | + QTest::newRow("Browser") << "Browser"; |
3494 | + QTest::newRow("Test") << "Test"; |
3495 | +} |
3496 | + |
3497 | +void |
3498 | +TestMetadata::testSetDownloadDestinationApp() { |
3499 | + QFETCH(QString, owner); |
3500 | + |
3501 | + Metadata metadata; |
3502 | + metadata.setOwner(owner); |
3503 | + QCOMPARE(metadata[Metadata::APP_ID].toString(), owner); |
3504 | +} |
3505 | + |
3506 | +void |
3507 | +TestMetadata::testHasDownloadDestinationAppTrue() { |
3508 | + Metadata metadata; |
3509 | + metadata.setOwner("pedro"); |
3510 | + |
3511 | + QVERIFY(metadata.hasOwner()); |
3512 | +} |
3513 | + |
3514 | +void |
3515 | +TestMetadata::testHasDownloadDestinationAppFalse() { |
3516 | + Metadata metadata; |
3517 | + metadata.clear(); |
3518 | + |
3519 | + QVERIFY(!metadata.hasOwner()); |
3520 | +} |
3521 | + |
3522 | +void |
3523 | +TestMetadata::testDestinationAppIsPickedFromEnv_data() { |
3524 | + QTest::addColumn<QString>("appid"); |
3525 | + |
3526 | + QTest::newRow("First app") << "Chanco"; |
3527 | + QTest::newRow("Browser") << "Browser"; |
3528 | + QTest::newRow("Test") << "Test"; |
3529 | +} |
3530 | + |
3531 | + |
3532 | +void |
3533 | +TestMetadata::testDestinationAppIsPickedFromEnv() { |
3534 | + QFETCH(QString, appid); |
3535 | + |
3536 | + // set the used envar |
3537 | + setenv("APP_ID", appid.toStdString().c_str(), 1); |
3538 | + |
3539 | + Metadata metadata; |
3540 | + QVERIFY(metadata.hasOwner()); |
3541 | + QCOMPARE(metadata.destinationApp(), appid); |
3542 | +} |
3543 | + |
3544 | +void |
3545 | +TestMetadata::testDestinationAppIsAlreadyPresent() { |
3546 | + QString appid("Test"); |
3547 | + QVariantMap map; |
3548 | + |
3549 | + // set the used envar |
3550 | + setenv("APP_ID", appid.toStdString().c_str(), 1); |
3551 | + Metadata metadata(map); |
3552 | + QVERIFY(metadata.hasOwner()); |
3553 | + QCOMPARE(metadata.destinationApp(), appid); |
3554 | +} |
3555 | + |
3556 | QTEST_MAIN(TestMetadata) |
3557 | #include "moc_test_metadata.cpp" |
3558 | |
3559 | === modified file 'tests/downloads/daemon/test_metadata.h' |
3560 | --- tests/downloads/daemon/test_metadata.h 2014-09-22 23:24:34 +0000 |
3561 | +++ tests/downloads/daemon/test_metadata.h 2015-12-16 02:32:33 +0000 |
3562 | @@ -71,6 +71,15 @@ |
3563 | void testSetDeflate(); |
3564 | void testHasDeflateTrue(); |
3565 | void testHasDeflateFalse(); |
3566 | + void testDownloadOwner_data(); |
3567 | + void testDownloadOwner(); |
3568 | + void testSetDownloadDestinationApp_data(); |
3569 | + void testSetDownloadDestinationApp(); |
3570 | + void testHasDownloadDestinationAppTrue(); |
3571 | + void testHasDownloadDestinationAppFalse(); |
3572 | + void testDestinationAppIsPickedFromEnv_data(); |
3573 | + void testDestinationAppIsPickedFromEnv(); |
3574 | + void testDestinationAppIsAlreadyPresent(); |
3575 | }; |
3576 | |
3577 | -#endif // TEST_METADATA_H |
3578 | +#endif |
3579 | |
3580 | === modified file 'tests/downloads/qml/manager.h' |
3581 | --- tests/downloads/qml/manager.h 2014-07-04 15:19:50 +0000 |
3582 | +++ tests/downloads/qml/manager.h 2015-12-16 02:32:33 +0000 |
3583 | @@ -37,8 +37,8 @@ |
3584 | const QVariantMap&, StringMap)); |
3585 | MOCK_METHOD7(createDownload, void(StructList, const QString&, bool, |
3586 | const QVariantMap&, StringMap, GroupCb, GroupCb)); |
3587 | - MOCK_METHOD0(getAllDownloads, void()); |
3588 | - MOCK_METHOD2(getAllDownloads, void(DownloadsListCb, DownloadsListCb)); |
3589 | + MOCK_METHOD0(getAllDownloads, void(const QString&, bool)); |
3590 | + MOCK_METHOD2(getAllDownloads, void(const QString&, bool, DownloadsListCb, DownloadsListCb)); |
3591 | MOCK_METHOD2(getAllDownloadsWithMetadata, void(const QString&, |
3592 | const QString&)); |
3593 | MOCK_METHOD4(getAllDownloadsWithMetadata, void(const QString&, |
FAILED: Continuous integration, rev:361 jenkins. qa.ubuntu. com/job/ ubuntu- download- manager- ci/774/ jenkins. qa.ubuntu. com/job/ ubuntu- download- manager- wily-amd64- ci/5/console jenkins. qa.ubuntu. com/job/ ubuntu- download- manager- wily-armhf- ci/5/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- download- manager- ci/774/ rebuild
http://