summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRJ Ryan <rryan@mixxx.org>2016-04-25 12:46:45 -0700
committerRJ Ryan <rryan@mixxx.org>2016-04-25 12:48:44 -0700
commitaf0714af69bcd371b9e588ce59d07f60e2a4410d (patch)
tree4b44259344fb2cd6007184a69fcd6f95247a406e
parent3592cdd57c8015f7c4552d0c643aabb6a657211c (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)
-rw-r--r--src/widget/controlwidgetconnection.cpp15
-rw-r--r--src/widget/controlwidgetconnection.h18
-rw-r--r--src/widget/effectwidgetutils.h4
-rw-r--r--src/widget/hexspinbox.cpp5
-rw-r--r--src/widget/hexspinbox.h10
-rw-r--r--src/widget/slidereventhandler.h2
-rw-r--r--src/widget/wanalysislibrarytableview.cpp3
-rw-r--r--src/widget/wanalysislibrarytableview.h4
-rw-r--r--src/widget/wbasewidget.cpp6
-rw-r--r--src/widget/wbasewidget.h2
-rw-r--r--src/widget/wbattery.cpp5
-rw-r--r--src/widget/wbattery.h6
-rw-r--r--src/widget/wcombobox.cpp3
-rw-r--r--src/widget/wcombobox.h8
-rw-r--r--src/widget/wcoverart.cpp12
-rw-r--r--src/widget/wcoverart.h16
-rw-r--r--src/widget/wcoverartlabel.cpp2
-rw-r--r--src/widget/wcoverartlabel.h8
-rw-r--r--src/widget/wcoverartmenu.cpp4
-rw-r--r--src/widget/wcoverartmenu.h4
-rw-r--r--src/widget/wdisplay.cpp4
-rw-r--r--src/widget/wdisplay.h8
-rw-r--r--src/widget/weffect.cpp3
-rw-r--r--src/widget/weffect.h4
-rw-r--r--src/widget/weffectbuttonparameter.cpp3
-rw-r--r--src/widget/weffectbuttonparameter.h4
-rw-r--r--src/widget/weffectchain.cpp3
-rw-r--r--src/widget/weffectchain.h4
-rw-r--r--src/widget/weffectparameter.cpp3
-rw-r--r--src/widget/weffectparameter.h4
-rw-r--r--src/widget/weffectparameterbase.cpp3
-rw-r--r--src/widget/weffectparameterbase.h4
-rw-r--r--src/widget/weffectpushbutton.cpp17
-rw-r--r--src/widget/weffectpushbutton.h12
-rw-r--r--src/widget/wimagestore.cpp12
-rw-r--r--src/widget/wkey.cpp3
-rw-r--r--src/widget/wkey.h8
-rw-r--r--src/widget/wknob.cpp3
-rw-r--r--src/widget/wknob.h12
-rw-r--r--src/widget/wknobcomposed.cpp3
-rw-r--r--src/widget/wknobcomposed.h16
-rw-r--r--src/widget/wlabel.cpp3
-rw-r--r--src/widget/wlabel.h10
-rw-r--r--src/widget/wlibrary.cpp13
-rw-r--r--src/widget/wlibrary.h6
-rw-r--r--src/widget/wlibrarysidebar.cpp5
-rw-r--r--src/widget/wlibrarysidebar.h20
-rw-r--r--src/widget/wlibrarytableview.cpp8
-rw-r--r--src/widget/wlibrarytableview.h4
-rw-r--r--src/widget/wlibrarytextbrowser.cpp3
-rw-r--r--src/widget/wlibrarytextbrowser.h6
-rw-r--r--src/widget/wmainmenubar.cpp64
-rw-r--r--src/widget/wmainmenubar.h8
-rw-r--r--src/widget/wnumber.cpp3
-rw-r--r--src/widget/wnumber.h8
-rw-r--r--src/widget/wnumberdb.cpp3
-rw-r--r--src/widget/wnumberdb.h6
-rw-r--r--src/widget/wnumberpos.cpp6
-rw-r--r--src/widget/wnumberpos.h10
-rw-r--r--src/widget/wnumberrate.cpp5
-rw-r--r--src/widget/wnumberrate.h6
-rw-r--r--src/widget/woverview.cpp18
-rw-r--r--src/widget/woverview.h20
-rw-r--r--src/widget/woverviewhsv.cpp2
-rw-r--r--src/widget/woverviewhsv.h2
-rw-r--r--src/widget/woverviewlmh.cpp2
-rw-r--r--src/widget/woverviewlmh.h2
-rw-r--r--src/widget/woverviewrgb.cpp2
-rw-r--r--src/widget/woverviewrgb.h2
-rw-r--r--src/widget/wpixmapstore.cpp4
-rw-r--r--src/widget/wpushbutton.cpp9
-rw-r--r--src/widget/wpushbutton.h18
-rw-r--r--src/widget/wsearchlineedit.cpp3
-rw-r--r--src/widget/wsearchlineedit.h12
-rw-r--r--src/widget/wsingletoncontainer.cpp6
-rw-r--r--src/widget/wsingletoncontainer.h4
-rw-r--r--src/widget/wsizeawarestack.cpp5
-rw-r--r--src/widget/wsizeawarestack.h10
-rw-r--r--src/widget/wslidercomposed.cpp10
-rw-r--r--src/widget/wslidercomposed.h22
-rw-r--r--src/widget/wspinny.cpp54
-rw-r--r--src/widget/wspinny.h24
-rw-r--r--src/widget/wsplitter.cpp5
-rw-r--r--src/widget/wsplitter.h4
-rw-r--r--src/widget/wstarrating.cpp19
-rw-r--r--src/widget/wstarrating.h6
-rw-r--r--src/widget/wstatuslight.cpp5
-rw-r--r--src/widget/wstatuslight.h8
-rw-r--r--src/widget/wtime.h6
-rw-r--r--src/widget/wtrackproperty.cpp7
-rw-r--r--src/widget/wtrackproperty.h10
-rw-r--r--src/widget/wtracktableview.cpp84
-rw-r--r--src/widget/wtracktableview.h30
-rw-r--r--src/widget/wtracktableviewheader.cpp17
-rw-r--r--src/widget/wtracktableviewheader.h10
-rw-r--r--src/widget/wtracktext.cpp7
-rw-r--r--src/widget/wtracktext.h10
-rw-r--r--src/widget/wvumeter.cpp19
-rw-r--r--src/widget/wvumeter.h8
-rw-r--r--src/widget/wwaveformviewer.cpp2
-rw-r--r--src/widget/wwaveformviewer.h20
-rw-r--r--src/widget/wwidget.cpp2
-rw-r--r--src/widget/wwidget.h6
-rw-r--r--src/widget/wwidgetgroup.cpp13
-rw-r--r--src/widget/wwidgetgroup.h14
-rw-r--r--src/widget/wwidgetstack.cpp10
-rw-r--r--src/widget/wwidgetstack.h14
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.
- double wheelAdjustment = ((QWheelEvent *)e)->delta() / (120.0 * 127.0);
+ double wheelAdjustment = (e)->delta() / (120.0 * 127.0);
double newParameter = pWidget->getControlParameter() + wheelAdjustment;
// Clamp to [0.0, 1.0]