Reformatting: Adjust trailing comments
authorChristian Kamm <mail@ckamm.de>
Fri, 28 Apr 2017 08:03:49 +0000 (10:03 +0200)
committerckamm <mail@ckamm.de>
Wed, 17 May 2017 10:26:27 +0000 (12:26 +0200)
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
src/gui/creds/shibbolethcredentials.cpp
src/gui/folderstatusmodel.h
src/libsync/bandwidthmanager.h
src/libsync/discoveryphase.cpp
src/libsync/propagateremotemove.cpp
src/libsync/syncengine.h
src/libsync/syncjournaldb.cpp

index e4ea56e189817768a7994f2c04b113b0bcc6f356..975ddf3e456008dc7148c149087fe9cc52f1cd44 100644 (file)
@@ -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();
index d5dd1726cfc4f17e58f53d560c01528a17f394b5..a8cae2eb6d91f267ae4d3902b504e024fff265eb 100644 (file)
@@ -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
     }
index 197c82e655de7f42294ab9dac4d37af98d912a24..d7ad69cb245cdb5aeb43dffc4231eca9a7f674d4 100644 (file)
@@ -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;
 };
index 7660525aa8112edabf698dd50b94960fb7b0995a..a57ca073fa40568eaadd8333526f605f814bc185 100644 (file)
@@ -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<UploadDevice*> _absoluteUploadDeviceList;
-    QLinkedList<UploadDevice*> _relativeUploadDeviceList; // FIXME merge with list above ^^
+    QLinkedList<UploadDevice*> _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<GETFileJob*> _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;
 };
 
index a221d79c8caabc3040f9819c3cf3f6b3ab387137..9a8be41aa14a6569689aab697205280995d8b790 100644 (file)
@@ -667,7 +667,8 @@ void DiscoveryJob::remote_vio_closedir_hook (csync_vio_handle_t *dhandle,  void
         DiscoveryDirectoryResult *directoryResult = static_cast<DiscoveryDirectoryResult*> (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;
     }
 }
 
index c878b1cf74470e2cdc6e739f61c4d25d73e0bf87..de7952de7b52f4a78b47fb439afbd3dfe2017693 100644 (file)
@@ -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;
         }
     }
 
index 7c77dd283b897b3559b956f533718a9385378180..9cf30c8581ae91b70190ed22d2d8ad43fcf23c19 100644 (file)
@@ -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;
index 5f3f2ed621846651fa0d269c4378926c605fe447..128ac50438b227b0e2bfafdd5fba15c33db8804f 100644 (file)
@@ -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();