From f8a7b418d529beaaebd6983f36d49c705ccbee6a Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 16 Jan 2017 18:17:34 +0100 Subject: [PATCH] Prefer nullptr over Q_NULLPTR --- .../calendar/eventdatadecorator.h | 2 +- src/declarativeimports/core/framesvgitem.cpp | 2 +- src/declarativeimports/core/iconitem.cpp | 2 +- src/declarativeimports/core/svgitem.cpp | 6 +++--- src/declarativeimports/core/tooltip.cpp | 2 +- src/declarativeimports/core/tooltipdialog.cpp | 2 +- .../core/windowthumbnail.cpp | 20 +++++++++---------- .../plasmacomponents/qmenu.cpp | 4 ++-- .../platformcomponents/application.h | 2 +- .../platformcomponents/icondialog.h | 2 +- .../platformextensionplugin.cpp | 2 +- src/plasma/private/applet_p.cpp | 4 ++-- src/plasma/private/theme_p.cpp | 2 +- src/plasmaquick/dialog.cpp | 2 +- .../qml/plasmoid/containmentinterface.cpp | 2 +- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/declarativeimports/calendar/eventdatadecorator.h b/src/declarativeimports/calendar/eventdatadecorator.h index de492ed59..f256d65cd 100644 --- a/src/declarativeimports/calendar/eventdatadecorator.h +++ b/src/declarativeimports/calendar/eventdatadecorator.h @@ -39,7 +39,7 @@ class EventDataDecorator : public QObject Q_PROPERTY(QString eventType READ eventType NOTIFY eventDataChanged) public: - EventDataDecorator(const CalendarEvents::EventData &data, QObject *parent = Q_NULLPTR); + EventDataDecorator(const CalendarEvents::EventData &data, QObject *parent = nullptr); QDateTime startDateTime() const; QDateTime endDateTime() const; diff --git a/src/declarativeimports/core/framesvgitem.cpp b/src/declarativeimports/core/framesvgitem.cpp index ef85ed8cd..966f5b609 100644 --- a/src/declarativeimports/core/framesvgitem.cpp +++ b/src/declarativeimports/core/framesvgitem.cpp @@ -448,7 +448,7 @@ QSGNode *FrameSvgItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaint if (!window() || !m_frameSvg || (!m_frameSvg->hasElementPrefix(m_frameSvg->actualPrefix()) && !m_frameSvg->hasElementPrefix(m_prefix))) { delete oldNode; - return Q_NULLPTR; + return nullptr; } if (m_fastPath) { diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 48405f9c6..e406ff081 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -375,7 +375,7 @@ QSGNode* IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update if (m_iconPixmap.isNull() || width() == 0 || height() == 0) { delete oldNode; - return Q_NULLPTR; + return nullptr; } if (m_animation->state() == QAbstractAnimation::Running) { diff --git a/src/declarativeimports/core/svgitem.cpp b/src/declarativeimports/core/svgitem.cpp index 51f09bd60..017cc3627 100644 --- a/src/declarativeimports/core/svgitem.cpp +++ b/src/declarativeimports/core/svgitem.cpp @@ -134,13 +134,13 @@ QSGNode *SvgItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP Q_UNUSED(updatePaintNodeData); if (!window() || !m_svg) { delete oldNode; - return Q_NULLPTR; + return nullptr; } //this is more than just an optimisation, uploading a null image to QSGAtlasTexture causes a crash if (width() == 0 || height() == 0) { delete oldNode; - return Q_NULLPTR; + return nullptr; } ManagedTextureNode *textureNode = static_cast(oldNode); @@ -160,7 +160,7 @@ QSGNode *SvgItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP //Dave E fixed this in Qt in 5.3.something onwards but we need this for now if (m_image.isNull()) { delete textureNode; - return Q_NULLPTR; + return nullptr; } QSharedPointer texture(window()->createTextureFromImage(m_image, QQuickWindow::TextureCanUseAtlas)); diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index ffe1064e0..c823b3ff3 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -133,7 +133,7 @@ void ToolTip::showToolTip() } // Unset the dialog's old contents before reparenting the dialog. - dlg->setMainItem(Q_NULLPTR); + dlg->setMainItem(nullptr); Plasma::Types::Location location = m_location; if (m_location == Plasma::Types::Floating) { diff --git a/src/declarativeimports/core/tooltipdialog.cpp b/src/declarativeimports/core/tooltipdialog.cpp index 208337442..3d1491135 100644 --- a/src/declarativeimports/core/tooltipdialog.cpp +++ b/src/declarativeimports/core/tooltipdialog.cpp @@ -34,7 +34,7 @@ ToolTipDialog::ToolTipDialog(QQuickItem *parent) m_qmlObject(0), m_hideTimeout(4000), m_interactive(false), - m_owner(Q_NULLPTR) + m_owner(nullptr) { Qt::WindowFlags flags = Qt::ToolTip; if (KWindowSystem::isPlatformX11()) { diff --git a/src/declarativeimports/core/windowthumbnail.cpp b/src/declarativeimports/core/windowthumbnail.cpp index dee803929..21cdae71a 100644 --- a/src/declarativeimports/core/windowthumbnail.cpp +++ b/src/declarativeimports/core/windowthumbnail.cpp @@ -145,15 +145,15 @@ WindowThumbnail::WindowThumbnail(QQuickItem *parent) , m_texture(0) #if HAVE_GLX , m_glxPixmap(XCB_PIXMAP_NONE) - , m_bindTexImage(Q_NULLPTR) - , m_releaseTexImage(Q_NULLPTR) + , m_bindTexImage(nullptr) + , m_releaseTexImage(nullptr) #endif // HAVE_GLX #if HAVE_EGL , m_eglFunctionsResolved(false) , m_image(EGL_NO_IMAGE_KHR) - , m_eglCreateImageKHR(Q_NULLPTR) - , m_eglDestroyImageKHR(Q_NULLPTR) - , m_glEGLImageTargetTexture2DOES(Q_NULLPTR) + , m_eglCreateImageKHR(nullptr) + , m_eglDestroyImageKHR(nullptr) + , m_glEGLImageTargetTexture2DOES(nullptr) #endif // HAVE_EGL #endif { @@ -391,7 +391,7 @@ bool WindowThumbnail::windowToTextureGLX(WindowTextureNode *textureNode) if (m_glxPixmap == XCB_PIXMAP_NONE) { xcb_connection_t *c = QX11Info::connection(); auto geometryCookie = xcb_get_geometry_unchecked(c, m_pixmap); - QScopedPointer geo(xcb_get_geometry_reply(c, geometryCookie, Q_NULLPTR)); + QScopedPointer geo(xcb_get_geometry_reply(c, geometryCookie, nullptr)); if (geo.isNull()) { return false; @@ -445,7 +445,7 @@ bool WindowThumbnail::xcbWindowToTextureEGL(WindowTextureNode *textureNode) } glGenTextures(1, &m_texture); - QScopedPointer geo(xcb_get_geometry_reply(c, geometryCookie, Q_NULLPTR)); + QScopedPointer geo(xcb_get_geometry_reply(c, geometryCookie, nullptr)); QSize size; if (!geo.isNull()) { size.setWidth(geo->width); @@ -589,13 +589,13 @@ GLXFBConfig *getConfig(int depth, int *index) }; if (QByteArray((char *)glGetString(GL_RENDERER)).contains("llvmpipe")) { - return Q_NULLPTR; + return nullptr; } int count = 0; GLXFBConfig *fbConfigs = glXChooseFBConfig(QX11Info::display(), QX11Info::appScreen(), attribs, &count); if (count < 1) { - return Q_NULLPTR; + return nullptr; } for (int i = 0; i < count; ++i) { @@ -738,7 +738,7 @@ void WindowThumbnail::startRedirecting() m_damage = xcb_generate_id(c); xcb_damage_create(c, m_damage, m_winId, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); - QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, Q_NULLPTR)); + QScopedPointer attr(xcb_get_window_attributes_reply(c, attribsCookie, nullptr)); uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; if (!attr.isNull()) { events = events | attr->your_event_mask; diff --git a/src/declarativeimports/plasmacomponents/qmenu.cpp b/src/declarativeimports/plasmacomponents/qmenu.cpp index fc07a09c9..9cd3ca682 100644 --- a/src/declarativeimports/plasmacomponents/qmenu.cpp +++ b/src/declarativeimports/plasmacomponents/qmenu.cpp @@ -28,7 +28,7 @@ #include "plasmacomponentsplugin.h" QMenuProxy::QMenuProxy(QObject *parent) : QObject(parent), - m_menu(Q_NULLPTR), + m_menu(nullptr), m_status(DialogStatus::Closed), m_placement(Plasma::Types::LeftPosedTopAlignedPopup) { @@ -110,7 +110,7 @@ void QMenuProxy::setVisualParent(QObject *parent) QWindow *QMenuProxy::transientParent() { if (!m_menu) { - return Q_NULLPTR; + return nullptr; } return m_menu->windowHandle()->transientParent(); } diff --git a/src/declarativeimports/platformcomponents/application.h b/src/declarativeimports/platformcomponents/application.h index defd7692d..1ec2542eb 100644 --- a/src/declarativeimports/platformcomponents/application.h +++ b/src/declarativeimports/platformcomponents/application.h @@ -52,7 +52,7 @@ class Application: public QObject Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged) public: - Application(QObject *parent = Q_NULLPTR); + Application(QObject *parent = nullptr); ~Application(); QString application() const; diff --git a/src/declarativeimports/platformcomponents/icondialog.h b/src/declarativeimports/platformcomponents/icondialog.h index a06eefdf1..c3ae8cd57 100644 --- a/src/declarativeimports/platformcomponents/icondialog.h +++ b/src/declarativeimports/platformcomponents/icondialog.h @@ -46,7 +46,7 @@ class IconDialog: public QObject Q_OBJECT public: - IconDialog(QObject *parent = Q_NULLPTR); + IconDialog(QObject *parent = nullptr); ~IconDialog(); Q_INVOKABLE QString openDialog(); diff --git a/src/declarativeimports/platformcomponents/platformextensionplugin.cpp b/src/declarativeimports/platformcomponents/platformextensionplugin.cpp index 9addf1fc2..388480f90 100644 --- a/src/declarativeimports/platformcomponents/platformextensionplugin.cpp +++ b/src/declarativeimports/platformcomponents/platformextensionplugin.cpp @@ -30,7 +30,7 @@ class PlatformComponentsPlugin: public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.kde.plasma.platformcomponents") public: - PlatformComponentsPlugin(QObject *parent = Q_NULLPTR) + PlatformComponentsPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index ac3d45f3b..fd2bc8bfb 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -68,8 +68,8 @@ AppletPrivate::AppletPrivate(const KPluginMetaData &info, int uniqueID, Applet * actions(AppletPrivate::defaultActions(applet)), activationAction(0), itemStatus(Types::UnknownStatus), - modificationsTimer(Q_NULLPTR), - deleteNotificationTimer(Q_NULLPTR), + modificationsTimer(nullptr), + deleteNotificationTimer(nullptr), hasConfigurationInterface(false), failed(false), transient(false), diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index b90561a48..01bd0f449 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -42,7 +42,7 @@ const char ThemePrivate::themeRcFile[] = "plasmarc"; // these svgs do not follow the theme's colors, but rather the system colors const char ThemePrivate::systemColorsTheme[] = "internal-system-colors"; #if HAVE_X11 -EffectWatcher *ThemePrivate::s_backgroundContrastEffectWatcher = Q_NULLPTR; +EffectWatcher *ThemePrivate::s_backgroundContrastEffectWatcher = nullptr; #endif ThemePrivate *ThemePrivate::globalTheme = 0; diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index f83f647d5..c215664eb 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -549,7 +549,7 @@ void DialogPrivate::updateInputShape() if (extension->present) { // query version auto cookie = xcb_shape_query_version(c); - QScopedPointer version(xcb_shape_query_version_reply(c, cookie, Q_NULLPTR)); + QScopedPointer version(xcb_shape_query_version_reply(c, cookie, nullptr)); if (!version.isNull()) { s_shapeAvailable = (version->major_version * 0x10 + version->minor_version) >= 0x11; } diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index d0dbda967..49421e689 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -238,7 +238,7 @@ void ContainmentInterface::setAppletArgs(Plasma::Applet *applet, const QString & QObject *ContainmentInterface::containmentAt(int x, int y) { - QObject *desktop = Q_NULLPTR; + QObject *desktop = nullptr; foreach (Plasma::Containment *c, m_containment->corona()->containments()) { ContainmentInterface *contInterface = c->property("_plasma_graphicObject").value();