aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppTransferManager.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2011-06-05 12:35:56 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2011-06-05 12:35:56 +0000
commitb6f639c39e33743b71561113fa006dae1738a674 (patch)
tree9517b3024ce15d84eb0c3bd4d017e7f3c4c4db33 /src/QXmppTransferManager.cpp
parentfdae4dc93f9e6dd2b94ee2018ac9b7d6d91e1761 (diff)
downloadqxmpp-b6f639c39e33743b71561113fa006dae1738a674.tar.gz
add some signals
Diffstat (limited to 'src/QXmppTransferManager.cpp')
-rw-r--r--src/QXmppTransferManager.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/QXmppTransferManager.cpp b/src/QXmppTransferManager.cpp
index ca0bbbbe..baa5d4aa 100644
--- a/src/QXmppTransferManager.cpp
+++ b/src/QXmppTransferManager.cpp
@@ -982,16 +982,16 @@ void QXmppTransferManager::jobError(QXmppTransferJob::Error error)
}
}
-void QXmppTransferManager::jobFinished()
+void QXmppTransferManager::onJobFinished()
{
QXmppTransferJob *job = qobject_cast<QXmppTransferJob *>(sender());
if (!job || !m_jobs.contains(job))
return;
- emit finished(job);
+ emit jobFinished(job);
}
-void QXmppTransferManager::jobStateChanged(QXmppTransferJob::State state)
+void QXmppTransferManager::onJobStateChanged(QXmppTransferJob::State state)
{
QXmppTransferJob *job = qobject_cast<QXmppTransferJob *>(sender());
if (!job || !m_jobs.contains(job))
@@ -1001,7 +1001,7 @@ void QXmppTransferManager::jobStateChanged(QXmppTransferJob::State state)
return;
// disconnect from the signal
- disconnect(job, SIGNAL(stateChanged(QXmppTransferJob::State)), this, SLOT(jobStateChanged(QXmppTransferJob::State)));
+ disconnect(job, SIGNAL(stateChanged(QXmppTransferJob::State)), this, SLOT(onJobStateChanged(QXmppTransferJob::State)));
// the job was refused by the local party
if (state != QXmppTransferJob::StartState || !job->d->iodevice || !job->d->iodevice->isWritable())
@@ -1054,6 +1054,9 @@ void QXmppTransferManager::jobStateChanged(QXmppTransferJob::State state)
response.setSiItems(feature);
client()->sendPacket(response);
+
+ // notify user
+ emit jobStarted(job);
}
/// Send file to a remote party.
@@ -1186,7 +1189,7 @@ QXmppTransferJob *QXmppTransferManager::sendFile(const QString &jid, QIODevice *
m_jobs.append(job);
connect(job, SIGNAL(destroyed(QObject*)), this, SLOT(jobDestroyed(QObject*)));
connect(job, SIGNAL(error(QXmppTransferJob::Error)), this, SLOT(jobError(QXmppTransferJob::Error)));
- connect(job, SIGNAL(finished()), this, SLOT(jobFinished()));
+ connect(job, SIGNAL(finished()), this, SLOT(onJobFinished()));
QXmppStreamInitiationIq request;
request.setType(QXmppIq::Set);
@@ -1197,6 +1200,9 @@ QXmppTransferJob *QXmppTransferManager::sendFile(const QString &jid, QIODevice *
job->d->requestId = request.id();
client()->sendPacket(request);
+ // notify user
+ emit jobStarted(job);
+
return job;
}
@@ -1437,8 +1443,8 @@ void QXmppTransferManager::streamInitiationSetReceived(const QXmppStreamInitiati
// register job
m_jobs.append(job);
connect(job, SIGNAL(destroyed(QObject*)), this, SLOT(jobDestroyed(QObject*)));
- connect(job, SIGNAL(finished()), this, SLOT(jobFinished()));
- connect(job, SIGNAL(stateChanged(QXmppTransferJob::State)), this, SLOT(jobStateChanged(QXmppTransferJob::State)));
+ connect(job, SIGNAL(finished()), this, SLOT(onJobFinished()));
+ connect(job, SIGNAL(stateChanged(QXmppTransferJob::State)), this, SLOT(onJobStateChanged(QXmppTransferJob::State)));
// allow user to accept or decline the job
emit fileReceived(job);