From a73a1f39276ca5132ba011f9a5d48055b9d7f1b8 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 25 May 2020 21:33:24 +0200 Subject: [PATCH] Use = default for trivial ctors and dtors Signed-off-by: Kevin Ottens --- src/common/checksums.cpp | 4 +--- src/csync/csync_exclude.cpp | 4 +--- src/gui/accountstate.cpp | 4 +--- src/gui/creds/flow2auth.cpp | 4 +--- src/gui/creds/oauth.cpp | 4 +--- src/gui/folderstatusmodel.cpp | 4 +--- src/gui/folderwatcher.cpp | 4 +--- src/gui/folderwatcher_linux.cpp | 4 +--- src/gui/folderwizard.cpp | 16 ++++------------ src/gui/logbrowser.cpp | 4 +--- src/gui/synclogdialog.cpp | 4 +--- src/gui/syncrunfilelog.cpp | 4 +--- src/gui/wizard/owncloudsetuppage.cpp | 4 +--- src/gui/wizard/owncloudwizardresultpage.cpp | 4 +--- src/libsync/account.cpp | 4 +--- src/libsync/bandwidthmanager.cpp | 4 +--- src/libsync/clientsideencryption.cpp | 4 +--- src/libsync/cookiejar.cpp | 4 +--- src/libsync/networkjobs.cpp | 4 +--- src/libsync/owncloudpropagator.cpp | 8 ++------ src/libsync/progressdispatcher.cpp | 4 +--- src/libsync/theme.cpp | 4 +--- 22 files changed, 26 insertions(+), 78 deletions(-) diff --git a/src/common/checksums.cpp b/src/common/checksums.cpp index 566c84ad7..3099c24fb 100644 --- a/src/common/checksums.cpp +++ b/src/common/checksums.cpp @@ -255,9 +255,7 @@ void ValidateChecksumHeader::slotChecksumCalculated(const QByteArray &checksumTy emit validated(checksumType, checksum); } -CSyncChecksumHook::CSyncChecksumHook() -{ -} +CSyncChecksumHook::CSyncChecksumHook() = default; QByteArray CSyncChecksumHook::hook(const QByteArray &path, const QByteArray &otherChecksumHeader, void * /*this_obj*/) { diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index d20e8f49d..dadd611bf 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -261,9 +261,7 @@ ExcludedFiles::ExcludedFiles(QString localPath) addInTreeExcludeFilePath(fi.absoluteFilePath()); } -ExcludedFiles::~ExcludedFiles() -{ -} +ExcludedFiles::~ExcludedFiles() = default; void ExcludedFiles::addExcludeFilePath(const QString &path) { diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 6802dcf7f..be7aa5832 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -57,9 +57,7 @@ AccountState::AccountState(AccountPtr account) _timeSinceLastETagCheck.invalidate(); } -AccountState::~AccountState() -{ -} +AccountState::~AccountState() = default; AccountState *AccountState::loadFromSettings(AccountPtr account, QSettings & /*settings*/) { diff --git a/src/gui/creds/flow2auth.cpp b/src/gui/creds/flow2auth.cpp index e75a8c9bf..b4e826d46 100644 --- a/src/gui/creds/flow2auth.cpp +++ b/src/gui/creds/flow2auth.cpp @@ -41,9 +41,7 @@ Flow2Auth::Flow2Auth(Account *account, QObject *parent) QObject::connect(&_pollTimer, &QTimer::timeout, this, &Flow2Auth::slotPollTimerTimeout); } -Flow2Auth::~Flow2Auth() -{ -} +Flow2Auth::~Flow2Auth() = default; void Flow2Auth::start() { diff --git a/src/gui/creds/oauth.cpp b/src/gui/creds/oauth.cpp index 9870fcd35..fa040955f 100644 --- a/src/gui/creds/oauth.cpp +++ b/src/gui/creds/oauth.cpp @@ -27,9 +27,7 @@ namespace OCC { Q_LOGGING_CATEGORY(lcOauth, "nextcloud.sync.credentials.oauth", QtInfoMsg) -OAuth::~OAuth() -{ -} +OAuth::~OAuth() = default; static void httpReplyAndClose(QTcpSocket *socket, const char *code, const char *html, const char *moreHeaders = nullptr) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index ef773f555..ef200277a 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -49,9 +49,7 @@ FolderStatusModel::FolderStatusModel(QObject *parent) } -FolderStatusModel::~FolderStatusModel() -{ -} +FolderStatusModel::~FolderStatusModel() = default; static bool sortByFolderHeader(const FolderStatusModel::SubFolderInfo &lhs, const FolderStatusModel::SubFolderInfo &rhs) { diff --git a/src/gui/folderwatcher.cpp b/src/gui/folderwatcher.cpp index 65e68cb36..d73e913f5 100644 --- a/src/gui/folderwatcher.cpp +++ b/src/gui/folderwatcher.cpp @@ -44,9 +44,7 @@ FolderWatcher::FolderWatcher(Folder *folder) { } -FolderWatcher::~FolderWatcher() -{ -} +FolderWatcher::~FolderWatcher() = default; void FolderWatcher::init(const QString &root) { diff --git a/src/gui/folderwatcher_linux.cpp b/src/gui/folderwatcher_linux.cpp index 2929a9ff8..c048a552d 100644 --- a/src/gui/folderwatcher_linux.cpp +++ b/src/gui/folderwatcher_linux.cpp @@ -42,9 +42,7 @@ FolderWatcherPrivate::FolderWatcherPrivate(FolderWatcher *p, const QString &path QMetaObject::invokeMethod(this, "slotAddFolderRecursive", Q_ARG(QString, path)); } -FolderWatcherPrivate::~FolderWatcherPrivate() -{ -} +FolderWatcherPrivate::~FolderWatcherPrivate() = default; // attention: result list passed by reference! bool FolderWatcherPrivate::findFoldersBelow(const QDir &dir, QStringList &fullList) diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index 1f51a3020..6e1ca4790 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -77,9 +77,7 @@ FolderWizardLocalPath::FolderWizardLocalPath(const AccountPtr &account) _ui.warnLabel->hide(); } -FolderWizardLocalPath::~FolderWizardLocalPath() -{ -} +FolderWizardLocalPath::~FolderWizardLocalPath() = default; void FolderWizardLocalPath::initializePage() { @@ -416,9 +414,7 @@ LsColJob *FolderWizardRemotePath::runLsColJob(const QString &path) return job; } -FolderWizardRemotePath::~FolderWizardRemotePath() -{ -} +FolderWizardRemotePath::~FolderWizardRemotePath() = default; bool FolderWizardRemotePath::isComplete() const { @@ -485,9 +481,7 @@ FolderWizardSelectiveSync::FolderWizardSelectiveSync(const AccountPtr &account) layout->addWidget(_selectiveSync); } -FolderWizardSelectiveSync::~FolderWizardSelectiveSync() -{ -} +FolderWizardSelectiveSync::~FolderWizardSelectiveSync() = default; void FolderWizardSelectiveSync::initializePage() @@ -552,9 +546,7 @@ FolderWizard::FolderWizard(AccountPtr account, QWidget *parent) setButtonText(QWizard::FinishButton, tr("Add Sync Connection")); } -FolderWizard::~FolderWizard() -{ -} +FolderWizard::~FolderWizard() = default; bool FolderWizard::eventFilter(QObject *watched, QEvent *event) { diff --git a/src/gui/logbrowser.cpp b/src/gui/logbrowser.cpp index 691ed2373..52119b754 100644 --- a/src/gui/logbrowser.cpp +++ b/src/gui/logbrowser.cpp @@ -143,9 +143,7 @@ LogBrowser::LogBrowser(QWidget *parent) _logWidget->document()->setMaximumBlockCount(lines); } -LogBrowser::~LogBrowser() -{ -} +LogBrowser::~LogBrowser() = default; void LogBrowser::showEvent(QShowEvent *) { diff --git a/src/gui/synclogdialog.cpp b/src/gui/synclogdialog.cpp index 85f043f1a..ce355aa78 100644 --- a/src/gui/synclogdialog.cpp +++ b/src/gui/synclogdialog.cpp @@ -41,7 +41,5 @@ SyncLogDialog::SyncLogDialog(QWidget *parent) } } -SyncLogDialog::~SyncLogDialog() -{ -} +SyncLogDialog::~SyncLogDialog() = default; } diff --git a/src/gui/syncrunfilelog.cpp b/src/gui/syncrunfilelog.cpp index e493918e1..ff913f64e 100644 --- a/src/gui/syncrunfilelog.cpp +++ b/src/gui/syncrunfilelog.cpp @@ -21,9 +21,7 @@ namespace OCC { -SyncRunFileLog::SyncRunFileLog() -{ -} +SyncRunFileLog::SyncRunFileLog() = default; QString SyncRunFileLog::dateTimeStr(const QDateTime &dt) { diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp index 954e3f47b..d0a41e43c 100644 --- a/src/gui/wizard/owncloudsetuppage.cpp +++ b/src/gui/wizard/owncloudsetuppage.cpp @@ -416,9 +416,7 @@ void OwncloudSetupPage::slotCertificateAccepted() } } -OwncloudSetupPage::~OwncloudSetupPage() -{ -} +OwncloudSetupPage::~OwncloudSetupPage() = default; void OwncloudSetupPage::slotStyleChanged() { diff --git a/src/gui/wizard/owncloudwizardresultpage.cpp b/src/gui/wizard/owncloudwizardresultpage.cpp index 79446de37..c7f0ad616 100644 --- a/src/gui/wizard/owncloudwizardresultpage.cpp +++ b/src/gui/wizard/owncloudwizardresultpage.cpp @@ -54,9 +54,7 @@ OwncloudWizardResultPage::OwncloudWizardResultPage() setupCustomization(); } -OwncloudWizardResultPage::~OwncloudWizardResultPage() -{ -} +OwncloudWizardResultPage::~OwncloudWizardResultPage() = default; void OwncloudWizardResultPage::setComplete(bool complete) { diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 6908cd3b0..692b86a7a 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -75,9 +75,7 @@ ClientSideEncryption* Account::e2e() return &_e2e; } -Account::~Account() -{ -} +Account::~Account() = default; QString Account::davPath() const { diff --git a/src/libsync/bandwidthmanager.cpp b/src/libsync/bandwidthmanager.cpp index 95564bb7b..d177a6275 100644 --- a/src/libsync/bandwidthmanager.cpp +++ b/src/libsync/bandwidthmanager.cpp @@ -87,9 +87,7 @@ BandwidthManager::BandwidthManager(OwncloudPropagator *p) _relativeDownloadDelayTimer.setSingleShot(true); // will be restarted from the measuring timer } -BandwidthManager::~BandwidthManager() -{ -} +BandwidthManager::~BandwidthManager() = default; void BandwidthManager::registerUploadDevice(UploadDevice *p) { diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index 151ebcabd..33fbd4d9c 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -610,9 +610,7 @@ QByteArray encryptStringAsymmetric(EVP_PKEY *publicKey, const QByteArray& data) } } -ClientSideEncryption::ClientSideEncryption() -{ -} +ClientSideEncryption::ClientSideEncryption() = default; void ClientSideEncryption::setAccount(AccountPtr account) { diff --git a/src/libsync/cookiejar.cpp b/src/libsync/cookiejar.cpp index 615220e8d..9824aab5d 100644 --- a/src/libsync/cookiejar.cpp +++ b/src/libsync/cookiejar.cpp @@ -71,9 +71,7 @@ CookieJar::CookieJar(QObject *parent) { } -CookieJar::~CookieJar() -{ -} +CookieJar::~CookieJar() = default; bool CookieJar::setCookiesFromUrl(const QList &cookieList, const QUrl &url) { diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index c1bf86d42..bd3858650 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -182,9 +182,7 @@ static QString readContentsAsString(QXmlStreamReader &reader) } -LsColXMLParser::LsColXMLParser() -{ -} +LsColXMLParser::LsColXMLParser() = default; bool LsColXMLParser::parse(const QByteArray &xml, QHash *fileInfo, const QString &expectedPath) { diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp index 112068145..7a1274bd7 100644 --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@ -73,9 +73,7 @@ qint64 freeSpaceLimit() return value; } -OwncloudPropagator::~OwncloudPropagator() -{ -} +OwncloudPropagator::~OwncloudPropagator() = default; int OwncloudPropagator::maximumActiveTransferJob() @@ -1001,9 +999,7 @@ void PropagateDirectory::slotSubJobsFinished(SyncFileItem::Status status) // ================================================================================ -CleanupPollsJob::~CleanupPollsJob() -{ -} +CleanupPollsJob::~CleanupPollsJob() = default; void CleanupPollsJob::start() { diff --git a/src/libsync/progressdispatcher.cpp b/src/libsync/progressdispatcher.cpp index 179d28319..518bd9ec0 100644 --- a/src/libsync/progressdispatcher.cpp +++ b/src/libsync/progressdispatcher.cpp @@ -113,9 +113,7 @@ ProgressDispatcher::ProgressDispatcher(QObject *parent) { } -ProgressDispatcher::~ProgressDispatcher() -{ -} +ProgressDispatcher::~ProgressDispatcher() = default; void ProgressDispatcher::setProgressInfo(const QString &folder, const ProgressInfo &progress) { diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index 48ceb5f93..11d7a1065 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -50,9 +50,7 @@ Theme *Theme::instance() return _instance; } -Theme::~Theme() -{ -} +Theme::~Theme() = default; QString Theme::statusHeaderText(SyncResult::Status status) const {