Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2014-04-30 12:10:32 +0400
committerOlivier Goffart <ogoffart@woboq.com>2014-04-30 12:24:17 +0400
commitd62deabf9b41ba58da6b0e9ae5b6da62992253bd (patch)
treefd2c888b15fd87d8410617689b0336d27fe04fe9
parent47c23dae30b160bd2d3615cd6e6c5c8f35609b86 (diff)
Fix updating mtimev1.6.0-beta2
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.
-rw-r--r--src/mirall/propagator_qnam.cpp16
-rw-r--r--src/mirall/propagator_qnam.h2
-rw-r--r--src/mirall/propagatorjobs.cpp6
3 files changed, 14 insertions, 10 deletions
diff --git a/src/mirall/propagator_qnam.cpp b/src/mirall/propagator_qnam.cpp
index 67afa0099..c24507ba7 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 d5fa45148..4936d2ddc 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 660aec33a..85c47f568 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);
}