From c01446583edcc5b349075ee12f49792e47589ad6 Mon Sep 17 00:00:00 2001 From: Matteo De Carlo Date: Mon, 24 Feb 2014 16:33:40 +0100 Subject: [PATCH] Replace NULL with nullptr in scripting folder Replacing all NULL to nullptr in all the files in scripting folder (also substituting some "0" used as nullptr with nullptr) REVIEW: 115915 --- scripting/scriptedeffect.cpp | 8 ++++---- scripting/scriptedeffect.h | 6 +++--- scripting/scripting.cpp | 12 ++++++------ scripting/scripting.h | 6 +++--- scripting/scripting_model.cpp | 20 ++++++++++---------- scripting/scripting_model.h | 10 +++++----- scripting/workspace_wrapper.h | 2 +- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/scripting/scriptedeffect.cpp b/scripting/scriptedeffect.cpp index 7f3f6c54ce..d0fc674071 100644 --- a/scripting/scriptedeffect.cpp +++ b/scripting/scriptedeffect.cpp @@ -250,7 +250,7 @@ QScriptValue kwinEffectAnimate(QScriptContext *context, QScriptEngine *engine) setting.duration, setting.to, setting.from, - NULL, + nullptr, setting.curve, setting.delay)); } @@ -279,7 +279,7 @@ QScriptValue kwinEffectSet(QScriptContext *context, QScriptEngine *engine) setting.duration, setting.to, setting.from, - NULL, + nullptr, setting.curve, setting.delay)); } @@ -371,7 +371,7 @@ ScriptedEffect *ScriptedEffect::create(const QString& effectName, const QString& ScriptedEffect *effect = new ScriptedEffect(); if (!effect->init(effectName, pathToScript)) { delete effect; - return NULL; + return nullptr; } return effect; } @@ -380,7 +380,7 @@ ScriptedEffect::ScriptedEffect() : AnimationEffect() , m_engine(new QScriptEngine(this)) , m_scriptFile(QString()) - , m_config(NULL) + , m_config(nullptr) { connect(m_engine, SIGNAL(signalHandlerException(QScriptValue)), SLOT(signalHandlerException(QScriptValue))); } diff --git a/scripting/scriptedeffect.h b/scripting/scriptedeffect.h index 7112700fa9..e47ea22db0 100644 --- a/scripting/scriptedeffect.h +++ b/scripting/scriptedeffect.h @@ -47,7 +47,7 @@ public: YAxis, ZAxis }; - explicit AnimationData(QObject* parent = 0); + explicit AnimationData(QObject* parent = nullptr); // getter AnimationEffect::Anchor sourceAnchor() const; @@ -130,8 +130,8 @@ public: } public Q_SLOTS: - quint64 animate(KWin::EffectWindow *w, Attribute a, int ms, KWin::FPx2 to, KWin::FPx2 from = KWin::FPx2(), KWin::AnimationData *data = NULL, QEasingCurve::Type curve = QEasingCurve::Linear, int delay = 0); - quint64 set(KWin::EffectWindow *w, Attribute a, int ms, KWin::FPx2 to, KWin::FPx2 from = KWin::FPx2(), KWin::AnimationData *data = NULL, QEasingCurve::Type curve = QEasingCurve::Linear, int delay = 0); + quint64 animate(KWin::EffectWindow *w, Attribute a, int ms, KWin::FPx2 to, KWin::FPx2 from = KWin::FPx2(), KWin::AnimationData *data = nullptr, QEasingCurve::Type curve = QEasingCurve::Linear, int delay = 0); + quint64 set(KWin::EffectWindow *w, Attribute a, int ms, KWin::FPx2 to, KWin::FPx2 from = KWin::FPx2(), KWin::AnimationData *data = nullptr, QEasingCurve::Type curve = QEasingCurve::Linear, int delay = 0); bool cancel(quint64 animationId) { return AnimationEffect::cancel(animationId); } virtual bool borderActivated(ElectricBorder border); diff --git a/scripting/scripting.cpp b/scripting/scripting.cpp index 8d51667211..ae14b22eff 100644 --- a/scripting/scripting.cpp +++ b/scripting/scripting.cpp @@ -367,7 +367,7 @@ QAction *KWin::AbstractScript::scriptValueToAction(QScriptValue &value, QMenu *p if (!titleValue.isValid()) { // title not specified - does not make any sense to include - return NULL; + return nullptr; } const QString title = titleValue.toString(); const bool checkable = checkableValue.isValid() && checkableValue.toBool(); @@ -376,19 +376,19 @@ QAction *KWin::AbstractScript::scriptValueToAction(QScriptValue &value, QMenu *p if (itemsValue.isValid()) { if (!itemsValue.isArray()) { // not an array, so cannot be a menu - return NULL; + return nullptr; } QScriptValue lengthValue = itemsValue.property(QStringLiteral("length")); if (!lengthValue.isValid() || !lengthValue.isNumber() || lengthValue.toInteger() == 0) { // length property missing - return NULL; + return nullptr; } return createMenu(title, itemsValue, parent); } else if (triggeredValue.isValid()) { // normal item return createAction(title, checkable, checked, triggeredValue, parent); } - return NULL; + return nullptr; } QAction *KWin::AbstractScript::createAction(const QString &title, bool checkable, bool checked, QScriptValue &callback, QMenu *parent) @@ -605,7 +605,7 @@ void KWin::JSEngineGlobalMethodsWrapper::registerWindow(QQuickWindow *window) }); } -KWin::Scripting *KWin::Scripting::s_self = NULL; +KWin::Scripting *KWin::Scripting::s_self = nullptr; KWin::Scripting *KWin::Scripting::create(QObject *parent) { @@ -781,7 +781,7 @@ KWin::Scripting::~Scripting() { QDBusConnection::sessionBus().unregisterObject(QStringLiteral("/Scripting")); QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.kwin.Scripting")); - s_self = NULL; + s_self = nullptr; } QList< QAction * > KWin::Scripting::actionsForUserActionMenu(KWin::Client *c, QMenu *parent) diff --git a/scripting/scripting.h b/scripting/scripting.h index a7f991d88c..2ac96ee472 100644 --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -55,7 +55,7 @@ class AbstractScript : public QObject { Q_OBJECT public: - AbstractScript(int id, QString scriptName, QString pluginName, QObject *parent = NULL); + AbstractScript(int id, QString scriptName, QString pluginName, QObject *parent = nullptr); ~AbstractScript(); QString fileName() const { return m_scriptFile.fileName(); @@ -221,7 +221,7 @@ class Script : public AbstractScript Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Scripting") public: - Script(int id, QString scriptName, QString pluginName, QObject *parent = NULL); + Script(int id, QString scriptName, QString pluginName, QObject *parent = nullptr); virtual ~Script(); QScriptEngine *engine() { return m_engine; @@ -271,7 +271,7 @@ class DeclarativeScript : public AbstractScript Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Scripting") public: - explicit DeclarativeScript(int id, QString scriptName, QString pluginName, QObject *parent = 0); + explicit DeclarativeScript(int id, QString scriptName, QString pluginName, QObject *parent = nullptr); virtual ~DeclarativeScript(); public Q_SLOTS: diff --git a/scripting/scripting_model.cpp b/scripting/scripting_model.cpp index 08ab36be88..60d32b7bb3 100644 --- a/scripting/scripting_model.cpp +++ b/scripting/scripting_model.cpp @@ -251,7 +251,7 @@ Client *ClientLevel::clientForId(quint32 child) const { QMap::const_iterator it = m_clients.constFind(child); if (it == m_clients.constEnd()) { - return NULL; + return nullptr; } return it.value(); } @@ -273,7 +273,7 @@ const AbstractLevel *ClientLevel::levelForId(quint32 id) const if (id == AbstractLevel::id()) { return this; } - return NULL; + return nullptr; } AbstractLevel *ClientLevel::parentForId(quint32 child) const @@ -284,7 +284,7 @@ AbstractLevel *ClientLevel::parentForId(quint32 child) const if (m_clients.contains(child)) { return const_cast(this); } - return NULL; + return nullptr; } AbstractLevel *AbstractLevel::create(const QList< ClientModel::LevelRestriction > &restrictions, ClientModel::LevelRestrictions parentRestrictions, ClientModel *model, AbstractLevel *parent) @@ -321,7 +321,7 @@ AbstractLevel *AbstractLevel::create(const QList< ClientModel::LevelRestriction } break; #else - return NULL; + return nullptr; #endif } case ClientModel::ScreenRestriction: @@ -346,7 +346,7 @@ AbstractLevel *AbstractLevel::create(const QList< ClientModel::LevelRestriction break; default: // invalid - return NULL; + return nullptr; } return currentLevel; @@ -580,7 +580,7 @@ const AbstractLevel *ForkLevel::levelForId(quint32 id) const } } // not found - return NULL; + return nullptr; } AbstractLevel *ForkLevel::parentForId(quint32 child) const @@ -594,7 +594,7 @@ AbstractLevel *ForkLevel::parentForId(quint32 child) const } } // not found - return NULL; + return nullptr; } int ForkLevel::rowForId(quint32 child) const @@ -626,12 +626,12 @@ Client *ForkLevel::clientForId(quint32 child) const } } // not found - return NULL; + return nullptr; } ClientModel::ClientModel(QObject *parent) : QAbstractItemModel(parent) - , m_root(NULL) + , m_root(nullptr) , m_exclusions(NoExclusion) { QHash roleNames; @@ -826,7 +826,7 @@ CLIENT_MODEL_WRAPPER(ClientModelByScreenAndDesktop, QList() << ClientFilterModel::ClientFilterModel(QObject *parent) : QSortFilterProxyModel(parent) - , m_clientModel(NULL) + , m_clientModel(nullptr) { } diff --git a/scripting/scripting_model.h b/scripting/scripting_model.h index 23cf75edb8..26f5630684 100644 --- a/scripting/scripting_model.h +++ b/scripting/scripting_model.h @@ -152,7 +152,7 @@ public: virtual void setVirtualDesktop(uint virtualDesktop); virtual void setActivity(const QString &activity); - static AbstractLevel *create(const QList &restrictions, ClientModel::LevelRestrictions parentRestrictions, ClientModel *model, AbstractLevel *parent = NULL); + static AbstractLevel *create(const QList &restrictions, ClientModel::LevelRestrictions parentRestrictions, ClientModel *model, AbstractLevel *parent = nullptr); Q_SIGNALS: void beginInsert(int rowStart, int rowEnd, quint32 parentId); @@ -248,7 +248,7 @@ class SimpleClientModel : public ClientModel { Q_OBJECT public: - SimpleClientModel(QObject *parent = NULL); + SimpleClientModel(QObject *parent = nullptr); virtual ~SimpleClientModel(); }; @@ -256,7 +256,7 @@ class ClientModelByScreen : public ClientModel { Q_OBJECT public: - ClientModelByScreen(QObject *parent = NULL); + ClientModelByScreen(QObject *parent = nullptr); virtual ~ClientModelByScreen(); }; @@ -264,7 +264,7 @@ class ClientModelByScreenAndDesktop : public ClientModel { Q_OBJECT public: - ClientModelByScreenAndDesktop(QObject *parent = NULL); + ClientModelByScreenAndDesktop(QObject *parent = nullptr); virtual ~ClientModelByScreenAndDesktop(); }; @@ -278,7 +278,7 @@ class ClientFilterModel : public QSortFilterProxyModel Q_PROPERTY(KWin::ScriptingClientModel::ClientModel *clientModel READ clientModel WRITE setClientModel NOTIFY clientModelChanged) Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) public: - ClientFilterModel(QObject *parent = 0); + ClientFilterModel(QObject *parent = nullptr); virtual ~ClientFilterModel(); ClientModel *clientModel() const; const QString &filter() const; diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index 965ce3dea6..5f3d3d6f35 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -170,7 +170,7 @@ public: ElectricNone }; - explicit WorkspaceWrapper(QObject* parent = 0); + explicit WorkspaceWrapper(QObject* parent = nullptr); #define GETTERSETTERDEF( rettype, getter, setter ) \ rettype getter() const; \ void setter( rettype val );