Commit 581cfb45 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify + remove extra ;

parent 9071d74a
......@@ -445,7 +445,7 @@ void KMixWindow::saveVolumes()
saveVolumes(QString());
}
void KMixWindow::saveVolumes(QString postfix)
void KMixWindow::saveVolumes(const QString &postfix)
{
const QString& kmixctrlRcFilename = getKmixctrlRcFilename(postfix);
KConfig *cfg = new KConfig(kmixctrlRcFilename);
......@@ -463,7 +463,7 @@ void KMixWindow::saveVolumes(QString postfix)
<< "Volume configuration saved";
}
QString KMixWindow::getKmixctrlRcFilename(QString postfix)
QString KMixWindow::getKmixctrlRcFilename(const QString &postfix)
{
QString kmixctrlRcFilename("kmixctrlrc");
if (!postfix.isEmpty())
......
......@@ -86,7 +86,7 @@ KMixWindow : public KXmlGuiWindow
void loadVolumes();
void loadVolumes(QString postfix);
void saveVolumes();
void saveVolumes(QString postfix);
void saveVolumes(const QString &postfix);
void saveConfig();
virtual void applyPrefs();
void recreateGUI(bool saveView, bool reset);
......@@ -131,7 +131,7 @@ private:
void setInitialSize();
private:
static QString getKmixctrlRcFilename(QString postfix);
static QString getKmixctrlRcFilename(const QString &postfix);
bool profileExists(QString guiProfileId);
bool updateDocking();
void removeDock();
......
......@@ -41,7 +41,7 @@ KMixD : public KDEDModule, protected QDBusContext
Q_CLASSINFO("D-Bus Interface", "org.kde.KMixD")
public:
KMixD(QObject* parent, const QList<QVariant>&);
explicit KMixD(QObject* parent, const QList<QVariant>&);
~KMixD();
private:
......
......@@ -116,7 +116,7 @@ public:
Mixer_MPRIS2(Mixer *mixer, int device);
virtual ~Mixer_MPRIS2();
QString getDriverName() override;
QString getId() const override { return _id; };
QString getId() const override { return _id; }
int open() override;
int close() override;
......
......@@ -46,7 +46,7 @@ protected:
int wrapIoctl(int ioctlRet);
void reinitialize() { open(); close(); };
void reinitialize() { open(); close(); }
virtual int open();
virtual int close();
......
......@@ -60,7 +60,7 @@ class Mixer_PULSE : public Mixer_Backend
bool moveStream( const QString& id, const QString& destId ) override;
QString getDriverName() override;
QString getId() const override { return _id; };
QString getId() const override { return _id; }
bool needsPolling() override { return false; }
......
......@@ -77,10 +77,10 @@ public:
this->sourceId = sourceId;
}
const QString getMixerId() const { return mixerId; };
ControlManager::ChangeType getChangeType() const { return controlChangeType; };
QObject *getTarget() const { return target; };
const QString getSourceId() const { return sourceId; };
const QString getMixerId() const { return mixerId; }
ControlManager::ChangeType getChangeType() const { return controlChangeType; }
QObject *getTarget() const { return target; }
const QString getSourceId() const { return sourceId; }
private:
QString mixerId;
......
......@@ -45,7 +45,7 @@ public:
private:
ControlPool();
virtual ~ControlPool() {};
virtual ~ControlPool() {}
QMap<QString, shared_ptr<MixDevice> > *pool;
......
......@@ -44,12 +44,12 @@ public:
explicit MediaController(const QString &controlId);
virtual ~MediaController() = default;
void addMediaPlayControl() { mediaPlayControl = true; };
void addMediaNextControl() { mediaNextControl = true; };
void addMediaPrevControl() { mediaPrevControl = true; };
bool hasMediaPlayControl() { return mediaPlayControl; };
bool hasMediaNextControl() { return mediaNextControl; };
bool hasMediaPrevControl() { return mediaPrevControl; };
void addMediaPlayControl() { mediaPlayControl = true; }
void addMediaNextControl() { mediaNextControl = true; }
void addMediaPrevControl() { mediaPrevControl = true; }
bool hasMediaPlayControl() { return mediaPlayControl; }
bool hasMediaNextControl() { return mediaNextControl; }
bool hasMediaPrevControl() { return mediaPrevControl; }
bool hasControls() const;
......
......@@ -183,9 +183,9 @@ public:
virtual bool moveStream(const QString &id, const QString &destId);
virtual QString currentStreamDevice(const QString &id) const;
virtual int mediaPlay(QString id) { return _mixerBackend->mediaPlay(id); };
virtual int mediaPrev(QString id) { return _mixerBackend->mediaPrev(id); };
virtual int mediaNext(QString id) { return _mixerBackend->mediaNext(id); };
virtual int mediaPlay(QString id) { return _mixerBackend->mediaPlay(id); }
virtual int mediaPrev(QString id) { return _mixerBackend->mediaPrev(id); }
virtual int mediaNext(QString id) { return _mixerBackend->mediaNext(id); }
void commitVolumeChange( shared_ptr<MixDevice> md );
......
......@@ -77,7 +77,7 @@ void MixSet::setName( const QString &name )
m_name = name;
}
shared_ptr<MixDevice> MixSet::get(QString id)
shared_ptr<MixDevice> MixSet::get(const QString &id)
{
shared_ptr<MixDevice> mdRet;
......@@ -92,7 +92,7 @@ shared_ptr<MixDevice> MixSet::get(QString id)
return mdRet;
}
void MixSet::removeById(QString id)
void MixSet::removeById(const QString &id)
{
for (int i=0; i < count() ; i++ )
{
......
......@@ -34,12 +34,12 @@ class KMIXCORE_EXPORT MixSet : public QList<shared_ptr<MixDevice> >
bool read( KConfig *config, const QString& grp );
bool write( KConfig *config, const QString& grp );
QString name() { return m_name; }
QString name() const { return m_name; }
void setName( const QString &name );
shared_ptr<MixDevice> get(QString id);
shared_ptr<MixDevice> get(const QString &id);
void removeById(QString id);
void removeById(const QString &id);
private:
QString m_name;
......
......@@ -290,7 +290,7 @@ void KMixPrefDlg::createControlsTab()
* @param toopTipText
* @param objectName
*/
void KMixPrefDlg::addWidgetToLayout(QWidget* widget, QBoxLayout* layout, int spacingBefore, QString tooltip, QString kconfigName)
void KMixPrefDlg::addWidgetToLayout(QWidget* widget, QBoxLayout* layout, int spacingBefore, const QString &tooltip, const QString &kconfigName)
{
if (!kconfigName.isEmpty())
{
......
......@@ -88,7 +88,7 @@ private:
GlobalConfig& dialogConfig;
void addWidgetToLayout(QWidget* widget, QBoxLayout* layout, int spacingBefore, QString tooltip, QString kconfigName);
void addWidgetToLayout(QWidget* widget, QBoxLayout* layout, int spacingBefore, const QString &tooltip, const QString &kconfigName);
void createStartupTab();
void replaceBackendsInTab();
......
......@@ -38,7 +38,7 @@ class KMixToolBox {
static void setLabels (QList<QWidget *> &mdws, bool on );
static void setTicks (QList<QWidget *> &mdws, bool on );
static void notification(const char *notificationName, const QString &text, const QStringList &actions = QStringList(), QObject *receiver = 0, const char *actionSlot = 0);
static void notification(const char *notificationName, const QString &text, const QStringList &actions = QStringList(), QObject *receiver = nullptr, const char *actionSlot = nullptr);
};
#endif
......@@ -35,7 +35,7 @@ class KSmallSlider : public QAbstractSlider
public:
KSmallSlider( int minValue, int maxValue, int pageStep, int value,
Qt::Orientation, QWidget *parent, const char *name=0 );
Qt::Orientation, QWidget *parent, const char *name=nullptr );
/* void setChid(Volume::ChannelID chid) { this->chid = chid; };
Volume::ChannelID getChid() { return chid; };*/
......
......@@ -103,6 +103,6 @@ private:
KShortcutsDialog *m_shortcutsDialog;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(MixDeviceWidget::MDWFlags);
Q_DECLARE_OPERATORS_FOR_FLAGS(MixDeviceWidget::MDWFlags)
#endif
......@@ -59,7 +59,7 @@ class MixerEngine : public Plasma::DataEngine,
Q_OBJECT
public:
MixerEngine(QObject* parent, const QVariantList& args);
explicit MixerEngine(QObject* parent, const QVariantList& args);
~MixerEngine();
QStringList sources() const override;
......
......@@ -41,7 +41,7 @@ Plasma::ServiceJob* MixerService::createJob(const QString& operation,
}
MixerJob::MixerJob( MixerService* service, const QString &operation,
QMap<QString,QVariant>& parameters )
const QMap<QString,QVariant>& parameters )
: Plasma::ServiceJob(service->destination(), operation, parameters, service)
, m_service( service )
{
......
......@@ -30,7 +30,7 @@ class MixerService : public Plasma::Service
{
Q_OBJECT
public:
MixerService( QObject *parent, OrgKdeKMixControlInterface *iface );
explicit MixerService( QObject *parent, OrgKdeKMixControlInterface *iface );
OrgKdeKMixControlInterface* iface();
protected:
Plasma::ServiceJob* createJob(const QString& operation,
......@@ -43,8 +43,8 @@ class MixerJob : public Plasma::ServiceJob
{
Q_OBJECT
public:
MixerJob( MixerService *parent, const QString &operation,
QMap<QString,QVariant>& parameters );
MixerJob(MixerService *parent, const QString &operation,
const QMap<QString, QVariant> &parameters );
void start() override;
private:
MixerService *m_service;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment