Use more nullptr

This commit is contained in:
Friedrich W. H. Kossebau 2018-07-02 00:16:21 +02:00
parent 799b26861d
commit 30cbc2dc33
13 changed files with 25 additions and 25 deletions

View File

@ -29,13 +29,13 @@ Plasma::Applet *SimpleLoader::internalLoadApplet(const QString &name, uint apple
{ {
Q_UNUSED(args) Q_UNUSED(args)
if (name == QLatin1String("simpleapplet")) { if (name == QLatin1String("simpleapplet")) {
return new SimpleApplet(0, QString(), appletId); return new SimpleApplet(nullptr, QString(), appletId);
} else if (name == QLatin1String("simplecontainment")) { } else if (name == QLatin1String("simplecontainment")) {
return new SimpleContainment(0, QString(), appletId); return new SimpleContainment(nullptr, QString(), appletId);
} else if (name == QLatin1String("simplenoscreencontainment")) { } else if (name == QLatin1String("simplenoscreencontainment")) {
return new SimpleNoScreenContainment(0, QString(), appletId); return new SimpleNoScreenContainment(nullptr, QString(), appletId);
} else { } else {
return 0; return nullptr;
} }
} }

View File

@ -55,8 +55,8 @@ void SortFilterModelTest::setEmptyModel()
QStandardItemModel model; QStandardItemModel model;
filterModel.setModel(&model); filterModel.setModel(&model);
QCOMPARE(filterModel.sourceModel(), static_cast<QAbstractItemModel *>(&model)); QCOMPARE(filterModel.sourceModel(), static_cast<QAbstractItemModel *>(&model));
filterModel.setModel(0); filterModel.setModel(nullptr);
QCOMPARE(filterModel.sourceModel(), static_cast<QAbstractItemModel *>(0)); QCOMPARE(filterModel.sourceModel(), static_cast<QAbstractItemModel *>(nullptr));
} }
void SortFilterModelTest::setFilterRegExp() void SortFilterModelTest::setFilterRegExp()

View File

