[Pkg-owncloud-commits] [owncloud-client] 170/484: Propagate: On download store checksum header in db #3735

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit b1387f801b58cd77eb7ef81d55b7cccd36f67617
Author: Christian Kamm <mail at ckamm.de>
Date:   Wed Oct 14 15:29:27 2015 +0200

    Propagate: On download store checksum header in db #3735
---
 src/libsync/propagatedownload.cpp | 13 ++++++++++---
 src/libsync/propagatedownload.h   |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp
index b37e6bd..5fd94da 100644
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@ -351,7 +351,10 @@ void PropagateDownloadFileQNAM::start()
         if (_resumeStart == _item->_size) {
             qDebug() << "File is already complete, no need to download";
             _tmpFile.close();
-            downloadFinished();
+
+            // Unfortunately we lost the checksum header, if any...
+            QByteArray checksumHeader;
+            downloadFinished(checksumHeader);
             return;
         }
     }
@@ -532,7 +535,7 @@ void PropagateDownloadFileQNAM::slotGetFinished()
     // will also emit the validated() signal to continue the flow in slot downloadFinished()
     // as this is (still) also correct.
     ValidateChecksumHeader *validator = new ValidateChecksumHeader(this);
-    connect(validator, SIGNAL(validated(QByteArray)), this, SLOT(downloadFinished()));
+    connect(validator, SIGNAL(validated(QByteArray)), this, SLOT(downloadFinished(QByteArray)));
     connect(validator, SIGNAL(validationFailed(QString)), this, SLOT(slotChecksumFail(QString)));
     validator->start(_tmpFile.fileName(), job->reply()->rawHeader(checkSumHeaderC));
 }
@@ -611,8 +614,12 @@ static void handleRecallFile(const QString &fn)
 }
 } // end namespace
 
-void PropagateDownloadFileQNAM::downloadFinished()
+void PropagateDownloadFileQNAM::downloadFinished(const QByteArray& checksumHeader)
 {
+    if (!checksumHeader.isEmpty()) {
+        _item->_checksumHeader = checksumHeader;
+    }
+
     QString fn = _propagator->getFilePath(_item->_file);
 
     // In case of file name clash, report an error
diff --git a/src/libsync/propagatedownload.h b/src/libsync/propagatedownload.h
index 32e05db..9a5c2b3 100644
--- a/src/libsync/propagatedownload.h
+++ b/src/libsync/propagatedownload.h
@@ -117,7 +117,7 @@ public:
 private slots:
     void slotGetFinished();
     void abort() Q_DECL_OVERRIDE;
-    void downloadFinished();
+    void downloadFinished(const QByteArray& checksumHeader);
     void slotDownloadProgress(qint64,qint64);
     void slotChecksumFail( const QString& errMsg );
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list