1
#include <unity/storage/qt/client/internal/remote_client/CreateFileHandler.h>
3
#include "ProviderInterface.h"
4
#include <unity/storage/qt/client/Exceptions.h>
5
#include <unity/storage/qt/client/internal/remote_client/UploaderImpl.h>
21
namespace remote_client
24
CreateFileHandler::CreateFileHandler(QDBusPendingReply<QString, QDBusUnixFileDescriptor> const& reply,
25
weak_ptr<Root> const& root,
26
ProviderInterface& provider)
27
: watcher_(reply, this)
32
connect(&watcher_, &QDBusPendingCallWatcher::finished, this, &CreateFileHandler::finished);
36
QFuture<shared_ptr<Uploader>> CreateFileHandler::future()
41
void CreateFileHandler::finished(QDBusPendingCallWatcher* call)
45
QDBusPendingReply<QString, QDBusUnixFileDescriptor> reply = *call;
48
qDebug() << reply.error().message(); // TODO, remove this
49
qf_.reportException(StorageException()); // TODO
54
auto upload_id = reply.argumentAt<0>();
55
auto fd = reply.argumentAt<1>();
56
auto uploader = UploaderImpl::make_uploader(upload_id, fd.fileDescriptor(), "", root_, provider_);
57
qf_.reportResult(uploader);
61
} // namespace remote_client
62
} // namespace internal
65
} // namespace storage
68
#include "CreateFileHandler.moc"