projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hide AutoWHO for nicks without IrcUser objects
[quassel.git]
/
src
/
client
/
clienttransfer.cpp
diff --git
a/src/client/clienttransfer.cpp
b/src/client/clienttransfer.cpp
index
f42e14e
..
2255adc
100644
(file)
--- a/
src/client/clienttransfer.cpp
+++ b/
src/client/clienttransfer.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
5
by the Quassel Project *
+ * Copyright (C) 2005-201
6
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-31,6
+31,15
@@
ClientTransfer::ClientTransfer(const QUuid &uuid, QObject *parent)
}
}
+quint64 ClientTransfer::transferred() const
+{
+ if (status() == Status::Completed)
+ return fileSize();
+
+ return _file ? _file->size() : 0;
+}
+
+
void ClientTransfer::cleanUp()
{
if (_file) {
void ClientTransfer::cleanUp()
{
if (_file) {
@@
-82,6
+91,8
@@
void ClientTransfer::dataReceived(PeerPtr, const QByteArray &data)
qWarning() << Q_FUNC_INFO << "Could not write to file:" << _file->errorString();
return;
}
qWarning() << Q_FUNC_INFO << "Could not write to file:" << _file->errorString();
return;
}
+
+ emit transferredChanged(transferred());
}
}