diff --git a/kdecore/kernel/kcomponentdata.cpp b/kdecore/kernel/kcomponentdata.cpp index b74e8a51..eb6e8de1 100644 --- a/kdecore/kernel/kcomponentdata.cpp +++ b/kdecore/kernel/kcomponentdata.cpp @@ -168,7 +168,6 @@ KStandardDirs *KComponentData::dirs() const { Q_ASSERT(d); d->lazyInit(*this); - return d->dirs; } @@ -176,7 +175,6 @@ const KSharedConfig::Ptr &KComponentData::config() const { Q_ASSERT(d); d->lazyInit(*this); - return d->sharedConfig; } diff --git a/kdecore/kernel/kcomponentdata_p.h b/kdecore/kernel/kcomponentdata_p.h index f50aeebe..616ea946 100644 --- a/kdecore/kernel/kcomponentdata_p.h +++ b/kdecore/kernel/kcomponentdata_p.h @@ -31,7 +31,7 @@ class KComponentDataPrivate { public: KComponentDataPrivate(const KAboutData &aboutData_) - : dirs(0), + : dirs(nullptr), aboutData(aboutData_), refCount(1) { @@ -40,7 +40,7 @@ public: shouldRemoveCatalog = true; } else { shouldRemoveCatalog = false; - } + } } ~KComponentDataPrivate() diff --git a/kdecore/kernel/kglobal.cpp b/kdecore/kernel/kglobal.cpp index 03cc88aa..351b4650 100644 --- a/kdecore/kernel/kglobal.cpp +++ b/kdecore/kernel/kglobal.cpp @@ -53,8 +53,8 @@ class KGlobalPrivate { public: inline KGlobalPrivate() - : locale(0), - charsets(0), + : locale(nullptr), + charsets(nullptr), localeIsFromFakeComponent(false) { // the umask is read here before any threads are created to avoid race conditions @@ -66,9 +66,9 @@ class KGlobalPrivate inline ~KGlobalPrivate() { delete locale; - locale = 0; + locale = nullptr; delete charsets; - charsets = 0; + charsets = nullptr; } KComponentData activeComponent; @@ -275,10 +275,9 @@ QString KGlobal::caption() } else if (d->mainComponent.isValid() && d->mainComponent.aboutData()) { // We have some about data ? return d->mainComponent.aboutData()->programName(); - } else { - // Last resort : application name - return QCoreApplication::instance()->applicationName(); } + // Last resort : application name + return QCoreApplication::applicationName(); } /** diff --git a/kdecore/kernel/ktoolinvocation.cpp b/kdecore/kernel/ktoolinvocation.cpp index 23927c3f..9cd2e2c8 100644 --- a/kdecore/kernel/ktoolinvocation.cpp +++ b/kdecore/kernel/ktoolinvocation.cpp @@ -215,7 +215,7 @@ void KToolInvocation::invokeHelp(const QString &anchor, QString appname; QString docPath; if (_appname.isEmpty()) { - appname = QCoreApplication::instance()->applicationName(); + appname = QCoreApplication::applicationName(); } else { appname = _appname; } diff --git a/kdeui/actions/kstandardaction.cpp b/kdeui/actions/kstandardaction.cpp index d1f3763d..b4813deb 100644 --- a/kdeui/actions/kstandardaction.cpp +++ b/kdeui/actions/kstandardaction.cpp @@ -119,7 +119,7 @@ KAction *create(StandardAction id, const QObject *recvr, const char *slot, QObje else aboutData = KGlobal::aboutData(); */ - QString appName = (aboutData) ? aboutData->programName() : qApp->applicationName(); + QString appName = (aboutData) ? aboutData->programName() : QCoreApplication::applicationName(); sLabel = i18n( pInfo->psLabel, appName ); } break; diff --git a/kdeui/kernel/kapplication.cpp b/kdeui/kernel/kapplication.cpp index 786b09d0..969dff31 100644 --- a/kdeui/kernel/kapplication.cpp +++ b/kdeui/kernel/kapplication.cpp @@ -292,7 +292,7 @@ QString KApplicationPrivate::sessionConfigName() const QString sessKey = q->sessionKey(); if ( sessKey.isEmpty() && !sessionKey.isEmpty() ) sessKey = sessionKey; - return QString::fromLatin1("session/%1_%2_%3").arg(q->applicationName()).arg(q->sessionId()).arg(sessKey); + return QString::fromLatin1("session/%1_%2_%3").arg(QCoreApplication::applicationName()).arg(q->sessionId()).arg(sessKey); } #ifdef Q_WS_X11 @@ -440,7 +440,7 @@ void KApplicationPrivate::init() reversedDomain.prepend(s); } const QString pidSuffix = QString::number( getpid() ).prepend( QLatin1String("-") ); - const QString serviceName = reversedDomain + q->applicationName() + pidSuffix; + const QString serviceName = reversedDomain + QCoreApplication::applicationName() + pidSuffix; if ( bus->registerService(serviceName) == QDBusConnectionInterface::ServiceNotRegistered ) { kError() << "Couldn't register name '" << serviceName << "' with DBUS - another process owns it already!"; ::exit(126); @@ -456,7 +456,7 @@ void KApplicationPrivate::init() KSharedConfig::Ptr config = componentData.config(); QByteArray readOnly = qgetenv("KDE_HOME_READONLY"); - if (readOnly.isEmpty() && q->applicationName() != QLatin1String("kdialog")) + if (readOnly.isEmpty() && QCoreApplication::applicationName() != QLatin1String("kdialog")) { config->isConfigWritable(true); } @@ -477,7 +477,7 @@ void KApplicationPrivate::init() // HACK: KLauncher creates KApplication instance and KToolInvocation creates KLauncher instance // (i.e recursion) - if (q->applicationName() != QLatin1String("klauncher")) { + if (QCoreApplication::applicationName() != QLatin1String("klauncher")) { q->connect( KToolInvocation::self(), SIGNAL(kapplication_hook(QStringList&,QByteArray&)), q, SLOT(_k_KToolInvocation_hook(QStringList&,QByteArray&)) diff --git a/kdeui/widgets/kmainwindow.cpp b/kdeui/widgets/kmainwindow.cpp index 1516b675..399dd56f 100644 --- a/kdeui/widgets/kmainwindow.cpp +++ b/kdeui/widgets/kmainwindow.cpp @@ -352,7 +352,7 @@ void KMainWindowPrivate::polish(KMainWindow *q) q->winId(); // workaround for setWindowRole() crashing, and set also window role, just in case TT q->setWindowRole( s ); // will keep insisting that object name suddenly should not be used for window role - dbusName = '/' + qApp->applicationName() + '/' + q->objectName().replace(QLatin1Char('/'), QLatin1Char('_')); + dbusName = '/' + QCoreApplication::applicationName() + '/' + q->objectName().replace(QLatin1Char('/'), QLatin1Char('_')); // Clean up for dbus usage: any non-alphanumeric char should be turned into '_' const int len = dbusName.length(); for ( int i = 0; i < len; ++i ) {