Commit 6c2e2a02 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use nullptr

parent b806d14c
......@@ -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;
}
};
......
......@@ -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;
......
......@@ -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)
......
......@@ -329,7 +329,7 @@ QPlatformDialogHelper *KdePlatformTheme::createPlatformDialogHelper(QPlatformThe
case QPlatformTheme::ColorDialog:
case QPlatformTheme::MessageDialog:
default:
return 0;
return nullptr;
}
}
......
......@@ -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();
}
......
......@@ -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());
/**
......
......@@ -37,7 +37,7 @@ public:
/**
* Creates a new file tree view.
*/
KFileTreeView(QWidget *parent = 0);
KFileTreeView(QWidget *parent = nullptr);
/**
* Destroys the file tree view.
......
......@@ -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));
......
......@@ -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) {
......
......@@ -40,7 +40,7 @@ static const QByteArray s_blurBehindPropertyName = QByteArrayLiteral("ENABLE_BLU
KWaylandIntegration::KWaylandIntegration()
: QObject()
, m_decoration(Q_NULLPTR)
, m_decoration(nullptr)
{
}
......
......@@ -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 &paramList) override
......
......@@ -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;
......
......@@ -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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment