Warning--

This commit is contained in:
Laurent Montel 2018-04-13 13:58:44 +02:00
parent a4eeca5190
commit e690c4726e
63 changed files with 186 additions and 204 deletions

View File

@ -94,11 +94,11 @@ Applet::Applet(QObject *parent, const QString &serviceID, uint appletId)
}
Applet::Applet(QObject *parentObject, const QVariantList &args)
: QObject(0),
: QObject(nullptr),
d(new AppletPrivate(KPluginMetaData(), args.count() > 2 ? args[2].toInt() : 0, this))
{
setParent(parentObject);
if (args.count() > 0) {
if (!args.isEmpty()) {
const QVariant first = args.first();
if (first.canConvert<KPackage::Package>()) {
d->package = first.value<KPackage::Package>();
@ -264,7 +264,7 @@ KConfigGroup Applet::globalConfig() const
QString group = isContainment() ? QStringLiteral("ContainmentGlobals") : QStringLiteral("AppletGlobals");
Containment *cont = containment();
Corona *corona = 0;
Corona *corona = nullptr;
if (cont) {
corona = cont->corona();
}
@ -300,7 +300,7 @@ KConfigLoader *Applet::configScheme() const
const QString xmlPath = d->package.isValid() ? d->package.filePath("mainconfigxml") : QString();
KConfigGroup cfg = config();
if (xmlPath.isEmpty()) {
d->configLoader = new KConfigLoader(cfg, 0);
d->configLoader = new KConfigLoader(cfg, nullptr);
} else {
QFile file(xmlPath);
d->configLoader = new KConfigLoader(cfg, &file);
@ -646,7 +646,7 @@ Containment *Applet::containment() const
if (c && c->isContainment()) {
return c;
} else {
c = 0;
c = nullptr;
}
QObject *parent = this->parent();
@ -794,7 +794,7 @@ Applet *Applet::loadPlasmoid(const QString &path, uint appletId)
}
}
return 0;
return nullptr;
}
void Applet::timerEvent(QTimerEvent *event)

View File

@ -106,7 +106,7 @@ public:
*/
explicit Applet(const KPluginMetaData &metadata, QObject *parent = nullptr, uint appletId = 0);
~Applet();
~Applet() Q_DECL_OVERRIDE;
//BOOKKEEPING
/**

View File

@ -408,7 +408,7 @@ void Containment::addApplet(Applet *applet)
if (currentContainment && currentContainment != this) {
emit currentContainment->appletRemoved(applet);
disconnect(applet, 0, currentContainment, 0);
disconnect(applet, nullptr, currentContainment, nullptr);
KConfigGroup oldConfig = applet->config();
currentContainment->d->applets.removeAll(applet);
applet->setParent(this);
@ -521,13 +521,13 @@ QString Containment::wallpaper() const
void Containment::setContainmentActions(const QString &trigger, const QString &pluginName)
{
KConfigGroup cfg = d->containmentActionsConfig();
ContainmentActions *plugin = 0;
ContainmentActions *plugin = nullptr;
plugin = containmentActions().value(trigger);
if (plugin && plugin->pluginInfo().pluginName() != pluginName) {
containmentActions().remove(trigger);
delete plugin;
plugin = 0;
plugin = nullptr;
}
if (pluginName.isEmpty()) {

View File

@ -85,7 +85,7 @@ public:
*/
Containment(QObject *parent, const QVariantList &args);
~Containment();
~Containment() Q_DECL_OVERRIDE;
/**
* Reimplemented from Applet

View File

@ -90,7 +90,7 @@ void ContainmentActions::save(KConfigGroup &config)
QWidget *ContainmentActions::createConfigurationInterface(QWidget *parent)
{
Q_UNUSED(parent);
return 0;
return nullptr;
}
void ContainmentActions::configurationAccepted()

View File

@ -171,7 +171,7 @@ void Corona::loadLayout(const QString &configName)
{
if (!configName.isEmpty() && configName != d->configName) {
// if we have a new config name passed in, then use that as the config file for this Corona
d->config = 0;
d->config = nullptr;
d->configName = configName;
}
@ -202,7 +202,7 @@ Containment *Corona::containmentForScreen(int screen) const
}
}
return 0;
return nullptr;
}
Containment *Corona::containmentForScreen(int screen,
@ -250,7 +250,7 @@ Containment *Corona::createContainment(const QString &name, const QVariantList &
return d->addContainment(name, args, 0);
}
return 0;
return nullptr;
}
Containment *Corona::createContainmentDelayed(const QString &name, const QVariantList &args)
@ -259,7 +259,7 @@ Containment *Corona::createContainmentDelayed(const QString &name, const QVarian
return d->addContainment(name, args, 0, true);
}
return 0;
return nullptr;
}
int Corona::screenForContainment(const Containment *) const
@ -355,7 +355,7 @@ KActionCollection *Corona::actions() const
CoronaPrivate::CoronaPrivate(Corona *corona)
: q(corona),
immutability(Types::Mutable),
config(0),
config(nullptr),
configSyncTimer(new QTimer(corona)),
actions(corona),
containmentsStarting(0)
@ -450,8 +450,8 @@ void CoronaPrivate::syncConfig()
Containment *CoronaPrivate::addContainment(const QString &name, const QVariantList &args, uint id, bool delayedInit)
{
QString pluginName = name;
Containment *containment = 0;
Applet *applet = 0;
Containment *containment = nullptr;
Applet *applet = nullptr;
// qCDebug(LOG_PLASMA) << "Loading" << name << args << id;

View File

@ -164,7 +164,7 @@ void DataContainer::connectVisualization(QObject *visualization, uint pollingInt
if (pollingInterval < 1) {
//qCDebug(LOG_PLASMA) << " connecting directly";
d->relayObjects[visualization] = 0;
d->relayObjects[visualization] = nullptr;
if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma::DataEngine::Data)") >= 0) {
connect(this, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)),
visualization, SLOT(dataUpdated(QString,Plasma::DataEngine::Data)));
@ -221,11 +221,11 @@ void DataContainer::setNeedsToBeStored(bool store)
DataEngine *DataContainer::getDataEngine()
{
QObject *o = this;
DataEngine *de = NULL;
while (de == NULL) {
DataEngine *de = nullptr;
while (de == nullptr) {
o = dynamic_cast<QObject *>(o->parent());
if (o == NULL) {
return NULL;
if (o == nullptr) {
return nullptr;
}
de = dynamic_cast<DataEngine *>(o);
}
@ -262,14 +262,14 @@ void DataContainerPrivate::storeJobFinished(KJob *)
--storageCount;
if (storageCount < 1) {
storage->deleteLater();
storage = 0;
storage = nullptr;
}
}
void DataContainerPrivate::retrieve()
{
DataEngine *de = q->getDataEngine();
if (de == NULL) {
if (de == nullptr) {
return;
}
@ -407,7 +407,7 @@ void DataContainer::timerEvent(QTimerEvent *event)
//NOTE: Notifying visualization of the model destruction before actual deletion avoids crashes in some edge cases
if (d->model) {
d->model.clear();
emit modelChanged(objectName(), 0);
emit modelChanged(objectName(), nullptr);
}
emit becameUnused(objectName());
}

View File

@ -74,7 +74,7 @@ public:
* associated with it
**/
explicit DataContainer(QObject *parent = nullptr);
virtual ~DataContainer();
~DataContainer() Q_DECL_OVERRIDE;
/**
* Returns the data for this DataContainer

View File

@ -252,7 +252,7 @@ QAbstractItemModel *DataEngine::modelForSource(const QString &source)
if (s) {
return s->model();
} else {
return 0;
return nullptr;
}
}
@ -417,8 +417,8 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info, con
updateTimerId(0),
minPollingInterval(-1),
valid(false),
script(0),
package(0)
script(nullptr),
package(nullptr)
{
updateTimer.start();
@ -448,7 +448,7 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info, con
// << dataEngineDescription.name() << "DataEngine.";
#endif
delete package;
package = 0;
package = nullptr;
}
}
}
@ -457,9 +457,9 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info, con
DataEnginePrivate::~DataEnginePrivate()
{
delete script;
script = 0;
script = nullptr;
delete package;
package = 0;
package = nullptr;
}
void DataEnginePrivate::internalUpdateSource(DataContainer *source)
@ -509,7 +509,7 @@ DataContainer *DataEnginePrivate::source(const QString &sourceName, bool createW
}
if (!createWhenMissing) {
return 0;
return nullptr;
}
//qCDebug(LOG_PLASMA) << "DataEngine " << q->objectName() << ": could not find DataContainer " << sourceName << ", creating";

View File

@ -77,7 +77,7 @@ public:
explicit DataEngine(QObject *parent = nullptr, const QVariantList &args = QVariantList());
~DataEngine();
~DataEngine() Q_DECL_OVERRIDE;
/**
* @return a list of all the data sources available via this DataEngine

View File

@ -160,19 +160,14 @@ bool FrameSvg::hasElementPrefix(Plasma::Types::Location location) const
switch (location) {
case Types::TopEdge:
return hasElementPrefix(QStringLiteral("north"));
break;
case Types::BottomEdge:
return hasElementPrefix(QStringLiteral("south"));
break;
case Types::LeftEdge:
return hasElementPrefix(QStringLiteral("west"));
break;
case Types::RightEdge:
return hasElementPrefix(QStringLiteral("east"));
break;
default:
return hasElementPrefix(QString());
break;
}
}
@ -226,20 +221,16 @@ qreal FrameSvg::marginSize(const Plasma::Types::MarginEdge edge) const
switch (edge) {
case Plasma::Types::TopMargin:
return d->frame->topMargin;
break;
case Plasma::Types::LeftMargin:
return d->frame->leftMargin;
break;
case Plasma::Types::RightMargin:
return d->frame->rightMargin;
break;
//Plasma::BottomMargin
default:
return d->frame->bottomMargin;
break;
}
}
@ -256,20 +247,16 @@ qreal FrameSvg::fixedMarginSize(const Plasma::Types::MarginEdge edge) const
switch (edge) {
case Plasma::Types::TopMargin:
return d->frame->fixedTopMargin;
break;
case Plasma::Types::LeftMargin:
return d->frame->fixedLeftMargin;
break;
case Plasma::Types::RightMargin:
return d->frame->fixedRightMargin;
break;
//Plasma::BottomMargin
default:
return d->frame->fixedBottomMargin;
break;
}
}

View File

@ -104,7 +104,7 @@ public:
* @related Plasma::Theme
*/
explicit FrameSvg(QObject *parent = nullptr);
~FrameSvg();
~FrameSvg() Q_DECL_OVERRIDE;
/**
* Loads a new Svg

View File

@ -46,9 +46,9 @@ namespace Plasma
PackagePrivate::PackagePrivate()
: internalPackage(0),
fallbackPackage(0),
structure(0)
: internalPackage(nullptr),
fallbackPackage(nullptr),
structure(nullptr)
{
}

View File

@ -92,7 +92,7 @@ public:
* otherwise the structure is allowed to set up the Package's initial layout
* @since 4.6
*/
PLASMA_DEPRECATED explicit Package(PackageStructure *structure = 0);
PLASMA_DEPRECATED explicit Package(PackageStructure *structure = nullptr);
/**
* Copy constructore

View File

@ -72,7 +72,7 @@ void PackageStructureWrapper::pathChanged(KPackage::Package *package)
KJob *PackageStructureWrapper::install(KPackage::Package *package, const QString &archivePath, const QString &packageRoot)
{
if (!m_struct || !s_packagesMap.contains(package)) {
return 0;
return nullptr;
}
return m_struct->install(s_packagesMap.value(package), archivePath, packageRoot);
@ -81,7 +81,7 @@ KJob *PackageStructureWrapper::install(KPackage::Package *package, const QString
KJob *PackageStructureWrapper::uninstall(KPackage::Package *package, const QString &packageRoot)
{
if (!m_struct || !s_packagesMap.contains(package)) {
return 0;
return nullptr;
}
return m_struct->uninstall(s_packagesMap.value(package), packageRoot);
@ -211,7 +211,7 @@ KJob *PackageStructure::install(Package *package, const QString &archivePath, co
return job;
}
return 0;
return nullptr;
}
KJob *PackageStructure::uninstall(Package *package, const QString &packageRoot)
@ -236,7 +236,7 @@ KJob *PackageStructure::uninstall(Package *package, const QString &packageRoot)
return job;
}
return 0;
return nullptr;
}
}

View File

@ -28,7 +28,7 @@ class ContainmentActionsPackage : public Plasma::ChangeableMainScriptPackage
{
Q_OBJECT
public:
ContainmentActionsPackage(QObject *parent = 0, const QVariantList &args = QVariantList()) : ChangeableMainScriptPackage(parent, args) {}
ContainmentActionsPackage(QObject *parent = nullptr, const QVariantList &args = QVariantList()) : ChangeableMainScriptPackage(parent, args) {}
void initPackage(KPackage::Package *package) Q_DECL_OVERRIDE
{

View File

@ -29,7 +29,7 @@ class DataEnginePackage : public Plasma::ChangeableMainScriptPackage
{
Q_OBJECT
public:
DataEnginePackage(QObject *parent = 0, const QVariantList &args = QVariantList()) : ChangeableMainScriptPackage(parent, args) {}
DataEnginePackage(QObject *parent = nullptr, const QVariantList &args = QVariantList()) : ChangeableMainScriptPackage(parent, args) {}
void initPackage(KPackage::Package *package) Q_DECL_OVERRIDE
{

View File

@ -28,7 +28,7 @@ class ThemePackage : public KPackage::PackageStructure
{
Q_OBJECT
public:
ThemePackage(QObject *parent = 0, const QVariantList &args = QVariantList()) : KPackage::PackageStructure(parent, args) {}
ThemePackage(QObject *parent = nullptr, const QVariantList &args = QVariantList()) : KPackage::PackageStructure(parent, args) {}
void initPackage(KPackage::Package *package) Q_DECL_OVERRIDE
{

View File

@ -29,7 +29,7 @@ class PlasmoidPackage : public Plasma::GenericPackage
{
Q_OBJECT
public:
PlasmoidPackage(QObject *parent = 0, const QVariantList &args = QVariantList()) : GenericPackage(parent, args) {}
PlasmoidPackage(QObject *parent = nullptr, const QVariantList &args = QVariantList()) : GenericPackage(parent, args) {}
void initPackage(KPackage::Package *package) Q_DECL_OVERRIDE
{

View File

@ -50,7 +50,7 @@
namespace Plasma
{
static PluginLoader *s_pluginLoader = 0;
static PluginLoader *s_pluginLoader = nullptr;
class PluginLoaderPrivate
{
@ -168,10 +168,10 @@ PluginLoader *PluginLoader::self()
Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVariantList &args)
{
if (name.isEmpty()) {
return 0;
return nullptr;
}
Applet *applet = d->isDefaultLoader ? 0 : internalLoadApplet(name, appletId, args);
Applet *applet = d->isDefaultLoader ? nullptr : internalLoadApplet(name, appletId, args);
if (applet) {
return applet;
}
@ -200,13 +200,13 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
if (!plugins.isEmpty()) {
KPluginLoader loader(plugins.first().fileName());
if (!isPluginVersionCompatible(loader)) {
return 0;
return nullptr;
}
KPluginFactory *factory = loader.factory();
if (factory) {
QVariantList allArgs;
allArgs << QVariant::fromValue(p) << loader.metaData().toVariantMap() << appletId << args;
applet = factory->create<Plasma::Applet>(0, allArgs);
applet = factory->create<Plasma::Applet>(nullptr, allArgs);
}
}
if (applet) {
@ -221,9 +221,9 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
allArgs << QVariant::fromValue(p) << p.metadata().fileName() << appletId << args;
if (p.metadata().serviceTypes().contains(QStringLiteral("Plasma/Containment"))) {
applet = new Containment(0, allArgs);
applet = new Containment(nullptr, allArgs);
} else {
applet = new Applet(0, allArgs);
applet = new Applet(nullptr, allArgs);
}
}
@ -237,7 +237,7 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
DataEngine *PluginLoader::loadDataEngine(const QString &name)
{
DataEngine *engine = d->isDefaultLoader ? 0 : internalLoadDataEngine(name);
DataEngine *engine = d->isDefaultLoader ? nullptr : internalLoadDataEngine(name);
if (engine) {
return engine;
}
@ -254,7 +254,7 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name)
const QVariantList argsWithMetaData = QVariantList() << loader.metaData().toVariantMap();
KPluginFactory *factory = loader.factory();
if (factory) {
engine = factory->create<Plasma::DataEngine>(0, argsWithMetaData);
engine = factory->create<Plasma::DataEngine>(nullptr, argsWithMetaData);
}
}
if (engine) {
@ -263,10 +263,10 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name)
const KPackage::Package p = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/DataEngine"), name);
if (!p.isValid()) {
return 0;
return nullptr;
}
return new DataEngine(KPluginInfo(p.metadata().fileName()), 0);
return new DataEngine(KPluginInfo(p.metadata().fileName()), nullptr);
}
QStringList PluginLoader::listAllEngines(const QString &parentApp)
@ -334,7 +334,7 @@ KPluginInfo::List PluginLoader::listEngineInfoByCategory(const QString &category
Service *PluginLoader::loadService(const QString &name, const QVariantList &args, QObject *parent)
{
Service *service = d->isDefaultLoader ? 0 : internalLoadService(name, args, parent);
Service *service = d->isDefaultLoader ? nullptr : internalLoadService(name, args, parent);
if (service) {
return service;
}
@ -357,11 +357,11 @@ Service *PluginLoader::loadService(const QString &name, const QVariantList &args
if (!plugins.isEmpty()) {
KPluginLoader loader(plugins.first().fileName());
if (!isPluginVersionCompatible(loader)) {
return 0;
return nullptr;
}
KPluginFactory *factory = loader.factory();
if (factory) {
service = factory->create<Plasma::Service>(0, args);
service = factory->create<Plasma::Service>(nullptr, args);
}
}
@ -378,10 +378,10 @@ Service *PluginLoader::loadService(const QString &name, const QVariantList &args
ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, const QString &name, const QVariantList &args)
{
if (name.isEmpty()) {
return 0;
return nullptr;
}
ContainmentActions *actions = d->isDefaultLoader ? 0 : internalLoadContainmentActions(parent, name, args);
ContainmentActions *actions = d->isDefaultLoader ? nullptr : internalLoadContainmentActions(parent, name, args);
if (actions) {
return actions;
}
@ -415,14 +415,14 @@ ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, co
#ifndef NDEBUG
qCDebug(LOG_PLASMA) << "offers is empty for " << name;
#endif
return 0;
return nullptr;
}
KService::Ptr offer = offers.first();
KPluginLoader plugin(*offer);
if (!isPluginVersionCompatible(plugin)) {
return 0;
return nullptr;
}
QVariantList allArgs;
@ -468,7 +468,7 @@ Package PluginLoader::loadPackage(const QString &packageFormat, const QString &s
//fallback to old structures
} else {
const QString constraint = QStringLiteral("[X-KDE-PluginInfo-Name] == '%1'").arg(packageFormat);
structure = KPluginTrader::createInstanceFromQuery<Plasma::PackageStructure>(PluginLoaderPrivate::s_packageStructurePluginDir, QStringLiteral("Plasma/PackageStructure"), constraint, 0);
structure = KPluginTrader::createInstanceFromQuery<Plasma::PackageStructure>(PluginLoaderPrivate::s_packageStructurePluginDir, QStringLiteral("Plasma/PackageStructure"), constraint, nullptr);
if (structure) {
structure->d->internalStructure = new PackageStructureWrapper(structure);
}
@ -762,13 +762,13 @@ Applet *PluginLoader::internalLoadApplet(const QString &name, uint appletId, con
Q_UNUSED(name)
Q_UNUSED(appletId)
Q_UNUSED(args)
return 0;
return nullptr;
}
DataEngine *PluginLoader::internalLoadDataEngine(const QString &name)
{
Q_UNUSED(name)
return 0;
return nullptr;
}
ContainmentActions *PluginLoader::internalLoadContainmentActions(Containment *containment, const QString &name, const QVariantList &args)
@ -776,7 +776,7 @@ ContainmentActions *PluginLoader::internalLoadContainmentActions(Containment *co
Q_UNUSED(containment)
Q_UNUSED(name)
Q_UNUSED(args)
return 0;
return nullptr;
}
Service *PluginLoader::internalLoadService(const QString &name, const QVariantList &args, QObject *parent)
@ -784,7 +784,7 @@ Service *PluginLoader::internalLoadService(const QString &name, const QVariantLi
Q_UNUSED(name)
Q_UNUSED(args)
Q_UNUSED(parent)
return 0;
return nullptr;
}

View File

@ -60,13 +60,13 @@ AppletPrivate::AppletPrivate(const KPluginMetaData &info, int uniqueID, Applet *
oldImmutability(Types::Mutable),
appletDescription(info),
icon(appletDescription.iconName()),
mainConfig(0),
mainConfig(nullptr),
pendingConstraints(Types::NoConstraint),
script(0),
package(0),
configLoader(0),
script(nullptr),
package(nullptr),
configLoader(nullptr),
actions(AppletPrivate::defaultActions(applet)),
activationAction(0),
activationAction(nullptr),
itemStatus(Types::UnknownStatus),
modificationsTimer(nullptr),
deleteNotificationTimer(nullptr),
@ -105,11 +105,11 @@ AppletPrivate::~AppletPrivate()
}
delete script;
script = 0;
script = nullptr;
delete configLoader;
configLoader = 0;
configLoader = nullptr;
delete mainConfig;
mainConfig = 0;
mainConfig = nullptr;
delete modificationsTimer;
}
@ -297,7 +297,7 @@ void AppletPrivate::askDestroy()
//when an applet gets transient, it's "systemimmutable"
emit q->immutabilityChanged(q->immutability());
delete containmentApplet->d->deleteNotificationTimer;
containmentApplet->d->deleteNotificationTimer = 0;
containmentApplet->d->deleteNotificationTimer = nullptr;
}
//make sure the applets are sorted by id
@ -312,7 +312,7 @@ void AppletPrivate::askDestroy()
} else if (deleteNotificationTimer) {
deleteNotificationTimer->stop();
deleteNotificationTimer->deleteLater();
deleteNotificationTimer = 0;
deleteNotificationTimer = nullptr;
}
});
QObject::connect(deleteNotification.data(), &KNotification::closed, q,
@ -324,7 +324,7 @@ void AppletPrivate::askDestroy()
if (deleteNotificationTimer) {
deleteNotificationTimer->stop();
deleteNotificationTimer->deleteLater();
deleteNotificationTimer = 0;
deleteNotificationTimer = nullptr;
}
});
@ -529,7 +529,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
}
Containment *c = q->containment();
Plasma::Applet *parentApplet = 0;
Plasma::Applet *parentApplet = nullptr;
if (c) {
parentApplet = qobject_cast<Plasma::Applet *>(c->parent());
}
@ -584,7 +584,7 @@ void AppletPrivate::resetConfigurationObject()
mainConfig->deleteEntry("activityId");
mainConfig->deleteGroup();
delete mainConfig;
mainConfig = 0;
mainConfig = nullptr;
Containment *cont = qobject_cast<Containment *>(q);

View File

@ -198,7 +198,7 @@ void AssociatedApplicationManager::run(Plasma::Applet *applet)
{
if (d->applicationNames.contains(applet)) {
#if !PLASMA_NO_KIO
bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), 0);
bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), nullptr);
if (!success) {
qCWarning(LOG_PLASMA) << "couldn't run" << d->applicationNames.value(applet) << d->urlLists.value(applet);
}
@ -215,7 +215,7 @@ void AssociatedApplicationManager::run(Plasma::Applet *applet)
} else if (d->urlLists.contains(applet)) {
#if !PLASMA_NO_KIO
KRun *krun = new KRun(d->urlLists.value(applet).first(), 0);
KRun *krun = new KRun(d->urlLists.value(applet).first(), nullptr);
krun->setAutoDelete(true);
#else
QDesktopServices::openUrl(d->urlLists.value(applet).first());

View File

@ -189,21 +189,21 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Types::Constraints
Applet *ContainmentPrivate::createApplet(const QString &name, const QVariantList &args, uint id)
{
if (!q->isContainment()) {
return 0;
return nullptr;
}
if (q->immutability() != Types::Mutable && !args.contains(QVariant::fromValue(QStringLiteral("org.kde.plasma:force-create")))) {
#ifndef NDEBUG
// qCDebug(LOG_PLASMA) << "addApplet for" << name << "requested, but we're currently immutable!";
#endif
return 0;
return nullptr;
}
Applet *applet = PluginLoader::self()->loadApplet(name, id, args);
if (!applet) {
qCWarning(LOG_PLASMA) << "Applet" << name << "could not be loaded.";
applet = new Applet(0, QString(), id);
applet = new Applet(nullptr, QString(), id);
applet->setLaunchErrorMessage(i18n("Could not find requested component: %1", name));
}

View File

@ -73,7 +73,7 @@ public:
/**
* add the regular actions & keyboard shortcuts onto Applet's collection
*/
static void addDefaultActions(KActionCollection *actions, Containment *c = 0);
static void addDefaultActions(KActionCollection *actions, Containment *c = nullptr);
void setUiReady();
void setStarted();

View File

@ -29,7 +29,7 @@ SignalRelay *DataContainerPrivate::signalRelay(const DataContainer *dc, QObject
bool immediateUpdate)
{
QMap<uint, SignalRelay *>::const_iterator relayIt = relays.constFind(pollingInterval);
SignalRelay *relay = 0;
SignalRelay *relay = nullptr;
//FIXME what if we have two applets with the same interval and different alignment?
if (relayIt == relays.constEnd()) {

View File

@ -41,7 +41,7 @@ class DataContainerPrivate
public:
DataContainerPrivate(DataContainer *container)
: q(container),
storage(NULL),
storage(nullptr),
storageCount(0),
dirty(false),
cached(false),

View File

@ -40,7 +40,7 @@ namespace Plasma
class NullEngine : public DataEngine
{
public:
NullEngine(QObject *parent = 0)
explicit NullEngine(QObject *parent = nullptr)
: DataEngine(KPluginInfo(), parent)
{
setValid(false);
@ -54,7 +54,7 @@ class DataEngineManagerPrivate
{
public:
DataEngineManagerPrivate()
: nullEng(0)
: nullEng(nullptr)
{}
~DataEngineManagerPrivate()

View File

@ -82,7 +82,7 @@ private:
* preferred access mechanism.
*/
DataEngineManager();
~DataEngineManager();
~DataEngineManager() Q_DECL_OVERRIDE;
DataEngineManagerPrivate *const d;

View File

@ -108,7 +108,7 @@ void StorageJob::resultSlot(StorageJob *job, const QVariant &result)
Plasma::ServiceJob *Storage::createJob(const QString &operation, QVariantMap &parameters)
{
if (m_clientName.isEmpty()) {
return 0;
return nullptr;
}
return new StorageJob(m_clientName, operation, parameters, this);

View File

@ -39,7 +39,7 @@ public:
const QString &operation,
const QVariantMap &parameters,
QObject *parent = nullptr);
~StorageJob();
~StorageJob() Q_DECL_OVERRIDE;
void setData(const QVariantMap &data);
QVariantMap data() const;
void start() Q_DECL_OVERRIDE;
@ -62,8 +62,8 @@ class Storage : public Plasma::Service
Q_OBJECT
public:
Storage(QObject *parent = nullptr);
~Storage();
explicit Storage(QObject *parent = nullptr);
~Storage() Q_DECL_OVERRIDE;
protected:
Plasma::ServiceJob *createJob(const QString &operation, QVariantMap &parameters) Q_DECL_OVERRIDE;

View File

@ -175,7 +175,6 @@ void StorageThread::save(QWeakPointer<StorageJob> wcaller, const QVariantMap &pa
break;
default:
continue;
break;
}
if (binary) {

View File

@ -34,7 +34,7 @@ class StorageThread : public QThread
Q_OBJECT
public:
explicit StorageThread(QObject *parent = nullptr);
~StorageThread();
~StorageThread() Q_DECL_OVERRIDE;
void run() Q_DECL_OVERRIDE;

View File

@ -46,23 +46,23 @@ const char ThemePrivate::systemColorsTheme[] = "internal-system-colors";
EffectWatcher *ThemePrivate::s_backgroundContrastEffectWatcher = nullptr;
#endif
ThemePrivate *ThemePrivate::globalTheme = 0;
ThemePrivate *ThemePrivate::globalTheme = nullptr;
QAtomicInt ThemePrivate::globalThemeRefCount = QAtomicInt();
QHash<QString, ThemePrivate *> ThemePrivate::themes = QHash<QString, ThemePrivate *>();
QHash<QString, QAtomicInt> ThemePrivate::themesRefCount = QHash<QString, QAtomicInt>();
ThemePrivate::ThemePrivate(QObject *parent)
: QObject(parent),
colorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)),
selectionColorScheme(QPalette::Active, KColorScheme::Selection, KSharedConfigPtr(0)),
buttonColorScheme(QPalette::Active, KColorScheme::Button, KSharedConfigPtr(0)),
viewColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)),
complementaryColorScheme(QPalette::Active, KColorScheme::Complementary, KSharedConfigPtr(0)),
colorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(nullptr)),
selectionColorScheme(QPalette::Active, KColorScheme::Selection, KSharedConfigPtr(nullptr)),
buttonColorScheme(QPalette::Active, KColorScheme::Button, KSharedConfigPtr(nullptr)),
viewColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(nullptr)),
complementaryColorScheme(QPalette::Active, KColorScheme::Complementary, KSharedConfigPtr(nullptr)),
defaultWallpaperTheme(QStringLiteral(DEFAULT_WALLPAPER_THEME)),
defaultWallpaperSuffix(QStringLiteral(DEFAULT_WALLPAPER_SUFFIX)),
defaultWallpaperWidth(DEFAULT_WALLPAPER_WIDTH),
defaultWallpaperHeight(DEFAULT_WALLPAPER_HEIGHT),
pixmapCache(0),
pixmapCache(nullptr),
cacheSize(0),
cachesToDiscard(NoCache),
compositingActive(KWindowSystem::self()->compositingActive()),
@ -297,7 +297,7 @@ void ThemePrivate::onAppExitCleanup()
{
pixmapsToCache.clear();
delete pixmapCache;
pixmapCache = 0;
pixmapCache = nullptr;
cacheTheme = false;
}
@ -359,7 +359,7 @@ void ThemePrivate::discardCache(CacheTypes caches)
} else {
// This deletes the object but keeps the on-disk cache for later use
delete pixmapCache;
pixmapCache = 0;
pixmapCache = nullptr;
}
cachedDefaultStyleSheet = QString();
@ -370,7 +370,7 @@ void ThemePrivate::discardCache(CacheTypes caches)
discoveries.clear();
invalidElements.clear();
svgElementsCache = 0;
svgElementsCache = nullptr;
}
}
@ -625,7 +625,7 @@ void ThemePrivate::saveSvgElementsCache()
QColor ThemePrivate::color(Theme::ColorRole role, Theme::ColorGroup group) const
{
const KColorScheme *scheme = 0;
const KColorScheme *scheme = nullptr;
//Before 5.0 Plasma theme really only used Normal and Button
//many old themes are built on this assumption and will break
@ -793,7 +793,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
//qCDebug(LOG_PLASMA) << "we're going for..." << colorsFile << "*******************";
if (colorsFile.isEmpty()) {
colors = 0;
colors = nullptr;
} else {
colors = KSharedConfig::openConfig(colorsFile);
}

View File

@ -64,7 +64,7 @@ class ThemePrivate : public QObject
public:
explicit ThemePrivate(QObject *parent = nullptr);
~ThemePrivate();
~ThemePrivate() Q_DECL_OVERRIDE;
KConfigGroup &config();

View File

@ -38,7 +38,7 @@ AppletScript::AppletScript(QObject *parent)
: ScriptEngine(parent),
d(new AppletScriptPrivate)
{
d->applet = 0;
d->applet = nullptr;
}
AppletScript::~AppletScript()

View File

@ -58,7 +58,7 @@ public:
* in the init() method.
*/
explicit AppletScript(QObject *parent = nullptr);
~AppletScript();
~AppletScript() Q_DECL_OVERRIDE;
/**
* Sets the applet associated with this AppletScript

View File

@ -50,7 +50,7 @@ public:
* in the init() method.
*/
explicit DataEngineScript(QObject *parent = nullptr);
~DataEngineScript();
~DataEngineScript() Q_DECL_OVERRIDE;
/**
* Sets the Plasma::DataEngine associated with this DataEngineScript

View File

@ -35,7 +35,7 @@ namespace Plasma
ScriptEngine::ScriptEngine(QObject *parent)
: QObject(parent),
d(0)
d(nullptr)
{
}
@ -80,7 +80,7 @@ ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QOb
{
Q_UNUSED(parent);
ScriptEngine *engine = 0;
ScriptEngine *engine = nullptr;
auto filter = [&language](const KPluginMetaData &md) -> bool
{
@ -94,12 +94,12 @@ ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QOb
|| ((type & Types::DataEngineComponent) && !componentTypes.contains(QStringLiteral("DataEngine")))) {
qCWarning(LOG_PLASMA) << "ScriptEngine" << plugins.first().name() << "does not provide Applet or DataEngine components, returning empty.";
return 0;
return nullptr;
}
KPluginLoader loader(plugins.first().fileName());
KPluginFactory *factory = loader.factory();
if (factory) {
engine = factory->create<Plasma::ScriptEngine>(0, args);
engine = factory->create<Plasma::ScriptEngine>(nullptr, args);
} else {
qCWarning(LOG_PLASMA) << "Unable to load" << plugins.first().name() << "ScriptEngine";
}

View File

@ -97,7 +97,7 @@ QVariantMap Service::operationDescription(const QString &operationName)
ServiceJob *Service::startOperationCall(const QVariantMap &description, QObject *parent)
{
// TODO: nested groups?
ServiceJob *job = 0;
ServiceJob *job = nullptr;
const QString op = !description.isEmpty() ? description.value(QStringLiteral("_name")).toString() : QString();
if (d->operationsMap.isEmpty()) {

View File

@ -71,7 +71,7 @@ public:
/**
* Destructor
*/
~ServiceJob();
~ServiceJob() Q_DECL_OVERRIDE;
/**
* @return the subject that the job is acting on

View File

@ -141,7 +141,7 @@ bool SharedSvgRenderer::load(
SvgPrivate::SvgPrivate(Svg *svg)
: q(svg),
renderer(0),
renderer(nullptr),
styleCrc(0),
colorGroup(Plasma::Theme::NormalColorGroup),
lastModified(0),
@ -213,7 +213,7 @@ bool SvgPrivate::setImagePath(const QString &imagePath)
if (isThemed && !themed && s_systemColorsCache) {
// catch the case where we weren't themed, but now we are, and the colors cache was set up
// ensure we are not connected to that theme previously
QObject::disconnect(s_systemColorsCache.data(), 0, q, 0);
QObject::disconnect(s_systemColorsCache.data(), nullptr, q, nullptr);
}
themed = isThemed;
@ -503,7 +503,7 @@ void SvgPrivate::eraseRenderer()
}
}
renderer = 0;
renderer = nullptr;
styleCrc = 0;
localRectCache.clear();
elementsWithSizeHints.clear();
@ -770,7 +770,7 @@ void Svg::setColorGroup(Plasma::Theme::ColorGroup group)
}
d->colorGroup = group;
d->renderer = 0;
d->renderer = nullptr;
emit colorGroupChanged();
emit repaintNeeded();
}
@ -968,7 +968,7 @@ void Svg::setTheme(Plasma::Theme *theme)
}
if (d->theme) {
disconnect(d->theme.data(), 0, this, 0);
disconnect(d->theme.data(), nullptr, this, nullptr);
}
d->theme = theme;

View File

@ -86,7 +86,7 @@ public:
* @related Plasma::Theme
*/
explicit Svg(QObject *parent = nullptr);
~Svg();
~Svg() Q_DECL_OVERRIDE;
/**
* Set the device pixel ratio for the Svg. This is the ratio between

View File

@ -97,8 +97,8 @@ Theme::~Theme()
if (!ThemePrivate::globalThemeRefCount.deref()) {
disconnect(ThemePrivate::globalTheme, 0, this, 0);
delete ThemePrivate::globalTheme;
ThemePrivate::globalTheme = 0;
d = 0;
ThemePrivate::globalTheme = nullptr;
d = nullptr;
}
} else {
if (!ThemePrivate::themesRefCount[d->themeName].deref()) {
@ -447,7 +447,7 @@ void Theme::setCacheLimit(int kbytes)
{
d->cacheSize = kbytes;
delete d->pixmapCache;
d->pixmapCache = 0;
d->pixmapCache = nullptr;
}
KPluginInfo Theme::pluginInfo() const

View File

@ -105,7 +105,7 @@ int AppletQuickItemPrivate::preloadWeight() const
void AppletQuickItemPrivate::connectLayoutAttached(QObject *item)
{
QObject *layout = 0;
QObject *layout = nullptr;
//Extract the representation's Layout, if any
//No Item?
@ -154,7 +154,7 @@ void AppletQuickItemPrivate::connectLayoutAttached(QObject *item)
propagateSizeHint("fillHeight");
QObject *ownLayout = 0;
QObject *ownLayout = nullptr;
foreach (QObject *child, q->children()) {
//find for the needed property of Layout: minimum/maximum/preferred sizes and fillWidth/fillHeight
@ -226,7 +226,7 @@ void AppletQuickItemPrivate::propagateSizeHint(const QByteArray &layoutProperty)
QQuickItem *AppletQuickItemPrivate::createCompactRepresentationItem()
{
if (!compactRepresentation) {
return 0;
return nullptr;
}
if (compactRepresentationItem) {
@ -260,7 +260,7 @@ QQuickItem *AppletQuickItemPrivate::createFullRepresentationItem()
}
if (!fullRepresentationItem) {
return 0;
return nullptr;
}
emit q->fullRepresentationItemChanged(fullRepresentationItem);
@ -271,7 +271,7 @@ QQuickItem *AppletQuickItemPrivate::createFullRepresentationItem()
QQuickItem *AppletQuickItemPrivate::createCompactRepresentationExpanderItem()
{
if (!compactRepresentationExpander) {
return 0;
return nullptr;
}
if (compactRepresentationExpanderItem) {
@ -281,7 +281,7 @@ QQuickItem *AppletQuickItemPrivate::createCompactRepresentationExpanderItem()
compactRepresentationExpanderItem = qobject_cast<QQuickItem*>(qmlObject->createObjectFromComponent(compactRepresentationExpander, QtQml::qmlContext(qmlObject->rootObject())));
if (!compactRepresentationExpanderItem) {
return 0;
return nullptr;
}
compactRepresentationExpanderItem->setProperty("compactRepresentation", QVariant::fromValue<QObject*>(createCompactRepresentationItem()));
@ -541,7 +541,7 @@ AppletQuickItem *AppletQuickItem::qmlAttachedProperties(QObject *object)
if (!object->parent() && AppletQuickItemPrivate::s_rootObjects.contains(context)) {
return AppletQuickItemPrivate::s_rootObjects.value(context);
} else {
return 0;
return nullptr;
}
}

View File

@ -94,7 +94,7 @@ class PLASMAQUICK_EXPORT AppletQuickItem : public QQuickItem
public:
AppletQuickItem(Plasma::Applet *applet, QQuickItem *parent = nullptr);
~AppletQuickItem();
~AppletQuickItem() Q_DECL_OVERRIDE;
////API NOT SUPPOSED TO BE USED BY QML
Plasma::Applet *applet() const;

View File

@ -81,7 +81,7 @@ ConfigCategory *ConfigModelPrivate::categories_at(QQmlListProperty<ConfigCategor
{
ConfigModel *model = qobject_cast<ConfigModel *>(prop->object);
if (!model || index >= model->d->categories.count() || index < 0) {
return 0;
return nullptr;
} else {
return model->d->categories.at(index);
}
@ -95,7 +95,7 @@ void ConfigModelPrivate::categories_append(QQmlListProperty<ConfigCategory> *pro
}
if (o->parent() == prop->object) {
o->setParent(0);
o->setParent(nullptr);
}
o->setParent(prop->object);
@ -126,7 +126,7 @@ void ConfigModelPrivate::clear()
{
q->beginResetModel();
while (!categories.isEmpty()) {
categories.first()->setParent(0);
categories.first()->setParent(nullptr);
categories.pop_front();
}
q->endResetModel();
@ -357,7 +357,7 @@ Plasma::Applet *ConfigModel::applet() const
QQmlListProperty<ConfigCategory> ConfigModel::categories()
{
return QQmlListProperty<ConfigCategory>(this, 0, ConfigModelPrivate::categories_append,
return QQmlListProperty<ConfigCategory>(this, nullptr, ConfigModelPrivate::categories_append,
ConfigModelPrivate::categories_count,
ConfigModelPrivate::categories_at,
ConfigModelPrivate::categories_clear);

View File

@ -73,8 +73,8 @@ public:
VisibleRole,
KCMRole
};
ConfigModel(QObject *parent = nullptr);
~ConfigModel();
explicit ConfigModel(QObject *parent = nullptr);
~ConfigModel() Q_DECL_OVERRIDE;
/**
* add a new category in the model
@ -109,7 +109,7 @@ public:
/**
* @param row the row for which the data will be returned
* @raturn the data of the specified row
* @return the data of the specified row
**/
Q_INVOKABLE QVariant get(int row) const;

View File

@ -76,7 +76,7 @@ public:
ConfigViewPrivate::ConfigViewPrivate(Plasma::Applet *appl, ConfigView *view)
: q(view),
applet(appl),
corona(0)
corona(nullptr)
{
}
@ -239,7 +239,7 @@ void ConfigViewPrivate::mainItemLoaded()
}
//Extract the representation's Layout, if any
QObject *layout = 0;
QObject *layout = nullptr;
//Search a child that has the needed Layout properties
//HACK: here we are not type safe, but is the only way to access to a pointer of Layout

View File

@ -59,7 +59,7 @@ public:
* @param parent the QWindow in which this ConfigView is parented to
**/
ConfigView(Plasma::Applet *applet, QWindow *parent = nullptr);
virtual ~ConfigView();
~ConfigView() Q_DECL_OVERRIDE;
virtual void init();

View File

@ -73,7 +73,7 @@ void ContainmentViewPrivate::setContainment(Plasma::Containment *cont)
Plasma::Types::FormFactor oldForm = formFactor();
if (containment) {
QObject::disconnect(containment, 0, q, 0);
QObject::disconnect(containment, nullptr, q, nullptr);
QObject *oldGraphicObject = containment->property("_plasma_graphicObject").value<QObject *>();
if (auto item = qobject_cast<QQuickItem*>(oldGraphicObject)) {
item->setVisible(false);

View File

@ -70,13 +70,13 @@ public:
DialogPrivate(Dialog *dialog)
: q(dialog),
location(Plasma::Types::BottomEdge),
frameSvgItem(0),
frameSvgItem(nullptr),
hasMask(false),
type(Dialog::Normal),
hideOnWindowDeactivate(false),
outputOnly(false),
visible(false),
componentComplete(dialog->parent() == 0),
componentComplete(dialog->parent() == nullptr),
backgroundHints(Dialog::StandardBackground)
{
hintsCommitTimer.setSingleShot(true);
@ -584,7 +584,7 @@ void DialogPrivate::updateInputShape()
if (outputOnly) {
// set input shape, so that it doesn't accept any input events
xcb_shape_rectangles(c, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT,
XCB_CLIP_ORDERING_UNSORTED, q->winId(), 0, 0, 0, NULL);
XCB_CLIP_ORDERING_UNSORTED, q->winId(), 0, 0, 0, nullptr);
} else {
// delete the shape
xcb_shape_mask(c, XCB_SHAPE_SO_INTERSECT, XCB_SHAPE_SK_INPUT,
@ -727,7 +727,7 @@ void DialogPrivate::setupWaylandIntegration()
Dialog::Dialog(QQuickItem *parent)
: QQuickWindow(parent ? parent->window() : 0),
: QQuickWindow(parent ? parent->window() : nullptr),
d(new DialogPrivate(this))
{
setClearBeforeRendering(true);
@ -774,12 +774,12 @@ void Dialog::setMainItem(QQuickItem *mainItem)
d->hintsCommitTimer.stop();
if (d->mainItem) {
disconnect(d->mainItem, 0, this, 0);
disconnect(d->mainItem, nullptr, this, nullptr);
d->mainItem->setVisible(false);
}
if (d->mainItemLayout) {
disconnect(d->mainItemLayout, 0, this, 0);
disconnect(d->mainItemLayout, nullptr, this, nullptr);
}
d->mainItem = mainItem;
@ -793,7 +793,7 @@ void Dialog::setMainItem(QQuickItem *mainItem)
d->slotMainItemSizeChanged();
//Extract the representation's Layout, if any
QObject *layout = 0;
QObject *layout = nullptr;
setMinimumSize(QSize(0, 0));
setMaximumSize(QSize(DIALOGSIZE_MAX, DIALOGSIZE_MAX));
@ -871,16 +871,12 @@ QPoint Dialog::popupPosition(QQuickItem *item, const QSize &size)
switch (d->location) {
case Plasma::Types::TopEdge:
return QPoint(screen->availableGeometry().center().x() - size.width() / 2, screen->availableGeometry().y());
break;
case Plasma::Types::LeftEdge:
return QPoint(screen->availableGeometry().x(), screen->availableGeometry().center().y() - size.height() / 2);
break;
case Plasma::Types::RightEdge:
return QPoint(screen->availableGeometry().right() - size.width(), screen->availableGeometry().center().y() - size.height() / 2);
break;
case Plasma::Types::BottomEdge:
return QPoint(screen->availableGeometry().center().x() - size.width() / 2, screen->availableGeometry().bottom() - size.height());
break;
//Default center in the screen
default:
return screen->geometry().center() - QPoint(size.width() / 2, size.height() / 2);

View File

@ -167,8 +167,8 @@ public:
};
Q_ENUM(BackgroundHints)
Dialog(QQuickItem *parent = nullptr);
~Dialog();
explicit Dialog(QQuickItem *parent = nullptr);
~Dialog() Q_DECL_OVERRIDE;
//PROPERTIES ACCESSORS
QQuickItem *mainItem() const;

View File

@ -166,7 +166,7 @@ void DialogShadows::removeWindow(const QWindow *window)
}
d->m_windows.remove(window);
disconnect(window, 0, this, 0);
disconnect(window, nullptr, this, nullptr);
d->clearShadow(window);
if (d->m_windows.isEmpty()) {

View File

@ -49,7 +49,7 @@ class PLASMAQUICK_EXPORT PackageUrlInterceptor: public QQmlAbstractUrlIntercepto
{
public:
PackageUrlInterceptor(QQmlEngine *engine, const KPackage::Package &p);
virtual ~PackageUrlInterceptor();
~PackageUrlInterceptor() Q_DECL_OVERRIDE;
void addAllowedPath(const QString &path);
void removeAllowedPath(const QString &path);

View File

@ -31,7 +31,7 @@ class PLASMAQUICK_DEPRECATED_EXPORT ShellPluginLoader : public Plasma::PluginLoa
{
public:
ShellPluginLoader();
~ShellPluginLoader();
~ShellPluginLoader() Q_DECL_OVERRIDE;
static void init();

View File

@ -73,7 +73,7 @@ void ViewPrivate::setContainment(Plasma::Containment *cont)
Plasma::Types::FormFactor oldForm = formFactor();
if (containment) {
QObject::disconnect(containment, 0, q, 0);
QObject::disconnect(containment, nullptr, q, nullptr);
QObject *oldGraphicObject = containment->property("_plasma_graphicObject").value<QObject *>();
if (oldGraphicObject) {
// qDebug() << "Old graphics Object:" << oldGraphicObject << "Old containment" << containment.data();

View File

@ -48,15 +48,15 @@ Q_DECLARE_METATYPE(AppletInterface *)
AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariantList &args, QQuickItem *parent)
: AppletQuickItem(script->applet(), parent),
m_configuration(0),
m_configuration(nullptr),
m_appletScriptEngine(script),
m_toolTipTextFormat(0),
m_toolTipItem(0),
m_toolTipItem(nullptr),
m_args(args),
m_backgroundHints(Plasma::Types::StandardBackground),
m_hideOnDeactivate(true),
m_oldKeyboardShortcut(0),
m_dummyNativeInterface(0),
m_dummyNativeInterface(nullptr),
m_positionBeforeRemoval(QPointF(-1, -1))
{
qmlRegisterType<QAction>();

View File

@ -240,7 +240,7 @@ class AppletInterface : public PlasmaQuick::AppletQuickItem
public:
AppletInterface(DeclarativeAppletScript *script, const QVariantList &args = QVariantList(), QQuickItem *parent = nullptr);
~AppletInterface();
~AppletInterface() Q_DECL_OVERRIDE;
//API not intended for the QML part

View File

@ -60,8 +60,8 @@
ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent, const QVariantList &args)
: AppletInterface(parent, args),
m_wallpaperInterface(0),
m_activityInfo(0),
m_wallpaperInterface(nullptr),
m_activityInfo(nullptr),
m_wheelDelta(0),
m_editMode(false)
{
@ -122,7 +122,7 @@ void ContainmentInterface::init()
QVariantHash toolboxProperties;
toolboxProperties[QStringLiteral("parent")] = QVariant::fromValue(this);
QObject *toolBoxObject = qmlObject()->createObjectFromSource(pkg.fileUrl("mainscript"), 0, toolboxProperties);
QObject *toolBoxObject = qmlObject()->createObjectFromSource(pkg.fileUrl("mainscript"), nullptr, toolboxProperties);
if (toolBoxObject && containmentGraphicObject) {
containmentGraphicObject->setProperty("toolBox", QVariant::fromValue(toolBoxObject));
}
@ -567,7 +567,7 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
void ContainmentInterface::clearDataForMimeJob(KIO::Job *job)
{
#ifndef PLASMA_NO_KIO
QObject::disconnect(job, 0, this, 0);
QObject::disconnect(job, nullptr, this, nullptr);
m_dropPoints.remove(job);
QMenu *choices = m_dropMenus.take(job);
m_dropJobs.remove(job);
@ -881,7 +881,7 @@ void ContainmentInterface::loadWallpaper()
} else {
if (m_wallpaperInterface) {
m_wallpaperInterface->deleteLater();
m_wallpaperInterface = 0;
m_wallpaperInterface = nullptr;
}
}
}
@ -989,14 +989,14 @@ void ContainmentInterface::mousePressEvent(QMouseEvent *event)
}
//FIXME: very inefficient appletAt() implementation
Plasma::Applet *applet = 0;
Plasma::Applet *applet = nullptr;
foreach (QObject *appletObject, m_appletInterfaces) {
if (AppletInterface *ai = qobject_cast<AppletInterface *>(appletObject)) {
if (ai->isVisible() && ai->contains(ai->mapFromItem(this, event->posF()))) {
applet = ai->applet();
break;
} else {
ai = 0;
ai = nullptr;
}
}
}

View File

@ -113,12 +113,12 @@ public:
/**
* Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button
*/
Q_INVOKABLE void processMimeData(QMimeData *data, int x, int y, KIO::DropJob *dropJob = 0);
Q_INVOKABLE void processMimeData(QMimeData *data, int x, int y, KIO::DropJob *dropJob = nullptr);
/**
* Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button
*/
Q_INVOKABLE void processMimeData(QObject *data, int x, int y, KIO::DropJob *dropJob = 0);
Q_INVOKABLE void processMimeData(QObject *data, int x, int y, KIO::DropJob *dropJob = nullptr);
/**
* Search for a containment at those coordinates.

View File

@ -48,7 +48,7 @@
DeclarativeAppletScript::DeclarativeAppletScript(QObject *parent, const QVariantList &args)
: Plasma::AppletScript(parent),
m_interface(0),
m_interface(nullptr),
m_args(args)
{
//qmlRegisterType<AppletInterface>();

View File

@ -34,7 +34,7 @@ class DeclarativeAppletScript : public Plasma::AppletScript
public:
DeclarativeAppletScript(QObject *parent, const QVariantList &args);
~DeclarativeAppletScript();
~DeclarativeAppletScript() Q_DECL_OVERRIDE;
QString filePath(const QString &type, const QString &file) const;

View File

@ -40,9 +40,9 @@ QHash<QObject *, WallpaperInterface *> WallpaperInterface::s_rootObjects = QHash
WallpaperInterface::WallpaperInterface(ContainmentInterface *parent)
: QQuickItem(parent),
m_containmentInterface(parent),
m_qmlObject(0),
m_configuration(0),
m_configLoader(0)
m_qmlObject(nullptr),
m_configuration(nullptr),
m_configLoader(nullptr)
{
m_actions = new KActionCollection(this);
@ -104,7 +104,7 @@ KConfigLoader *WallpaperInterface::configScheme()
cfg = KConfigGroup(&cfg, m_wallpaperPlugin);
if (xmlPath.isEmpty()) {
m_configLoader = new KConfigLoader(cfg, 0, this);
m_configLoader = new KConfigLoader(cfg, nullptr, this);
} else {
QFile file(xmlPath);
m_configLoader = new KConfigLoader(cfg, &file, this);
@ -140,8 +140,8 @@ void WallpaperInterface::syncWallpaperPackage()
if (m_configLoader) m_configLoader->deleteLater();
if (m_configuration) m_configuration->deleteLater();
m_configLoader = 0;
m_configuration = 0;
m_configLoader = nullptr;
m_configuration = nullptr;
if (configScheme()) {
m_configuration = new KDeclarative::ConfigPropertyMap(configScheme(), this);
}
@ -180,7 +180,7 @@ void WallpaperInterface::loadFinished()
qWarning() << "Error loading the wallpaper" << m_qmlObject->mainComponent()->errors();
s_rootObjects.remove(m_qmlObject->engine());
m_qmlObject->deleteLater();
m_qmlObject = 0;
m_qmlObject = nullptr;
} else {
qWarning() << "Error loading the wallpaper, package not found";