From 533a5d09393339d4c621bd976ddabd2f03aebdfc Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 10 Oct 2018 21:26:46 +0200 Subject: [PATCH] Use override --- connector/syncthingconnection.h | 2 +- fileitemactionplugin/syncthingfileitemaction.h | 2 +- model/syncthingdevicemodel.h | 18 +++++++++--------- model/syncthingdirectorymodel.h | 18 +++++++++--------- model/syncthingdownloadmodel.h | 16 ++++++++-------- plasmoid/lib/syncthingapplet.h | 2 +- tray/gui/devbuttonsitemdelegate.h | 2 +- tray/gui/devview.h | 2 +- tray/gui/dirbuttonsitemdelegate.h | 2 +- tray/gui/dirview.h | 2 +- tray/gui/downloaditemdelegate.h | 4 ++-- tray/gui/downloadview.h | 2 +- tray/gui/traymenu.h | 2 +- tray/gui/traywidget.h | 2 +- widgets/misc/errorviewdialog.h | 2 +- widgets/misc/textviewdialog.h | 2 +- widgets/settings/settingsdialog.h | 2 +- widgets/webview/webpage.h | 8 ++++---- widgets/webview/webviewdialog.h | 8 ++++---- widgets/webview/webviewinterceptor.h | 2 +- 20 files changed, 50 insertions(+), 50 deletions(-) diff --git a/connector/syncthingconnection.h b/connector/syncthingconnection.h index 28e6a9b..71609f9 100644 --- a/connector/syncthingconnection.h +++ b/connector/syncthingconnection.h @@ -94,7 +94,7 @@ class LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingConnection : public QObject { public: explicit SyncthingConnection( const QString &syncthingUrl = QStringLiteral("http://localhost:8080"), const QByteArray &apiKey = QByteArray(), QObject *parent = nullptr); - ~SyncthingConnection(); + ~SyncthingConnection() override; const QString &syncthingUrl() const; void setSyncthingUrl(const QString &url); diff --git a/fileitemactionplugin/syncthingfileitemaction.h b/fileitemactionplugin/syncthingfileitemaction.h index 0d778b2..2f7db1c 100644 --- a/fileitemactionplugin/syncthingfileitemaction.h +++ b/fileitemactionplugin/syncthingfileitemaction.h @@ -33,7 +33,7 @@ public: SyncthingInfoAction(QObject *parent = nullptr); protected: - QWidget *createWidget(QWidget *parent); + QWidget *createWidget(QWidget *parent) override; }; class SyncthingDirActions : public QObject { diff --git a/model/syncthingdevicemodel.h b/model/syncthingdevicemodel.h index 1cfc317..194ffa8 100644 --- a/model/syncthingdevicemodel.h +++ b/model/syncthingdevicemodel.h @@ -27,15 +27,15 @@ public: explicit SyncthingDeviceModel(SyncthingConnection &connection, QObject *parent = nullptr); public Q_SLOTS: - QHash roleNames() const; - const QVector &colorRoles() const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; + QHash roleNames() const override; + const QVector &colorRoles() const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex &index, int role) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; + int rowCount(const QModelIndex &parent) const override; + int columnCount(const QModelIndex &parent) const override; const SyncthingDev *devInfo(const QModelIndex &index) const; private Q_SLOTS: diff --git a/model/syncthingdirectorymodel.h b/model/syncthingdirectorymodel.h index fff63cf..baace10 100644 --- a/model/syncthingdirectorymodel.h +++ b/model/syncthingdirectorymodel.h @@ -27,15 +27,15 @@ public: explicit SyncthingDirectoryModel(SyncthingConnection &connection, QObject *parent = nullptr); public Q_SLOTS: - QHash roleNames() const; - const QVector &colorRoles() const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; + QHash roleNames() const override; + const QVector &colorRoles() const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex &index, int role) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; + int rowCount(const QModelIndex &parent) const override; + int columnCount(const QModelIndex &parent) const override; const SyncthingDir *dirInfo(const QModelIndex &index) const; private Q_SLOTS: diff --git a/model/syncthingdownloadmodel.h b/model/syncthingdownloadmodel.h index 42a3801..cabea06 100644 --- a/model/syncthingdownloadmodel.h +++ b/model/syncthingdownloadmodel.h @@ -23,14 +23,14 @@ public: enum SyncthingDownloadModelRole { ItemPercentage = Qt::UserRole + 1, ItemProgressLabel, ItemPath }; public Q_SLOTS: - QHash roleNames() const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; + QHash roleNames() const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex &index, int role) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; + int rowCount(const QModelIndex &parent) const override; + int columnCount(const QModelIndex &parent) const override; const SyncthingDir *dirInfo(const QModelIndex &index) const; const SyncthingItemDownloadProgress *progressInfo(const QModelIndex &index) const; unsigned int pendingDownloads() const; diff --git a/plasmoid/lib/syncthingapplet.h b/plasmoid/lib/syncthingapplet.h index 20ea89b..0026d73 100644 --- a/plasmoid/lib/syncthingapplet.h +++ b/plasmoid/lib/syncthingapplet.h @@ -95,7 +95,7 @@ public: void setPassiveStates(const QList &passiveStates); public Q_SLOTS: - void init() Q_DECL_OVERRIDE; + void init() override; void showSettingsDlg(); void showWebUI(); void showLog(); diff --git a/tray/gui/devbuttonsitemdelegate.h b/tray/gui/devbuttonsitemdelegate.h index 04ab30c..89b50be 100644 --- a/tray/gui/devbuttonsitemdelegate.h +++ b/tray/gui/devbuttonsitemdelegate.h @@ -12,7 +12,7 @@ class DevButtonsItemDelegate : public QStyledItemDelegate { public: DevButtonsItemDelegate(QObject *parent); - void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const; + void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; private: const QPixmap m_pauseIcon; diff --git a/tray/gui/devview.h b/tray/gui/devview.h index e5d793b..30a753c 100644 --- a/tray/gui/devview.h +++ b/tray/gui/devview.h @@ -18,7 +18,7 @@ Q_SIGNALS: void pauseResumeDev(const Data::SyncthingDev &dev); protected: - void mouseReleaseEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event) override; private Q_SLOTS: void showContextMenu(); diff --git a/tray/gui/dirbuttonsitemdelegate.h b/tray/gui/dirbuttonsitemdelegate.h index f5b04d6..795f35f 100644 --- a/tray/gui/dirbuttonsitemdelegate.h +++ b/tray/gui/dirbuttonsitemdelegate.h @@ -11,7 +11,7 @@ class DirButtonsItemDelegate : public QStyledItemDelegate { public: DirButtonsItemDelegate(QObject *parent); - void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const; + void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; private: const QPixmap m_refreshIcon; diff --git a/tray/gui/dirview.h b/tray/gui/dirview.h index c1b35f0..42b5e0e 100644 --- a/tray/gui/dirview.h +++ b/tray/gui/dirview.h @@ -20,7 +20,7 @@ Q_SIGNALS: void pauseResumeDir(const Data::SyncthingDir &dir); protected: - void mouseReleaseEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event) override; private Q_SLOTS: void showContextMenu(); diff --git a/tray/gui/downloaditemdelegate.h b/tray/gui/downloaditemdelegate.h index 14ad73d..53fd3d9 100644 --- a/tray/gui/downloaditemdelegate.h +++ b/tray/gui/downloaditemdelegate.h @@ -11,8 +11,8 @@ class DownloadItemDelegate : public QStyledItemDelegate { public: DownloadItemDelegate(QObject *parent); - void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: const QPixmap m_folderIcon; diff --git a/tray/gui/downloadview.h b/tray/gui/downloadview.h index 6f47e4c..8935ef3 100644 --- a/tray/gui/downloadview.h +++ b/tray/gui/downloadview.h @@ -20,7 +20,7 @@ Q_SIGNALS: void openItemDir(const Data::SyncthingItemDownloadProgress &dir); protected: - void mouseReleaseEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event) override; private Q_SLOTS: void showContextMenu(); diff --git a/tray/gui/traymenu.h b/tray/gui/traymenu.h index 97707b7..2ea6d6d 100644 --- a/tray/gui/traymenu.h +++ b/tray/gui/traymenu.h @@ -14,7 +14,7 @@ class TrayMenu : public QMenu { public: TrayMenu(TrayIcon *trayIcon = nullptr, QWidget *parent = nullptr); - QSize sizeHint() const; + QSize sizeHint() const override; TrayWidget &widget(); const TrayWidget &widget() const; TrayIcon *icon(); diff --git a/tray/gui/traywidget.h b/tray/gui/traywidget.h index ffc769a..b111e42 100644 --- a/tray/gui/traywidget.h +++ b/tray/gui/traywidget.h @@ -43,7 +43,7 @@ class TrayWidget : public QWidget { public: TrayWidget(TrayMenu *parent = nullptr); - ~TrayWidget(); + ~TrayWidget() override; Data::SyncthingConnection &connection(); const Data::SyncthingConnection &connection() const; diff --git a/widgets/misc/errorviewdialog.h b/widgets/misc/errorviewdialog.h index 0b28d38..2ba345f 100644 --- a/widgets/misc/errorviewdialog.h +++ b/widgets/misc/errorviewdialog.h @@ -13,7 +13,7 @@ namespace QtGui { class SYNCTHINGWIDGETS_EXPORT ErrorViewDialog : public TextViewDialog { Q_OBJECT public: - ~ErrorViewDialog(); + ~ErrorViewDialog() override; static ErrorViewDialog *instance(); static void addError(InternalError &&newError); diff --git a/widgets/misc/textviewdialog.h b/widgets/misc/textviewdialog.h index e60088a..4470596 100644 --- a/widgets/misc/textviewdialog.h +++ b/widgets/misc/textviewdialog.h @@ -30,7 +30,7 @@ Q_SIGNALS: void reload(); protected: - void keyPressEvent(QKeyEvent *event); + void keyPressEvent(QKeyEvent *event) override; private: void showLogEntries(const std::vector &logEntries); diff --git a/widgets/settings/settingsdialog.h b/widgets/settings/settingsdialog.h index ff33e4d..64ace73 100644 --- a/widgets/settings/settingsdialog.h +++ b/widgets/settings/settingsdialog.h @@ -115,7 +115,7 @@ public: explicit SettingsDialog(Data::SyncthingConnection *connection, QWidget *parent = nullptr); explicit SettingsDialog(const QList &categories, QWidget *parent = nullptr); explicit SettingsDialog(QWidget *parent = nullptr); - ~SettingsDialog(); + ~SettingsDialog() override; private: void init(); diff --git a/widgets/webview/webpage.h b/widgets/webview/webpage.h index e20bf44..0698dde 100644 --- a/widgets/webview/webpage.h +++ b/widgets/webview/webpage.h @@ -28,12 +28,12 @@ public: static bool isSamePage(const QUrl &url1, const QUrl &url2); protected: - SYNCTHINGWIDGETS_WEB_PAGE *createWindow(WebWindowType type); + SYNCTHINGWIDGETS_WEB_PAGE *createWindow(WebWindowType type) override; #ifdef SYNCTHINGWIDGETS_USE_WEBENGINE - bool certificateError(const QWebEngineCertificateError &certificateError); - bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame); + bool certificateError(const QWebEngineCertificateError &certificateError) override; + bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override; void javaScriptConsoleMessage( - QWebEnginePage::JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID); + QWebEnginePage::JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID) override; #else bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type); void javaScriptConsoleMessage(const QString &message, int lineNumber, const QString &sourceID); diff --git a/widgets/webview/webviewdialog.h b/widgets/webview/webviewdialog.h index db8ceb7..cb11451 100644 --- a/widgets/webview/webviewdialog.h +++ b/widgets/webview/webviewdialog.h @@ -21,7 +21,7 @@ class SYNCTHINGWIDGETS_EXPORT WebViewDialog : public QMainWindow { Q_OBJECT public: WebViewDialog(QWidget *parent = nullptr); - ~WebViewDialog(); + ~WebViewDialog() override; public slots: void applySettings(const Data::SyncthingConnectionSettings &connectionSettings); @@ -32,10 +32,10 @@ public slots: void closeUnlessModalVisible(); protected: - void closeEvent(QCloseEvent *event); - void keyPressEvent(QKeyEvent *event); + void closeEvent(QCloseEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; #if defined(SYNCTHINGWIDGETS_USE_WEBENGINE) - bool eventFilter(QObject *watched, QEvent *event); + bool eventFilter(QObject *watched, QEvent *event) override; #endif private: diff --git a/widgets/webview/webviewinterceptor.h b/widgets/webview/webviewinterceptor.h index 2085ead..17487c1 100644 --- a/widgets/webview/webviewinterceptor.h +++ b/widgets/webview/webviewinterceptor.h @@ -16,7 +16,7 @@ class WebViewInterceptor : public QWebEngineUrlRequestInterceptor { public: explicit WebViewInterceptor(const Data::SyncthingConnectionSettings &settings, QObject *parent = nullptr); - virtual void interceptRequest(QWebEngineUrlRequestInfo &info); + virtual void interceptRequest(QWebEngineUrlRequestInfo &info) override; private: const Data::SyncthingConnectionSettings &m_settings;