Enable the modernize-use-equals-default check on clang-tidy
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 12 Aug 2020 15:19:49 +0000 (17:19 +0200)
committerKevin Ottens <ervin@ipsquad.net>
Thu, 13 Aug 2020 12:19:42 +0000 (14:19 +0200)
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
16 files changed:
.clang-tidy
src/common/ownsql.cpp
src/common/syncjournalfilerecord.cpp
src/gui/accountmanager.h
src/gui/creds/webflowcredentials.cpp
src/gui/folderwatcher_linux.h
src/gui/systray.h
src/gui/tray/UserModel.h
src/gui/wizard/webviewpage.cpp
src/libsync/account.h
src/libsync/creds/abstractcredentials.cpp
src/libsync/creds/httpcredentials.cpp
src/libsync/owncloudpropagator.h
src/libsync/syncfilestatus.cpp
src/libsync/syncresult.cpp
test/syncenginetestutils.h

index 17e948c2a1ab240e012cb93ad8263dc0faa3bf5e..203c6393c547c76ba1a6edb91444ade582ef2328 100644 (file)
@@ -16,6 +16,7 @@ Checks: '-*,
     modernize-use-emplace,
     modernize-use-equals-delete,
     modernize-use-nodiscard,
+    modernize-use-equals-default,
     modernize-use-noexcept,
     modernize-user-override,
     modernize-use-nullptr,
