[Pkg-owncloud-commits] [owncloud-client] 100/103: Fix updating mtime

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Apr 30 18:09:04 UTC 2014


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 d62deabf9b41ba58da6b0e9ae5b6da62992253bd
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Apr 30 10:10:32 2014 +0200

    Fix updating mtime
    
    Fixup commit 9193286fc11a6a135d6f6891906ffe1ae764032e
    Use the right URL for the PROPPATCH and HEAD, do not let other
    jobs start when we wait for the UpdateMTimeAndETagJob
    Update the etag and the fileid of the real item.
---
 src/mirall/propagator_qnam.cpp | 16 ++++++++++------
 src/mirall/propagator_qnam.h   |  2 +-
 src/mirall/propagatorjobs.cpp  |  6 +++---
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp
index 67afa00..c24507b 100644
--- a/src/mirall/propagator_qnam.cpp
+++ b/src/mirall/propagator_qnam.cpp
@@ -288,8 +288,6 @@ void PropagateUploadFileQNAM::slotPutFinished()
         return;
     }
 
-    _propagator->_activeJobs--;
-
     // the file id should only be empty for new files up- or downloaded
     QByteArray fid = job->reply()->rawHeader("OC-FileID");
     if( !fid.isEmpty() ) {
@@ -307,16 +305,22 @@ void PropagateUploadFileQNAM::slotPutFinished()
         // Normaly Owncloud 6 always put X-OC-MTime
         qDebug() << "Server do not support X-OC-MTime";
         PropagatorJob *newJob = new UpdateMTimeAndETagJob(_propagator, _item);
-        QObject::connect(newJob, SIGNAL(completed(SyncFileItem)), this, SLOT(finalize()));
+        QObject::connect(newJob, SIGNAL(completed(SyncFileItem)), this, SLOT(finalize(SyncFileItem)));
         QMetaObject::invokeMethod(newJob, "start");
         return;
     }
-    finalize();
+    finalize(_item);
 }
 
-
-void PropagateUploadFileQNAM::finalize()
+void PropagateUploadFileQNAM::finalize(const SyncFileItem &copy)
 {
+    // Normally, copy == _item,   but when it comes from the UpdateMTimeAndETagJob, we need to do
+    // some updates
+    _item._etag = copy._etag;
+    _item._fileId = copy._fileId;
+
+    _propagator->_activeJobs--;
+
     _item._requestDuration = _duration.elapsed();
 
     _propagator->_journal->setFileRecord(SyncJournalFileRecord(_item, _propagator->_localDir + _item._file));
diff --git a/src/mirall/propagator_qnam.h b/src/mirall/propagator_qnam.h
index d5fa451..4936d2d 100644
--- a/src/mirall/propagator_qnam.h
+++ b/src/mirall/propagator_qnam.h
@@ -91,7 +91,7 @@ private slots:
     void slotUploadProgress(qint64,qint64);
     void abort();
     void startNextChunk();
-    void finalize();
+    void finalize(const Mirall::SyncFileItem&);
 };
 
 
diff --git a/src/mirall/propagatorjobs.cpp b/src/mirall/propagatorjobs.cpp
index 660aec3..85c47f5 100644
--- a/src/mirall/propagatorjobs.cpp
+++ b/src/mirall/propagatorjobs.cpp
@@ -324,9 +324,9 @@ bool PropagateNeonJob::updateErrorFromSession(int neon_code, ne_request* req, in
 
 void UpdateMTimeAndETagJob::start()
 {
-    QScopedPointer<char, QScopedPointerPodDeleter> uri2(
-        ne_path_escape((_propagator->_remoteDir + _item._renameTarget).toUtf8()));
-    if (!updateMTimeAndETag(uri2.data(), _item._modtime))
+    QScopedPointer<char, QScopedPointerPodDeleter> uri(
+        ne_path_escape((_propagator->_remoteDir + _item._file).toUtf8()));
+    if (!updateMTimeAndETag(uri.data(), _item._modtime))
         return;
     done(SyncFileItem::Success);
 }

-- 
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