Skip to content
Permalink
Browse files
[transfer-engine] Expired transfers are cleaned up & added more funct…
…ionality to the client API.
  • Loading branch information
Marko Mattila committed Jul 1, 2013
1 parent feaccb0 commit 513cf65fc074a5bfb3c85a4d58e5861a5c63eecb
Showing with 202 additions and 39 deletions.
  1. +56 −0 lib/transferengineclient.cpp
  2. +9 −0 lib/transferengineclient.h
  3. +1 −1 rpm/transfer-engine-qt5.spec
  4. +108 −35 src/transferengine.cpp
  5. +27 −2 src/transferengine_p.h
  6. +1 −1 transfer-engine.pro
@@ -104,6 +104,7 @@ class TransferEngineClientPrivate
{
public:
TransferEngineInterface *m_client;
QString m_uuid;
};

/*!
@@ -339,3 +340,58 @@ void TransferEngineClient::finishTransfer(int transferId, Status status, const Q
d->m_client->finishTransfer(transferId, static_cast<int>(status), reason);
}

/*!
Private method for QML interface to cancel an ongoing transfer using \a transferId.
*/
void TransferEngineClient::cbCancelTransfer(int transferId)
{
Q_D(TransferEngineClient);
d->m_client->cancelTransfer(transferId);
}

/*!
Private method for QML interface to restart canceled or interrupted transfer using \a transferId.
*/
void TransferEngineClient::cbRestartTransfer(int transferId)
{
Q_D(TransferEngineClient);
d->m_client->restartTransfer(transferId);
}

/*!
Private method for QML interface to clear all canceled or interrupted events.
*/
void TransferEngineClient::clearTransfers()
{
Q_D(TransferEngineClient);
d->m_client->clearTransfers();
}

/*!
Private method for QML interface to enable notifications.
*/
void TransferEngineClient::enableNotifications(bool enable)
{
Q_D(TransferEngineClient);
d->m_client->enableNotifications(enable);
}


/*!
Private method for QML interface.
\returns true if notifications are enabled, otherwise false is returned.
*/
bool TransferEngineClient::notificationsEnabled() const
{
Q_D(const TransferEngineClient);
QDBusPendingReply<bool> reply = d->m_client->notificationsEnabled();
reply.waitForFinished();

if (reply.isError()) {
qWarning() << Q_FUNC_INFO << "failed to get notifications!";
return false;
}

return reply.value();
}
@@ -81,9 +81,18 @@ class TransferEngineClient : public QObject
void updateTransferProgress(int transferId, qreal progress);
void finishTransfer(int transferId, Status status, const QString &reason = QString());

private:
void cbCancelTransfer(int transferId);
void cbRestartTransfer(int transferId);
void clearTransfers();
void enableNotifications(bool enable);
bool notificationsEnabled() const;

private:
TransferEngineClientPrivate *d_ptr;
Q_DECLARE_PRIVATE(TransferEngineClient)

friend class DeclarativeTransferInterface;
};

#endif // TRANSFERENGINECLIENT_H
@@ -1,5 +1,5 @@
Name: nemo-transferengine-qt5
Version: 0.0.17
Version: 0.0.23
Release: 0
Summary: Transfer Engine for uploading media content and tracking transfers.
Group: System Environment/Daemon

0 comments on commit 513cf65

Please sign in to comment.