diff --git a/kcm/src/collapsablebutton.cpp b/kcm/src/collapsablebutton.cpp index 6be807e32254bff8d1fe0819bea579c6d14965c9..f4a3b2b96235b75635b8b62a393ee174503c46de 100644 --- a/kcm/src/collapsablebutton.cpp +++ b/kcm/src/collapsablebutton.cpp @@ -30,7 +30,7 @@ CollapsableButton::CollapsableButton(const QString &text, QWidget *parent) : QWidget(parent) , mCollapsed(false) - , mWidget(0) + , mWidget(nullptr) { QHBoxLayout *layout = new QHBoxLayout(this); mLabel = new QLabel(text, this); diff --git a/kcm/src/controlpanel.h b/kcm/src/controlpanel.h index ec18646ceb5a9ac4170bfd1504acbec5101bec26..7bab7e4247d9aa895b239b73c0460ca6a6d8a22a 100644 --- a/kcm/src/controlpanel.h +++ b/kcm/src/controlpanel.h @@ -40,7 +40,7 @@ class ControlPanel : public QFrame Q_OBJECT public: - explicit ControlPanel(QWidget *parent = 0); + explicit ControlPanel(QWidget *parent = nullptr); virtual ~ControlPanel(); void setConfig(const KScreen::ConfigPtr &config); diff --git a/kcm/src/declarative/qmloutputcomponent.cpp b/kcm/src/declarative/qmloutputcomponent.cpp index 98bf832f76a118dbf4537e4bdf15f2e9e8e55343..4dc683850aef673ba69b46a36b84cb40454c3424 100644 --- a/kcm/src/declarative/qmloutputcomponent.cpp +++ b/kcm/src/declarative/qmloutputcomponent.cpp @@ -44,16 +44,13 @@ QMLOutputComponent::~QMLOutputComponent() QMLOutput* QMLOutputComponent::createForOutput(const KScreen::OutputPtr &output) { - QObject *instance; - - instance = beginCreate(m_engine->rootContext()); + QObject *instance = beginCreate(m_engine->rootContext()); if (!instance) { qWarning() << errorString(); - return 0; + return nullptr; } - bool success = false; - success = instance->setProperty("outputPtr", QVariant::fromValue(output)); + bool success = instance->setProperty("outputPtr", QVariant::fromValue(output)); Q_ASSERT(success); success = instance->setProperty("screen", QVariant::fromValue(qobject_cast(parent()))); Q_ASSERT(success); diff --git a/kcm/src/declarative/qmlscreen.cpp b/kcm/src/declarative/qmlscreen.cpp index 6f443120715f71606b4c71875b06ebc72ea37541..5b8e2f91cafffe1d5b23594168559b920fdb37d7 100644 --- a/kcm/src/declarative/qmlscreen.cpp +++ b/kcm/src/declarative/qmlscreen.cpp @@ -33,13 +33,13 @@ QMLScreen::QMLScreen(QQuickItem *parent): QQuickItem(parent), - m_config(0), + m_config(nullptr), m_connectedOutputsCount(0), m_enabledOutputsCount(0), - m_leftmost(0), - m_topmost(0), - m_rightmost(0), - m_bottommost(0) + m_leftmost(nullptr), + m_topmost(nullptr), + m_rightmost(nullptr), + m_bottommost(nullptr) { connect(this, &QMLScreen::widthChanged, this, &QMLScreen::viewSizeChanged); connect(this, &QMLScreen::heightChanged, this, &QMLScreen::viewSizeChanged); diff --git a/kcm/src/declarative/qmlscreen.h b/kcm/src/declarative/qmlscreen.h index d74fbbc76ef5183457e9fb9934719b501a2969bd..1c3d54b002686ade4c6247ef993475e445269fe7 100644 --- a/kcm/src/declarative/qmlscreen.h +++ b/kcm/src/declarative/qmlscreen.h @@ -56,7 +56,7 @@ class QMLScreen : public QQuickItem MEMBER m_engine) public: - explicit QMLScreen(QQuickItem *parent = 0); + explicit QMLScreen(QQuickItem *parent = nullptr); virtual ~QMLScreen(); @@ -111,8 +111,11 @@ class QMLScreen : public QQuickItem int m_connectedOutputsCount; int m_enabledOutputsCount; - QQmlEngine* m_engine; - QMLOutput *m_leftmost, *m_topmost, *m_rightmost, *m_bottommost; + QQmlEngine* m_engine = nullptr; + QMLOutput *m_leftmost = nullptr; + QMLOutput *m_topmost = nullptr; + QMLOutput *m_rightmost = nullptr; + QMLOutput *m_bottommost = nullptr; }; diff --git a/kcm/src/kcm_kscreen.h b/kcm/src/kcm_kscreen.h index 93837c4d9c29b89db5b134d6b12dae975789e857..fc72ab859e48eccf9efd3ba76103eff99df90f1d 100644 --- a/kcm/src/kcm_kscreen.h +++ b/kcm/src/kcm_kscreen.h @@ -34,7 +34,7 @@ class KCMKScreen : public KCModule Q_OBJECT public: - explicit KCMKScreen (QWidget* parent = 0, const QVariantList& args = QVariantList()); + explicit KCMKScreen (QWidget* parent = nullptr, const QVariantList& args = QVariantList()); virtual ~KCMKScreen(); virtual QSize sizeHint() const Q_DECL_OVERRIDE; @@ -48,7 +48,7 @@ class KCMKScreen : public KCModule private: void configReady(KScreen::ConfigOperation *op); - Widget *mKScreenWidget; + Widget *mKScreenWidget = nullptr; bool m_blockChanges = false; QHBoxLayout *mMainLayout = nullptr; diff --git a/kcm/src/outputconfig.h b/kcm/src/outputconfig.h index 08535dfa7d007ebf9c2a2a244afd60257819e028..b85dfda49423e09bad10678af274394f8e093f6d 100644 --- a/kcm/src/outputconfig.h +++ b/kcm/src/outputconfig.h @@ -40,7 +40,7 @@ class OutputConfig : public QWidget public: explicit OutputConfig(QWidget *parent); - explicit OutputConfig(const KScreen::OutputPtr &output, QWidget *parent = 0); + explicit OutputConfig(const KScreen::OutputPtr &output, QWidget *parent = nullptr); virtual ~OutputConfig(); virtual void setOutput(const KScreen::OutputPtr &output); @@ -63,13 +63,13 @@ class OutputConfig : public QWidget virtual void initUi(); protected: - QLabel *mTitle; + QLabel *mTitle = nullptr; KScreen::OutputPtr mOutput; - QCheckBox *mEnabled; - ResolutionSlider *mResolution; - QComboBox *mRotation; - QComboBox *mScale; - QComboBox *mRefreshRate; + QCheckBox *mEnabled = nullptr; + ResolutionSlider *mResolution = nullptr; + QComboBox *mRotation = nullptr; + QComboBox *mScale = nullptr; + QComboBox *mRefreshRate = nullptr; bool mShowScaleOption = false; }; diff --git a/kcm/src/previewwidget.h b/kcm/src/previewwidget.h index f0c07a833135e2a275a4156422c20002059454c5..7b81e9ca900ecbc29a574bbd2d73251674365f1f 100644 --- a/kcm/src/previewwidget.h +++ b/kcm/src/previewwidget.h @@ -28,7 +28,7 @@ class PreviewWidget : public QLabel { Q_OBJECT public: - PreviewWidget(QWidget *parent=0); + explicit PreviewWidget(QWidget *parent=nullptr); ~PreviewWidget(); void setScale(qreal scale); public Q_SLOTS: @@ -36,7 +36,7 @@ public Q_SLOTS: private: qreal pointSizeToPixelSize(qreal pointSize) const; qreal m_scale; - QWidget *m_internalPreview; + QWidget *m_internalPreview = nullptr; }; #endif // PREVIEWWIDGET_H diff --git a/kcm/src/primaryoutputcombo.h b/kcm/src/primaryoutputcombo.h index 807753450341647aa038475664f6e0a608eb99c2..eb7a223a3b2c36c3ed51ae09daa14c2cd55129cc 100644 --- a/kcm/src/primaryoutputcombo.h +++ b/kcm/src/primaryoutputcombo.h @@ -30,7 +30,7 @@ class PrimaryOutputCombo : public QComboBox { Q_OBJECT public: - explicit PrimaryOutputCombo(QWidget *parent = 0); + explicit PrimaryOutputCombo(QWidget *parent = nullptr); virtual ~PrimaryOutputCombo(); void setConfig(const KScreen::ConfigPtr &config); @@ -55,4 +55,4 @@ private: KScreen::ConfigPtr mConfig; }; -#endif \ No newline at end of file +#endif diff --git a/kcm/src/resolutionslider.h b/kcm/src/resolutionslider.h index 0224416cf5ca27c67f10f5bf6667a306845323c0..403314dab6f9cb86cae87ba06085ab10c419a56c 100644 --- a/kcm/src/resolutionslider.h +++ b/kcm/src/resolutionslider.h @@ -36,7 +36,7 @@ class ResolutionSlider : public QWidget Q_OBJECT public: - explicit ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent = 0); + explicit ResolutionSlider(const KScreen::OutputPtr &output, QWidget *parent = nullptr); virtual ~ResolutionSlider(); QSize currentResolution() const; @@ -53,11 +53,11 @@ class ResolutionSlider : public QWidget QList mModes; - QLabel *mSmallestLabel; - QLabel *mBiggestLabel; - QLabel *mCurrentLabel; - QSlider *mSlider; - QComboBox *mComboBox; + QLabel *mSmallestLabel = nullptr; + QLabel *mBiggestLabel = nullptr; + QLabel *mCurrentLabel = nullptr; + QSlider *mSlider = nullptr; + QComboBox *mComboBox = nullptr; }; #endif // RESOLUTIONSLIDER_H diff --git a/kcm/src/widget.cpp b/kcm/src/widget.cpp index 248f5bdc0f6f7f6cd19780140424a4d0590f2bb1..b5a8ab12c5d7aa9f2337c6c512d02bf78f36617c 100644 --- a/kcm/src/widget.cpp +++ b/kcm/src/widget.cpp @@ -190,7 +190,7 @@ void Widget::setConfig(const KScreen::ConfigPtr &config) if (qmlOutput) { mScreen->setActiveOutput(qmlOutput); } else { - if (mScreen->outputs().count() > 0) { + if (!mScreen->outputs().isEmpty()) { mScreen->setActiveOutput(mScreen->outputs()[0]); } } diff --git a/kcm/src/widget.h b/kcm/src/widget.h index 326349a6db441ae8b68ebda781854b5e82bfc0db..d95df894444a47d6d3767d6ee0e2310b952ea7ac 100644 --- a/kcm/src/widget.h +++ b/kcm/src/widget.h @@ -46,7 +46,7 @@ class Widget : public QWidget Q_OBJECT public: - explicit Widget(QWidget *parent = 0); + explicit Widget(QWidget *parent = nullptr); virtual ~Widget(); void setConfig(const KScreen::ConfigPtr &config); @@ -80,23 +80,23 @@ class Widget : public QWidget KScreen::OutputPtr findOutput(const KScreen::ConfigPtr &config, const QVariantMap &info); private: - QMLScreen *mScreen; + QMLScreen *mScreen = nullptr; KScreen::ConfigPtr mConfig; KScreen::ConfigPtr mPrevConfig; - QQuickView *mDeclarativeView; - ControlPanel *mControlPanel; + QQuickView *mDeclarativeView = nullptr; + ControlPanel *mControlPanel = nullptr; - ProfilesModel *mProfilesModel; - PrimaryOutputCombo *mPrimaryCombo; - QComboBox *mProfilesCombo; + ProfilesModel *mProfilesModel = nullptr; + PrimaryOutputCombo *mPrimaryCombo = nullptr; + QComboBox *mProfilesCombo = nullptr; - QPushButton *mScaleAllOutputsButton; - QPushButton *mUnifyButton; - QPushButton *mSaveProfileButton; + QPushButton *mScaleAllOutputsButton = nullptr; + QPushButton *mUnifyButton = nullptr; + QPushButton *mSaveProfileButton = nullptr; QList mOutputIdentifiers; - QTimer *mOutputTimer; + QTimer *mOutputTimer = nullptr; };