index 5646e0ab44f1df242752a49d76e1764e177a6ec7..04ec4106df468858c70fd953d795b1ae9959298b 100644 (file)
@@ -43,9 +43,7 @@ namespace OCC {
 
 Q_LOGGING_CATEGORY(lcSql, "nextcloud.sync.database.sql", QtInfoMsg)
 
-SqlDatabase::SqlDatabase()
-{
-}
+SqlDatabase::SqlDatabase() = default;
 
 SqlDatabase::~SqlDatabase()
 {
index 082b52b6d246c0b55f5ca653f330b3a1eb2c6a51..24244eb1258506ea803c00799d7ffb766605d0cf 100644 (file)
@@ -21,9 +21,7 @@
 
 namespace OCC {
 
-SyncJournalFileRecord::SyncJournalFileRecord()
-{
-}
+SyncJournalFileRecord::SyncJournalFileRecord() = default;
 
 QByteArray SyncJournalFileRecord::numericFileId() const
 {
index 4719b8109d075da51bb988e7041e1aa941f35b85..e06148757b9d16e8ae3967074be0c3b1f7bfcc87 100644 (file)
@@ -28,7 +28,7 @@ class AccountManager : public QObject
     Q_OBJECT
 public:
     static AccountManager *instance();
-    ~AccountManager() {}
+    ~AccountManager() = default;
 
     /**
      * Saves the accounts to a given settings file
@@ -89,7 +89,7 @@ private:
     // Adds an account to the tracked list, emitting accountAdded()
     void addAccountState(AccountState *accountState);
 
-    AccountManager() {}
+    AccountManager() = default;
     QList<AccountStatePtr> _accounts;
 
 public slots:
index 58beb358cf3ac3121f08bacbb385adc4d3aeac60..d1c73597ba146d22473bc321b8efb078b12393d9 100644 (file)
@@ -85,10 +85,7 @@ static void addSettingsToJob(Account *account, QKeychain::Job *job)
 }
 #endif
 
-WebFlowCredentials::WebFlowCredentials()
-{
-
-}
+WebFlowCredentials::WebFlowCredentials() = default;
 
 WebFlowCredentials::WebFlowCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key, const QList<QSslCertificate> &caCertificates)
     : _user(user)
index 24d3377777c23ef803dab245946cfd986f42e551..e44fc421c8856c33d949aa2c41063c0de8201b38 100644 (file)
@@ -33,7 +33,7 @@ class FolderWatcherPrivate : public QObject
 {
     Q_OBJECT
 public:
-    FolderWatcherPrivate() {}
+    FolderWatcherPrivate() = default;
     FolderWatcherPrivate(FolderWatcher *p, const QString &path);
     ~FolderWatcherPrivate();
 
index 995d7c6198eebb5cd5cc68909fc9097a464c774d..d4282cb86ab7d726d5419457292313e6866453b2 100644 (file)
@@ -45,7 +45,7 @@ class Systray
     Q_OBJECT
 public:
     static Systray *instance();
-    virtual ~Systray() {};
+    virtual ~Systray() = default;
 
     enum class TaskBarPosition { Bottom, Left, Top, Right };
     Q_ENUM(TaskBarPosition);
index 8fcd65f80ff82f144c63dfb4b1595a5fd1495e6f..fd48f1110a730d256ab2875a64c3f306269b7804 100644 (file)
@@ -91,7 +91,7 @@ class UserModel : public QAbstractListModel
     Q_PROPERTY(User* currentUser READ currentUser NOTIFY newUserSelected)
 public:
     static UserModel *instance();
-    virtual ~UserModel() {};
+    virtual ~UserModel() = default;
 
     void addUser(AccountStatePtr &user, const bool &isCurrent = false);
     int currentUserIndex();
@@ -163,7 +163,7 @@ class UserAppsModel : public QAbstractListModel
     Q_OBJECT
 public:
     static UserAppsModel *instance();
-    virtual ~UserAppsModel() {};
+    virtual ~UserAppsModel() = default;
 
     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
 
index fc86ba419b6a82039bb0e61531ba95d01bd49615..01311e839bf6d1358a372d4ba39b82dff45c336a 100644 (file)
@@ -32,9 +32,10 @@ WebViewPage::WebViewPage(QWidget *parent)
     //_useSystemProxy = QNetworkProxyFactory::usesSystemConfiguration();
 }
 
-WebViewPage::~WebViewPage() {
-    //QNetworkProxyFactory::setUseSystemConfiguration(_useSystemProxy);
-}
+WebViewPage::~WebViewPage() = default;
+//{
+//    QNetworkProxyFactory::setUseSystemConfiguration(_useSystemProxy);
+//}
 
 void WebViewPage::initializePage() {
     //QNetworkProxy::setApplicationProxy(QNetworkProxy::applicationProxy());
index 3df7a29a16f75986c5026a2e8439d9bffa90ebac..92008ff0824f14330a036ffb292a2c165eefbd0d 100644 (file)
@@ -62,7 +62,7 @@ class SimpleNetworkJob;
 class AbstractSslErrorHandler
 {
 public:
-    virtual ~AbstractSslErrorHandler() {}
+    virtual ~AbstractSslErrorHandler() = default;
     virtual bool handleErrors(QList<QSslError>, const QSslConfiguration &conf, QList<QSslCertificate> *, AccountPtr) = 0;
 };
 
index e71ca059edb2adfff4a5a4725e2160b0e7b48654..839bf3bbb39b50e013413a400f375b3cc36440d5 100644 (file)
@@ -23,9 +23,7 @@ namespace OCC {
 
 Q_LOGGING_CATEGORY(lcCredentials, "nextcloud.sync.credentials", QtInfoMsg)
 
-AbstractCredentials::AbstractCredentials()
-{
-}
+AbstractCredentials::AbstractCredentials() = default;
 
 void AbstractCredentials::setAccount(Account *account)
 {
index a5e74da51b27856af33614eea40257cd55605672..9b1d10a9e3fb68600c7fe2ff82170d471492aa2c 100644 (file)
@@ -103,9 +103,7 @@ static void addSettingsToJob(Account *account, QKeychain::Job *job)
     job->setSettings(settings.release());
 }
 
-HttpCredentials::HttpCredentials()
-{
-}
+HttpCredentials::HttpCredentials() = default;
 
 // From wizard
 HttpCredentials::HttpCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key)
index af944e8e9455730e650de833c86fb2988c7f8fe2..e00ed328cb4ac82f086aeb7a9cedeb2a51a28f22 100644 (file)
@@ -225,12 +225,10 @@ public:
     {
     }
 
-    virtual ~PropagatorCompositeJob()
-    {
-        // Don't delete jobs in _jobsToDo and _runningJobs: they have parents
-        // that will be responsible for cleanup. Deleting them here would risk
-        // deleting something that has already been deleted by a shared parent.
-    }
+    // Don't delete jobs in _jobsToDo and _runningJobs: they have parents
+    // that will be responsible for cleanup. Deleting them here would risk
+    // deleting something that has already been deleted by a shared parent.
+    virtual ~PropagatorCompositeJob() = default;
 
     void appendJob(PropagatorJob *job);
     void appendTask(const SyncFileItemPtr &item)
index c937f9b299319b2b4ab223ab64768ade886542e5..6ffea64c2827989e662aebbc946720a427d0871b 100644 (file)
@@ -15,9 +15,7 @@
 #include "syncfilestatus.h"
 
 namespace OCC {
-SyncFileStatus::SyncFileStatus()
-{
-}
+SyncFileStatus::SyncFileStatus() = default;
 
 SyncFileStatus::SyncFileStatus(SyncFileStatusTag tag)
     : _tag(tag)
index e33d7354ec185ecccc92fdd2bad9596cbdd259af..2e2c01033de716864d62d6b95a842f6d71f66a93 100644 (file)
@@ -17,9 +17,7 @@
 
 namespace OCC {
 
-SyncResult::SyncResult()
-{
-}
+SyncResult::SyncResult() = default;
 
 SyncResult::Status SyncResult::status() const
 {
index fedf091ac828ac3eef14fde2d5ab2daf19565319..055f11e4531ba6ac1b5c8a05560932abfaaf2767 100644 (file)
@@ -66,7 +66,7 @@ public:
 class FileModifier
 {
 public:
-    virtual ~FileModifier() { }
+    virtual ~FileModifier() = default;
     virtual void remove(const QString &relativePath) = 0;
     virtual void insert(const QString &relativePath, qint64 size = 64, char contentChar = 'W') = 0;
     virtual void setContents(const QString &relativePath, char contentChar) = 0;