diff --git a/src/declarativeimports/calendar/daysmodel.cpp b/src/declarativeimports/calendar/daysmodel.cpp index 273eab917..1f701440c 100644 --- a/src/declarativeimports/calendar/daysmodel.cpp +++ b/src/declarativeimports/calendar/daysmodel.cpp @@ -218,9 +218,9 @@ void DaysModel::setPluginsManager(QObject *manager) return; } - if (m_pluginsManager != 0) { + if (m_pluginsManager) { m_pluginsManager->deleteLater(); - m_pluginsManager = 0; + m_pluginsManager = nullptr; } m_pluginsManager = m; diff --git a/src/declarativeimports/calendar/eventpluginsmanager.cpp b/src/declarativeimports/calendar/eventpluginsmanager.cpp index c4b46063e..c7301c413 100644 --- a/src/declarativeimports/calendar/eventpluginsmanager.cpp +++ b/src/declarativeimports/calendar/eventpluginsmanager.cpp @@ -42,7 +42,7 @@ public: m_roles.insert(Qt::EditRole, QByteArrayLiteral("checked")); m_roles.insert(Qt::UserRole, QByteArrayLiteral("configUi")); m_roles.insert(Qt::UserRole + 1, QByteArrayLiteral("pluginPath")); - }; + } // make these two available to the manager void beginResetModel() diff --git a/src/declarativeimports/core/colorscope.cpp b/src/declarativeimports/core/colorscope.cpp index c427221eb..56e379ec0 100644 --- a/src/declarativeimports/core/colorscope.cpp +++ b/src/declarativeimports/core/colorscope.cpp @@ -57,7 +57,7 @@ ColorScope *ColorScope::qmlAttachedProperties(QObject *object) return cs; } - ColorScope *s = new ColorScope(0, object); + ColorScope *s = new ColorScope(nullptr, object); s_attachedScopes[object] = s; s->m_inherit = true; s->setParent(object); diff --git a/src/declarativeimports/core/colorscope.h b/src/declarativeimports/core/colorscope.h index ce4d85ec2..2596352dc 100644 --- a/src/declarativeimports/core/colorscope.h +++ b/src/declarativeimports/core/colorscope.h @@ -88,7 +88,7 @@ class ColorScope : public QQuickItem public: /// @cond INTERNAL_DOCS explicit ColorScope(QQuickItem *parent = nullptr, QObject *parentObject = nullptr); - ~ColorScope(); + ~ColorScope() Q_DECL_OVERRIDE; void setColorGroup(Plasma::Theme::ColorGroup group); Plasma::Theme::ColorGroup colorGroup() const; diff --git a/src/declarativeimports/core/datamodel.cpp b/src/declarativeimports/core/datamodel.cpp index 7664cb747..b0257d866 100644 --- a/src/declarativeimports/core/datamodel.cpp +++ b/src/declarativeimports/core/datamodel.cpp @@ -217,7 +217,7 @@ int SortFilterModel::mapRowFromSource(int row) const DataModel::DataModel(QObject *parent) : QAbstractItemModel(parent), - m_dataSource(0), + m_dataSource(nullptr), m_maxRoleId(Qt::UserRole + 1) { //There is one reserved role name: DataEngineSource @@ -293,7 +293,7 @@ void DataModel::setDataSource(QObject *object) } if (m_dataSource) { - disconnect(m_dataSource, 0, this, 0); + disconnect(m_dataSource, nullptr, this, nullptr); } m_dataSource = source; diff --git a/src/declarativeimports/core/framesvgitem.cpp b/src/declarativeimports/core/framesvgitem.cpp index 7449a81c4..47d116750 100644 --- a/src/declarativeimports/core/framesvgitem.cpp +++ b/src/declarativeimports/core/framesvgitem.cpp @@ -514,7 +514,7 @@ QSGNode *FrameSvgItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaint if (m_fastPath) { if (m_textureChanged) { delete oldNode; - oldNode = 0; + oldNode = nullptr; } if (!oldNode) { diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index d8b060f17..c554f8673 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -37,7 +37,7 @@ IconItem::IconItem(QQuickItem *parent) : QQuickItem(parent), - m_svgIcon(0), + m_svgIcon(nullptr), m_status(Plasma::Svg::Normal), m_smooth(true), m_active(false), @@ -163,7 +163,7 @@ void IconItem::setSource(const QVariant &source) m_imageIcon = QImage(localFile); m_svgIconName.clear(); delete m_svgIcon; - m_svgIcon = 0; + m_svgIcon = nullptr; } else { if (!m_svgIcon) { m_svgIcon = new Plasma::Svg(this); @@ -209,7 +209,7 @@ void IconItem::setSource(const QVariant &source) } m_svgIconName.clear(); delete m_svgIcon; - m_svgIcon = 0; + m_svgIcon = nullptr; m_imageIcon = QImage(); } } @@ -220,19 +220,19 @@ void IconItem::setSource(const QVariant &source) m_imageIcon = QImage(); m_svgIconName.clear(); delete m_svgIcon; - m_svgIcon = 0; + m_svgIcon = nullptr; } else if (source.canConvert()) { m_icon = QIcon(); m_imageIcon = source.value(); m_svgIconName.clear(); delete m_svgIcon; - m_svgIcon = 0; + m_svgIcon = nullptr; } else { m_icon = QIcon(); m_imageIcon = QImage(); m_svgIconName.clear(); delete m_svgIcon; - m_svgIcon = 0; + m_svgIcon = nullptr; } if (width() > 0 && height() > 0) { @@ -470,7 +470,7 @@ QSGNode* IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update { Q_UNUSED(updatePaintNodeData) - if (m_iconPixmap.isNull() || width() == 0 || height() == 0) { + if (m_iconPixmap.isNull() || width() == 0.0 || height() == 0.0) { delete oldNode; return nullptr; } diff --git a/src/declarativeimports/core/iconitem.h b/src/declarativeimports/core/iconitem.h index 9ae0837d7..bf7ff25dc 100644 --- a/src/declarativeimports/core/iconitem.h +++ b/src/declarativeimports/core/iconitem.h @@ -126,7 +126,7 @@ class IconItem : public QQuickItem public: explicit IconItem(QQuickItem *parent = nullptr); - ~IconItem(); + ~IconItem() Q_DECL_OVERRIDE; void setSource(const QVariant &source); QVariant source() const; diff --git a/src/declarativeimports/core/serviceoperationstatus.cpp b/src/declarativeimports/core/serviceoperationstatus.cpp index e22cc55c1..ed355b6cb 100644 --- a/src/declarativeimports/core/serviceoperationstatus.cpp +++ b/src/declarativeimports/core/serviceoperationstatus.cpp @@ -36,7 +36,7 @@ void ServiceOperationStatus::setService(Plasma::Service *service) } if (m_service) { - disconnect(m_service.data(), 0, this, 0); + disconnect(m_service.data(), nullptr, this, nullptr); } if (service) { connect(service, &Plasma::Service::operationEnabledChanged, diff --git a/src/declarativeimports/core/svgitem.cpp b/src/declarativeimports/core/svgitem.cpp index 9ebc7c334..d1b37b9f4 100644 --- a/src/declarativeimports/core/svgitem.cpp +++ b/src/declarativeimports/core/svgitem.cpp @@ -86,7 +86,7 @@ QSizeF SvgItem::naturalSize() const void SvgItem::setSvg(Plasma::Svg *svg) { if (m_svg) { - disconnect(m_svg.data(), 0, this, 0); + disconnect(m_svg.data(), nullptr, this, nullptr); } m_svg = svg; updateDevicePixelRatio(); @@ -138,7 +138,7 @@ QSGNode *SvgItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP } //this is more than just an optimisation, uploading a null image to QSGAtlasTexture causes a crash - if (width() == 0 || height() == 0) { + if (width() == 0.0 || height() == 0.0) { delete oldNode; return nullptr; } diff --git a/src/declarativeimports/core/tooltip.h b/src/declarativeimports/core/tooltip.h index b37c467c5..543b6c5c6 100644 --- a/src/declarativeimports/core/tooltip.h +++ b/src/declarativeimports/core/tooltip.h @@ -127,8 +127,8 @@ class ToolTip : public QQuickItem public: /// @cond INTERNAL_DOCS - ToolTip(QQuickItem *parent = nullptr); - ~ToolTip(); + explicit ToolTip(QQuickItem *parent = nullptr); + ~ToolTip() Q_DECL_OVERRIDE; QQuickItem *mainItem() const; void setMainItem(QQuickItem *mainItem); diff --git a/src/declarativeimports/core/tooltipdialog.cpp b/src/declarativeimports/core/tooltipdialog.cpp index e5f629c4e..787f19fde 100644 --- a/src/declarativeimports/core/tooltipdialog.cpp +++ b/src/declarativeimports/core/tooltipdialog.cpp @@ -29,7 +29,7 @@ ToolTipDialog::ToolTipDialog(QQuickItem *parent) : Dialog(parent), - m_qmlObject(0), + m_qmlObject(nullptr), m_hideTimeout(4000), m_interactive(false), m_owner(nullptr) diff --git a/src/declarativeimports/core/tooltipdialog.h b/src/declarativeimports/core/tooltipdialog.h index 2652fc9ae..ce9011f7a 100644 --- a/src/declarativeimports/core/tooltipdialog.h +++ b/src/declarativeimports/core/tooltipdialog.h @@ -43,8 +43,8 @@ class ToolTipDialog : public PlasmaQuick::Dialog Q_OBJECT public: - ToolTipDialog(QQuickItem *parent = nullptr); - ~ToolTipDialog(); + explicit ToolTipDialog(QQuickItem *parent = nullptr); + ~ToolTipDialog() Q_DECL_OVERRIDE; QQuickItem *loadDefaultItem(); diff --git a/src/declarativeimports/core/units.h b/src/declarativeimports/core/units.h index e93270cc7..a0a7e9f28 100644 --- a/src/declarativeimports/core/units.h +++ b/src/declarativeimports/core/units.h @@ -32,8 +32,8 @@ class SharedAppFilter : public QObject { Q_OBJECT public: - SharedAppFilter(QObject *parent = nullptr); - ~SharedAppFilter(); + explicit SharedAppFilter(QObject *parent = nullptr); + ~SharedAppFilter() Q_DECL_OVERRIDE; Q_SIGNALS: void fontChanged(); diff --git a/src/declarativeimports/plasmacomponents/qmenu.h b/src/declarativeimports/plasmacomponents/qmenu.h index 34e20f64f..8a40b7751 100644 --- a/src/declarativeimports/plasmacomponents/qmenu.h +++ b/src/declarativeimports/plasmacomponents/qmenu.h @@ -102,7 +102,7 @@ class QMenuProxy : public QObject public: explicit QMenuProxy(QObject *parent = nullptr); - ~QMenuProxy(); + ~QMenuProxy() Q_DECL_OVERRIDE; QQmlListProperty content(); int actionCount() const; diff --git a/src/declarativeimports/plasmacomponents/qmenuitem.cpp b/src/declarativeimports/plasmacomponents/qmenuitem.cpp index f773a26d4..0d598491a 100644 --- a/src/declarativeimports/plasmacomponents/qmenuitem.cpp +++ b/src/declarativeimports/plasmacomponents/qmenuitem.cpp @@ -22,7 +22,7 @@ QMenuItem::QMenuItem(QQuickItem *parent) : QQuickItem(parent), - m_action(0), + m_action(nullptr), m_section(false) { setAction(new QAction(this)); @@ -37,7 +37,7 @@ void QMenuItem::setAction(QAction *a) { if (m_action != a) { if (m_action) { - disconnect(m_action, 0, this, 0); + disconnect(m_action, nullptr, this, nullptr); if (m_action->parent() == this) { delete m_action; diff --git a/src/declarativeimports/plasmacomponents/qmenuitem.h b/src/declarativeimports/plasmacomponents/qmenuitem.h index c52ca36c2..c42d52000 100644 --- a/src/declarativeimports/plasmacomponents/qmenuitem.h +++ b/src/declarativeimports/plasmacomponents/qmenuitem.h @@ -48,7 +48,7 @@ class QMenuItem : public QQuickItem Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY toggled) public: - QMenuItem(QQuickItem *parent = nullptr); + explicit QMenuItem(QQuickItem *parent = nullptr); QAction *action() const; void setAction(QAction *a); diff --git a/src/declarativeimports/plasmacomponents/qrangemodel.cpp b/src/declarativeimports/plasmacomponents/qrangemodel.cpp index f57b3233d..1fa2a9ac1 100644 --- a/src/declarativeimports/plasmacomponents/qrangemodel.cpp +++ b/src/declarativeimports/plasmacomponents/qrangemodel.cpp @@ -104,7 +104,7 @@ qreal QRangeModelPrivate::publicPosition(qreal position) const const qreal positionValueRatio = valueRange ? (max - min) / valueRange : 0; const qreal positionStep = stepSize * positionValueRatio; - if (positionStep == 0) { + if (positionStep == 0.0) { return (min < max) ? qBound(min, position, max) : qBound(max, position, min); } @@ -146,7 +146,7 @@ qreal QRangeModelPrivate::publicValue(qreal value) const // QML bindings; a position that is initially invalid because it lays // outside the range, might become valid later if the range changes. - if (stepSize == 0) { + if (stepSize == 0.0) { return qBound(minimum, value, maximum); } @@ -215,7 +215,7 @@ QRangeModel::QRangeModel(QRangeModelPrivate &dd, QObject *parent) QRangeModel::~QRangeModel() { delete d_ptr; - d_ptr = 0; + d_ptr = nullptr; } /*! diff --git a/src/declarativeimports/plasmaextracomponents/appbackgroundprovider_p.h b/src/declarativeimports/plasmaextracomponents/appbackgroundprovider_p.h index ea4f07aa8..fbd1d5655 100644 --- a/src/declarativeimports/plasmaextracomponents/appbackgroundprovider_p.h +++ b/src/declarativeimports/plasmaextracomponents/appbackgroundprovider_p.h @@ -37,7 +37,7 @@ class AppBackgroundProvider : public QQuickImageProvider public: AppBackgroundProvider(); - ~AppBackgroundProvider(); + ~AppBackgroundProvider() Q_DECL_OVERRIDE; QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) Q_DECL_OVERRIDE; private: Plasma::Theme *m_theme;