diff options
author | RJ Ryan <rryan@mixxx.org> | 2016-04-25 12:46:45 -0700 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2016-04-25 12:48:44 -0700 |
commit | af0714af69bcd371b9e588ce59d07f60e2a4410d (patch) | |
tree | 4b44259344fb2cd6007184a69fcd6f95247a406e /src | |
parent | 3592cdd57c8015f7c4552d0c643aabb6a657211c (diff) |
Spring cleaning: Apply clang-tidy to src/widget.
Using LLVM 3.8.0:
$ clang-tidy --fix --checks="*,-llvm-header-guard,-readability-implicit-bool-cast,-readability-else-after-return,-google-readability-todo" $(git ls src/widget | xargs) -- (flags to compile)
Diffstat (limited to 'src')
107 files changed, 501 insertions, 533 deletions
diff --git a/src/widget/controlwidgetconnection.cpp b/src/widget/controlwidgetconnection.cpp index 022659052e..5186c9288e 100644 --- a/src/widget/controlwidgetconnection.cpp +++ b/src/widget/controlwidgetconnection.cpp @@ -15,11 +15,10 @@ ControlWidgetConnection::ControlWidgetConnection(WBaseWidget* pBaseWidget, m_pControl->connectValueChanged(SLOT(slotControlValueChanged(double))); } -ControlWidgetConnection::~ControlWidgetConnection() { -} +ControlWidgetConnection::~ControlWidgetConnection() = default; void ControlWidgetConnection::setControlParameter(double parameter) { - if (m_pValueTransformer != NULL) { + if (m_pValueTransformer != nullptr) { parameter = m_pValueTransformer->transformInverse(parameter); } m_pControl->setParameter(parameter); @@ -27,7 +26,7 @@ void ControlWidgetConnection::setControlParameter(double parameter) { double ControlWidgetConnection::getControlParameter() const { double parameter = m_pControl->getParameter(); - if (m_pValueTransformer != NULL) { + if (m_pValueTransformer != nullptr) { parameter = m_pValueTransformer->transform(parameter); } return parameter; @@ -35,7 +34,7 @@ double ControlWidgetConnection::getControlParameter() const { double ControlWidgetConnection::getControlParameterForValue(double value) const { double parameter = m_pControl->getParameterForValue(value); - if (m_pValueTransformer != NULL) { + if (m_pValueTransformer != nullptr) { parameter = m_pValueTransformer->transform(parameter); } return parameter; @@ -51,8 +50,7 @@ ControlParameterWidgetConnection::ControlParameterWidgetConnection(WBaseWidget* m_emitOption(emitOption) { } -ControlParameterWidgetConnection::~ControlParameterWidgetConnection() { -} +ControlParameterWidgetConnection::~ControlParameterWidgetConnection() = default; void ControlParameterWidgetConnection::Init() { slotControlValueChanged(m_pControl->get()); @@ -107,8 +105,7 @@ ControlWidgetPropertyConnection::ControlWidgetPropertyConnection(WBaseWidget* pB slotControlValueChanged(m_pControl->get()); } -ControlWidgetPropertyConnection::~ControlWidgetPropertyConnection() { -} +ControlWidgetPropertyConnection::~ControlWidgetPropertyConnection() = default; QString ControlWidgetPropertyConnection::toDebugString() const { const ConfigKey& key = getKey(); diff --git a/src/widget/controlwidgetconnection.h b/src/widget/controlwidgetconnection.h index 4954c096c9..adb4f6d7b2 100644 --- a/src/widget/controlwidgetconnection.h +++ b/src/widget/controlwidgetconnection.h @@ -18,7 +18,7 @@ class ControlWidgetConnection : public QObject { ControlWidgetConnection(WBaseWidget* pBaseWidget, const ConfigKey& key, ValueTransformer* pTransformer); - virtual ~ControlWidgetConnection(); + ~ControlWidgetConnection() override; double getControlParameter() const; double getControlParameterForValue(double value) const; @@ -33,7 +33,7 @@ class ControlWidgetConnection : public QObject { virtual void slotControlValueChanged(double v) = 0; protected: - void setControlParameter(double v); + void setControlParameter(double parameter); WBaseWidget* m_pWidget; @@ -100,11 +100,11 @@ class ControlParameterWidgetConnection : public ControlWidgetConnection { ValueTransformer* pTransformer, DirectionOption directionOption, EmitOption emitOption); - virtual ~ControlParameterWidgetConnection(); + ~ControlParameterWidgetConnection() override; void Init(); - QString toDebugString() const; + QString toDebugString() const override; int getDirectionOption() const { return m_directionOption; }; int getEmitOption() const { return m_emitOption; }; @@ -118,7 +118,7 @@ class ControlParameterWidgetConnection : public ControlWidgetConnection { void setControlParameterUp(double v); private slots: - virtual void slotControlValueChanged(double v); + void slotControlValueChanged(double value) override; private: DirectionOption m_directionOption; @@ -131,13 +131,13 @@ class ControlWidgetPropertyConnection : public ControlWidgetConnection { ControlWidgetPropertyConnection(WBaseWidget* pBaseWidget, const ConfigKey& key, ValueTransformer* pTransformer, - const QString& property); - virtual ~ControlWidgetPropertyConnection(); + const QString& propertyName); + ~ControlWidgetPropertyConnection() override; - QString toDebugString() const; + QString toDebugString() const override; private slots: - virtual void slotControlValueChanged(double v); + void slotControlValueChanged(double v) override; private: QByteArray m_propertyName; diff --git a/src/widget/effectwidgetutils.h b/src/widget/effectwidgetutils.h index f14b7ad9e5..77d13fe966 100644 --- a/src/widget/effectwidgetutils.h +++ b/src/widget/effectwidgetutils.h @@ -12,7 +12,7 @@ class EffectWidgetUtils { const QDomNode& node, const SkinContext& context, EffectsManager* pEffectsManager) { - if (pEffectsManager == NULL) { + if (pEffectsManager == nullptr) { return EffectRackPointer(); } @@ -116,7 +116,7 @@ class EffectWidgetUtils { } private: - EffectWidgetUtils() {}; + EffectWidgetUtils() = default;; }; #endif /* EFFECTWIDGETUTILS_H */ diff --git a/src/widget/hexspinbox.cpp b/src/widget/hexspinbox.cpp index 0272fc15f5..0035ffcee0 100644 --- a/src/widget/hexspinbox.cpp +++ b/src/widget/hexspinbox.cpp @@ -5,8 +5,7 @@ HexSpinBox::HexSpinBox(QWidget* pParent) setRange(0, 255); } -HexSpinBox::~HexSpinBox() { -} +HexSpinBox::~HexSpinBox() = default; QString HexSpinBox::textFromValue(int value) const { // Construct a hex string formatted like 0xFF. @@ -21,6 +20,6 @@ int HexSpinBox::valueFromText(const QString& text) const { QValidator::State HexSpinBox::validate(QString& input, int& pos) const { const QRegExp regExp("^0(x|X)[0-9A-Fa-f]+"); - QRegExpValidator validator(regExp, NULL); + QRegExpValidator validator(regExp, nullptr); return validator.validate(input, pos); } diff --git a/src/widget/hexspinbox.h b/src/widget/hexspinbox.h index aaa11ebf7c..64dd1b0feb 100644 --- a/src/widget/hexspinbox.h +++ b/src/widget/hexspinbox.h @@ -6,13 +6,13 @@ class HexSpinBox : public QSpinBox { public: - HexSpinBox(QWidget *parent); - virtual ~HexSpinBox(); + explicit HexSpinBox(QWidget *pParent); + ~HexSpinBox() override; protected: - QString textFromValue(int value) const; - int valueFromText(const QString& text) const; - QValidator::State validate(QString& input, int& pos) const; + QString textFromValue(int value) const override; + int valueFromText(const QString& text) const override; + QValidator::State validate(QString& input, int& pos) const override; }; #endif /* HEXSPINBOX_H */ diff --git a/src/widget/slidereventhandler.h b/src/widget/slidereventhandler.h index adefad3f18..a456ca0cf3 100644 --- a/src/widget/slidereventhandler.h +++ b/src/widget/slidereventhandler.h @@ -105,7 +105,7 @@ class SliderEventHandler { void wheelEvent(T* pWidget, QWheelEvent* e) { // For legacy (MIDI) reasons this is tuned to 127. |