From 5dd224f861b108fe967f8dfd6b467c3a91bedae0 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Fri, 5 Mar 2010 08:43:31 +0000 Subject: make it possible to associate arbitrary data with a job --- source/QXmppTransferManager.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/QXmppTransferManager.h') diff --git a/source/QXmppTransferManager.h b/source/QXmppTransferManager.h index cc8fc926..b5edf5a5 100644 --- a/source/QXmppTransferManager.h +++ b/source/QXmppTransferManager.h @@ -26,7 +26,9 @@ #include #include +#include #include +#include #include "QXmppIq.h" #include "QXmppByteStreamIq.h" @@ -79,10 +81,11 @@ public: void abort(); void accept(QIODevice *output); + QVariant data(int role) const; + void setData(int role, const QVariant &value); + QXmppTransferJob::Direction direction() const; QXmppTransferJob::Error error() const; - QString localFilePath() const; - void setLocalFilePath(const QString &path); QString jid() const; QXmppTransferJob::Method method() const; QXmppTransferJob::State state() const; @@ -122,8 +125,8 @@ private: QString m_requestId; State m_state; - // local path to file - QString m_localFilePath; + // arbitrary data + QHash m_data; // file meta-data QDateTime m_fileDate; @@ -155,6 +158,11 @@ public: void setSupportedMethods(int methods); signals: + /// This signal is emitted when a new file transfer offer is received. + /// + /// To accept the transfer job, you must call its accept() method from + /// a slot connected to the signal. Otherwise, the offer transfer job + /// will be refused. void fileReceived(QXmppTransferJob *offer); private slots: -- cgit v1.2.3