[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasma-integration] /: Use nullptr
From: Friedrich W. H. Kossebau <null () kde ! org>
Date: 2018-03-07 22:04:19
Message-ID: E1ethAZ-0005zj-CT () code ! kde ! org
[Download RAW message or body]
Git commit 6c2e2a02964f70dc7c7e18c38807b5112135c058 by Friedrich W. H. Kossebau.
Committed on 07/03/2018 at 21:44.
Pushed by kossebau into branch 'master'.
Use nullptr
M +3 -3 autotests/kfiledialog_unittest.cpp
M +1 -1 autotests/kfiledialogqml_unittest.cpp
M +4 -4 src/platformtheme/kdeplatformsystemtrayicon.cpp
M +1 -1 src/platformtheme/kdeplatformtheme.cpp
M +2 -3 src/platformtheme/kdirselectdialog.cpp
M +2 -2 src/platformtheme/kdirselectdialog_p.h
M +1 -1 src/platformtheme/kfiletreeview_p.h
M +4 -4 src/platformtheme/kfontsettingsdata.cpp
M +1 -1 src/platformtheme/khintssettings.cpp
M +1 -1 src/platformtheme/kwaylandintegration.cpp
M +1 -1 src/platformtheme/main.cpp
M +2 -2 src/platformtheme/x11integration.cpp
M +2 -2 tests/qfiledialogtest.cpp
https://commits.kde.org/plasma-integration/6c2e2a02964f70dc7c7e18c38807b5112135c058
diff --git a/autotests/kfiledialog_unittest.cpp b/autotests/kfiledialog_unittest.cpp
index fe86bef..148e5f4 100644
--- a/autotests/kfiledialog_unittest.cpp
+++ b/autotests/kfiledialog_unittest.cpp
@@ -163,7 +163,7 @@ private Q_SLOTS:
qApp->activeWindow()->close();
});
- QFileDialog::getSaveFileUrl(0, QString(), url);
+ QFileDialog::getSaveFileUrl(nullptr, QString(), url);
QCOMPARE(saveFileOperationMode, KFileWidget::Saving);
}
@@ -377,7 +377,7 @@ private:
}
}
Q_ASSERT(widgets.count() == 1);
- return (widgets.count() == 1) ? widgets.first() : Q_NULLPTR;
+ return (widgets.count() == 1) ? widgets.first() : nullptr;
}
static QDialog *findMessageBox()
@@ -389,7 +389,7 @@ private:
widgets.append(dlg);
}
}
- return (widgets.count() == 1) ? widgets.first() : Q_NULLPTR;
+ return (widgets.count() == 1) ? widgets.first() : nullptr;
}
};
diff --git a/autotests/kfiledialogqml_unittest.cpp \
b/autotests/kfiledialogqml_unittest.cpp index b0e6936..6ceecad 100644
--- a/autotests/kfiledialogqml_unittest.cpp
+++ b/autotests/kfiledialogqml_unittest.cpp
@@ -88,7 +88,7 @@ private:
}
}
Q_ASSERT(widgets.count() == 1);
- return (widgets.count() == 1) ? widgets.first() : Q_NULLPTR;
+ return (widgets.count() == 1) ? widgets.first() : nullptr;
}
QQmlEngine *m_engine = nullptr;
diff --git a/src/platformtheme/kdeplatformsystemtrayicon.cpp \
b/src/platformtheme/kdeplatformsystemtrayicon.cpp index a7f52a3..ea2efe9 100644
--- a/src/platformtheme/kdeplatformsystemtrayicon.cpp
+++ b/src/platformtheme/kdeplatformsystemtrayicon.cpp
@@ -82,7 +82,7 @@ QPlatformMenuItem *SystemTrayMenu::menuItemAt(int position) const
if (position < m_items.size()) {
return m_items.at(position);
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformMenuItem *SystemTrayMenu::menuItemForTag(quintptr tag) const
@@ -93,7 +93,7 @@ QPlatformMenuItem *SystemTrayMenu::menuItemForTag(quintptr tag) \
const if (it != m_items.constEnd()) {
return *it;
}
- return Q_NULLPTR;
+ return nullptr;
}
void SystemTrayMenu::removeMenuItem(QPlatformMenuItem *menuItem)
@@ -274,7 +274,7 @@ QAction *SystemTrayMenuItem::action() const
KDEPlatformSystemTrayIcon::KDEPlatformSystemTrayIcon()
: QPlatformSystemTrayIcon()
- , m_sni(Q_NULLPTR)
+ , m_sni(nullptr)
{
}
@@ -303,7 +303,7 @@ void KDEPlatformSystemTrayIcon::init()
void KDEPlatformSystemTrayIcon::cleanup()
{
delete m_sni;
- m_sni = Q_NULLPTR;
+ m_sni = nullptr;
}
void KDEPlatformSystemTrayIcon::updateIcon(const QIcon &icon)
diff --git a/src/platformtheme/kdeplatformtheme.cpp \
b/src/platformtheme/kdeplatformtheme.cpp index 015be41..2067e79 100644
--- a/src/platformtheme/kdeplatformtheme.cpp
+++ b/src/platformtheme/kdeplatformtheme.cpp
@@ -329,7 +329,7 @@ QPlatformDialogHelper \
*KdePlatformTheme::createPlatformDialogHelper(QPlatformThe case \
QPlatformTheme::ColorDialog: case QPlatformTheme::MessageDialog:
default:
- return 0;
+ return nullptr;
}
}
diff --git a/src/platformtheme/kdirselectdialog.cpp \
b/src/platformtheme/kdirselectdialog.cpp index 9d13ec4..eb46be6 100644
--- a/src/platformtheme/kdirselectdialog.cpp
+++ b/src/platformtheme/kdirselectdialog.cpp
@@ -67,7 +67,7 @@ public:
: m_parent(parent),
m_localOnly(localOnly),
m_comboLocked(false),
- m_urlCombo(0)
+ m_urlCombo(nullptr)
{
}
@@ -268,8 +268,7 @@ void KDirSelectDialog::Private::slotDelete()
void KDirSelectDialog::Private::slotProperties()
{
- KPropertiesDialog *dialog = 0;
- dialog = new KPropertiesDialog(m_treeView->selectedUrl(), this->m_parent);
+ KPropertiesDialog *dialog = new KPropertiesDialog(m_treeView->selectedUrl(), \
this->m_parent); dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
diff --git a/src/platformtheme/kdirselectdialog_p.h \
b/src/platformtheme/kdirselectdialog_p.h index 3dbf381..5907b23 100644
--- a/src/platformtheme/kdirselectdialog_p.h
+++ b/src/platformtheme/kdirselectdialog_p.h
@@ -45,7 +45,7 @@ public:
*/
explicit KDirSelectDialog(const QUrl &startDir = QUrl(),
bool localOnly = false,
- QWidget *parent = 0L);
+ QWidget *parent = nullptr);
/**
* Destroys the directory selection dialog.
@@ -89,7 +89,7 @@ public:
* or QFileDialog::getExistingDirectoryUrl (if localOnly was false) instead.
*/
static QUrl selectDirectory(const QUrl &startDir = QUrl(),
- bool localOnly = false, QWidget *parent = 0L,
+ bool localOnly = false, QWidget *parent = nullptr,
const QString &caption = QString());
/**
diff --git a/src/platformtheme/kfiletreeview_p.h \
b/src/platformtheme/kfiletreeview_p.h index fc0dca4..8aee29c 100644
--- a/src/platformtheme/kfiletreeview_p.h
+++ b/src/platformtheme/kfiletreeview_p.h
@@ -37,7 +37,7 @@ public:
/**
* Creates a new file tree view.
*/
- KFileTreeView(QWidget *parent = 0);
+ KFileTreeView(QWidget *parent = nullptr);
/**
* Destroys the file tree view.
diff --git a/src/platformtheme/kfontsettingsdata.cpp \
b/src/platformtheme/kfontsettingsdata.cpp index 989610b..193781f 100644
--- a/src/platformtheme/kfontsettingsdata.cpp
+++ b/src/platformtheme/kfontsettingsdata.cpp
@@ -31,13 +31,13 @@
#include <kconfiggroup.h>
KFontSettingsData::KFontSettingsData()
- : QObject(0),
+ : QObject(nullptr),
mKdeGlobals(KSharedConfig::openConfig())
{
QMetaObject::invokeMethod(this, "delayedDBusConnects", Qt::QueuedConnection);
for (int i = 0; i < FontTypesCount; ++i) {
- mFonts[i] = 0;
+ mFonts[i] = nullptr;
}
}
@@ -92,10 +92,10 @@ void KFontSettingsData::dropFontSettingsCache()
mKdeGlobals->reparseConfiguration();
for (int i = 0; i < FontTypesCount; ++i) {
delete mFonts[i];
- mFonts[i] = 0;
+ mFonts[i] = nullptr;
}
- QWindowSystemInterface::handleThemeChange(0);
+ QWindowSystemInterface::handleThemeChange(nullptr);
if (qobject_cast<QApplication *>(QCoreApplication::instance())) {
QApplication::setFont(*font(KFontSettingsData::GeneralFont));
diff --git a/src/platformtheme/khintssettings.cpp \
b/src/platformtheme/khintssettings.cpp index 34b3904..bb4b412 100644
--- a/src/platformtheme/khintssettings.cpp
+++ b/src/platformtheme/khintssettings.cpp
@@ -57,7 +57,7 @@
static const QString defaultLookAndFeelPackage = \
QStringLiteral("org.kde.breeze.desktop");
KHintsSettings::KHintsSettings(KSharedConfig::Ptr kdeglobals)
- : QObject(0)
+ : QObject(nullptr)
, mKdeGlobals(kdeglobals)
{
if (!mKdeGlobals) {
diff --git a/src/platformtheme/kwaylandintegration.cpp \
b/src/platformtheme/kwaylandintegration.cpp index d6894b6..83afec1 100644
--- a/src/platformtheme/kwaylandintegration.cpp
+++ b/src/platformtheme/kwaylandintegration.cpp
@@ -40,7 +40,7 @@ static const QByteArray s_blurBehindPropertyName = \
QByteArrayLiteral("ENABLE_BLU
KWaylandIntegration::KWaylandIntegration()
: QObject()
- , m_decoration(Q_NULLPTR)
+ , m_decoration(nullptr)
{
}
diff --git a/src/platformtheme/main.cpp b/src/platformtheme/main.cpp
index 28a9d50..0d739d9 100644
--- a/src/platformtheme/main.cpp
+++ b/src/platformtheme/main.cpp
@@ -27,7 +27,7 @@ class KdePlatformThemePlugin : public QPlatformThemePlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1" \
FILE "kdeplatformtheme.json") public:
- KdePlatformThemePlugin(QObject *parent = 0)
+ KdePlatformThemePlugin(QObject *parent = nullptr)
: QPlatformThemePlugin(parent) {}
QPlatformTheme *create(const QString &key, const QStringList ¶mList) \
override
diff --git a/src/platformtheme/x11integration.cpp \
b/src/platformtheme/x11integration.cpp index ec6d57a..f5ada8f 100644
--- a/src/platformtheme/x11integration.cpp
+++ b/src/platformtheme/x11integration.cpp
@@ -91,7 +91,7 @@ void X11Integration::installColorScheme(QWindow *w)
if (atom == XCB_ATOM_NONE) {
const QByteArray name = QByteArrayLiteral("_KDE_NET_WM_COLOR_SCHEME");
const xcb_intern_atom_cookie_t cookie = xcb_intern_atom(c, false, \
name.length(), name.constData());
- QScopedPointer<xcb_intern_atom_reply_t, QScopedPointerPodDeleter> \
reply(xcb_intern_atom_reply(c, cookie, Q_NULLPTR)); + \
QScopedPointer<xcb_intern_atom_reply_t, QScopedPointerPodDeleter> \
reply(xcb_intern_atom_reply(c, cookie, nullptr)); if (!reply.isNull()) {
atom = reply->atom;
} else {
@@ -129,7 +129,7 @@ void X11Integration::setWindowProperty(QWindow *window, const \
QByteArray &name, auto it = m_atoms.find(name);
if (it == m_atoms.end()) {
const xcb_intern_atom_cookie_t cookie = xcb_intern_atom(c, false, \
name.length(), name.constData());
- QScopedPointer<xcb_intern_atom_reply_t, QScopedPointerPodDeleter> \
reply(xcb_intern_atom_reply(c, cookie, Q_NULLPTR)); + \
QScopedPointer<xcb_intern_atom_reply_t, QScopedPointerPodDeleter> \
reply(xcb_intern_atom_reply(c, cookie, nullptr)); if (!reply.isNull()) {
atom = reply->atom;
m_atoms[name] = atom;
diff --git a/tests/qfiledialogtest.cpp b/tests/qfiledialogtest.cpp
index ac1478d..083af84 100644
--- a/tests/qfiledialogtest.cpp
+++ b/tests/qfiledialogtest.cpp
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
qDebug() << dir;
return 0;
} else if (staticFunction == QLatin1String("getOpenFileUrl")) {
- qDebug() << QFileDialog::getOpenFileUrl(Q_NULLPTR, \
QStringLiteral("getOpenFileUrl test"), QUrl::fromLocalFile(QDir::homePath())); + \
qDebug() << QFileDialog::getOpenFileUrl(nullptr, QStringLiteral("getOpenFileUrl \
test"), QUrl::fromLocalFile(QDir::homePath())); return 0;
}
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
if (parser.isSet(QLatin1String("options"))) {
auto optStrings = parser.values(QLatin1String("options"));
- QFileDialog::Options options = 0;
+ QFileDialog::Options options = {};
const auto mo = QFileDialog::staticMetaObject;
const auto enumerator = mo.indexOfEnumerator("Options");
for(const auto &optString: optStrings) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic