]> Some of my projects - anidbudpclient.git/commitdiff
Add hashingProgress property to File, so hashing Progress can be obtained without...
authorAPTX <marek321@gmail.com>
Sat, 11 Dec 2010 16:52:02 +0000 (17:52 +0100)
committerAPTX <marek321@gmail.com>
Sat, 11 Dec 2010 16:52:02 +0000 (17:52 +0100)
file.cpp
file.h

index 1d056a4166dffad168e2268c42da5a0b889aec13..9f810e10c9783d28485347a2258bf755fe5f3176 100644 (file)
--- 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 d850e204c91b8ebfb06b3d3f0fdf56c6c249f95c..6428c579e7e334b53ca141cc3598a00ee4d3037c 100644 (file)
--- 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;