Merge lp:~michihenning/storage-framework/exorcise-v1-api into lp:storage-framework/devel

Proposed by Michi Henning
Status: Needs review
Proposed branch: lp:~michihenning/storage-framework/exorcise-v1-api
Merge into: lp:storage-framework/devel
Diff against target: 14362 lines (+25/-13662)
107 files modified
CMakeLists.txt (+3/-6)
debian/changelog (+1/-0)
debian/control.in (+1/-24)
debian/libstorage-framework-qt-client-1-0.install (+0/-1)
debian/libstorage-framework-qt-client-1-0.shlibs (+0/-1)
include/unity/storage/common.h (+0/-1)
include/unity/storage/qt/CMakeLists.txt (+0/-2)
include/unity/storage/qt/client/Account.h (+0/-108)
include/unity/storage/qt/client/CMakeLists.txt (+0/-14)
include/unity/storage/qt/client/Downloader.h (+0/-139)
include/unity/storage/qt/client/Exceptions.h (+0/-255)
include/unity/storage/qt/client/File.h (+0/-109)
include/unity/storage/qt/client/Folder.h (+0/-127)
include/unity/storage/qt/client/Item.h (+0/-239)
include/unity/storage/qt/client/Root.h (+0/-92)
include/unity/storage/qt/client/Runtime.h (+0/-122)
include/unity/storage/qt/client/Uploader.h (+0/-144)
include/unity/storage/qt/client/internal/AccountBase.h (+0/-72)
include/unity/storage/qt/client/internal/DownloaderBase.h (+0/-63)
include/unity/storage/qt/client/internal/FileBase.h (+0/-53)
include/unity/storage/qt/client/internal/FolderBase.h (+0/-52)
include/unity/storage/qt/client/internal/ItemBase.h (+0/-101)
include/unity/storage/qt/client/internal/RootBase.h (+0/-69)
include/unity/storage/qt/client/internal/RuntimeBase.h (+0/-74)
include/unity/storage/qt/client/internal/UploaderBase.h (+0/-69)
include/unity/storage/qt/client/internal/local_client/AccountImpl.h (+0/-61)
include/unity/storage/qt/client/internal/local_client/DownloaderImpl.h (+0/-120)
include/unity/storage/qt/client/internal/local_client/FileImpl.h (+0/-55)
include/unity/storage/qt/client/internal/local_client/FolderImpl.h (+0/-57)
include/unity/storage/qt/client/internal/local_client/ItemImpl.h (+0/-86)
include/unity/storage/qt/client/internal/local_client/RootImpl.h (+0/-59)
include/unity/storage/qt/client/internal/local_client/RuntimeImpl.h (+0/-53)
include/unity/storage/qt/client/internal/local_client/UploaderImpl.h (+0/-141)
include/unity/storage/qt/client/internal/local_client/boost_filesystem.h (+0/-29)
include/unity/storage/qt/client/internal/local_client/storage_exception.h (+0/-94)
include/unity/storage/qt/client/internal/local_client/tmpfile_prefix.h (+0/-21)
include/unity/storage/qt/client/internal/make_future.h (+0/-85)
include/unity/storage/qt/client/internal/remote_client/AccountImpl.h (+0/-68)
include/unity/storage/qt/client/internal/remote_client/DownloaderImpl.h (+0/-76)
include/unity/storage/qt/client/internal/remote_client/FileImpl.h (+0/-61)
include/unity/storage/qt/client/internal/remote_client/FolderImpl.h (+0/-56)
include/unity/storage/qt/client/internal/remote_client/Handler.h (+0/-134)
include/unity/storage/qt/client/internal/remote_client/HandlerBase.h (+0/-76)
include/unity/storage/qt/client/internal/remote_client/ItemImpl.h (+0/-79)
include/unity/storage/qt/client/internal/remote_client/RootImpl.h (+0/-68)
include/unity/storage/qt/client/internal/remote_client/RuntimeImpl.h (+0/-81)
include/unity/storage/qt/client/internal/remote_client/UploaderImpl.h (+0/-84)
include/unity/storage/qt/client/internal/remote_client/dbusmarshal.h (+0/-45)
include/unity/storage/qt/client/internal/remote_client/validate.h (+0/-51)
plugins/Ubuntu/StorageFramework/CMakeLists.txt (+2/-1)
src/internal/CMakeLists.txt (+0/-1)
src/qt/CMakeLists.txt (+8/-10)
src/qt/client/Account.cpp (+0/-72)
src/qt/client/CMakeLists.txt (+0/-131)
src/qt/client/Downloader.cpp (+0/-62)
src/qt/client/Exceptions.cpp (+0/-304)
src/qt/client/File.cpp (+0/-61)
src/qt/client/Folder.cpp (+0/-65)
src/qt/client/Item.cpp (+0/-121)
src/qt/client/Root.cpp (+0/-65)
src/qt/client/Runtime.cpp (+0/-76)
src/qt/client/Uploader.cpp (+0/-67)
src/qt/client/internal/AccountBase.cpp (+0/-70)
src/qt/client/internal/CMakeLists.txt (+0/-5)
src/qt/client/internal/DownloaderBase.cpp (+0/-48)
src/qt/client/internal/FileBase.cpp (+0/-43)
src/qt/client/internal/FolderBase.cpp (+0/-46)
src/qt/client/internal/ItemBase.cpp (+0/-117)
src/qt/client/internal/RootBase.cpp (+0/-68)
src/qt/client/internal/RuntimeBase.cpp (+0/-47)
src/qt/client/internal/UploaderBase.cpp (+0/-59)
src/qt/client/internal/local_client/AccountImpl.cpp (+0/-159)
src/qt/client/internal/local_client/CMakeLists.txt (+0/-17)
src/qt/client/internal/local_client/DownloaderImpl.cpp (+0/-336)
src/qt/client/internal/local_client/FileImpl.cpp (+0/-136)
src/qt/client/internal/local_client/FolderImpl.cpp (+0/-283)
src/qt/client/internal/local_client/ItemImpl.cpp (+0/-496)
src/qt/client/internal/local_client/RootImpl.cpp (+0/-263)
src/qt/client/internal/local_client/RuntimeImpl.cpp (+0/-124)
src/qt/client/internal/local_client/Runtime_create.cpp (+0/-49)
src/qt/client/internal/local_client/UploaderImpl.cpp (+0/-444)
src/qt/client/internal/local_client/storage_exception.cpp (+0/-99)
src/qt/client/internal/remote_client/AccountImpl.cpp (+0/-135)
src/qt/client/internal/remote_client/CMakeLists.txt (+0/-16)
src/qt/client/internal/remote_client/DownloaderImpl.cpp (+0/-114)
src/qt/client/internal/remote_client/FileImpl.cpp (+0/-171)
src/qt/client/internal/remote_client/FolderImpl.cpp (+0/-295)
src/qt/client/internal/remote_client/HandlerBase.cpp (+0/-65)
src/qt/client/internal/remote_client/ItemImpl.cpp (+0/-332)
src/qt/client/internal/remote_client/RootImpl.cpp (+0/-187)
src/qt/client/internal/remote_client/RuntimeImpl.cpp (+0/-215)
src/qt/client/internal/remote_client/Runtime_create.cpp (+0/-47)
src/qt/client/internal/remote_client/UploaderImpl.cpp (+0/-150)
src/qt/client/internal/remote_client/dbusmarshal.cpp (+0/-138)
src/qt/client/internal/remote_client/validate.cpp (+0/-174)
src/qt/client/storage-framework-qt-client-1.pc.in (+0/-6)
src/qt/client/storage-framework-qt-local-client.pc.in (+0/-6)
tests/CMakeLists.txt (+2/-4)
tests/client/CMakeLists.txt (+6/-6)
tests/headers/CMakeLists.txt (+1/-4)
tests/local-client/CMakeLists.txt (+0/-15)
tests/local-client/local-client_test.cpp (+0/-2450)
tests/local-provider/CMakeLists.txt (+1/-1)
tests/remote-client-v1/CMakeLists.txt (+0/-20)
tests/remote-client-v1/MockProvider.cpp (+0/-236)
tests/remote-client-v1/MockProvider.h (+0/-101)
tests/remote-client-v1/remote-client-v1_test.cpp (+0/-1152)
To merge this branch: bzr merge lp:~michihenning/storage-framework/exorcise-v1-api
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
Unity API Team Pending
Review via email: mp+320300@code.launchpad.net

Commit message

Removed old Qt client API.

Description of the change

Removed old Qt client API. We'll should merge this once the 0.3 release is done and change the package version to 0.4 then.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:119
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/268/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1833
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1840
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1616
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1616/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1616
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1616/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1616
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1616/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1616
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1616/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1616
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1616/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1616
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1616/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/268/rebuild

