Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct destructor and virtual method overrides #1938

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion panel/config/addplugindialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AddPluginDialog : public QDialog

public:
AddPluginDialog(QWidget *parent = nullptr);
~AddPluginDialog();
~AddPluginDialog() override;

signals:
void pluginSelected(const LXQt::PluginInfo &plugin);
Expand Down
2 changes: 1 addition & 1 deletion panel/config/configplacement.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ConfigPlacement : public QWidget

public:
explicit ConfigPlacement(LXQtPanel *panel, QWidget *parent = nullptr);
~ConfigPlacement();
~ConfigPlacement() override;

int screenNum() const { return mScreenNum; }
ILXQtPanel::Position position() const { return mPosition; }
Expand Down
2 changes: 1 addition & 1 deletion panel/config/configpluginswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ConfigPluginsWidget : public QWidget

public:
ConfigPluginsWidget(LXQtPanel *panel, QWidget* parent = nullptr);
~ConfigPluginsWidget();
~ConfigPluginsWidget() override;

signals:
void changed();
Expand Down
2 changes: 1 addition & 1 deletion panel/config/configstyling.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ConfigStyling : public QWidget

public:
explicit ConfigStyling(LXQtPanel *panel, QWidget *parent = nullptr);
~ConfigStyling();
~ConfigStyling() override;

void updateIconThemeSettings();

Expand Down
2 changes: 1 addition & 1 deletion panel/lxqtpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LXQT_PANEL_API LXQtPanel : public QFrame, public ILXQtPanel
* @param parent Parent QWidget, can be omitted.
*/
LXQtPanel(const QString &configGroup, LXQt::Settings *settings, QWidget *parent = nullptr);
virtual ~LXQtPanel();
~LXQtPanel() override;

/**
* @brief Returns the name of this panel which is also used as identifier
Expand Down
2 changes: 1 addition & 1 deletion panel/lxqtpanelapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class LXQtPanelApplication : public LXQt::Application
* \param argv
*/
explicit LXQtPanelApplication(int& argc, char** argv);
~LXQtPanelApplication();
~LXQtPanelApplication() override;

void setIconTheme(const QString &iconTheme);

