~unity-api-team/storage-framework/vivid

« back to all changes in this revision

Viewing changes to src/qt/client/internal/remote_client/CancelUploadHandler.cpp

  • Committer: Michi Henning
  • Date: 2016-07-11 05:44:31 UTC
  • mfrom: (8.10.31 decltype)
  • mto: (8.1.15 devel)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: michi.henning@canonical.com-20160711054431-jj23l6adsm7367b7
Merged decltype branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <unity/storage/qt/client/internal/remote_client/CancelUploadHandler.h>
2
 
 
3
 
#include "ProviderInterface.h"
4
 
#include <unity/storage/internal/ItemMetadata.h>
5
 
#include <unity/storage/qt/client/Exceptions.h>
6
 
#include <unity/storage/qt/client/internal/remote_client/FileImpl.h>
7
 
 
8
 
using namespace std;
9
 
 
10
 
namespace unity
11
 
{
12
 
namespace storage
13
 
{
14
 
namespace qt
15
 
{
16
 
namespace client
17
 
{
18
 
namespace internal
19
 
{
20
 
namespace remote_client
21
 
{
22
 
 
23
 
CancelUploadHandler::CancelUploadHandler(QDBusPendingReply<void> const& reply)
24
 
    : watcher_(reply, this)
25
 
{
26
 
    connect(&watcher_, &QDBusPendingCallWatcher::finished, this, &CancelUploadHandler::finished);
27
 
    qf_.reportStarted();
28
 
}
29
 
 
30
 
QFuture<void> CancelUploadHandler::future()
31
 
{
32
 
    return qf_.future();
33
 
}
34
 
 
35
 
void CancelUploadHandler::finished(QDBusPendingCallWatcher* call)
36
 
{
37
 
    deleteLater();
38
 
 
39
 
    QDBusPendingReply<void> reply = *call;
40
 
    if (reply.isError())
41
 
    {
42
 
        qDebug() << reply.error().message();  // TODO, remove this
43
 
        qf_.reportException(StorageException());  // TODO
44
 
    }
45
 
    qf_.reportFinished();
46
 
}
47
 
 
48
 
}  // namespace remote_client
49
 
}  // namespace internal
50
 
}  // namespace client
51
 
}  // namespace qt
52
 
}  // namespace storage
53
 
}  // namespace unity
54
 
 
55
 
#include "CancelUploadHandler.moc"