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
This commit is contained in:
Matteo De Carlo 2014-02-24 16:33:40 +01:00
parent 5a521c149f
commit c01446583e
7 changed files with 32 additions and 32 deletions

View file

@ -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)));
}

View file

@ -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);

View file

@ -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)

View file

@ -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:

View file

@ -251,7 +251,7 @@ Client *ClientLevel::clientForId(quint32 child) const
{
QMap<quint32, Client*>::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<ClientLevel*>(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<int, QByteArray> roleNames;
@ -826,7 +826,7 @@ CLIENT_MODEL_WRAPPER(ClientModelByScreenAndDesktop, QList<LevelRestriction>() <<
ClientFilterModel::ClientFilterModel(QObject *parent)
: QSortFilterProxyModel(parent)
, m_clientModel(NULL)
, m_clientModel(nullptr)
{
}

View file

@ -152,7 +152,7 @@ public:
virtual void setVirtualDesktop(uint virtualDesktop);
virtual void setActivity(const QString &activity);
static AbstractLevel *create(const QList<ClientModel::LevelRestriction> &restrictions, ClientModel::LevelRestrictions parentRestrictions, ClientModel *model, AbstractLevel *parent = NULL);
static AbstractLevel *create(const QList<ClientModel::LevelRestriction> &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;

View file

@ -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 );