Expand Down
2 changes: 1 addition & 1 deletion panel/lxqtpanelapplication_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LXQtPanelApplicationPrivate {
public:

LXQtPanelApplicationPrivate(LXQtPanelApplication *q);
~LXQtPanelApplicationPrivate() {};
~LXQtPanelApplicationPrivate() {}

LXQt::Settings *mSettings;

Expand Down
2 changes: 1 addition & 1 deletion panel/lxqtpanellayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LXQT_PANEL_API LXQtPanelLayout : public QLayout
Q_OBJECT
public:
explicit LXQtPanelLayout(QWidget *parent);
~LXQtPanelLayout();
~LXQtPanelLayout() override;

void addItem(QLayoutItem *item);
QLayoutItem *itemAt(int index) const;
Expand Down
4 changes: 2 additions & 2 deletions panel/lxqtpanelpluginconfigdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class LXQT_PANEL_API LXQtPanelPluginConfigDialog : public QDialog
public:
explicit LXQtPanelPluginConfigDialog(PluginSettings &settings, QWidget *parent = nullptr);
explicit LXQtPanelPluginConfigDialog(PluginSettings *settings, QWidget *parent = nullptr) : LXQtPanelPluginConfigDialog(*settings, parent) {}
virtual ~LXQtPanelPluginConfigDialog();
~LXQtPanelPluginConfigDialog() override;

PluginSettings &settings() const;

protected:
virtual void closeEvent(QCloseEvent *event) override;
void closeEvent(QCloseEvent *event) override;

protected slots:
/*
Expand Down
8 changes: 4 additions & 4 deletions panel/panelpluginsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PanelPluginsModel : public QAbstractListModel
QString const & namesKey,
QStringList const & desktopDirs,
QObject * parent = nullptr);
~PanelPluginsModel();
~PanelPluginsModel() override;

/*!
* \brief rowCount returns the number of Plugins. It overrides/implements
Expand All @@ -62,7 +62,7 @@ class PanelPluginsModel : public QAbstractListModel
* Plugins. If it is given and a valid model index, the method returns 0
* because PanelPluginsModel is not a hierarchical model.
*/
virtual int rowCount(const QModelIndex & parent = QModelIndex()) const override;
int rowCount(const QModelIndex & parent = QModelIndex()) const override;
/*!
* \brief data returns the Plugin data as defined by the Model/View
* architecture. The Plugins itself can be accessed with the role
Expand All @@ -78,13 +78,13 @@ class PanelPluginsModel : public QAbstractListModel
* 3. Qt::UserRole to return a Plugin*.
* \return The data as determined by index and role.
*/
virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
/*!
* \brief flags returns the item flags for the given model index. For
* all Plugins, this is the same:
* Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemNeverHasChildren.
*/
virtual Qt::ItemFlags flags(const QModelIndex & index) const override;
Qt::ItemFlags flags(const QModelIndex & index) const override;

/*!
* \brief pluginNames returns a list of names for all the Plugins in
Expand Down
4 changes: 2 additions & 2 deletions panel/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LXQT_PANEL_API Plugin : public QFrame


explicit Plugin(const LXQt::PluginInfo &desktopFile, LXQt::Settings *settings, const QString &settingsGroup, LXQtPanel *panel);
~Plugin();
~Plugin() override;

bool isLoaded() const { return mPlugin != 0; }
Alignment alignment() const { return mAlignment; }
Expand All @@ -81,7 +81,7 @@ class LXQT_PANEL_API Plugin : public QFrame

QString name() const { return mName; }

virtual bool eventFilter(QObject * watched, QEvent * event);
bool eventFilter(QObject * watched, QEvent * event) override;

// For QSS properties ..................
static QColor moveMarkerColor() { return mMoveMarkerColor; }
Expand Down
2 changes: 1 addition & 1 deletion panel/pluginmoveprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LXQT_PANEL_API PluginMoveProcessor : public QWidget
Q_OBJECT
public:
explicit PluginMoveProcessor(LXQtPanelLayout *layout, Plugin *plugin);
~PluginMoveProcessor();
~PluginMoveProcessor() override;

Plugin *plugin() const { return mPlugin; }

Expand Down
2 changes: 1 addition & 1 deletion panel/pluginsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class LXQT_PANEL_API PluginSettings : public QObject
friend class PluginSettingsFactory;

public:
~PluginSettings();
~PluginSettings() override;

QString group() const;

Expand Down
2 changes: 1 addition & 1 deletion panel/popupmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LXQT_PANEL_API PopupMenu: public QMenu
bool eventFilter(QObject *object, QEvent *event);

protected:
virtual void keyPressEvent(QKeyEvent* e);
void keyPressEvent(QKeyEvent* e) override;
};

#endif // POPUPMENU_H
2 changes: 1 addition & 1 deletion panel/windownotifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class WindowNotifier : public QObject
void observeWindow(QWidget * w);
inline bool isAnyWindowShown() const { return !mShownWindows.isEmpty(); }

virtual bool eventFilter(QObject * watched, QEvent * event) override;
bool eventFilter(QObject * watched, QEvent * event) override;
signals:
void lastHidden();
void firstShown();
Expand Down
8 changes: 4 additions & 4 deletions plugin-backlight/backlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class LXQtBacklight : public QObject, public ILXQtPanelPlugin
Q_OBJECT
public:
LXQtBacklight(const ILXQtPanelPluginStartupInfo &startupInfo);
~LXQtBacklight();
~LXQtBacklight() override;

virtual QWidget *widget();
virtual QString themeId() const { return QStringLiteral("Backlight"); }
virtual ILXQtPanelPlugin::Flags flags() const { return PreferRightAlignment ; }
QWidget *widget() override;
QString themeId() const override { return QStringLiteral("Backlight"); }
ILXQtPanelPlugin::Flags flags() const override { return PreferRightAlignment ; }

protected Q_SLOTS:
void showSlider(bool);
Expand Down
12 changes: 6 additions & 6 deletions plugin-colorpicker/colorpicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ColorPickerWidget : public QWidget

public:
ColorPickerWidget(QWidget* parent = nullptr);
~ColorPickerWidget();
~ColorPickerWidget() override;

QMenu* popupMenu() { return mColorsMenu; }
QToolButton* pickerButton() { return mPickerButton; }
Expand Down Expand Up @@ -82,14 +82,14 @@ class ColorPicker : public QObject, public ILXQtPanelPlugin
Q_OBJECT
public:
ColorPicker(const ILXQtPanelPluginStartupInfo &startupInfo);
~ColorPicker();
~ColorPicker() override;

virtual QWidget *widget() override { return &mWidget; }
virtual QString themeId() const override { return QStringLiteral("ColorPicker"); }
QWidget *widget() override { return &mWidget; }
QString themeId() const override { return QStringLiteral("ColorPicker"); }

virtual bool isSeparate() const override { return true; }
bool isSeparate() const override { return true; }

virtual void realign() override;
void realign() override;

private:
ColorPickerWidget mWidget;
Expand Down
8 changes: 4 additions & 4 deletions plugin-cpuload/lxqtcpuload.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LXQtCpuLoad: public QFrame
};

LXQtCpuLoad(ILXQtPanelPlugin *plugin, QWidget* parent = nullptr);
~LXQtCpuLoad();
~LXQtCpuLoad() override;


void settingsChanged();
Expand All @@ -58,9 +58,9 @@ class LXQtCpuLoad: public QFrame
QColor getFontColor() const { return fontColor; }

protected:
void virtual timerEvent(QTimerEvent *event);
void virtual paintEvent ( QPaintEvent * event );
void virtual resizeEvent(QResizeEvent *);
void timerEvent(QTimerEvent *event) override;
void paintEvent ( QPaintEvent * event ) override;
void resizeEvent(QResizeEvent *) override;

private:
double getLoadCpu() const;
Expand Down
2 changes: 1 addition & 1 deletion plugin-cpuload/lxqtcpuloadconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LXQtCpuLoadConfiguration : public LXQtPanelPluginConfigDialog

public:
explicit LXQtCpuLoadConfiguration(PluginSettings *settings, QWidget *parent = nullptr);
~LXQtCpuLoadConfiguration();
~LXQtCpuLoadConfiguration() override;

private:
Ui::LXQtCpuLoadConfiguration *ui;
Expand Down
10 changes: 5 additions & 5 deletions plugin-cpuload/lxqtcpuloadplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ class LXQtCpuLoadPlugin: public QObject, public ILXQtPanelPlugin
Q_OBJECT
public:
explicit LXQtCpuLoadPlugin(const ILXQtPanelPluginStartupInfo &startupInfo);
~LXQtCpuLoadPlugin();
~LXQtCpuLoadPlugin() override;

virtual ILXQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog; }
virtual QWidget *widget();
virtual QString themeId() const { return QStringLiteral("CpuLoad"); }
ILXQtPanelPlugin::Flags flags() const override { return PreferRightAlignment | HaveConfigDialog; }
QWidget *widget() override ;
QString themeId() const override { return QStringLiteral("CpuLoad"); }

bool isSeparate() const { return true; }
QDialog *configureDialog();

protected:
virtual void settingsChanged();
void settingsChanged() override;

private:
QWidget *mWidget;
Expand Down
2 changes: 1 addition & 1 deletion plugin-customcommand/custombutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CustomButton : public QToolButton

public:
CustomButton(ILXQtPanelPlugin *plugin, QWidget* parent = nullptr);
~CustomButton();
~CustomButton() override;

public slots:
void setAutoRotation(bool value);
Expand Down
14 changes: 7 additions & 7 deletions plugin-customcommand/lxqtcustomcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ class LXQtCustomCommand : public QObject, public ILXQtPanelPlugin
Q_OBJECT
public:
LXQtCustomCommand(const ILXQtPanelPluginStartupInfo &startupInfo);
~LXQtCustomCommand();
~LXQtCustomCommand() override;

virtual QWidget *widget();
virtual QString themeId() const { return QStringLiteral("Custom"); }
virtual ILXQtPanelPlugin::Flags flags() const { return PreferRightAlignment | HaveConfigDialog ; }
void realign();
QDialog *configureDialog();
QWidget *widget() override;
QString themeId() const override { return QStringLiteral("Custom"); }
ILXQtPanelPlugin::Flags flags() const override { return PreferRightAlignment | HaveConfigDialog ; }
void realign() override;
QDialog *configureDialog() override;

protected slots:
virtual void settingsChanged();
void settingsChanged() override;

private slots:
void handleClick();
Expand Down
4 changes: 2 additions & 2 deletions plugin-customcommand/lxqtcustomcommandconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LXQtCustomCommandConfiguration : public LXQtPanelPluginConfigDialog

public:
explicit LXQtCustomCommandConfiguration(PluginSettings *settings, QWidget *parent = nullptr);
~LXQtCustomCommandConfiguration();
~LXQtCustomCommandConfiguration() override;

private slots:
void autoRotateChanged(bool autoRotate);
Expand All @@ -57,7 +57,7 @@ private slots:
void wheelDownLineEditChanged(QString wheelDown);

protected slots:
virtual void loadSettings();
void loadSettings() override;

private:
Ui::LXQtCustomCommandConfiguration *ui;
Expand Down
16 changes: 8 additions & 8 deletions plugin-desktopswitch/desktopswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ class DesktopSwitch : public QObject, public ILXQtPanelPlugin
Q_OBJECT
public:
DesktopSwitch(const ILXQtPanelPluginStartupInfo &startupInfo);
~DesktopSwitch();
~DesktopSwitch() override;

QString themeId() const { return QStringLiteral("DesktopSwitch"); }
QWidget *widget() { return &mWidget; }
bool isSeparate() const { return true; }
void realign();
QString themeId() const override { return QStringLiteral("DesktopSwitch"); }
QWidget *widget() override { return &mWidget; }
bool isSeparate() const override { return true; }
void realign() override;

virtual ILXQtPanelPlugin::Flags flags() const { return HaveConfigDialog; }
QDialog *configureDialog();
ILXQtPanelPlugin::Flags flags() const override { return HaveConfigDialog; }
QDialog *configureDialog() override;

private:
QButtonGroup * m_buttons;
Expand All @@ -96,7 +96,7 @@ private slots:
void onNumberOfDesktopsChanged(int);
void onCurrentDesktopChanged(int);
void onDesktopNamesChanged();
virtual void settingsChanged();
void settingsChanged() override;
void registerShortcuts();
void shortcutRegistered();
void onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2);
Expand Down
4 changes: 2 additions & 2 deletions plugin-desktopswitch/desktopswitchconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DesktopSwitchConfiguration : public LXQtPanelPluginConfigDialog

public:
explicit DesktopSwitchConfiguration(PluginSettings *settings, QWidget *parent = nullptr);
~DesktopSwitchConfiguration();
~DesktopSwitchConfiguration() override;

private:
Ui::DesktopSwitchConfiguration *ui;
Expand All @@ -55,7 +55,7 @@ private slots:
/*
Saves settings in conf file.
*/
void loadSettings();
void loadSettings() override;
void loadDesktopsNames();
void rowsChanged(int value);
void labelTypeChanged(int type);
Expand Down
12 changes: 6 additions & 6 deletions plugin-directorymenu/directorymenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class DirectoryMenu : public QObject, public ILXQtPanelPlugin

public:
DirectoryMenu(const ILXQtPanelPluginStartupInfo &startupInfo);
~DirectoryMenu();
~DirectoryMenu() override;

virtual QWidget *widget() { return &mButton; }
virtual QString themeId() const { return QStringLiteral("DirectoryMenu"); }
virtual ILXQtPanelPlugin::Flags flags() const { return HaveConfigDialog; }
QDialog *configureDialog();
void settingsChanged();
QWidget *widget() override { return &mButton; }
QString themeId() const override { return QStringLiteral("DirectoryMenu"); }
ILXQtPanelPlugin::Flags flags() const override { return HaveConfigDialog; }
QDialog *configureDialog() override;
void settingsChanged() override;

private slots:
void showMenu();
Expand Down
Loading