Enable all the misc clang-tidy check except one
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 19 Aug 2020 14:32:57 +0000 (16:32 +0200)
committerKevin Ottens <ervin@ipsquad.net>
Mon, 31 Aug 2020 07:14:09 +0000 (09:14 +0200)
This flagged mostly unused parameters. Didn't enable the
misc-non-private-member-variables-in-classes check as we got a lot of
those. Hopefully we'll get to fix them at some point but that feels too
early and too much work for now.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
.clang-tidy
src/common/utility_unix.cpp
src/gui/creds/webflowcredentials.cpp
src/gui/creds/webflowcredentialsdialog.cpp
src/gui/ocssharejob.cpp
src/gui/owncloudgui.cpp
src/gui/remotewipe.cpp
src/gui/socketapi.cpp
src/gui/tray/ActivityListModel.cpp
src/gui/wizard/flow2authcredspage.cpp
test/stubremotewipe.cpp

index b255f3def18e42d480458c66f63d2ea442a3328c..e4eacf0b8c83fbfc5f99940e8c4bd74aef931074 100644 (file)
@@ -1,5 +1,7 @@
 Checks: '-*,
     cppcoreguidelines-init-variables,
+    misc-*,
+    -misc-non-private-member-variables-in-classes,
     modernize-avoid-bind,
     modernize-concat-nested-namespaces,
     modernize-deprecated-headers,
