Commit 2608ccce authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use nullptr

parent 6ad07459
......@@ -143,7 +143,7 @@ void AppMenuModel::onActiveWindowChanged(WId id)
QByteArray value;
if (!s_atoms.contains(name)) {
const xcb_intern_atom_cookie_t atomCookie = xcb_intern_atom(c, false, name.length(), name.constData());
QScopedPointer<xcb_intern_atom_reply_t, QScopedPointerPodDeleter> atomReply(xcb_intern_atom_reply(c, atomCookie, Q_NULLPTR));
QScopedPointer<xcb_intern_atom_reply_t, QScopedPointerPodDeleter> atomReply(xcb_intern_atom_reply(c, atomCookie, nullptr));
if (atomReply.isNull()) {
return value;
}
......@@ -156,7 +156,7 @@ void AppMenuModel::onActiveWindowChanged(WId id)
static const long MAX_PROP_SIZE = 10000;
auto propertyCookie = xcb_get_property(c, false, id, s_atoms[name], XCB_ATOM_STRING, 0, MAX_PROP_SIZE);
QScopedPointer<xcb_get_property_reply_t, QScopedPointerPodDeleter> propertyReply(xcb_get_property_reply(c, propertyCookie, NULL));
QScopedPointer<xcb_get_property_reply_t, QScopedPointerPodDeleter> propertyReply(xcb_get_property_reply(c, propertyCookie, nullptr));
if (propertyReply.isNull()) {
return value;
}
......@@ -196,7 +196,7 @@ void AppMenuModel::onActiveWindowChanged(WId id)
if (updateMenuFromWindowIfHasMenu(transientId)) {
return;
}
transientId = KWindowInfo(transientId, 0, NET::WM2TransientFor).transientFor();
transientId = KWindowInfo(transientId, nullptr, NET::WM2TransientFor).transientFor();
}
if (updateMenuFromWindowIfHasMenu(id)) {
......
......@@ -55,7 +55,7 @@ StatusNotifierTest::StatusNotifierTest(QWidget* parent) :
QDialog(parent)
{
d = new StatusNotifierTestPrivate;
d->job = 0;
d->job = nullptr;
init();
......@@ -137,7 +137,7 @@ void StatusNotifierTest::updateNotifier()
//log("update");
if (!enabledCheck->isChecked()) {
delete d->systemNotifier;
d->systemNotifier = 0;
d->systemNotifier = nullptr;
return;
} else {
if (!d->systemNotifier) {
......
......@@ -34,7 +34,7 @@ class StatusNotifierTest : public QDialog, public Ui_StatusNotifierTest
Q_OBJECT
public:
StatusNotifierTest(QWidget* parent = 0);
StatusNotifierTest(QWidget* parent = nullptr);
~StatusNotifierTest() override;
void init();
......
......@@ -116,7 +116,7 @@ void AppMenuModule::slotWindowRegistered(WId id, const QString &serviceName, con
auto setWindowProperty = [c](WId id, xcb_atom_t &atom, const QByteArray &name, const QByteArray &value) {
if (atom == XCB_ATOM_NONE) {
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()) {
return;
}
......@@ -159,7 +159,7 @@ void AppMenuModule::slotShowMenu(int x, int y, const QString &serviceName, const
auto *importer = new KDBusMenuImporter(serviceName, menuObjectPath.path(), this);
QMetaObject::invokeMethod(importer, "updateMenu", Qt::QueuedConnection);
disconnect(importer, 0, this, 0); // ensure we don't popup multiple times in case the menu updates again later
disconnect(importer, nullptr, this, nullptr); // ensure we don't popup multiple times in case the menu updates again later
connect(importer, &KDBusMenuImporter::menuUpdated, this, [=](QMenu *m) {
QMenu *menu = importer->menu();
......
......@@ -48,9 +48,9 @@ QMenu *VerticalMenu::leafMenu()
leaf = act->menu();
continue;
}
return leaf == this ? 0 : leaf;
return leaf == this ? nullptr : leaf;
}
return 0; // make gcc happy
return nullptr; // make gcc happy
}
void VerticalMenu::paintEvent(QPaintEvent *pe)
......
......@@ -33,7 +33,7 @@ class VerticalMenu : public QMenu
{
Q_OBJECT
public:
VerticalMenu(QWidget * parent = 0);
VerticalMenu(QWidget * parent = nullptr);
~VerticalMenu() override;
QString serviceName() const { return m_serviceName; }
......
......@@ -27,7 +27,7 @@
KeyboardLayout::KeyboardLayout(QObject* parent)
: QObject(parent)
, mIface(0)
, mIface(nullptr)
{
mIface = new QDBusInterface(QStringLiteral("org.kde.keyboard"),
QStringLiteral("/Layouts"),
......@@ -36,7 +36,7 @@ KeyboardLayout::KeyboardLayout(QObject* parent)
this);
if (!mIface->isValid()) {
delete mIface;
mIface = 0;
mIface = nullptr;
return;
}
......
......@@ -62,9 +62,9 @@ static const QString s_kwinService = QStringLiteral("org.kde.KWin");
InteractiveConsole::InteractiveConsole(QWidget *parent)
: QDialog(parent),
m_splitter(new QSplitter(Qt::Vertical, this)),
m_editorPart(0),
m_editor(0),
m_output(0),
m_editorPart(nullptr),
m_editor(nullptr),
m_output(nullptr),
m_loadAction(KStandardAction::open(this, SLOT(openScriptFile()), this)),
m_saveAction(KStandardAction::saveAs(this, SLOT(saveScript()), this)),
m_clearAction(KStandardAction::clear(this, SLOT(clearEditor()), this)),
......@@ -72,7 +72,7 @@ InteractiveConsole::InteractiveConsole(QWidget *parent)
m_plasmaAction(new QAction(QIcon::fromTheme(QStringLiteral("plasma")), i18nc("Toolbar Button to switch to Plasma Scripting Mode", "Plasma"), this)),
m_kwinAction(new QAction(QIcon::fromTheme(QStringLiteral("kwin")), i18nc("Toolbar Button to switch to KWin Scripting Mode", "KWin"), this)),
m_snippetsMenu(new QMenu(i18n("Templates"), this)),
m_fileDialog(0),
m_fileDialog(nullptr),
m_closeWhenCompleted(false),
m_mode(PlasmaConsole)
{
......@@ -237,7 +237,7 @@ void InteractiveConsole::setScriptInterface(QObject *obj)
{
if (m_scriptEngine != obj) {
if (m_scriptEngine) {
disconnect(m_scriptEngine, 0, this, 0);
disconnect(m_scriptEngine, nullptr, this, nullptr);
}
m_scriptEngine = obj;
......@@ -476,7 +476,7 @@ void InteractiveConsole::saveScriptUrlSelected(int result)
}
m_fileDialog->deleteLater();
m_fileDialog = 0;
m_fileDialog = nullptr;
}
void InteractiveConsole::saveScript(const QUrl &url)
......
......@@ -53,7 +53,7 @@ class InteractiveConsole : public QDialog
Q_OBJECT
public:
InteractiveConsole(QWidget *parent = 0);
InteractiveConsole(QWidget *parent = nullptr);
~InteractiveConsole() override;
enum ConsoleMode {
......@@ -132,8 +132,8 @@ class InteractiveConsoleItem : public QObject
public:
InteractiveConsoleItem()
: QObject(0),
m_dialog(new InteractiveConsole(0))
: QObject(nullptr),
m_dialog(new InteractiveConsole(nullptr))
{
connect(m_dialog, &InteractiveConsole::scriptEngineChanged,
this, &InteractiveConsoleItem::scriptEngineChanged);
......
......@@ -39,8 +39,8 @@ namespace Plasma
OpenWidgetAssistant::OpenWidgetAssistant(QWidget *parent)
: KAssistantDialog(parent),
m_fileWidget(0),
m_filePageWidget(0)
m_fileWidget(nullptr),
m_filePageWidget(nullptr)
{
m_filePageWidget = new QWidget(this);
......
......@@ -355,13 +355,13 @@ QMimeData *PlasmaAppletItemModel::mimeData(const QModelIndexList &indexes) const
{
//qDebug() << "GETTING MIME DATA\n";
if (indexes.count() <= 0) {
return 0;
return nullptr;
}
QStringList types = mimeTypes();
if (types.isEmpty()) {
return 0;
return nullptr;
}
QMimeData *data = new QMimeData();
......
......@@ -83,7 +83,7 @@ public:
ScreenshotRole = Qt::UserRole+12
};
explicit PlasmaAppletItemModel(QObject * parent = 0);
explicit PlasmaAppletItemModel(QObject * parent = nullptr);
QStringList mimeTypes() const override;
QSet<QString> categories() const;
......
......@@ -68,7 +68,7 @@ class WidgetExplorerPrivate
public:
WidgetExplorerPrivate(WidgetExplorer *w)
: q(w),
containment(0),
containment(nullptr),
itemModel(w),
filterModel(w),
activitiesConsumer(new KActivities::Consumer())
......@@ -293,7 +293,7 @@ void WidgetExplorerPrivate::addContainment(Containment *containment)
void WidgetExplorerPrivate::containmentDestroyed()
{
containment = 0;
containment = nullptr;
}
void WidgetExplorerPrivate::appletAdded(Plasma::Applet *applet)
......@@ -410,7 +410,7 @@ Plasma::Corona *WidgetExplorer::corona() const
return d->containment->corona();
}
return 0;
return nullptr;
}
void WidgetExplorer::addApplet(const QString &pluginName)
......@@ -457,7 +457,7 @@ void WidgetExplorer::openWidgetFile()
Plasma::OpenWidgetAssistant *assistant = d->openAssistant.data();
if (!assistant) {
assistant = new Plasma::OpenWidgetAssistant(0);
assistant = new Plasma::OpenWidgetAssistant(nullptr);
d->openAssistant = assistant;
}
......
......@@ -42,7 +42,7 @@ QList<QAction*> AppLauncher::contextualActions()
{
qDeleteAll(m_actions);
m_actions.clear();
makeMenu(0, m_group);
makeMenu(nullptr, m_group);
return m_actions;
}
......@@ -61,7 +61,7 @@ void AppLauncher::makeMenu(QMenu *menu, const KServiceGroup::Ptr group)
QAction *action = new QAction(QIcon::fromTheme(service->icon()), text, this);
connect(action, &QAction::triggered, [action](){
KService::Ptr service = KService::serviceByStorageId(action->data().toString());
new KRun(QUrl("file://"+service->entryPath()), 0);
new KRun(QUrl("file://"+service->entryPath()), nullptr);
});
action->setData(service->storageId());
if (menu) {
......
......@@ -46,13 +46,13 @@
ContextMenu::ContextMenu(QObject *parent, const QVariantList &args)
: Plasma::ContainmentActions(parent, args),
m_runCommandAction(0),
m_lockScreenAction(0),
m_logoutAction(0),
m_separator1(0),
m_separator2(0),
m_separator3(0),
m_buttons(0)
m_runCommandAction(nullptr),
m_lockScreenAction(nullptr),
m_logoutAction(nullptr),
m_separator1(nullptr),
m_separator2(nullptr),
m_separator3(nullptr),
m_buttons(nullptr)
{
}
......@@ -189,7 +189,7 @@ QAction *ContextMenu::action(const QString &name)
//FIXME: remove action: make removal of current activity possible
return c->actions()->action(name);
}
return 0;
return nullptr;
}
void ContextMenu::runCommand()
......@@ -256,7 +256,7 @@ QWidget* ContextMenu::createConfigurationInterface(QWidget* parent)
m_buttons->setExclusive(false);
foreach (const QString &name, m_actionOrder) {
QCheckBox *item = 0;
QCheckBox *item = nullptr;
if (name == QLatin1String("_context")) {
item = new QCheckBox(widget);
......
......@@ -35,7 +35,7 @@ SwitchWindow::SwitchWindow(QObject *parent, const QVariantList &args)
m_activityInfo(new TaskManager::ActivityInfo(this)),
m_tasksModel(new TaskManager::TasksModel(this)),
m_mode(AllFlat),
m_clearOrderTimer(0)
m_clearOrderTimer(nullptr)
{
m_tasksModel->setGroupMode(TaskManager::TasksModel::GroupDisabled);
......
......@@ -31,7 +31,7 @@ class JobAction : public Plasma::ServiceJob
JobAction(JobView *jobView,
const QString& operation,
QMap<QString,QVariant>& parameters,
QObject* parent = 0)
QObject* parent = nullptr)
: ServiceJob(jobView->objectName(), operation, parameters, parent),
m_jobView(jobView)
{
......
......@@ -35,7 +35,7 @@ void AppJob::start()
const QString operation = operationName();
if (operation == QLatin1String("launch")) {
QString path = m_source->getApp()->entryPath();
new KRun(QUrl(path), 0);
new KRun(QUrl(path), nullptr);
setResult(true);
return;
}
......
......@@ -68,7 +68,7 @@ void KSolidNotify::onDeviceRemoved(const QString &udi)
if (m_devices[udi].is<Solid::StorageVolume>()) {
Solid::StorageAccess *access = m_devices[udi].as<Solid::StorageAccess>();
if (access) {
disconnect(access, 0, this, 0);
disconnect(access, nullptr, this, nullptr);
}
}
m_devices.remove(udi);
......
......@@ -29,7 +29,7 @@
DictEngine::DictEngine(QObject* parent, const QVariantList& args)
: Plasma::DataEngine(parent, args)
, m_tcpSocket(0)
, m_tcpSocket(nullptr)
{
Q_UNUSED(args)
m_serverName = QLatin1String("dict.org"); //In case we need to switch it later
......@@ -190,7 +190,7 @@ void DictEngine::socketClosed()
if (m_tcpSocket) {
m_tcpSocket->deleteLater();
}
m_tcpSocket = 0;
m_tcpSocket = nullptr;
}
bool DictEngine::sourceRequestEvent(const QString &query)
......@@ -200,7 +200,7 @@ bool DictEngine::sourceRequestEvent(const QString &query)
if (m_tcpSocket) {
m_tcpSocket->abort(); //stop if lookup is in progress and new query is requested
m_tcpSocket->deleteLater();
m_tcpSocket = 0;
m_tcpSocket = nullptr;
}
QStringList queryParts = query.split(':', QString::SkipEmptyParts);
......
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