Commit 9071d74a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove extra ; use nullptr use override

parent 25342928
......@@ -74,7 +74,7 @@ KMixWindow : public KXmlGuiWindow
void fixConfigAfterRead();
bool queryClose() Q_DECL_OVERRIDE;
bool queryClose() override;
public slots:
void controlsChange(ControlManager::ChangeType changeType);
......
......@@ -42,18 +42,18 @@ public:
explicit Mixer_ALSA(Mixer *mixer, int device = -1 );
~Mixer_ALSA();
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md ) Q_DECL_OVERRIDE;
int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> md ) Q_DECL_OVERRIDE;
void setEnumIdHW( const QString& id, unsigned int) Q_DECL_OVERRIDE;
unsigned int enumIdHW(const QString& id) Q_DECL_OVERRIDE;
bool hasChangedControls() Q_DECL_OVERRIDE;
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md ) override;
int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> md ) override;
void setEnumIdHW( const QString& id, unsigned int) override;
unsigned int enumIdHW(const QString& id) override;
bool hasChangedControls() override;
bool needsPolling() Q_DECL_OVERRIDE { return false; }
QString getDriverName() Q_DECL_OVERRIDE;
bool needsPolling() override { return false; }
QString getDriverName() override;
protected:
int open() Q_DECL_OVERRIDE;
int close() Q_DECL_OVERRIDE;
int open() override;
int close() override;
int id2num(const QString& id);
private:
......@@ -68,7 +68,7 @@ private:
int identify( snd_mixer_selem_id_t *sid );
snd_mixer_elem_t* getMixerElem(int devnum);
QString errorText(int mixer_error) Q_DECL_OVERRIDE;
QString errorText(int mixer_error) override;
typedef QList<snd_mixer_selem_id_t *>AlsaMixerSidList;
AlsaMixerSidList mixer_sid_list;
typedef QList<snd_mixer_elem_t *> AlsaMixerElemList;
......
......@@ -115,20 +115,20 @@ class Mixer_MPRIS2 : public Mixer_Backend
public:
Mixer_MPRIS2(Mixer *mixer, int device);
virtual ~Mixer_MPRIS2();
QString getDriverName() Q_DECL_OVERRIDE;
QString getId() const Q_DECL_OVERRIDE { return _id; };
int open() Q_DECL_OVERRIDE;
int close() Q_DECL_OVERRIDE;
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) Q_DECL_OVERRIDE;
int writeVolumeToHW( const QString& id, shared_ptr<MixDevice> ) Q_DECL_OVERRIDE;
void setEnumIdHW(const QString& id, unsigned int) Q_DECL_OVERRIDE;
unsigned int enumIdHW(const QString& id) Q_DECL_OVERRIDE;
bool needsPolling() Q_DECL_OVERRIDE { return false; }
int mediaPlay(QString id) Q_DECL_OVERRIDE;
int mediaPrev(QString id) Q_DECL_OVERRIDE;
int mediaNext(QString id) Q_DECL_OVERRIDE;
QString getDriverName() override;
QString getId() const override { return _id; };
int open() override;
int close() override;
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) override;
int writeVolumeToHW( const QString& id, shared_ptr<MixDevice> ) override;
void setEnumIdHW(const QString& id, unsigned int) override;
unsigned int enumIdHW(const QString& id) override;
bool needsPolling() override { return false; }
int mediaPlay(QString id) override;
int mediaPrev(QString id) override;
int mediaNext(QString id) override;
virtual int mediaControl(QString id, QString command);
static MediaController::PlayState mprisPlayStateString2PlayState(const QString& playbackStatus);
......
......@@ -32,16 +32,16 @@ public:
Mixer_OSS(Mixer *mixer, int device);
virtual ~Mixer_OSS();
QString errorText(int mixer_error) Q_DECL_OVERRIDE;
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) Q_DECL_OVERRIDE;
int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> ) Q_DECL_OVERRIDE;
QString errorText(int mixer_error) override;
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) override;
int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> ) override;
QString getDriverName() Q_DECL_OVERRIDE;
QString getDriverName() override;
protected:
int open() Q_DECL_OVERRIDE;
int close() Q_DECL_OVERRIDE;
int open() override;
int close() override;
virtual QString deviceName( int );
virtual QString deviceNameDevfs( int );
......
......@@ -53,16 +53,16 @@ class Mixer_PULSE : public Mixer_Backend
Mixer_PULSE(Mixer *mixer, int devnum);
virtual ~Mixer_PULSE();
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) Q_DECL_OVERRIDE;
int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> ) Q_DECL_OVERRIDE;
int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) override;
int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> ) override;
QString currentStreamDevice(const QString &id) const Q_DECL_OVERRIDE;
bool moveStream( const QString& id, const QString& destId ) Q_DECL_OVERRIDE;
QString currentStreamDevice(const QString &id) const override;
bool moveStream( const QString& id, const QString& destId ) override;
QString getDriverName() Q_DECL_OVERRIDE;
QString getId() const Q_DECL_OVERRIDE { return _id; };
QString getDriverName() override;
QString getId() const override { return _id; };
bool needsPolling() Q_DECL_OVERRIDE { return false; }
bool needsPolling() override { return false; }
void triggerUpdate();
void addWidget(int index, bool = false);
......@@ -72,8 +72,8 @@ class Mixer_PULSE : public Mixer_Backend
int id2num(const QString& id);
protected:
int open() Q_DECL_OVERRIDE;
int close() Q_DECL_OVERRIDE;
int open() override;
int close() override;
int fd;
QString _id;
......@@ -89,7 +89,7 @@ class Mixer_PULSE : public Mixer_Backend
void pulseControlsReconfigured();
public:
void reinit() Q_DECL_OVERRIDE;
void reinit() override;
};
......
......@@ -131,7 +131,7 @@ private:
/**
* @Override
*/
void usrReadConfig() Q_DECL_OVERRIDE;
void usrReadConfig() override;
/**
* @Override
*/
......
......@@ -83,16 +83,16 @@ public:
// Methods for handling the switches. This methods are useful, because the Sswitch in the Volume object
// is an abstract concept. It places no interpretation on the meaning of the switch (e.g. does "switch set" mean
// "mute on", or does it mean "playback on".
bool isMuted() const Q_DECL_OVERRIDE;
void setMuted(bool value) Q_DECL_OVERRIDE;
bool isRecSource() const Q_DECL_OVERRIDE;
void setRecSource(bool value) Q_DECL_OVERRIDE;
bool isEnum() const Q_DECL_OVERRIDE;
bool isMuted() const override;
void setMuted(bool value) override;
bool isRecSource() const override;
void setRecSource(bool value) override;
bool isEnum() const override;
// Refresh the composite from its components
void update();
Volume &playbackVolume() Q_DECL_OVERRIDE;
Volume &playbackVolume() override;
//virtual Volume& captureVolume();
private:
......
......@@ -37,8 +37,8 @@ class DialogAddView : public DialogBase
DialogAddView(QWidget *parent, Mixer *mixer);
virtual ~DialogAddView() = default;
QString getresultViewName() { return resultViewName; }
QString getresultMixerId() { return resultMixerId; }
QString getresultViewName() const { return resultViewName; }
QString getresultMixerId() const { return resultMixerId; }
public slots:
void apply();
......
......@@ -137,7 +137,7 @@ bool DialogChooseBackends::getAndResetModifyFlag()
return modifiedOld;
}
bool DialogChooseBackends::getModifyFlag()
bool DialogChooseBackends::getModifyFlag() const
{
return modified;
}
......
......@@ -41,7 +41,7 @@ public:
QSet<QString> getChosenBackends();
bool getAndResetModifyFlag();
bool getModifyFlag();
bool getModifyFlag() const;
signals:
void backendsModified();
......
......@@ -34,7 +34,7 @@ class DialogSelectMaster : public DialogBase
Q_OBJECT
public:
explicit DialogSelectMaster(Mixer *mixer = 0, QWidget *parent = 0);
explicit DialogSelectMaster(Mixer *mixer = nullptr, QWidget *parent = nullptr);
virtual ~DialogSelectMaster() = default;
public slots:
......
......@@ -169,7 +169,7 @@ protected:
/**
* @reimp
**/
virtual bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
virtual bool eventFilter(QObject *obj, QEvent *ev) override;
private slots:
void restoreConfigInternal();
......
......@@ -69,26 +69,26 @@ class DialogViewConfigurationWidget : public QListWidget
{
Q_OBJECT
public:
explicit DialogViewConfigurationWidget(QWidget *parent=0);
explicit DialogViewConfigurationWidget(QWidget *parent=nullptr);
void setActiveList(bool isActiveList) {
m_activeList = isActiveList;
}
bool isActiveList() const { return m_activeList; };
bool isActiveList() const { return m_activeList; }
Q_SIGNALS:
void dropped(DialogViewConfigurationWidget* list, int index, DialogViewConfigurationItem* item);
protected:
QMimeData* mimeData(const QList<QListWidgetItem*> items) const Q_DECL_OVERRIDE;
bool dropMimeData(int index, const QMimeData * mimeData, Qt::DropAction action) Q_DECL_OVERRIDE;
QMimeData* mimeData(const QList<QListWidgetItem*> items) const override;
bool dropMimeData(int index, const QMimeData * mimeData, Qt::DropAction action) override;
Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE
Qt::DropActions supportedDropActions() const override
{
//qCDebug(KMIX_LOG) << "supportedDropActions!";
return Qt::MoveAction;
}
QStringList mimeTypes() const Q_DECL_OVERRIDE
QStringList mimeTypes() const override
{
//qCDebug(KMIX_LOG) << "mimeTypes!";
return QStringList() << "application/x-kde-action-list";
......@@ -96,7 +96,7 @@ protected:
// Skip internal dnd handling in QListWidget ---- how is one supposed to figure this out
// without reading the QListWidget code !?
void dropEvent(QDropEvent* ev) Q_DECL_OVERRIDE {
void dropEvent(QDropEvent* ev) override {
QAbstractItemView::dropEvent(ev);
}
......
......@@ -613,7 +613,7 @@ void ProfControl::setVisibility(const QString &visString)
setVisibility(visibilityFromString(visString));
}
void ProfControl::setSubcontrols(QString sctls)
void ProfControl::setSubcontrols(const QString &sctls)
{
_subcontrols = sctls;
......
......@@ -77,7 +77,7 @@ public:
QString name() const { return (_name); }
void setName(const QString &name) { _name = name; }
void setSubcontrols(QString sctls);
void setSubcontrols(const QString &sctls);
bool useSubcontrolPlayback() const { return (_useSubcontrolPlayback); }
bool useSubcontrolCapture() const { return (_useSubcontrolCapture); }
bool useSubcontrolPlaybackSwitch() const { return (_useSubcontrolPlaybackSwitch); }
......@@ -211,9 +211,9 @@ public:
// Enumeration for the scope
enum ProfileScope { NONE, SOUNDCARD };
bool startDocument() Q_DECL_OVERRIDE;
bool startElement( const QString&, const QString&, const QString& , const QXmlAttributes& ) Q_DECL_OVERRIDE;
bool endElement( const QString&, const QString&, const QString& ) Q_DECL_OVERRIDE;
bool startDocument() override;
bool startElement( const QString&, const QString&, const QString& , const QXmlAttributes& ) override;
bool endElement( const QString&, const QString&, const QString& ) override;
private:
void addControl(const QXmlAttributes& attributes);
......
......@@ -55,7 +55,7 @@ class KMixDockWidget : public KStatusNotifierItem
public slots:
void setVolumeTip();
void updatePixmap();
void activate(const QPoint &pos) Q_DECL_OVERRIDE;
void activate(const QPoint &pos) override;
void controlsChange(ControlManager::ChangeType changeType);
protected:
......
......@@ -49,8 +49,8 @@
KMixerWidget contains
a TabBar with n Tabs (at least one per soundcard). These contain View's with sliders, switches and other GUI elements visualizing the Mixer)
*/
KMixerWidget::KMixerWidget( Mixer *mixer,
QWidget * parent, ViewBase::ViewFlags vflags, QString guiprofId,
KMixerWidget::KMixerWidget(Mixer *mixer,
QWidget * parent, ViewBase::ViewFlags vflags, const QString &guiprofId,
KActionCollection* actionCollection )
: QWidget( parent ), _mixer(mixer),
m_topLayout(0), _guiprofId(guiprofId),
......
......@@ -53,12 +53,12 @@ class KMixerWidget : public QWidget
public:
explicit KMixerWidget( Mixer *mixer,
QWidget *parent, ViewBase::ViewFlags vflags, QString guiprofId, KActionCollection* coll = 0 );
QWidget *parent, ViewBase::ViewFlags vflags, const QString &guiprofId, KActionCollection* coll = nullptr );
~KMixerWidget();
Mixer *mixer() { return _mixer; }
ViewBase* currentView();
GUIProfile* getGuiprof() { return GUIProfile::find(_guiprofId); };
GUIProfile* getGuiprof() { return GUIProfile::find(_guiprofId); }
signals:
......
......@@ -61,19 +61,19 @@ private slots:
void kmixConfigHasChangedEmitter();
protected:
void showEvent(QShowEvent * event) Q_DECL_OVERRIDE;
void showEvent(QShowEvent * event) override;
/**
* Orientation is not supported by default => implement manually
* @Override
*/
void updateWidgets() Q_DECL_OVERRIDE;
void updateWidgets() override;
/**
* Orientation is not supported by default => implement manually
* @Override
*/
void updateSettings() Q_DECL_OVERRIDE;
void updateSettings() override;
bool hasChanged() Q_DECL_OVERRIDE;
bool hasChanged() override;
private:
static KMixPrefDlg* instance;
......
......@@ -40,9 +40,9 @@ class KSmallSlider : public QAbstractSlider
/* void setChid(Volume::ChannelID chid) { this->chid = chid; };
Volume::ChannelID getChid() { return chid; };*/
QSize sizeHint() const Q_DECL_OVERRIDE;
QSize sizeHint() const override;
QSizePolicy sizePolicy() const;
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
QSize minimumSizeHint() const override;
bool gray() const;
......@@ -57,12 +57,12 @@ public slots:
void valueChanged( int value );
protected:
void resizeEvent( QResizeEvent * ) Q_DECL_OVERRIDE;
void paintEvent( QPaintEvent * ) Q_DECL_OVERRIDE;
void resizeEvent( QResizeEvent * ) override;
void paintEvent( QPaintEvent * ) override;
void mousePressEvent( QMouseEvent * ) Q_DECL_OVERRIDE;
void mouseMoveEvent( QMouseEvent * ) Q_DECL_OVERRIDE;
void wheelEvent( QWheelEvent * ) Q_DECL_OVERRIDE;
void mousePressEvent( QMouseEvent * ) override;
void mouseMoveEvent( QMouseEvent * ) override;
void wheelEvent( QWheelEvent * ) override;
void valueChange();
......
......@@ -43,20 +43,20 @@ public:
void addActionToPopup( QAction *action );
QSizePolicy sizePolicy() const;
int labelExtentHint() const Q_DECL_OVERRIDE;
void setLabelExtent(int extent) Q_DECL_OVERRIDE;
int labelExtentHint() const override;
void setLabelExtent(int extent) override;
public slots:
// GUI hide and show
void setDisabled(bool) Q_DECL_OVERRIDE;
void setDisabled(bool) override;
// Enum handling: next and selecting
void nextEnumId();
int enumId();
void setEnumId(int value);
void update() Q_DECL_OVERRIDE;
void showContextMenu(const QPoint& pos = QCursor::pos()) Q_DECL_OVERRIDE;
void update() override;
void showContextMenu(const QPoint& pos = QCursor::pos()) override;
private:
void createWidgets();
......
......@@ -622,7 +622,7 @@ static QWidget *createLabel(QWidget *parent, const QString &label, Qt::Orientati
void MDWSlider::addSliders( QBoxLayout *volLayout, char type, Volume& vol,
QList<QAbstractSlider *>& ref_sliders, QString tooltipText)
QList<QAbstractSlider *>& ref_sliders, const QString &tooltipText)
{
const int minSliderSize = fontMetrics().height() * 10;
long minvol = vol.minVolume();
......
......@@ -56,25 +56,25 @@ public:
void createShortcutActions();
// GUI
bool isStereoLinked() const Q_DECL_OVERRIDE { return m_linked; }
void setStereoLinked( bool value ) Q_DECL_OVERRIDE;
void setLabeled( bool value ) Q_DECL_OVERRIDE;
void setTicks( bool ticks ) Q_DECL_OVERRIDE;
void setIcons( bool value ) Q_DECL_OVERRIDE;
bool isStereoLinked() const override { return m_linked; }
void setStereoLinked( bool value ) override;
void setLabeled( bool value ) override;
void setTicks( bool ticks ) override;
void setIcons( bool value ) override;
QToolButton* addMediaButton(QString iconName, QLayout* layout, QWidget *parent);
void updateMediaButton();
void setColors( QColor high, QColor low, QColor back ) Q_DECL_OVERRIDE;
void setMutedColors( QColor high, QColor low, QColor back ) Q_DECL_OVERRIDE;
void setColors( QColor high, QColor low, QColor back ) override;
void setMutedColors( QColor high, QColor low, QColor back ) override;
bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
bool eventFilter(QObject *obj, QEvent *ev) override;
QString iconName();
// Layout
QSizePolicy sizePolicy() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
int labelExtentHint() const Q_DECL_OVERRIDE;
void setLabelExtent(int extent) Q_DECL_OVERRIDE;
QSize sizeHint() const override;
int labelExtentHint() const override;
void setLabelExtent(int extent) override;
bool hasMuteButton() const;
bool hasCaptureLED() const;
......@@ -85,10 +85,10 @@ public slots:
void toggleMuted();
void toggleStereoLinked();
void setDisabled( bool value ) Q_DECL_OVERRIDE;
void update() Q_DECL_OVERRIDE;
void setDisabled( bool value ) override;
void update() override;
void showMoveMenu();
void showContextMenu( const QPoint &pos = QCursor::pos() ) Q_DECL_OVERRIDE;
void showContextMenu( const QPoint &pos = QCursor::pos() ) override;
void increaseOrDecreaseVolume(bool arg1, Volume::VolumeTypeFlag volumeType);
VolumeSliderExtraData& extraData(QAbstractSlider *slider);
void addMediaControls(QBoxLayout* arg1);
......@@ -111,8 +111,8 @@ private slots:
private:
void createWidgets();
void addSliders( QBoxLayout *volLayout, char type, Volume& vol,
QList<QAbstractSlider *>& ref_sliders, QString tooltipText );
void addSliders(QBoxLayout *volLayout, char type, Volume& vol,
QList<QAbstractSlider *>& ref_sliders, const QString &tooltipText );
// Methods that are called two times from a wrapper. Once for playabck, once for capture
void setStereoLinkedInternal( QList< QAbstractSlider* >& ref_sliders, bool showSubcontrolLabels);
......
......@@ -84,7 +84,7 @@ protected slots:
protected:
void addActionToPopup(QAction *action);
void contextMenuEvent(QContextMenuEvent *ev) Q_DECL_OVERRIDE;
void contextMenuEvent(QContextMenuEvent *ev) override;
Qt::Orientation orientation() const { return (m_view->orientation()); }
MixDeviceWidget::MDWFlags flags() const { return (m_flags); }
......
......@@ -39,7 +39,7 @@ class OSDWidget : public Plasma::Dialog
{
Q_OBJECT
public:
explicit OSDWidget(QWidget * parent = 0);
explicit OSDWidget(QWidget * parent = nullptr);
virtual ~OSDWidget();
void setCurrentVolume(int volumeLevel, bool muted);
......
......@@ -27,15 +27,15 @@
class VerticalText : public QWidget
{
public:
VerticalText(QWidget * parent, const QString&, Qt::WindowFlags f = {});
explicit VerticalText(QWidget * parent, const QString&, Qt::WindowFlags f = {});
~VerticalText();
void setText(const QString& text);
QSize sizeHint() const Q_DECL_OVERRIDE;
QSize sizeHint() const override;
QSizePolicy sizePolicy () const;
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
QSize minimumSizeHint() const override;
protected:
void paintEvent ( QPaintEvent * event ) Q_DECL_OVERRIDE;
void paintEvent ( QPaintEvent * event ) override;
private:
QString m_labelText;
......
......@@ -84,8 +84,8 @@ public:
ProfControl *findMdw(const QString &mdwId, GuiVisibility visibility = GuiVisibility::Default) const;
KActionCollection *actionCollection() const { return (_actions); };
const QList<Mixer*> &getMixers() const { return (_mixers); };
KActionCollection *actionCollection() const { return (_actions); }
const QList<Mixer*> &getMixers() const { return (_mixers); }
int mixDeviceCount() const { return (_mdws.count()); }
QWidget *mixDeviceAt(int i) const { return (_mdws.at(i)); }
......@@ -139,7 +139,7 @@ protected:
/**
* Popup stuff
*/
void contextMenuEvent(QContextMenuEvent *ev) Q_DECL_OVERRIDE;
void contextMenuEvent(QContextMenuEvent *ev) override;
virtual void showContextMenu();
// Creates a suitable representation for the given MixDevice.
......@@ -163,6 +163,6 @@ private slots:
void toggleMenuBarSlot();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(ViewBase::ViewFlags);
Q_DECLARE_OPERATORS_FOR_FLAGS(ViewBase::ViewFlags)
#endif
......@@ -44,17 +44,17 @@ public:
ViewDockAreaPopup(QWidget* parent, const QString &id, ViewBase::ViewFlags vflags, const QString &guiProfileId, KMixWindow *dockW);
virtual ~ViewDockAreaPopup();
QWidget* add(shared_ptr<MixDevice> md) Q_DECL_OVERRIDE;
void constructionFinished() Q_DECL_OVERRIDE;
void refreshVolumeLevels() Q_DECL_OVERRIDE;
void showContextMenu() Q_DECL_OVERRIDE;
void configurationUpdate() Q_DECL_OVERRIDE;
QWidget* add(shared_ptr<MixDevice> md) override;
void constructionFinished() override;
void refreshVolumeLevels() override;
void showContextMenu() override;
void configurationUpdate() override;
protected:
KMixWindow *_kmixMainWindow;
void initLayout() Q_DECL_OVERRIDE;
Qt::Orientation orientationSetting() const Q_DECL_OVERRIDE;
void initLayout() override;
Qt::Orientation orientationSetting() const override;
private:
QGridLayout* _layoutMDW;
......@@ -78,7 +78,7 @@ private:
public slots: