]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Propagator, remove the QNAM in the name as the alternative has been removed a long...
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 18 May 2016 14:42:55 +0000 (16:42 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 31 Aug 2016 08:25:06 +0000 (10:25 +0200)
src/libsync/owncloudpropagator.cpp
src/libsync/owncloudpropagator.h
src/libsync/propagatedownload.cpp
src/libsync/propagatedownload.h
src/libsync/propagateupload.cpp
src/libsync/propagateupload.h

index b330c27c8ddbf26a4b3fb744ff0e41a3d1140592..d73f63c768214d1aacd8567ecc30310df963ba86 100644 (file)
@@ -201,7 +201,7 @@ bool PropagateItemJob::checkForProblemsWithShared(int httpStatusCode, const QStr
                 downloadItem->_instruction = CSYNC_INSTRUCTION_SYNC;
             }
             downloadItem->_direction = SyncFileItem::Down;
-            newJob = new PropagateDownloadFileQNAM(_propagator, downloadItem);
+            newJob = new PropagateDownloadFile(_propagator, downloadItem);
         } else {
             // Directories are harder to recover.
             // But just re-create the directory, next sync will be able to recover the files
@@ -266,11 +266,11 @@ PropagateItemJob* OwncloudPropagator::createJob(const SyncFileItemPtr &item) {
         case CSYNC_INSTRUCTION_SYNC:
         case CSYNC_INSTRUCTION_CONFLICT:
             if (item->_direction != SyncFileItem::Up) {
-                auto job = new PropagateDownloadFileQNAM(this, item);
+                auto job = new PropagateDownloadFile(this, item);
                 job->setDeleteExistingFolder(deleteExisting);
                 return job;
             } else {
-                auto job = new PropagateUploadFileQNAM(this, item);
+                auto job = new PropagateUploadFile(this, item);
                 job->setDeleteExisting(deleteExisting);
                 return job;
             }
index cad94c9eeef568fe3e1fec83994c52f6d476ccdd..5f04beff2e7acc1e9c805776c6f90ca1042ede75 100644 (file)
@@ -378,7 +378,7 @@ private:
 
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     // access to signals which are protected in Qt4
-    friend class PropagateDownloadFileQNAM;
+    friend class PropagateDownloadFile;
     friend class PropagateUploadFileQNAM;
     friend class PropagateLocalMkdir;
     friend class PropagateLocalRename;
index 6473c40013753d45525f805ada36e292dcb27a39..0a837715970a0f567dc16ba3310d3010e146e27a 100644 (file)
@@ -304,7 +304,7 @@ QString GETFileJob::errorString() const
     }
 }
 
-void PropagateDownloadFileQNAM::start()
+void PropagateDownloadFile::start()
 {
     if (_propagator->_abortRequested.fetchAndAddRelaxed(0))
         return;
@@ -418,7 +418,7 @@ void PropagateDownloadFileQNAM::start()
     _job->start();
 }
 
-qint64 PropagateDownloadFileQNAM::committedDiskSpace() const
+qint64 PropagateDownloadFile::committedDiskSpace() const
 {
     if (_state == Running) {
         return qBound(0ULL, _item->_size - _resumeStart - _downloadProgress, _item->_size);
@@ -426,13 +426,13 @@ qint64 PropagateDownloadFileQNAM::committedDiskSpace() const
     return 0;
 }
 
-void PropagateDownloadFileQNAM::setDeleteExistingFolder(bool enabled)
+void PropagateDownloadFile::setDeleteExistingFolder(bool enabled)
 {
     _deleteExisting = enabled;
 }
 
 const char owncloudCustomSoftErrorStringC[] = "owncloud-custom-soft-error-string";
-void PropagateDownloadFileQNAM::slotGetFinished()
+void PropagateDownloadFile::slotGetFinished()
 {
     _propagator->_activeJobList.removeOne(this);
 
@@ -565,14 +565,14 @@ void PropagateDownloadFileQNAM::slotGetFinished()
     validator->start(_tmpFile.fileName(), checksumHeader);
 }
 
-void PropagateDownloadFileQNAM::slotChecksumFail( const QString& errMsg )
+void PropagateDownloadFile::slotChecksumFail( const QString& errMsg )
 {
     FileSystem::remove(_tmpFile.fileName());
     _propagator->_anotherSyncNeeded = true;
     done(SyncFileItem::SoftError, errMsg ); // tr("The file downloaded with a broken checksum, will be redownloaded."));
 }
 
-void PropagateDownloadFileQNAM::deleteExistingFolder()
+void PropagateDownloadFile::deleteExistingFolder()
 {
     QString existingDir = _propagator->getFilePath(_item->_file);
     if (!QFileInfo(existingDir).isDir()) {
@@ -653,7 +653,7 @@ static void preserveGroupOwnership(const QString& fileName, const QFileInfo& fi)
 }
 } // end namespace
 
-void PropagateDownloadFileQNAM::transmissionChecksumValidated(const QByteArray &checksumType, const QByteArray &checksum)
+void PropagateDownloadFile::transmissionChecksumValidated(const QByteArray &checksumType, const QByteArray &checksum)
 {
     const auto theContentChecksumType = contentChecksumType();
 
@@ -674,7 +674,7 @@ void PropagateDownloadFileQNAM::transmissionChecksumValidated(const QByteArray &
     computeChecksum->start(_tmpFile.fileName());
 }
 
-void PropagateDownloadFileQNAM::contentChecksumComputed(const QByteArray &checksumType, const QByteArray &checksum)
+void PropagateDownloadFile::contentChecksumComputed(const QByteArray &checksumType, const QByteArray &checksum)
 {
     _item->_contentChecksum = checksum;
     _item->_contentChecksumType = checksumType;
@@ -682,7 +682,7 @@ void PropagateDownloadFileQNAM::contentChecksumComputed(const QByteArray &checks
     downloadFinished();
 }
 
-void PropagateDownloadFileQNAM::downloadFinished()
+void PropagateDownloadFile::downloadFinished()
 {
     QString fn = _propagator->getFilePath(_item->_file);
 
@@ -805,7 +805,7 @@ void PropagateDownloadFileQNAM::downloadFinished()
     }
 }
 
-void PropagateDownloadFileQNAM::slotDownloadProgress(qint64 received, qint64)
+void PropagateDownloadFile::slotDownloadProgress(qint64 received, qint64)
 {
     if (!_job) return;
     _downloadProgress = received;
@@ -813,7 +813,7 @@ void PropagateDownloadFileQNAM::slotDownloadProgress(qint64 received, qint64)
 }
 
 
-void PropagateDownloadFileQNAM::abort()
+void PropagateDownloadFile::abort()
 {
     if (_job &&  _job->reply())
         _job->reply()->abort();
index fd05d065c156e32d367a67cefbbdea937f7539f9..1317dda869c739dd9ae6ca2d0590deb502b3a7af 100644 (file)
@@ -103,13 +103,13 @@ private slots:
 };
 
 /**
- * @brief The PropagateDownloadFileQNAM class
+ * @brief The PropagateDownloadFile class
  * @ingroup libsync
  */
-class PropagateDownloadFileQNAM : public PropagateItemJob {
+class PropagateDownloadFile : public PropagateItemJob {
     Q_OBJECT
 public:
-    PropagateDownloadFileQNAM(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
+    PropagateDownloadFile(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
         : PropagateItemJob(propagator, item), _resumeStart(0), _downloadProgress(0), _deleteExisting(false) {}
     void start() Q_DECL_OVERRIDE;
     qint64 committedDiskSpace() const Q_DECL_OVERRIDE;
index f60106244aa54f7e4cece4df7f6caffea23188cd..2783ac9a597e687d9e8ed6bdada5ef3bc33c9b82 100644 (file)
@@ -184,7 +184,7 @@ bool PollJob::finished()
     return true;
 }
 
-void PropagateUploadFileQNAM::start()
+void PropagateUploadFile::start()
 {
     if (_propagator->_abortRequested.fetchAndAddRelaxed(0)) {
         return;
@@ -205,7 +205,7 @@ void PropagateUploadFileQNAM::start()
     job->start();
 }
 
-void PropagateUploadFileQNAM::slotComputeContentChecksum()
+void PropagateUploadFile::slotComputeContentChecksum()
 {
     if (_propagator->_abortRequested.fetchAndAddRelaxed(0)) {
         return;
@@ -239,12 +239,12 @@ void PropagateUploadFileQNAM::slotComputeContentChecksum()
     computeChecksum->start(filePath);
 }
 
-void PropagateUploadFileQNAM::setDeleteExisting(bool enabled)
+void PropagateUploadFile::setDeleteExisting(bool enabled)
 {
     _deleteExisting = enabled;
 }
 
-void PropagateUploadFileQNAM::slotComputeTransmissionChecksum(const QByteArray& contentChecksumType, const QByteArray& contentChecksum)
+void PropagateUploadFile::slotComputeTransmissionChecksum(const QByteArray& contentChecksumType, const QByteArray& contentChecksum)
 {
     _item->_contentChecksum = contentChecksum;
     _item->_contentChecksumType = contentChecksumType;
@@ -276,7 +276,7 @@ void PropagateUploadFileQNAM::slotComputeTransmissionChecksum(const QByteArray&
     computeChecksum->start(filePath);
 }
 
-void PropagateUploadFileQNAM::slotStartUpload(const QByteArray& transmissionChecksumType, const QByteArray& transmissionChecksum)
+void PropagateUploadFile::slotStartUpload(const QByteArray& transmissionChecksumType, const QByteArray& transmissionChecksum)
 {
     // Remove ourselfs from the list of active job, before any posible call to done()
     // When we start chunks, we will add it again, once for every chunks.
@@ -299,7 +299,7 @@ void PropagateUploadFileQNAM::slotStartUpload(const QByteArray& transmissionChec
     }
     _stopWatch.addLapTime(QLatin1String("TransmissionChecksum"));
 
-    time_t prevModtime = _item->_modtime; // the _item value was set in PropagateUploadFileQNAM::start()
+    time_t prevModtime = _item->_modtime; // the _item value was set in PropagateUploadFile::start()
     // but a potential checksum calculation could have taken some time during which the file could
     // have been changed again, so better check again here.
 
@@ -476,7 +476,7 @@ void UploadDevice::setChoked(bool b) {
     }
 }
 
-void PropagateUploadFileQNAM::startNextChunk()
+void PropagateUploadFile::startNextChunk()
 {
     if (_propagator->_abortRequested.fetchAndAddRelaxed(0))
         return;
@@ -607,7 +607,7 @@ void PropagateUploadFileQNAM::startNextChunk()
     }
 }
 
-void PropagateUploadFileQNAM::slotPutFinished()
+void PropagateUploadFile::slotPutFinished()
 {
     PUTFileJob *job = qobject_cast<PUTFileJob *>(sender());
     Q_ASSERT(job);
@@ -785,7 +785,7 @@ void PropagateUploadFileQNAM::slotPutFinished()
     finalize(*_item);
 }
 
-void PropagateUploadFileQNAM::finalize(const SyncFileItem &copy)
+void PropagateUploadFile::finalize(const SyncFileItem &copy)
 {
     // Normally, copy == _item,   but when it comes from the UpdateMTimeAndETagJob, we need to do
     // some updates
@@ -807,7 +807,7 @@ void PropagateUploadFileQNAM::finalize(const SyncFileItem &copy)
     done(SyncFileItem::Success);
 }
 
-void PropagateUploadFileQNAM::slotUploadProgress(qint64 sent, qint64 total)
+void PropagateUploadFile::slotUploadProgress(qint64 sent, qint64 total)
 {
     // Completion is signaled with sent=0, total=0; avoid accidentally
     // resetting progress due to the sent being zero by ignoring it.
@@ -840,7 +840,7 @@ void PropagateUploadFileQNAM::slotUploadProgress(qint64 sent, qint64 total)
     emit progress(*_item, amount);
 }
 
-void PropagateUploadFileQNAM::startPollJob(const QString& path)
+void PropagateUploadFile::startPollJob(const QString& path)
 {
     PollJob* job = new PollJob(_propagator->account(), path, _item,
                                _propagator->_journal, _propagator->_localDir, this);
@@ -855,7 +855,7 @@ void PropagateUploadFileQNAM::startPollJob(const QString& path)
     job->start();
 }
 
-void PropagateUploadFileQNAM::slotPollFinished()
+void PropagateUploadFile::slotPollFinished()
 {
     PollJob *job = qobject_cast<PollJob *>(sender());
     Q_ASSERT(job);
@@ -871,12 +871,12 @@ void PropagateUploadFileQNAM::slotPollFinished()
     finalize(*job->_item);
 }
 
-void PropagateUploadFileQNAM::slotJobDestroyed(QObject* job)
+void PropagateUploadFile::slotJobDestroyed(QObject* job)
 {
     _jobs.erase(std::remove(_jobs.begin(), _jobs.end(), job) , _jobs.end());
 }
 
-void PropagateUploadFileQNAM::abort()
+void PropagateUploadFile::abort()
 {
     foreach(auto *job, _jobs) {
         if (job->reply()) {
@@ -887,7 +887,7 @@ void PropagateUploadFileQNAM::abort()
 }
 
 // This function is used whenever there is an error occuring and jobs might be in progress
-void PropagateUploadFileQNAM::abortWithError(SyncFileItem::Status status, const QString &error)
+void PropagateUploadFile::abortWithError(SyncFileItem::Status status, const QString &error)
 {
     _finished = true;
     abort();
index a340f1a288fe05595811e973ef92d13d4224dea0..2be0212e9dfe452fb63cb0e3bd9a3993ab7b0fca 100644 (file)
@@ -155,10 +155,10 @@ signals:
 };
 
 /**
- * @brief The PropagateUploadFileQNAM class
+ * @brief The PropagateUploadFile class
  * @ingroup libsync
  */
-class PropagateUploadFileQNAM : public PropagateItemJob {
+class PropagateUploadFile : public PropagateItemJob {
     Q_OBJECT
 
 private:
@@ -191,7 +191,7 @@ private:
     quint64 chunkSize() const { return _propagator->chunkSize(); }
 
 public:
-    PropagateUploadFileQNAM(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
+    PropagateUploadFile(OwncloudPropagator* propagator,const SyncFileItemPtr& item)
         : PropagateItemJob(propagator, item), _startChunk(0), _currentChunk(0), _chunkCount(0), _transferId(0), _finished(false), _deleteExisting(false) {}
     void start() Q_DECL_OVERRIDE;