Prefer nullptr over Q_NULLPTR

This commit is contained in:
Kevin Funk 2017-01-16 18:17:34 +01:00
parent 7d3d68a3c8
commit f8a7b418d5
15 changed files with 28 additions and 28 deletions

View File

@ -39,7 +39,7 @@ class EventDataDecorator : public QObject
Q_PROPERTY(QString eventType READ eventType NOTIFY eventDataChanged) Q_PROPERTY(QString eventType READ eventType NOTIFY eventDataChanged)
public: public:
EventDataDecorator(const CalendarEvents::EventData &data, QObject *parent = Q_NULLPTR); EventDataDecorator(const CalendarEvents::EventData &data, QObject *parent = nullptr);
QDateTime startDateTime() const; QDateTime startDateTime() const;
QDateTime endDateTime() const; QDateTime endDateTime() const;

View File

@ -448,7 +448,7 @@ QSGNode *FrameSvgItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaint
if (!window() || !m_frameSvg || if (!window() || !m_frameSvg ||
(!m_frameSvg->hasElementPrefix(m_frameSvg->actualPrefix()) && !m_frameSvg->hasElementPrefix(m_prefix))) { (!m_frameSvg->hasElementPrefix(m_frameSvg->actualPrefix()) && !m_frameSvg->hasElementPrefix(m_prefix))) {
delete oldNode; delete oldNode;
return Q_NULLPTR; return nullptr;
} }
if (m_fastPath) { if (m_fastPath) {

View File

@ -375,7 +375,7 @@ QSGNode* IconItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *update
if (m_iconPixmap.isNull() || width() == 0 || height() == 0) { if (m_iconPixmap.isNull() || width() == 0 || height() == 0) {
delete oldNode; delete oldNode;
return Q_NULLPTR; return nullptr;
} }
if (m_animation->state() == QAbstractAnimation::Running) { if (m_animation->state() == QAbstractAnimation::Running) {

View File

@ -134,13 +134,13 @@ QSGNode *SvgItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updateP
Q_UNUSED(updatePaintNodeData); Q_UNUSED(updatePaintNodeData);
if (!window() || !m_svg) { if (!window() || !m_svg) {
delete oldNode; delete oldNode;
return Q_NULLPTR; return nullptr;
} }
//this is more than just an optimisation, uploading a null image to QSGAtlasTexture causes a crash //this is more than just an optimisation, uploading a null image to QSGAtlasTexture causes a crash
if (width() == 0 || height() == 0) { if (width() == 0 || height() == 0) {
delete oldNode; delete oldNode;
return Q_NULLPTR; return nullptr;
} }
ManagedTextureNode *textureNode = static_cast<ManagedTextureNode *>(oldNode); ManagedTextureNode *textureNode = static_cast<ManagedTextureNode *>(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 //Dave E fixed this in Qt in 5.3.something onwards but we need this for now
if (m_image.isNull()) { if (m_image.isNull()) {
delete textureNode; delete textureNode;
return Q_NULLPTR; return nullptr;
} }
QSharedPointer<QSGTexture> texture(window()->createTextureFromImage(m_image, QQuickWindow::TextureCanUseAtlas)); QSharedPointer<QSGTexture> texture(window()->createTextureFromImage(m_image, QQuickWindow::TextureCanUseAtlas));

View File

@ -133,7 +133,7 @@ void ToolTip::showToolTip()
} }
// Unset the dialog's old contents before reparenting the dialog. // Unset the dialog's old contents before reparenting the dialog.
dlg->setMainItem(Q_NULLPTR); dlg->setMainItem(nullptr);
Plasma::Types::Location location = m_location; Plasma::Types::Location location = m_location;
if (m_location == Plasma::Types::Floating) { if (m_location == Plasma::Types::Floating) {

View File

@ -34,7 +34,7 @@ ToolTipDialog::ToolTipDialog(QQuickItem *parent)
m_qmlObject(0), m_qmlObject(0),
m_hideTimeout(4000), m_hideTimeout(4000),
m_interactive(false), m_interactive(false),
m_owner(Q_NULLPTR) m_owner(nullptr)
{ {
Qt::WindowFlags flags = Qt::ToolTip; Qt::WindowFlags flags = Qt::ToolTip;
if (KWindowSystem::isPlatformX11()) { if (KWindowSystem::isPlatformX11()) {

View File

@ -145,15 +145,15 @@ WindowThumbnail::WindowThumbnail(QQuickItem *parent)
, m_texture(0) , m_texture(0)
#if HAVE_GLX #if HAVE_GLX
, m_glxPixmap(XCB_PIXMAP_NONE) , m_glxPixmap(XCB_PIXMAP_NONE)
, m_bindTexImage(Q_NULLPTR) , m_bindTexImage(nullptr)
, m_releaseTexImage(Q_NULLPTR) , m_releaseTexImage(nullptr)
#endif // HAVE_GLX #endif // HAVE_GLX
#if HAVE_EGL #if HAVE_EGL
, m_eglFunctionsResolved(false) , m_eglFunctionsResolved(false)
, m_image(EGL_NO_IMAGE_KHR) , m_image(EGL_NO_IMAGE_KHR)
, m_eglCreateImageKHR(Q_NULLPTR) , m_eglCreateImageKHR(nullptr)
, m_eglDestroyImageKHR(Q_NULLPTR) , m_eglDestroyImageKHR(nullptr)
, m_glEGLImageTargetTexture2DOES(Q_NULLPTR) , m_glEGLImageTargetTexture2DOES(nullptr)
#endif // HAVE_EGL #endif // HAVE_EGL
#endif #endif
{ {
@ -391,7 +391,7 @@ bool WindowThumbnail::windowToTextureGLX(WindowTextureNode *textureNode)
if (m_glxPixmap == XCB_PIXMAP_NONE) { if (m_glxPixmap == XCB_PIXMAP_NONE) {
xcb_connection_t *c = QX11Info::connection(); xcb_connection_t *c = QX11Info::connection();
auto geometryCookie = xcb_get_geometry_unchecked(c, m_pixmap); auto geometryCookie = xcb_get_geometry_unchecked(c, m_pixmap);
QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> geo(xcb_get_geometry_reply(c, geometryCookie, Q_NULLPTR)); QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> geo(xcb_get_geometry_reply(c, geometryCookie, nullptr));
if (geo.isNull()) { if (geo.isNull()) {
return false; return false;
@ -445,7 +445,7 @@ bool WindowThumbnail::xcbWindowToTextureEGL(WindowTextureNode *textureNode)
} }
glGenTextures(1, &m_texture); glGenTextures(1, &m_texture);
QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> geo(xcb_get_geometry_reply(c, geometryCookie, Q_NULLPTR)); QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> geo(xcb_get_geometry_reply(c, geometryCookie, nullptr));
QSize size; QSize size;
if (!geo.isNull()) { if (!geo.isNull()) {
size.setWidth(geo->width); size.setWidth(geo->width);
@ -589,13 +589,13 @@ GLXFBConfig *getConfig(int depth, int *index)
}; };
if (QByteArray((char *)glGetString(GL_RENDERER)).contains("llvmpipe")) { if (QByteArray((char *)glGetString(GL_RENDERER)).contains("llvmpipe")) {
return Q_NULLPTR; return nullptr;
} }
int count = 0; int count = 0;
GLXFBConfig *fbConfigs = glXChooseFBConfig(QX11Info::display(), QX11Info::appScreen(), attribs, &count); GLXFBConfig *fbConfigs = glXChooseFBConfig(QX11Info::display(), QX11Info::appScreen(), attribs, &count);
if (count < 1) { if (count < 1) {
return Q_NULLPTR; return nullptr;
} }
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
@ -738,7 +738,7 @@ void WindowThumbnail::startRedirecting()
m_damage = xcb_generate_id(c); m_damage = xcb_generate_id(c);
xcb_damage_create(c, m_damage, m_winId, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY); xcb_damage_create(c, m_damage, m_winId, XCB_DAMAGE_REPORT_LEVEL_NON_EMPTY);
QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> attr(xcb_get_window_attributes_reply(c, attribsCookie, Q_NULLPTR)); QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> attr(xcb_get_window_attributes_reply(c, attribsCookie, nullptr));
uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY; uint32_t events = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
if (!attr.isNull()) { if (!attr.isNull()) {
events = events | attr->your_event_mask; events = events | attr->your_event_mask;

View File

@ -28,7 +28,7 @@
#include "plasmacomponentsplugin.h" #include "plasmacomponentsplugin.h"
QMenuProxy::QMenuProxy(QObject *parent) QMenuProxy::QMenuProxy(QObject *parent)
: QObject(parent), : QObject(parent),
m_menu(Q_NULLPTR), m_menu(nullptr),
m_status(DialogStatus::Closed), m_status(DialogStatus::Closed),
m_placement(Plasma::Types::LeftPosedTopAlignedPopup) m_placement(Plasma::Types::LeftPosedTopAlignedPopup)
{ {
@ -110,7 +110,7 @@ void QMenuProxy::setVisualParent(QObject *parent)
QWindow *QMenuProxy::transientParent() QWindow *QMenuProxy::transientParent()
{ {
if (!m_menu) { if (!m_menu) {
return Q_NULLPTR; return nullptr;
} }
return m_menu->windowHandle()->transientParent(); return m_menu->windowHandle()->transientParent();
} }

View File

@ -52,7 +52,7 @@ class Application: public QObject
Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged) Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged)
public: public:
Application(QObject *parent = Q_NULLPTR); Application(QObject *parent = nullptr);
~Application(); ~Application();
QString application() const; QString application() const;

View File

@ -46,7 +46,7 @@ class IconDialog: public QObject
Q_OBJECT Q_OBJECT
public: public:
IconDialog(QObject *parent = Q_NULLPTR); IconDialog(QObject *parent = nullptr);
~IconDialog(); ~IconDialog();
Q_INVOKABLE QString openDialog(); Q_INVOKABLE QString openDialog();

View File

@ -30,7 +30,7 @@ class PlatformComponentsPlugin: public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID "org.kde.plasma.platformcomponents") Q_PLUGIN_METADATA(IID "org.kde.plasma.platformcomponents")
public: public:
PlatformComponentsPlugin(QObject *parent = Q_NULLPTR) PlatformComponentsPlugin(QObject *parent = nullptr)
: QQmlExtensionPlugin(parent) : QQmlExtensionPlugin(parent)
{ {
} }

View File

@ -68,8 +68,8 @@ AppletPrivate::AppletPrivate(const KPluginMetaData &info, int uniqueID, Applet *
actions(AppletPrivate::defaultActions(applet)), actions(AppletPrivate::defaultActions(applet)),
activationAction(0), activationAction(0),
itemStatus(Types::UnknownStatus), itemStatus(Types::UnknownStatus),
modificationsTimer(Q_NULLPTR), modificationsTimer(nullptr),
deleteNotificationTimer(Q_NULLPTR), deleteNotificationTimer(nullptr),
hasConfigurationInterface(false), hasConfigurationInterface(false),
failed(false), failed(false),
transient(false), transient(false),

View File

@ -42,7 +42,7 @@ const char ThemePrivate::themeRcFile[] = "plasmarc";
// these svgs do not follow the theme's colors, but rather the system colors // these svgs do not follow the theme's colors, but rather the system colors
const char ThemePrivate::systemColorsTheme[] = "internal-system-colors"; const char ThemePrivate::systemColorsTheme[] = "internal-system-colors";
#if HAVE_X11 #if HAVE_X11
EffectWatcher *ThemePrivate::s_backgroundContrastEffectWatcher = Q_NULLPTR; EffectWatcher *ThemePrivate::s_backgroundContrastEffectWatcher = nullptr;
#endif #endif
ThemePrivate *ThemePrivate::globalTheme = 0; ThemePrivate *ThemePrivate::globalTheme = 0;

View File

@ -549,7 +549,7 @@ void DialogPrivate::updateInputShape()
if (extension->present) { if (extension->present) {
// query version // query version
auto cookie = xcb_shape_query_version(c); auto cookie = xcb_shape_query_version(c);
QScopedPointer<xcb_shape_query_version_reply_t, QScopedPointerPodDeleter> version(xcb_shape_query_version_reply(c, cookie, Q_NULLPTR)); QScopedPointer<xcb_shape_query_version_reply_t, QScopedPointerPodDeleter> version(xcb_shape_query_version_reply(c, cookie, nullptr));
if (!version.isNull()) { if (!version.isNull()) {
s_shapeAvailable = (version->major_version * 0x10 + version->minor_version) >= 0x11; s_shapeAvailable = (version->major_version * 0x10 + version->minor_version) >= 0x11;
} }

View File

@ -238,7 +238,7 @@ void ContainmentInterface::setAppletArgs(Plasma::Applet *applet, const QString &
QObject *ContainmentInterface::containmentAt(int x, int y) QObject *ContainmentInterface::containmentAt(int x, int y)
{ {
QObject *desktop = Q_NULLPTR; QObject *desktop = nullptr;
foreach (Plasma::Containment *c, m_containment->corona()->containments()) { foreach (Plasma::Containment *c, m_containment->corona()->containments()) {
ContainmentInterface *contInterface = c->property("_plasma_graphicObject").value<ContainmentInterface *>(); ContainmentInterface *contInterface = c->property("_plasma_graphicObject").value<ContainmentInterface *>();