summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2009-09-16 22:58:56 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2009-09-16 22:58:56 -0300
commit712141a3a5725a996a2a7b21186db670a53a5357 (patch)
tree0d6503eeb6a1acb4909faa42d9c1b1e8a73afeb4 /examples
parent9d9551223d783a748f0aa64a2fd187d95f9366ab (diff)
file-transfer sender example: Listen to transferredBytesChanged.
Diffstat (limited to 'examples')
-rw-r--r--examples/file-transfer/sender.cpp8
-rw-r--r--examples/file-transfer/sender.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/file-transfer/sender.cpp b/examples/file-transfer/sender.cpp
index 631e0d56..d6d767a8 100644
--- a/examples/file-transfer/sender.cpp
+++ b/examples/file-transfer/sender.cpp
@@ -275,6 +275,9 @@ void Sender::onFileTransferChannelReady(PendingOperation *op)
connect(mChan.data(),
SIGNAL(stateChanged(Tp::FileTransferState, Tp::FileTransferStateChangeReason)),
SLOT(onFileTransferChannelStateChanged(Tp::FileTransferState, Tp::FileTransferStateChangeReason)));
+ connect(mChan.data(),
+ SIGNAL(transferredBytesChanged(qulonglong)),
+ SLOT(onFileTransferChannelTransferredBytesChanged(qulonglong)));
mChan->provideFile(&mFile);
}
@@ -290,6 +293,11 @@ void Sender::onFileTransferChannelStateChanged(Tp::FileTransferState state,
}
}
+void Sender::onFileTransferChannelTransferredBytesChanged(qulonglong count)
+{
+ qDebug() << "Tranferred bytes" << count;
+}
+
void Sender::onInvalidated()
{
QCoreApplication::exit(!mCompleted);
diff --git a/examples/file-transfer/sender.h b/examples/file-transfer/sender.h
index 0597f401..8b430c17 100644
--- a/examples/file-transfer/sender.h
+++ b/examples/file-transfer/sender.h
@@ -56,6 +56,7 @@ private Q_SLOTS:
void onFileTransferChannelReady(Tp::PendingOperation *op);
void onFileTransferChannelStateChanged(Tp::FileTransferState state,
Tp::FileTransferStateChangeReason stateReason);
+ void onFileTransferChannelTransferredBytesChanged(qulonglong count);
void onInvalidated();
private: