From: APTX Date: Sat, 11 Dec 2010 16:52:02 +0000 (+0100) Subject: Add hashingProgress property to File, so hashing Progress can be obtained without... X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=45d13a7a0710592703039c2401817ee62e825e49;p=anidbudpclient.git Add hashingProgress property to File, so hashing Progress can be obtained without the statusUpdate signal. --- diff --git a/file.cpp b/file.cpp index 1d056a4..9f810e1 100644 --- a/file.cpp +++ b/file.cpp @@ -66,6 +66,11 @@ QByteArray File::ed2k() return m_ed2k; } +int File::hashingProgress() const +{ + return m_hashingProgress; +} + File::ActionState File::hashingState() const { return m_hashingState; @@ -273,6 +278,7 @@ void File::workOnFinished(Action action, ActionState actionState) void File::updateHashProgress(int percent) { + m_hashingProgress = percent; emit statusUpdate(Hashing, InProgress, percent); } @@ -375,6 +381,7 @@ void File::init() fileReply = 0; addReply = 0; markReply = 0; + m_hashingProgress = 0; m_hashingState = m_renamingState = m_addingState = m_markingState = NotStarted; notWorking = true; diff --git a/file.h b/file.h index d850e20..6428c57 100644 --- a/file.h +++ b/file.h @@ -25,6 +25,7 @@ class ANIDBUDPCLIENTSHARED_EXPORT File : public QObject Q_PROPERTY(qint64 size READ size); Q_PROPERTY(QByteArray ed2k READ ed2k); + Q_PROPERTY(int hashingProgress READ hashingProgress); Q_PROPERTY(ActionState hashingState READ hashingState); Q_PROPERTY(ActionState renamingState READ renamingState); Q_PROPERTY(ActionState addingState READ addingState); @@ -63,7 +64,7 @@ public: qint64 size(); QByteArray ed2k(); - + int hashingProgress() const; ActionState hashingState() const; ActionState renamingState() const; ActionState addingState() const; @@ -109,6 +110,7 @@ private: bool notWorking; + int m_hashingProgress; ActionState m_hashingState; ActionState m_renamingState; ActionState m_addingState;