review: Approve (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:120
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/269/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1834
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1841
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1617
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1617/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1617
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1617/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1617
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1617/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1617
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1617/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1617
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1617/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1617
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1617/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/269/rebuild

review: Approve (continuous-integration)
120. By Michi Henning

Removed old v1 enum definition for overwriting files.

121. By Michi Henning

Merged devel and updated changelog.

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:121
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/273/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1883
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1890
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1672
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1672/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1672
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1672/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1672
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1672/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1672
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1672/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1672
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1672/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1672
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1672/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/273/rebuild

review: Approve (continuous-integration)
122. By Michi Henning

Merged devel and resolved conflicts.

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:122
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/279/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1919
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1926
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1707
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1707/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1707
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1707/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1707
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1707/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1707
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1707/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1707
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1707/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1707
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1707/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/279/rebuild

review: Approve (continuous-integration)
123. By Michi Henning

Merged devel and resolved conflicts.

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:123
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/283/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1928
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1935
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1715
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1715/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1715
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1715/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1715
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1715/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1715
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1715/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1715
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1715/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1715
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1715/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/283/rebuild

review: Approve (continuous-integration)

Unmerged revisions

123. By Michi Henning

Merged devel and resolved conflicts.

122. By Michi Henning

Merged devel and resolved conflicts.

121. By Michi Henning

Merged devel and updated changelog.

120. By Michi Henning

Removed old v1 enum definition for overwriting files.

119. By Michi Henning

Removed old Qt client API.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-03-30 06:43:01 +0000
+++ CMakeLists.txt 2017-04-06 08:34:29 +0000
@@ -139,14 +139,11 @@
139enable_coverage_report(139enable_coverage_report(
140 TARGETS140 TARGETS
141 local-provider-lib141 local-provider-lib
142 qt-client-lib-common142 registry-static
143 sf-provider-objects
143 storage-framework-common-internal144 storage-framework-common-internal
145 storage-framework-provider
144 storage-framework-qt-client146 storage-framework-qt-client
145 storage-framework-qt-client-v2
146 storage-framework-qt-local-client
147 sf-provider-objects
148 storage-framework-provider
149 registry-static
150 storage-framework-registry147 storage-framework-registry
151 storage-provider-local148 storage-provider-local
152 FILTER149 FILTER
153150
=== modified file 'debian/changelog'
--- debian/changelog 2017-04-06 07:41:50 +0000
+++ debian/changelog 2017-04-06 08:34:29 +0000
@@ -1,6 +1,7 @@
1storage-framework (0.4-0ubuntu2) UNRELEASED; urgency=medium1storage-framework (0.4-0ubuntu2) UNRELEASED; urgency=medium
22
3 [ Michi Henning ]3 [ Michi Henning ]
4 * Removed the deprecated v1 client API.
4 * Removed dependency on libgio.5 * Removed dependency on libgio.
5 * Added tutorial and provider reference documentation.6 * Added tutorial and provider reference documentation.
67
78
=== modified file 'debian/control.in'
--- debian/control.in 2017-03-30 06:31:03 +0000
+++ debian/control.in 2017-04-06 08:34:29 +0000
@@ -39,15 +39,6 @@
39Description: Library for Storage Framework providers39Description: Library for Storage Framework providers
40 Server-side runtime support for provider implementations.40 Server-side runtime support for provider implementations.
4141
42Package: libstorage-framework-qt-client-1-0
43Architecture: any
44Multi-Arch: same
45Pre-Depends: ${misc:Pre-Depends},
46Depends: ${misc:Depends},
47 ${shlibs:Depends},
48Description: Client library for the Storage Framework (API v1, soon to be removed)
49 Runtime support for storage framework clients.
50
51Package: storage-framework-registry42Package: storage-framework-registry
52Architecture: any43Architecture: any
53Multi-Arch: foreign44Multi-Arch: foreign
@@ -70,26 +61,12 @@
70Description: Client library for the Storage Framework61Description: Client library for the Storage Framework
71 Runtime support for storage framework clients.62 Runtime support for storage framework clients.
7263
73Package: libstorage-framework-qt-local-client-1-0
74Architecture: any
75Multi-Arch: same
76Pre-Depends: ${misc:Pre-Depends},
77Depends: ${misc:Depends},
78 ${shlibs:Depends},
79Description: Client library for the Storage Framework backed by the local file system
80 A version of the client-side API that implements a local
81 file system provider. This is intended mainly for testing;
82 it allows application code to use the storage framework
83 API without requiring use of DBus and cloud service account.
84
85Package: storage-framework-client-dev64Package: storage-framework-client-dev
86Section: libdevel65Section: libdevel
87Architecture: any66Architecture: any
88Multi-Arch: same67Multi-Arch: same
89Pre-Depends: ${misc:Pre-Depends},68Pre-Depends: ${misc:Pre-Depends},
90Depends: libstorage-framework-qt-client-1-0 (= ${binary:Version}),69Depends: libstorage-framework-qt-client-2-0 (= ${binary:Version}),
91 libstorage-framework-qt-local-client-1-0 (= ${binary:Version}),
92 libstorage-framework-qt-client-2-0 (= ${binary:Version}),
93 qtbase5-dev,70 qtbase5-dev,
94 ${misc:Depends},71 ${misc:Depends},
95Description: Header files for the Storage Framework client libraries72Description: Header files for the Storage Framework client libraries
9673
=== removed file 'debian/libstorage-framework-qt-client-1-0.install'
--- debian/libstorage-framework-qt-client-1-0.install 2016-09-21 04:41:06 +0000
+++ debian/libstorage-framework-qt-client-1-0.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1usr/lib/*/libstorage-framework-qt-client-1.so.*
20
=== removed file 'debian/libstorage-framework-qt-client-1-0.shlibs'
--- debian/libstorage-framework-qt-client-1-0.shlibs 2016-11-04 10:27:54 +0000
+++ debian/libstorage-framework-qt-client-1-0.shlibs 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1libstorage-framework-qt-client-1 0 libstorage-framework-qt-client-1-0 (>= 0.1)
20
=== modified file 'include/unity/storage/common.h'
--- include/unity/storage/common.h 2017-03-29 01:01:24 +0000
+++ include/unity/storage/common.h 2017-04-06 08:34:29 +0000
@@ -43,7 +43,6 @@
43{43{
44 error_if_conflict, /*!< Return an error if the ETag has changed. */44 error_if_conflict, /*!< Return an error if the ETag has changed. */
45 ignore_conflict, /*!< Ignore ETag mismatch and overwrite or replace the file. */45 ignore_conflict, /*!< Ignore ETag mismatch and overwrite or replace the file. */
46 overwrite = ignore_conflict, // TODO: remove this, it's here only for compatibility with v1 API
47};46};
4847
49/**48/**
5049
=== modified file 'include/unity/storage/qt/CMakeLists.txt'
--- include/unity/storage/qt/CMakeLists.txt 2016-09-08 08:33:59 +0000
+++ include/unity/storage/qt/CMakeLists.txt 2017-04-06 08:34:29 +0000
@@ -1,5 +1,3 @@
1add_subdirectory(client) # Old (v1) API
2
3set(includeprefix unity/storage/qt)1set(includeprefix unity/storage/qt)
4file(GLOB public_hdrs *.h)2file(GLOB public_hdrs *.h)
5set(convenience_hdr ${CMAKE_CURRENT_BINARY_DIR}/client-api.h)3set(convenience_hdr ${CMAKE_CURRENT_BINARY_DIR}/client-api.h)
64
=== removed directory 'include/unity/storage/qt/client'
=== removed file 'include/unity/storage/qt/client/Account.h'
--- include/unity/storage/qt/client/Account.h 2016-11-02 03:20:03 +0000
+++ include/unity/storage/qt/client/Account.h 1970-01-01 00:00:00 +0000
@@ -1,108 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/visibility.h>
22
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wcast-align"
25#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
26#include <QFuture>
27#pragma GCC diagnostic pop
28#include <QVector>
29
30#include <memory>
31
32namespace unity
33{
34namespace storage
35{
36namespace qt
37{
38namespace client
39{
40
41class Runtime;
42class Root;
43
44namespace internal
45{
46
47class AccountBase;
48
49namespace local_client
50{
51
52class RuntimeImpl;
53
54} // namespace local_client
55
56namespace remote_client
57{
58
59class ItemImpl;
60class RuntimeImpl;
61
62} // namespace remote_client
63} // namespace internal
64
65/**
66\brief Class that represents an account.
67*/
68class UNITY_STORAGE_EXPORT Account final
69{
70public:
71 /// @cond
72 ~Account();
73 /// @endcond
74
75 Account(Account&&);
76 Account& operator=(Account&&);
77
78 typedef std::shared_ptr<Account> SPtr;
79
80 std::shared_ptr<Runtime> runtime() const;
81
82 QString owner() const;
83 QString owner_id() const;
84 QString description() const;
85
86 // TODO: Will almost certainly need more here. Other details?
87
88 /**
89 \brief Returns the root directories for the account.
90
91 An account can have more than one root directory (for providers that support the concept of multiple drives).
92 */
93 QFuture<QVector<std::shared_ptr<Root>>> roots() const;
94
95private:
96 Account(internal::AccountBase*) UNITY_STORAGE_HIDDEN;
97
98 std::shared_ptr<internal::AccountBase> p_;
99
100 friend class internal::local_client::RuntimeImpl;
101 friend class internal::remote_client::ItemImpl;
102 friend class internal::remote_client::RuntimeImpl;
103};
104
105} // namespace client
106} // namespace qt
107} // namespace storage
108} // namespace unity
1090
=== removed file 'include/unity/storage/qt/client/CMakeLists.txt'
--- include/unity/storage/qt/client/CMakeLists.txt 2016-09-21 04:41:06 +0000
+++ include/unity/storage/qt/client/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1set(includeprefix unity/storage/qt/client)
2file(GLOB public_hdrs *.h)
3set(convenience_hdr ${CMAKE_CURRENT_BINARY_DIR}/client-api.h)
4
5add_custom_command(
6 OUTPUT ${convenience_hdr}
7 COMMAND ${CMAKE_SOURCE_DIR}/tools/create_globalheader.py
8 ${convenience_hdr} ${includeprefix} ${CMAKE_CURRENT_SOURCE_DIR}
9 DEPENDS ${public_hdrs})
10
11add_custom_target(qt-client-all-headers-v1 ALL DEPENDS ${convenience_hdr})
12
13install(FILES ${public_hdrs} ${convenience_hdr}
14 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/storage-framework-client-1/${includeprefix})
150
=== removed file 'include/unity/storage/qt/client/Downloader.h'
--- include/unity/storage/qt/client/Downloader.h 2016-07-22 02:35:12 +0000
+++ include/unity/storage/qt/client/Downloader.h 1970-01-01 00:00:00 +0000
@@ -1,139 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/common.h>
22#include <unity/storage/visibility.h>
23
24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wcast-align"
26#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
27#include <QFuture>
28#pragma GCC diagnostic pop
29#include <QLocalSocket>
30
31#include <memory>
32
33class QLocalSocket;
34
35namespace unity
36{
37namespace storage
38{
39namespace qt
40{
41namespace client
42{
43
44class File;
45
46namespace internal
47{
48
49class DownloaderBase;
50
51namespace local_client
52{
53
54class FileImpl;
55
56} // namespace local_client
57
58namespace remote_client
59{
60
61class DownloaderImpl;
62
63} // namespace remote_client
64} // namespace internal
65
66class UNITY_STORAGE_EXPORT Downloader final
67{
68public:
69 /**
70 \brief Destroys the downloader.
71
72 The destructor implicitly calls cancel() if it has not been called already.
73 */
74 ~Downloader();
75
76 Downloader(Downloader&&);
77 Downloader& operator=(Downloader&&);
78
79 /**
80 \brief Convenience type definition.
81 */
82 typedef std::shared_ptr<Downloader> SPtr;
83
84 /**
85 \brief Returns the file for this downloader.
86 */
87 std::shared_ptr<File> file() const;
88
89 /**
90 \brief Returns a socket that is open for reading.
91
92 To download the file contents, read from the returned socket.
93 \return A socket open for reading.
94 */
95 std::shared_ptr<QLocalSocket> socket() const;
96
97 /**
98 \brief Finalizes the download.
99
100 Once the returned socket indicates EOF, you must call finish_download(), which closes
101 the socket. Call `waitForFinished()` on the returned future to check for errors. If an error
102 occurred, `waitForFinished()` throws an exception. If the download was cancelled, `waitForFinished()` throws
103 CancelledException.
104
105 \warning Do not assume that a download completed successfully once you detect EOF on the socket.
106 If something goes wrong during a download on the server side, the socket will return EOF
107 for a partially-downloaded file.
108 */
109 QFuture<void> finish_download();
110
111 /**
112 \brief Cancels a download.
113
114 Calling cancel() informs the provider that the download is no longer needed. The provider
115 will make a best-effort attempt to cancel the download from the remote service.
116
117 You can check whether the cancel was successfully sent by calling `waitForFinished()` on the returned future.
118 If this does not throw an exception, the message was received and acted upon by the provider. However,
119 successful completion does _not_ indicate that the download was actually cancelled. (For example,
120 the download may have completed already by the time the provider received the cancel request, or the provider
121 may not support cancellation.)
122
123 Calling cancel() more than once, or calling cancel() after a call to finish_download() is safe and does nothing.
124 */
125 QFuture<void> cancel();
126
127private:
128 Downloader(internal::DownloaderBase*) UNITY_STORAGE_HIDDEN;
129
130 std::shared_ptr<internal::DownloaderBase> p_;
131
132 friend class internal::local_client::FileImpl;
133 friend class internal::remote_client::DownloaderImpl;
134};
135
136} // namespace client
137} // namespace qt
138} // namespace storage
139} // namespace unity
1400
=== removed file 'include/unity/storage/qt/client/Exceptions.h'
--- include/unity/storage/qt/client/Exceptions.h 2016-08-26 00:15:44 +0000
+++ include/unity/storage/qt/client/Exceptions.h 1970-01-01 00:00:00 +0000
@@ -1,255 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/visibility.h>
22
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wcast-align"
25#include <QException>
26#pragma GCC diagnostic pop
27#include <QString>
28
29namespace unity
30{
31namespace storage
32{
33namespace qt
34{
35namespace client
36{
37
38/**
39\brief Base exception class for all exceptions returned by the API.
40*/
41class UNITY_STORAGE_EXPORT StorageException : public QException
42{
43public:
44 StorageException(char const* exception_name, QString const& error_message);
45 ~StorageException();
46
47 virtual StorageException* clone() const override = 0;
48 virtual void raise() const override = 0;
49
50 virtual char const* what() const noexcept override;
51
52 QString error_message() const;
53
54private:
55 std::string what_string_;
56 QString error_message_;
57};
58
59/**
60\brief Indicates errors in the communication with the storage provider service.
61*/
62class UNITY_STORAGE_EXPORT LocalCommsException : public StorageException
63{
64public:
65 LocalCommsException(QString const& error_message);
66 ~LocalCommsException();
67
68 virtual LocalCommsException* clone() const override;
69 virtual void raise() const override;
70};
71
72/**
73\brief Indicates errors in the communication between the storage provider and the cloud service.
74*/
75class UNITY_STORAGE_EXPORT RemoteCommsException : public StorageException
76{
77public:
78 RemoteCommsException(QString const& error_message);
79 ~RemoteCommsException();
80
81 virtual RemoteCommsException* clone() const override;
82 virtual void raise() const override;
83};
84
85/**
86\brief Indicates that the caller invoked an operation on a file or folder that was deleted.
87*/
88class UNITY_STORAGE_EXPORT DeletedException : public StorageException
89{
90public:
91 DeletedException(QString const& error_message, QString const& identity_);
92 ~DeletedException();
93
94 virtual DeletedException* clone() const override;
95 virtual void raise() const override;
96
97 QString native_identity() const;
98
99private:
100 QString identity_;
101};
102
103/**
104\brief Indicates that the caller destroyed the runtime.
105*/
106class UNITY_STORAGE_EXPORT RuntimeDestroyedException : public StorageException
107{
108public:
109 RuntimeDestroyedException(QString const& method);
110 ~RuntimeDestroyedException();
111
112 virtual RuntimeDestroyedException* clone() const override;
113 virtual void raise() const override;
114};
115
116/**
117\brief Indicates that an item does not exist or could not be found.
118*/
119class UNITY_STORAGE_EXPORT NotExistsException : public StorageException
120{
121public:
122 NotExistsException(QString const& error_message, QString const& key);
123 ~NotExistsException();
124
125 virtual NotExistsException* clone() const override;
126 virtual void raise() const override;
127
128 QString key() const;
129
130private:
131 QString key_;
132};
133
134/**
135\brief Indicates that an item cannot be created because it exists already.
136*/
137class UNITY_STORAGE_EXPORT ExistsException : public StorageException
138{
139public:
140 ExistsException(QString const& error_message, QString const& identity, QString const& name);
141 ~ExistsException();
142
143 virtual ExistsException* clone() const override;
144 virtual void raise() const override;
145
146 QString native_identity() const;
147 QString name() const;
148
149private:
150 QString identity_;
151 QString name_;
152};
153
154/**
155\brief Indicates that an upload detected a version mismatch.
156*/
157class UNITY_STORAGE_EXPORT ConflictException : public StorageException
158{
159public:
160 ConflictException(QString const& error_message);
161 ~ConflictException();
162
163 virtual ConflictException* clone() const override;
164 virtual void raise() const override;
165};
166
167/**
168\brief Indicates that an operation failed because of a permission problem.
169*/
170class UNITY_STORAGE_EXPORT PermissionException : public StorageException
171{
172public:
173 PermissionException(QString const& error_message);
174 ~PermissionException();
175
176 virtual PermissionException* clone() const override;
177 virtual void raise() const override;
178};
179
180/**
181\brief Indicates that an update failed because the provider ran out of space.
182*/
183class UNITY_STORAGE_EXPORT QuotaException : public StorageException
184{
185public:
186 QuotaException(QString const& error_message);
187 ~QuotaException();
188
189 virtual QuotaException* clone() const override;
190 virtual void raise() const override;
191};
192
193/**
194\brief Indicates that an upload or download was cancelled before it could complete.
195*/
196class UNITY_STORAGE_EXPORT CancelledException : public StorageException
197{
198public:
199 CancelledException(QString const& error_message);
200 ~CancelledException();
201
202 virtual CancelledException* clone() const override;
203 virtual void raise() const override;
204};
205
206/**
207\brief Indicates incorrect use of the API, such as calling methods in the wrong order.
208*/
209class UNITY_STORAGE_EXPORT LogicException : public StorageException
210{
211public:
212 LogicException(QString const& error_message);
213 ~LogicException();
214
215 virtual LogicException* clone() const override;
216 virtual void raise() const override;
217};
218
219/**
220\brief Indicates an invalid parameter, such as a negative value when a positive one was
221expected, or a string that does not parse correctly or is empty when it should be non-empty.
222*/
223class UNITY_STORAGE_EXPORT InvalidArgumentException : public StorageException
224{
225public:
226 InvalidArgumentException(QString const& error_message);
227 ~InvalidArgumentException();
228
229 virtual InvalidArgumentException* clone() const override;
230 virtual void raise() const override;
231};
232
233/**
234\brief Indicates a system error, such as failure to create a file or folder,
235or any other (usually non-recoverable) kind of error that should not arise during normal operation.
236*/
237class UNITY_STORAGE_EXPORT ResourceException : public StorageException
238{
239public:
240 ResourceException(QString const& error_message, int error_code);
241 ~ResourceException();
242
243 virtual ResourceException* clone() const override;
244 virtual void raise() const override;
245
246 int error_code() const noexcept;
247
248private:
249 int error_code_;
250};
251
252} // namespace client
253} // namespace qt
254} // namespace storage
255} // namespace unity
2560
=== removed file 'include/unity/storage/qt/client/File.h'
--- include/unity/storage/qt/client/File.h 2016-07-14 00:17:14 +0000
+++ include/unity/storage/qt/client/File.h 1970-01-01 00:00:00 +0000
@@ -1,109 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/Item.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32class Downloader;
33class Uploader;
34namespace internal
35{
36
37class FileBase;
38
39namespace local_client
40{
41
42class FileImpl;
43
44} // namespace local_client
45
46namespace remote_client
47{
48
49class FileImpl;
50
51} // namespace remotelocal_client
52} // namespace internal
53
54/**
55\brief Class that represents a file.
56
57A file is a sequence of bytes.
58*/
59class UNITY_STORAGE_EXPORT File final : public Item
60{
61public:
62 /// @cond
63 virtual ~File();
64 /// @endcond
65
66 File(File&&);
67 File& operator=(File&&);
68
69 /**
70 \brief Convenience type definition.
71 */
72 typedef std::shared_ptr<File> SPtr;
73
74 /**
75 \brief Returns the size of the file in bytes.
76 \throws DestroyedException if the file has been destroyed.
77 */
78 int64_t size() const;
79
80 /**
81 \brief Creates an uploader for the file.
82 \param policy The conflict resolution policy. If set to ConflictPolicy::overwrite,
83 the contents of the file will be overwritten even if the file was modified
84 after this File instance was retrieved. Otherwise, if set to ConflictPolicy::error_if_conflict,
85 an attempt to retrieve the File instance from the future returned by Uploader::finish_upload()
86 throws ConflictException if the file was was modified via some other channel.
87 \param size The size of the upload in bytes.
88 \note The provided file size must match the number of bytes that you write for the upload, otherwise
89 an attampt to retrive the File instance from the future returned by Uploader::finish_upload()
90 throws LogicException.
91 */
92 QFuture<std::shared_ptr<Uploader>> create_uploader(ConflictPolicy policy, int64_t size);
93
94 /**
95 \brief Creates a downloader for the file.
96 */
97 QFuture<std::shared_ptr<Downloader>> create_downloader();
98
99private:
100 File(internal::FileBase*) UNITY_STORAGE_HIDDEN;
101
102 friend class internal::local_client::FileImpl;
103 friend class internal::remote_client::FileImpl;
104};
105
106} // namespace client
107} // namespace qt
108} // namespace storage
109} // namespace unity
1100
=== removed file 'include/unity/storage/qt/client/Folder.h'
--- include/unity/storage/qt/client/Folder.h 2016-07-14 00:17:14 +0000
+++ include/unity/storage/qt/client/Folder.h 1970-01-01 00:00:00 +0000
@@ -1,127 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/File.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31namespace internal
32{
33
34class FolderBase;
35
36namespace local_client
37{
38
39class FolderImpl;
40class ItemImpl;
41
42} // namespace local_client
43
44namespace remote_client
45{
46
47class FolderImpl;
48class ItemImpl;
49
50} // namespace local_client
51} // namespace internal
52
53/**
54\brief Class that represents a folder.
55
56A folder is an unordered set of files and/or folders.
57*/
58class UNITY_STORAGE_EXPORT Folder : public Item
59{
60public:
61 /// @cond
62 virtual ~Folder();
63 /// @endcond
64
65 Folder(Folder&&);
66 Folder& operator=(Folder&&);
67
68 typedef std::shared_ptr<Folder> SPtr;
69
70 /**
71 \brief Returns the contents of a folder.
72 \return A vector of items or, if this folder is empty,
73 an empty vector. If there is a large number of items,
74 the returned future may become ready
75 more than once. (See QFutureWatcher for more information.)
76 */
77 QFuture<QVector<Item::SPtr>> list() const;
78
79 /**
80 \brief Returns the item within this folder with the given name.
81 \return The item. If no such item exists, retrieving the result
82 from the future throws an exception.
83 */
84 QFuture<QVector<Item::SPtr>> lookup(QString const& name) const;
85
86 /**
87 \brief Creates a new folder with the current folder as the parent.
88 \param name The name of the new folder. Note that the actual name may be changed
89 by the provider; call Item::name() once the folder is created to get its actual name.
90 \warn Do not rely on create_folder() to fail if an attempt is made to create
91 a folder with the same name as an already existing folder or file. Depending on the cloud
92 provider, it may be possible to have several folders with the same name.
93 // TODO: Explain issues with metacharacters.
94 \return The new folder.
95 */
96 QFuture<Folder::SPtr> create_folder(QString const& name);
97
98 /**
99 \brief Creates a new file with the current folder as the parent.
100
101 Use the returned Uploader to write data to the file. You must call Uploader::finish_upload()
102 for the file to actually be created (whether data was written to the file or not).
103 \param name The name of the new file. Note that the actual name may be changed
104 by the provider; call Item::name() once the file is created to get its actual name.
105 \param size The size of the upload in bytes.
106 \note The provided file size must match the number of bytes that you write for the upload, otherwise
107 an attampt to retrive the File instance from the future returned by Uploader::finish_upload()
108 throws LogicException.
109 \warn Do not rely on create_file() to fail if an attempt is made to create
110 a file with the same name as an already existing file or folder. Depending on the cloud
111 provider, it may be possible to have several files with the same name.
112 // TODO: Explain issues with metacharacters.
113 */
114 QFuture<std::shared_ptr<Uploader>> create_file(QString const& name, int64_t size);
115
116protected:
117 Folder(internal::FolderBase*) UNITY_STORAGE_HIDDEN;
118
119 friend class internal::local_client::FolderImpl;
120 friend class internal::local_client::ItemImpl;
121 friend class internal::remote_client::FolderImpl;
122};
123
124} // namespace client
125} // namespace qt
126} // namespace storage
127} // namespace unity
1280
=== removed file 'include/unity/storage/qt/client/Item.h'
--- include/unity/storage/qt/client/Item.h 2016-07-25 03:45:41 +0000
+++ include/unity/storage/qt/client/Item.h 1970-01-01 00:00:00 +0000
@@ -1,239 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/common.h>
22#include <unity/storage/visibility.h>
23
24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wcast-align"
26#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
27#include <QDateTime>
28#include <QFuture>
29#pragma GCC diagnostic pop
30
31#include <memory>
32
33namespace unity
34{
35namespace storage
36{
37namespace qt
38{
39namespace client
40{
41
42class Folder;
43class Root;
44
45typedef QMap<QString, QVariant> MetadataMap;
46
47namespace internal
48{
49
50class ItemBase;
51
52namespace local_client
53{
54
55class UploadWorker;
56
57} // namespace local_client
58
59namespace remote_client
60{
61
62class CopyHandler;
63class ItemImpl;
64class LookupHandler;
65class MetadataHandler;
66
67} // namespace remote_client
68} // namespace internal
69
70/**
71\brief Base class for files and folders.
72*/
73class UNITY_STORAGE_EXPORT Item
74{
75public:
76 /// @cond
77 virtual ~Item();
78 /// @endcond
79
80 Item(Item&&);
81 Item& operator=(Item&&);
82
83 /**
84 \brief Convenience type definition.
85 */
86 typedef std::shared_ptr<Item> SPtr;
87
88 /**
89 \brief Returns the native identifier used by the provider.
90 */
91 QString native_identity() const;
92
93 /**
94 \brief Returns the name of the file or folder.
95
96 The returned name may not be the same as the name that was used to create the item because the provider
97 may have changed it in some way (such as converting upper case characters to lower case).
98 */
99 QString name() const;
100
101 /**
102 \brief Returns the root folder for this item.
103
104 If this item is a root, the returned pointer points at this item.
105 */
106 std::shared_ptr<Root> root() const;
107
108 /**
109 \brief Returns the type of the item.
110 */
111 ItemType type() const;
112
113 /**
114 \brief Returns a version identifier for the item.
115
116 The version identifier changes each time the file is updated (possibly
117 via some channel other than this API).
118 */
119 QString etag() const;
120
121 /**
122 \brief Returns metadata for the item.
123
124 TODO: Needs a lot more doc. Explain standard and provider-specific metadata.
125 */
126 QVariantMap metadata() const;
127
128 /**
129 \brief Returns the time at which the item was last modified.
130 */
131 QDateTime last_modified_time() const;
132
133 /**
134 \brief Returns a list of parent folders of this item.
135 \return A vector of parents. For a root, the returned vector is empty.
136 \warn Depending on the provider, a single file or folder may have multiple
137 parents. Do not assume that only a single parent will be returned, or that
138 parents are returned in a particular order.
139 */
140 QFuture<QVector<std::shared_ptr<Folder>>> parents() const;
141
142 /**
143 \brief Returns the native identities of the parents of this item.
144 \return A vector of parent identities. For a root, the returned vector is empty.
145 \warn Depending on the provider, a single file or folder may have multiple
146 parents. Do not assume that only a single parent ID will be returned, or that
147 parent IDs are returned in a particular order.
148 */
149 QVector<QString> parent_ids() const;
150
151 /**
152 \brief Copies this item.
153
154 Copying a folder recursively copies its contents.
155 \param new_parent The new parent folder for the item. If the item is to be copied within
156 its current folder, this parameter must designate the currently existing parent.
157 \param new_name The new name for the file.
158 \warn Do not rely on copy() to fail if an attempt is made to copy
159 a file or folder to a destination name that is the same as that of an already existing file or folder.
160 Depending on the cloud provider, it may be possible to have several folders with the same name.
161 */
162 QFuture<Item::SPtr> copy(std::shared_ptr<Folder> const& new_parent, QString const& new_name);
163
164 /**
165 \brief Renames and/or moves a file or folder.
166 \param new_parent The new parent folder for the item. If the item is to be renamed within
167 its current folder, this parameter must designate the currently existing parent.
168 \param new_name The new name for the item.
169 \warn Do not rely on move() to fail if an attempt is made to move
170 a file or folder to a destination name that is the same as that of an already existing file or folder.
171 Depending on the cloud provider, it may be possible to have several files or folders with the same name.
172 \note It is not possible to move or rename the root folder.
173 */
174 QFuture<Item::SPtr> move(std::shared_ptr<Folder> const& new_parent, QString const& new_name);
175
176 /**
177 \brief Permamently deletes the item.
178 \warning Deleting a folder recursively deletes its contents.
179 */
180 QFuture<void> delete_item();
181
182 /**
183 \brief Returns the time at which an item was created.
184 \return If a provider does not support this method, the returned `QDateTime`'s `isValid()`
185 method returns false.
186 */
187 QDateTime creation_time() const;
188
189 /**
190 \brief Returns provider-specific metadata.
191
192 The contents of the returned map depend on the actual provider. This method is provided
193 to allow applications to use provider-specific features that may not be
194 supported by all providers.
195 \return The returned map may be empty if a provider does not support this feature. If a provider
196 supports it, the following keys are guaranteed to be present:
197 - `native_provider_id` (string)
198 A string that identifies the provider, such as "mCloud".
199 - `native_provider_version` (string)
200 A string that provides a version identifier.
201 \warn Unless you know that your application will only be used with a specific provider,
202 avoid using this method. If you do use provider-specific data, ensure reasonable fallback
203 behavior for your application if it encounters a different provider that does not support
204 a particular metadata item.
205 // TODO: document where to find the list of metadata items for each concrete provider.
206 */
207 MetadataMap native_metadata() const;
208
209 /**
210 \brief Compares two items for equality.
211
212 Equality comparison is deep, that is, it compares the native identities of two items, not
213 their `shared_ptr` values.
214 \note If you retrieve the same item more than once (such as by calling Root::get() twice
215 with the same file ID) and then perform an upload using one of the two file handles, the
216 files still have the same identity after the upload. However, the etag() values of the two
217 file handles differ after the upload. Despite this, equal_to() still returns `true` for
218 the two files, that is, the ETags are ignored for equality comparison.
219 \return `!this->native_identity() == other->native_identity()`
220 \throws DeletedException if `this` or `other` have been deleted.
221 */
222 bool equal_to(Item::SPtr const& other) const noexcept;
223
224protected:
225 Item(internal::ItemBase* p) UNITY_STORAGE_HIDDEN;
226
227 std::shared_ptr<internal::ItemBase> p_;
228
229 friend class internal::local_client::UploadWorker;
230 friend class internal::remote_client::CopyHandler;
231 friend class internal::remote_client::ItemImpl;
232 friend class internal::remote_client::LookupHandler;
233 friend class internal::remote_client::MetadataHandler;
234};
235
236} // namespace client
237} // namespace qt
238} // namespace storage
239} // namespace unity
2400
=== removed file 'include/unity/storage/qt/client/Root.h'
--- include/unity/storage/qt/client/Root.h 2016-07-20 06:58:30 +0000
+++ include/unity/storage/qt/client/Root.h 1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/Folder.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32class Account;
33class Item;
34
35namespace internal
36{
37
38class RootBase;
39
40namespace local_client
41{
42
43class RootImpl;
44
45} // namespace local_client
46
47namespace remote_client
48{
49
50class RootImpl;
51
52} // namespace remote_client
53} // namespace internal
54
55/**
56\brief Class that represents a root folder.
57*/
58class UNITY_STORAGE_EXPORT Root final : public Folder
59{
60public:
61 // @cond
62 virtual ~Root();
63 /// @endcond
64
65 Root(Root&&);
66 Root& operator=(Root&&);
67
68 typedef std::shared_ptr<Root> SPtr;
69
70 /**
71 \brief Returns the account for this root.
72 */
73 std::shared_ptr<Account> account() const;
74
75 QFuture<int64_t> free_space_bytes() const;
76 QFuture<int64_t> used_space_bytes() const;
77
78 QFuture<Item::SPtr> get(QString native_identity) const;
79
80 // TODO: Do we need a method to get lots of things?
81
82private:
83 Root(internal::RootBase*) UNITY_STORAGE_HIDDEN;
84
85 friend class internal::local_client::RootImpl;
86 friend class internal::remote_client::RootImpl;
87};
88
89} // namespace client
90} // namespace qt
91} // namespace storage
92} // namespace unity
930
=== removed file 'include/unity/storage/qt/client/Runtime.h'
--- include/unity/storage/qt/client/Runtime.h 2016-08-12 00:32:42 +0000
+++ include/unity/storage/qt/client/Runtime.h 1970-01-01 00:00:00 +0000
@@ -1,122 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/visibility.h>
22
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wcast-align"
25#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
26#include <QFuture>
27#pragma GCC diagnostic pop
28
29#include <memory>
30
31class QDBusConnection;
32
33namespace unity
34{
35namespace storage
36{
37namespace qt
38{
39namespace client
40{
41
42class Account;
43
44namespace internal
45{
46
47class AccountBase;
48class RuntimeBase;
49
50namespace remote_client
51{
52
53class AccountImpl;
54
55} // namespace remote_client
56
57} // namespace internal
58
59/**
60TODO
61*/
62class UNITY_STORAGE_EXPORT Runtime final
63{
64public:
65 /**
66 \brief Destroys the runtime.
67
68 The destructor implicitly calls shutdown().
69
70 \warning Do not invoke methods on any other part of the API once the runtime is destroyed;
71 doing so has undefined behavior.
72 */
73 ~Runtime();
74
75 Runtime(Runtime&&);
76 Runtime& operator=(Runtime&&);
77
78 typedef std::shared_ptr<Runtime> SPtr;
79
80 /**
81 \brief Initializes the runtime.
82 */
83 static SPtr create();
84 static SPtr create(QDBusConnection const& bus);
85
86 /**
87 \brief Shuts down the runtime.
88
89 This method shuts down the runtime. Calling shutdown() more than once is safe and does nothing.
90
91 The destructor implicitly calls shutdown(). This method is provided mainly to permit logging of any
92 errors that might arise during shut-down.
93 \throws Various exceptions, depending on the error. TODO
94 */
95 void shutdown();
96
97 QFuture<QVector<std::shared_ptr<Account>>> accounts();
98
99 /// @cond
100 /**
101 \brief Creates an Account object pointing at (bus_name, object_path)
102
103 This method is intended for use in tests, where you want to talk
104 to a provider that has already been set up on the bus.
105 */
106 std::shared_ptr<Account> make_test_account(QString const& bus_name,
107 QString const& object_path);
108 /// @endcond
109
110private:
111 Runtime(internal::RuntimeBase* p) UNITY_STORAGE_HIDDEN;
112
113 std::shared_ptr<internal::RuntimeBase> p_;
114
115 friend class internal::AccountBase;
116 friend class internal::remote_client::AccountImpl;
117};
118
119} // namespace client
120} // namespace qt
121} // namespace storage
122} // namespace unity
1230
=== removed file 'include/unity/storage/qt/client/Uploader.h'
--- include/unity/storage/qt/client/Uploader.h 2016-08-03 03:20:39 +0000
+++ include/unity/storage/qt/client/Uploader.h 1970-01-01 00:00:00 +0000
@@ -1,144 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/visibility.h>
22
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wcast-align"
25#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
26#include <QFuture>
27#pragma GCC diagnostic pop
28#include <QLocalSocket>
29
30#include <memory>
31
32class QLocalSocket;
33
34namespace unity
35{
36namespace storage
37{
38namespace qt
39{
40namespace client
41{
42
43class File;
44
45namespace internal
46{
47
48class UploaderBase;
49
50namespace local_client
51{
52
53class FileImpl;
54class FolderImpl;
55
56} // namespace local_client
57
58namespace remote_client
59{
60
61class UploaderImpl;
62
63} // namespace remote_client
64} // namespace internal
65
66class UNITY_STORAGE_EXPORT Uploader final
67{
68public:
69 /**
70 \brief Destroys the uploader.
71
72 The destructor implicitly calls cancel() if it has not been called already.
73 */
74 ~Uploader();
75
76 Uploader(Uploader&&);
77 Uploader& operator=(Uploader&&);
78
79 /**
80 \brief Convenience type definition.
81 */
82 typedef std::shared_ptr<Uploader> SPtr;
83
84 /**
85 \brief Returns a socket that is open for writing.
86
87 To upload the file contents, write to the returned socket.
88 If an operation on the socket returns an error, the file is in an indeterminate state.
89
90 \return A socket open for writing.
91 */
92 std::shared_ptr<QLocalSocket> socket() const;
93
94 /**
95 \brief Returns the size that was passed to Folder::create_file() or File::create_uploader().
96
97 \return The number of bytes that the uploader expects to be written to the `QLocalSocket` returned
98 from socket().
99 */
100 int64_t size() const;
101
102 /**
103 \brief Finalizes the upload.
104
105 Once you have written the file contents to the socket returned by socket(), you must call finish_upload(),
106 which closes the socket. Call `result()` on the returned future to check for errors. If an error
107 occurred, `result()` throws an exception. If the upload was cancelled, `result` throws CancelledException.
108 Otherwise, it returns the File that was uploaded.
109
110 Calling finish_upload() more than once is safe; subsequent calls do nothing and return the future
111 that was returned by the first call.
112 */
113 QFuture<std::shared_ptr<File>> finish_upload();
114
115 /**
116 \brief Cancels an upload.
117
118 Calling cancel() informs the provider that the upload is no longer needed. The provider
119 will make a best-effort attempt to cancel the upload to the remote service.
120
121 You can check whether the cancel was successfully sent by calling `waitForFinished()` on the returned future.
122 If this does not throw an exception, the message was received and acted upon by the provider. However,
123 successful completion does _not_ indicate that the upload was actually cancelled. (For example,
124 the upload may have completed already by the time the provider received the cancel request, or the provider
125 may not support cancellation.)
126
127 Calling cancel() more than once, or calling cancel() after a call to finish_upload() is safe and does nothing.
128 */
129 QFuture<void> cancel();
130
131private:
132 Uploader(internal::UploaderBase*) UNITY_STORAGE_HIDDEN;
133
134 std::shared_ptr<internal::UploaderBase> p_;
135
136 friend class internal::local_client::FileImpl;
137 friend class internal::local_client::FolderImpl;
138 friend class internal::remote_client::UploaderImpl;
139};
140
141} // namespace client
142} // namespace qt
143} // namespace storage
144} // namespace unity
1450
=== removed directory 'include/unity/storage/qt/client/internal'
=== removed file 'include/unity/storage/qt/client/internal/AccountBase.h'
--- include/unity/storage/qt/client/internal/AccountBase.h 2016-07-25 03:45:41 +0000
+++ include/unity/storage/qt/client/internal/AccountBase.h 1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wcast-align"
23#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
24#include <QFuture>
25#pragma GCC diagnostic pop
26#include <QVector>
27
28#include <atomic>
29#include <memory>
30
31namespace unity
32{
33namespace storage
34{
35namespace qt
36{
37namespace client
38{
39
40class Account;
41class Root;
42class Runtime;
43
44namespace internal
45{
46
47class AccountBase
48{
49public:
50 AccountBase(std::weak_ptr<Runtime> const& runtime);
51 virtual ~AccountBase() = default;
52 AccountBase(AccountBase const&) = delete;
53 AccountBase& operator=(AccountBase const&) = delete;
54
55 std::shared_ptr<Runtime> runtime() const;
56 virtual QString owner() const = 0;
57 virtual QString owner_id() const = 0;
58 virtual QString description() const = 0;
59 virtual QFuture<QVector<std::shared_ptr<Root>>> roots() = 0;
60
61 void set_public_instance(std::weak_ptr<Account> const& p);
62
63protected:
64 std::weak_ptr<Runtime> runtime_; // Immutable once set
65 std::weak_ptr<Account> public_instance_; // Immutable once set
66};
67
68} // namespace internal
69} // namespace client
70} // namespace qt
71} // namespace storage
72} // namespace unity
730
=== removed file 'include/unity/storage/qt/client/internal/DownloaderBase.h'
--- include/unity/storage/qt/client/internal/DownloaderBase.h 2016-07-22 02:35:12 +0000
+++ include/unity/storage/qt/client/internal/DownloaderBase.h 1970-01-01 00:00:00 +0000
@@ -1,63 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wcast-align"
23#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
24#include <QFuture>
25#pragma GCC diagnostic pop
26
27#include <memory>
28
29class QLocalSocket;
30
31namespace unity
32{
33namespace storage
34{
35namespace qt
36{
37namespace client
38{
39
40class File;
41
42namespace internal
43{
44
45class DownloaderBase : public QObject
46{
47public:
48 DownloaderBase(std::weak_ptr<File> file);
49
50 virtual std::shared_ptr<File> file() const = 0;
51 virtual std::shared_ptr<QLocalSocket> socket() const = 0;
52 virtual QFuture<void> finish_download() = 0;
53 virtual QFuture<void> cancel() noexcept = 0;
54
55protected:
56 std::shared_ptr<File> file_;
57};
58
59} // namespace internal
60} // namespace client
61} // namespace qt
62} // namespace storage
63} // namespace unity
640
=== removed file 'include/unity/storage/qt/client/internal/FileBase.h'
--- include/unity/storage/qt/client/internal/FileBase.h 2016-07-14 00:17:14 +0000
+++ include/unity/storage/qt/client/internal/FileBase.h 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/ItemBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32class Downloader;
33class File;
34class Uploader;
35
36namespace internal
37{
38
39class FileBase : public virtual ItemBase
40{
41public:
42 FileBase(QString const& identity);
43
44 virtual int64_t size() const = 0;
45 virtual QFuture<std::shared_ptr<Uploader>> create_uploader(ConflictPolicy policy, int64_t size) = 0;
46 virtual QFuture<std::shared_ptr<Downloader>> create_downloader() = 0;
47};
48
49} // namespace internal
50} // namespace client
51} // namespace qt
52} // namespace storage
53} // namespace unity
540
=== removed file 'include/unity/storage/qt/client/internal/FolderBase.h'
--- include/unity/storage/qt/client/internal/FolderBase.h 2016-07-22 00:17:24 +0000
+++ include/unity/storage/qt/client/internal/FolderBase.h 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/ItemBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32class Uploader;
33
34namespace internal
35{
36
37class FolderBase : public virtual ItemBase
38{
39public:
40 FolderBase(QString const& identity, ItemType type);
41
42 virtual QFuture<QVector<std::shared_ptr<Item>>> list() const = 0;
43 virtual QFuture<QVector<std::shared_ptr<Item>>> lookup(QString const& name) const = 0;
44 virtual QFuture<std::shared_ptr<Folder>> create_folder(QString const& name) = 0;
45 virtual QFuture<std::shared_ptr<Uploader>> create_file(QString const& name, int64_t size) = 0;
46};
47
48} // namespace internal
49} // namespace client
50} // namespace qt
51} // namespace storage
52} // namespace unity
530
=== removed file 'include/unity/storage/qt/client/internal/ItemBase.h'
--- include/unity/storage/qt/client/internal/ItemBase.h 2016-08-05 05:37:23 +0000
+++ include/unity/storage/qt/client/internal/ItemBase.h 1970-01-01 00:00:00 +0000
@@ -1,101 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/common.h>
22
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wcast-align"
25#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
26#include <QDateTime>
27#include <QFuture>
28#pragma GCC diagnostic pop
29#include <QVariantMap>
30
31#include <memory>
32
33namespace unity
34{
35namespace storage
36{
37namespace qt
38{
39namespace client
40{
41
42class Folder;
43class Item;
44class Root;
45
46typedef QMap<QString, QVariant> MetadataMap;
47
48namespace internal
49{
50
51class ItemImpl;
52
53class ItemBase : public std::enable_shared_from_this<ItemBase>
54{
55public:
56 ItemBase(QString const& identity, ItemType type);
57 virtual ~ItemBase();
58 ItemBase(ItemBase const&) = delete;
59 ItemBase& operator=(ItemBase const&) = delete;
60
61 QString native_identity() const;
62 ItemType type() const;
63 std::shared_ptr<Root> root() const;
64
65 virtual QString name() const = 0;
66 virtual QString etag() const = 0;
67 virtual QVariantMap metadata() const = 0;
68 virtual QDateTime last_modified_time() const = 0;
69
70 virtual QFuture<std::shared_ptr<Item>> copy(std::shared_ptr<Folder> const& new_parent, QString const& new_name) = 0;
71 virtual QFuture<std::shared_ptr<Item>> move(std::shared_ptr<Folder> const& new_parent, QString const& new_name) = 0;
72 virtual QFuture<QVector<std::shared_ptr<Folder>>> parents() const = 0;
73 virtual QVector<QString> parent_ids() const = 0;
74 virtual QFuture<void> delete_item() = 0;
75
76 virtual QDateTime creation_time() const = 0;
77 virtual MetadataMap native_metadata() const = 0;
78
79 virtual bool equal_to(ItemBase const& other) const noexcept = 0;
80
81 void set_root(std::weak_ptr<Root> p);
82 void set_public_instance(std::weak_ptr<Item> p);
83
84protected:
85 std::shared_ptr<Root> get_root() const noexcept;
86 void throw_if_destroyed(QString const& method) const;
87
88 const QString identity_;
89 const ItemType type_;
90 std::weak_ptr<Root> root_;
91 std::weak_ptr<Item> public_instance_;
92 bool deleted_ = false;
93
94 friend class ItemImpl;
95};
96
97} // namespace internal
98} // namespace client
99} // namespace qt
100} // namespace storage
101} // namespace unity
1020
=== removed file 'include/unity/storage/qt/client/internal/RootBase.h'
--- include/unity/storage/qt/client/internal/RootBase.h 2016-07-20 06:58:30 +0000
+++ include/unity/storage/qt/client/internal/RootBase.h 1970-01-01 00:00:00 +0000
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/Root.h>
22#include <unity/storage/qt/client/internal/FolderBase.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace qt
29{
30namespace client
31{
32namespace internal
33{
34namespace remote_client
35{
36
37class CopyHandler;
38class ItemImpl;
39class LookupHandler;
40class MetadataHandler;
41
42} // namespace remote_client
43
44class RootBase : public virtual FolderBase
45{
46public:
47 RootBase(QString const& identity, std::weak_ptr<Account> const& account);
48
49 std::shared_ptr<Account> account() const;
50 virtual QFuture<int64_t> free_space_bytes() const = 0;
51 virtual QFuture<int64_t> used_space_bytes() const = 0;
52 virtual QFuture<Item::SPtr> get(QString native_identity) const = 0;
53
54 static std::shared_ptr<Root> make_root(QString const& identity, std::weak_ptr<Account> const& account);
55
56protected:
57 std::weak_ptr<Account> account_;
58
59 friend class remote_client::CopyHandler;
60 friend class remote_client::ItemImpl; // TODO: probably no longer needed
61 friend class remote_client::LookupHandler;
62 friend class remote_client::MetadataHandler;
63};
64
65} // namespace internal
66} // namespace client
67} // namespace qt
68} // namespace storage
69} // namespace unity
700
=== removed file 'include/unity/storage/qt/client/internal/RuntimeBase.h'
--- include/unity/storage/qt/client/internal/RuntimeBase.h 2016-08-11 23:55:40 +0000
+++ include/unity/storage/qt/client/internal/RuntimeBase.h 1970-01-01 00:00:00 +0000
@@ -1,74 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wcast-align"
23#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
24#include <QFuture>
25#pragma GCC diagnostic pop
26#include <QVector>
27
28#include <memory>
29
30namespace unity
31{
32namespace storage
33{
34namespace qt
35{
36namespace client
37{
38
39class Account;
40class Runtime;
41
42namespace internal
43{
44
45class AccountBase;
46
47class RuntimeBase : public QObject
48{
49public:
50 RuntimeBase() = default;
51 virtual ~RuntimeBase() = default;
52 RuntimeBase(RuntimeBase const&) = delete;
53 RuntimeBase& operator=(RuntimeBase const&) = delete;
54
55 virtual void shutdown() = 0;
56 virtual QFuture<QVector<std::shared_ptr<Account>>> accounts() = 0;
57 virtual std::shared_ptr<Account> make_test_account(QString const& bus_name,
58 QString const& object_path) = 0;
59
60 void set_public_instance(std::weak_ptr<Runtime> p);
61
62protected:
63 bool destroyed_ = false;
64 QVector<std::shared_ptr<Account>> accounts_;
65 std::weak_ptr<Runtime> public_instance_; // Immutable once set
66
67 friend class unity::storage::qt::client::internal::AccountBase;
68};
69
70} // namespace internal
71} // namespace client
72} // namespace qt
73} // namespace storage
74} // namespace unity
750
=== removed file 'include/unity/storage/qt/client/internal/UploaderBase.h'
--- include/unity/storage/qt/client/internal/UploaderBase.h 2016-08-03 03:20:39 +0000
+++ include/unity/storage/qt/client/internal/UploaderBase.h 1970-01-01 00:00:00 +0000
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/common.h>
22
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wcast-align"
25#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
26#include <QFuture>
27#pragma GCC diagnostic pop
28
29#include <memory>
30
31class QLocalSocket;
32
33namespace unity
34{
35namespace storage
36{
37namespace qt
38{
39namespace client
40{
41
42class File;
43
44namespace internal
45{
46
47class UploaderBase : public QObject
48{
49public:
50 UploaderBase(ConflictPolicy policy, int64_t size);
51 UploaderBase(UploaderBase&) = delete;
52 UploaderBase& operator=(UploaderBase const&) = delete;
53
54 virtual std::shared_ptr<QLocalSocket> socket() const = 0;
55 virtual QFuture<std::shared_ptr<File>> finish_upload() = 0;
56 virtual QFuture<void> cancel() noexcept = 0;
57
58 int64_t size() const;
59
60protected:
61 ConflictPolicy policy_;
62 int64_t size_;
63};
64
65} // namespace internal
66} // namespace client
67} // namespace qt
68} // namespace storage
69} // namespace unity
700
=== removed directory 'include/unity/storage/qt/client/internal/local_client'
=== removed file 'include/unity/storage/qt/client/internal/local_client/AccountImpl.h'
--- include/unity/storage/qt/client/internal/local_client/AccountImpl.h 2016-07-13 04:19:12 +0000
+++ include/unity/storage/qt/client/internal/local_client/AccountImpl.h 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/AccountBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31namespace internal
32{
33namespace local_client
34{
35
36class AccountImpl : public virtual AccountBase
37{
38public:
39 AccountImpl(std::weak_ptr<Runtime> const& runtime,
40 QString const& owner,
41 QString const& owner_id,
42 QString const& description);
43
44 virtual QString owner() const override;
45 virtual QString owner_id() const override;
46 virtual QString description() const override;
47 virtual QFuture<QVector<std::shared_ptr<Root>>> roots() override;
48
49private:
50 QString owner_; // Immutable
51 QString owner_id_; // Immutable
52 QString description_; // Immutable
53 QVector<std::shared_ptr<Root>> roots_; // Immutable
54};
55
56} // namespace local_client
57} // namespace internal
58} // namespace client
59} // namespace qt
60} // namespace storage
61} // namespace unity
620
=== removed file 'include/unity/storage/qt/client/internal/local_client/DownloaderImpl.h'
--- include/unity/storage/qt/client/internal/local_client/DownloaderImpl.h 2016-07-18 05:14:09 +0000
+++ include/unity/storage/qt/client/internal/local_client/DownloaderImpl.h 1970-01-01 00:00:00 +0000
@@ -1,120 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/DownloaderBase.h>
22
23#include <QFile>
24#include <QThread>
25
26class QLocalSocket;
27
28namespace unity
29{
30namespace storage
31{
32namespace qt
33{
34namespace client
35{
36namespace internal
37{
38namespace local_client
39{
40
41class DownloadWorker : public QObject
42{
43 Q_OBJECT
44
45public:
46 DownloadWorker(int write_fd,
47 QString const& filename,
48 QFutureInterface<void>& qf,
49 QFutureInterface<void>& worker_initialized);
50 void start_downloading() noexcept;
51
52public Q_SLOTS:
53 void do_finish();
54 void do_cancel();
55
56private Q_SLOTS:
57 void on_bytes_written(qint64 bytes);
58 void on_disconnected();
59 void on_error();
60
61private:
62 void read_and_write_chunk();
63 void handle_error(QString const& msg, int error_code);
64
65 enum State { in_progress, finalized, cancelled, error };
66
67 State state_ = in_progress;
68 int write_fd_;
69 std::shared_ptr<QLocalSocket> write_socket_;
70 QString filename_;
71 std::unique_ptr<QFile> input_file_;
72 QFutureInterface<void>& qf_;
73 QFutureInterface<void>& worker_initialized_;
74 qint64 bytes_to_write_;
75 QString error_msg_;
76 int error_code_ = 0;
77};
78
79class DownloadThread : public QThread
80{
81 Q_OBJECT
82
83public:
84 DownloadThread(DownloadWorker* worker);
85 virtual void run() override;
86
87private:
88 DownloadWorker* worker_;
89};
90
91class DownloaderImpl : public DownloaderBase
92{
93 Q_OBJECT
94
95public:
96 DownloaderImpl(std::weak_ptr<File> file);
97 virtual ~DownloaderImpl();
98
99 std::shared_ptr<File> file() const override;
100 std::shared_ptr<QLocalSocket> socket() const override;
101 QFuture<void> finish_download() override;
102 QFuture<void> cancel() noexcept override;
103
104Q_SIGNALS:
105 void do_finish();
106 void do_cancel();
107
108private:
109 std::shared_ptr<QLocalSocket> read_socket_;
110 QFutureInterface<void> qf_;
111 std::unique_ptr<DownloadThread> download_thread_;
112 std::unique_ptr<DownloadWorker> worker_;
113};
114
115} // namespace local_client
116} // namespace internal
117} // namespace client
118} // namespace qt
119} // namespace storage
120} // namespace unity
1210
=== removed file 'include/unity/storage/qt/client/internal/local_client/FileImpl.h'
--- include/unity/storage/qt/client/internal/local_client/FileImpl.h 2016-07-14 00:17:14 +0000
+++ include/unity/storage/qt/client/internal/local_client/FileImpl.h 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/FileBase.h>
22#include <unity/storage/qt/client/internal/local_client/ItemImpl.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace qt
29{
30namespace client
31{
32namespace internal
33{
34namespace local_client
35{
36
37class FileImpl : public virtual FileBase, public virtual ItemImpl
38{
39public:
40 FileImpl(QString const& identity);
41
42 virtual QString name() const override;
43 virtual int64_t size() const override;
44 virtual QFuture<std::shared_ptr<Uploader>> create_uploader(ConflictPolicy policy, int64_t size) override;
45 virtual QFuture<std::shared_ptr<Downloader>> create_downloader() override;
46
47 static std::shared_ptr<File> make_file(QString const& identity, std::weak_ptr<Root> root);
48};
49
50} // namespace local_client
51} // namespace internal
52} // namespace client
53} // namespace qt
54} // namespace storage
55} // namespace unity
560
=== removed file 'include/unity/storage/qt/client/internal/local_client/FolderImpl.h'
--- include/unity/storage/qt/client/internal/local_client/FolderImpl.h 2016-07-25 03:45:41 +0000
+++ include/unity/storage/qt/client/internal/local_client/FolderImpl.h 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/FolderBase.h>
22#include <unity/storage/qt/client/internal/local_client/ItemImpl.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace qt
29{
30namespace client
31{
32namespace internal
33{
34namespace local_client
35{
36
37class FolderImpl : public virtual FolderBase, public virtual ItemImpl
38{
39public:
40 FolderImpl(QString const& identity);
41 FolderImpl(QString const& identity, ItemType type);
42
43 virtual QString name() const override;
44 QFuture<QVector<std::shared_ptr<Item>>> list() const override;
45 QFuture<QVector<std::shared_ptr<Item>>> lookup(QString const& name) const override;
46 QFuture<std::shared_ptr<Folder>> create_folder(QString const& name) override;
47 QFuture<std::shared_ptr<Uploader>> create_file(QString const& name, int64_t size) override;
48
49 static std::shared_ptr<Folder> make_folder(QString const& identity, std::weak_ptr<Root> root);
50};
51
52} // namespace local_client
53} // namespace internal
54} // namespace client
55} // namespace qt
56} // namespace storage
57} // namespace unity
580
=== removed file 'include/unity/storage/qt/client/internal/local_client/ItemImpl.h'
--- include/unity/storage/qt/client/internal/local_client/ItemImpl.h 2016-08-02 04:29:06 +0000
+++ include/unity/storage/qt/client/internal/local_client/ItemImpl.h 1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/common.h>
22#include <unity/storage/qt/client/Exceptions.h>
23#include <unity/storage/qt/client/internal/ItemBase.h>
24#include <unity/storage/qt/client/internal/local_client/boost_filesystem.h>
25
26#include <mutex>
27
28namespace unity
29{
30namespace storage
31{
32namespace qt
33{
34namespace client
35{
36namespace internal
37{
38
39class MetadataImpl;
40
41namespace local_client
42{
43
44class ItemImpl : public virtual ItemBase
45{
46public:
47 ItemImpl(QString const& identity, ItemType type);
48 virtual ~ItemImpl();
49
50 virtual QString etag() const override;
51 virtual QVariantMap metadata() const override;
52 virtual QDateTime last_modified_time() const override;
53 virtual QFuture<std::shared_ptr<Item>> copy(std::shared_ptr<Folder> const& new_parent, QString const& new_name) override;
54 virtual QFuture<std::shared_ptr<Item>> move(std::shared_ptr<Folder> const& new_parent, QString const& new_name) override;
55 virtual QFuture<QVector<std::shared_ptr<Folder>>> parents() const override;
56 virtual QVector<QString> parent_ids() const override;
57 virtual QFuture<void> delete_item() override;
58
59 virtual QDateTime creation_time() const override;
60 virtual MetadataMap native_metadata() const override;
61
62 virtual bool equal_to(ItemBase const& other) const noexcept override;
63
64 void set_timestamps() noexcept;
65 bool has_conflict() const noexcept;
66
67protected:
68 static boost::filesystem::path sanitize(QString const& name, QString const& method);
69 static bool is_reserved_path(boost::filesystem::path const& path) noexcept;
70
71 QString name_;
72 QString etag_;
73 QDateTime modified_time_;
74 QVariantMap metadata_;
75 std::recursive_mutex mutable mutex_;
76
77private:
78 static void copy_recursively(boost::filesystem::path const& source, boost::filesystem::path const& target);
79};
80
81} // namespace local_client
82} // namespace internal
83} // namespace client
84} // namespace qt
85} // namespace storage
86} // namespace unity
870
=== removed file 'include/unity/storage/qt/client/internal/local_client/RootImpl.h'
--- include/unity/storage/qt/client/internal/local_client/RootImpl.h 2016-07-12 02:22:05 +0000
+++ include/unity/storage/qt/client/internal/local_client/RootImpl.h 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/RootBase.h>
22#include <unity/storage/qt/client/internal/local_client/FolderImpl.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace qt
29{
30namespace client
31{
32namespace internal
33{
34namespace local_client
35{
36
37class RootImpl : public virtual RootBase, public virtual FolderImpl
38{
39public:
40 RootImpl(QString const& identity, std::weak_ptr<Account> const& account);
41
42 virtual QString name() const override;
43 virtual QFuture<QVector<std::shared_ptr<Folder>>> parents() const override;
44 virtual QVector<QString> parent_ids() const override;
45 virtual QFuture<void> delete_item() override;
46
47 virtual QFuture<int64_t> free_space_bytes() const override;
48 virtual QFuture<int64_t> used_space_bytes() const override;
49 virtual QFuture<Item::SPtr> get(QString native_identity) const override;
50
51 static std::shared_ptr<Root> make_root(QString const& identity, std::weak_ptr<Account> const& account);
52};
53
54} // namespace local_client
55} // namespace internal
56} // namespace client
57} // namespace qt
58} // namespace storage
59} // namespace unity
600
=== removed file 'include/unity/storage/qt/client/internal/local_client/RuntimeImpl.h'
--- include/unity/storage/qt/client/internal/local_client/RuntimeImpl.h 2016-08-11 23:55:40 +0000
+++ include/unity/storage/qt/client/internal/local_client/RuntimeImpl.h 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/RuntimeBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31namespace internal
32{
33namespace local_client
34{
35
36class RuntimeImpl : public virtual RuntimeBase
37{
38public:
39 RuntimeImpl();
40 virtual ~RuntimeImpl();
41
42 virtual void shutdown() override;
43 virtual QFuture<QVector<std::shared_ptr<Account>>> accounts() override;
44 virtual std::shared_ptr<Account> make_test_account(QString const& bus_name,
45 QString const& object_path) override;
46};
47
48} // namespace local_client
49} // namespace internal
50} // namespace client
51} // namespace qt
52} // namespace storage
53} // namespace unity
540
=== removed file 'include/unity/storage/qt/client/internal/local_client/UploaderImpl.h'
--- include/unity/storage/qt/client/internal/local_client/UploaderImpl.h 2016-07-29 05:56:42 +0000
+++ include/unity/storage/qt/client/internal/local_client/UploaderImpl.h 1970-01-01 00:00:00 +0000
@@ -1,141 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/UploaderBase.h>
22
23#include <QFile>
24#include <QFutureInterface>
25#include <QThread>
26#include <unity/util/ResourcePtr.h>
27
28class QLocalSocket;
29
30namespace unity
31{
32namespace storage
33{
34namespace qt
35{
36namespace client
37{
38
39class File;
40class Root;
41
42namespace internal
43{
44namespace local_client
45{
46
47class UploadWorker : public QObject
48{
49 Q_OBJECT
50
51public:
52 UploadWorker(int read_fd,
53 std::weak_ptr<File> file,
54 int64_t size,
55 QString const& path,
56 ConflictPolicy policy,
57 std::weak_ptr<Root> root,
58 QFutureInterface<std::shared_ptr<File>>& qf,
59 QFutureInterface<void>& worker_initialized);
60 virtual ~UploadWorker();
61
62 void start_uploading() noexcept;
63
64public Q_SLOTS:
65 void do_finish();
66 void do_cancel();
67
68private Q_SLOTS:
69 void on_bytes_ready();
70 void on_read_channel_finished();
71
72private:
73 void read_and_write_chunk();
74 void finalize();
75 void handle_error(QString const& msg, int error_code);
76
77 enum State { in_progress, finalized, cancelled, error };
78
79 State state_ = in_progress;
80 int read_fd_;
81 std::shared_ptr<QLocalSocket> read_socket_;
82 std::weak_ptr<File> file_;
83 int64_t size_;
84 int64_t bytes_read_;
85 QString path_;
86 std::weak_ptr<Root> root_;
87 std::unique_ptr<QFile> output_file_;
88 unity::util::ResourcePtr<int, std::function<void(int)>> tmp_fd_;
89 ConflictPolicy policy_;
90 QFutureInterface<std::shared_ptr<File>>& qf_;
91 QFutureInterface<void>& worker_initialized_;
92 QString error_msg_;
93 int error_code_ = 0;
94 bool use_linkat_ = true;
95};
96
97class UploadThread : public QThread
98{
99 Q_OBJECT
100
101public:
102 UploadThread(UploadWorker* worker);
103 virtual void run() override;
104
105private:
106 UploadWorker* worker_;
107};
108
109class UploaderImpl : public UploaderBase
110{
111 Q_OBJECT
112
113public:
114 UploaderImpl(std::weak_ptr<File> file,
115 int64_t size,
116 QString const& path,
117 ConflictPolicy policy,
118 std::weak_ptr<Root> root);
119 virtual ~UploaderImpl();
120
121 virtual std::shared_ptr<QLocalSocket> socket() const override;
122 virtual QFuture<std::shared_ptr<File>> finish_upload() override;
123 virtual QFuture<void> cancel() noexcept override;
124
125Q_SIGNALS:
126 void do_finish();
127 void do_cancel();
128
129private:
130 std::shared_ptr<QLocalSocket> write_socket_;
131 QFutureInterface<std::shared_ptr<File>> qf_;
132 std::unique_ptr<UploadThread> upload_thread_;
133 std::unique_ptr<UploadWorker> worker_;
134};
135
136} // namespace local_client
137} // namespace internal
138} // namespace client
139} // namespace qt
140} // namespace storage
141} // namespace unity
1420
=== removed file 'include/unity/storage/qt/client/internal/local_client/boost_filesystem.h'
--- include/unity/storage/qt/client/internal/local_client/boost_filesystem.h 2016-07-27 02:19:17 +0000
+++ include/unity/storage/qt/client/internal/local_client/boost_filesystem.h 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <boost/version.hpp>
22
23#if BOOST_VERSION < 105600
24 #define BOOST_NO_CXX11_SCOPED_ENUMS
25 #include <boost/filesystem.hpp>
26 #undef BOOST_NO_CXX11_SCOPED_ENUMS
27#else
28 #include <boost/filesystem.hpp>
29#endif
300
=== removed file 'include/unity/storage/qt/client/internal/local_client/storage_exception.h'
--- include/unity/storage/qt/client/internal/local_client/storage_exception.h 2016-08-02 05:27:00 +0000
+++ include/unity/storage/qt/client/internal/local_client/storage_exception.h 1970-01-01 00:00:00 +0000
@@ -1,94 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/Exceptions.h>
22#include <unity/storage/qt/client/internal/local_client/boost_filesystem.h>
23
24#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
26#pragma GCC diagnostic ignored "-Wcast-align"
27#include <QFuture>
28#pragma GCC diagnostic pop
29#include <QFutureInterface>
30
31class QString;
32
33namespace unity
34{
35namespace storage
36{
37namespace qt
38{
39namespace client
40{
41namespace internal
42{
43namespace local_client
44{
45
46void throw_storage_exception(QString const& method,
47 std::exception_ptr ep) __attribute__ ((noreturn));
48
49void throw_storage_exception(QString const& method,
50 std::exception_ptr ep,
51 QString const& key) __attribute__ ((noreturn));
52
53template<typename T>
54QFuture<T> make_exceptional_future(QString const& method, std::exception_ptr ep)
55{
56 try
57 {
58 throw_storage_exception(method, ep);
59 }
60 catch (StorageException const& e)
61 {
62 QFutureInterface<T> qf;
63 qf.reportException(e);
64 qf.reportFinished();
65 return qf.future();
66 }
67 abort(); // Impossible. // LCOV_EXCL_LINE
68}
69
70template<typename T>
71QFuture<T> make_exceptional_future(QString const& method,
72 std::exception_ptr ep,
73 QString const& key)
74{
75 try
76 {
77 throw_storage_exception(method, ep, key);
78 }
79 catch (StorageException const& e)
80 {
81 QFutureInterface<T> qf;
82 qf.reportException(e);
83 qf.reportFinished();
84 return qf.future();
85 }
86 abort(); // Impossible. // LCOV_EXCL_LINE
87}
88
89} // namespace local_client
90} // namespace internal
91} // namespace client
92} // namespace qt
93} // namespace storage
94} // namespace unity
950
=== removed file 'include/unity/storage/qt/client/internal/local_client/tmpfile_prefix.h'
--- include/unity/storage/qt/client/internal/local_client/tmpfile_prefix.h 2016-08-02 05:27:00 +0000
+++ include/unity/storage/qt/client/internal/local_client/tmpfile_prefix.h 1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#define TMPFILE_PREFIX ".storage-framework-"
220
=== removed file 'include/unity/storage/qt/client/internal/make_future.h'
--- include/unity/storage/qt/client/internal/make_future.h 2016-08-26 04:45:56 +0000
+++ include/unity/storage/qt/client/internal/make_future.h 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
23#pragma GCC diagnostic ignored "-Wcast-align"
24#include <QFuture>
25#pragma GCC diagnostic pop
26#include <QFutureInterface>
27
28namespace unity
29{
30namespace storage
31{
32namespace qt
33{
34namespace client
35{
36namespace internal
37{
38
39template<typename T>
40QFuture<T>
41__attribute__ ((warn_unused_result))
42make_ready_future(T const& val)
43{
44 QFutureInterface<T> qf;
45 qf.reportResult(val);
46 qf.reportFinished();
47 return qf.future();
48}
49
50template<typename T = void>
51QFuture<T>
52__attribute__ ((warn_unused_result))
53make_ready_future()
54{
55 QFutureInterface<void> qf;
56 return make_ready_future(qf);
57}
58
59template<typename E>
60QFuture<void>
61__attribute__
62((warn_unused_result)) make_exceptional_future(E const& ex)
63{
64 QFutureInterface<void> qf;
65 qf.reportException(ex);
66 qf.reportFinished();
67 return qf.future();
68}
69
70template<typename T, typename E>
71QFuture<T>
72__attribute__ ((warn_unused_result))
73make_exceptional_future(E const& ex)
74{
75 QFutureInterface<T> qf;
76 qf.reportException(ex);
77 qf.reportFinished();
78 return qf.future();
79}
80
81} // namespace internal
82} // namespace client
83} // namespace qt
84} // namespace storage
85} // namespace unity
860
=== removed directory 'include/unity/storage/qt/client/internal/remote_client'
=== removed file 'include/unity/storage/qt/client/internal/remote_client/AccountImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/AccountImpl.h 2016-08-11 07:34:49 +0000
+++ include/unity/storage/qt/client/internal/remote_client/AccountImpl.h 1970-01-01 00:00:00 +0000
@@ -1,68 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/AccountBase.h>
22
23class ProviderInterface;
24
25namespace unity
26{
27namespace storage
28{
29namespace qt
30{
31namespace client
32{
33namespace internal
34{
35namespace remote_client
36{
37
38class AccountImpl : public QObject, public virtual AccountBase
39{
40public:
41 AccountImpl(std::weak_ptr<Runtime> const& runtime,
42 QString const& bus_name,
43 QString const& object_path,
44 QString const& owner,
45 QString const& owner_id,
46 QString const& description);
47
48 virtual QString owner() const override;
49 virtual QString owner_id() const override;
50 virtual QString description() const override;
51 virtual QFuture<QVector<std::shared_ptr<Root>>> roots() override;
52
53 std::shared_ptr<ProviderInterface> provider() const noexcept;
54
55private:
56 QString owner_;
57 QString owner_id_;
58 QString description_;
59 QVector<std::shared_ptr<Root>> roots_;
60 std::shared_ptr<ProviderInterface> provider_;
61};
62
63} // namespace remote_client
64} // namespace internal
65} // namespace client
66} // namespace qt
67} // namespace storage
68} // namespace unity
690
=== removed file 'include/unity/storage/qt/client/internal/remote_client/DownloaderImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/DownloaderImpl.h 2016-07-15 03:34:00 +0000
+++ include/unity/storage/qt/client/internal/remote_client/DownloaderImpl.h 1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/DownloaderBase.h>
22
23#include <QDBusUnixFileDescriptor>
24
25class ProviderInterface;
26class QLocalSocket;
27
28namespace unity
29{
30namespace storage
31{
32namespace qt
33{
34namespace client
35{
36
37class Downloader;
38
39namespace internal
40{
41namespace remote_client
42{
43
44class DownloaderImpl : public DownloaderBase
45{
46public:
47 DownloaderImpl(QString const& download_id,
48 QDBusUnixFileDescriptor fd,
49 std::shared_ptr<File> const& file,
50 std::shared_ptr<ProviderInterface> const& provider);
51 virtual ~DownloaderImpl();
52
53 virtual std::shared_ptr<File> file() const override;
54 virtual std::shared_ptr<QLocalSocket> socket() const override;
55 virtual QFuture<void> finish_download() override;
56 virtual QFuture<void> cancel() noexcept override;
57
58 static std::shared_ptr<Downloader> make_downloader(QString const& upload_id,
59 QDBusUnixFileDescriptor fd,
60 std::shared_ptr<File> const& file,
61 std::shared_ptr<ProviderInterface> const& provider);
62
63private:
64 QString download_id_;
65 QDBusUnixFileDescriptor fd_;
66 std::shared_ptr<File> file_;
67 std::shared_ptr<ProviderInterface> provider_;
68 std::shared_ptr<QLocalSocket> read_socket_;
69};
70
71} // namespace remote_client
72} // namespace internal
73} // namespace client
74} // namespace qt
75} // namespace storage
76} // namespace unity
770
=== removed file 'include/unity/storage/qt/client/internal/remote_client/FileImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/FileImpl.h 2016-07-21 12:48:40 +0000
+++ include/unity/storage/qt/client/internal/remote_client/FileImpl.h 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/FileBase.h>
22#include <unity/storage/qt/client/internal/remote_client/ItemImpl.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace internal
29{
30
31struct ItemMetadata;
32
33} // namespace internal
34
35namespace qt
36{
37namespace client
38{
39namespace internal
40{
41namespace remote_client
42{
43
44class FileImpl : public virtual FileBase, public virtual ItemImpl
45{
46public:
47 FileImpl(storage::internal::ItemMetadata const& md);
48
49 virtual int64_t size() const override;
50 virtual QFuture<std::shared_ptr<Uploader>> create_uploader(ConflictPolicy policy, int64_t size) override;
51 virtual QFuture<std::shared_ptr<Downloader>> create_downloader() override;
52
53 static std::shared_ptr<File> make_file(storage::internal::ItemMetadata const& md, std::weak_ptr<Root> root);
54};
55
56} // namespace remote_client
57} // namespace internal
58} // namespace client
59} // namespace qt
60} // namespace storage
61} // namespace unity
620
=== removed file 'include/unity/storage/qt/client/internal/remote_client/FolderImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/FolderImpl.h 2016-07-14 00:17:14 +0000
+++ include/unity/storage/qt/client/internal/remote_client/FolderImpl.h 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/FolderBase.h>
22#include <unity/storage/qt/client/internal/remote_client/ItemImpl.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace qt
29{
30namespace client
31{
32namespace internal
33{
34namespace remote_client
35{
36
37class FolderImpl : public virtual FolderBase, public virtual ItemImpl
38{
39public:
40 FolderImpl(storage::internal::ItemMetadata const& md);
41 FolderImpl(storage::internal::ItemMetadata const& md, ItemType type);
42
43 QFuture<QVector<std::shared_ptr<Item>>> list() const override;
44 QFuture<QVector<std::shared_ptr<Item>>> lookup(QString const& name) const override;
45 QFuture<std::shared_ptr<Folder>> create_folder(QString const& name) override;
46 QFuture<std::shared_ptr<Uploader>> create_file(QString const& name, int64_t size) override;
47
48 static std::shared_ptr<Folder> make_folder(storage::internal::ItemMetadata const& md, std::weak_ptr<Root> root);
49};
50
51} // namespace remote_client
52} // namespace internal
53} // namespace client
54} // namespace qt
55} // namespace storage
56} // namespace unity
570
=== removed file 'include/unity/storage/qt/client/internal/remote_client/Handler.h'
--- include/unity/storage/qt/client/internal/remote_client/Handler.h 2016-08-26 04:45:56 +0000
+++ include/unity/storage/qt/client/internal/remote_client/Handler.h 1970-01-01 00:00:00 +0000
@@ -1,134 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/Exceptions.h>
22#include <unity/storage/qt/client/internal/make_future.h>
23#include <unity/storage/qt/client/internal/remote_client/dbusmarshal.h>
24#include <unity/storage/qt/client/internal/remote_client/HandlerBase.h>
25
26#include <QDBusPendingReply>
27
28#include <cassert>
29
30namespace unity
31{
32namespace storage
33{
34namespace qt
35{
36namespace client
37{
38namespace internal
39{
40namespace remote_client
41{
42
43template<typename T>
44class Handler : public HandlerBase
45{
46public:
47 template<typename ... DBusArgs>
48 Handler(QObject* parent,
49 QDBusPendingReply<DBusArgs...>& reply,
50 std::function<void(decltype(reply)&, QFutureInterface<T>&)> closure);
51
52 QFuture<T> future();
53
54private:
55 QFutureInterface<T> qf_;
56};
57
58// TODO: HACK: The reply argument really should be passed by const reference, which also
59// would make the explicit conversion of the call to QDBusPendingReply<QDBusArgs...>
60// unnecessary. But this doesn't work with gcc 4.9: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60420
61// Once we get rid of Vivid, this should be changed back to
62//
63// Handler<T>::Handler(QObject* parent,
64// QDBusPendingReply<DBusArgs...> const& reply,
65// std::function<void(decltype(reply) const&, QFutureInterface<T>&)> closure)
66
67template<typename T>
68template<typename ... DBusArgs>
69Handler<T>::Handler(QObject* parent,
70 QDBusPendingReply<DBusArgs...>& reply,
71 std::function<void(decltype(reply)&, QFutureInterface<T>&)> closure)
72 : HandlerBase(parent,
73 reply,
74 [this, closure](QDBusPendingCallWatcher& call)
75 {
76 if (call.isError())
77 {
78 try
79 {
80 auto ep = unmarshal_exception(call);
81 std::rethrow_exception(ep);
82 }
83 // We catch some exceptions that are "surprising" so we can log those.
84 catch (LocalCommsException const& e)
85 {
86 qCritical() << "provider exception:" << e.what();
87 qf_.reportException(e);
88 qf_.reportFinished();
89 }
90 catch (RemoteCommsException const& e)
91 {
92 qCritical() << "provider exception:" << e.what();
93 qf_.reportException(e);
94 qf_.reportFinished();
95 }
96 catch (ResourceException const& e)
97 {
98 qCritical() << "provider exception:" << e.what();
99 qf_.reportException(e);
100 qf_.reportFinished();
101 }
102 catch (StorageException const& e)
103 {
104 qf_.reportException(e);
105 qf_.reportFinished();
106 }
107 // LCOV_EXCL_START
108 catch (...)
109 {
110 abort(); // Impossible.
111 }
112 // LCOV_EXCL_STOP
113 return;
114 }
115 // TODO: See HACK above. Should just be closure(call, qf_);
116 QDBusPendingReply<DBusArgs...> r = call;
117 closure(r, qf_);
118 })
119{
120 qf_.reportStarted();
121}
122
123template<typename T>
124QFuture<T> Handler<T>::future()
125{
126 return qf_.future();
127}
128
129} // namespace remote_client
130} // namespace internal
131} // namespace client
132} // namespace qt
133} // namespace storage
134} // namespace unity
1350
=== removed file 'include/unity/storage/qt/client/internal/remote_client/HandlerBase.h'
--- include/unity/storage/qt/client/internal/remote_client/HandlerBase.h 2016-11-01 03:06:07 +0000
+++ include/unity/storage/qt/client/internal/remote_client/HandlerBase.h 1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wcast-align"
23#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
24#pragma GCC diagnostic ignored "-Wswitch-default"
25#include <QDBusPendingCallWatcher>
26#pragma GCC diagnostic pop
27#include <QObject>
28
29#include <functional>
30
31class QDBusPendingCall;
32
33namespace unity
34{
35namespace storage
36{
37namespace qt
38{
39namespace client
40{
41namespace internal
42{
43namespace remote_client
44{
45
46class HandlerBase : public QObject
47{
48 Q_OBJECT
49
50public:
51 // TODO: HACK: gcc 4.9 bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60420
52 // Once we get rid of Vivid, this should be changed back to
53 //
54 // HandlerBase(QObject* parent,
55 // QDBusPendingCall const& call,
56 // std::function<void(QDBusPendingCallWatcher const&)> const& closure);
57 HandlerBase(QObject* parent,
58 QDBusPendingCall& call,
59 std::function<void(QDBusPendingCallWatcher&)> const& closure);
60
61public Q_SLOTS:
62 void finished(QDBusPendingCallWatcher* call);
63
64protected:
65 QDBusPendingCallWatcher watcher_;
66
67private:
68 std::function<void(QDBusPendingCallWatcher&)> closure_;
69};
70
71} // namespace remote_client
72} // namespace internal
73} // namespace client
74} // namespace qt
75} // namespace storage
76} // namespace unity
770
=== removed file 'include/unity/storage/qt/client/internal/remote_client/ItemImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/ItemImpl.h 2016-08-02 04:29:06 +0000
+++ include/unity/storage/qt/client/internal/remote_client/ItemImpl.h 1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/internal/ItemMetadata.h>
22#include <unity/storage/qt/client/Exceptions.h>
23#include <unity/storage/qt/client/internal/ItemBase.h>
24
25#include <memory>
26
27class ProviderInterface;
28
29namespace unity
30{
31namespace storage
32{
33namespace qt
34{
35namespace client
36{
37namespace internal
38{
39namespace remote_client
40{
41
42class DeleteHandler;
43
44class ItemImpl : public virtual ItemBase, public virtual QObject
45{
46public:
47 ItemImpl(storage::internal::ItemMetadata const& md, ItemType type);
48
49 virtual QString name() const override;
50 virtual QString etag() const override;
51 virtual QVariantMap metadata() const override;
52 virtual QDateTime last_modified_time() const override;
53 virtual QFuture<std::shared_ptr<Item>> copy(std::shared_ptr<Folder> const& new_parent, QString const& new_name) override;
54 virtual QFuture<std::shared_ptr<Item>> move(std::shared_ptr<Folder> const& new_parent, QString const& new_name) override;
55 virtual QFuture<QVector<std::shared_ptr<Folder>>> parents() const override;
56 virtual QVector<QString> parent_ids() const override;
57 virtual QFuture<void> delete_item() override;
58
59 virtual QDateTime creation_time() const override;
60 virtual MetadataMap native_metadata() const override;
61
62 virtual bool equal_to(ItemBase const& other) const noexcept override;
63
64 std::shared_ptr<ProviderInterface> provider() const noexcept;
65
66 static std::shared_ptr<Item> make_item(storage::internal::ItemMetadata const& md, std::weak_ptr<Root> root);
67
68protected:
69 storage::internal::ItemMetadata md_;
70
71 friend class DeleteHandler;
72};
73
74} // namespace remote_client
75} // namespace internal
76} // namespace client
77} // namespace qt
78} // namespace storage
79} // namespace unity
800
=== removed file 'include/unity/storage/qt/client/internal/remote_client/RootImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/RootImpl.h 2016-07-13 04:19:12 +0000
+++ include/unity/storage/qt/client/internal/remote_client/RootImpl.h 1970-01-01 00:00:00 +0000
@@ -1,68 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/RootBase.h>
22#include <unity/storage/qt/client/internal/remote_client/FolderImpl.h>
23
24namespace unity
25{
26namespace storage
27{
28namespace internal
29{
30
31struct ItemMetadata;
32
33} // namespace internal
34
35namespace qt
36{
37namespace client
38{
39namespace internal
40{
41namespace remote_client
42{
43
44class RootImpl : public virtual RootBase, public virtual FolderImpl
45{
46public:
47 RootImpl(storage::internal::ItemMetadata const& md, std::weak_ptr<Account> const& account);
48
49 virtual QFuture<QVector<std::shared_ptr<Folder>>> parents() const override;
50 virtual QVector<QString> parent_ids() const override;
51 virtual QFuture<void> delete_item() override;
52
53 virtual QFuture<int64_t> free_space_bytes() const override;
54 virtual QFuture<int64_t> used_space_bytes() const override;
55 virtual QFuture<Item::SPtr> get(QString native_identity) const override;
56
57 static std::shared_ptr<Root> make_root(storage::internal::ItemMetadata const& md,
58 std::weak_ptr<Account> const& account);
59
60 friend class FolderImpl;
61};
62
63} // namespace remote_client
64} // namespace internal
65} // namespace client
66} // namespace qt
67} // namespace storage
68} // namespace unity
690
=== removed file 'include/unity/storage/qt/client/internal/remote_client/RuntimeImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/RuntimeImpl.h 2016-08-11 23:55:40 +0000
+++ include/unity/storage/qt/client/internal/remote_client/RuntimeImpl.h 1970-01-01 00:00:00 +0000
@@ -1,81 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/RuntimeBase.h>
22
23#include <OnlineAccounts/Manager>
24#include <QDBusConnection>
25#include <QTimer>
26
27namespace unity
28{
29namespace storage
30{
31namespace qt
32{
33namespace client
34{
35
36class Account;
37
38namespace internal
39{
40namespace remote_client
41{
42
43class RuntimeImpl : public RuntimeBase
44{
45 Q_OBJECT
46
47public:
48 RuntimeImpl(QDBusConnection const& bus);
49 virtual ~RuntimeImpl();
50
51 virtual void shutdown() override;
52 virtual QFuture<QVector<std::shared_ptr<Account>>> accounts() override;
53 virtual std::shared_ptr<Account> make_test_account(QString const& bus_name,
54 QString const& object_path) override;
55
56 QDBusConnection& connection();
57
58private Q_SLOTS:
59 virtual void manager_ready();
60 virtual void timeout();
61
62private:
63 std::shared_ptr<Account> make_account(QString const& bus_name,
64 QString const& object_path,
65 QString const& owner,
66 QString const& owner_id,
67 QString const& description);
68
69 QDBusConnection conn_;
70 std::unique_ptr<OnlineAccounts::Manager> manager_; // TODO: Hack until we can use the registry
71 QTimer timer_;
72 QVector<std::shared_ptr<Account>> accounts_;
73 QFutureInterface<QVector<std::shared_ptr<Account>>> qf_;
74};
75
76} // namespace remote_client
77} // namespace internal
78} // namespace client
79} // namespace qt
80} // namespace storage
81} // namespace unity
820
=== removed file 'include/unity/storage/qt/client/internal/remote_client/UploaderImpl.h'
--- include/unity/storage/qt/client/internal/remote_client/UploaderImpl.h 2016-08-25 23:12:45 +0000
+++ include/unity/storage/qt/client/internal/remote_client/UploaderImpl.h 1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <unity/storage/qt/client/internal/UploaderBase.h>
22
23#include <QDBusUnixFileDescriptor>
24
25class QLocalSocket;
26class ProviderInterface;
27
28namespace unity
29{
30namespace storage
31{
32namespace qt
33{
34namespace client
35{
36
37class Root;
38class Uploader;
39
40namespace internal
41{
42namespace remote_client
43{
44
45class UploaderImpl : public UploaderBase
46{
47public:
48 UploaderImpl(QString const& upload_id,
49 QDBusUnixFileDescriptor fd,
50 int64_t size,
51 QString const& old_etag,
52 std::weak_ptr<Root> root,
53 std::shared_ptr<ProviderInterface> const& provider);
54 ~UploaderImpl();
55
56 virtual std::shared_ptr<QLocalSocket> socket() const override;
57 virtual QFuture<std::shared_ptr<File>> finish_upload() override;
58 virtual QFuture<void> cancel() noexcept override;
59
60 static std::shared_ptr<Uploader> make_uploader(QString const& upload_id,
61 QDBusUnixFileDescriptor fd,
62 int64_t size,
63 QString const& old_etag,
64 std::weak_ptr<Root> root,
65 std::shared_ptr<ProviderInterface> const& provider);
66
67private:
68 enum State { uploading, finalized };
69
70 QString upload_id_;
71 QDBusUnixFileDescriptor fd_;
72 QString old_etag_;
73 std::shared_ptr<Root> root_;
74 std::shared_ptr<ProviderInterface> provider_;
75 std::shared_ptr<QLocalSocket> write_socket_;
76 State state_;
77};
78
79} // namespace remote_client
80} // namespace internal
81} // namespace client
82} // namespace qt
83} // namespace storage
84} // namespace unity
850
=== removed file 'include/unity/storage/qt/client/internal/remote_client/dbusmarshal.h'
--- include/unity/storage/qt/client/internal/remote_client/dbusmarshal.h 2016-08-11 06:53:25 +0000
+++ include/unity/storage/qt/client/internal/remote_client/dbusmarshal.h 1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <exception>
22
23class QDBusPendingCallWatcher;
24
25namespace unity
26{
27namespace storage
28{
29namespace qt
30{
31namespace client
32{
33namespace internal
34{
35namespace remote_client
36{
37
38std::exception_ptr unmarshal_exception(QDBusPendingCallWatcher const& call);
39
40} // namespace remote_client
41} // namespace internal
42} // client
43} // qt
44} // storage
45} // unity
460
=== removed file 'include/unity/storage/qt/client/internal/remote_client/validate.h'
--- include/unity/storage/qt/client/internal/remote_client/validate.h 2016-08-09 02:25:13 +0000
+++ include/unity/storage/qt/client/internal/remote_client/validate.h 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#pragma once
20
21#include <QString>
22
23namespace unity
24{
25namespace storage
26{
27
28namespace internal
29{
30
31class ItemMetadata;
32
33} // namespace internal
34
35namespace qt
36{
37namespace client
38{
39namespace internal
40{
41namespace remote_client
42{
43
44void validate(QString const& method, unity::storage::internal::ItemMetadata const& md);
45
46} // namespace remote_client
47} // namespace internal
48} // namespace client
49} // namespace qt
50} // namespace storage
51} // namespace unity
520
=== modified file 'plugins/Ubuntu/StorageFramework/CMakeLists.txt'
--- plugins/Ubuntu/StorageFramework/CMakeLists.txt 2016-09-29 11:37:05 +0000
+++ plugins/Ubuntu/StorageFramework/CMakeLists.txt 2017-04-06 08:34:29 +0000
@@ -9,7 +9,8 @@
9)9)
1010
11target_link_libraries(storage-framework-qml11target_link_libraries(storage-framework-qml
12 storage-framework-qt-client-v212 storage-framework-qt-client
13 Qt5::DBus
13 Qt5::Qml14 Qt5::Qml
14)15)
1516
1617
=== modified file 'src/internal/CMakeLists.txt'
--- src/internal/CMakeLists.txt 2016-11-09 03:26:49 +0000
+++ src/internal/CMakeLists.txt 2017-04-06 08:34:29 +0000
@@ -8,7 +8,6 @@
8 ${CMAKE_SOURCE_DIR}/include/unity/storage/internal/InactivityTimer.h8 ${CMAKE_SOURCE_DIR}/include/unity/storage/internal/InactivityTimer.h
9)9)
1010
11
12add_library(storage-framework-common-internal STATIC ${src})11add_library(storage-framework-common-internal STATIC ${src})
1312
14set_target_properties(storage-framework-common-internal PROPERTIES AUTOMOC TRUE)13set_target_properties(storage-framework-common-internal PROPERTIES AUTOMOC TRUE)
1514
=== modified file 'src/qt/CMakeLists.txt'
--- src/qt/CMakeLists.txt 2016-11-15 02:05:14 +0000
+++ src/qt/CMakeLists.txt 2017-04-06 08:34:29 +0000
@@ -1,5 +1,3 @@
1add_subdirectory(client)
2
3set_source_files_properties(${CMAKE_SOURCE_DIR}/data/provider.xml PROPERTIES1set_source_files_properties(${CMAKE_SOURCE_DIR}/data/provider.xml PROPERTIES
4 CLASSNAME ProviderInterface2 CLASSNAME ProviderInterface
5 INCLUDE unity/storage/internal/dbusmarshal.h3 INCLUDE unity/storage/internal/dbusmarshal.h
@@ -23,8 +21,8 @@
23 GENERATED TRUE21 GENERATED TRUE
24)22)
2523
26# Sources for remote client V2 library.24# Sources for client library.
27set(QT_CLIENT_LIB_V2_SRC25set(QT_CLIENT_LIB_SRC
28 Account.cpp26 Account.cpp
29 AccountsJob.cpp27 AccountsJob.cpp
30 Downloader.cpp28 Downloader.cpp
@@ -73,29 +71,29 @@
73 ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/internal/VoidJobImpl.h71 ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/internal/VoidJobImpl.h
74)72)
7573
76add_library(storage-framework-qt-client-v2 SHARED74add_library(storage-framework-qt-client SHARED
77 ${QT_CLIENT_LIB_V2_SRC}75 ${QT_CLIENT_LIB_SRC}
78 ${generated_files}76 ${generated_files}
79)77)
80target_include_directories(storage-framework-qt-client-v2 PRIVATE78target_include_directories(storage-framework-qt-client PRIVATE
81 ${Qt5DBus_INCLUDE_DIRS}79 ${Qt5DBus_INCLUDE_DIRS}
82 ${Qt5Network_INCLUDE_DIRS}80 ${Qt5Network_INCLUDE_DIRS}
83)81)
84set_target_properties(storage-framework-qt-client-v2 PROPERTIES82set_target_properties(storage-framework-qt-client PROPERTIES
85 AUTOMOC TRUE83 AUTOMOC TRUE
86 LINK_FLAGS "-Wl,--no-undefined"84 LINK_FLAGS "-Wl,--no-undefined"
87 OUTPUT_NAME "storage-framework-qt-client-${SF_CLIENT_API_VERSION}"85 OUTPUT_NAME "storage-framework-qt-client-${SF_CLIENT_API_VERSION}"
88 SOVERSION ${SF_CLIENT_SOVERSION}86 SOVERSION ${SF_CLIENT_SOVERSION}
89 VERSION ${SF_CLIENT_LIBVERSION}87 VERSION ${SF_CLIENT_LIBVERSION}
90)88)
91target_link_libraries(storage-framework-qt-client-v289target_link_libraries(storage-framework-qt-client
92 storage-framework-common-internal90 storage-framework-common-internal
93 Qt5::Core91 Qt5::Core
94 Qt5::DBus92 Qt5::DBus
95 Qt5::Network93 Qt5::Network
96)94)
97install(95install(
98 TARGETS storage-framework-qt-client-v296 TARGETS storage-framework-qt-client
99 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}97 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
100)98)
10199
102100
=== removed directory 'src/qt/client'
=== removed file 'src/qt/client/Account.cpp'
--- src/qt/client/Account.cpp 2016-07-20 06:58:30 +0000
+++ src/qt/client/Account.cpp 1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Account.h>
20
21#include <unity/storage/qt/client/internal/AccountBase.h>
22
23#include <cassert>
24
25using namespace std;
26
27namespace unity
28{
29namespace storage
30{
31namespace qt
32{
33namespace client
34{
35
36Account::Account(internal::AccountBase* p)
37 : p_(p)
38{
39 assert(p != nullptr);
40}
41
42Account::~Account() = default;
43
44shared_ptr<Runtime> Account::runtime() const
45{
46 return p_->runtime();
47}
48
49QString Account::owner() const
50{
51 return p_->owner();
52}
53
54QString Account::owner_id() const
55{
56 return p_->owner_id();
57}
58
59QString Account::description() const
60{
61 return p_->description();
62}
63
64QFuture<QVector<std::shared_ptr<Root>>> Account::roots() const
65{
66 return p_->roots();
67}
68
69} // namespace client
70} // namespace qt
71} // namespace storage
72} // namespace unity
730
=== removed file 'src/qt/client/CMakeLists.txt'
--- src/qt/client/CMakeLists.txt 2016-10-12 08:08:48 +0000
+++ src/qt/client/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,131 +0,0 @@
1# Create an OBJECT library for the files that are used by both
2# local and remote client libraries, so we don't compile them twice.
3
4add_library(qt-client-lib-common OBJECT
5 Account.cpp
6 Downloader.cpp
7 Exceptions.cpp
8 File.cpp
9 Folder.cpp
10 Item.cpp
11 Root.cpp
12 Runtime.cpp
13 Uploader.cpp
14 internal/AccountBase.cpp
15 internal/DownloaderBase.cpp
16 internal/FileBase.cpp
17 internal/FolderBase.cpp
18 internal/ItemBase.cpp
19 internal/RootBase.cpp
20 internal/RuntimeBase.cpp
21 internal/UploaderBase.cpp
22 ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/DownloaderBase.h
23 ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/UploaderBase.h
24)
25target_include_directories(qt-client-lib-common PRIVATE
26 ${Qt5DBus_INCLUDE_DIRS}
27 ${Qt5Network_INCLUDE_DIRS}
28)
29set_target_properties(qt-client-lib-common PROPERTIES
30 AUTOMOC TRUE
31 POSITION_INDEPENDENT_CODE TRUE
32)
33
34# We build both local and remote client libraries here instead
35# of creating OBJECT libraries for them because cmake 3.0.2 (which
36# is in the Vivid overlay) cannot handle .moc files in OBJECT libraries.
37
38# Descend into the child directories first. The CMakeLists.txt files
39# there set QT_CLIENT_LIB_LOCAL_SRC and QT_CLIENT_LIB_REMOTE_SRC.
40add_subdirectory(internal)
41
42# Build the local loopback client library
43add_library(storage-framework-qt-local-client SHARED
44 $<TARGET_OBJECTS:qt-client-lib-common>
45 ${QT_CLIENT_LIB_LOCAL_SRC}
46)
47target_include_directories(storage-framework-qt-local-client PRIVATE
48 ${GLIB_DEPS_INCLUDE_DIRS}
49)
50set_target_properties(storage-framework-qt-local-client PROPERTIES
51 AUTOMOC TRUE
52 LINK_FLAGS "-Wl,--no-undefined"
53 OUTPUT_NAME "storage-framework-qt-local-client-1"
54 SOVERSION 0
55 VERSION 0.0.1
56)
57target_link_libraries(storage-framework-qt-local-client
58 storage-framework-common-internal
59 Qt5::Concurrent
60 Qt5::Core
61 Qt5::DBus
62 Qt5::Network
63 ${Boost_LIBRARIES}
64 ${GLIB_DEPS_LIBRARIES}
65)
66install(
67 TARGETS storage-framework-qt-local-client
68 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
69)
70
71configure_file(
72 storage-framework-qt-local-client.pc.in
73 storage-framework-qt-local-client-1.pc
74)
75install(
76 FILES ${CMAKE_CURRENT_BINARY_DIR}/storage-framework-qt-local-client-1.pc
77 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
78)
79
80# Build the remote client library
81set_source_files_properties(${CMAKE_SOURCE_DIR}/data/provider.xml PROPERTIES
82 CLASSNAME ProviderInterface
83 INCLUDE unity/storage/internal/dbusmarshal.h
84)
85
86qt5_add_dbus_interface(generated_files
87 ${CMAKE_SOURCE_DIR}/data/provider.xml
88 ProviderInterface
89)
90set_source_files_properties(${generated_files} PROPERTIES
91 COMPILE_FLAGS "-Wno-ctor-dtor-privacy -Wno-missing-field-initializers"
92 GENERATED TRUE
93)
94
95add_library(storage-framework-qt-client SHARED
96 $<TARGET_OBJECTS:qt-client-lib-common>
97 ${QT_CLIENT_LIB_REMOTE_SRC}
98 ${generated_files}
99)
100target_include_directories(storage-framework-qt-client PRIVATE
101 ${GLIB_DEPS_INCLUDE_DIRS}
102 ${ONLINEACCOUNTS_DEPS_INCLUDE_DIRS}
103)
104set_target_properties(storage-framework-qt-client PROPERTIES
105 AUTOMOC TRUE
106 LINK_FLAGS "-Wl,--no-undefined"
107 OUTPUT_NAME "storage-framework-qt-client-1"
108 SOVERSION 0
109 VERSION 0.0.1
110)
111target_link_libraries(storage-framework-qt-client
112 storage-framework-common-internal
113 Qt5::Concurrent
114 Qt5::Core
115 Qt5::DBus
116 Qt5::Network
117 ${ONLINEACCOUNTS_DEPS_LDFLAGS}
118)
119install(
120 TARGETS storage-framework-qt-client
121 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
122)
123
124configure_file(
125 storage-framework-qt-client-1.pc.in
126 storage-framework-qt-client-1.pc
127)
128install(
129 FILES ${CMAKE_CURRENT_BINARY_DIR}/storage-framework-qt-client-1.pc
130 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
131)
1320
=== removed file 'src/qt/client/Downloader.cpp'
--- src/qt/client/Downloader.cpp 2016-07-12 02:22:05 +0000
+++ src/qt/client/Downloader.cpp 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Downloader.h>
20
21#include <unity/storage/qt/client/internal/DownloaderBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32Downloader::Downloader(internal::DownloaderBase* p)
33 : p_(p)
34{
35}
36
37Downloader::~Downloader() = default;
38
39std::shared_ptr<File> Downloader::file() const
40{
41 return p_->file();
42}
43
44std::shared_ptr<QLocalSocket> Downloader::socket() const
45{
46 return p_->socket();
47}
48
49QFuture<void> Downloader::finish_download()
50{
51 return p_->finish_download();
52}
53
54QFuture<void> Downloader::cancel()
55{
56 return p_->cancel();
57}
58
59} // namespace client
60} // namespace qt
61} // namespace storage
62} // namespace unity
630
=== removed file 'src/qt/client/Exceptions.cpp'
--- src/qt/client/Exceptions.cpp 2016-08-05 05:37:23 +0000
+++ src/qt/client/Exceptions.cpp 1970-01-01 00:00:00 +0000
@@ -1,304 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Exceptions.h>
20
21using namespace std;
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32StorageException::StorageException(char const* exception_name, QString const& error_message)
33 : what_string_(string(exception_name) + ": " + error_message.toStdString())
34 , error_message_(error_message)
35{
36}
37
38StorageException::~StorageException() = default;
39
40char const* StorageException::what() const noexcept
41{
42 return what_string_.c_str();
43}
44
45QString StorageException::error_message() const
46{
47 return error_message_;
48}
49
50LocalCommsException::LocalCommsException(QString const& error_message)
51 : StorageException("LocalCommsException", error_message)
52{
53}
54
55LocalCommsException::~LocalCommsException() = default;
56
57LocalCommsException* LocalCommsException::clone() const
58{
59 return new LocalCommsException(*this);
60}
61
62void LocalCommsException::raise() const
63{
64 throw *this;
65}
66
67RemoteCommsException::RemoteCommsException(QString const& error_message)
68 : StorageException("RemoteCommsException", error_message)
69{
70}
71
72RemoteCommsException::~RemoteCommsException() = default;
73
74RemoteCommsException* RemoteCommsException::clone() const
75{
76 return new RemoteCommsException(*this);
77}
78
79void RemoteCommsException::raise() const
80{
81 throw *this;
82}
83
84DeletedException::DeletedException(QString const& error_message, QString const& identity)
85 : StorageException("DeletedException", error_message)
86 , identity_(identity)
87{
88}
89
90DeletedException::~DeletedException() = default;
91
92DeletedException* DeletedException::clone() const
93{
94 return new DeletedException(*this);
95}
96
97void DeletedException::raise() const
98{
99 throw *this;
100}
101
102QString DeletedException::native_identity() const
103{
104 return identity_;
105}
106
107RuntimeDestroyedException::RuntimeDestroyedException(QString const& method)
108 : StorageException("RuntimeDestroyedException", method + ": runtime was destroyed previously")
109{
110}
111
112RuntimeDestroyedException::~RuntimeDestroyedException() = default;
113
114RuntimeDestroyedException* RuntimeDestroyedException::clone() const
115{
116 return new RuntimeDestroyedException(*this);
117}
118
119void RuntimeDestroyedException::raise() const
120{
121 throw *this;
122}
123
124NotExistsException::NotExistsException(QString const& error_message, QString const& key)
125 : StorageException("NotExistsException", error_message)
126 , key_(key)
127{
128}
129
130NotExistsException::~NotExistsException() = default;
131
132NotExistsException* NotExistsException::clone() const
133{
134 return new NotExistsException(*this);
135}
136
137void NotExistsException::raise() const
138{
139 throw *this;
140}
141
142QString NotExistsException::key() const
143{
144 return key_;
145}
146
147ExistsException::ExistsException(QString const& error_message, QString const& identity, QString const& name)
148 : StorageException("ExistsException", error_message)
149 , identity_(identity)
150 , name_(name)
151{
152}
153
154ExistsException::~ExistsException() = default;
155
156ExistsException* ExistsException::clone() const
157{
158 return new ExistsException(*this);
159}
160
161void ExistsException::raise() const
162{
163 throw *this;
164}
165
166QString ExistsException::native_identity() const
167{
168 return identity_;
169}
170
171QString ExistsException::name() const
172{
173 return name_;
174}
175
176ConflictException::ConflictException(QString const& error_message)
177 : StorageException("ConflictException", error_message)
178{
179}
180
181ConflictException::~ConflictException() = default;
182
183ConflictException* ConflictException::clone() const
184{
185 return new ConflictException(*this);
186}
187
188void ConflictException::raise() const
189{
190 throw *this;
191}
192
193PermissionException::PermissionException(QString const& error_message)
194 : StorageException("PermissionException", error_message)
195{
196}
197
198PermissionException::~PermissionException() = default;
199
200PermissionException* PermissionException::clone() const
201{
202 return new PermissionException(*this);
203}
204
205void PermissionException::raise() const
206{
207 throw *this;
208}
209
210QuotaException::QuotaException(QString const& error_message)
211 : StorageException("QuotaException", error_message)
212{
213}
214
215QuotaException::~QuotaException() = default;
216
217QuotaException* QuotaException::clone() const
218{
219 return new QuotaException(*this);
220}
221
222void QuotaException::raise() const
223{
224 throw *this;
225}
226
227CancelledException::CancelledException(QString const& error_message)
228 : StorageException("CancelledException", error_message)
229{
230}
231
232CancelledException::~CancelledException() = default;
233
234CancelledException* CancelledException::clone() const
235{
236 return new CancelledException(*this);
237}
238
239void CancelledException::raise() const
240{
241 throw *this;
242}
243
244LogicException::LogicException(QString const& error_message)
245 : StorageException("LogicException", error_message)
246{
247}
248
249LogicException::~LogicException() = default;
250
251LogicException* LogicException::clone() const
252{
253 return new LogicException(*this);
254}
255
256void LogicException::raise() const
257{
258 throw *this;
259}
260
261InvalidArgumentException::InvalidArgumentException(QString const& error_message)
262 : StorageException("InvalidArgumentException", error_message)
263{
264}
265
266InvalidArgumentException::~InvalidArgumentException() = default;
267
268InvalidArgumentException* InvalidArgumentException::clone() const
269{
270 return new InvalidArgumentException(*this);
271}
272
273void InvalidArgumentException::raise() const
274{
275 throw *this;
276}
277
278ResourceException::ResourceException(QString const& error_message, int error_code)
279 : StorageException("ResourceException", error_message)
280 , error_code_(error_code)
281{
282}
283
284ResourceException::~ResourceException() = default;
285
286ResourceException* ResourceException::clone() const
287{
288 return new ResourceException(*this);
289}
290
291void ResourceException::raise() const
292{
293 throw *this;
294}
295
296int ResourceException::error_code() const noexcept
297{
298 return error_code_;
299}
300
301} // namespace client
302} // namespace qt
303} // namespace storage
304} // namespace unity
3050
=== removed file 'src/qt/client/File.cpp'
--- src/qt/client/File.cpp 2016-07-14 00:17:14 +0000
+++ src/qt/client/File.cpp 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/File.h>
20
21#include <unity/storage/qt/client/internal/FileBase.h>
22
23using namespace std;
24
25namespace unity
26{
27namespace storage
28{
29namespace qt
30{
31namespace client
32{
33
34using namespace internal;
35
36File::File(FileBase* p)
37 : Item(p)
38{
39}
40
41File::~File() = default;
42
43int64_t File::size() const
44{
45 return dynamic_cast<FileBase*>(p_.get())->size();
46}
47
48QFuture<shared_ptr<Uploader>> File::create_uploader(ConflictPolicy policy, int64_t size)
49{
50 return dynamic_cast<FileBase*>(p_.get())->create_uploader(policy, size);
51}
52
53QFuture<shared_ptr<Downloader>> File::create_downloader()
54{
55 return dynamic_cast<FileBase*>(p_.get())->create_downloader();
56}
57
58} // namespace client
59} // namespace qt
60} // namespace storage
61} // namespace unity
620
=== removed file 'src/qt/client/Folder.cpp'
--- src/qt/client/Folder.cpp 2016-07-14 00:17:14 +0000
+++ src/qt/client/Folder.cpp 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Folder.h>
20
21#include <unity/storage/qt/client/internal/FolderBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32using namespace internal;
33using namespace std;
34
35Folder::Folder(FolderBase* p)
36 : Item(p)
37{
38}
39
40Folder::~Folder() = default;
41
42QFuture<QVector<Item::SPtr>> Folder::list() const
43{
44 return dynamic_cast<FolderBase*>(p_.get())->list();
45}
46
47QFuture<QVector<Item::SPtr>> Folder::lookup(QString const& name) const
48{
49 return dynamic_cast<FolderBase*>(p_.get())->lookup(name);
50}
51
52QFuture<Folder::SPtr> Folder::create_folder(QString const& name)
53{
54 return dynamic_cast<FolderBase*>(p_.get())->create_folder(name);
55}
56
57QFuture<shared_ptr<Uploader>> Folder::create_file(QString const& name, int64_t size)
58{
59 return dynamic_cast<FolderBase*>(p_.get())->create_file(name, size);
60}
61
62} // namespace client
63} // namespace qt
64} // namespace storage
65} // namespace unity
660
=== removed file 'src/qt/client/Item.cpp'
--- src/qt/client/Item.cpp 2016-07-25 03:45:41 +0000
+++ src/qt/client/Item.cpp 1970-01-01 00:00:00 +0000
@@ -1,121 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Item.h>
20
21#include <unity/storage/qt/client/internal/ItemBase.h>
22
23#include <cassert>
24
25using namespace std;
26
27namespace unity
28{
29namespace storage
30{
31namespace qt
32{
33namespace client
34{
35
36Item::Item(internal::ItemBase* p)
37 : p_(p)
38{
39 assert(p != nullptr);
40}
41
42Item::~Item() = default;
43
44QString Item::native_identity() const
45{
46 return p_->native_identity();
47}
48
49QString Item::name() const
50{
51 return p_->name();
52}
53
54shared_ptr<Root> Item::root() const
55{
56 return p_->root();
57}
58
59ItemType Item::type() const
60{
61 return p_->type();
62}
63
64QString Item::etag() const
65{
66 return p_->etag();
67}
68
69QVariantMap Item::metadata() const
70{
71 return p_->metadata();
72}
73
74QDateTime Item::last_modified_time() const
75{
76 return p_->last_modified_time();
77}
78
79QFuture<QVector<std::shared_ptr<Folder>>> Item::parents() const
80{
81 return p_->parents();
82}
83
84QVector<QString> Item::parent_ids() const
85{
86 return p_->parent_ids();
87}
88
89QFuture<Item::SPtr> Item::copy(std::shared_ptr<Folder> const& new_parent, QString const& new_name)
90{
91 return p_->copy(new_parent, new_name);
92}
93QFuture<Item::SPtr> Item::move(std::shared_ptr<Folder> const& new_parent, QString const& new_name)
94{
95 return p_->move(new_parent, new_name);
96}
97
98QFuture<void> Item::delete_item()
99{
100 return p_->delete_item();
101}
102
103QDateTime Item::creation_time() const
104{
105 return p_->creation_time();
106}
107
108MetadataMap Item::native_metadata() const
109{
110 return p_->native_metadata();
111}
112
113bool Item::equal_to(Item::SPtr const& other) const noexcept
114{
115 return p_->equal_to(*other->p_);
116}
117
118} // namespace client
119} // namespace qt
120} // namespace storage
121} // namespace unity
1220
=== removed file 'src/qt/client/Root.cpp'
--- src/qt/client/Root.cpp 2016-07-20 06:58:30 +0000
+++ src/qt/client/Root.cpp 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Root.h>
20
21#include <unity/storage/qt/client/internal/RootBase.h>
22
23namespace unity
24{
25namespace storage
26{
27namespace qt
28{
29namespace client
30{
31
32using namespace internal;
33using namespace std;
34
35Root::Root(RootBase* p)
36 : Folder(p)
37{
38}
39
40Root::~Root() = default;
41
42shared_ptr<Account> Root::account() const
43{
44 return dynamic_cast<RootBase*>(p_.get())->account();
45}
46
47QFuture<int64_t> Root::free_space_bytes() const
48{
49 return dynamic_cast<RootBase*>(p_.get())->free_space_bytes();
50}
51
52QFuture<int64_t> Root::used_space_bytes() const
53{
54 return dynamic_cast<RootBase*>(p_.get())->used_space_bytes();
55}
56
57QFuture<Item::SPtr> Root::get(QString native_identity) const
58{
59 return dynamic_cast<RootBase*>(p_.get())->get(native_identity);
60}
61
62} // namespace client
63} // namespace qt
64} // namespace storage
65} // namespace unity
660
=== removed file 'src/qt/client/Runtime.cpp'
--- src/qt/client/Runtime.cpp 2016-08-11 23:55:40 +0000
+++ src/qt/client/Runtime.cpp 1970-01-01 00:00:00 +0000
@@ -1,76 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * 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
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michi Henning <michi.henning@canonical.com>
17 */
18
19#include <unity/storage/qt/client/Runtime.h>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: