From df3fe2570200a5bc855556d6444112c2882f948d Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 28 Apr 2017 10:03:49 +0200 Subject: [PATCH] Reformatting: Adjust trailing comments These would otherwise be line-wrapped by clang-format, and then consecutive reformattings remove the aligned comment indentation Example: int a; // too long comment -> int a; // too long // comment -> int a; // too long // comment --- src/gui/accountsettings.cpp | 4 ++- src/gui/creds/shibbolethcredentials.cpp | 3 +- src/gui/folderstatusmodel.h | 7 +++-- src/libsync/bandwidthmanager.h | 39 ++++++++++++++++++------- src/libsync/discoveryphase.cpp | 3 +- src/libsync/propagateremotemove.cpp | 4 ++- src/libsync/syncengine.h | 15 +++++++--- src/libsync/syncjournaldb.cpp | 3 +- 8 files changed, 57 insertions(+), 21 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index e4ea56e18..975ddf3e4 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -778,7 +778,9 @@ void AccountSettings::slotDeleteAccount() } } - _model->setAccountState(0); // Else it might access during destruction. This should be better handled by it having a QSharedPointer + // Else it might access during destruction. This should be better handled by it having a QSharedPointer + _model->setAccountState(0); + auto manager = AccountManager::instance(); manager->deleteAccount(_accountState); manager->save(); diff --git a/src/gui/creds/shibbolethcredentials.cpp b/src/gui/creds/shibbolethcredentials.cpp index d5dd1726c..a8cae2eb6 100644 --- a/src/gui/creds/shibbolethcredentials.cpp +++ b/src/gui/creds/shibbolethcredentials.cpp @@ -108,7 +108,8 @@ void ShibbolethCredentials::slotReplyFinished(QNetworkReply* r) QVariant target = r->attribute(QNetworkRequest::RedirectionTargetAttribute); if (target.isValid()) { _stillValid = false; - qCWarning(lcShibboleth) << "detected redirect, will open Login Window"; // will be done in NetworkJob's finished signal + // The Login window will be opened in NetworkJob's finished signal + qCWarning(lcShibboleth) << "detected redirect, will open Login Window"; } else { //_stillValid = true; // gets set when reading from keychain or getting it from browser } diff --git a/src/gui/folderstatusmodel.h b/src/gui/folderstatusmodel.h index 197c82e65..d7ad69cb2 100644 --- a/src/gui/folderstatusmodel.h +++ b/src/gui/folderstatusmodel.h @@ -70,7 +70,8 @@ public: QString _lastErrorString; bool _fetchingLabel; // Whether a 'fetching in progress' label is shown. - bool _isUndecided; // undecided folders are the big folders that the user has not accepted yet + // undecided folders are the big folders that the user has not accepted yet + bool _isUndecided; Qt::CheckState _checked; @@ -150,7 +151,9 @@ private: signals: void dirtyChanged(); - void suggestExpand(const QModelIndex &); // Tell the view that this item should be expanded because it has an undecided item + + // Tell the view that this item should be expanded because it has an undecided item + void suggestExpand(const QModelIndex &); friend struct SubFolderInfo; }; diff --git a/src/libsync/bandwidthmanager.h b/src/libsync/bandwidthmanager.h index 7660525aa..a57ca073f 100644 --- a/src/libsync/bandwidthmanager.h +++ b/src/libsync/bandwidthmanager.h @@ -61,25 +61,44 @@ public slots: void relativeDownloadDelayTimerExpired(); private: - QTimer _switchingTimer; // for switching between absolute and relative bw limiting - OwncloudPropagator *_propagator; // FIXME this timer and this variable should be replaced + // for switching between absolute and relative bw limiting + QTimer _switchingTimer; + + // FIXME this timer and this variable should be replaced // by the propagator emitting the changed limit values to us as signal + OwncloudPropagator *_propagator; - QTimer _absoluteLimitTimer; // for absolute up/down bw limiting + // for absolute up/down bw limiting + QTimer _absoluteLimitTimer; + // FIXME merge these two lists QLinkedList _absoluteUploadDeviceList; - QLinkedList _relativeUploadDeviceList; // FIXME merge with list above ^^ + QLinkedList _relativeUploadDeviceList; + QTimer _relativeUploadMeasuringTimer; - QTimer _relativeUploadDelayTimer; // for relative bw limiting, we need to wait this amount before measuring again - UploadDevice *_relativeLimitCurrentMeasuredDevice; // the device measured - qint64 _relativeUploadLimitProgressAtMeasuringRestart; // for measuring how much progress we made at start + + // for relative bw limiting, we need to wait this amount before measuring again + QTimer _relativeUploadDelayTimer; + + // the device measured + UploadDevice *_relativeLimitCurrentMeasuredDevice; + + // for measuring how much progress we made at start + qint64 _relativeUploadLimitProgressAtMeasuringRestart; qint64 _currentUploadLimit; QLinkedList _downloadJobList; QTimer _relativeDownloadMeasuringTimer; - QTimer _relativeDownloadDelayTimer; // for relative bw limiting, we need to wait this amount before measuring again - GETFileJob *_relativeLimitCurrentMeasuredJob; // the device measured - qint64 _relativeDownloadLimitProgressAtMeasuringRestart; // for measuring how much progress we made at start + + // for relative bw limiting, we need to wait this amount before measuring again + QTimer _relativeDownloadDelayTimer; + + // the device measured + GETFileJob *_relativeLimitCurrentMeasuredJob; + + // for measuring how much progress we made at start + qint64 _relativeDownloadLimitProgressAtMeasuringRestart; + qint64 _currentDownloadLimit; }; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index a221d79c8..9a8be41aa 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -667,7 +667,8 @@ void DiscoveryJob::remote_vio_closedir_hook (csync_vio_handle_t *dhandle, void DiscoveryDirectoryResult *directoryResult = static_cast (dhandle); QString path = directoryResult->path; qCDebug(lcDiscovery) << discoveryJob << path; - delete directoryResult; // just deletes the struct and the iterator, the data itself is owned by the SyncEngine/DiscoveryMainThread + // just deletes the struct and the iterator, the data itself is owned by the SyncEngine/DiscoveryMainThread + delete directoryResult; } } diff --git a/src/libsync/propagateremotemove.cpp b/src/libsync/propagateremotemove.cpp index c878b1cf7..de7952de7 100644 --- a/src/libsync/propagateremotemove.cpp +++ b/src/libsync/propagateremotemove.cpp @@ -173,7 +173,9 @@ void PropagateRemoteMove::finalize() record._contentChecksumType = oldRecord._contentChecksumType; if (record._fileSize != oldRecord._fileSize) { qCWarning(lcPropagateRemoteMove) << "File sizes differ on server vs sync journal: " << record._fileSize << oldRecord._fileSize; - record._fileSize = oldRecord._fileSize; // server might have claimed different size, we take the old one from the DB + + // the server might have claimed a different size, we take the old one from the DB + record._fileSize = oldRecord._fileSize; } } diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index 7c77dd283..9cf30c858 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -238,10 +238,17 @@ private: */ void restoreOldFiles(SyncFileItemVector &syncItems); - bool _hasNoneFiles; // true if there is at least one file which was not changed on the server - bool _hasRemoveFile; // true if there is at leasr one file with instruction REMOVE - bool _hasForwardInTimeFiles; // true if there is at least one file from the server that goes forward in time - int _backInTimeFiles; // number of files which goes back in time from the server + // true if there is at least one file which was not changed on the server + bool _hasNoneFiles; + + // true if there is at leasr one file with instruction REMOVE + bool _hasRemoveFile; + + // true if there is at least one file from the server that goes forward in time + bool _hasForwardInTimeFiles; + + // number of files which goes back in time from the server + int _backInTimeFiles; int _uploadLimit; diff --git a/src/libsync/syncjournaldb.cpp b/src/libsync/syncjournaldb.cpp index 5f3f2ed62..128ac5043 100644 --- a/src/libsync/syncjournaldb.cpp +++ b/src/libsync/syncjournaldb.cpp @@ -1631,7 +1631,8 @@ void SyncJournalDb::avoidReadFromDbOnNextSync(const QString& fileName) SqlQuery query(_db); // This query will match entries for which the path is a prefix of fileName - query.prepare("UPDATE metadata SET md5='_invalid_' WHERE ?1 LIKE(path||'/%') AND type == 2;"); // CSYNC_FTW_TYPE_DIR == 2 + // Note: CSYNC_FTW_TYPE_DIR == 2 + query.prepare("UPDATE metadata SET md5='_invalid_' WHERE ?1 LIKE(path||'/%') AND type == 2;"); query.bindValue(1, fileName); query.exec(); -- 2.30.2