@ -570,7 +570,7 @@ void WindowThumbnail::bindGLXTexture()
{ {
Display *d = QX11Info::display(); Display *d = QX11Info::display();
((glXReleaseTexImageEXT_func)(m_releaseTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT); ((glXReleaseTexImageEXT_func)(m_releaseTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT);
((glXBindTexImageEXT_func)(m_bindTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT, NULL); ((glXBindTexImageEXT_func)(m_bindTexImage))(d, m_glxPixmap, GLX_FRONT_LEFT_EXT, nullptr);
resetDamaged(); resetDamaged();
} }

View File

@ -399,7 +399,7 @@ ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, co
const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap(); const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap();
KPluginFactory *factory = loader.factory(); KPluginFactory *factory = loader.factory();
if (factory) { if (factory) {
actions = factory->create<Plasma::ContainmentActions>(0, argsWithMetaData); actions = factory->create<Plasma::ContainmentActions>(nullptr, argsWithMetaData);
} }
} }
if (actions) { if (actions) {

View File

@ -29,8 +29,8 @@ public:
ContainmentActionsPrivate(KService::Ptr service, ContainmentActions *containmentActions) : ContainmentActionsPrivate(KService::Ptr service, ContainmentActions *containmentActions) :
q(containmentActions), q(containmentActions),
containmentActionsDescription(service), containmentActionsDescription(service),
package(0), package(nullptr),
containment(0) containment(nullptr)
{ {
} }

View File

@ -37,7 +37,7 @@ public:
DataContainer *source(const QString &sourceName, bool createWhenMissing = true); DataContainer *source(const QString &sourceName, bool createWhenMissing = true);
void connectSource(DataContainer *s, QObject *visualization, uint pollingInterval, void connectSource(DataContainer *s, QObject *visualization, uint pollingInterval,
Plasma::Types::IntervalAlignment align, bool immediateCall = true); Plasma::Types::IntervalAlignment align, bool immediateCall = true);
DataContainer *requestSource(const QString &sourceName, bool *newSource = 0); DataContainer *requestSource(const QString &sourceName, bool *newSource = nullptr);
void internalUpdateSource(DataContainer *); void internalUpdateSource(DataContainer *);
void setupScriptSupport(); void setupScriptSupport();

View File

@ -52,7 +52,7 @@ public:
stretchBorders(false), stretchBorders(false),
tileCenter(false), tileCenter(false),
composeOverBorder(false), composeOverBorder(false),
theme(0) theme(nullptr)
{ {
ref(svg); ref(svg);
} }
@ -76,7 +76,7 @@ public:
stretchBorders(false), stretchBorders(false),
tileCenter(false), tileCenter(false),
composeOverBorder(false), composeOverBorder(false),
theme(0) theme(nullptr)
{ {
ref(svg); ref(svg);
} }

View File

@ -56,7 +56,7 @@ class PackageStructurePrivate
public: public:
PackageStructurePrivate(PackageStructure *str) PackageStructurePrivate(PackageStructure *str)
: q(str), : q(str),
internalStructure(0) internalStructure(nullptr)
{} {}
~PackageStructurePrivate() ~PackageStructurePrivate()
{} {}

View File

@ -95,7 +95,7 @@ Theme::~Theme()
{ {
if (d == ThemePrivate::globalTheme) { if (d == ThemePrivate::globalTheme) {
if (!ThemePrivate::globalThemeRefCount.deref()) { if (!ThemePrivate::globalThemeRefCount.deref()) {
disconnect(ThemePrivate::globalTheme, 0, this, 0); disconnect(ThemePrivate::globalTheme, nullptr, this, nullptr);
delete ThemePrivate::globalTheme; delete ThemePrivate::globalTheme;
ThemePrivate::globalTheme = nullptr; ThemePrivate::globalTheme = nullptr;
d = nullptr; d = nullptr;
@ -117,7 +117,7 @@ void Theme::setThemeName(const QString &themeName)
} }
if (d != ThemePrivate::globalTheme) { if (d != ThemePrivate::globalTheme) {
disconnect(QCoreApplication::instance(), 0, d, 0); disconnect(QCoreApplication::instance(), nullptr, d, nullptr);
if (!ThemePrivate::themesRefCount[d->themeName].deref()) { if (!ThemePrivate::themesRefCount[d->themeName].deref()) {
ThemePrivate *themePrivate = ThemePrivate::themes[d->themeName]; ThemePrivate *themePrivate = ThemePrivate::themes[d->themeName];
ThemePrivate::themes.remove(d->themeName); ThemePrivate::themes.remove(d->themeName);

View File

@ -179,7 +179,7 @@ void AppletQuickItemPrivate::connectLayoutAttached(QObject *item)
} }
if (representationLayout) { if (representationLayout) {
QObject::disconnect(representationLayout, 0, q, 0); QObject::disconnect(representationLayout, nullptr, q, nullptr);
} }
//Here we can't use the new connect syntax because we can't link against QtQuick layouts //Here we can't use the new connect syntax because we can't link against QtQuick layouts

View File

@ -48,8 +48,8 @@ public:
Private(DialogShadows *shadows) Private(DialogShadows *shadows)
: q(shadows) : q(shadows)
#if HAVE_X11 #if HAVE_X11
,_connection(0x0), , _connection(nullptr)
_gc(0x0) , _gc(0x0)
, m_isX11(KWindowSystem::isPlatformX11()) , m_isX11(KWindowSystem::isPlatformX11())
#endif #endif
{ {
@ -207,7 +207,7 @@ Qt::HANDLE DialogShadows::Private::createPixmap(const QPixmap &source)
// do nothing for invalid pixmaps // do nothing for invalid pixmaps
if (source.isNull()) { if (source.isNull()) {
return 0; return nullptr;
} }
/* /*
@ -218,7 +218,7 @@ Qt::HANDLE DialogShadows::Private::createPixmap(const QPixmap &source)
#if HAVE_X11 #if HAVE_X11
if (!m_isX11) { if (!m_isX11) {
return 0; return nullptr;
} }
// check connection // check connection
@ -235,7 +235,7 @@ Qt::HANDLE DialogShadows::Private::createPixmap(const QPixmap &source)
// check gc // check gc
if (!_gc) { if (!_gc) {
_gc = xcb_generate_id(_connection); _gc = xcb_generate_id(_connection);
xcb_create_gc(_connection, _gc, pixmap, 0, 0x0); xcb_create_gc(_connection, _gc, pixmap, 0, nullptr);
} }
// // create explicitly shared QPixmap from it // // create explicitly shared QPixmap from it
@ -260,7 +260,7 @@ Qt::HANDLE DialogShadows::Private::createPixmap(const QPixmap &source)
return (Qt::HANDLE)pixmap; return (Qt::HANDLE)pixmap;
#else #else
return 0; return nullptr;
#endif #endif
} }

View File

@ -676,7 +676,7 @@ void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimet
connect(installJob, &KJob::result, this, [this, packagePath, structure, posi](KJob *job) { connect(installJob, &KJob::result, this, [this, packagePath, structure, posi](KJob *job) {
auto fail = [job](const QString &text) { auto fail = [job](const QString &text) {
KNotification::event(QStringLiteral("plasmoidInstallationFailed"), i18n("Package Installation Failed"), KNotification::event(QStringLiteral("plasmoidInstallationFailed"), i18n("Package Installation Failed"),
text, QStringLiteral("dialog-error"), 0, KNotification::CloseOnTimeout, QStringLiteral("plasma_workspace")); text, QStringLiteral("dialog-error"), nullptr, KNotification::CloseOnTimeout, QStringLiteral("plasma_workspace"));
}; };
// if the applet is already installed, just add it to the containment // if the applet is already installed, just add it to the containment

View File

@ -101,7 +101,7 @@ bool PluginTest::loadKPlugin()
//QObject *o = factory->createPlugin("time"); //QObject *o = factory->createPlugin("time");
//qDebug() << " objec name:" << o->objectName(); //qDebug() << " objec name:" << o->objectName();
//Plasma::DataEngine *time_engine = qobject_cast<Plasma::DataEngine*>(factory->create(this, QVariantList())); //Plasma::DataEngine *time_engine = qobject_cast<Plasma::DataEngine*>(factory->create(this, QVariantList()));
Plasma::DataEngine *time_engine = 0; Plasma::DataEngine *time_engine = nullptr;
// Plasma::DataEngine *time_engine = factory->create(this, QVariantList()); // Plasma::DataEngine *time_engine = factory->create(this, QVariantList());
time_engine = factory->create<Plasma::DataEngine>(this, QVariantList()); time_engine = factory->create<Plasma::DataEngine>(this, QVariantList());