index 135eefef2832bc398117b282ee5d001d559cdfe0..cd4f772e128acd2ac6701a6886c5ee3aac9dd417 100644 (file)
@@ -47,6 +47,7 @@ QString getUserAutostartDir_private()
 
 bool hasLaunchOnStartup_private(const QString &appName)
 {
+    Q_UNUSED(appName)
     QString desktopFileLocation = getUserAutostartDir_private()
                                     + QLatin1String(LINUX_APPLICATION_ID)
                                     + QLatin1String(".desktop");
@@ -55,6 +56,7 @@ bool hasLaunchOnStartup_private(const QString &appName)
 
 void setLaunchOnStartup_private(const QString &appName, const QString &guiName, bool enable)
 {
+    Q_UNUSED(appName)
     QString userAutoStartPath = getUserAutostartDir_private();
     QString desktopFileLocation = userAutoStartPath
                                     + QLatin1String(LINUX_APPLICATION_ID)
index d1c73597ba146d22473bc321b8efb078b12393d9..2915d9ed597dc2a192d80ead2c7de1ae7d8ee984 100644 (file)
@@ -249,6 +249,7 @@ void WebFlowCredentials::persist() {
 
 void WebFlowCredentials::slotWriteClientCertPEMJobDone(KeychainChunk::WriteJob *writeJob)
 {
+    Q_UNUSED(writeJob)
     // write ssl key if there is one
     if (!_clientSslKey.isNull()) {
         auto job = new KeychainChunk::WriteJob(_account,
@@ -295,6 +296,7 @@ void WebFlowCredentials::writeSingleClientCaCertPEM()
 
 void WebFlowCredentials::slotWriteClientKeyPEMJobDone(KeychainChunk::WriteJob *writeJob)
 {
+    Q_UNUSED(writeJob)
     _clientSslCaCertificatesWriteQueue.clear();
 
     // write ca certs if there are any
index ea8d29e7979db7b3ef2764ed2a0dff812f763a41..4253097eb0a2ede73543c8465c66fe7a15291474 100644 (file)
@@ -159,6 +159,7 @@ void WebFlowCredentialsDialog::slotShowSettingsDialog()
 
 void WebFlowCredentialsDialog::slotFlow2AuthResult(Flow2Auth::Result r, const QString &errorString, const QString &user, const QString &appPassword)
 {
+    Q_UNUSED(errorString)
     if(r == Flow2Auth::LoggedIn) {
         emit urlCatched(user, appPassword, QString());
     } else {
index eb651633d931e99e095ce47b8004917a1c33b2e8..228208ff64e3499c485fc638471786d992c5ca4d 100644 (file)
@@ -144,6 +144,7 @@ void OcsShareJob::createShare(const QString &path,
     const QString &shareWith,
     const Share::Permissions permissions)
 {
+    Q_UNUSED(permissions)
     setVerb("POST");
 
     addParam(QString::fromLatin1("path"), path);
index 825844fcbf8f43111f447327c24230bbbfac8210..021e4e02ffa11c3648e31d7168fff1086898cd00 100644 (file)
@@ -248,6 +248,8 @@ void ownCloudGui::slotComputeOverallSyncStatus()
     bool allDisconnected = true;
     QVector<AccountStatePtr> problemAccounts;
     auto setStatusText = [&](const QString &text) {
+        // FIXME: So this doesn't do anything? Needs to be revisited
+        Q_UNUSED(text)
         // Don't overwrite the status if we're currently syncing
         if (FolderMan::instance()->currentSyncFolder())
             return;
index 061acb2e079decde6a934d2c0f5f587c56b0feba..116c9e65c3ca3f384855318a66760d838ac6ed9b 100644 (file)
@@ -25,7 +25,8 @@ namespace OCC {
 Q_LOGGING_CATEGORY(lcRemoteWipe, "nextcloud.gui.remotewipe", QtInfoMsg)
 
 RemoteWipe::RemoteWipe(AccountPtr account, QObject *parent)
-    : _account(account),
+    : QObject(parent),
+      _account(account),
       _appPassword(QString()),
       _accountRemoved(false),
       _networkManager(nullptr),
index 40c93d1f6946b14bb8f970aad9f904b64d359ec6..bba8e41c034963299b13c612f1d34dd418323d78 100644 (file)
@@ -469,6 +469,7 @@ void SocketApi::command_SHARE_MENU_TITLE(const QString &, SocketListener *listen
 
 void SocketApi::command_EDIT(const QString &localFile, SocketListener *listener)
 {
+    Q_UNUSED(listener)
     auto fileData = FileData::get(localFile);
     if (!fileData.folder) {
         qCWarning(lcSocketApi) << "Unknown path" << localFile;
index ddfbd6fcdf28a55d6b3176fac2012aafb8ceaba2..eac45232c18b8f1251d1c2d9cb89c2a5d4fd3fd4 100644 (file)
@@ -35,7 +35,7 @@ namespace OCC {
 Q_LOGGING_CATEGORY(lcActivity, "nextcloud.gui.activity", QtInfoMsg)
 
 ActivityListModel::ActivityListModel(AccountState *accountState, QObject *parent)
-    : QAbstractListModel()
+    : QAbstractListModel(parent)
     , _accountState(accountState)
 {
 }
index b9912152d00a23d968ebbc8871e2d1cb0e7a3db7..9b0f80e00d9131a78aee859273bdac46678879f0 100644 (file)
@@ -75,6 +75,7 @@ void OCC::Flow2AuthCredsPage::cleanupPage()
 
 void Flow2AuthCredsPage::slotFlow2AuthResult(Flow2Auth::Result r, const QString &errorString, const QString &user, const QString &appPassword)
 {
+    Q_UNUSED(errorString)
     switch (r) {
     case Flow2Auth::NotSupported: {
         /* Flow2Auth not supported (can't open browser) */
index fbb46d2210a51427d49d2ba375b4ecccb6c72e82..d74dde2dae591477230521171661e513d9937da7 100644 (file)
@@ -14,7 +14,7 @@ const QMetaObject OCC::AccountManager::staticMetaObject = QObject::staticMetaObj
 
 OCC::FolderMan *OCC::FolderMan::instance() { return static_cast<FolderMan *>(new QObject); }
 void OCC::FolderMan::wipeDone(OCC::AccountState*, bool) { }
-OCC::Folder* OCC::FolderMan::addFolder(OCC::AccountState* as, OCC::FolderDefinition const &f) { return nullptr; }
+OCC::Folder* OCC::FolderMan::addFolder(OCC::AccountState*, OCC::FolderDefinition const &) { return nullptr; }
 void OCC::FolderMan::slotWipeFolderForAccount(OCC::AccountState*) { }
 QString OCC::FolderMan::unescapeAlias(QString const&){ return QString(); }
 QString OCC::FolderMan::escapeAlias(QString const&){ return QString(); }