20 #include <QDBusPendingReply>
21 #include <glog/logging.h>
27 namespace DownloadManager {
29 DownloadPCW::DownloadPCW(
30 const QDBusConnection& conn,
31 const QString& servicePath,
32 const QDBusPendingCall& call,
34 : PendingCallWatcher(conn, servicePath, call, parent) {
35 CHECK(connect(
this, &DownloadPCW::finished,
36 this, &DownloadPCW::onFinished))
37 <<
"Could not connect to signal";
41 DownloadPCW::onFinished(QDBusPendingCallWatcher* watcher) {
42 auto down = qobject_cast<Download*>(parent());
43 QDBusPendingReply<> reply = *watcher;
44 if (reply.isError()) {
45 qDebug() <<
"ERROR" << reply.error() << reply.error().type();
46 auto err =
new DBusError(reply.error());
49 watcher->deleteLater();