Enable the modernize-use-equals-default check on clang-tidy

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Kevin Ottens 2020-08-12 17:19:49 +02:00 committed by Kevin Ottens
parent 2d4d66b998
commit 2f8c29082a
16 changed files with 24 additions and 39 deletions

View file

@ -16,6 +16,7 @@ Checks: '-*,
modernize-use-emplace, modernize-use-emplace,
modernize-use-equals-delete, modernize-use-equals-delete,
modernize-use-nodiscard, modernize-use-nodiscard,
modernize-use-equals-default,
modernize-use-noexcept, modernize-use-noexcept,
modernize-user-override, modernize-user-override,
modernize-use-nullptr, modernize-use-nullptr,

View file

@ -43,9 +43,7 @@ namespace OCC {
Q_LOGGING_CATEGORY(lcSql, "nextcloud.sync.database.sql", QtInfoMsg) Q_LOGGING_CATEGORY(lcSql, "nextcloud.sync.database.sql", QtInfoMsg)
SqlDatabase::SqlDatabase() SqlDatabase::SqlDatabase() = default;
{
}
SqlDatabase::~SqlDatabase() SqlDatabase::~SqlDatabase()
{ {

View file

@ -21,9 +21,7 @@
namespace OCC { namespace OCC {
SyncJournalFileRecord::SyncJournalFileRecord() SyncJournalFileRecord::SyncJournalFileRecord() = default;
{
}
QByteArray SyncJournalFileRecord::numericFileId() const QByteArray SyncJournalFileRecord::numericFileId() const
{ {

View file

@ -28,7 +28,7 @@ class AccountManager : public QObject
Q_OBJECT Q_OBJECT
public: public:
static AccountManager *instance(); static AccountManager *instance();
~AccountManager() {} ~AccountManager() = default;
/** /**
* Saves the accounts to a given settings file * Saves the accounts to a given settings file
@ -89,7 +89,7 @@ private:
// Adds an account to the tracked list, emitting accountAdded() // Adds an account to the tracked list, emitting accountAdded()
void addAccountState(AccountState *accountState); void addAccountState(AccountState *accountState);
AccountManager() {} AccountManager() = default;
QList<AccountStatePtr> _accounts; QList<AccountStatePtr> _accounts;
public slots: public slots:

View file

@ -85,10 +85,7 @@ static void addSettingsToJob(Account *account, QKeychain::Job *job)
} }
#endif #endif
WebFlowCredentials::WebFlowCredentials() WebFlowCredentials::WebFlowCredentials() = default;
{
}
WebFlowCredentials::WebFlowCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key, const QList<QSslCertificate> &caCertificates) WebFlowCredentials::WebFlowCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key, const QList<QSslCertificate> &caCertificates)
: _user(user) : _user(user)

View file

@ -33,7 +33,7 @@ class FolderWatcherPrivate : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
FolderWatcherPrivate() {} FolderWatcherPrivate() = default;
FolderWatcherPrivate(FolderWatcher *p, const QString &path); FolderWatcherPrivate(FolderWatcher *p, const QString &path);
~FolderWatcherPrivate(); ~FolderWatcherPrivate();

View file

@ -45,7 +45,7 @@ class Systray
Q_OBJECT Q_OBJECT
public: public:
static Systray *instance(); static Systray *instance();
virtual ~Systray() {}; virtual ~Systray() = default;
enum class TaskBarPosition { Bottom, Left, Top, Right }; enum class TaskBarPosition { Bottom, Left, Top, Right };
Q_ENUM(TaskBarPosition); Q_ENUM(TaskBarPosition);

View file

@ -91,7 +91,7 @@ class UserModel : public QAbstractListModel
Q_PROPERTY(User* currentUser READ currentUser NOTIFY newUserSelected) Q_PROPERTY(User* currentUser READ currentUser NOTIFY newUserSelected)
public: public:
static UserModel *instance(); static UserModel *instance();
virtual ~UserModel() {}; virtual ~UserModel() = default;
void addUser(AccountStatePtr &user, const bool &isCurrent = false); void addUser(AccountStatePtr &user, const bool &isCurrent = false);
int currentUserIndex(); int currentUserIndex();
@ -163,7 +163,7 @@ class UserAppsModel : public QAbstractListModel
Q_OBJECT Q_OBJECT
public: public:
static UserAppsModel *instance(); static UserAppsModel *instance();
virtual ~UserAppsModel() {}; virtual ~UserAppsModel() = default;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override;

View file

@ -32,9 +32,10 @@ WebViewPage::WebViewPage(QWidget *parent)
//_useSystemProxy = QNetworkProxyFactory::usesSystemConfiguration(); //_useSystemProxy = QNetworkProxyFactory::usesSystemConfiguration();
} }
WebViewPage::~WebViewPage() { WebViewPage::~WebViewPage() = default;
//QNetworkProxyFactory::setUseSystemConfiguration(_useSystemProxy); //{
} // QNetworkProxyFactory::setUseSystemConfiguration(_useSystemProxy);
//}
void WebViewPage::initializePage() { void WebViewPage::initializePage() {
//QNetworkProxy::setApplicationProxy(QNetworkProxy::applicationProxy()); //QNetworkProxy::setApplicationProxy(QNetworkProxy::applicationProxy());

View file

@ -62,7 +62,7 @@ class SimpleNetworkJob;
class AbstractSslErrorHandler class AbstractSslErrorHandler
{ {
public: public:
virtual ~AbstractSslErrorHandler() {} virtual ~AbstractSslErrorHandler() = default;
virtual bool handleErrors(QList<QSslError>, const QSslConfiguration &conf, QList<QSslCertificate> *, AccountPtr) = 0; virtual bool handleErrors(QList<QSslError>, const QSslConfiguration &conf, QList<QSslCertificate> *, AccountPtr) = 0;
}; };

View file

@ -23,9 +23,7 @@ namespace OCC {
Q_LOGGING_CATEGORY(lcCredentials, "nextcloud.sync.credentials", QtInfoMsg) Q_LOGGING_CATEGORY(lcCredentials, "nextcloud.sync.credentials", QtInfoMsg)
AbstractCredentials::AbstractCredentials() AbstractCredentials::AbstractCredentials() = default;
{
}
void AbstractCredentials::setAccount(Account *account) void AbstractCredentials::setAccount(Account *account)
{ {

View file

@ -103,9 +103,7 @@ static void addSettingsToJob(Account *account, QKeychain::Job *job)
job->setSettings(settings.release()); job->setSettings(settings.release());
} }
HttpCredentials::HttpCredentials() HttpCredentials::HttpCredentials() = default;
{
}
// From wizard // From wizard
HttpCredentials::HttpCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key) HttpCredentials::HttpCredentials(const QString &user, const QString &password, const QSslCertificate &certificate, const QSslKey &key)

View 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
// Don't delete jobs in _jobsToDo and _runningJobs: they have parents // deleting something that has already been deleted by a shared parent.
// that will be responsible for cleanup. Deleting them here would risk virtual ~PropagatorCompositeJob() = default;
// deleting something that has already been deleted by a shared parent.
}
void appendJob(PropagatorJob *job); void appendJob(PropagatorJob *job);
void appendTask(const SyncFileItemPtr &item) void appendTask(const SyncFileItemPtr &item)

View file

@ -15,9 +15,7 @@
#include "syncfilestatus.h" #include "syncfilestatus.h"
namespace OCC { namespace OCC {
SyncFileStatus::SyncFileStatus() SyncFileStatus::SyncFileStatus() = default;
{
}
SyncFileStatus::SyncFileStatus(SyncFileStatusTag tag) SyncFileStatus::SyncFileStatus(SyncFileStatusTag tag)
: _tag(tag) : _tag(tag)

View file

@ -17,9 +17,7 @@
namespace OCC { namespace OCC {
SyncResult::SyncResult() SyncResult::SyncResult() = default;
{
}
SyncResult::Status SyncResult::status() const SyncResult::Status SyncResult::status() const
{ {

View file

@ -66,7 +66,7 @@ public:
class FileModifier class FileModifier
{ {
public: public:
virtual ~FileModifier() { } virtual ~FileModifier() = default;
virtual void remove(const QString &relativePath) = 0; virtual void remove(const QString &relativePath) = 0;
virtual void insert(const QString &relativePath, qint64 size = 64, char contentChar = 'W') = 0; virtual void insert(const QString &relativePath, qint64 size = 64, char contentChar = 'W') = 0;
virtual void setContents(const QString &relativePath, char contentChar) = 0; virtual void setContents(const QString &relativePath, char contentChar) = 0;