Use nullptr

parent 55c17c05
......@@ -46,7 +46,7 @@
KAMD_DBUS_OBJECT_PATH(OBJECT_PATH), \
KAMD_DBUS_OBJECT(OBJECT), \
QDBusConnection::sessionBus(), \
Q_NULLPTR)
nullptr)
#define KAMD_DBUS_CLASS_INTERFACE(OBJECT_PATH, OBJECT, PARENT) \
org::kde::ActivityManager::OBJECT( \
......
......@@ -58,7 +58,7 @@ public:
/**
* Creates new Activities object
*/
explicit Activities(QObject *parent = Q_NULLPTR);
explicit Activities(QObject *parent = nullptr);
/**
* Destroys this interface
......
......@@ -74,7 +74,7 @@ T *runInQThread()
class Thread : public QThread {
public:
Thread(T *ptr = Q_NULLPTR)
Thread(T *ptr = nullptr)
: QThread()
, object(ptr)
{
......@@ -131,7 +131,7 @@ public:
static Application *s_instance;
};
Application *Application::Private::s_instance = Q_NULLPTR;
Application *Application::Private::s_instance = nullptr;
Application::Application(int &argc, char **argv)
: QApplication(argc, argv)
......@@ -252,7 +252,7 @@ Application::~Application()
delete plugin;
}
Private::s_instance = Q_NULLPTR;
Private::s_instance = nullptr;
}
int Application::newInstance()
......@@ -326,7 +326,7 @@ int main(int argc, char **argv)
application.setApplicationName(QStringLiteral("ActivityManager"));
application.setOrganizationDomain(QStringLiteral("kde.org"));
// KAboutData about("kactivitymanagerd", Q_NULLPTR, ki18n("KDE Activity Manager"), "3.0",
// KAboutData about("kactivitymanagerd", nullptr, ki18n("KDE Activity Manager"), "3.0",
// ki18n("KDE Activity Management Service"),
// KAboutData::License_GPL,
// ki18n("(c) 2010, 2011, 2012 Ivan Cukic"), KLocalizedString(),
......
......@@ -27,7 +27,7 @@ class Config : public Module {
Q_OBJECT
public:
explicit Config(QObject *parent = Q_NULLPTR);
explicit Config(QObject *parent = nullptr);
virtual ~Config();
Q_SIGNALS:
......
......@@ -42,7 +42,7 @@ class Features : public Module {
Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.Features")
public:
explicit Features(QObject *parent = Q_NULLPTR);
explicit Features(QObject *parent = nullptr);
virtual ~Features();
public Q_SLOTS:
......
......@@ -63,7 +63,7 @@ QObject *Module::get(const QString &name)
}
qCWarning(KAMD_LOG_APPLICATION) << "The requested module doesn't exist:" << name;
return Q_NULLPTR;
return nullptr;
}
QHash<QString, QObject *> &Module::get()
......
......@@ -40,7 +40,7 @@ class KACTIVITYMANAGERD_PLUGIN_EXPORT Module : public QObject {
Q_OBJECT
public:
explicit Module(const QString &name, QObject *parent = Q_NULLPTR);
explicit Module(const QString &name, QObject *parent = nullptr);
virtual ~Module();
static QObject *get(const QString &name);
......
......@@ -34,7 +34,7 @@
class Plugin::Private {
public:
Private()
: config(Q_NULLPTR)
: config(nullptr)
{
}
......
......@@ -41,7 +41,7 @@ class Resources : public Module {
Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.Resources")
public:
explicit Resources(QObject *parent = Q_NULLPTR);
explicit Resources(QObject *parent = nullptr);
virtual ~Resources();
public Q_SLOTS:
......
......@@ -43,7 +43,7 @@
KSMServer::Private::Private(KSMServer *parent)
: serviceWatcher(new QDBusServiceWatcher(this))
, kwin(Q_NULLPTR)
, kwin(nullptr)
, processing(false)
, q(parent)
{
......@@ -66,7 +66,7 @@ void KSMServer::Private::serviceOwnerChanged(const QString &service,
if (service == KWIN_SERVICE) {
// Delete the old object, just in case
delete kwin;
kwin = Q_NULLPTR;
kwin = nullptr;
if (KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(KWIN_SERVICE)) {
// Creating the new dbus interface
......@@ -84,7 +84,7 @@ void KSMServer::Private::serviceOwnerChanged(const QString &service,
} else {
delete kwin;
kwin = Q_NULLPTR;
kwin = nullptr;
}
}
}
......
......@@ -40,7 +40,7 @@ public:
FailedToStop = 2
};
explicit KSMServer(QObject *parent = Q_NULLPTR);
explicit KSMServer(QObject *parent = nullptr);
virtual ~KSMServer();
public Q_SLOTS:
......
......@@ -28,7 +28,7 @@ class TemplatesPlugin : public Plugin {
Q_CLASSINFO("D-Bus Interface", "org.kde.ActivityManager.Templates")
public:
explicit TemplatesPlugin(QObject *parent = Q_NULLPTR,
explicit TemplatesPlugin(QObject *parent = nullptr,
const QVariantList &args = QVariantList());
~TemplatesPlugin() Q_DECL_OVERRIDE;
......
......@@ -30,7 +30,7 @@ KAMD_EXPORT_PLUGIN(eventspyplugin, EventSpyPlugin, "kactivitymanagerd-plugin-eve
EventSpyPlugin::EventSpyPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
, m_resources(Q_NULLPTR)
, m_resources(nullptr)
, m_dirWatcher(new KDirWatch())
, m_lastUpdate(QDateTime::currentDateTime())
{
......
......@@ -29,7 +29,7 @@ class EventSpyPlugin : public Plugin {
Q_OBJECT
public:
explicit EventSpyPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
explicit EventSpyPlugin(QObject *parent = nullptr, const QVariantList &args = QVariantList());
~EventSpyPlugin() Q_DECL_OVERRIDE;
bool init(QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
......
......@@ -34,7 +34,7 @@ const auto objectNamePatternLength = objectNamePattern.length() - 2;
GlobalShortcutsPlugin::GlobalShortcutsPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
, m_activitiesService(Q_NULLPTR)
, m_activitiesService(nullptr)
, m_signalMapper(new QSignalMapper(this))
, m_actionCollection(new KActionCollection(this))
{
......
......@@ -30,7 +30,7 @@ class GlobalShortcutsPlugin : public Plugin {
// Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.globalshortcutsplugin")
public:
explicit GlobalShortcutsPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
explicit GlobalShortcutsPlugin(QObject *parent = nullptr, const QVariantList &args = QVariantList());
~GlobalShortcutsPlugin() Q_DECL_OVERRIDE;
bool init(QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
......
......@@ -39,7 +39,7 @@ KAMD_EXPORT_PLUGIN(runapplicationplugin, RunApplicationPlugin, "kactivitymanager
RunApplicationPlugin::RunApplicationPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
, m_activitiesService(Q_NULLPTR)
, m_activitiesService(nullptr)
{
Q_UNUSED(args);
......
......@@ -25,7 +25,7 @@ class RunApplicationPlugin : public Plugin {
// Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.virtualdesktopswitch")
public:
explicit RunApplicationPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
explicit RunApplicationPlugin(QObject *parent = nullptr, const QVariantList &args = QVariantList());
~RunApplicationPlugin() Q_DECL_OVERRIDE;
bool init(QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
......
......@@ -26,7 +26,7 @@ class SlcPlugin : public Plugin {
// Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.slc")
public:
explicit SlcPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
explicit SlcPlugin(QObject *parent = nullptr, const QVariantList &args = QVariantList());
~SlcPlugin() Q_DECL_OVERRIDE;
bool init(QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
......
......@@ -46,12 +46,12 @@
KAMD_EXPORT_PLUGIN(sqliteplugin, StatsPlugin, "kactivitymanagerd-plugin-sqlite.json")
StatsPlugin *StatsPlugin::s_instance = Q_NULLPTR;
StatsPlugin *StatsPlugin::s_instance = nullptr;
StatsPlugin::StatsPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
, m_activities(Q_NULLPTR)
, m_resources(Q_NULLPTR)
, m_activities(nullptr)
, m_resources(nullptr)
, m_resourceLinking(new ResourceLinking(this))
{
Q_UNUSED(args);
......
......@@ -45,7 +45,7 @@ class StatsPlugin : public Plugin {
// Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.sqlite")
public:
explicit StatsPlugin(QObject *parent = Q_NULLPTR,
explicit StatsPlugin(QObject *parent = nullptr,
const QVariantList &args = QVariantList());
static StatsPlugin *self();
......
......@@ -27,7 +27,7 @@ const auto configPattern = QStringLiteral("desktop-for-%1");
VirtualDesktopSwitchPlugin::VirtualDesktopSwitchPlugin(QObject *parent, const QVariantList &args)
: Plugin(parent)
, m_activitiesService(Q_NULLPTR)
, m_activitiesService(nullptr)
{
Q_UNUSED(args);
......
......@@ -25,7 +25,7 @@ class VirtualDesktopSwitchPlugin : public Plugin {
// Q_PLUGIN_METADATA(IID "org.kde.ActivityManager.plugins.virtualdesktopswitch")
public:
explicit VirtualDesktopSwitchPlugin(QObject *parent = Q_NULLPTR, const QVariantList &args = QVariantList());
explicit VirtualDesktopSwitchPlugin(QObject *parent = nullptr, const QVariantList &args = QVariantList());
~VirtualDesktopSwitchPlugin() Q_DECL_OVERRIDE;
bool init(QHash<QString, QObject *> &modules) Q_DECL_OVERRIDE;
......
......@@ -39,7 +39,7 @@ class DBusCallFutureInterface : public QObject,
public:
DBusCallFutureInterface(QDBusPendingReply<_Result> reply)
: reply(reply),
replyWatcher(Q_NULLPTR)
replyWatcher(nullptr)
{
}
......
......@@ -75,7 +75,7 @@ template <typename Container, typename Function>
Function for_each_assoc(const Container &c, Function f)
{
return details::_for_each_assoc_helper_container
<Container, Function>(c, f, Q_NULLPTR);
<Container, Function>(c, f, nullptr);
}
} // namespace utils
......
......@@ -42,13 +42,13 @@ public:
}
optional_view(const none_t &)
: m_value(Q_NULLPTR)
: m_value(nullptr)
{
}
bool is_initialized() const
{
return m_value != Q_NULLPTR;
return m_value != nullptr;
}
const T &get() const
......
Markdown is supported
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