Merge lp:~mandel/ubuntu-download-manager/all-downloads-client into lp:ubuntu-download-manager

Proposed by Manuel de la Peña
Status: Superseded
Proposed branch: lp:~mandel/ubuntu-download-manager/all-downloads-client
Merge into: lp:ubuntu-download-manager
Prerequisite: lp:~mandel/ubuntu-download-manager/abstract-classes
Diff against target: 31405 lines (+14554/-9366)
323 files modified
CMakeLists.txt (+73/-0)
cmake/modules/EnableCoverageReport.cmake (+153/-0)
cmake/modules/FindGtest.cmake (+53/-0)
cmake/modules/FindLcov.cmake (+29/-0)
cmake/modules/Findgcovr.cmake (+31/-0)
cmake/modules/ParseArguments.cmake (+52/-0)
common-installs-config.pri (+0/-44)
common-pkgconfig.pri (+0/-10)
common-project-config.pri (+0/-56)
common-vars.pri (+0/-21)
common.pri (+0/-5)
coverage.pri (+0/-66)
debian/control (+89/-19)
debian/libubuntu-download-manager-client-dev.install (+1/-1)
debian/libubuntu-download-manager-common-dev.install (+1/-6)
debian/libubuntu-download-manager-priv0.install (+0/-1)
debian/libubuntu-upload-manager-common-dev.install (+5/-0)
debian/libubuntu-upload-manager-common0.install (+1/-0)
debian/libudm-common-dev.install (+7/-0)
debian/libudm-common0.install (+1/-0)
debian/libudm-priv0.install (+1/-0)
debian/qtdeclarative5-ubuntu-download-manager0.1.install (+2/-2)
debian/rules (+17/-1)
debian/ubuntu-download-manager.install (+1/-1)
debian/ubuntu-upload-manager.install (+4/-0)
docs/com.canonical.applications.download.xml (+4/-0)
docs/com.canonical.applications.upload.xml (+73/-0)
docs/com.canonical.applications.upload_manager.xml (+52/-0)
download-manager.pro (+0/-34)
src/CMakeLists.txt (+19/-0)
src/common/CMakeLists.txt (+18/-0)
src/common/priv/CMakeLists.txt (+87/-0)
src/common/priv/ubuntu/transfers/adaptor_factory.h (+41/-0)
src/common/priv/ubuntu/transfers/base_daemon.cpp (+193/-286)
src/common/priv/ubuntu/transfers/base_daemon.h (+42/-35)
src/common/priv/ubuntu/transfers/base_manager.cpp (+48/-0)
src/common/priv/ubuntu/transfers/base_manager.h (+60/-0)
src/common/priv/ubuntu/transfers/manager_factory.h (+46/-0)
src/common/priv/ubuntu/transfers/queue.cpp (+92/-87)
src/common/priv/ubuntu/transfers/queue.h (+15/-18)
src/common/priv/ubuntu/transfers/system/apn_proxy.cpp (+6/-6)
src/common/priv/ubuntu/transfers/system/apn_proxy.h (+3/-3)
src/common/priv/ubuntu/transfers/system/apn_request_factory.cpp (+2/-2)
src/common/priv/ubuntu/transfers/system/apn_request_factory.h (+2/-2)
src/common/priv/ubuntu/transfers/system/apparmor.cpp (+79/-74)
src/common/priv/ubuntu/transfers/system/apparmor.h (+21/-14)
src/common/priv/ubuntu/transfers/system/application.cpp (+2/-3)
src/common/priv/ubuntu/transfers/system/application.h (+2/-2)
src/common/priv/ubuntu/transfers/system/cryptographic_hash.cpp (+92/-0)
src/common/priv/ubuntu/transfers/system/cryptographic_hash.h (+71/-0)
src/common/priv/ubuntu/transfers/system/dbus_proxy.h (+2/-1)
src/common/priv/ubuntu/transfers/system/file_manager.cpp (+17/-2)
src/common/priv/ubuntu/transfers/system/file_manager.h (+13/-11)
src/common/priv/ubuntu/transfers/system/filename_mutex.cpp (+4/-4)
src/common/priv/ubuntu/transfers/system/filename_mutex.h (+2/-2)
src/common/priv/ubuntu/transfers/system/network_reply.cpp (+19/-11)
src/common/priv/ubuntu/transfers/system/network_reply.h (+3/-2)
src/common/priv/ubuntu/transfers/system/process.cpp (+18/-14)
src/common/priv/ubuntu/transfers/system/process.h (+2/-2)
src/common/priv/ubuntu/transfers/system/process_factory.cpp (+2/-2)
src/common/priv/ubuntu/transfers/system/process_factory.h (+2/-2)
src/common/priv/ubuntu/transfers/system/request_factory.cpp (+26/-11)
src/common/priv/ubuntu/transfers/system/request_factory.h (+5/-2)
src/common/priv/ubuntu/transfers/system/system_network_info.cpp (+70/-47)
src/common/priv/ubuntu/transfers/system/system_network_info.h (+2/-2)
src/common/priv/ubuntu/transfers/system/timer.cpp (+5/-3)
src/common/priv/ubuntu/transfers/system/timer.h (+2/-2)
src/common/priv/ubuntu/transfers/system/uuid_factory.cpp (+2/-2)
src/common/priv/ubuntu/transfers/system/uuid_factory.h (+2/-2)
src/common/priv/ubuntu/transfers/system/uuid_utils.cpp (+2/-2)
src/common/priv/ubuntu/transfers/system/uuid_utils.h (+2/-2)
src/common/priv/ubuntu/transfers/transfer.cpp (+181/-0)
src/common/priv/ubuntu/transfers/transfer.h (+110/-0)
src/common/priv/udm-priv-common.pro.THIS (+67/-0)
src/common/priv/udm-priv-common_global.h (+12/-0)
src/common/public/CMakeLists.txt (+62/-0)
src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp (+5/-2)
src/common/public/ubuntu/transfers/errors/auth_error_struct.h (+6/-4)
src/common/public/ubuntu/transfers/errors/http_error_struct.cpp (+6/-2)
src/common/public/ubuntu/transfers/errors/http_error_struct.h (+7/-5)
src/common/public/ubuntu/transfers/errors/network_error_struct.cpp (+6/-2)
src/common/public/ubuntu/transfers/errors/network_error_struct.h (+7/-4)
src/common/public/ubuntu/transfers/errors/process_error_struct.cpp (+5/-2)
src/common/public/ubuntu/transfers/errors/process_error_struct.h (+7/-4)
src/common/public/ubuntu/transfers/metadata.cpp (+1/-1)
src/common/public/ubuntu/transfers/metadata.h (+1/-1)
src/common/public/ubuntu/transfers/system/dbus_connection.cpp (+2/-2)
src/common/public/ubuntu/transfers/system/dbus_connection.h (+2/-2)
src/common/public/ubuntu/transfers/system/hash_algorithm.cpp (+2/-2)
src/common/public/ubuntu/transfers/system/hash_algorithm.h (+2/-2)
src/common/public/ubuntu/transfers/system/logger.cpp (+2/-12)
src/common/public/ubuntu/transfers/system/logger.h (+4/-4)
src/common/public/udm-common.pc.in (+12/-0)
src/common/public/udm-common_global.h (+12/-0)
src/downloads/CMakeLists.txt (+22/-0)
src/downloads/client/CMakeLists.txt (+68/-0)
src/downloads/client/ubuntu-download-manager-client.pc.in (+4/-5)
src/downloads/client/ubuntu-download-manager-client.pro.THIS (+3/-0)
src/downloads/client/ubuntu/download_manager/download.h (+10/-1)
src/downloads/client/ubuntu/download_manager/download_impl.cpp (+39/-26)
src/downloads/client/ubuntu/download_manager/download_impl.h (+6/-7)
src/downloads/client/ubuntu/download_manager/download_interface.h (+7/-0)
src/downloads/client/ubuntu/download_manager/download_pendingcall_watcher.cpp (+6/-4)
src/downloads/client/ubuntu/download_manager/download_pendingcall_watcher.h (+2/-2)
src/downloads/client/ubuntu/download_manager/downloads_list.h (+50/-0)
src/downloads/client/ubuntu/download_manager/downloads_list_impl.cpp (+64/-0)
src/downloads/client/ubuntu/download_manager/downloads_list_impl.h (+53/-0)
src/downloads/client/ubuntu/download_manager/error.cpp (+18/-14)
src/downloads/client/ubuntu/download_manager/error.h (+26/-18)
src/downloads/client/ubuntu/download_manager/group_download.h (+2/-2)
src/downloads/client/ubuntu/download_manager/manager.h (+77/-3)
src/downloads/client/ubuntu/download_manager/manager_impl.cpp (+54/-22)
src/downloads/client/ubuntu/download_manager/manager_impl.h (+13/-3)
src/downloads/client/ubuntu/download_manager/manager_interface.h (+2/-0)
src/downloads/client/ubuntu/download_manager/manager_pendingcall_watcher.cpp (+122/-28)
src/downloads/client/ubuntu/download_manager/manager_pendingcall_watcher.h (+60/-17)
src/downloads/common/CMakeLists.txt (+49/-0)
src/downloads/common/ubuntu-download-manager-common.pc.in (+3/-3)
src/downloads/common/ubuntu/download_manager/download_struct.h (+1/-1)
src/downloads/common/ubuntu/download_manager/group_download_struct.cpp (+1/-1)
src/downloads/common/ubuntu/download_manager/group_download_struct.h (+1/-1)
src/downloads/common/ubuntu/download_manager/metatypes.h (+5/-4)
src/downloads/common/ubuntu/download_manager/system/logger.cpp (+29/-0)
src/downloads/common/ubuntu/download_manager/system/logger.h (+38/-0)
src/downloads/daemon/CMakeLists.txt (+37/-0)
src/downloads/daemon/main.cpp (+2/-2)
src/downloads/priv/CMakeLists.txt (+78/-0)
src/downloads/priv/ubuntu/downloads/daemon.cpp (+62/-0)
src/downloads/priv/ubuntu/downloads/daemon.h (+57/-0)
src/downloads/priv/ubuntu/downloads/download.cpp (+3/-81)
src/downloads/priv/ubuntu/downloads/download.h (+18/-106)
src/downloads/priv/ubuntu/downloads/download_adaptor.cpp (+7/-1)
src/downloads/priv/ubuntu/downloads/download_adaptor.h (+4/-0)
src/downloads/priv/ubuntu/downloads/download_adaptor_factory.cpp (+43/-0)
src/downloads/priv/ubuntu/downloads/download_adaptor_factory.h (+47/-0)
src/downloads/priv/ubuntu/downloads/download_manager_factory.cpp (+46/-0)
src/downloads/priv/ubuntu/downloads/download_manager_factory.h (+54/-0)
src/downloads/priv/ubuntu/downloads/downloads_db.cpp (+13/-10)
src/downloads/priv/ubuntu/downloads/downloads_db.h (+2/-2)
src/downloads/priv/ubuntu/downloads/factory.cpp (+47/-67)
src/downloads/priv/ubuntu/downloads/factory.h (+7/-10)
src/downloads/priv/ubuntu/downloads/file_download.cpp (+122/-44)
src/downloads/priv/ubuntu/downloads/file_download.h (+22/-16)
src/downloads/priv/ubuntu/downloads/group_download.cpp (+51/-32)
src/downloads/priv/ubuntu/downloads/group_download.h (+9/-8)
src/downloads/priv/ubuntu/downloads/group_download_adaptor.cpp (+2/-2)
src/downloads/priv/ubuntu/downloads/manager.cpp (+77/-82)
src/downloads/priv/ubuntu/downloads/manager.h (+22/-22)
src/downloads/priv/ubuntu/downloads/mms_file_download.cpp (+1/-1)
src/downloads/priv/ubuntu/downloads/sm_file_download.h (+1/-1)
src/downloads/priv/ubuntu/downloads/state_machines/download_sm.cpp (+11/-7)
src/downloads/priv/ubuntu/downloads/state_machines/download_sm.h (+1/-1)
src/downloads/priv/ubuntu/downloads/state_machines/final_state.cpp (+1/-1)
src/downloads/qml/CMakeLists.txt (+40/-0)
src/downloads/qml/single_download.cpp (+41/-14)
src/downloads/qml/ubuntu_download_manager.cpp (+10/-6)
src/downloads/test-daemon/CMakeLists.txt (+51/-0)
src/downloads/test-daemon/main.cpp (+1/-1)
src/downloads/test-daemon/testing_daemon.cpp (+25/-13)
src/downloads/test-daemon/testing_daemon.h (+6/-7)
src/downloads/test-daemon/testing_file_download.cpp (+18/-18)
src/downloads/test-daemon/testing_file_download.h (+6/-6)
src/downloads/test-daemon/testing_manager.cpp (+25/-25)
src/downloads/test-daemon/testing_manager.h (+4/-3)
src/downloads/test-daemon/ubuntu-download-manager-test-daemon.pro.THIS (+15/-0)
src/uploads/CMakeLists.txt (+19/-0)
src/uploads/common/CMakeLists.txt (+45/-0)
src/uploads/common/ubuntu-upload-manager-common.pc.in (+12/-0)
src/uploads/common/ubuntu/upload_manager/common.h (+28/-0)
src/uploads/common/ubuntu/upload_manager/metatypes.h (+42/-0)
src/uploads/common/ubuntu/upload_manager/upload_struct.cpp (+113/-0)
src/uploads/common/ubuntu/upload_manager/upload_struct.h (+72/-0)
src/uploads/daemon/CMakeLists.txt (+37/-0)
src/uploads/daemon/com.canonical.applications.Uploader.conf (+18/-0)
src/uploads/daemon/com.canonical.applications.Uploader.service (+4/-0)
src/uploads/daemon/main.cpp (+33/-0)
src/uploads/daemon/ubuntu-upload-manager.pro (+49/-0)
src/uploads/daemon/ubuntu-upload-manager.service (+3/-0)
src/uploads/priv/CMakeLists.txt (+64/-0)
src/uploads/priv/ubuntu-upload-manager-priv.pro.THIS (+60/-0)
src/uploads/priv/ubuntu/uploads/daemon.cpp (+63/-0)
src/uploads/priv/ubuntu/uploads/daemon.h (+55/-0)
src/uploads/priv/ubuntu/uploads/factory.cpp (+122/-0)
src/uploads/priv/ubuntu/uploads/factory.h (+76/-0)
src/uploads/priv/ubuntu/uploads/file_upload.cpp (+322/-0)
src/uploads/priv/ubuntu/uploads/file_upload.h (+115/-0)
src/uploads/priv/ubuntu/uploads/manager.cpp (+231/-0)
src/uploads/priv/ubuntu/uploads/manager.h (+113/-0)
src/uploads/priv/ubuntu/uploads/mms_file_upload.cpp (+52/-0)
src/uploads/priv/ubuntu/uploads/mms_file_upload.h (+54/-0)
src/uploads/priv/ubuntu/uploads/upload_adaptor.cpp (+100/-0)
src/uploads/priv/ubuntu/uploads/upload_adaptor.h (+124/-0)
src/uploads/priv/ubuntu/uploads/upload_adaptor_factory.cpp (+44/-0)
src/uploads/priv/ubuntu/uploads/upload_adaptor_factory.h (+48/-0)
src/uploads/priv/ubuntu/uploads/upload_manager_adaptor.cpp (+109/-0)
src/uploads/priv/ubuntu/uploads/upload_manager_adaptor.h (+105/-0)
src/uploads/priv/ubuntu/uploads/upload_manager_factory.cpp (+46/-0)
src/uploads/priv/ubuntu/uploads/upload_manager_factory.h (+52/-0)
tests/CMakeLists.txt (+173/-0)
tests/apparmor.h (+23/-31)
tests/application.h (+49/-0)
tests/base_testcase.cpp (+1/-1)
tests/base_testcase.h (+37/-0)
tests/cryptographic_hash.h (+55/-0)
tests/daemon_testcase.cpp (+5/-11)
tests/daemon_testcase.h (+1/-3)
tests/database.h (+31/-0)
tests/dbus_connection.h (+54/-0)
tests/download.h (+33/-28)
tests/factory.h (+24/-48)
tests/file_manager.h (+43/-33)
tests/filename_mutex.h (+48/-0)
tests/group_download.h (+6/-23)
tests/local_tree_testcase.cpp (+1/-1)
tests/local_tree_testcase.h (+1/-1)
tests/manager.h (+34/-14)
tests/matchers.h (+128/-0)
tests/network_reply.h (+60/-0)
tests/process.h (+32/-50)
tests/process_factory.h (+21/-10)
tests/queue.h (+16/-20)
tests/request_factory.h (+28/-32)
tests/sm_file_download.h (+26/-58)
tests/system_network_info.h (+37/-38)
tests/test_apn_request_factory.cpp (+4/-6)
tests/test_apn_request_factory.h (+36/-5)
tests/test_base_download.cpp (+55/-41)
tests/test_base_download.h (+8/-6)
tests/test_cancel_download_transition.cpp (+18/-18)
tests/test_cancel_download_transition.h (+7/-8)
tests/test_client_download.cpp (+64/-10)
tests/test_client_download.h (+7/-3)
tests/test_client_manager.cpp (+209/-4)
tests/test_client_manager.h (+8/-3)
tests/test_daemon.cpp (+417/-199)
tests/test_daemon.h (+9/-11)
tests/test_download.cpp (+2708/-1540)
tests/test_download.h (+31/-28)
tests/test_download_factory.cpp (+154/-181)
tests/test_download_factory.h (+12/-18)
tests/test_download_manager.cpp (+250/-243)
tests/test_download_manager.h (+24/-24)
tests/test_download_manager_watch.cpp (+20/-17)
tests/test_download_manager_watch.h (+5/-9)
tests/test_download_watch.cpp (+8/-4)
tests/test_download_watch.h (+0/-3)
tests/test_downloads_db.cpp (+17/-16)
tests/test_downloads_db.h (+3/-7)
tests/test_file_download_sm.cpp (+177/-120)
tests/test_file_download_sm.h (+6/-8)
tests/test_filename_mutex.cpp (+4/-6)
tests/test_filename_mutex.h (+3/-5)
tests/test_final_state.cpp (+14/-7)
tests/test_final_state.h (+3/-7)
tests/test_group_download.cpp (+1176/-623)
tests/test_group_download.h (+19/-33)
tests/test_group_manager_watch.cpp (+10/-7)
tests/test_group_manager_watch.h (+1/-3)
tests/test_metadata.cpp (+4/-5)
tests/test_metadata.h (+4/-5)
tests/test_mms_download.cpp (+2/-0)
tests/test_mms_download.h (+6/-10)
tests/test_network_error_transition.cpp (+14/-15)
tests/test_network_error_transition.h (+7/-9)
tests/test_resume_download_transition.cpp (+18/-16)
tests/test_resume_download_transition.h (+7/-9)
tests/test_ssl_error_transition.cpp (+14/-12)
tests/test_ssl_error_transition.h (+7/-9)
tests/test_start_download_transition.cpp (+17/-16)
tests/test_start_download_transition.h (+7/-9)
tests/test_stop_request_transition.cpp (+17/-16)
tests/test_stop_request_transition.h (+7/-9)
tests/test_transfers_queue.cpp (+1003/-512)
tests/test_transfers_queue.h (+36/-32)
tests/testing_interface.cpp (+26/-0)
tests/testing_interface.h (+87/-0)
tests/timer.h (+49/-0)
tests/transfer.h (+78/-0)
tests/uuid_factory.h (+22/-13)
ubuntu-download-manager-client-tests/main.cpp (+0/-25)
ubuntu-download-manager-client-tests/ubuntu-download-manager-client-tests.pro (+0/-61)
ubuntu-download-manager-common-tests/main.cpp (+0/-25)
ubuntu-download-manager-common-tests/ubuntu-download-manager-common-tests.pro (+0/-36)
ubuntu-download-manager-common/ubuntu-download-manager-common.pro (+0/-51)
ubuntu-download-manager-plugin/UbuntuDownloadManager/UbuntuDownloadManager.pro (+0/-11)
ubuntu-download-manager-plugin/UbuntuDownloadManager/modules/UbuntuDownloadManager/UbuntuDownloadManager.pro (+0/-55)
ubuntu-download-manager-plugin/ubuntu-download-manager-plugin.pro (+0/-4)
ubuntu-download-manager-priv/ubuntu-download-manager-priv.pro (+0/-103)
ubuntu-download-manager-test-lib/ubuntu-download-manager-test-lib.pro (+0/-79)
ubuntu-download-manager-test-lib/ubuntu-download-manager-test-lib_global.h (+0/-12)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/fake.cpp (+0/-234)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/fake.h (+0/-145)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/apn_request_factory.cpp (+0/-50)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/apn_request_factory.h (+0/-43)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/apparmor.cpp (+0/-87)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/application.cpp (+0/-54)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/application.h (+0/-42)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/dbus_connection.cpp (+0/-144)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/dbus_connection.h (+0/-80)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/download.cpp (+0/-158)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/factory.cpp (+0/-149)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/file_manager.cpp (+0/-80)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/filename_mutex.cpp (+0/-58)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/filename_mutex.h (+0/-43)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/group_download.cpp (+0/-81)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/manager.cpp (+0/-56)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/network_reply.cpp (+0/-166)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/network_reply.h (+0/-79)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/process.cpp (+0/-106)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/process_factory.cpp (+0/-45)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/qnetwork_reply.cpp (+0/-78)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/qnetwork_reply.h (+0/-45)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/queue.cpp (+0/-60)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/request_factory.cpp (+0/-84)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/sm_file_download.cpp (+0/-210)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/system_network_info.cpp (+0/-80)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/timer.cpp (+0/-75)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/timer.h (+0/-45)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/server/uuid_factory.cpp (+0/-39)
ubuntu-download-manager-test-lib/ubuntu/download_manager/tests/test_runner.h (+0/-87)
ubuntu-download-manager-tests/main.cpp (+0/-25)
ubuntu-download-manager-tests/ubuntu-download-manager-tests.pro (+0/-82)
ubuntu-download-manager/ubuntu-download-manager.pro (+0/-43)
To merge this branch: bzr merge lp:~mandel/ubuntu-download-manager/all-downloads-client
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
dobey (community) Needs Fixing
Alejandro J. Cura (community) Approve
Mike McCracken (community) Approve
Review via email: mp+207490@code.launchpad.net

This proposal has been superseded by a proposal from 2014-04-15.

Commit message

Provide the methods that allow to get all the downloads and all the downloads with a given metadata value.

Description of the change

Provide the methods that allow to get all the downloads and all the downloads with a given metadata value.

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

looks good, tests pass. will start adding it to unity-scope-click and I'll file separate bugs if there are any problems.

review: Approve
Revision history for this message
Alejandro J. Cura (alecu) wrote :

puked a little bit in my mouth when I saw the size of this, but it looks good: +1

review: Approve
Revision history for this message
dobey (dobey) wrote :

Why are so many changes in this one branch? Particularly the huge change to cmake, addition of coverage reporting (the necessary cmake files of which have some small licensing issues), and several other small bug fixes? The branch is now beyond unreasonably huge, due to r242..246 which were all added after the branch had been approved. Not to mention the 19 other current MPs, some of which are also extremely large.

I find it very hard to believe that a branch of this size, with this many changes, is acceptable to land. Are those commits made *after* the approval really necessary to have here? If so, why?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
247. By Manuel de la Peña

Remove useless files.

248. By Manuel de la Peña

Merged set-download-dir into all-downloads-client.

249. By Manuel de la Peña

Merged set-download-dir into all-downloads-client.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
250. By Manuel de la Peña

Remove the .THIS file.

251. By Manuel de la Peña

Fix the system dbus activation file location.

252. By Manuel de la Peña

Update the name of the package to match the names of the .so

253. By Manuel de la Peña

Move the location of the pkconfig files.

254. By Manuel de la Peña

Add pkgconfig to the .pc paths.

255. By Manuel de la Peña

Do not configure in the wrong dir and jsut move to libexdir on install time.

256. By Manuel de la Peña

Fix broken install path.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'CMakeLists.txt'
--- CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,73 @@
1project(ubuntu-download-manager)
2cmake_minimum_required(VERSION 2.8)
3set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
4set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -pthread")
5
6
7# Standard install paths
8include(GNUInstallDirs)
9
10include(EnableCoverageReport)
11#####################################################################
12# Enable code coverage calculation with gcov/gcovr/lcov
13# Usage:
14# * Switch build type to coverage (use ccmake or cmake-gui)
15# * Invoke make, make test, make coverage
16# * Find html report in subdir coveragereport
17# * Find xml report feasible for jenkins in coverage.xml
18#####################################################################
19IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
20 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs" )
21 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs" )
22 SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -coverage" )
23 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -coverage" )
24 ENABLE_COVERAGE_REPORT(TARGETS ${DIALER_APP})
25ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
26
27execute_process(
28 COMMAND qmake -query QT_INSTALL_QML
29 OUTPUT_VARIABLE QT_INSTALL_QML
30 OUTPUT_STRIP_TRAILING_WHITESPACE
31)
32
33set(UDM_VERSION_MAJOR 0)
34set(UDM_VERSION_MINOR 3)
35set(UDM_VERSION_PATCH 0)
36
37find_package(Gtest REQUIRED)
38include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
39
40# Instruct CMake to run moc automatically when needed.
41set(CMAKE_AUTOMOC ON)
42
43find_package(Qt5Core REQUIRED)
44find_package(Qt5DBus REQUIRED)
45find_package(Qt5Network REQUIRED)
46find_package(Qt5SystemInfo REQUIRED)
47find_package(Qt5Sql REQUIRED)
48find_package(Qt5Test REQUIRED)
49
50find_package(PkgConfig REQUIRED)
51pkg_check_modules(DBUS REQUIRED dbus-1)
52pkg_check_modules(GLOG REQUIRED libglog)
53pkg_check_modules(NIH_DBUS REQUIRED libnih-dbus)
54pkg_check_modules(GLOG REQUIRED libglog)
55pkg_check_modules(GLOG libglog)
56
57enable_testing()
58set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -std=c++11 -Werror -O2 -Wall -W -D_REENTRANT -fPIC -pedantic -Wextra")
59add_definitions("-DNDEBUG")
60
61if(NOT CMAKE_BUILD_TYPE)
62 message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
63 set(CMAKE_BUILD_TYPE RelWithDebInfo)
64endif()
65
66string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower)
67
68if(cmake_build_type_lower MATCHES relwithdebinfo) # workaround for http://pub lic.kitware.com/Bug/view.php?id=14696
69 add_definitions(-DQT_NO_DEBUG)
70endif()
71
72add_subdirectory(src)
73add_subdirectory(tests)
074
=== added directory 'cmake'
=== added directory 'cmake/modules'
=== added file 'cmake/modules/EnableCoverageReport.cmake'
--- cmake/modules/EnableCoverageReport.cmake 1970-01-01 00:00:00 +0000
+++ cmake/modules/EnableCoverageReport.cmake 2014-04-11 16:06:36 +0000
@@ -0,0 +1,153 @@
1# - Creates a special coverage build type and target on GCC.
2#
3# Defines a function ENABLE_COVERAGE_REPORT which generates the coverage target
4# for selected targets. Optional arguments to this function are used to filter
5# unwanted results using globbing expressions. Moreover targets with tests for
6# the source code can be specified to trigger regenerating the report if the
7# test has changed
8#
9# ENABLE_COVERAGE_REPORT(TARGETS target... [FILTER filter...] [TESTS test targets...])
10#
11# To generate a coverage report first build the project with
12# CMAKE_BUILD_TYPE=coverage, then call make test and afterwards make coverage.
13#
14# The coverage report is based on gcov. Depending on the availability of lcov
15# a HTML report will be generated and/or an XML report of gcovr is found.
16# The generated coverage target executes all found solutions. Special targets
17# exist to create e.g. only the xml report: coverage-xml.
18#
19# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
20#
21# This program is free software; you can redistribute it
22# and/or modify it under the terms of the GNU General
23# Public License as published by the Free Software Foundation;
24# either version 2, or (at your option)
25# any later version.
26#
27# This program is distributed in the hope that it will be useful,
28# but WITHOUT ANY WARRANTY; without even the implied warranty of
29# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30# GNU General Public License for more details.
31#
32
33INCLUDE(ParseArguments)
34
35FIND_PACKAGE(Lcov)
36FIND_PACKAGE(gcovr)
37
38FUNCTION(ENABLE_COVERAGE_REPORT)
39
40 # argument parsing
41 PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN})
42
43 SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info")
44 SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info")
45 SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport")
46 SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml")
47 SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake")
48
49 # decide if there is any tool to create coverage data
50 SET(TOOL_FOUND FALSE)
51 IF(LCOV_FOUND OR GCOVR_FOUND)
52 SET(TOOL_FOUND TRUE)
53 ENDIF()
54 IF(NOT TOOL_FOUND)
55 MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.")
56 ENDIF()
57
58 STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE)
59 IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage")
60
61 MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}")
62
63 # create coverage build type
64 SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE)
65 SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE)
66 SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE)
67
68 # instrument targets
69 SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage
70 LINK_FLAGS --coverage)
71
72 # html report
73 IF (LCOV_FOUND)
74
75 MESSAGE(STATUS "Enabling HTML coverage report")
76
77 # set up coverage target
78
79 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE}
80 COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE}
81 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
82 COMMENT "Collecting coverage data"
83 DEPENDS ${ARG_TARGETS} ${ARG_TESTS}
84 VERBATIM)
85
86 # filter unwanted stuff
87 LIST(LENGTH ARG_FILTER FILTER_LENGTH)
88 IF(${FILTER_LENGTH} GREATER 0)
89 SET(FILTER COMMAND ${LCOV_EXECUTABLE})
90 FOREACH(F ${ARG_FILTER})
91 SET(FILTER ${FILTER} -r ${COVERAGE_FILTERED_FILE} ${F})
92 ENDFOREACH()
93 SET(FILTER ${FILTER} -o ${COVERAGE_FILTERED_FILE})
94 ELSE()
95 SET(FILTER "")
96 ENDIF()
97
98 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE}
99 COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE}
100 ${FILTER}
101 DEPENDS ${COVERAGE_RAW_FILE}
102 COMMENT "Filtering recorded coverage data for project-relevant entries"
103 VERBATIM)
104 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_REPORT_DIR}
105 COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_REPORT_DIR}
106 COMMAND ${GENHTML_EXECUTABLE} --legend --show-details -t "${PROJECT_NAME} test coverage" -o ${COVERAGE_REPORT_DIR} ${COVERAGE_FILTERED_FILE}
107 DEPENDS ${COVERAGE_FILTERED_FILE}
108 COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}"
109 VERBATIM)
110
111 ADD_CUSTOM_TARGET(coverage-html
112 DEPENDS ${COVERAGE_REPORT_DIR})
113
114 ENDIF()
115
116 # xml coverage report
117 IF(GCOVR_FOUND)
118
119 MESSAGE(STATUS "Enabling XML coverage report")
120
121 # gcovr cannot write directly to a file so the execution needs to
122 # be wrapped in a cmake file that generates the file output
123 FILE(WRITE ${COVERAGE_XML_COMMAND_FILE}
124 "SET(ENV{LANG} en)\n")
125 FILE(APPEND ${COVERAGE_XML_COMMAND_FILE}
126 "EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" -x -r \"${CMAKE_SOURCE_DIR}\" OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n")
127
128 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE}
129 COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE}
130 COMMENT "Generating coverage XML report"
131 VERBATIM)
132
133 ADD_CUSTOM_TARGET(coverage-xml
134 DEPENDS ${COVERAGE_XML_FILE})
135
136 ENDIF()
137
138 # provide a global coverage target executing both steps if available
139 SET(GLOBAL_DEPENDS "")
140 IF(LCOV_FOUND)
141 LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_REPORT_DIR})
142 ENDIF()
143 IF(GCOVR_FOUND)
144 LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_XML_FILE})
145 ENDIF()
146 IF(LCOV_FOUND OR GCOVR_FOUND)
147 ADD_CUSTOM_TARGET(coverage
148 DEPENDS ${GLOBAL_DEPENDS})
149 ENDIF()
150
151 ENDIF()
152
153ENDFUNCTION()
0154
=== added file 'cmake/modules/FindGtest.cmake'
--- cmake/modules/FindGtest.cmake 1970-01-01 00:00:00 +0000
+++ cmake/modules/FindGtest.cmake 2014-04-11 16:06:36 +0000
@@ -0,0 +1,53 @@
1include(ExternalProject)
2include(FindPackageHandleStandardArgs)
3
4#gtest
5set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
6find_path(GTEST_INCLUDE_DIR gtest/gtest.h
7 HINTS ${GTEST_INSTALL_DIR})
8
9#gmock
10find_path(GMOCK_INSTALL_DIR gmock/CMakeLists.txt
11 HINTS /usr/src)
12if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
13 message(FATAL_ERROR "google-mock package not found")
14endif()
15
16set(GMOCK_INSTALL_DIR ${GMOCK_INSTALL_DIR}/gmock)
17find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
18
19set(GMOCK_PREFIX gmock)
20set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
21set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
22
23set(GTEST_CMAKE_ARGS "")
24if (${MIR_IS_CROSS_COMPILING})
25 set(GTEST_CMAKE_ARGS
26 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
27endif()
28
29ExternalProject_Add(
30 GMock
31 #where to build in source tree
32 PREFIX ${GMOCK_PREFIX}
33 #where the source is external to the project
34 SOURCE_DIR ${GMOCK_INSTALL_DIR}
35 #forward the compilers to the subproject so cross-arch builds work
36 CMAKE_ARGS ${GTEST_CMAKE_ARGS}
37 BINARY_DIR ${GMOCK_BINARY_DIR}
38
39 #we don't need to install, so skip
40 INSTALL_COMMAND ""
41)
42
43set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
44set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
45set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
46set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
47set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
48set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
49set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
50
51find_package_handle_standard_args(GTest DEFAULT_MSG
52 GMOCK_INCLUDE_DIR
53 GTEST_INCLUDE_DIR)
054
=== added file 'cmake/modules/FindLcov.cmake'
--- cmake/modules/FindLcov.cmake 1970-01-01 00:00:00 +0000
+++ cmake/modules/FindLcov.cmake 2014-04-11 16:06:36 +0000
@@ -0,0 +1,29 @@
1# - Find lcov
2# Will define:
3#
4# LCOV_EXECUTABLE - the lcov binary
5# GENHTML_EXECUTABLE - the genhtml executable
6#
7# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
8#
9# This program is free software; you can redistribute it
10# and/or modify it under the terms of the GNU General
11# Public License as published by the Free Software Foundation;
12# either version 2, or (at your option)
13# any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20
21INCLUDE(FindPackageHandleStandardArgs)
22
23FIND_PROGRAM(LCOV_EXECUTABLE lcov)
24FIND_PROGRAM(GENHTML_EXECUTABLE genhtml)
25
26FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lcov DEFAULT_MSG LCOV_EXECUTABLE GENHTML_EXECUTABLE)
27
28# only visible in advanced view
29MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
030
=== added file 'cmake/modules/Findgcovr.cmake'
--- cmake/modules/Findgcovr.cmake 1970-01-01 00:00:00 +0000
+++ cmake/modules/Findgcovr.cmake 2014-04-11 16:06:36 +0000
@@ -0,0 +1,31 @@
1# - Find gcovr scrip
2# Will define:
3#
4# GCOVR_EXECUTABLE - the gcovr script
5#
6# Uses:
7#
8# GCOVR_ROOT - root to search for the script
9#
10# Copyright (C) 2011 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
11#
12# This program is free software; you can redistribute it
13# and/or modify it under the terms of the GNU General
14# Public License as published by the Free Software Foundation;
15# either version 2, or (at your option)
16# any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23
24INCLUDE(FindPackageHandleStandardArgs)
25
26FIND_PROGRAM(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin")
27
28FIND_PACKAGE_HANDLE_STANDARD_ARGS(gcovr DEFAULT_MSG GCOVR_EXECUTABLE)
29
30# only visible in advanced view
31MARK_AS_ADVANCED(GCOVR_EXECUTABLE)
032
=== added file 'cmake/modules/ParseArguments.cmake'
--- cmake/modules/ParseArguments.cmake 1970-01-01 00:00:00 +0000
+++ cmake/modules/ParseArguments.cmake 2014-04-11 16:06:36 +0000
@@ -0,0 +1,52 @@
1# Parse arguments passed to a function into several lists separated by
2# upper-case identifiers and options that do not have an associated list e.g.:
3#
4# SET(arguments
5# hello OPTION3 world
6# LIST3 foo bar
7# OPTION2
8# LIST1 fuz baz
9# )
10# PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "OPTION1;OPTION2;OPTION3" ${arguments})
11#
12# results in 7 distinct variables:
13# * ARG_DEFAULT_ARGS: hello;world
14# * ARG_LIST1: fuz;baz
15# * ARG_LIST2:
16# * ARG_LIST3: foo;bar
17# * ARG_OPTION1: FALSE
18# * ARG_OPTION2: TRUE
19# * ARG_OPTION3: TRUE
20#
21# taken from http://www.cmake.org/Wiki/CMakeMacroParseArguments
22
23MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
24 SET(DEFAULT_ARGS)
25 FOREACH(arg_name ${arg_names})
26 SET(${prefix}_${arg_name})
27 ENDFOREACH(arg_name)
28 FOREACH(option ${option_names})
29 SET(${prefix}_${option} FALSE)
30 ENDFOREACH(option)
31
32 SET(current_arg_name DEFAULT_ARGS)
33 SET(current_arg_list)
34 FOREACH(arg ${ARGN})
35 SET(larg_names ${arg_names})
36 LIST(FIND larg_names "${arg}" is_arg_name)
37 IF (is_arg_name GREATER -1)
38 SET(${prefix}_${current_arg_name} ${current_arg_list})
39 SET(current_arg_name ${arg})
40 SET(current_arg_list)
41 ELSE (is_arg_name GREATER -1)
42 SET(loption_names ${option_names})
43 LIST(FIND loption_names "${arg}" is_option)
44 IF (is_option GREATER -1)
45 SET(${prefix}_${arg} TRUE)
46 ELSE (is_option GREATER -1)
47 SET(current_arg_list ${current_arg_list} ${arg})
48 ENDIF (is_option GREATER -1)
49 ENDIF (is_arg_name GREATER -1)
50 ENDFOREACH(arg)
51 SET(${prefix}_${current_arg_name} ${current_arg_list})
52ENDMACRO(PARSE_ARGUMENTS)
053
=== removed file 'common-installs-config.pri'
--- common-installs-config.pri 2013-12-03 11:06:36 +0000
+++ common-installs-config.pri 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1#-----------------------------------------------------------------------------
2# Common installation configuration for all projects.
3#-----------------------------------------------------------------------------
4
5#-----------------------------------------------------------------------------
6# default installation target for applications
7#-----------------------------------------------------------------------------
8contains( TEMPLATE, app ) {
9 target.path = $${INSTALL_PREFIX}/bin
10 INSTALLS += target
11 message("====")
12 message("==== INSTALLS += target")
13}
14
15#-----------------------------------------------------------------------------
16# default installation target for libraries
17#-----------------------------------------------------------------------------
18contains( TEMPLATE, lib ) {
19
20 target.path = $${INSTALL_LIBDIR}
21 INSTALLS += target
22 message("====")
23 message("==== INSTALLS += target")
24
25 # reset the .pc file's `prefix' variable
26 #include( tools/fix-pc-prefix.pri )
27
28}
29
30#-----------------------------------------------------------------------------
31# target for header files
32#-----------------------------------------------------------------------------
33!isEmpty( headers.files ) {
34 headers.path = $${INSTALL_PREFIX}/include/ubuntu/download_manager
35 INSTALLS += headers
36 message("====")
37 message("==== INSTALLS += headers")
38} else {
39 message("====")
40 message("==== NOTE: Remember to add your API headers into `headers.files' for installation!")
41}
42
43
44# End of File
450
=== removed file 'common-pkgconfig.pri'
--- common-pkgconfig.pri 2013-12-03 11:06:36 +0000
+++ common-pkgconfig.pri 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1# Include this file after defining the pkgconfig.files variable
2
3!isEmpty(pkgconfig.files) {
4 QMAKE_SUBSTITUTES += $${pkgconfig.files}.in
5 pkgconfig.CONFIG = no_check_exist
6 pkgconfig.path = $${INSTALL_LIBDIR}/pkgconfig
7 QMAKE_EXTRA_TARGETS += pkgconfig
8
9 QMAKE_CLEAN += $${pkgconfig.files}
10}
110
=== removed file 'common-project-config.pri'
--- common-project-config.pri 2014-01-22 15:16:14 +0000
+++ common-project-config.pri 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
1#-----------------------------------------------------------------------------
2# Common configuration for all projects.
3#-----------------------------------------------------------------------------
4
5QT -= gui
6CONFIG += link_pkgconfig
7
8TOP_SRC_DIR = $$PWD
9TOP_BUILD_DIR = $${TOP_SRC_DIR}/$${BUILD_DIR}
10QMAKE_LIBDIR += $${TOP_BUILD_DIR}
11INCLUDEPATH += $${TOP_SRC_DIR}
12QMAKE_CXXFLAGS += -std=c++11 -Werror
13
14#-----------------------------------------------------------------------------
15# setup the installation prefix
16#-----------------------------------------------------------------------------
17INSTALL_PREFIX = /usr # default installation prefix
18
19# default prefix can be overriden by defining PREFIX when running qmake
20isEmpty( PREFIX ) {
21 message("====")
22 message("==== NOTE: To override the installation path run: `qmake PREFIX=/custom/path'")
23 message("==== (current installation path is `$${INSTALL_PREFIX}')")
24} else {
25 INSTALL_PREFIX = $${PREFIX}
26 message("====")
27 message("==== install prefix set to `$${INSTALL_PREFIX}'")
28}
29
30ARCH = $$system(uname -m)
31contains( ARCH, x86_64 ) {
32 INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib/x86_64-linux-gnu
33} else {
34 contains( ARCH, i686) {
35 INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib/i386-linux-gnu
36 } else {
37 INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib/arm-linux-gnueabihf
38 }
39}
40
41# default library directory can be overriden by defining LIBDIR when
42# running qmake
43isEmpty( LIBDIR ) {
44 message("====")
45 message("==== NOTE: To override the library installation path run: `qmake LIBDIR=/custom/path'")
46 message("==== (current installation path is `$${INSTALL_LIBDIR}')")
47} else {
48 INSTALL_LIBDIR = $${LIBDIR}
49 message("====")
50 message("==== library install path set to `$${INSTALL_LIBDIR}'")
51}
52
53include( coverage.pri )
54
55# End of File
56
570
=== removed file 'common-vars.pri'
--- common-vars.pri 2013-12-03 11:06:36 +0000
+++ common-vars.pri 1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
1#-----------------------------------------------------------------------------
2# Common variables for all projects.
3#-----------------------------------------------------------------------------
4DEFINES += BUILDING_UBUNTU_DOWNLOAD_MANAGER
5
6
7#-----------------------------------------------------------------------------
8# Project name (used e.g. in include file and doc install path).
9#-----------------------------------------------------------------------------
10PROJECT_NAME = ubuntu-download-manager
11
12
13#-----------------------------------------------------------------------------
14# Project version
15#-----------------------------------------------------------------------------
16PROJECT_VERSION = 0.3
17
18#-----------------------------------------------------------------------------
19# Library version
20#-----------------------------------------------------------------------------
21VERSION = 0.3
220
=== removed file 'common.pri'
--- common.pri 2013-07-03 11:02:59 +0000
+++ common.pri 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1contains(QT_VERSION, ^4.*) {
2 error("Use at least Qt 5.x");
3}
4
5include( coverage.pri )
60
=== removed file 'coverage.pri'
--- coverage.pri 2013-07-03 11:02:59 +0000
+++ coverage.pri 1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
1# Coverage Support
2# --------------------------------
3# In order to generate coverage report you will have to:
4# 0) Install following packages: gcovr lcov
5# 1) Configure project with coverage enabled
6# 1.1) qmake CONFIG+=coverage
7# 2) Compile project with coverage target
8# 2.1) xml report
9# 2.1.1) make coverage-xml
10# 2.2) html report
11# 2.2.1) make coverage-html
12#
13# In order to regenerate the report you might need to do following steps:
14# 1) make distclean
15# 2) qmake -r CONFIG+=coverage
16# 3) make coverage-html or make coverage-xml
17# --------------------------------
18
19CONFIG(coverage) {
20 OBJECTS_DIR =
21 MOC_DIR =
22 TOP_SRC_DIR = $$PWD
23
24 LIBS += -lgcov
25 QMAKE_CXXFLAGS += --coverage
26 QMAKE_LDFLAGS += --coverage
27
28 QMAKE_EXTRA_TARGETS += coverage cov
29 QMAKE_EXTRA_TARGETS += clean-gcno clean-gcda coverage-html \
30 generate-coverage-html clean-coverage-html coverage-xml \
31 generate-xml generate-coverage-xml clean-coverage-xml
32
33 clean-gcno.commands = \
34 "@echo Removing old coverage instrumentation"; \
35 "find -name '*.gcno' -print | xargs -r rm"
36
37 clean-gcda.commands = \
38 "@echo Removing old coverage results"; \
39 "find -name '*.gcda' -print | xargs -r rm"
40
41 coverage-html.depends = clean-gcda check generate-coverage-html
42
43 generate-coverage-html.commands = \
44 "@echo Collecting coverage data"; \
45 "lcov --directory $${TOP_SRC_DIR} --capture --output-file coverage.info --no-checksum --compat-libtool"; \
46 "lcov --extract coverage.info \"*/modules/*.cpp\" -o coverage.info"; \
47 "lcov --remove coverage.info \"moc_*.cpp\" -o coverage.info"; \
48 "LANG=C genhtml --prefix $${TOP_SRC_DIR} --output-directory coverage-html --title \"Code Coverage\" --legend --show-details coverage.info"
49
50 clean-coverage-html.depends = clean-gcda
51 clean-coverage-html.commands = \
52 "lcov --directory $${TOP_SRC_DIR} -z"; \
53 "rm -rf coverage.info coverage-html"
54
55 coverage-xml.depends = clean-gcda check generate-coverage-xml
56
57 generate-coverage-xml.commands = \
58 "@echo Generating coverage GCOVR XML report"; \
59 "gcovr -x -r $${TOP_SRC_DIR} -o $${TOP_SRC_DIR}/coverage.xml -e \".*/moc_.*\" -e \"unit/.*\" -e \".*\\.h\""
60
61 clean-coverage-xml.depends = clean-gcda
62 clean-coverage-xml.commands = \
63 "rm -rf $${TOP_SRC_DIR}/coverage.xml"
64
65 QMAKE_CLEAN += *.gcda *.gcno coverage.info coverage.xml
66}
670
=== modified file 'debian/control'
--- debian/control 2014-03-20 16:23:00 +0000
+++ debian/control 2014-04-11 16:06:36 +0000
@@ -1,7 +1,10 @@
1Source: ubuntu-download-manager1Source: ubuntu-download-manager
2Section: net2Section: net
3Priority: optional3Priority: optional
4Build-Depends: debhelper (>= 9),4Build-Depends: cmake,
5 debhelper (>= 9),
6 dbus-test-runner,
7 google-mock,
5 qt5-qmake,8 qt5-qmake,
6 qt5-default,9 qt5-default,
7 qtbase5-dev,10 qtbase5-dev,
@@ -10,7 +13,6 @@
10 libqt5sql5-sqlite,13 libqt5sql5-sqlite,
11 libnih-dbus-dev,14 libnih-dbus-dev,
12 libgoogle-glog-dev,15 libgoogle-glog-dev,
13 dbus-test-runner,
14 qtdeclarative5-dev,16 qtdeclarative5-dev,
15 qtdeclarative5-dev-tools,17 qtdeclarative5-dev-tools,
16 qtdeclarative5-test-plugin18 qtdeclarative5-test-plugin
@@ -22,10 +24,47 @@
22# upstream branch24# upstream branch
23Vcs-Bzr: lp:ubuntu-download-manager25Vcs-Bzr: lp:ubuntu-download-manager
2426
27Package: libudm-common0
28Section: libs
29Architecture: any
30Depends: ${misc:Depends},
31 ${shlibs:Depends},
32Description: Upload Download Manager - shared common library
33 Upload Download Manager performs uploads and downloads from a centralized
34 location.
35 .
36 This package includes the common shared library between the client lib and the
37 service lib.
38
39Package: libudm-common-dev
40Section: libdevel
41Architecture: any
42Depends: libudm-common0 (= ${binary:Version}),
43 qtbase5-dev,
44 ${shlibs:Depends},
45 ${misc:Depends}
46Description: QT library for Ubuntu Download Manager - development files
47 This package contains the common headers shared between the client library and
48 the daemon library.
49
50Package: libudm-priv0
51Section: libs
52Architecture: any
53Depends: ${misc:Depends},
54 ${shlibs:Depends},
55 libudm-common0 (= ${binary:Version}),
56Breaks: libubuntu-download-manager-priv1
57Replaces: libubuntu-download-manager-priv1
58Description: Upload Download Manager - shared private library
59 Upload Download Manager performs downloads from a centralized location.
60 .
61 This package includes the private shared library.
62
25Package: libubuntu-download-manager-common063Package: libubuntu-download-manager-common0
26Section: libs64Section: libs
27Architecture: any65Architecture: any
28Depends: ${misc:Depends},66Depends: libudm-common0 (= ${binary:Version}),
67 ${misc:Depends},
29 ${shlibs:Depends},68 ${shlibs:Depends},
30Breaks: ubuntu-download-manager-common169Breaks: ubuntu-download-manager-common1
31Replaces: ubuntu-download-manager-common170Replaces: ubuntu-download-manager-common1
@@ -38,7 +77,8 @@
38Package: libubuntu-download-manager-common-dev77Package: libubuntu-download-manager-common-dev
39Section: libdevel78Section: libdevel
40Architecture: any79Architecture: any
41Depends: libubuntu-download-manager-common0 (= ${binary:Version}),80Depends: libudm-common-dev (= ${binary:Version}),
81 libubuntu-download-manager-common0 (= ${binary:Version}),
42 qtbase5-dev,82 qtbase5-dev,
43 ${shlibs:Depends},83 ${shlibs:Depends},
44 ${misc:Depends}84 ${misc:Depends}
@@ -48,24 +88,12 @@
48 This package contains the common headers shared between the client library and88 This package contains the common headers shared between the client library and
49 the daemon library.89 the daemon library.
5090
51Package: libubuntu-download-manager-priv0
52Section: libs
53Architecture: any
54Depends: ${misc:Depends},
55 ${shlibs:Depends},
56 libubuntu-download-manager-common0 (= ${binary:Version}),
57Breaks: ubuntu-download-manager-priv1
58Replaces: ubuntu-download-manager-priv1
59Description: Ubuntu Download Manager - shared private library
60 Ubuntu Download Manager performs downloads from a centralized location.
61 .
62 This package includes the private shared library.
63
64Package: libubuntu-download-manager-client091Package: libubuntu-download-manager-client0
65Section: libs92Section: libs
66Architecture: any93Architecture: any
67Depends: ${misc:Depends},94Depends: ${misc:Depends},
68 ${shlibs:Depends},95 ${shlibs:Depends},
96 libudm-common0 (= ${binary:Version}),
69 libubuntu-download-manager-common0 (= ${binary:Version}),97 libubuntu-download-manager-common0 (= ${binary:Version}),
70Breaks: ubuntu-download-manager-client198Breaks: ubuntu-download-manager-client1
71Replaces: ubuntu-download-manager-client199Replaces: ubuntu-download-manager-client1
@@ -77,7 +105,8 @@
77Package: libubuntu-download-manager-client-dev105Package: libubuntu-download-manager-client-dev
78Section: libdevel106Section: libdevel
79Architecture: any107Architecture: any
80Depends: libubuntu-download-manager-common-dev (= ${binary:Version}),108Depends: libudm-common-dev (= ${binary:Version}),
109 libubuntu-download-manager-common-dev (= ${binary:Version}),
81 libubuntu-download-manager-client0 (= ${binary:Version}),110 libubuntu-download-manager-client0 (= ${binary:Version}),
82 qtbase5-dev,111 qtbase5-dev,
83 ${shlibs:Depends},112 ${shlibs:Depends},
@@ -88,22 +117,63 @@
88 This package contains the header that can be used to allow an application use117 This package contains the header that can be used to allow an application use
89 the Ubuntu Download Manager client library.118 the Ubuntu Download Manager client library.
90119
120Package: libubuntu-upload-manager-common0
121Section: libs
122Architecture: any
123Depends: libudm-common0 (= ${binary:Version}),
124 ${misc:Depends},
125 ${shlibs:Depends},
126Description: Ubuntu Upload Manager - shared common library
127 Ubuntu Upload Manager performs uploads from a centralized location.
128 .
129 This package includes the common shared library between the client lib and the
130 service lib.
131
132Package: libubuntu-upload-manager-common-dev
133Section: libdevel
134Architecture: any
135Depends: libudm-common-dev (= ${binary:Version}),
136 libubuntu-download-manager-common0 (= ${binary:Version}),
137 qtbase5-dev,
138 ${shlibs:Depends},
139 ${misc:Depends}
140Description: QT library for Ubuntu Upload Manager - development files
141 This package contains the common headers shared between the client library and
142 the daemon library.
143
91Package: ubuntu-download-manager144Package: ubuntu-download-manager
92Section: net145Section: net
93Architecture: any146Architecture: any
94Depends: ${misc:Depends},147Depends: ${misc:Depends},
95 ${shlibs:Depends},148 ${shlibs:Depends},
96 libubuntu-download-manager-priv0 (= ${binary:Version}),149 libudm-common0 (= ${binary:Version}),
150 libudm-priv0 (= ${binary:Version}),
151 libubuntu-download-manager-common0 (= ${binary:Version}),
97Description: Ubuntu Download Manager - daemon152Description: Ubuntu Download Manager - daemon
98 Ubuntu Download Manager performs downloads from a centralized location.153 Ubuntu Download Manager performs downloads from a centralized location.
99 .154 .
100 This package includes the daemon.155 This package includes the daemon.
101156
157Package: ubuntu-upload-manager
158Section: net
159Architecture: any
160Depends: ${misc:Depends},
161 ${shlibs:Depends},
162 libudm-common0 (= ${binary:Version}),
163 libudm-priv0 (= ${binary:Version}),
164 libubuntu-upload-manager-common0 (= ${binary:Version}),
165Description: Ubuntu Upload Manager - daemon
166 Ubuntu Upload Manager performs uploads from a centralized location.
167 .
168 This package includes the daemon.
169
102Package: qtdeclarative5-ubuntu-download-manager0.1170Package: qtdeclarative5-ubuntu-download-manager0.1
103Section: net171Section: net
104Architecture: any172Architecture: any
105Depends: ${misc:Depends},173Depends: ${misc:Depends},
106 ${shlibs:Depends},174 ${shlibs:Depends},
175 libudm-common0 (= ${binary:Version}),
176 libubuntu-download-manager-common0 (= ${binary:Version}),
107 libubuntu-download-manager-client0 (= ${binary:Version})177 libubuntu-download-manager-client0 (= ${binary:Version})
108Description: Ubuntu Download Manager Plugin178Description: Ubuntu Download Manager Plugin
109 This package contains a QML Plugin to handle downloads from a pure QML179 This package contains a QML Plugin to handle downloads from a pure QML
110180
=== modified file 'debian/libubuntu-download-manager-client-dev.install'
--- debian/libubuntu-download-manager-client-dev.install 2014-02-10 18:04:03 +0000
+++ debian/libubuntu-download-manager-client-dev.install 2014-04-11 16:06:36 +0000
@@ -2,5 +2,5 @@
2usr/include/ubuntu/download_manager/manager.h2usr/include/ubuntu/download_manager/manager.h
3usr/include/ubuntu/download_manager/download.h3usr/include/ubuntu/download_manager/download.h
4usr/include/ubuntu/download_manager/group_download.h4usr/include/ubuntu/download_manager/group_download.h
5usr/lib/*/pkgconfig/ubuntu-download-manager-client.pc5usr/share/pkgconfig/ubuntu-download-manager-client.pc
6usr/lib/*/libubuntu-download-manager-client.so6usr/lib/*/libubuntu-download-manager-client.so
77
=== modified file 'debian/libubuntu-download-manager-common-dev.install'
--- debian/libubuntu-download-manager-common-dev.install 2014-02-19 19:01:37 +0000
+++ debian/libubuntu-download-manager-common-dev.install 2014-04-11 16:06:36 +0000
@@ -2,10 +2,5 @@
2usr/include/ubuntu/download_manager/metatypes.h2usr/include/ubuntu/download_manager/metatypes.h
3usr/include/ubuntu/download_manager/download_struct.h3usr/include/ubuntu/download_manager/download_struct.h
4usr/include/ubuntu/download_manager/group_download_struct.h4usr/include/ubuntu/download_manager/group_download_struct.h
5usr/include/ubuntu/download_manager/auth_error_struct.h5usr/share/pkgconfig/ubuntu-download-manager-common.pc
6usr/include/ubuntu/download_manager/http_error_struct.h
7usr/include/ubuntu/download_manager/network_error_struct.h
8usr/include/ubuntu/download_manager/process_error_struct.h
9usr/include/ubuntu/download_manager/metadata.h
10usr/lib/*/pkgconfig/ubuntu-download-manager-common.pc
11usr/lib/*/libubuntu-download-manager-common.so6usr/lib/*/libubuntu-download-manager-common.so
127
=== removed file 'debian/libubuntu-download-manager-priv0.install'
--- debian/libubuntu-download-manager-priv0.install 2014-02-10 18:04:03 +0000
+++ debian/libubuntu-download-manager-priv0.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1usr/lib/*/libubuntu-download-manager-priv.so.0*
20
=== added file 'debian/libubuntu-upload-manager-common-dev.install'
--- debian/libubuntu-upload-manager-common-dev.install 1970-01-01 00:00:00 +0000
+++ debian/libubuntu-upload-manager-common-dev.install 2014-04-11 16:06:36 +0000
@@ -0,0 +1,5 @@
1usr/include/ubuntu/upload_manager/common.h
2usr/include/ubuntu/upload_manager/metatypes.h
3usr/include/ubuntu/upload_manager/upload_struct.h
4usr/share/pkgconfig/ubuntu-upload-manager-common.pc
5usr/lib/*/libubuntu-upload-manager-common.so
06
=== added file 'debian/libubuntu-upload-manager-common0.install'
--- debian/libubuntu-upload-manager-common0.install 1970-01-01 00:00:00 +0000
+++ debian/libubuntu-upload-manager-common0.install 2014-04-11 16:06:36 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/libubuntu-upload-manager-common.so.0*
02
=== added file 'debian/libudm-common-dev.install'
--- debian/libudm-common-dev.install 1970-01-01 00:00:00 +0000
+++ debian/libudm-common-dev.install 2014-04-11 16:06:36 +0000
@@ -0,0 +1,7 @@
1usr/include/ubuntu/transfers/metadata.h
2usr/include/ubuntu/transfers/errors/auth_error_struct.h
3usr/include/ubuntu/transfers/errors/http_error_struct.h
4usr/include/ubuntu/transfers/errors/network_error_struct.h
5usr/include/ubuntu/transfers/errors/process_error_struct.h
6usr/share/pkgconfig/udm-common.pc
7usr/lib/*/libudm-common.so
08
=== added file 'debian/libudm-common0.install'
--- debian/libudm-common0.install 1970-01-01 00:00:00 +0000
+++ debian/libudm-common0.install 2014-04-11 16:06:36 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/libudm-common.so.0*
02
=== added file 'debian/libudm-priv0.install'
--- debian/libudm-priv0.install 1970-01-01 00:00:00 +0000
+++ debian/libudm-priv0.install 2014-04-11 16:06:36 +0000
@@ -0,0 +1,1 @@
1usr/lib/*/libudm-priv-common.so.0*
02
=== modified file 'debian/qtdeclarative5-ubuntu-download-manager0.1.install'
--- debian/qtdeclarative5-ubuntu-download-manager0.1.install 2014-03-20 11:41:09 +0000
+++ debian/qtdeclarative5-ubuntu-download-manager0.1.install 2014-04-11 16:06:36 +0000
@@ -1,2 +1,2 @@
1usr/lib/*/qt5/qml/UbuntuDownloadManager.0.1/libUbuntuDownloadManager.so1usr/lib/*/qt5/qml/UbuntuDownloadManager/libUbuntuDownloadManager.so
2usr/lib/*/qt5/qml/UbuntuDownloadManager.0.1/qmldir2usr/lib/*/qt5/qml/UbuntuDownloadManager/qmldir
33
=== modified file 'debian/rules'
--- debian/rules 2014-03-19 10:42:33 +0000
+++ debian/rules 2014-04-11 16:06:36 +0000
@@ -7,8 +7,24 @@
77
8export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)8export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
99
10DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11# Work around pointer equality problem with -Bsymbolic-functions:
12# http://lists.linaro.org/pipermail/linaro-toolchain/2014-January/003944.html
13ifneq (,$(findstring powerpc,$(DEB_HOST_GNU_TYPE)))
14export DEB_BUILD_MAINT_OPTIONS := hardening=+pie
15endif
16
17ifneq (,$(findstring arm,$(DEB_HOST_GNU_TYPE)))
18export DEB_BUILD_MAINT_OPTIONS := hardening=+pie
19endif
20
21
22ifneq (,$(findstring aarch64,$(DEB_HOST_GNU_TYPE)))
23export DEB_BUILD_MAINT_OPTIONS := hardening=+pie
24endif
25
10override_dh_auto_configure:26override_dh_auto_configure:
11 dh_auto_configure -- LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)27 dh_auto_configure -- -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
1228
13dh_auto_install:29dh_auto_install:
14 rm -f debian/tmp/usr/lib/*.so30 rm -f debian/tmp/usr/lib/*.so
1531
=== modified file 'debian/ubuntu-download-manager.install'
--- debian/ubuntu-download-manager.install 2013-09-20 12:52:33 +0000
+++ debian/ubuntu-download-manager.install 2014-04-11 16:06:36 +0000
@@ -1,4 +1,4 @@
1usr/bin/ubuntu-download-manager1usr/bin/ubuntu-download-manager
2usr/share/dbus-1/services/ubuntu-download-manager.service2usr/share/dbus-1/services/ubuntu-download-manager.service
3usr/share/dbus-1/system-services/com.canonical.applications.Downloader.service3etc/dbus-1/system-services/com.canonical.applications.Downloader.service
4etc/dbus-1/system.d/com.canonical.applications.Downloader.conf4etc/dbus-1/system.d/com.canonical.applications.Downloader.conf
55
=== added file 'debian/ubuntu-upload-manager.install'
--- debian/ubuntu-upload-manager.install 1970-01-01 00:00:00 +0000
+++ debian/ubuntu-upload-manager.install 2014-04-11 16:06:36 +0000
@@ -0,0 +1,4 @@
1usr/bin/ubuntu-upload-manager
2usr/share/dbus-1/services/ubuntu-upload-manager.service
3etc/dbus-1/system-services/com.canonical.applications.Uploader.service
4etc/dbus-1/system.d/com.canonical.applications.Uploader.conf
05
=== modified file 'docs/com.canonical.applications.download.xml'
--- docs/com.canonical.applications.download.xml 2014-02-11 15:35:52 +0000
+++ docs/com.canonical.applications.download.xml 2014-04-11 16:06:36 +0000
@@ -22,6 +22,10 @@
22 <arg name="speed" type="t" direction="out"/>22 <arg name="speed" type="t" direction="out"/>
23 </method>23 </method>
2424
25 <method name="setDestinationDir">
26 <arg name="path" type="s" direction="in"/>
27 </method>
28
25 <method name="allowGSMDownload">29 <method name="allowGSMDownload">
26 <arg name="allowed" type="b" direction="in"/>30 <arg name="allowed" type="b" direction="in"/>
27 </method>31 </method>
2832
=== added file 'docs/com.canonical.applications.upload.xml'
--- docs/com.canonical.applications.upload.xml 1970-01-01 00:00:00 +0000
+++ docs/com.canonical.applications.upload.xml 2014-04-11 16:06:36 +0000
@@ -0,0 +1,73 @@
1<node>
2 <interface name="com.canonical.applications.Upload">
3
4 <method name="progress">
5 <arg name="uploaded" type="t" direction="out"/>
6 </method>
7
8 <method name="metadata">
9 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
10 <arg name="data" type="a{sv}" direction="out" />
11 </method>
12
13 <method name="setThrottle">
14 <arg name="speed" type="t" direction="in"/>
15 </method>
16
17 <method name="throttle">
18 <arg name="speed" type="t" direction="out"/>
19 </method>
20
21 <method name="allowMobileUpload">
22 <arg name="allowed" type="b" direction="in"/>
23 </method>
24
25 <method name="isMobileUploadAllowed">
26 <arg name="allowed" type="b" direction="out"/>
27 </method>
28
29 <method name="start" />
30 <method name="cancel" />
31
32 <signal name="started">
33 <arg name="success" type="b" direction="out"/>
34 </signal>
35
36 <signal name="canceled">
37 <arg name="success" type="b" direction="out"/>
38 </signal>
39
40 <signal name="finished">
41 </signal>
42
43 <signal name="error">
44 <arg name="error" type="s" direction="out"/>
45 </signal>
46
47 <signal name="authError">
48 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="AuthErrorStruct"/>
49 <arg name="error" type="(is)" direction="out"/>
50 </signal>
51
52 <signal name="httpError">
53 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="HttpErrorStruct"/>
54 <arg name="error" type="(is)" direction="out"/>
55 </signal>
56
57 <signal name="networkError">
58 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="NetworkErrorStruct"/>
59 <arg name="error" type="(is)" direction="out"/>
60 </signal>
61
62 <signal name="processError">
63 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="ProcessErrorStruct"/>
64 <arg name="error" type="(isiss)" direction="out"/>
65 </signal>
66
67 <signal name="progress">
68 <arg name="uploded" type="t" direction="out"/>
69 <arg name="total" type="t" direction="out"/>
70 </signal>
71
72 </interface>
73</node>
074
=== added file 'docs/com.canonical.applications.upload_manager.xml'
--- docs/com.canonical.applications.upload_manager.xml 1970-01-01 00:00:00 +0000
+++ docs/com.canonical.applications.upload_manager.xml 2014-04-11 16:06:36 +0000
@@ -0,0 +1,52 @@
1<node>
2 <interface name="com.canonical.applications.UploadManager">
3 <method name="createUpload">
4 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="UploadStruct"/>
5 <arg name="upload" type="(ssa{sv}a{ss})" direction="in" />
6 <arg name="uploadPath" type="o" direction="out" />
7 </method>
8
9 <method name="createMmsUpload">
10 <arg name="url" type="s" direction="in" />
11 <arg name="file" type="s" direction="in" />
12 <arg name="hostname" type="s" direction="in" />
13 <arg name="port" type="i" direction="in" />
14 <arg name="username" type="s" direction="in" />
15 <arg name="password" type="s" direction="in" />
16 <arg name="uploadPath" type="o" direction="out" />
17 </method>
18
19 <method name="getAllUploads">
20 <arg name="uploads" type="ao" direction="out" />
21 </method>
22
23 <method name="getAllUploadsWithMetadata">
24 <arg name="name" type="s" direction="in"/>
25 <arg name="value" type="s" direction="in"/>
26 <arg name="uploads" type="ao" direction="out" />
27 </method>
28
29 <method name="setDefaultThrottle">
30 <arg name="speed" type="t" direction="in"/>
31 </method>
32
33 <method name="defaultThrottle">
34 <arg name="speed" type="t" direction="out"/>
35 </method>
36
37 <method name="allowMobileUpload">
38 <arg name="allowed" type="b" direction="in"/>
39 </method>
40
41 <method name="isMobileUploadAllowed">
42 <arg name="allowed" type="b" direction="out"/>
43 </method>
44
45 <method name="exit" />
46
47 <signal name="uploadCreated">
48 <arg name="path" type="o" direction="out"/>
49 </signal>
50
51 </interface>
52</node>
053
=== removed file 'download-manager.pro'
--- download-manager.pro 2014-03-06 12:18:32 +0000
+++ download-manager.pro 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
1include(common.pri)
2
3TEMPLATE = subdirs
4CONFIG += ordered
5
6SUBDIRS += \
7 ubuntu-download-manager-common \
8 ubuntu-download-manager-priv \
9 ubuntu-download-manager \
10 ubuntu-download-manager-client \
11 ubuntu-download-manager-test-lib \
12 ubuntu-download-manager-tests \
13 ubuntu-download-manager-common-tests \
14 ubuntu-download-manager-test-daemon \
15 ubuntu-download-manager-client-tests \
16 ubuntu-download-manager-client-tests \
17 ubuntu-download-manager-plugin
18
19ubuntu-download-manager-priv.depends = ubuntu-download-manager-common
20
21ubuntu-download-manager.depends = ubuntu-download-manager-priv
22
23ubuntu-download-manager-client.depends = ubuntu-download-manager-common
24
25ubuntu-download-manager-common-tests.depends += ubuntu-download-manager-test-daemon
26ubuntu-download-manager-common-tests.depends += ubuntu-download-manager-common
27ubuntu-download-manager-common-tests.depends += ubuntu-download-manager-test-lib
28
29ubuntu-download-manager-tests.depends += ubuntu-download-manager-test-lib
30ubuntu-download-manager-tests.depends += ubuntu-download-manager-priv
31
32ubuntu-download-manager-client-tests.depends += ubuntu-download-manager-test-daemon
33ubuntu-download-manager-client-tests.depends += ubuntu-download-manager-test-lib
34ubuntu-download-manager-client-tests.depends += ubuntu-download-manager-client
350
=== added directory 'src'
=== added file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,19 @@
1# Copyright © 2013 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License version 3 as
5# published by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14#
15# Authored by: Manuel de la Peña <manuel.delapena@canonical.com>
16
17add_subdirectory(common)
18add_subdirectory(downloads)
19add_subdirectory(uploads)
020
=== added directory 'src/common'
=== added file 'src/common/CMakeLists.txt'
--- src/common/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/common/CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,18 @@
1# Copyright © 2013 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License version 3 as
5# published by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14#
15# Authored by: Manuel de la Peña <manuel.delapena@canonical.com>
16
17add_subdirectory(priv)
18add_subdirectory(public)
019
=== added directory 'src/common/priv'
=== added file 'src/common/priv/CMakeLists.txt'
--- src/common/priv/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/common/priv/CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,87 @@
1set(TARGET udm-priv-common)
2
3set(SOURCES
4 ubuntu/transfers/base_daemon.cpp
5 ubuntu/transfers/base_manager.cpp
6 ubuntu/transfers/queue.cpp
7 ubuntu/transfers/transfer.cpp
8 ubuntu/transfers/system/apn_proxy.cpp
9 ubuntu/transfers/system/apn_request_factory.cpp
10 ubuntu/transfers/system/apparmor.cpp
11 ubuntu/transfers/system/application.cpp
12 ubuntu/transfers/system/cryptographic_hash.cpp
13 ubuntu/transfers/system/dbus_proxy.cpp
14 ubuntu/transfers/system/file_manager.cpp
15 ubuntu/transfers/system/filename_mutex.cpp
16 ubuntu/transfers/system/network_reply.cpp
17 ubuntu/transfers/system/process.cpp
18 ubuntu/transfers/system/process_factory.cpp
19 ubuntu/transfers/system/request_factory.cpp
20 ubuntu/transfers/system/system_network_info.cpp
21 ubuntu/transfers/system/timer.cpp
22 ubuntu/transfers/system/uuid_factory.cpp
23 ubuntu/transfers/system/uuid_utils.cpp
24)
25
26set(HEADERS
27 ubuntu/transfers/adaptor_factory.h
28 ubuntu/transfers/base_daemon.h
29 ubuntu/transfers/base_manager.h
30 ubuntu/transfers/manager_factory.h
31 ubuntu/transfers/queue.h
32 ubuntu/transfers/transfer.h
33 ubuntu/transfers/system/apn_proxy.h
34 ubuntu/transfers/system/apn_request_factory.h
35 ubuntu/transfers/system/apparmor.h
36 ubuntu/transfers/system/application.h
37 ubuntu/transfers/system/cryptographic_hash.h
38 ubuntu/transfers/system/dbus_proxy.h
39 ubuntu/transfers/system/file_manager.h
40 ubuntu/transfers/system/filename_mutex.h
41 ubuntu/transfers/system/network_reply.h
42 ubuntu/transfers/system/process.h
43 ubuntu/transfers/system/process_factory.h
44 ubuntu/transfers/system/request_factory.h
45 ubuntu/transfers/system/system_network_info.h
46 ubuntu/transfers/system/timer.h
47 ubuntu/transfers/system/uuid_factory.h
48 ubuntu/transfers/system/uuid_utils.h
49)
50
51include_directories(${Qt5SystemInfo_INCLUDE_DIRS})
52include_directories(${Qt5DBus_INCLUDE_DIRS})
53include_directories(${Qt5Network_INCLUDE_DIRS})
54include_directories(${Qt5Sql_INCLUDE_DIRS})
55include_directories(${DBUS_INCLUDE_DIRS})
56include_directories(${CMAKE_CURRENT_SOURCE_DIR})
57include_directories(${CMAKE_CURRENT_BINARY_DIR})
58include_directories(${CMAKE_SOURCE_DIR}/src/common/public)
59
60add_library(${TARGET} SHARED
61 ${HEADERS}
62 ${SOURCES}
63)
64
65set_target_properties(
66 ${TARGET}
67
68 PROPERTIES
69 VERSION ${UDM_VERSION_MAJOR}.${UDM_VERSION_MINOR}.${UDM_VERSION_PATCH}
70 SOVERSION ${UDM_VERSION_MAJOR}
71)
72
73link_directories(${NIH_DBUS_LIBDIR})
74link_directories(${GLOG_DBUS_LIBDIR})
75
76target_link_libraries(${TARGET}
77 ${NIH_DBUS_LIBRARIES}
78 ${GLOG_LIBRARIES}
79 ${Qt5Network_LIBRARIES}
80 ${Qt5Sql_LIBRARIES}
81 ${Qt5SystemInfo_LIBRARIES}
82 ${Qt5Core_LIBRARIES}
83 ${Qt5DBus_LIBRARIES}
84 udm-common
85)
86
87install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_LIBDIR})
088
=== added directory 'src/common/priv/ubuntu'
=== added directory 'src/common/priv/ubuntu/transfers'
=== added file 'src/common/priv/ubuntu/transfers/adaptor_factory.h'
--- src/common/priv/ubuntu/transfers/adaptor_factory.h 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/adaptor_factory.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,41 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#ifndef UBUNTU_GENERAL_ADAPTOR_FACTORY_H
20#define UBUNTU_GENERAL_ADAPTOR_FACTORY_H
21
22#include <QObject>
23#include "base_manager.h"
24
25namespace Ubuntu {
26
27namespace Transfers {
28
29class AdaptorFactory : public QObject {
30 public:
31 explicit AdaptorFactory(QObject *parent = 0)
32 : QObject(parent) {}
33
34 virtual QObject* createAdaptor(BaseManager* man) = 0;
35};
36
37} // General
38
39} // Ubuntu
40
41#endif // UBUNTU_GENERAL_ADAPTOR_FACTORY_H
042
=== renamed file 'ubuntu-download-manager-priv/downloads/daemon.cpp' => 'src/common/priv/ubuntu/transfers/base_daemon.cpp'
--- ubuntu-download-manager-priv/downloads/daemon.cpp 2014-02-21 11:52:42 +0000
+++ src/common/priv/ubuntu/transfers/base_daemon.cpp 2014-04-11 16:06:36 +0000
@@ -16,15 +16,17 @@
16 * Boston, MA 02110-1301, USA.16 * Boston, MA 02110-1301, USA.
17 */17 */
1818
19#include <QDebug>
19#include <QtDBus/QDBusConnection>20#include <QtDBus/QDBusConnection>
20#include <QSharedPointer>21#include <QSharedPointer>
21#include <QSslCertificate>22#include <QSslCertificate>
22#include "downloads/daemon.h"23#include <glog/logging.h>
23#include "downloads/manager.h"24#include "ubuntu/transfers/system/application.h"
24#include "downloads/download_manager_adaptor.h"25#include "ubuntu/transfers/system/logger.h"
25#include "system/application.h"26#include "ubuntu/transfers/system/timer.h"
26#include "system/logger.h"27#include "adaptor_factory.h"
27#include "system/timer.h"28#include "manager_factory.h"
29#include "base_daemon.h"
2830
2931
30namespace {32namespace {
@@ -32,298 +34,203 @@
32 const QString SELFSIGNED_CERT = "-self-signed-certs";34 const QString SELFSIGNED_CERT = "-self-signed-certs";
33 const QString STOPPABLE = "-stoppable";35 const QString STOPPABLE = "-stoppable";
34 const QString LOG_DIR= "-log-dir";36 const QString LOG_DIR= "-log-dir";
37 const int DEFAULT_TIMEOUT = 30000;
35}38}
3639
37namespace Ubuntu {40namespace Ubuntu {
3841
39namespace DownloadManager {42namespace Transfers {
4043
41namespace Daemon {44using namespace System;
4245
43/**46BaseDaemon::BaseDaemon(ManagerFactory* managerFactory,
44 * PRIVATE IMPLEMENATION47 AdaptorFactory* adaptorFactory,
45 */48 QObject *parent)
46
47class DaemonPrivate {
48 Q_DECLARE_PUBLIC(Daemon)
49
50 public:
51 explicit DaemonPrivate(Daemon* parent)
52 : q_ptr(parent) {
53 _app = new Application();
54 _conn = new DBusConnection();
55 _shutDownTimer = new Timer();
56 init();
57 }
58
59 DaemonPrivate(Application* app,
60 DBusConnection* conn,
61 Timer* timer,
62 Manager* man,
63 Daemon* parent)
64 : _app(app),
65 _shutDownTimer(timer),
66 _conn(conn),
67 _downInterface(man),
68 q_ptr(parent) {
69 init();
70 }
71
72 ~DaemonPrivate() {
73 // no need to delete the adaptor because the interface is its parent
74 delete _app;
75 delete _conn;
76 delete _downInterface;
77 delete _shutDownTimer;
78 }
79
80 bool isTimeoutEnabled() {
81 return _isTimeoutEnabled;
82 }
83
84 void enableTimeout(bool enabled) {
85 _isTimeoutEnabled = enabled;
86 if (!_isTimeoutEnabled) {
87 _shutDownTimer->stop();
88 }
89 }
90
91 bool isStoppable() {
92 return _stoppable;
93 }
94
95 void setStoppable(bool stoppable) {
96 _stoppable = stoppable;
97 }
98
99 QList<QSslCertificate> selfSignedCerts() {
100 return _certs;
101 }
102
103 void setSelfSignedCerts(QList<QSslCertificate> certs) {
104 _certs = certs;
105 }
106
107 void start(QString path) {
108 TRACE;
109 _path = path;
110 _downAdaptor = new DownloadManagerAdaptor(_downInterface);
111 bool ret = _conn->registerService(_path);
112 if (ret) {
113 LOG(INFO) << "Service registered to"
114 << _path;
115 ret = _conn->registerObject("/", _downInterface);
116 if (!ret) {
117 LOG(ERROR) << "Could not register interface. DBus Error =>"
118 << _conn->connection().lastError();
119 _app->exit(-1);
120 }
121 return;
122 }
123 LOG(ERROR) << "Could not register service. DBus Error =>"
124 << _conn->connection().lastError();
125 _app->exit(-1);
126 }
127
128 void stop() {
129 // stop listening in the service
130 bool ret = _conn->unregisterService(_path);
131 if (!ret) {
132 qCritical() << "Could not unregister service at" << _path;
133 }
134 }
135
136 Manager* manager() {
137 return _downInterface;
138 }
139
140 void onTimeout() {
141 LOG(INFO) << "Timeout reached, shutdown service.";
142 _app->exit(0);
143 }
144
145 void onDownloadManagerSizeChanged(int size) {
146 TRACE << size;
147 bool isActive = _shutDownTimer->isActive();
148
149 if (isActive && size > 0) {
150 LOG(INFO) << "Timer must be stopped because we have " << size
151 << "downloads.";
152 _shutDownTimer->stop();
153 }
154 if (!isActive && size == 0) {
155 LOG(INFO) << "Timer must be started because we have 0 downloads.";
156 _shutDownTimer->start(timeout);
157 }
158 }
159
160 static const int timeout = 30000;
161
162 private:
163 void parseCommandLine() {
164 QStringList args = _app->arguments();
165 int index;
166
167 // set logging
168 if (args.contains(LOG_DIR)) {
169 index = args.indexOf(LOG_DIR);
170 if (args.count() > index + 1) {
171 auto logPath = args[index + 1];
172 Logger::setupLogging(logPath);
173 LOG(INFO) << "Log path is" << logPath;
174 } else {
175 Logger::setupLogging();
176 LOG(ERROR) << "Missing log dir path.";
177 }
178 } else {
179 Logger::setupLogging();
180 LOG(INFO) << "Using default log path.";
181 }
182
183 if (args.contains(SELFSIGNED_CERT)) {
184 index = args.indexOf(SELFSIGNED_CERT);
185 if (args.count() > index + 1) {
186 QString certsRegex = args[index + 1];
187 _certs = QSslCertificate::fromPath(certsRegex);
188 LOG(INFO) << "Accepting self signed certs at path"
189 << certsRegex;
190 } else {
191 LOG(ERROR) << "Missing certs path.";
192 }
193 } // certs
194 _isTimeoutEnabled = !args.contains(DISABLE_TIMEOUT);
195 LOG(INFO) << "Timeout is enabled: " << _isTimeoutEnabled;
196 _stoppable = args.contains(STOPPABLE);
197 LOG(INFO) << "Daemon is stoppable: " << _stoppable;
198 }
199
200 void init() {
201 Q_Q(Daemon);
202
203 // parse command line to decide if the timer is enabled and if
204 // we accept self signed certs
205 parseCommandLine();
206 if (_isTimeoutEnabled) {
207 q->connect(_shutDownTimer, SIGNAL(timeout()),
208 q, SLOT(onTimeout()));
209 _shutDownTimer->start(timeout);
210 }
211
212 if (_downInterface == nullptr) {
213 _downInterface = new Manager(_app, _conn, _stoppable,
214 q_ptr);
215 }
216
217 _downInterface->setAcceptedCertificates(_certs);
218 // connect to the download manager changes
219 q->connect(_downInterface,
220 SIGNAL(sizeChanged(int)), // NOLINT (readability/function)
221 q, SLOT(onDownloadManagerSizeChanged(int))); // NOLINT (readability/function)
222 }
223
224 private:
225 QString _path = "";
226 bool _isTimeoutEnabled = true;
227 bool _stoppable = false;
228 QList<QSslCertificate> _certs;
229 Application* _app = nullptr;
230 Timer* _shutDownTimer = nullptr;
231 DBusConnection* _conn = nullptr;
232 Manager* _downInterface = nullptr;
233 DownloadManagerAdaptor* _downAdaptor = nullptr;
234 Daemon* q_ptr;
235};
236
237/**
238 * PUBLIC IMPLEMENTATION
239 */
240
241Daemon::Daemon(QObject *parent)
242 : QObject(parent),49 : QObject(parent),
243 d_ptr(new DaemonPrivate(this)) {50 _managerFactory(managerFactory),
51 _adaptorFactory(adaptorFactory) {
52
53 _app = new Application();
54 _conn = new DBusConnection();
55 _shutDownTimer = new Timer();
56 init();
244}57}
24558
246Daemon::Daemon(Application* app,59BaseDaemon::BaseDaemon(ManagerFactory* managerFactory,
60 AdaptorFactory* adaptorFactory,
61 Application* app,
247 DBusConnection* conn,62 DBusConnection* conn,
248 Timer* timer,63 Timer* timer,
249 Manager* man,64 QObject* parent)
250 QObject *parent)
251 : QObject(parent),65 : QObject(parent),
252 d_ptr(new DaemonPrivate(app, conn, timer, man, this)) {66 _app(app),
253}67 _shutDownTimer(timer),
25468 _conn(conn),
255Daemon::Daemon(ManagerConstructor manConstructor, QObject *parent)69 _managerFactory(managerFactory),
256 : QObject(parent) {70 _adaptorFactory(adaptorFactory) {
257 auto app = new Application();71 init();
258 auto conn = new DBusConnection();72}
259 auto timer = new Timer();73
260 auto man = manConstructor(app, conn);74BaseDaemon::~BaseDaemon() {
261 qDebug() << man;75 // no need to delete the adaptor because the interface is its parent
262 d_ptr = new DaemonPrivate(app, conn, timer, man, this);76 delete _app;
263}77 delete _conn;
26478 delete _manager;
265Daemon::~Daemon() {79 delete _shutDownTimer;
266 delete d_ptr;80 delete _managerFactory;
267}81 delete _adaptorFactory;
26882}
269bool83
270Daemon::isTimeoutEnabled() {84bool
271 Q_D(Daemon);85BaseDaemon::isTimeoutEnabled() {
272 return d->isTimeoutEnabled();86 return _isTimeoutEnabled;
273}87}
27488
275void89void
276Daemon::enableTimeout(bool enabled) {90BaseDaemon::enableTimeout(bool enabled) {
277 Q_D(Daemon);91 _isTimeoutEnabled = enabled;
278 d->enableTimeout(enabled);92 if (!_isTimeoutEnabled) {
279}93 _shutDownTimer->stop();
28094 }
281bool95}
282Daemon::isStoppable() {96
283 Q_D(Daemon);97bool
284 return d->isStoppable();98BaseDaemon::isStoppable() {
285}99 return _stoppable;
286100}
287void101
288Daemon::setStoppable(bool stoppable) {102void
289 Q_D(Daemon);103BaseDaemon::setStoppable(bool stoppable) {
290 d->setStoppable(stoppable);104 _stoppable = stoppable;
291}105}
292106
293QList<QSslCertificate>107QList<QSslCertificate>
294Daemon::selfSignedCerts() {108BaseDaemon::selfSignedCerts() {
295 Q_D(Daemon);109 return _certs;
296 return d->selfSignedCerts();110}
297}111
298112void
299void113BaseDaemon::setSelfSignedCerts(QList<QSslCertificate> certs) {
300Daemon::setSelfSignedCerts(QList<QSslCertificate> certs) {114 _certs = certs;
301 Q_D(Daemon);115}
302 d->setSelfSignedCerts(certs);116
303}117void
304118BaseDaemon::start(const QString& path) {
305void119 TRACE;
306Daemon::start(QString path) {120 _path = path;
307 Q_D(Daemon);121 _managerAdaptor = _adaptorFactory->createAdaptor(_manager);
308 d->start(path);122 bool ret = _conn->registerService(_path);
309}123 if (ret) {
310124 LOG(INFO) << "Service registered to" << _path;
311void125 ret = _conn->registerObject("/", _manager);
312Daemon::stop() {126 if (!ret) {
313 Q_D(Daemon);127 LOG(ERROR) << "Could not register interface. DBus Error =>"
314 d->stop();128 << _conn->connection().lastError();
315}129 _app->exit(-1);
316130 }
317Manager*131 return;
318Daemon::manager() {132 }
319 Q_D(Daemon);133 LOG(ERROR) << "Could not register service. DBus Error =>"
320 return d->manager();134 << _conn->connection().lastError();
321}135 _app->exit(-1);
322136}
323} // Daemon137
324138void
325} // DownloadManager139BaseDaemon::stop() {
140 // stop listening in the service
141 bool ret = _conn->unregisterService(_path);
142 if (!ret) {
143 qCritical() << "Could not unregister service at" << _path;
144 }
145}
146
147BaseManager*
148BaseDaemon::manager() {
149 return _manager;
150}
151
152void
153BaseDaemon::onTimeout() {
154 LOG(INFO) << "Timeout reached, shutdown service.";
155 _app->exit(0);
156}
157
158void
159BaseDaemon::onDownloadManagerSizeChanged(int size) {
160 TRACE << size;
161 bool isActive = _shutDownTimer->isActive();
162
163 if (isActive && size > 0) {
164 LOG(INFO) << "Timer must be stopped because we have " << size
165 << "downloads.";
166 _shutDownTimer->stop();
167 }
168 if (!isActive && size == 0) {
169 LOG(INFO) << "Timer must be started because we have 0 downloads.";
170 _shutDownTimer->start(DEFAULT_TIMEOUT);
171 }
172}
173
174void
175BaseDaemon::parseCommandLine() {
176 QStringList args = _app->arguments();
177 int index;
178
179 // set logging
180 if (args.contains(LOG_DIR)) {
181 index = args.indexOf(LOG_DIR);
182 if (args.count() > index + 1) {
183 auto logPath = args[index + 1];
184 Logger::setupLogging(logPath);
185 LOG(INFO) << "Log path is" << logPath;
186 } else {
187 LOG(ERROR) << "Missing log dir path.";
188 Logger::setupLogging();
189 }
190 } else {
191 Logger::setupLogging();
192 }
193
194 if (args.contains(SELFSIGNED_CERT)) {
195 index = args.indexOf(SELFSIGNED_CERT);
196 if (args.count() > index + 1) {
197 QString certsRegex = args[index + 1];
198 _certs = QSslCertificate::fromPath(certsRegex);
199 LOG(INFO) << "Accepting self signed certs at path"
200 << certsRegex;
201 } else {
202 LOG(ERROR) << "Missing certs path.";
203 }
204 } // certs
205 _isTimeoutEnabled = !args.contains(DISABLE_TIMEOUT);
206 LOG(INFO) << "Timeout is enabled: " << _isTimeoutEnabled;
207 _stoppable = args.contains(STOPPABLE);
208 LOG(INFO) << "Daemon is stoppable: " << _stoppable;
209}
210
211void
212BaseDaemon::init() {
213 // parse command line to decide if the timer is enabled and if
214 // we accept self signed certs
215 parseCommandLine();
216 if (_isTimeoutEnabled) {
217 CHECK(connect(_shutDownTimer, &Timer::timeout,
218 this, &BaseDaemon::onTimeout))
219 << "Could not connect to signal";
220 _shutDownTimer->start(DEFAULT_TIMEOUT);
221 }
222
223 _manager = _managerFactory->createManager(
224 _app, _conn, _stoppable, this);
225
226 _manager->setAcceptedCertificates(_certs);
227 // connect to the download manager changes
228 CHECK(connect(_manager,
229 &BaseManager::sizeChanged,
230 this, &BaseDaemon::onDownloadManagerSizeChanged))
231 << "Could not connect to signal";
232}
233
234} // General
326235
327} // Ubuntu236} // Ubuntu
328
329#include "moc_daemon.cpp"
330237
=== renamed file 'ubuntu-download-manager-priv/downloads/daemon.h' => 'src/common/priv/ubuntu/transfers/base_daemon.h'
--- ubuntu-download-manager-priv/downloads/daemon.h 2014-02-07 10:06:24 +0000
+++ src/common/priv/ubuntu/transfers/base_daemon.h 2014-04-11 16:06:36 +0000
@@ -16,19 +16,19 @@
16 * Boston, MA 02110-1301, USA.16 * Boston, MA 02110-1301, USA.
17 */17 */
1818
19#ifndef DOWNLOADER_LIB_DOWNLOAD_DAEMON_H19#ifndef UBUNTU_GENERAL_LIB_DAEMON_H
20#define DOWNLOADER_LIB_DOWNLOAD_DAEMON_H20#define UBUNTU_GENERAL_LIB_DAEMON_H
2121
22#include <functional>22#include <functional>
23#include <QObject>23#include <QObject>
24#include <QSslCertificate>
25#include <QSharedPointer>24#include <QSharedPointer>
26#include <ubuntu/download_manager/common.h>25#include <ubuntu/transfers/system/dbus_connection.h>
27#include <ubuntu/download_manager/system/dbus_connection.h>26
27class QSslCertificate;
2828
29namespace Ubuntu {29namespace Ubuntu {
3030
31namespace DownloadManager {31namespace Transfers {
3232
33namespace System {33namespace System {
3434
@@ -38,26 +38,27 @@
3838
39}39}
4040
41namespace Daemon {41class BaseManager;
4242class ManagerFactory;
43class Manager;43class AdaptorFactory;
44class DaemonPrivate;44
4545typedef std::function<BaseManager*(System::Application*, System::DBusConnection*)>
46typedef std::function<Manager*(System::Application*, System::DBusConnection*)>
47 ManagerConstructor;46 ManagerConstructor;
4847
49class DOWNLOAD_MANAGER_EXPORT Daemon : public QObject {48class BaseDaemon : public QObject {
50 Q_DECLARE_PRIVATE(Daemon)
51 Q_OBJECT49 Q_OBJECT
5250
53 public:51 public:
54 explicit Daemon(QObject *parent = 0);52 BaseDaemon(ManagerFactory* managerFactory,
55 Daemon(System::Application* app,53 AdaptorFactory* adaptorFactory,
54 QObject *parent = 0);
55 BaseDaemon(ManagerFactory* managerFactory,
56 AdaptorFactory* adaptorFactory,
57 System::Application* app,
56 System::DBusConnection* conn,58 System::DBusConnection* conn,
57 System::Timer* timer,59 System::Timer* timer,
58 Manager* man,
59 QObject *parent = 0);60 QObject *parent = 0);
60 virtual ~Daemon();61 virtual ~BaseDaemon();
6162
62 bool isTimeoutEnabled();63 bool isTimeoutEnabled();
63 void enableTimeout(bool enabled);64 void enableTimeout(bool enabled);
@@ -69,28 +70,34 @@
69 void setSelfSignedCerts(QList<QSslCertificate> cert);70 void setSelfSignedCerts(QList<QSslCertificate> cert);
7071
71 public slots: // NOLINT (whitespace/indent)72 public slots: // NOLINT (whitespace/indent)
72 virtual void start(QString path="com.canonical.applications.Downloader");73 virtual void start(const QString& path);
73 void stop();74 void stop();
7475
75 protected:76 protected:
76 // constructor that can be used to pass a special case of manager77 BaseManager* manager();
77 // this is useful when a subclass was to speciallize the manager78
78 Daemon(ManagerConstructor manConstructor, QObject* parent = 0);79 private:
7980 void init();
80 Manager* manager();81 void parseCommandLine();
8182 void onTimeout();
82 private:83 void onDownloadManagerSizeChanged(int);
83 Q_PRIVATE_SLOT(d_func(), void onTimeout())84
84 Q_PRIVATE_SLOT(d_func(), void onDownloadManagerSizeChanged(int)) // NOLINT (readability/function)85 private:
8586 QString _path = "";
86 private:87 bool _isTimeoutEnabled = true;
87 // use pimpl so that we can mantains ABI compatibility88 bool _stoppable = false;
88 DaemonPrivate* d_ptr;89 QList<QSslCertificate> _certs;
90 System::Application* _app = nullptr;
91 System::Timer* _shutDownTimer = nullptr;
92 System::DBusConnection* _conn = nullptr;
93 ManagerFactory* _managerFactory = nullptr;
94 AdaptorFactory* _adaptorFactory = nullptr;
95 BaseManager* _manager = nullptr;
96 QObject* _managerAdaptor = nullptr;
89};97};
9098
91} // Daemon99} // General
92
93} // DownloadManager
94100
95} // Ubuntu101} // Ubuntu
102
96#endif // DOWNLOADER_LIB_DOWNLOAD_DAEMON_H103#endif // DOWNLOADER_LIB_DOWNLOAD_DAEMON_H
97104
=== added file 'src/common/priv/ubuntu/transfers/base_manager.cpp'
--- src/common/priv/ubuntu/transfers/base_manager.cpp 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/base_manager.cpp 2014-04-11 16:06:36 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#include "base_manager.h"
20
21namespace Ubuntu {
22
23namespace Transfers {
24
25BaseManager::BaseManager(System::Application* app,
26 bool stoppable,
27 QObject *parent)
28 : QObject(parent),
29 QDBusContext(),
30 _app(app),
31 _stoppable(stoppable) {
32}
33
34void
35BaseManager::exit() {
36 if (_stoppable) {
37 _app->exit(0);
38 } else {
39 if (calledFromDBus()) {
40 sendErrorReply(QDBusError::NotSupported,
41 "Daemon should have been started with -stoppable");
42 } // dbus call
43 }
44}
45
46} // General
47
48} // Ubuntu
049
=== added file 'src/common/priv/ubuntu/transfers/base_manager.h'
--- src/common/priv/ubuntu/transfers/base_manager.h 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/base_manager.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,60 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#ifndef UBUNTU_GENERAL_MANAGER_H
20#define UBUNTU_GENERAL_MANAGER_H
21
22#include <QDBusContext>
23#include <QList>
24#include <QObject>
25#include <QSslCertificate>
26#include "ubuntu/transfers/system/application.h"
27
28namespace Ubuntu {
29
30namespace Transfers {
31
32using namespace System;
33
34class BaseManager : public QObject, public QDBusContext {
35 Q_OBJECT
36
37 public:
38 BaseManager(Application* app,
39 bool stopabble=false,
40 QObject *parent = 0);
41
42 virtual QList<QSslCertificate> acceptedCertificates() = 0;
43 virtual void setAcceptedCertificates(
44 const QList<QSslCertificate>& certs) = 0;
45
46 virtual void exit();
47
48 signals:
49 void sizeChanged(int count);
50
51 protected:
52 Application* _app = nullptr;
53 bool _stoppable = false;
54};
55
56} // General
57
58} // Ubuntu
59
60#endif // UBUNTU_GENERAL_MANAGER_H
061
=== added file 'src/common/priv/ubuntu/transfers/manager_factory.h'
--- src/common/priv/ubuntu/transfers/manager_factory.h 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/manager_factory.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,46 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#ifndef UBUNTU_GENERAL_MANAGER_FACTORY_H
20#define UBUNTU_GENERAL_MANAGER_FACTORY_H
21
22#include <ubuntu/transfers/system/dbus_connection.h>
23#include "ubuntu/transfers/system/application.h"
24#include "base_manager.h"
25
26namespace Ubuntu {
27
28namespace Transfers {
29
30class ManagerFactory : public QObject {
31 public:
32 explicit ManagerFactory(QObject *parent = 0)
33 : QObject(parent) {}
34
35 virtual BaseManager* createManager(Application* app,
36 DBusConnection* connection,
37 bool stoppable = false,
38 QObject *parent = 0) = 0;
39};
40
41} // General
42
43} // Ubuntu
44
45#endif // UBUNTU_GENERAL_MANAGER_FACTORY_H
46
047
=== renamed file 'ubuntu-download-manager-priv/downloads/queue.cpp' => 'src/common/priv/ubuntu/transfers/queue.cpp'
--- ubuntu-download-manager-priv/downloads/queue.cpp 2014-02-03 17:52:16 +0000
+++ src/common/priv/ubuntu/transfers/queue.cpp 2014-04-11 16:06:36 +0000
@@ -17,58 +17,60 @@
17 */17 */
1818
19#include <QSignalMapper>19#include <QSignalMapper>
20#include "downloads/queue.h"20#include <glog/logging.h>
21#include "system/logger.h"21#include "ubuntu/transfers/system/logger.h"
22#include "system/system_network_info.h"22#include "ubuntu/transfers/system/system_network_info.h"
23#include "queue.h"
2324
24namespace Ubuntu {25namespace Ubuntu {
2526
26namespace DownloadManager {27namespace Transfers {
27
28namespace Daemon {
2928
30Queue::Queue(QObject* parent)29Queue::Queue(QObject* parent)
31 : QObject(parent),30 : QObject(parent),
32 _current("") {31 _current("") {
33 connect(SystemNetworkInfo::instance(),32 CHECK(connect(SystemNetworkInfo::instance(),
34 &SystemNetworkInfo::currentNetworkModeChanged,33 &SystemNetworkInfo::currentNetworkModeChanged,
35 this, &Queue::onCurrentNetworkModeChanged);34 this, &Queue::onCurrentNetworkModeChanged))
35 << "Could not connect to signal";
36}36}
3737
38void38void
39Queue::add(Download* download) {39Queue::add(Transfer* transfer) {
40 // connect to the signals and append to the list40 // connect to the signals and append to the list
41 QString path = download->path();41 auto path = transfer->path();
42 TRACE << path;42 TRACE << path;
4343
44 _sortedPaths.append(path);44 _sortedPaths.append(path);
45 _downloads[path] = download;45 _transfers[path] = transfer;
4646
47 if (download->addToQueue()) {47 if (transfer->addToQueue()) {
48 connect(download, &Download::stateChanged,48 CHECK(connect(transfer, &Transfer::stateChanged,
49 this, &Queue::onManagedDownloadStateChanged);49 this, &Queue::onManagedTransferStateChanged))
50 << "Could not connect to signal";
50 } else {51 } else {
51 connect(download, &Download::stateChanged,52 CHECK(connect(transfer, &Transfer::stateChanged,
52 this, &Queue::onUnmanagedDownloadStateChanged);53 this, &Queue::onUnmanagedTransferStateChanged))
54 << "Could not connect to signal";
53 }55 }
5456
55 emit downloadAdded(path);57 emit transferAdded(path);
56}58}
5759
58void60void
59Queue::remove(const QString& path) {61Queue::remove(const QString& path) {
60 TRACE << path;62 TRACE << path;
6163
62 Download* down = _downloads[path];64 auto transfer = _transfers[path];
63 _sortedPaths.removeOne(path);65 _sortedPaths.removeOne(path);
64 _downloads.remove(path);66 _transfers.remove(path);
6567
66 down->deleteLater();68 transfer->deleteLater();
67 emit downloadRemoved(path);69 emit transferRemoved(path);
68}70}
6971
70QString72QString
71Queue::currentDownload() {73Queue::currentTransfer() {
72 return _current;74 return _current;
73}75}
7476
@@ -77,56 +79,60 @@
77 return _sortedPaths;79 return _sortedPaths;
78}80}
7981
80QHash<QString, Download*>82QHash<QString, Transfer*>
81Queue::downloads() {83Queue::transfers() {
82 QHash<QString, Download*> downloads;84 QHash<QString, Transfer*> transfers;
83 foreach(const QString& path, _sortedPaths) {85 foreach(const QString& path, _sortedPaths) {
84 downloads[path] = _downloads[path];86 transfers[path] = _transfers[path];
85 }87 }
86 return downloads;88 return transfers;
87}89}
8890
89int91int
90Queue::size() {92Queue::size() {
91 return _downloads.size();93 return _transfers.size();
92}94}
9395
94void96void
95Queue::onManagedDownloadStateChanged() {97Queue::onManagedTransferStateChanged() {
96 TRACE;98 TRACE;
97 // get the appdownload that emited the signal and99 // get the appdownload that emited the signal and
98 // decide what to do with it100 // decide what to do with it
99 Download* down = qobject_cast<Download*>(sender());101 auto transfer = qobject_cast<Transfer*>(sender());
100 switch (down->state()) {102 qDebug() << "State changed" << transfer;
101 case Download::START:103 switch (transfer->state()) {
102 // only start the download in the update method104 case Transfer::START:
103 if (_current.isEmpty())105 // only start the transfer in the update method
104 updateCurrentDownload();106 if (_current.isEmpty())
105 break;107 updateCurrentTransfer();
106 case Download::PAUSE:108 break;
107 down->pauseDownload();109 case Transfer::PAUSE:
108 if (!_current.isEmpty() && _current == down->path())110 transfer->pauseTransfer();
109 updateCurrentDownload();111 if (!_current.isEmpty() && _current == transfer->path())
110 break;112 updateCurrentTransfer();
111 case Download::RESUME:113 break;
112 // only resume the download in the update method114 case Transfer::RESUME:
113 if (_current.isEmpty())115 // only resume the transfer in the update method
114 updateCurrentDownload();116 qDebug() << "State changed to resume.";
115 break;117 if (_current.isEmpty()) {
116 case Download::CANCEL:118 qDebug() << "There is no current download present.";
117 // cancel and remove the download119 updateCurrentTransfer();
118 down->cancelDownload();120 }
119 if (!_current.isEmpty() && _current == down->path())121 break;
120 updateCurrentDownload();122 case Transfer::CANCEL:
123 // cancel and remove the transfer
124 transfer->cancelTransfer();
125 if (!_current.isEmpty() && _current == transfer->path())
126 updateCurrentTransfer();
121 else127 else
122 remove(down->path());128 remove(transfer->path());
123 break;129 break;
124 case Download::ERROR:130 case Transfer::ERROR:
125 case Download::FINISH:131 case Transfer::FINISH:
126 // remove the registered object in dbus, remove the download132 // remove the registered object in dbus, remove the transfer
127 // and the adapter from the list133 // and the adapter from the list
128 if (!_current.isEmpty() && _current == down->path())134 if (!_current.isEmpty() && _current == transfer->path())
129 updateCurrentDownload();135 updateCurrentTransfer();
130 break;136 break;
131 default:137 default:
132 // do nothing138 // do nothing
@@ -135,17 +141,17 @@
135}141}
136142
137void143void
138Queue::onUnmanagedDownloadStateChanged() {144Queue::onUnmanagedTransferStateChanged() {
139 TRACE;145 TRACE;
140 // grab the download and clean it when needed146 // grab the transfer and clean it when needed
141 Download* down = qobject_cast<Download*>(sender());147 auto transfer = qobject_cast<Transfer*>(sender());
142 switch (down->state()) {148 switch (transfer->state()) {
143 case Download::CANCEL:149 case Transfer::CANCEL:
144 case Download::ERROR:150 case Transfer::ERROR:
145 case Download::FINISH:151 case Transfer::FINISH:
146 // remove the registered object in dbus, remove the download152 // remove the registered object in dbus, remove the transfer
147 // and the adapter from the list153 // and the adapter from the list
148 remove(down->path());154 remove(transfer->path());
149 break;155 break;
150 default:156 default:
151 // do nothing157 // do nothing
@@ -157,44 +163,45 @@
157Queue::onCurrentNetworkModeChanged(QNetworkInfo::NetworkMode mode) {163Queue::onCurrentNetworkModeChanged(QNetworkInfo::NetworkMode mode) {
158 TRACE << mode;164 TRACE << mode;
159 if (mode != QNetworkInfo::UnknownMode) {165 if (mode != QNetworkInfo::UnknownMode) {
160 updateCurrentDownload();166 updateCurrentTransfer();
161 }167 }
162}168}
163169
164void170void
165Queue::updateCurrentDownload() {171Queue::updateCurrentTransfer() {
166 TRACE;172 TRACE;
167 if (!_current.isEmpty()) {173 if (!_current.isEmpty()) {
168 // check if it was canceled/finished174 // check if it was canceled/finished
169 Download* currentDownload = _downloads[_current];175 auto currentTransfer = _transfers[_current];
170 Download::State state = currentDownload->state();176 auto state = currentTransfer->state();
171 if (state == Download::CANCEL || state == Download::FINISH177 if (state == Transfer::CANCEL || state == Transfer::FINISH
172 || state == Download::ERROR) {178 || state == Transfer::ERROR) {
173 LOG(INFO) << "State is CANCEL || FINISH || ERROR";179 LOG(INFO) << "State is CANCEL || FINISH || ERROR";
174 remove(_current);180 remove(_current);
175 _current = "";181 _current = "";
176 } else if (!currentDownload->canDownload()182 } else if (!currentTransfer->canTransfer()
177 || state == Download::PAUSE) {183 || state == Transfer::PAUSE) {
178 LOG(INFO) << "States is Cannot Download || PAUSE";184 LOG(INFO) << "States is Cannot Transfer || PAUSE";
179 _current = "";185 _current = "";
180 } else {186 } else {
181 return;187 return;
182 }188 }
183 }189 }
184190
185 // loop via the downloads and choose the first that is191 // loop via the transfers and choose the first that is
186 // started or resumed192 // started or resumed
187 foreach(const QString& path, _sortedPaths) {193 foreach(const QString& path, _sortedPaths) {
188 Download* down = _downloads[path];194 auto transfer = _transfers[path];
189 Download::State state = down->state();195 auto state = transfer->state();
190 if (down->canDownload()196 if (transfer->canTransfer()
191 && (state == Download::START197 && (state == Transfer::START
192 || state == Download::RESUME)) {198 || state == Transfer::RESUME)) {
193 _current = path;199 _current = path;
194 if (state == Download::START)200 qDebug() << _current;
195 down->startDownload();201 if (state == Transfer::START)
202 transfer->startTransfer();
196 else203 else
197 down->resumeDownload();204 transfer->resumeTransfer();
198 break;205 break;
199 }206 }
200 }207 }
@@ -202,8 +209,6 @@
202 emit currentChanged(_current);209 emit currentChanged(_current);
203}210}
204211
205} // Daemon212} // Transfers
206
207} // DownloadManager
208213
209} // Ubuntu214} // Ubuntu
210215
=== renamed file 'ubuntu-download-manager-priv/downloads/queue.h' => 'src/common/priv/ubuntu/transfers/queue.h'
--- ubuntu-download-manager-priv/downloads/queue.h 2014-01-29 10:47:13 +0000
+++ src/common/priv/ubuntu/transfers/queue.h 2014-04-11 16:06:36 +0000
@@ -19,56 +19,53 @@
19#ifndef DOWNLOADER_LIB_DOWNLOAD_QUEUE_H19#ifndef DOWNLOADER_LIB_DOWNLOAD_QUEUE_H
20#define DOWNLOADER_LIB_DOWNLOAD_QUEUE_H20#define DOWNLOADER_LIB_DOWNLOAD_QUEUE_H
2121
22#include <QString>
23#include <QStringList>
22#include <QList>24#include <QList>
23#include <QPair>25#include <QPair>
24#include <QSharedPointer>26#include <QSharedPointer>
25#include "downloads/download.h"27#include "transfer.h"
26#include "downloads/download_adaptor.h"
2728
28namespace Ubuntu {29namespace Ubuntu {
2930
30namespace DownloadManager {31namespace Transfers {
3132
32using namespace System;33using namespace System;
3334
34namespace Daemon {
35
36class Queue : public QObject {35class Queue : public QObject {
37 Q_OBJECT36 Q_OBJECT
3837
39 public:38 public:
40 explicit Queue(QObject* parent = 0);39 explicit Queue(QObject* parent = 0);
4140
42 virtual void add(Download* download);41 virtual void add(Transfer* transfer);
4342
44 // accessors for useful info43 // accessors for useful info
45 QString currentDownload();44 virtual QString currentTransfer();
46 QStringList paths();45 virtual QStringList paths();
47 QHash<QString, Download*> downloads();46 virtual QHash<QString, Transfer*> transfers();
48 virtual int size();47 virtual int size();
4948
50 signals:49 signals:
51 // signals raised when things happens within the q50 // signals raised when things happens within the q
52 void currentChanged(QString path);51 void currentChanged(QString path);
53 void downloadAdded(QString path);52 void transferAdded(QString path);
54 void downloadRemoved(QString path);53 void transferRemoved(QString path);
5554
56 private:55 private:
57 void onManagedDownloadStateChanged();56 void onManagedTransferStateChanged();
58 void onUnmanagedDownloadStateChanged();57 void onUnmanagedTransferStateChanged();
59 void onCurrentNetworkModeChanged(QNetworkInfo::NetworkMode mode);58 void onCurrentNetworkModeChanged(QNetworkInfo::NetworkMode mode);
60 void remove(const QString& path);59 void remove(const QString& path);
61 void updateCurrentDownload();60 void updateCurrentTransfer();
6261
63 private:62 private:
64 QString _current;63 QString _current;
65 QHash<QString, Download*> _downloads; // quick for access64 QHash<QString, Transfer*> _transfers; // quick for access
66 QStringList _sortedPaths; // keep the order65 QStringList _sortedPaths; // keep the order
67};66};
6867
69} // Daemon68} // Transfers
70
71} // DownloadManager
7269
73} // Ubuntu70} // Ubuntu
7471
7572
=== renamed directory 'ubuntu-download-manager-priv/system' => 'src/common/priv/ubuntu/transfers/system'
=== modified file 'src/common/priv/ubuntu/transfers/system/apn_proxy.cpp'
--- ubuntu-download-manager-priv/system/apn_proxy.cpp 2014-01-28 18:51:12 +0000
+++ src/common/priv/ubuntu/transfers/system/apn_proxy.cpp 2014-04-11 16:06:36 +0000
@@ -20,7 +20,7 @@
2020
21namespace Ubuntu {21namespace Ubuntu {
2222
23namespace DownloadManager {23namespace Transfers {
2424
25namespace System {25namespace System {
2626
@@ -34,8 +34,8 @@
34 return proxy;34 return proxy;
35}35}
3636
37}37} // System
3838
39}39} // Transfers
4040
41}41} // Ubuntu
4242
=== modified file 'src/common/priv/ubuntu/transfers/system/apn_proxy.h'
--- ubuntu-download-manager-priv/system/apn_proxy.h 2014-01-28 18:51:12 +0000
+++ src/common/priv/ubuntu/transfers/system/apn_proxy.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -38,9 +38,9 @@
3838
39};39};
4040
41} // System41} // System
4242
43} // DownloadManager43} // Transfers
4444
45} // Ubuntu45} // Ubuntu
46#endif // APN_PROXY_H46#endif // APN_PROXY_H
4747
=== modified file 'src/common/priv/ubuntu/transfers/system/apn_request_factory.cpp'
--- ubuntu-download-manager-priv/system/apn_request_factory.cpp 2014-01-29 12:11:35 +0000
+++ src/common/priv/ubuntu/transfers/system/apn_request_factory.cpp 2014-04-11 16:06:36 +0000
@@ -21,7 +21,7 @@
2121
22namespace Ubuntu {22namespace Ubuntu {
2323
24namespace DownloadManager {24namespace Transfers {
2525
26namespace System {26namespace System {
2727
@@ -34,6 +34,6 @@
3434
35} // System35} // System
3636
37} // DownloadManager37} // Transfers
3838
39} // Ubuntu39} // Ubuntu
4040
=== modified file 'src/common/priv/ubuntu/transfers/system/apn_request_factory.h'
--- ubuntu-download-manager-priv/system/apn_request_factory.h 2014-01-29 12:11:35 +0000
+++ src/common/priv/ubuntu/transfers/system/apn_request_factory.h 2014-04-11 16:06:36 +0000
@@ -25,7 +25,7 @@
2525
26namespace Ubuntu {26namespace Ubuntu {
2727
28namespace DownloadManager {28namespace Transfers {
2929
30namespace System {30namespace System {
3131
@@ -40,7 +40,7 @@
4040
41} // System41} // System
4242
43} // DownloadManager43} // Transfers
4444
45} // Ubuntu45} // Ubuntu
4646
4747
=== modified file 'src/common/priv/ubuntu/transfers/system/apparmor.cpp'
--- ubuntu-download-manager-priv/system/apparmor.cpp 2014-02-01 09:01:47 +0000
+++ src/common/priv/ubuntu/transfers/system/apparmor.cpp 2014-04-11 16:06:36 +0000
@@ -25,13 +25,13 @@
25#include <QDir>25#include <QDir>
26#include <QRegExp>26#include <QRegExp>
27#include <QStandardPaths>27#include <QStandardPaths>
28#include <ubuntu/transfers/system/logger.h>
28#include "uuid_utils.h"29#include "uuid_utils.h"
29#include "logger.h"
30#include "apparmor.h"30#include "apparmor.h"
3131
32namespace Ubuntu {32namespace Ubuntu {
3333
34namespace DownloadManager {34namespace Transfers {
3535
36namespace System {36namespace System {
3737
@@ -57,67 +57,30 @@
57 delete _uuidFactory;57 delete _uuidFactory;
58}58}
5959
60void60SecurityDetails*
61AppArmor::getDBusPath(QString& id, QString& dbusPath) {61AppArmor::getSecurityDetails(const QString& connName) {
62 QUuid uuid = _uuidFactory->createUuid();62 auto id = UuidUtils::getDBusString(_uuidFactory->createUuid());
63 id = UuidUtils::getDBusString(uuid);63 auto details = new SecurityDetails(id);
64 dbusPath = UuidUtils::getDBusString(uuid);64 getSecurityDetails(connName, details);
65}65 return details;
6666}
67QString67
68AppArmor::getSecurePath(const QString& connName,68SecurityDetails*
69 QString& dbusPath,69AppArmor::getSecurityDetails(const QString& connName,
70 QString& localPath,70 const QString& id) {
71 bool& isConfined) {71
72 QString id = UuidUtils::getDBusString(_uuidFactory->createUuid());72 auto details = new SecurityDetails(id);
73 getSecurePath(connName, id, dbusPath, localPath, isConfined);73 getSecurityDetails(connName, details);
74 return id;74 return details;
75}75}
7676
77QString77void
78AppArmor::getLocalPath(const QString& appId) {78AppArmor::getSecurityDetails(const QString& connName,
79 // if the service is running as root we will always return /tmp79 SecurityDetails* details) {
80 // as the local path root
81 if (getuid() == 0){
82 LOG(INFO) << "Running as system bus using /tmp for downloads";
83 return QStandardPaths::writableLocation(
84 QStandardPaths::TempLocation);
85 } else {
86 QString dataPath = QStandardPaths::writableLocation(
87 QStandardPaths::DataLocation);
88 QStringList pathComponents;
89 pathComponents << dataPath;
90
91 if (!appId.isEmpty()) {
92 QStringList appIdInfo = appId.split("_");
93 if (appIdInfo.count() > 0)
94 pathComponents << appIdInfo[0];
95 }
96
97 pathComponents << "Downloads";
98
99 QString path = pathComponents.join(QDir::separator());
100
101 bool wasCreated = QDir().mkpath(path);
102 if (!wasCreated) {
103 LOG(ERROR) << "Could not create the data path"
104 << path;
105 }
106 LOG(INFO) << "Local path is" << path;
107 return path;
108 } // not root
109}
110
111void
112AppArmor::getSecurePath(const QString& connName,
113 const QString& id,
114 QString& dbusPath,
115 QString& localPath,
116 bool& isConfined) {
117 if (connName.isEmpty()) {80 if (connName.isEmpty()) {
118 dbusPath = QString(BASE_ACCOUNT_URL) + "/" + id;81 details->dbusPath = QString(BASE_ACCOUNT_URL) + "/" + details->id;
119 localPath = getLocalPath("");82 details->localPath = getLocalPath("");
120 isConfined = false;83 details->isConfined = false;
121 return;84 return;
122 }85 }
12386
@@ -127,9 +90,9 @@
127 reply.waitForFinished();90 reply.waitForFinished();
128 if (reply.isError()) {91 if (reply.isError()) {
129 LOG(ERROR) << reply.error(); 92 LOG(ERROR) << reply.error();
130 dbusPath = QString(BASE_ACCOUNT_URL) + "/" + id;93 details->dbusPath = QString(BASE_ACCOUNT_URL) + "/" + details->id;
131 localPath = getLocalPath("");94 details->localPath = getLocalPath("");
132 isConfined = false;95 details->isConfined = false;
133 return;96 return;
134 } else {97 } else {
135 // use the returned value98 // use the returned value
@@ -137,12 +100,12 @@
137100
138 if (appId.isEmpty() || appId == UNCONFINED_ID) {101 if (appId.isEmpty() || appId == UNCONFINED_ID) {
139 LOG(INFO) << "UNCONFINED APP";102 LOG(INFO) << "UNCONFINED APP";
140 dbusPath = QString(BASE_ACCOUNT_URL) + "/" + id;103 details->dbusPath = QString(BASE_ACCOUNT_URL) + "/" + details->id;
141 localPath = getLocalPath("");104 details->localPath = getLocalPath("");
142 isConfined = false;105 details->isConfined = false;
143 return;106 return;
144 } else {107 } else {
145 isConfined = true;108 details->isConfined = true;
146 QByteArray appIdBa = appId.toUtf8();109 QByteArray appIdBa = appId.toUtf8();
147110
148 char * appIdPath;111 char * appIdPath;
@@ -152,8 +115,8 @@
152 if (appIdPath == nullptr) {115 if (appIdPath == nullptr) {
153 LOG(ERROR) << "Unable to allocate memory for "116 LOG(ERROR) << "Unable to allocate memory for "
154 << "nih_dbus_path()";117 << "nih_dbus_path()";
155 dbusPath = QString(BASE_ACCOUNT_URL) + "/" + id;118 details->dbusPath = QString(BASE_ACCOUNT_URL) + "/" + details->id;
156 localPath = getLocalPath(appId);119 details->localPath = getLocalPath(appId);
157 return;120 return;
158 }121 }
159 QString path = QString(appIdPath);122 QString path = QString(appIdPath);
@@ -161,15 +124,57 @@
161124
162 // free nih data125 // free nih data
163 nih_free(appIdPath);126 nih_free(appIdPath);
164 dbusPath = path + "/" + id;127 details->dbusPath = path + "/" + details->id;
165 localPath = getLocalPath(appId);128 details->localPath = getLocalPath(appId);
166 return;129 return;
167 } // not empty appid string130 } // not empty appid string
168 } // no dbus error131 } // no dbus error
169}132}
170133
134QPair<QString, QString>
135AppArmor::getDBusPath() {
136 QUuid uuid = _uuidFactory->createUuid();
137 QString id = UuidUtils::getDBusString(uuid);
138 QString dbusPath = UuidUtils::getDBusString(uuid);
139 return QPair<QString, QString>(id, dbusPath);
140}
141
142QString
143AppArmor::getLocalPath(const QString& appId) {
144 // if the service is running as root we will always return /tmp
145 // as the local path root
146 if (getuid() == 0){
147 LOG(INFO) << "Running as system bus using /tmp for downloads";
148 return QStandardPaths::writableLocation(
149 QStandardPaths::TempLocation);
150 } else {
151 QString dataPath = QStandardPaths::writableLocation(
152 QStandardPaths::DataLocation);
153 QStringList pathComponents;
154 pathComponents << dataPath;
155
156 if (!appId.isEmpty()) {
157 QStringList appIdInfo = appId.split("_");
158 if (appIdInfo.count() > 0)
159 pathComponents << appIdInfo[0];
160 }
161
162 pathComponents << "Downloads";
163
164 QString path = pathComponents.join(QDir::separator());
165
166 bool wasCreated = QDir().mkpath(path);
167 if (!wasCreated) {
168 LOG(ERROR) << "Could not create the data path"
169 << path;
170 }
171 LOG(INFO) << "Local path is" << path;
172 return path;
173 } // not root
174}
175
171} // System176} // System
172177
173} // DownloadManager178} // Transfers
174179
175} // Ubuntu180} // Ubuntu
176181
=== modified file 'src/common/priv/ubuntu/transfers/system/apparmor.h'
--- ubuntu-download-manager-priv/system/apparmor.h 2014-01-10 16:38:56 +0000
+++ src/common/priv/ubuntu/transfers/system/apparmor.h 2014-04-11 16:06:36 +0000
@@ -23,17 +23,27 @@
23#include <QPair>23#include <QPair>
24#include <QString>24#include <QString>
25#include <QSharedPointer>25#include <QSharedPointer>
26#include <ubuntu/download_manager/system/dbus_connection.h>26#include <ubuntu/transfers/system/dbus_connection.h>
27#include "dbus_proxy.h"27#include "dbus_proxy.h"
28#include "uuid_factory.h"28#include "uuid_factory.h"
2929
3030
31namespace Ubuntu {31namespace Ubuntu {
3232
33namespace DownloadManager {33namespace Transfers {
3434
35namespace System {35namespace System {
3636
37struct SecurityDetails {
38 public:
39 SecurityDetails() = default;
40 SecurityDetails(const QString& requiredId) { id = requiredId; }
41 QString id;
42 QString dbusPath;
43 QString localPath;
44 bool isConfined = false;
45};
46
37class AppArmor : public QObject {47class AppArmor : public QObject {
38 Q_OBJECT48 Q_OBJECT
3949
@@ -42,18 +52,15 @@
42 AppArmor(QSharedPointer<DBusConnection> connection, QObject *parent = 0);52 AppArmor(QSharedPointer<DBusConnection> connection, QObject *parent = 0);
43 ~AppArmor();53 ~AppArmor();
4454
45 virtual void getDBusPath(QString& id, QString& dbusPath);55 virtual QPair<QString, QString> getDBusPath();
4656
47 virtual QString getSecurePath(const QString& connName,57 virtual SecurityDetails* getSecurityDetails(const QString& connName);
48 QString& dbusPath,58 virtual SecurityDetails* getSecurityDetails(const QString& connName,
49 QString& localPath,59 const QString& id);
50 bool& isConfined);60
51 virtual void getSecurePath(const QString& connName,
52 const QString& id,
53 QString& dbusPath,
54 QString& localPath,
55 bool& isConfined);
56 private:61 private:
62 void getSecurityDetails(const QString& connName,
63 SecurityDetails* details);
57 QString getLocalPath(const QString& appId);64 QString getLocalPath(const QString& appId);
5865
59 private:66 private:
@@ -66,7 +73,7 @@
6673
67} // System74} // System
6875
69} // DownloadManager76} // Transfers
7077
71} // Ubuntu78} // Ubuntu
7279
7380
=== modified file 'src/common/priv/ubuntu/transfers/system/application.cpp'
--- ubuntu-download-manager-priv/system/application.cpp 2014-01-20 16:54:58 +0000
+++ src/common/priv/ubuntu/transfers/system/application.cpp 2014-04-11 16:06:36 +0000
@@ -21,11 +21,10 @@
2121
22namespace Ubuntu {22namespace Ubuntu {
2323
24namespace DownloadManager {24namespace Transfers {
2525
26namespace System {26namespace System {
2727
28
29Application::Application(QObject* parent)28Application::Application(QObject* parent)
30 : QObject(parent) {29 : QObject(parent) {
31}30}
@@ -44,6 +43,6 @@
4443
45} // System44} // System
4645
47} // DownloadManager46} // Transfers
4847
49} // Ubuntu48} // Ubuntu
5049
=== modified file 'src/common/priv/ubuntu/transfers/system/application.h'
--- ubuntu-download-manager-priv/system/application.h 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/application.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -40,7 +40,7 @@
4040
41} // System41} // System
4242
43} // DownloadManager43} // Transfers
4444
45} // Ubuntu45} // Ubuntu
4646
4747
=== added file 'src/common/priv/ubuntu/transfers/system/cryptographic_hash.cpp'
--- src/common/priv/ubuntu/transfers/system/cryptographic_hash.cpp 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/system/cryptographic_hash.cpp 2014-04-11 16:06:36 +0000
@@ -0,0 +1,92 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#include "cryptographic_hash.h"
20
21namespace Ubuntu {
22
23namespace Transfers {
24
25namespace System {
26
27CryptographicHashFactory* CryptographicHashFactory::_instance = nullptr;
28QMutex CryptographicHashFactory::_mutex;
29
30CryptographicHash::CryptographicHash(QCryptographicHash::Algorithm method,
31 QObject* parent)
32 : QObject(parent),
33 _hash(method) {
34}
35
36
37bool
38CryptographicHash::addData(QIODevice * device) {
39 return _hash.addData(device);
40}
41
42QByteArray
43CryptographicHash::result() const {
44 return _hash.result();
45}
46
47
48CryptographicHashFactory::CryptographicHashFactory(QObject* parent)
49 : QObject(parent) {
50}
51
52CryptographicHash*
53CryptographicHashFactory::createCryptographicHash(
54 QCryptographicHash::Algorithm method,
55 QObject* parent) {
56 return new CryptographicHash(method, parent);
57}
58
59CryptographicHashFactory*
60CryptographicHashFactory::instance() {
61 if(_instance == nullptr) {
62 _mutex.lock();
63 if(_instance == nullptr)
64 _instance = new CryptographicHashFactory();
65 _mutex.unlock();
66 }
67 return _instance;
68}
69
70// only used for testing purposes
71void
72CryptographicHashFactory::setInstance(CryptographicHashFactory* instance) {
73 _instance = instance;
74}
75
76void
77CryptographicHashFactory::deleteInstance() {
78 if(_instance != nullptr) {
79 _mutex.lock();
80 if(_instance != nullptr) {
81 delete _instance;
82 _instance = nullptr;
83 }
84 _mutex.unlock();
85 }
86}
87
88} // System
89
90} // Transfers
91
92} // Ubuntu
093
=== added file 'src/common/priv/ubuntu/transfers/system/cryptographic_hash.h'
--- src/common/priv/ubuntu/transfers/system/cryptographic_hash.h 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/system/cryptographic_hash.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,71 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#ifndef DOWNLOADER_LIB_CRYPTOGRAPHIC_HASH_H
20#define DOWNLOADER_LIB_CRYPTOGRAPHIC_HASH_H
21
22#include <QByteArray>
23#include <QCryptographicHash>
24#include <QMutex>
25#include <QIODevice>
26
27namespace Ubuntu {
28
29namespace Transfers {
30
31namespace System {
32
33class CryptographicHash : public QObject {
34
35 public:
36 CryptographicHash(QCryptographicHash::Algorithm method,
37 QObject* parent = 0);
38 virtual bool addData(QIODevice* device);
39 virtual QByteArray result() const;
40
41 private:
42 QCryptographicHash _hash;
43};
44
45class CryptographicHashFactory : public QObject {
46
47 public:
48 explicit CryptographicHashFactory(QObject* parent = 0);
49 virtual CryptographicHash* createCryptographicHash(
50 QCryptographicHash::Algorithm method,
51 QObject* parent = 0);
52
53 static CryptographicHashFactory* instance();
54
55 // only used for testing purposes
56 static void setInstance(CryptographicHashFactory* instance);
57 static void deleteInstance();
58
59 private:
60 static CryptographicHashFactory* _instance;
61 static QMutex _mutex;
62
63};
64
65} // System
66
67} // Transfers
68
69} // Ubuntu
70
71#endif
072
=== modified file 'src/common/priv/ubuntu/transfers/system/dbus_proxy.h'
--- ubuntu-download-manager-priv/system/dbus_proxy.h 2013-11-12 12:30:18 +0000
+++ src/common/priv/ubuntu/transfers/system/dbus_proxy.h 2014-04-11 16:06:36 +0000
@@ -19,7 +19,8 @@
19#include <QtCore/QStringList>19#include <QtCore/QStringList>
20#include <QtCore/QVariant>20#include <QtCore/QVariant>
21#include <QtDBus/QtDBus>21#include <QtDBus/QtDBus>
22#include <ubuntu/download_manager/metatypes.h>22
23typedef QMap<QString, QString> StringMap;
2324
24/*25/*
25 * Proxy class for interface org.freedesktop.DBus26 * Proxy class for interface org.freedesktop.DBus
2627
=== modified file 'src/common/priv/ubuntu/transfers/system/file_manager.cpp'
--- ubuntu-download-manager-priv/system/file_manager.cpp 2014-02-18 18:43:25 +0000
+++ src/common/priv/ubuntu/transfers/system/file_manager.cpp 2014-04-11 16:06:36 +0000
@@ -17,11 +17,12 @@
17 */17 */
1818
19#include <QFile>19#include <QFile>
20#include <QTemporaryFile>
20#include "file_manager.h"21#include "file_manager.h"
2122
22namespace Ubuntu {23namespace Ubuntu {
2324
24namespace DownloadManager {25namespace Transfers {
2526
26namespace System {27namespace System {
2728
@@ -29,6 +30,10 @@
29 _file = new QFile(name);30 _file = new QFile(name);
30}31}
3132
33File::File(QFile* file)
34 : _file(file) {
35}
36
32File::~File() {37File::~File() {
33 delete _file;38 delete _file;
34}39}
@@ -97,6 +102,16 @@
97 return new File(name);102 return new File(name);
98}103}
99104
105File*
106FileManager::copyToTempFile(const QString& name) {
107 // create a temp file, and copy the old name to the
108 // new file path
109 auto tempFile = new QTemporaryFile();
110 QFile file(name);
111 file.copy(tempFile->fileName());
112 return new File(tempFile);
113}
114
100bool115bool
101FileManager::remove(const QString& path) {116FileManager::remove(const QString& path) {
102 return QFile::remove(path);117 return QFile::remove(path);
@@ -139,6 +154,6 @@
139154
140} // System155} // System
141156
142} // DownloadManager157} // Transfers
143158
144} // Ubuntu159} // Ubuntu
145160
=== modified file 'src/common/priv/ubuntu/transfers/system/file_manager.h'
--- ubuntu-download-manager-priv/system/file_manager.h 2014-02-18 18:43:25 +0000
+++ src/common/priv/ubuntu/transfers/system/file_manager.h 2014-04-11 16:06:36 +0000
@@ -26,7 +26,7 @@
2626
27namespace Ubuntu {27namespace Ubuntu {
2828
29namespace DownloadManager {29namespace Transfers {
3030
31namespace System {31namespace System {
3232
@@ -39,20 +39,21 @@
39 virtual ~File();39 virtual ~File();
4040
41 // wrappers around the used QFile methods41 // wrappers around the used QFile methods
42 void close();42 virtual void close();
43 virtual QFile::FileError error() const; // virtual for testing purposes43 virtual QFile::FileError error() const; // virtual for testing purposes
44 QString fileName() const;44 virtual QString fileName() const;
45 virtual bool flush(); // virtual for testing purposes45 virtual bool flush(); // virtual for testing purposes
46 bool open(QIODevice::OpenMode mode);46 virtual bool open(QIODevice::OpenMode mode);
47 QByteArray readAll();47 virtual QByteArray readAll();
48 bool remove();48 virtual bool remove();
49 bool reset();49 virtual bool reset();
50 qint64 size() const;50 virtual qint64 size() const;
51 qint64 write(const QByteArray& byteArray);51 virtual qint64 write(const QByteArray& byteArray);
52 QIODevice* device();52 virtual QIODevice* device();
5353
54 protected:54 protected:
55 explicit File(const QString& name);55 explicit File(const QString& name);
56 explicit File(QFile* file);
5657
57 private:58 private:
58 QFile* _file = nullptr;59 QFile* _file = nullptr;
@@ -64,6 +65,7 @@
6465
65 public:66 public:
66 virtual File* createFile(const QString& name);67 virtual File* createFile(const QString& name);
68 virtual File* copyToTempFile(const QString& name);
67 virtual bool remove(const QString& path);69 virtual bool remove(const QString& path);
68 virtual bool exists(const QString& path);70 virtual bool exists(const QString& path);
69 virtual bool rename(const QString& oldName, const QString& newName);71 virtual bool rename(const QString& oldName, const QString& newName);
@@ -86,7 +88,7 @@
8688
87} // System89} // System
8890
89} // DownloadManager91} // Transfers
9092
91} // Ubuntu93} // Ubuntu
9294
9395
=== modified file 'src/common/priv/ubuntu/transfers/system/filename_mutex.cpp'
--- ubuntu-download-manager-priv/system/filename_mutex.cpp 2014-03-03 17:07:20 +0000
+++ src/common/priv/ubuntu/transfers/system/filename_mutex.cpp 2014-04-11 16:06:36 +0000
@@ -18,13 +18,13 @@
1818
19#include <QFile>19#include <QFile>
20#include <QFileInfo>20#include <QFileInfo>
21#include <ubuntu/download_manager/metadata.h>21#include <ubuntu/transfers/metadata.h>
22#include "logger.h"22#include <ubuntu/transfers/system/logger.h>
23#include "filename_mutex.h"23#include "filename_mutex.h"
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -128,6 +128,6 @@
128128
129} // System129} // System
130130
131} // DownloadManager131} // Transfers
132132
133} // Ubuntu133} // Ubuntu
134134
=== modified file 'src/common/priv/ubuntu/transfers/system/filename_mutex.h'
--- ubuntu-download-manager-priv/system/filename_mutex.h 2014-02-22 10:41:59 +0000
+++ src/common/priv/ubuntu/transfers/system/filename_mutex.h 2014-04-11 16:06:36 +0000
@@ -26,7 +26,7 @@
2626
27namespace Ubuntu {27namespace Ubuntu {
2828
29namespace DownloadManager {29namespace Transfers {
3030
31namespace System {31namespace System {
3232
@@ -57,7 +57,7 @@
5757
58} // System58} // System
5959
60} // DownloadManager60} // Transfers
6161
62} // Ubuntu62} // Ubuntu
6363
6464
=== modified file 'src/common/priv/ubuntu/transfers/system/network_reply.cpp'
--- ubuntu-download-manager-priv/system/network_reply.cpp 2014-03-18 11:22:26 +0000
+++ src/common/priv/ubuntu/transfers/system/network_reply.cpp 2014-04-11 16:06:36 +0000
@@ -16,12 +16,13 @@
16 * Boston, MA 02110-1301, USA.16 * Boston, MA 02110-1301, USA.
17 */17 */
1818
19#include <ubuntu/transfers/system/logger.h>
20#include <glog/logging.h>
19#include "network_reply.h"21#include "network_reply.h"
20#include "logger.h"
2122
22namespace Ubuntu {23namespace Ubuntu {
2324
24namespace DownloadManager {25namespace Transfers {
2526
26namespace System {27namespace System {
2728
@@ -30,16 +31,23 @@
30 _reply(reply) {31 _reply(reply) {
31 // connect to all the signals so that we forward them32 // connect to all the signals so that we forward them
32 if (_reply != nullptr) {33 if (_reply != nullptr) {
33 connect(_reply, &QNetworkReply::downloadProgress,34 CHECK(connect(_reply, &QNetworkReply::downloadProgress,
34 this, &NetworkReply::downloadProgress);35 this, &NetworkReply::downloadProgress))
35 connect(_reply, &QNetworkReply::finished,36 << "Could not connect to signal";
36 this, &NetworkReply::finished);37 CHECK(connect(_reply, &QNetworkReply::uploadProgress,
37 connect(_reply, &QNetworkReply::sslErrors,38 this, &NetworkReply::uploadProgress))
38 this, &NetworkReply::sslErrors);39 << "Could not connect to signal";
40 CHECK(connect(_reply, &QNetworkReply::finished,
41 this, &NetworkReply::finished))
42 << "Could not connect to signal";
43 CHECK(connect(_reply, &QNetworkReply::sslErrors,
44 this, &NetworkReply::sslErrors))
45 << "Could not connect to signal";
39 // because error is overloaded we need to help the compiler46 // because error is overloaded we need to help the compiler
40 connect(_reply, static_cast<void(QNetworkReply::*)47 CHECK(connect(_reply, static_cast<void(QNetworkReply::*)
41 (QNetworkReply::NetworkError)>(&QNetworkReply::error),48 (QNetworkReply::NetworkError)>(&QNetworkReply::error),
42 this, &NetworkReply::error);49 this, &NetworkReply::error))
50 << "Could not connect to signal";
43 }51 }
44}52}
4553
@@ -113,6 +121,6 @@
113121
114} // System122} // System
115123
116} // DownloadManager124} // Transfers
117125
118} // Ubuntu126} // Ubuntu
119127
=== modified file 'src/common/priv/ubuntu/transfers/system/network_reply.h'
--- ubuntu-download-manager-priv/system/network_reply.h 2014-02-11 15:35:52 +0000
+++ src/common/priv/ubuntu/transfers/system/network_reply.h 2014-04-11 16:06:36 +0000
@@ -27,7 +27,7 @@
2727
28namespace Ubuntu {28namespace Ubuntu {
2929
30namespace DownloadManager {30namespace Transfers {
3131
32namespace System {32namespace System {
3333
@@ -49,6 +49,7 @@
49 signals:49 signals:
50 // signals forwarded from the real reply object50 // signals forwarded from the real reply object
51 void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);51 void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
52 void uploadProgress(qint64 bytesSent, qint64 bytesTotal);
52 void error(QNetworkReply::NetworkError code);53 void error(QNetworkReply::NetworkError code);
53 void finished();54 void finished();
54 void sslErrors(const QList<QSslError>& errors);55 void sslErrors(const QList<QSslError>& errors);
@@ -61,7 +62,7 @@
6162
62} // System63} // System
6364
64} // DownloadManager65} // Transfers
6566
66} // Ubuntu67} // Ubuntu
6768
6869
=== modified file 'src/common/priv/ubuntu/transfers/system/process.cpp'
--- ubuntu-download-manager-priv/system/process.cpp 2014-01-29 14:40:16 +0000
+++ src/common/priv/ubuntu/transfers/system/process.cpp 2014-04-11 16:06:36 +0000
@@ -17,34 +17,38 @@
17 */17 */
1818
19#include <QProcess>19#include <QProcess>
20#include <glog/logging.h>
21#include <ubuntu/transfers/system/logger.h>
20#include "process.h"22#include "process.h"
21#include "logger.h"
2223
23namespace Ubuntu {24namespace Ubuntu {
2425
25namespace DownloadManager {26namespace Transfers {
2627
27namespace System {28namespace System {
2829
29
30Process::Process(QObject* parent)30Process::Process(QObject* parent)
31 : QObject(parent) {31 : QObject(parent) {
32 _process = new QProcess(this);32 _process = new QProcess(this);
33 _process->setProcessChannelMode(QProcess::SeparateChannels);33 _process->setProcessChannelMode(QProcess::SeparateChannels);
3434
35 // connect so that we foward the signals35 // connect so that we foward the signals
36 connect(_process, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>36 CHECK(connect(_process,
37 (&QProcess::finished),37 static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>
38 this, &Process::finished);38 (&QProcess::finished), this, &Process::finished))
39 connect(_process, static_cast<void(QProcess::*)(QProcess::ProcessError)>39 << "Could not connect to signal";
40 (&QProcess::error),40 CHECK(connect(_process,
41 this, &Process::error);41 static_cast<void(QProcess::*)(QProcess::ProcessError)>
42 (&QProcess::error), this, &Process::error))
43 << "Could not connect to signal";
4244
43 // connect so that we can log the stdout and stderr of the process45 // connect so that we can log the stdout and stderr of the process
44 connect(_process, &QProcess::readyReadStandardError,46 CHECK(connect(_process, &QProcess::readyReadStandardError,
45 this, &Process::onReadyReadStandardError);47 this, &Process::onReadyReadStandardError))
46 connect(_process, &QProcess::readyReadStandardOutput,48 << "Could not connect to signal";
47 this, &Process::onReadyReadStandardOutput);49 CHECK(connect(_process, &QProcess::readyReadStandardOutput,
50 this, &Process::onReadyReadStandardOutput))
51 << "Could not connect to signal";
48}52}
4953
50void54void
@@ -87,6 +91,6 @@
8791
88} // System92} // System
8993
90} // DownloadManager94} // Transfers
9195
92} // Ubuntu96} // Ubuntu
9397
=== modified file 'src/common/priv/ubuntu/transfers/system/process.h'
--- ubuntu-download-manager-priv/system/process.h 2014-01-29 14:40:16 +0000
+++ src/common/priv/ubuntu/transfers/system/process.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -57,7 +57,7 @@
5757
58} // System58} // System
5959
60} // DownloadManager60} // Transfers
6161
62} // Ubuntu62} // Ubuntu
6363
6464
=== modified file 'src/common/priv/ubuntu/transfers/system/process_factory.cpp'
--- ubuntu-download-manager-priv/system/process_factory.cpp 2014-02-01 09:01:47 +0000
+++ src/common/priv/ubuntu/transfers/system/process_factory.cpp 2014-04-11 16:06:36 +0000
@@ -20,7 +20,7 @@
2020
21namespace Ubuntu {21namespace Ubuntu {
2222
23namespace DownloadManager {23namespace Transfers {
2424
25namespace System {25namespace System {
2626
@@ -66,6 +66,6 @@
6666
67} // System67} // System
6868
69} // DownloadManager69} // Transfers
7070
71} // Ubuntu71} // Ubuntu
7272
=== modified file 'src/common/priv/ubuntu/transfers/system/process_factory.h'
--- ubuntu-download-manager-priv/system/process_factory.h 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/process_factory.h 2014-04-11 16:06:36 +0000
@@ -25,7 +25,7 @@
2525
26namespace Ubuntu {26namespace Ubuntu {
2727
28namespace DownloadManager {28namespace Transfers {
2929
30namespace System {30namespace System {
3131
@@ -52,7 +52,7 @@
5252
53} // System53} // System
5454
55} // DownloadManager55} // Transfers
5656
57} // Ubuntu57} // Ubuntu
5858
5959
=== modified file 'src/common/priv/ubuntu/transfers/system/request_factory.cpp'
--- ubuntu-download-manager-priv/system/request_factory.cpp 2014-02-01 09:01:47 +0000
+++ src/common/priv/ubuntu/transfers/system/request_factory.cpp 2014-04-11 16:06:36 +0000
@@ -16,12 +16,13 @@
16 * Boston, MA 02110-1301, USA.16 * Boston, MA 02110-1301, USA.
17 */17 */
1818
19#include <ubuntu/transfers/system/logger.h>
20#include <glog/logging.h>
19#include "request_factory.h"21#include "request_factory.h"
20#include "logger.h"
2122
22namespace Ubuntu {23namespace Ubuntu {
2324
24namespace DownloadManager {25namespace Transfers {
2526
26namespace System {27namespace System {
2728
@@ -36,8 +37,7 @@
36}37}
3738
38NetworkReply*39NetworkReply*
39RequestFactory::get(const QNetworkRequest& request) {40RequestFactory::buildRequest(QNetworkReply* qreply) {
40 QNetworkReply* qreply = _nam->get(request);
41 NetworkReply* reply = new NetworkReply(qreply);41 NetworkReply* reply = new NetworkReply(qreply);
4242
43 if (_certs.count() > 0) {43 if (_certs.count() > 0) {
@@ -50,16 +50,31 @@
50 // the connections for too long50 // the connections for too long
51 _replies.append(reply);51 _replies.append(reply);
5252
53 connect(reply, &NetworkReply::error,53 CHECK(connect(reply, &NetworkReply::error,
54 this, &RequestFactory::onError);54 this, &RequestFactory::onError))
55 connect(reply, &NetworkReply::finished,55 << "Could not connect to signal";
56 this, &RequestFactory::onFinished);56 CHECK(connect(reply, &NetworkReply::finished,
57 connect(reply, &NetworkReply::sslErrors,57 this, &RequestFactory::onFinished))
58 this, &RequestFactory::onSslErrors);58 << "Could not connect to signal";
59 CHECK(connect(reply, &NetworkReply::sslErrors,
60 this, &RequestFactory::onSslErrors))
61 << "Could not connect to signal";
59 }62 }
60 return reply;63 return reply;
61}64}
6265
66NetworkReply*
67RequestFactory::get(const QNetworkRequest& request) {
68 auto qreply = _nam->get(request);
69 return buildRequest(qreply);
70}
71
72NetworkReply*
73RequestFactory::post(const QNetworkRequest& request, File* data) {
74 auto qreply = _nam->post(request, data->device());
75 return buildRequest(qreply);
76}
77
63QList<QSslCertificate>78QList<QSslCertificate>
64RequestFactory::acceptedCertificates() {79RequestFactory::acceptedCertificates() {
65 return _certs;80 return _certs;
@@ -155,6 +170,6 @@
155170
156} // System171} // System
157172
158} // DownloadManager173} // Transfers
159174
160} // Ubuntu175} // Ubuntu
161176
=== modified file 'src/common/priv/ubuntu/transfers/system/request_factory.h'
--- ubuntu-download-manager-priv/system/request_factory.h 2014-02-07 10:06:24 +0000
+++ src/common/priv/ubuntu/transfers/system/request_factory.h 2014-04-11 16:06:36 +0000
@@ -25,11 +25,12 @@
25#include <QObject>25#include <QObject>
26#include <QSslCertificate>26#include <QSslCertificate>
27#include <QSslError>27#include <QSslError>
28#include <ubuntu/transfers/system/file_manager.h>
28#include "network_reply.h"29#include "network_reply.h"
2930
30namespace Ubuntu {31namespace Ubuntu {
3132
32namespace DownloadManager {33namespace Transfers {
3334
34namespace System {35namespace System {
3536
@@ -38,6 +39,7 @@
3839
39 public:40 public:
40 virtual NetworkReply* get(const QNetworkRequest& request);41 virtual NetworkReply* get(const QNetworkRequest& request);
42 virtual NetworkReply* post(const QNetworkRequest& request, File* data);
4143
42 // mainly for testing purposes44 // mainly for testing purposes
43 virtual QList<QSslCertificate> acceptedCertificates();45 virtual QList<QSslCertificate> acceptedCertificates();
@@ -55,6 +57,7 @@
5557
56 private:58 private:
57 void removeNetworkReply(NetworkReply* reply);59 void removeNetworkReply(NetworkReply* reply);
60 NetworkReply* buildRequest(QNetworkReply* qreply);
5861
59 private slots:62 private slots:
60 void onError(QNetworkReply::NetworkError);63 void onError(QNetworkReply::NetworkError);
@@ -78,7 +81,7 @@
7881
79} // System82} // System
8083
81} // DownloadManager84} // Transfers
8285
83} // Ubuntu86} // Ubuntu
8487
8588
=== modified file 'src/common/priv/ubuntu/transfers/system/system_network_info.cpp'
--- ubuntu-download-manager-priv/system/system_network_info.cpp 2014-02-01 09:01:47 +0000
+++ src/common/priv/ubuntu/transfers/system/system_network_info.cpp 2014-04-11 16:06:36 +0000
@@ -18,12 +18,13 @@
1818
19#include <QNetworkConfigurationManager>19#include <QNetworkConfigurationManager>
20#include <QNetworkSession>20#include <QNetworkSession>
21#include "logger.h"21#include <glog/logging.h>
22#include <ubuntu/transfers/system/logger.h>
22#include "system_network_info.h"23#include "system_network_info.h"
2324
24namespace Ubuntu {25namespace Ubuntu {
2526
26namespace DownloadManager {27namespace Transfers {
2728
28namespace System {29namespace System {
2930
@@ -37,56 +38,78 @@
3738
38#ifdef DEBUG39#ifdef DEBUG
39 // in debug do log the changes else just fwd them40 // in debug do log the changes else just fwd them
40 connect(_info, &QNetworkInfo::cellIdChanged, this,41 CHECK(connect(_info, &QNetworkInfo::cellIdChanged, this,
41 &SystemNetworkInfo::onCellIdChanged);42 &SystemNetworkInfo::onCellIdChanged))
42 connect(_info, &QNetworkInfo::currentCellDataTechnologyChanged, this,43 << "Could not connect to signal";
43 &SystemNetworkInfo::onCurrentCellDataTechnologyChanged);44 CHECK(connect(_info, &QNetworkInfo::currentCellDataTechnologyChanged,
44 connect(_info, &QNetworkInfo::currentMobileCountryCodeChanged, this,45 this, &SystemNetworkInfo::onCurrentCellDataTechnologyChanged))
45 &SystemNetworkInfo::onCurrentMobileCountryCodeChanged);46 << "Could not connect to signal";
46 connect(_info, &QNetworkInfo::currentMobileNetworkCodeChanged, this,47 CHECK(connect(_info, &QNetworkInfo::currentMobileCountryCodeChanged, this,
47 &SystemNetworkInfo::onCurrentMobileNetworkCodeChanged);48 &SystemNetworkInfo::onCurrentMobileCountryCodeChanged))
48 connect(_info, &QNetworkInfo::currentNetworkModeChanged, this,49 << "Could not connect to signal";
49 &SystemNetworkInfo::onCurrentNetworkModeChanged);50 CHECK(connect(_info, &QNetworkInfo::currentMobileNetworkCodeChanged, this,
50 connect(_info, &QNetworkInfo::locationAreaCodeChanged, this,51 &SystemNetworkInfo::onCurrentMobileNetworkCodeChanged))
51 &SystemNetworkInfo::onLocationAreaCodeChanged);52 << "Could not connect to signal";
52 connect(_info, &QNetworkInfo::networkInterfaceCountChanged, this,53 CHECK(connect(_info, &QNetworkInfo::currentNetworkModeChanged, this,
53 &SystemNetworkInfo::onNetworkInterfaceCountChanged);54 &SystemNetworkInfo::onCurrentNetworkModeChanged))
54 connect(_info, &QNetworkInfo::networkNameChanged, this,55 << "Could not connect to signal";
55 &SystemNetworkInfo::onNetworkNameChanged);56 CHECK(connect(_info, &QNetworkInfo::locationAreaCodeChanged, this,
56 connect(_info, &QNetworkInfo::networkSignalStrengthChanged, this,57 &SystemNetworkInfo::onLocationAreaCodeChanged))
57 &SystemNetworkInfo::onNetworkSignalStrengthChanged);58 << "Could not connect to signal";
58 connect(_info, &QNetworkInfo::networkStatusChanged, this,59 CHECK(connect(_info, &QNetworkInfo::networkInterfaceCountChanged, this,
59 &SystemNetworkInfo::onNetworkStatusChanged);60 &SystemNetworkInfo::onNetworkInterfaceCountChanged))
61 << "Could not connect to signal";
62 CHECK(connect(_info, &QNetworkInfo::networkNameChanged, this,
63 &SystemNetworkInfo::onNetworkNameChanged))
64 << "Could not connect to signal";
65 CHECK(connect(_info, &QNetworkInfo::networkSignalStrengthChanged, this,
66 &SystemNetworkInfo::onNetworkSignalStrengthChanged))
67 << "Could not connect to signal";
68 CHECK(connect(_info, &QNetworkInfo::networkStatusChanged, this,
69 &SystemNetworkInfo::onNetworkStatusChanged))
70 << "Could not connect to signal";
6071
61 connect(_configMan,72 CHECK(connect(_configMan,
62 &QNetworkConfigurationManager::onlineStateChanged, this,73 &QNetworkConfigurationManager::onlineStateChanged, this,
63 &SystemNetworkInfo::onOnlineStateChanged);74 &SystemNetworkInfo::onOnlineStateChanged))
75 << "Could not connect to signal";
64#else76#else
65 // connect to interesting signals77 // connect to interesting signals
66 connect(_info, &QNetworkInfo::cellIdChanged, this,78 CHECK(connect(_info, &QNetworkInfo::cellIdChanged, this,
67 &SystemNetworkInfo::cellIdChanged);79 &SystemNetworkInfo::cellIdChanged))
68 connect(_info, &QNetworkInfo::currentCellDataTechnologyChanged, this,80 << "Could not connect to signal";
69 &SystemNetworkInfo::currentCellDataTechnologyChanged);81 CHECK(connect(_info, &QNetworkInfo::currentCellDataTechnologyChanged,
70 connect(_info, &QNetworkInfo::currentMobileCountryCodeChanged, this,82 this, &SystemNetworkInfo::currentCellDataTechnologyChanged))
71 &SystemNetworkInfo::currentMobileCountryCodeChanged);83 << "Could not connect to signal";
72 connect(_info, &QNetworkInfo::currentMobileNetworkCodeChanged, this,84 CHECK(connect(_info, &QNetworkInfo::currentMobileCountryCodeChanged, this,
73 &SystemNetworkInfo::currentMobileNetworkCodeChanged);85 &SystemNetworkInfo::currentMobileCountryCodeChanged))
74 connect(_info, &QNetworkInfo::currentNetworkModeChanged, this,86 << "Could not connect to signal";
75 &SystemNetworkInfo::currentNetworkModeChanged);87 CHECK(connect(_info, &QNetworkInfo::currentMobileNetworkCodeChanged, this,
76 connect(_info, &QNetworkInfo::locationAreaCodeChanged, this,88 &SystemNetworkInfo::currentMobileNetworkCodeChanged))
77 &SystemNetworkInfo::locationAreaCodeChanged);89 << "Could not connect to signal";
78 connect(_info, &QNetworkInfo::networkInterfaceCountChanged, this,90 CHECK(connect(_info, &QNetworkInfo::currentNetworkModeChanged, this,
79 &SystemNetworkInfo::networkInterfaceCountChanged);91 &SystemNetworkInfo::currentNetworkModeChanged))
80 connect(_info, &QNetworkInfo::networkNameChanged, this,92 << "Could not connect to signal";
81 &SystemNetworkInfo::networkNameChanged);93 CHECK(connect(_info, &QNetworkInfo::locationAreaCodeChanged, this,
82 connect(_info, &QNetworkInfo::networkSignalStrengthChanged, this,94 &SystemNetworkInfo::locationAreaCodeChanged))
83 &SystemNetworkInfo::networkSignalStrengthChanged);95 << "Could not connect to signal";
84 connect(_info, &QNetworkInfo::networkStatusChanged, this,96 CHECK(connect(_info, &QNetworkInfo::networkInterfaceCountChanged, this,
85 &SystemNetworkInfo::networkStatusChanged);97 &SystemNetworkInfo::networkInterfaceCountChanged))
98 << "Could not connect to signal";
99 CHECK(connect(_info, &QNetworkInfo::networkNameChanged, this,
100 &SystemNetworkInfo::networkNameChanged))
101 << "Could not connect to signal";
102 CHECK(connect(_info, &QNetworkInfo::networkSignalStrengthChanged, this,
103 &SystemNetworkInfo::networkSignalStrengthChanged))
104 << "Could not connect to signal";
105 CHECK(connect(_info, &QNetworkInfo::networkStatusChanged, this,
106 &SystemNetworkInfo::networkStatusChanged))
107 << "Could not connect to signal";
86108
87 connect(_configMan,109 CHECK(connect(_configMan,
88 &QNetworkConfigurationManager::onlineStateChanged, this,110 &QNetworkConfigurationManager::onlineStateChanged, this,
89 &SystemNetworkInfo::onlineStateChanged);111 &SystemNetworkInfo::onlineStateChanged))
112 << "Could not connect to signal";
90#endif113#endif
91114
92}115}
@@ -209,6 +232,6 @@
209232
210} // System233} // System
211234
212} // DownloadManager235} // Transfers
213236
214} // Ubuntu237} // Ubuntu
215238
=== modified file 'src/common/priv/ubuntu/transfers/system/system_network_info.h'
--- ubuntu-download-manager-priv/system/system_network_info.h 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/system_network_info.h 2014-04-11 16:06:36 +0000
@@ -28,7 +28,7 @@
2828
29namespace Ubuntu {29namespace Ubuntu {
3030
31namespace DownloadManager {31namespace Transfers {
3232
33namespace System {33namespace System {
3434
@@ -97,7 +97,7 @@
9797
98} // System98} // System
9999
100} // DownloadManager100} // Transfers
101101
102} // Ubuntu102} // Ubuntu
103103
104104
=== modified file 'src/common/priv/ubuntu/transfers/system/timer.cpp'
--- ubuntu-download-manager-priv/system/timer.cpp 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/timer.cpp 2014-04-11 16:06:36 +0000
@@ -17,12 +17,13 @@
17 */17 */
1818
19#include <QTimer>19#include <QTimer>
20#include <glog/logging.h>
20#include "timer.h"21#include "timer.h"
2122
2223
23namespace Ubuntu {24namespace Ubuntu {
2425
25namespace DownloadManager {26namespace Transfers {
2627
27namespace System {28namespace System {
2829
@@ -31,7 +32,8 @@
31 _timer = new QTimer(this);32 _timer = new QTimer(this);
32 _timer->setSingleShot(true);33 _timer->setSingleShot(true);
3334
34 connect(_timer, &QTimer::timeout, this, &Timer::timeout);35 CHECK(connect(_timer, &QTimer::timeout, this, &Timer::timeout))
36 << "Could not connect to signal";
35}37}
3638
37bool39bool
@@ -51,6 +53,6 @@
5153
52} // System54} // System
5355
54} // DownloadManager56} // Transfers
5557
56} // Ubuntu58} // Ubuntu
5759
=== modified file 'src/common/priv/ubuntu/transfers/system/timer.h'
--- ubuntu-download-manager-priv/system/timer.h 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/timer.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -49,7 +49,7 @@
4949
50} // System50} // System
5151
52} // DownloadManager52} // Transfers
5353
54} // Ubuntu54} // Ubuntu
5555
5656
=== modified file 'src/common/priv/ubuntu/transfers/system/uuid_factory.cpp'
--- ubuntu-download-manager-priv/system/uuid_factory.cpp 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/uuid_factory.cpp 2014-04-11 16:06:36 +0000
@@ -20,7 +20,7 @@
2020
21namespace Ubuntu {21namespace Ubuntu {
2222
23namespace DownloadManager {23namespace Transfers {
2424
25namespace System {25namespace System {
2626
@@ -35,6 +35,6 @@
3535
36} // System36} // System
3737
38} // DownloadManager38} // Transfers
3939
40} // Ubuntu40} // Ubuntu
4141
=== modified file 'src/common/priv/ubuntu/transfers/system/uuid_factory.h'
--- ubuntu-download-manager-priv/system/uuid_factory.h 2014-01-16 15:42:53 +0000
+++ src/common/priv/ubuntu/transfers/system/uuid_factory.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -39,7 +39,7 @@
3939
40} // System40} // System
4141
42} // DownloadManager42} // Transfers
4343
44} // Ubuntu44} // Ubuntu
45#endif // DOWNLOADER_LIB_UUID_FACTORY_H45#endif // DOWNLOADER_LIB_UUID_FACTORY_H
4646
=== modified file 'src/common/priv/ubuntu/transfers/system/uuid_utils.cpp'
--- ubuntu-download-manager-priv/system/uuid_utils.cpp 2013-10-29 13:42:44 +0000
+++ src/common/priv/ubuntu/transfers/system/uuid_utils.cpp 2014-04-11 16:06:36 +0000
@@ -21,7 +21,7 @@
2121
22namespace Ubuntu {22namespace Ubuntu {
2323
24namespace DownloadManager {24namespace Transfers {
2525
26namespace System {26namespace System {
2727
@@ -32,6 +32,6 @@
3232
33} // System33} // System
3434
35} // DownloadManager35} // Transfers
3636
37} // Ubuntu37} // Ubuntu
3838
=== modified file 'src/common/priv/ubuntu/transfers/system/uuid_utils.h'
--- ubuntu-download-manager-priv/system/uuid_utils.h 2013-10-29 13:42:44 +0000
+++ src/common/priv/ubuntu/transfers/system/uuid_utils.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -35,7 +35,7 @@
3535
36} // System36} // System
3737
38} // DownloadManager38} // Transfers
3939
40} // Ubuntu40} // Ubuntu
4141
4242
=== added file 'src/common/priv/ubuntu/transfers/transfer.cpp'
--- src/common/priv/ubuntu/transfers/transfer.cpp 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/transfer.cpp 2014-04-11 16:06:36 +0000
@@ -0,0 +1,181 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#include <ubuntu/transfers/system/logger.h>
20#include "transfer.h"
21
22namespace Ubuntu {
23
24namespace Transfers {
25
26Transfer::Transfer(const QString& id,
27 const QString& path,
28 bool isConfined,
29 QObject* parent)
30 : QObject(parent),
31 _id(id),
32 _throttle(0),
33 _allowMobileData(true),
34 _state(Transfer::IDLE),
35 _dbusPath(path),
36 _isConfined(isConfined) {
37 _networkInfo = System::SystemNetworkInfo::instance();
38 setObjectName(id);
39}
40
41QString
42Transfer::transferId() const {
43 return _id;
44}
45
46QString
47Transfer::path() const {
48 return _dbusPath;
49}
50
51bool
52Transfer::isConfined() const {
53 return _isConfined;
54}
55
56Transfer::State
57Transfer::state() const {
58 return _state;
59}
60
61void
62Transfer::setState(Transfer::State state) {
63 if (_state != state) {
64 _state = state;
65 emit stateChanged();
66 }
67}
68
69bool
70Transfer::canTransfer() {
71 TRACE;
72 QNetworkInfo::NetworkMode mode = _networkInfo->currentNetworkMode();
73 switch (mode) {
74 case QNetworkInfo::UnknownMode:
75 qWarning() << "Network Mode unknown!";
76 return _allowMobileData;
77 break;
78 case QNetworkInfo::GsmMode:
79 case QNetworkInfo::CdmaMode:
80 case QNetworkInfo::WcdmaMode:
81 case QNetworkInfo::WimaxMode:
82 case QNetworkInfo::TdscdmaMode:
83 case QNetworkInfo::LteMode:
84 return _allowMobileData;
85 case QNetworkInfo::WlanMode:
86 case QNetworkInfo::EthernetMode:
87 case QNetworkInfo::BluetoothMode:
88 return true;
89 default:
90 return false;
91 }
92}
93
94bool
95Transfer::isValid() const {
96 return _isValid;
97}
98
99QString
100Transfer::lastError() const {
101 return _lastError;
102}
103
104bool
105Transfer::addToQueue() const {
106 return _addToQueue;
107}
108
109void
110Transfer::setIsValid(bool isValid) {
111 _isValid = isValid;
112}
113
114void
115Transfer::setAddToQueue(bool addToQueue) {
116 _addToQueue = addToQueue;
117}
118
119void
120Transfer::setLastError(const QString& lastError) {
121 _lastError = lastError;
122}
123
124void
125Transfer::setThrottle(qulonglong speed) {
126 if (speed != _throttle) {
127 _throttle = speed;
128 emit throttleChanged();
129 }
130}
131
132qulonglong
133Transfer::throttle() {
134 return _throttle;
135}
136
137void
138Transfer::allowGSMData(bool allowed) {
139 if (_allowMobileData != allowed) {
140 _allowMobileData = allowed;
141 // emit the signals so that they q knows what to do
142 emit stateChanged();
143 }
144}
145
146bool
147Transfer::isGSMDataAllowed() {
148 return _allowMobileData;
149}
150
151void
152Transfer::cancel() {
153 setState(Transfer::CANCEL);
154 if(!_addToQueue)
155 cancelTransfer();
156}
157
158void
159Transfer::pause() {
160 setState(Transfer::PAUSE);
161 if(!_addToQueue)
162 pauseTransfer();
163}
164
165void
166Transfer::resume() {
167 setState(Transfer::RESUME);
168 if(!_addToQueue)
169 resumeTransfer();
170}
171
172void
173Transfer::start() {
174 setState(Transfer::START);
175 if(!_addToQueue)
176 startTransfer();
177}
178
179} // General
180
181} // Ubuntu
0182
=== added file 'src/common/priv/ubuntu/transfers/transfer.h'
--- src/common/priv/ubuntu/transfers/transfer.h 1970-01-01 00:00:00 +0000
+++ src/common/priv/ubuntu/transfers/transfer.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,110 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#ifndef UBUNTU_GENERAL_LIB_TRANSFER_H
20#define UBUNTU_GENERAL_LIB_TRANSFER_H
21
22#include <QObject>
23#include "ubuntu/transfers/system/system_network_info.h"
24
25namespace Ubuntu {
26
27namespace Transfers {
28
29class Transfer : public QObject {
30 Q_OBJECT
31
32 public:
33 enum State {
34 IDLE,
35 START,
36 PAUSE,
37 RESUME,
38 CANCEL,
39 FINISH,
40 ERROR
41 };
42
43 Transfer(const QString& id,
44 const QString& path,
45 bool isConfined,
46 QObject* parent = 0);
47
48 virtual QString transferId() const;
49 virtual QString path() const;
50 virtual bool isConfined() const;
51 virtual Transfer::State state() const;
52 virtual void setState(Transfer::State state);
53 virtual bool canTransfer();
54 virtual bool isValid() const;
55 virtual QString lastError() const;
56 virtual bool addToQueue() const;
57 virtual void setAddToQueue(bool addToQueue);
58
59 // methods to be overridden by the children
60 virtual bool pausable() { return false; }
61 virtual void cancelTransfer() {}
62 virtual void pauseTransfer() {}
63 virtual void resumeTransfer() {}
64 virtual void startTransfer() {}
65
66 public slots: // NOLINT(whitespace/indent)
67
68 virtual void setThrottle(qulonglong speed);
69 virtual qulonglong throttle();
70 virtual void allowGSMData(bool allowed);
71 virtual bool isGSMDataAllowed();
72
73 virtual void cancel();
74 virtual void pause();
75 virtual void resume();
76 virtual void start();
77
78 signals:
79 void canceled(bool success);
80 void error(const QString& error);
81 void paused(bool success);
82 void resumed(bool success);
83 void started(bool success);
84
85 // internal signals
86 void stateChanged();
87 void throttleChanged();
88
89 protected:
90 void setIsValid(bool isValid);
91 void setLastError(const QString& lastError);
92
93 private:
94 bool _isValid = true;
95 bool _addToQueue = true;
96 QString _lastError = "";
97 QString _id;
98 qulonglong _throttle;
99 bool _allowMobileData;
100 Transfer::State _state;
101 QString _dbusPath;
102 bool _isConfined;
103 System::SystemNetworkInfo* _networkInfo;
104};
105
106} // Transfers
107
108} // Ubuntu
109
110#endif
0111
=== added file 'src/common/priv/udm-priv-common.pro.THIS'
--- src/common/priv/udm-priv-common.pro.THIS 1970-01-01 00:00:00 +0000
+++ src/common/priv/udm-priv-common.pro.THIS 2014-04-11 16:06:36 +0000
@@ -0,0 +1,67 @@
1include(../common-project-config.pri)
2include(../common-vars.pri)
3
4QT += network dbus systeminfo sql
5QT -= gui
6DEFINES += NDEBUG
7
8TARGET = udm-priv-common
9TEMPLATE = lib
10
11DEFINES += UDMPRIVCOMMON_LIBRARY
12
13SOURCES += \
14 ubuntu/transfers/base_daemon.cpp \
15 ubuntu/transfers/base_manager.cpp \
16 ubuntu/transfers/queue.cpp \
17 ubuntu/transfers/transfer.cpp \
18 ubuntu/transfers/system/uuid_utils.cpp \
19 ubuntu/transfers/system/uuid_factory.cpp \
20 ubuntu/transfers/system/timer.cpp \
21 ubuntu/transfers/system/system_network_info.cpp \
22 ubuntu/transfers/system/request_factory.cpp \
23 ubuntu/transfers/system/process_factory.cpp \
24 ubuntu/transfers/system/process.cpp \
25 ubuntu/transfers/system/file_manager.cpp \
26 ubuntu/transfers/system/filename_mutex.cpp \
27 ubuntu/transfers/system/application.cpp \
28 ubuntu/transfers/system/apparmor.cpp \
29 ubuntu/transfers/system/network_reply.cpp \
30 ubuntu/transfers/system/dbus_proxy.cpp \
31 ubuntu/transfers/system/apn_request_factory.cpp \
32 ubuntu/transfers/system/apn_proxy.cpp
33
34HEADERS += \
35 ubuntu/transfers/base_daemon.h \
36 ubuntu/transfers/base_manager.h \
37 ubuntu/transfers/queue.h \
38 ubuntu/transfers/transfer.h \
39 ubuntu/transfers/adaptor_factory.h \
40 ubuntu/transfers/manager_factory.h \
41 ubuntu/transfers/system/uuid_utils.h \
42 ubuntu/transfers/system/uuid_factory.h \
43 ubuntu/transfers/system/timer.h \
44 ubuntu/transfers/system/system_network_info.h \
45 ubuntu/transfers/system/request_factory.h \
46 ubuntu/transfers/system/process_factory.h \
47 ubuntu/transfers/system/process.h \
48 ubuntu/transfers/system/file_manager.h \
49 ubuntu/transfers/system/filename_mutex.h \
50 ubuntu/transfers/system/application.h \
51 ubuntu/transfers/system/apparmor.h \
52 ubuntu/transfers/system/network_reply.h \
53 ubuntu/transfers/system/dbus_proxy.h \
54 ubuntu/transfers/system/apn_request_factory.h \
55 ubuntu/transfers/system/apn_proxy.h
56
57include(../common-installs-config.pri)
58
59LIBS += -lnih-dbus
60
61PKGCONFIG += dbus-1
62PKGCONFIG += libglog
63
64LIBS += -L$$OUT_PWD/../udm-common/ -ludm-common
65
66INCLUDEPATH += $$PWD/../udm-common
67DEPENDPATH += $$PWD/../udm-common
068
=== added file 'src/common/priv/udm-priv-common_global.h'
--- src/common/priv/udm-priv-common_global.h 1970-01-01 00:00:00 +0000
+++ src/common/priv/udm-priv-common_global.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,12 @@
1#ifndef UDMPRIVCOMMON_GLOBAL_H
2#define UDMPRIVCOMMON_GLOBAL_H
3
4#include <QtCore/qglobal.h>
5
6#if defined(UDMPRIVCOMMON_LIBRARY)
7# define UDMPRIVCOMMONSHARED_EXPORT Q_DECL_EXPORT
8#else
9# define UDMPRIVCOMMONSHARED_EXPORT Q_DECL_IMPORT
10#endif
11
12#endif // UDMPRIVCOMMON_GLOBAL_H
013
=== added directory 'src/common/public'
=== added file 'src/common/public/CMakeLists.txt'
--- src/common/public/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/common/public/CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,62 @@
1pkg_check_modules(GLOG libglog)
2
3set(TARGET udm-common)
4
5set(SOURCES
6 ubuntu/transfers/metadata.cpp
7 ubuntu/transfers/errors/auth_error_struct.cpp
8 ubuntu/transfers/errors/http_error_struct.cpp
9 ubuntu/transfers/errors/network_error_struct.cpp
10 ubuntu/transfers/errors/process_error_struct.cpp
11 ubuntu/transfers/system/dbus_connection.cpp
12 ubuntu/transfers/system/hash_algorithm.cpp
13 ubuntu/transfers/system/logger.cpp
14)
15
16set(TRANSFERS_PUBLIC_HEADERS
17 ubuntu/transfers/metadata.h
18)
19
20set(ERRORS_PUBLIC_HEADERS
21 ubuntu/transfers/errors/auth_error_struct.h
22 ubuntu/transfers/errors/http_error_struct.h
23 ubuntu/transfers/errors/network_error_struct.h
24 ubuntu/transfers/errors/process_error_struct.h
25)
26
27set(PRIVATE_HEADERS
28 ubuntu/transfers/system/dbus_connection.h
29 ubuntu/transfers/system/hash_algorithm.h
30 ubuntu/transfers/system/logger.h
31)
32
33include_directories(${Qt5DBus_INCLUDE_DIRS})
34include_directories(${Qt5Network_INCLUDE_DIRS})
35
36add_library(${TARGET} SHARED
37 ${SOURCES}
38 ${TRANSFERS_PUBLIC_HEADERS}
39 ${ERRORS_PUBLIC_HEADERS}
40 ${PRIVATE_HEADERS}
41)
42
43set_target_properties(
44 ${TARGET}
45
46 PROPERTIES
47 VERSION ${UDM_VERSION_MAJOR}.${UDM_VERSION_MINOR}.${UDM_VERSION_PATCH}
48 SOVERSION ${UDM_VERSION_MAJOR}
49)
50
51target_link_libraries(${TARGET}
52 ${Qt5DBus_LIBRARIES}
53 ${Qt5Network_LIBRARIES}
54 glog
55)
56
57configure_file(${TARGET}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.pc @ONLY)
58
59install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.pc DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
60install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_LIBDIR})
61install(FILES ${TRANSFERS_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ubuntu/transfers)
62install(FILES ${ERRORS_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ubuntu/transfers/errors)
063
=== added directory 'src/common/public/ubuntu'
=== added directory 'src/common/public/ubuntu/transfers'
=== added directory 'src/common/public/ubuntu/transfers/errors'
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/auth_error_struct.cpp' => 'src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/auth_error_struct.cpp 2014-02-11 15:35:52 +0000
+++ src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp 2014-04-11 16:06:36 +0000
@@ -21,7 +21,9 @@
2121
22namespace Ubuntu {22namespace Ubuntu {
2323
24namespace DownloadManager {24namespace Transfers {
25
26namespace Errors {
2527
26AuthErrorStruct::AuthErrorStruct()28AuthErrorStruct::AuthErrorStruct()
27 : _type(),29 : _type(),
@@ -87,6 +89,7 @@
87 return _phrase;89 return _phrase;
88}90}
8991
90} // DownloadManager92} // Errors
9193
94} // Transfers
92} // Ubuntu95} // Ubuntu
9396
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/auth_error_struct.h' => 'src/common/public/ubuntu/transfers/errors/auth_error_struct.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/auth_error_struct.h 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/auth_error_struct.h 2014-04-11 16:06:36 +0000
@@ -19,13 +19,13 @@
19#ifndef DOWNLOADER_LIB_AUTH_ERROR_STRUCT_H19#ifndef DOWNLOADER_LIB_AUTH_ERROR_STRUCT_H
20#define DOWNLOADER_LIB_AUTH_ERROR_STRUCT_H20#define DOWNLOADER_LIB_AUTH_ERROR_STRUCT_H
2121
22#include "common.h"
23
24class QDBusArgument;22class QDBusArgument;
2523
26namespace Ubuntu {24namespace Ubuntu {
2725
28namespace DownloadManager {26namespace Transfers {
27
28namespace Errors {
2929
30/*!30/*!
31 \class AuthErrorStruct 31 \class AuthErrorStruct
@@ -113,7 +113,9 @@
113 QString _phrase;113 QString _phrase;
114};114};
115115
116} // DownloadManager116} // Errors
117
118} // Transfers
117119
118} // Ubuntu120} // Ubuntu
119121
120122
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/http_error_struct.cpp' => 'src/common/public/ubuntu/transfers/errors/http_error_struct.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/http_error_struct.cpp 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/http_error_struct.cpp 2014-04-11 16:06:36 +0000
@@ -21,7 +21,9 @@
2121
22namespace Ubuntu {22namespace Ubuntu {
2323
24namespace DownloadManager {24namespace Transfers {
25
26namespace Errors {
2527
26HttpErrorStruct::HttpErrorStruct()28HttpErrorStruct::HttpErrorStruct()
27 : _code(200),29 : _code(200),
@@ -75,6 +77,8 @@
75 return _phrase;77 return _phrase;
76}78}
7779
78} // DownloadManager80} // Errors
81
82} // Transfers
7983
80} // Ubuntu84} // Ubuntu
8185
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/http_error_struct.h' => 'src/common/public/ubuntu/transfers/errors/http_error_struct.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/http_error_struct.h 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/http_error_struct.h 2014-04-11 16:06:36 +0000
@@ -20,13 +20,14 @@
20#define DOWNLOADER_LIB_HTTP_ERROR_STRUCT_H20#define DOWNLOADER_LIB_HTTP_ERROR_STRUCT_H
2121
22#include <QString>22#include <QString>
23#include "common.h"
2423
25class QDBusArgument;24class QDBusArgument;
2625
27namespace Ubuntu {26namespace Ubuntu {
2827
29namespace DownloadManager {28namespace Transfers {
29
30namespace Errors {
3031
31/*!32/*!
32 \class HttpErrorStruct 33 \class HttpErrorStruct
@@ -35,7 +36,7 @@
35 manager to the different clients.36 manager to the different clients.
36 \since 0.337 \since 0.3
37*/38*/
38class DOWNLOAD_MANAGER_EXPORT HttpErrorStruct {39class HttpErrorStruct {
39 Q_PROPERTY(int code READ getCode)40 Q_PROPERTY(int code READ getCode)
40 Q_PROPERTY(QString phrase READ getPhrase)41 Q_PROPERTY(QString phrase READ getPhrase)
4142
@@ -101,8 +102,9 @@
101 QString _phrase;102 QString _phrase;
102};103};
103104
104} // DownloadManager105} // Errors
106
107} // Transfers
105108
106} // Ubuntu109} // Ubuntu
107
108#endif // HTTP_ERROR_STRUCT_H110#endif // HTTP_ERROR_STRUCT_H
109111
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/network_error_struct.cpp' => 'src/common/public/ubuntu/transfers/errors/network_error_struct.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/network_error_struct.cpp 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/network_error_struct.cpp 2014-04-11 16:06:36 +0000
@@ -22,7 +22,9 @@
2222
23namespace Ubuntu {23namespace Ubuntu {
2424
25namespace DownloadManager {25namespace Transfers {
26
27namespace Errors {
2628
27NetworkErrorStruct::NetworkErrorStruct()29NetworkErrorStruct::NetworkErrorStruct()
28 : _code(0),30 : _code(0),
@@ -161,6 +163,8 @@
161 return _phrase;163 return _phrase;
162}164}
163165
164} // DownloadManager166} // Errors
167
168} // Transfers
165169
166} // Ubuntu170} // Ubuntu
167171
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/network_error_struct.h' => 'src/common/public/ubuntu/transfers/errors/network_error_struct.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/network_error_struct.h 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/network_error_struct.h 2014-04-11 16:06:36 +0000
@@ -20,13 +20,14 @@
20#define DOWNLOADER_LIB_NETWORK_ERROR_STRUCT_H20#define DOWNLOADER_LIB_NETWORK_ERROR_STRUCT_H
2121
22#include <QString>22#include <QString>
23#include "common.h"
2423
25class QDBusArgument;24class QDBusArgument;
2625
27namespace Ubuntu {26namespace Ubuntu {
2827
29namespace DownloadManager {28namespace Transfers {
29
30namespace Errors {
3031
31/*!32/*!
32 \class NetworkErrorStruct 33 \class NetworkErrorStruct
@@ -35,7 +36,7 @@
35 manager to the different clients.36 manager to the different clients.
36 \since 0.337 \since 0.3
37*/38*/
38class DOWNLOAD_MANAGER_EXPORT NetworkErrorStruct {39class NetworkErrorStruct {
39 Q_PROPERTY(int code READ getCode)40 Q_PROPERTY(int code READ getCode)
40 Q_PROPERTY(QString phrase READ getPhrase)41 Q_PROPERTY(QString phrase READ getPhrase)
4142
@@ -106,7 +107,9 @@
106 QString _phrase;107 QString _phrase;
107};108};
108109
109} // DownloadManager110} // Errors
111
112} // Transfers
110113
111} // Ubuntu114} // Ubuntu
112115
113116
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/process_error_struct.cpp' => 'src/common/public/ubuntu/transfers/errors/process_error_struct.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/process_error_struct.cpp 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/process_error_struct.cpp 2014-04-11 16:06:36 +0000
@@ -22,7 +22,9 @@
2222
23namespace Ubuntu {23namespace Ubuntu {
2424
25namespace DownloadManager {25namespace Transfers {
26
27namespace Errors {
2628
27ProcessErrorStruct::ProcessErrorStruct()29ProcessErrorStruct::ProcessErrorStruct()
28 : _code(0),30 : _code(0),
@@ -152,7 +154,8 @@
152 return _stderr;154 return _stderr;
153}155}
154156
157} // Errors
155158
156} // DownloadManager159} // Transfers
157160
158} // Ubuntu161} // Ubuntu
159162
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/process_error_struct.h' => 'src/common/public/ubuntu/transfers/errors/process_error_struct.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/process_error_struct.h 2014-03-06 12:39:08 +0000
+++ src/common/public/ubuntu/transfers/errors/process_error_struct.h 2014-04-11 16:06:36 +0000
@@ -20,13 +20,14 @@
20#define DOWNLOADER_LIB_PROCESS_ERROR_STRUCT_H20#define DOWNLOADER_LIB_PROCESS_ERROR_STRUCT_H
2121
22#include <QString>22#include <QString>
23#include "common.h"
2423
25class QDBusArgument;24class QDBusArgument;
2625
27namespace Ubuntu {26namespace Ubuntu {
2827
29namespace DownloadManager {28namespace Transfers {
29
30namespace Errors {
3031
31/*!32/*!
32 \class ProcessErrorStruct33 \class ProcessErrorStruct
@@ -35,7 +36,7 @@
35 manager to the different clients.36 manager to the different clients.
36 \since 0.337 \since 0.3
37*/38*/
38class DOWNLOAD_MANAGER_EXPORT ProcessErrorStruct {39class ProcessErrorStruct {
39 Q_PROPERTY(int code READ getCode)40 Q_PROPERTY(int code READ getCode)
40 Q_PROPERTY(int exitCode READ getExitCode)41 Q_PROPERTY(int exitCode READ getExitCode)
41 Q_PROPERTY(QString phrase READ getPhrase)42 Q_PROPERTY(QString phrase READ getPhrase)
@@ -163,7 +164,9 @@
163 QString _stderr;164 QString _stderr;
164};165};
165166
166} // DownloadManager167} // Errors
168
169} // Transfers
167170
168} // Ubuntu171} // Ubuntu
169172
170173
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/metadata.cpp' => 'src/common/public/ubuntu/transfers/metadata.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/metadata.cpp 2014-02-18 23:59:20 +0000
+++ src/common/public/ubuntu/transfers/metadata.cpp 2014-04-11 16:06:36 +0000
@@ -20,7 +20,7 @@
2020
21namespace Ubuntu {21namespace Ubuntu {
2222
23namespace DownloadManager {23namespace Transfers {
2424
25const QString Metadata::COMMAND_KEY = "post-download-command";25const QString Metadata::COMMAND_KEY = "post-download-command";
26const QString Metadata::COMMAND_FILE_KEY = "$file";26const QString Metadata::COMMAND_FILE_KEY = "$file";
2727
=== renamed file 'ubuntu-download-manager-common/ubuntu/download_manager/metadata.h' => 'src/common/public/ubuntu/transfers/metadata.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/metadata.h 2014-02-18 23:59:20 +0000
+++ src/common/public/ubuntu/transfers/metadata.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29class Metadata : public QVariantMap {29class Metadata : public QVariantMap {
3030
3131
=== renamed directory 'ubuntu-download-manager-common/ubuntu/download_manager/system' => 'src/common/public/ubuntu/transfers/system'
=== modified file 'src/common/public/ubuntu/transfers/system/dbus_connection.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/system/dbus_connection.cpp 2014-01-22 16:53:05 +0000
+++ src/common/public/ubuntu/transfers/system/dbus_connection.cpp 2014-04-11 16:06:36 +0000
@@ -20,7 +20,7 @@
2020
21namespace Ubuntu {21namespace Ubuntu {
2222
23namespace DownloadManager {23namespace Transfers {
2424
25namespace System {25namespace System {
2626
@@ -64,6 +64,6 @@
6464
65} // System65} // System
6666
67} // DownloadManager67} // Transfers
6868
69} // Ubuntu69} // Ubuntu
7070
=== modified file 'src/common/public/ubuntu/transfers/system/dbus_connection.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/system/dbus_connection.h 2014-01-22 16:53:05 +0000
+++ src/common/public/ubuntu/transfers/system/dbus_connection.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,7 @@
2424
25namespace Ubuntu {25namespace Ubuntu {
2626
27namespace DownloadManager {27namespace Transfers {
2828
29namespace System {29namespace System {
3030
@@ -48,7 +48,7 @@
4848
49} // System49} // System
5050
51} // DownloadManager51} // Transfers
5252
53} // Ubuntu53} // Ubuntu
5454
5555
=== modified file 'src/common/public/ubuntu/transfers/system/hash_algorithm.cpp'
--- ubuntu-download-manager-common/ubuntu/download_manager/system/hash_algorithm.cpp 2013-11-12 12:30:18 +0000
+++ src/common/public/ubuntu/transfers/system/hash_algorithm.cpp 2014-04-11 16:06:36 +0000
@@ -20,7 +20,7 @@
2020
21namespace Ubuntu {21namespace Ubuntu {
2222
23namespace DownloadManager {23namespace Transfers {
2424
25namespace System {25namespace System {
2626
@@ -77,6 +77,6 @@
7777
78} // System78} // System
7979
80} // DownloadManager80} // Transfers
8181
82} // Ubuntu82} // Ubuntu
8383
=== modified file 'src/common/public/ubuntu/transfers/system/hash_algorithm.h'
--- ubuntu-download-manager-common/ubuntu/download_manager/system/hash_algorithm.h 2013-11-12 12:30:18 +0000
+++ src/common/public/ubuntu/transfers/system/hash_algorithm.h 2014-04-11 16:06:36 +0000
@@ -25,7 +25,7 @@
2525
26namespace Ubuntu {26namespace Ubuntu {
2727
28namespace DownloadManager {28namespace Transfers {
2929
30namespace System {30namespace System {
3131
@@ -40,7 +40,7 @@
4040
41} // System41} // System
4242
43} // DownloadManager43} // Transfers
4444
45} // Ubuntu45} // Ubuntu
4646
4747
=== renamed file 'ubuntu-download-manager-priv/system/logger.cpp' => 'src/common/public/ubuntu/transfers/system/logger.cpp'
--- ubuntu-download-manager-priv/system/logger.cpp 2014-03-06 13:00:01 +0000
+++ src/common/public/ubuntu/transfers/system/logger.cpp 2014-04-11 16:06:36 +0000
@@ -83,23 +83,13 @@
83 return out;83 return out;
84}84}
8585
86std::ostream& operator<<(std::ostream &out, StructList list) {
87 out << "(";
88 foreach(const GroupDownloadStruct& group, list) {
89 out << "{ url:" << group.getUrl() << " hash:" << group.getHash()
90 << " local file:" << group.getLocalFile() << "}";
91 }
92 out << ")";
93 return out;
94}
95
96namespace {86namespace {
97 const QString LOG_NAME = "ubuntu-download-manager.log";87 const QString LOG_NAME = "ubuntu-download-manager.log";
98}88}
9989
100namespace Ubuntu {90namespace Ubuntu {
10191
102namespace DownloadManager {92namespace Transfers {
10393
104namespace System {94namespace System {
10595
@@ -163,6 +153,6 @@
163153
164} // System154} // System
165155
166} // DownloadManager156} // Transfers
167157
168} // Ubuntu158} // Ubuntu
169159
=== renamed file 'ubuntu-download-manager-priv/system/logger.h' => 'src/common/public/ubuntu/transfers/system/logger.h'
--- ubuntu-download-manager-priv/system/logger.h 2014-02-13 17:28:10 +0000
+++ src/common/public/ubuntu/transfers/system/logger.h 2014-04-11 16:06:36 +0000
@@ -24,7 +24,6 @@
24#include <QString>24#include <QString>
25#include <QTextStream>25#include <QTextStream>
26#include <QtGlobal>26#include <QtGlobal>
27#include <ubuntu/download_manager/metatypes.h>
28#include <glog/logging.h>27#include <glog/logging.h>
29#include <iostream>28#include <iostream>
30#include <sstream>29#include <sstream>
@@ -36,6 +35,8 @@
3635
37#define TRACE DLOG(INFO) << __PRETTY_FUNCTION__36#define TRACE DLOG(INFO) << __PRETTY_FUNCTION__
3837
38typedef QMap<QString, QString> StringMap;
39
39std::ostream& operator<<(std::ostream &out, const QString& var);40std::ostream& operator<<(std::ostream &out, const QString& var);
40std::ostream& operator<<(std::ostream &out, const QByteArray& var);41std::ostream& operator<<(std::ostream &out, const QByteArray& var);
41std::ostream& operator<<(std::ostream &out, const QStringList& var);42std::ostream& operator<<(std::ostream &out, const QStringList& var);
@@ -44,11 +45,10 @@
44std::ostream& operator<<(std::ostream &out, const QDBusError& error);45std::ostream& operator<<(std::ostream &out, const QDBusError& error);
45std::ostream& operator<<(std::ostream &out, const QVariantMap& map);46std::ostream& operator<<(std::ostream &out, const QVariantMap& map);
46std::ostream& operator<<(std::ostream &out, const QMap<QString, QString>& map);47std::ostream& operator<<(std::ostream &out, const QMap<QString, QString>& map);
47std::ostream& operator<<(std::ostream &out, StructList list);
4848
49namespace Ubuntu {49namespace Ubuntu {
5050
51namespace DownloadManager {51namespace Transfers {
5252
53namespace System {53namespace System {
5454
@@ -68,7 +68,7 @@
6868
69} // System69} // System
7070
71} // DownloadManager71} // Transfers
7272
73} // Ubuntu73} // Ubuntu
7474
7575
=== added file 'src/common/public/udm-common.pc.in'
--- src/common/public/udm-common.pc.in 1970-01-01 00:00:00 +0000
+++ src/common/public/udm-common.pc.in 2014-04-11 16:06:36 +0000
@@ -0,0 +1,12 @@
1prefix=@CMAKE_INSTALL_PREFIX@
2exec_prefix=${prefix}
3libdir=${exec_prefix}/lib
4includedir=${prefix}/include/ubuntu/transfers
5
6Name: udm-common
7Description: Common Ubuntu Upload Download Manager lib
8Version: @UDM_VERSION_MAJOR@.@UDM_VERSION_MINOR@.@UDM_VERSION_PATCH@
9Libs: -L${libdir} -ludm-common
10Requires: Qt5Core Qt5DBus
11Cflags: -I${includedir}
12
013
=== added file 'src/common/public/udm-common_global.h'
--- src/common/public/udm-common_global.h 1970-01-01 00:00:00 +0000
+++ src/common/public/udm-common_global.h 2014-04-11 16:06:36 +0000
@@ -0,0 +1,12 @@
1#ifndef UDMCOMMON_GLOBAL_H
2#define UDMCOMMON_GLOBAL_H
3
4#include <QtCore/qglobal.h>
5
6#if defined(UDMCOMMON_LIBRARY)
7# define UDMCOMMONSHARED_EXPORT Q_DECL_EXPORT
8#else
9# define UDMCOMMONSHARED_EXPORT Q_DECL_IMPORT
10#endif
11
12#endif // UDMCOMMON_GLOBAL_H
013
=== added directory 'src/downloads'
=== added file 'src/downloads/CMakeLists.txt'
--- src/downloads/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/downloads/CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,22 @@
1# Copyright © 2013 Canonical Ltd.
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License version 3 as
5# published by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.
14#
15# Authored by: Manuel de la Peña <manuel.delapena@canonical.com>
16
17add_subdirectory(client)
18add_subdirectory(common)
19add_subdirectory(daemon)
20add_subdirectory(priv)
21add_subdirectory(qml)
22add_subdirectory(test-daemon)
023
=== renamed directory 'ubuntu-download-manager-client' => 'src/downloads/client'
=== added file 'src/downloads/client/CMakeLists.txt'
--- src/downloads/client/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/downloads/client/CMakeLists.txt 2014-04-11 16:06:36 +0000
@@ -0,0 +1,68 @@
1set(TARGET ubuntu-download-manager-client)
2
3set(SOURCES
4 ubuntu/download_manager/download_impl.cpp
5 ubuntu/download_manager/download_interface.cpp
6 ubuntu/download_manager/downloads_list_impl.cpp
7 ubuntu/download_manager/download_pendingcall_watcher.cpp
8 ubuntu/download_manager/error.cpp
9 ubuntu/download_manager/group_download.cpp
10 ubuntu/download_manager/manager.cpp
11 ubuntu/download_manager/manager_impl.cpp
12 ubuntu/download_manager/manager_interface.cpp
13 ubuntu/download_manager/manager_pendingcall_watcher.cpp
14 ubuntu/download_manager/pending_call_watcher.cpp
15)
16
17set(PUBLIC_HEADERS
18 ubuntu/download_manager/download.h
19 ubuntu/download_manager/downloads_list.h
20 ubuntu/download_manager/error.h
21 ubuntu/download_manager/group_download.h
22 ubuntu/download_manager/manager.h
23)
24
25set(PRIVATE_HEADERS
26 ubuntu/download_manager/download_impl.h
27 ubuntu/download_manager/download_interface.h
28 ubuntu/download_manager/downloads_list_impl.h
29 ubuntu/download_manager/download_pendingcall_watcher.h
30 ubuntu/download_manager/manager_impl.h
31 ubuntu/download_manager/manager_interface.h
32 ubuntu/download_manager/manager_pendingcall_watcher.h
33 ubuntu/download_manager/pending_call_watcher.h
34)
35
36include_directories(${Qt5DBus_INCLUDE_DIRS})
37include_directories(${Qt5Network_INCLUDE_DIRS})
38include_directories(${CMAKE_CURRENT_SOURCE_DIR})
39include_directories(${CMAKE_CURRENT_BINARY_DIR})
40include_directories(${CMAKE_SOURCE_DIR}/src/common/public)
41include_directories(${CMAKE_SOURCE_DIR}/src/downloads/common)
42
43add_library(${TARGET} SHARED
44 ${SOURCES}
45 ${PUBLIC_HEADERS}
46 ${PRIVATE_HEADERS}
47)
48
49set_target_properties(
50 ${TARGET}
51
52 PROPERTIES
53 VERSION ${UDM_VERSION_MAJOR}.${UDM_VERSION_MINOR}.${UDM_VERSION_PATCH}
54 SOVERSION ${UDM_VERSION_MAJOR}
55)
56
57target_link_libraries(${TARGET}
58 ${Qt5DBus_LIBRARIES}
59 ${GLOG_LIBRARIES}
60 udm-common
61 ubuntu-download-manager-common
62)
63
64configure_file(${TARGET}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.pc @ONLY)
65
66install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.pc DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
67install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_LIBDIR})
68install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ubuntu/download_manager)
069
=== modified file 'src/downloads/client/ubuntu-download-manager-client.pc.in'
--- ubuntu-download-manager-client/ubuntu-download-manager-client.pc.in 2013-12-03 13:29:34 +0000
+++ src/downloads/client/ubuntu-download-manager-client.pc.in 2014-04-11 16:06:36 +0000
@@ -1,12 +1,11 @@
1prefix=$$INSTALL_PREFIX1prefix=@CMAKE_INSTALL_PREFIX@
2exec_prefix=${prefix}2exec_prefix=${prefix}
3libdir=$$INSTALL_LIBDIR
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches