diff --git a/activities.h b/activities.h index 8717611656..f51635e0c6 100644 --- a/activities.h +++ b/activities.h @@ -122,7 +122,7 @@ inline QString Activities::nullUuid() { // cloned from kactivities/src/lib/core/consumer.cpp - return QString("00000000-0000-0000-0000-000000000000"); + return QStringLiteral("00000000-0000-0000-0000-000000000000"); } } diff --git a/client.cpp b/client.cpp index ebcec9929b..89a08ebf6b 100644 --- a/client.cpp +++ b/client.cpp @@ -1361,18 +1361,18 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp) if (!ask) { if (!clientMachine()->isLocal()) { QStringList lst; - lst << clientMachine()->hostName() << "kill" << QString::number(pid); - QProcess::startDetached("xon", lst); + lst << QString::fromUtf8(clientMachine()->hostName()) << QStringLiteral("kill") << QString::number(pid); + QProcess::startDetached(QStringLiteral("xon"), lst); } else ::kill(pid, SIGTERM); } else { - QString hostname = clientMachine()->isLocal() ? "localhost" : clientMachine()->hostName(); - QProcess::startDetached(KStandardDirs::findExe("kwin_killer_helper"), - QStringList() << "--pid" << QByteArray().setNum(unsigned(pid)) << "--hostname" << hostname - << "--windowname" << caption() - << "--applicationname" << resourceClass() - << "--wid" << QString::number(window()) - << "--timestamp" << QString::number(timestamp), + QString hostname = clientMachine()->isLocal() ? QStringLiteral("localhost") : QString::fromUtf8(clientMachine()->hostName()); + QProcess::startDetached(KStandardDirs::findExe(QStringLiteral("kwin_killer_helper")), + QStringList() << QStringLiteral("--pid") << QString::number(unsigned(pid)) << QStringLiteral("--hostname") << hostname + << QStringLiteral("--windowname") << caption() + << QStringLiteral("--applicationname") << QString::fromUtf8(resourceClass()) + << QStringLiteral("--wid") << QString::number(window()) + << QStringLiteral("--timestamp") << QString::number(timestamp), QString(), &m_killHelperPID); } } @@ -1501,9 +1501,9 @@ void Client::setOnActivity(const QString &activity, bool enable) void Client::setOnActivities(QStringList newActivitiesList) { #ifdef KWIN_BUILD_ACTIVITIES - QString joinedActivitiesList = newActivitiesList.join(","); + QString joinedActivitiesList = newActivitiesList.join(QStringLiteral(",")); joinedActivitiesList = rules()->checkActivity(joinedActivitiesList, false); - newActivitiesList = joinedActivitiesList.split(',', QString::SkipEmptyParts); + newActivitiesList = joinedActivitiesList.split(QStringLiteral(","), QString::SkipEmptyParts); QStringList allActivities = Activities::self()->all(); if ( newActivitiesList.isEmpty() || @@ -1739,7 +1739,7 @@ void Client::setCaption(const QString& _s, bool force) QString s(_s); for (int i = 0; i < s.length(); ++i) if (!s[i].isPrint()) - s[i] = QChar(' '); + s[i] = QChar(u' '); cap_normal = s; #ifdef KWIN_BUILD_SCRIPTING if (options->condensedTitle()) { @@ -1747,21 +1747,21 @@ void Client::setCaption(const QString& _s, bool force) static QScriptProgram stripTitle; static QScriptValue script; if (stripTitle.isNull()) { - const QString scriptFile = KStandardDirs::locate("data", QLatin1String(KWIN_NAME) + "/stripTitle.js"); + const QString scriptFile = KStandardDirs::locate("data", QStringLiteral(KWIN_NAME) + QStringLiteral("/stripTitle.js")); if (!scriptFile.isEmpty()) { QFile f(scriptFile); if (f.open(QIODevice::ReadOnly|QIODevice::Text)) { f.reset(); - stripTitle = QScriptProgram(QString::fromLocal8Bit(f.readAll()), "stripTitle.js"); + stripTitle = QScriptProgram(QString::fromLocal8Bit(f.readAll()), QStringLiteral("stripTitle.js")); f.close(); } } if (stripTitle.isNull()) - stripTitle = QScriptProgram("(function(title, wm_name, wm_class){ return title ; })", "stripTitle.js"); + stripTitle = QScriptProgram(QStringLiteral("(function(title, wm_name, wm_class){ return title ; })"), QStringLiteral("stripTitle.js")); script = engine.evaluate(stripTitle); } QScriptValueList args; - args << _s << QString(resourceName()) << QString(resourceClass()); + args << _s << QString::fromUtf8(resourceName()) << QString::fromUtf8(resourceClass()); s = script.call(QScriptValue(), args).toString(); } #endif @@ -1775,17 +1775,17 @@ void Client::setCaption(const QString& _s, bool force) QString machine_suffix; if (!options->condensedTitle()) { // machine doesn't qualify for "clean" if (clientMachine()->hostName() != ClientMachine::localhost() && !clientMachine()->isLocal()) - machine_suffix = QString(" <@") + clientMachine()->hostName() + '>' + LRM; + machine_suffix = QStringLiteral(" <@") + QString::fromUtf8(clientMachine()->hostName()) + QStringLiteral(">") + LRM; } - QString shortcut_suffix = !shortcut().isEmpty() ? (" {" + shortcut().toString() + '}') : QString(); + QString shortcut_suffix = !shortcut().isEmpty() ? (QStringLiteral(" {") + shortcut().toString() + QStringLiteral("}")) : QString(); cap_suffix = machine_suffix + shortcut_suffix; if ((!isSpecialWindow() || isToolbar()) && workspace()->findClient(FetchNameInternalPredicate(this))) { int i = 2; do { - cap_suffix = machine_suffix + " <" + QString::number(i) + '>' + LRM; + cap_suffix = machine_suffix + QStringLiteral(" <") + QString::number(i) + QStringLiteral(">") + LRM; i++; } while (workspace()->findClient(FetchNameInternalPredicate(this))); - info->setVisibleName(caption().toUtf8()); + info->setVisibleName(caption().toUtf8().constData()); reset_name = false; } if ((was_suffix && cap_suffix.isEmpty()) || reset_name) { @@ -1794,7 +1794,7 @@ void Client::setCaption(const QString& _s, bool force) info->setVisibleIconName(""); } else if (!cap_suffix.isEmpty() && !cap_iconic.isEmpty()) // Keep the same suffix in iconic name if it's set - info->setVisibleIconName(QString(cap_iconic + cap_suffix).toUtf8()); + info->setVisibleIconName(QString(cap_iconic + cap_suffix).toUtf8().constData()); emit captionChanged(); } @@ -1816,7 +1816,7 @@ void Client::fetchIconicName() cap_iconic = s; if (!cap_suffix.isEmpty()) { if (!cap_iconic.isEmpty()) // Keep the same suffix in iconic name if it's set - info->setVisibleIconName(QString(s + cap_suffix).toUtf8()); + info->setVisibleIconName(QString(s + cap_suffix).toUtf8().constData()); else if (was_set) info->setVisibleIconName(""); } @@ -2347,7 +2347,7 @@ QPixmap* kwin_get_menu_pix_hack() { static QPixmap p; if (p.isNull()) - p = SmallIcon("bx2"); + p = SmallIcon(QStringLiteral("bx2")); return &p; } @@ -2357,7 +2357,7 @@ void Client::checkActivities() QStringList newActivitiesList; QByteArray prop = getStringProperty(window(), atoms->activities); activitiesDefined = !prop.isEmpty(); - if (prop == Activities::nullUuid()) { + if (QString::fromUtf8(prop) == Activities::nullUuid()) { //copied from setOnAllActivities to avoid a redundant XChangeProperty. if (!activityList.isEmpty()) { activityList.clear(); @@ -2374,7 +2374,7 @@ void Client::checkActivities() return; } - newActivitiesList = QString(prop).split(','); + newActivitiesList = QString::fromUtf8(prop).split(QStringLiteral(",")); if (newActivitiesList == activityList) return; //expected change, it's ok. diff --git a/client_machine.cpp b/client_machine.cpp index 6c12a2b8cd..a45f6d03b0 100644 --- a/client_machine.cpp +++ b/client_machine.cpp @@ -98,8 +98,8 @@ void GetAddrInfo::resolve() // TODO: C++11 nullptr const char* nullPtr = NULL; - m_watcher->setFuture(QtConcurrent::run(getaddrinfo, m_hostName, nullPtr, m_addressHints, &m_address)); - m_ownAddressWatcher->setFuture(QtConcurrent::run(getaddrinfo, getHostName(), nullPtr, m_addressHints, &m_ownAddress)); + m_watcher->setFuture(QtConcurrent::run(getaddrinfo, m_hostName.constData(), nullPtr, m_addressHints, &m_address)); + m_ownAddressWatcher->setFuture(QtConcurrent::run(getaddrinfo, getHostName().constData(), nullPtr, m_addressHints, &m_ownAddress)); } void GetAddrInfo::slotResolved() diff --git a/composite.cpp b/composite.cpp index b4a0433196..a2a59c1611 100644 --- a/composite.cpp +++ b/composite.cpp @@ -93,8 +93,8 @@ Compositor::Compositor(QObject* workspace) qRegisterMetaType("Compositor::SuspendReason"); new CompositingAdaptor(this); QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/Compositor", this); - dbus.registerService("org.kde.kwin.Compositing"); + dbus.registerObject(QStringLiteral("/Compositor"), this); + dbus.registerService(QStringLiteral("org.kde.kwin.Compositing")); connect(&unredirectTimer, SIGNAL(timeout()), SLOT(delayedCheckUnredirect())); connect(&compositeResetTimer, SIGNAL(timeout()), SLOT(restart())); connect(workspace, SIGNAL(configChanged()), SLOT(slotConfigChanged())); @@ -183,7 +183,7 @@ void Compositor::slotCompositingOptionsInitialized() // Some broken drivers crash on glXQuery() so to prevent constant KWin crashes: KSharedConfigPtr unsafeConfigPtr = KGlobal::config(); KConfigGroup unsafeConfig(unsafeConfigPtr, "Compositing"); - const QString openGLIsUnsafe = "OpenGLIsUnsafe" + (is_multihead ? QString::number(screen_number) : ""); + const QString openGLIsUnsafe = QStringLiteral("OpenGLIsUnsafe") + (is_multihead ? QString::number(screen_number) : QString()); if (unsafeConfig.readEntry(openGLIsUnsafe, false)) kWarning(1212) << "KWin has detected that your OpenGL library is unsafe to use"; else { @@ -431,13 +431,13 @@ void Compositor::toggleCompositing() if (m_suspended) { // when disabled show a shortcut how the user can get back compositing QString shortcut, message; - if (KAction* action = qobject_cast(Workspace::self()->actionCollection()->action("Suspend Compositing"))) + if (KAction* action = qobject_cast(Workspace::self()->actionCollection()->action(QStringLiteral("Suspend Compositing")))) shortcut = action->globalShortcut().primary().toString(QKeySequence::NativeText); if (!shortcut.isEmpty()) { // display notification only if there is the shortcut message = i18n("Desktop effects have been suspended by another application.
" "You can resume using the '%1' shortcut.", shortcut); - KNotification::event("compositingsuspendeddbus", message); + KNotification::event(QStringLiteral("compositingsuspendeddbus"), message); } } } @@ -780,22 +780,22 @@ bool Compositor::isOpenGLBroken() const QString Compositor::compositingType() const { if (!hasScene()) { - return "none"; + return QStringLiteral("none"); } switch (m_scene->compositingType()) { case XRenderCompositing: - return "xrender"; + return QStringLiteral("xrender"); case OpenGL1Compositing: - return "gl1"; + return QStringLiteral("gl1"); case OpenGL2Compositing: #ifdef KWIN_HAVE_OPENGLES - return "gles"; + return QStringLiteral("gles"); #else - return "gl2"; + return QStringLiteral("gl2"); #endif case NoCompositing: default: - return "none"; + return QStringLiteral("none"); } } diff --git a/compositingprefs.cpp b/compositingprefs.cpp index f46dac455e..349e70e4c3 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -52,7 +52,7 @@ CompositingPrefs::~CompositingPrefs() bool CompositingPrefs::openGlIsBroken() { - const QString unsafeKey("OpenGLIsUnsafe" + (is_multihead ? QString::number(screen_number) : "")); + const QString unsafeKey(QStringLiteral("OpenGLIsUnsafe") + (is_multihead ? QString::number(screen_number) : QString())); return KConfigGroup(KGlobal::config(), "Compositing").readEntry(unsafeKey, false); } @@ -60,8 +60,8 @@ bool CompositingPrefs::compositingPossible() { // first off, check whether we figured that we'll crash on detection because of a buggy driver KConfigGroup gl_workaround_group(KGlobal::config(), "Compositing"); - const QString unsafeKey("OpenGLIsUnsafe" + (is_multihead ? QString::number(screen_number) : "")); - if (gl_workaround_group.readEntry("Backend", "OpenGL") == "OpenGL" && + const QString unsafeKey(QStringLiteral("OpenGLIsUnsafe") + (is_multihead ? QString::number(screen_number) : QString())); + if (gl_workaround_group.readEntry("Backend", "OpenGL") == QStringLiteral("OpenGL") && gl_workaround_group.readEntry(unsafeKey, false)) return false; @@ -90,8 +90,8 @@ QString CompositingPrefs::compositingNotPossibleReason() { // first off, check whether we figured that we'll crash on detection because of a buggy driver KConfigGroup gl_workaround_group(KGlobal::config(), "Compositing"); - const QString unsafeKey("OpenGLIsUnsafe" + (is_multihead ? QString::number(screen_number) : "")); - if (gl_workaround_group.readEntry("Backend", "OpenGL") == "OpenGL" && + const QString unsafeKey(QStringLiteral("OpenGLIsUnsafe") + (is_multihead ? QString::number(screen_number) : QString())); + if (gl_workaround_group.readEntry("Backend", "OpenGL") == QStringLiteral("OpenGL") && gl_workaround_group.readEntry(unsafeKey, false)) return i18n("OpenGL compositing (the default) has crashed KWin in the past.
" "This was most likely due to a driver bug." @@ -149,7 +149,7 @@ void CompositingPrefs::detect() // environment variable. // Direct rendering is preferred, since not all OpenGL extensions are // available with indirect rendering. - const QString opengl_test = KStandardDirs::findExe("kwin_opengl_test"); + const QString opengl_test = KStandardDirs::findExe(QStringLiteral("kwin_opengl_test")); if (QProcess::execute(opengl_test) != 0) { mEnableDirectRendering = false; setenv("LIBGL_ALWAYS_INDIRECT", "1", true); diff --git a/dbusinterface.cpp b/dbusinterface.cpp index 10ea3f2f5e..98eb55b664 100644 --- a/dbusinterface.cpp +++ b/dbusinterface.cpp @@ -46,15 +46,15 @@ DBusInterface::DBusInterface(QObject *parent) (void) new KWinAdaptor(this); QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/KWin", this); - if (!dbus.registerService("org.kde.KWin")) { - QDBusServiceWatcher *dog = new QDBusServiceWatcher("org.kde.KWin", dbus, QDBusServiceWatcher::WatchForUnregistration, this); + dbus.registerObject(QStringLiteral("/KWin"), this); + if (!dbus.registerService(QStringLiteral("org.kde.KWin"))) { + QDBusServiceWatcher *dog = new QDBusServiceWatcher(QStringLiteral("org.kde.KWin"), dbus, QDBusServiceWatcher::WatchForUnregistration, this); connect (dog, SIGNAL(serviceUnregistered(QString)), SLOT(becomeKWinService(QString))); } connect(Compositor::self(), SIGNAL(compositingToggled(bool)), SIGNAL(compositingToggled(bool))); - dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", + dbus.connect(QString(), QStringLiteral("/KWin"), QStringLiteral("org.kde.KWin"), QStringLiteral("reloadConfig"), Workspace::self(), SLOT(slotReloadConfig())); - dbus.connect(QString(), "/KWin", "org.kde.KWin", "reinitCompositing", + dbus.connect(QString(), QStringLiteral("/KWin"), QStringLiteral("org.kde.KWin"), QStringLiteral("reinitCompositing"), Compositor::self(), SLOT(slotReinitialize())); } @@ -62,16 +62,16 @@ void DBusInterface::becomeKWinService(const QString &service) { // TODO: this watchdog exists to make really safe that we at some point get the service // but it's probably no longer needed since we explicitly unregister the service with the deconstructor - if (service == "org.kde.KWin" && QDBusConnection::sessionBus().registerService("org.kde.KWin") && sender()) { + if (service == QStringLiteral("org.kde.KWin") && QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.KWin")) && sender()) { sender()->deleteLater(); // bye doggy :'( } } DBusInterface::~DBusInterface() { - QDBusConnection::sessionBus().unregisterService("org.kde.KWin"); // this is the long standing legal service + QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.KWin")); // this is the long standing legal service // KApplication automatically also grabs org.kde.kwin, so it's often been used externally - ensure to free it as well - QDBusConnection::sessionBus().unregisterService("org.kde.kwin"); + QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.kwin")); } void DBusInterface::circulateDesktopApplications() diff --git a/decorations.cpp b/decorations.cpp index 19560a580c..ea539c92cb 100644 --- a/decorations.cpp +++ b/decorations.cpp @@ -38,12 +38,12 @@ DecorationPlugin::DecorationPlugin(QObject *parent) , KDecorationPlugins(KGlobal::config()) , m_disabled(false) { - defaultPlugin = "kwin3_oxygen"; + defaultPlugin = QStringLiteral("kwin3_oxygen"); #ifndef KWIN_BUILD_OXYGEN - defaultPlugin = "kwin3_aurorae"; + defaultPlugin = QStringLiteral("kwin3_aurorae"); #endif #ifdef KWIN_BUILD_DECORATIONS - loadPlugin(""); // load the plugin specified in cfg file + loadPlugin(QString()); // load the plugin specified in cfg file #else setDisabled(true); #endif @@ -157,30 +157,30 @@ void DecorationPlugin::resetCompositing() QString DecorationPlugin::supportInformation() { if (m_disabled) { - return "Decoration Plugin disabled\n"; + return QStringLiteral("Decoration Plugin disabled\n"); } QString support; - support.append("Current Plugin: "); + support.append(QStringLiteral("Current Plugin: ")); support.append(currentPlugin()); - support.append('\n'); + support.append(QStringLiteral("\n")); - support.append("Shadows: "); - support.append(hasShadows() ? "yes\n" : "no\n"); + support.append(QStringLiteral("Shadows: ")); + support.append(hasShadows() ? QStringLiteral("yes\n") : QStringLiteral("no\n")); - support.append("Alpha: "); - support.append(hasAlpha() ? "yes\n" : "no\n"); + support.append(QStringLiteral("Alpha: ")); + support.append(hasAlpha() ? QStringLiteral("yes\n") : QStringLiteral("no\n")); - support.append("Announces Alpha: "); - support.append(supportsAnnounceAlpha() ? "yes\n" : "no\n"); + support.append(QStringLiteral("Announces Alpha: ")); + support.append(supportsAnnounceAlpha() ? QStringLiteral("yes\n") : QStringLiteral("no\n")); - support.append("Tabbing: "); - support.append(supportsTabbing() ? "yes\n" : "no\n"); + support.append(QStringLiteral("Tabbing: ")); + support.append(supportsTabbing() ? QStringLiteral("yes\n") : QStringLiteral("no\n")); - support.append("Frame Overlap: "); - support.append(supportsFrameOverlap() ? "yes\n" : "no\n"); + support.append(QStringLiteral("Frame Overlap: ")); + support.append(supportsFrameOverlap() ? QStringLiteral("yes\n") : QStringLiteral("no\n")); - support.append("Blur Behind: "); - support.append(supportsBlurBehind() ? "yes\n" : "no\n"); + support.append(QStringLiteral("Blur Behind: ")); + support.append(supportsBlurBehind() ? QStringLiteral("yes\n") : QStringLiteral("no\n")); // TODO: Qt5 - read support information from Factory return support; } diff --git a/effects.cpp b/effects.cpp index 911eada70c..8265fe9bf9 100644 --- a/effects.cpp +++ b/effects.cpp @@ -76,7 +76,7 @@ along with this program. If not, see . namespace KWin { -static const QString SCREEN_LOCKER_SERVICE_NAME = QString("org.freedesktop.ScreenSaver"); +static const QString SCREEN_LOCKER_SERVICE_NAME = QStringLiteral("org.freedesktop.ScreenSaver"); ScreenLockerWatcher::ScreenLockerWatcher(QObject *parent) : QObject(parent) @@ -220,8 +220,8 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) { new EffectsAdaptor(this); QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/Effects", this); - dbus.registerService("org.kde.kwin.Effects"); + dbus.registerObject(QStringLiteral("/Effects"), this); + dbus.registerService(QStringLiteral("org.kde.kwin.Effects")); // init is important, otherwise causes crashes when quads are build before the first painting pass start m_currentBuildQuadsIterator = m_activeEffects.end(); @@ -303,7 +303,7 @@ void EffectsHandlerImpl::reconfigure() // perform querying for the services in a thread QFutureWatcher *watcher = new QFutureWatcher(this); connect(watcher, SIGNAL(finished()), this, SLOT(slotEffectsQueried())); - watcher->setFuture(QtConcurrent::run(KServiceTypeTrader::self(), &KServiceTypeTrader::query, QString("KWin/Effect"), QString())); + watcher->setFuture(QtConcurrent::run(KServiceTypeTrader::self(), &KServiceTypeTrader::query, QStringLiteral("KWin/Effect"), QString())); } void EffectsHandlerImpl::slotEffectsQueried() @@ -735,7 +735,7 @@ void EffectsHandlerImpl::stopMouseInterception(Effect *effect) void* EffectsHandlerImpl::getProxy(QString name) { // All effects start with "kwin4_effect_", prepend it to the name - name.prepend("kwin4_effect_"); + name.prepend(QStringLiteral("kwin4_effect_")); for (QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it) if ((*it).first == name) @@ -1276,11 +1276,11 @@ KLibrary* EffectsHandlerImpl::findEffectLibrary(KService* service) { QString libname = service->library(); #ifdef KWIN_HAVE_OPENGLES - if (libname.startsWith(QLatin1String("kwin4_effect_"))) { - libname.replace("kwin4_effect_", "kwin4_effect_gles_"); + if (libname.startsWith(QStringLiteral("kwin4_effect_"))) { + libname.replace(QStringLiteral("kwin4_effect_"), QStringLiteral("kwin4_effect_gles_")); } #endif - libname.replace("kwin", KWIN_NAME); + libname.replace(QStringLiteral("kwin"), QStringLiteral(KWIN_NAME)); KLibrary* library = new KLibrary(libname); if (!library) { kError(1212) << "couldn't open library for effect '" << @@ -1310,7 +1310,7 @@ QStringList EffectsHandlerImpl::loadedEffects() const QStringList EffectsHandlerImpl::listOfEffects() const { - KService::List offers = KServiceTypeTrader::self()->query("KWin/Effect"); + KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("KWin/Effect")); QStringList listOfModules; // First unload necessary effects foreach (const KService::Ptr & service, offers) { @@ -1339,15 +1339,15 @@ bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault) kDebug(1212) << "Trying to load " << name; QString internalname = name.toLower(); - QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(internalname); - KService::List offers = KServiceTypeTrader::self()->query("KWin/Effect", constraint); + QString constraint = QStringLiteral("[X-KDE-PluginInfo-Name] == '%1'").arg(internalname); + KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("KWin/Effect"), constraint); if (offers.isEmpty()) { kError(1212) << "Couldn't find effect " << name << endl; return false; } KService::Ptr service = offers.first(); - if (service->property("X-Plasma-API").toString() == "javascript") { + if (service->property(QStringLiteral("X-Plasma-API")).toString() == QStringLiteral("javascript")) { // this is a scripted effect - use different loader return loadScriptedEffect(name, service.data()); } @@ -1357,8 +1357,8 @@ bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault) return false; } - QString version_symbol = "effect_version_" + name; - KLibrary::void_function_ptr version_func = library->resolveFunction(version_symbol.toAscii()); + QString version_symbol = QStringLiteral("effect_version_") + name; + KLibrary::void_function_ptr version_func = library->resolveFunction(version_symbol.toAscii().constData()); if (version_func == NULL) { kWarning(1212) << "Effect " << name << " does not provide required API version, ignoring."; delete library; @@ -1376,13 +1376,13 @@ bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault) return false; } - const QString enabledByDefault_symbol = "effect_enabledbydefault_" + name; + const QString enabledByDefault_symbol = QStringLiteral("effect_enabledbydefault_") + name; KLibrary::void_function_ptr enabledByDefault_func = library->resolveFunction(enabledByDefault_symbol.toAscii().data()); - const QString supported_symbol = "effect_supported_" + name; + const QString supported_symbol = QStringLiteral("effect_supported_") + name; KLibrary::void_function_ptr supported_func = library->resolveFunction(supported_symbol.toAscii().data()); - const QString create_symbol = "effect_create_" + name; + const QString create_symbol = QStringLiteral("effect_create_") + name; KLibrary::void_function_ptr create_func = library->resolveFunction(create_symbol.toAscii().data()); if (supported_func) { @@ -1428,7 +1428,7 @@ bool EffectsHandlerImpl::loadEffect(const QString& name, bool checkDefault) Effect* e = create(); - effect_order.insert(service->property("X-KDE-Ordering").toInt(), EffectPair(name, e)); + effect_order.insert(service->property(QStringLiteral("X-KDE-Ordering")).toInt(), EffectPair(name, e)); effectsChanged(); effect_libraries[ name ] = library; @@ -1439,12 +1439,12 @@ bool EffectsHandlerImpl::loadScriptedEffect(const QString& name, KService *servi { #ifdef KWIN_BUILD_SCRIPTING const KDesktopFile df("services", service->entryPath()); - const QString scriptName = df.desktopGroup().readEntry("X-Plasma-MainScript", ""); + const QString scriptName = df.desktopGroup().readEntry(QStringLiteral("X-Plasma-MainScript"), QString()); if (scriptName.isEmpty()) { kDebug(1212) << "X-Plasma-MainScript not set"; return false; } - const QString scriptFile = KStandardDirs::locate("data", QLatin1String(KWIN_NAME) + "/effects/" + name + "/contents/" + scriptName); + const QString scriptFile = KStandardDirs::locate("data", QStringLiteral(KWIN_NAME) + QStringLiteral("/effects/") + name + QStringLiteral("/contents/") + scriptName); if (scriptFile.isNull()) { kDebug(1212) << "Could not locate the effect script"; return false; @@ -1454,7 +1454,7 @@ bool EffectsHandlerImpl::loadScriptedEffect(const QString& name, KService *servi kDebug(1212) << "Could not initialize scripted effect: " << name; return false; } - effect_order.insert(service->property("X-KDE-Ordering").toInt(), EffectPair(name, effect)); + effect_order.insert(service->property(QStringLiteral("X-KDE-Ordering")).toInt(), EffectPair(name, effect)); effectsChanged(); return true; #else @@ -1578,14 +1578,14 @@ QString EffectsHandlerImpl::supportInformation(const QString &name) const } for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if ((*it).first == name) { - QString support((*it).first + ":\n"); + QString support((*it).first + QStringLiteral(":\n")); const QMetaObject *metaOptions = (*it).second->metaObject(); for (int i=0; ipropertyCount(); ++i) { const QMetaProperty property = metaOptions->property(i); - if (QLatin1String(property.name()) == "objectName") { + if (QLatin1String(property.name()) == QLatin1String("objectName")) { continue; } - support.append(QLatin1String(property.name()) % ": " % (*it).second->property(property.name()).toString() % '\n'); + support.append(QString::fromUtf8(property.name()) + QStringLiteral(": ") + (*it).second->property(property.name()).toString() + QStringLiteral("\n")); } return support; } @@ -1601,7 +1601,7 @@ bool EffectsHandlerImpl::isScreenLocked() const QString EffectsHandlerImpl::debug(const QString& name, const QString& parameter) const { - QString internalName = name.startsWith("kwin4_effect_") ? name : "kwin4_effect_" + name; + QString internalName = name.startsWith(QStringLiteral("kwin4_effect_")) ? name : QStringLiteral("kwin4_effect_") + name; for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if ((*it).first == internalName) { return it->second->debug(parameter); @@ -1849,12 +1849,12 @@ EffectFrameImpl::EffectFrameImpl(EffectFrameStyle style, bool staticSize, QPoint , m_theme(new Plasma::Theme(this)) { if (m_style == EffectFrameStyled) { - m_frame.setImagePath("widgets/background"); + m_frame.setImagePath(QStringLiteral("widgets/background")); m_frame.setCacheAllRenderedFrames(true); connect(m_theme, SIGNAL(themeChanged()), this, SLOT(plasmaThemeChanged())); } - m_selection.setImagePath("widgets/viewitem"); - m_selection.setElementPrefix("hover"); + m_selection.setImagePath(QStringLiteral("widgets/viewitem")); + m_selection.setElementPrefix(QStringLiteral("hover")); m_selection.setCacheAllRenderedFrames(true); m_selection.setEnabledBorders(Plasma::FrameSvg::AllBorders); diff --git a/effects/blur/blur_config.cpp b/effects/blur/blur_config.cpp index 2a11d1a7be..ffc8e2801d 100644 --- a/effects/blur/blur_config.cpp +++ b/effects/blur/blur_config.cpp @@ -45,7 +45,7 @@ void BlurEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("blur"); + EffectsHandler::sendReloadMessage(QStringLiteral("blur")); } } // namespace KWin diff --git a/effects/blur/blurshader.cpp b/effects/blur/blurshader.cpp index 4d8d442a5b..ad108f7323 100644 --- a/effects/blur/blurshader.cpp +++ b/effects/blur/blurshader.cpp @@ -362,7 +362,7 @@ void ARBBlurShader::reset() bool ARBBlurShader::supported() { - if (!hasGLExtension("GL_ARB_fragment_program")) + if (!hasGLExtension(QStringLiteral("GL_ARB_fragment_program"))) return false; (void) glGetError(); // Clear the error state diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index dfce08f099..5313ea2fb7 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -68,15 +68,15 @@ CoverSwitchEffect::CoverSwitchEffect() captionFont.setPointSize(captionFont.pointSize() * 2); if (effects->compositingType() == OpenGL2Compositing) { - QString shadersDir = "kwin/shaders/1.10/"; + QString shadersDir = QStringLiteral("kwin/shaders/1.10/"); #ifdef KWIN_HAVE_OPENGLES const qint64 coreVersionNumber = kVersionNumber(3, 0); #else const qint64 coreVersionNumber = kVersionNumber(1, 40); #endif if (GLPlatform::instance()->glslVersion() >= coreVersionNumber) - shadersDir = "kwin/shaders/1.40/"; - const QString fragmentshader = KGlobal::dirs()->findResource("data", shadersDir + "coverswitch-reflection.glsl"); + shadersDir = QStringLiteral("kwin/shaders/1.40/"); + const QString fragmentshader = KGlobal::dirs()->findResource("data", shadersDir + QStringLiteral("coverswitch-reflection.glsl")); m_reflectionShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, fragmentshader); } else { m_reflectionShader = NULL; @@ -1010,7 +1010,7 @@ void CoverSwitchEffect::updateCaption() if (selected_window->isDesktop()) { captionFrame->setText(i18nc("Special entry in alt+tab list for minimizing all windows", "Show Desktop")); - static QPixmap pix = KIcon("user-desktop").pixmap(captionFrame->iconSize()); + static QPixmap pix = KIcon(QStringLiteral("user-desktop")).pixmap(captionFrame->iconSize()); captionFrame->setIcon(pix); } else { captionFrame->setText(selected_window->caption()); diff --git a/effects/coverswitch/coverswitch_config.cpp b/effects/coverswitch/coverswitch_config.cpp index 379bc49e35..15f3a750c2 100644 --- a/effects/coverswitch/coverswitch_config.cpp +++ b/effects/coverswitch/coverswitch_config.cpp @@ -50,7 +50,7 @@ CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariant void CoverSwitchEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("coverswitch"); + EffectsHandler::sendReloadMessage(QStringLiteral("coverswitch")); } } // namespace diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index ce6587c6a5..46e7f67ee2 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -93,7 +93,7 @@ CubeEffect::CubeEffect() , zOrderingFactor(0.0f) , mAddedHeightCoeff1(0.0f) , mAddedHeightCoeff2(0.0f) - , m_shadersDir("kwin/shaders/1.10/") + , m_shadersDir(QStringLiteral("kwin/shaders/1.10/")) , m_cubeCapBuffer(NULL) , m_proxy(this) { @@ -106,12 +106,12 @@ CubeEffect::CubeEffect() const qint64 coreVersionNumber = kVersionNumber(1, 40); #endif if (GLPlatform::instance()->glslVersion() >= coreVersionNumber) - m_shadersDir = "kwin/shaders/1.40/"; + m_shadersDir = QStringLiteral("kwin/shaders/1.40/"); if (effects->compositingType() == OpenGL2Compositing) { - const QString fragmentshader = KGlobal::dirs()->findResource("data", m_shadersDir + "cube-reflection.glsl"); + const QString fragmentshader = KGlobal::dirs()->findResource("data", m_shadersDir + QStringLiteral("cube-reflection.glsl")); m_reflectionShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, fragmentshader); - const QString capshader = KGlobal::dirs()->findResource("data", m_shadersDir + "cube-cap.glsl"); + const QString capshader = KGlobal::dirs()->findResource("data", m_shadersDir + QStringLiteral("cube-cap.glsl")); m_capShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, capshader); } else { m_reflectionShader = NULL; @@ -202,15 +202,15 @@ void CubeEffect::reconfigure(ReconfigureFlags) // do not connect the shortcut if we use cylinder or sphere if (!shortcutsRegistered) { KActionCollection* actionCollection = new KActionCollection(this); - KAction* cubeAction = static_cast< KAction* >(actionCollection->addAction("Cube")); + KAction* cubeAction = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("Cube"))); cubeAction->setText(i18n("Desktop Cube")); cubeAction->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F11)); cubeShortcut = cubeAction->globalShortcut(); - KAction* cylinderAction = static_cast< KAction* >(actionCollection->addAction("Cylinder")); + KAction* cylinderAction = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("Cylinder"))); cylinderAction->setText(i18n("Desktop Cylinder")); cylinderAction->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); cylinderShortcut = cylinderAction->globalShortcut(); - KAction* sphereAction = static_cast< KAction* >(actionCollection->addAction("Sphere")); + KAction* sphereAction = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("Sphere"))); sphereAction->setText(i18n("Desktop Sphere")); sphereAction->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); sphereShortcut = sphereAction->globalShortcut(); @@ -297,8 +297,8 @@ bool CubeEffect::loadShader() if (!(GLPlatform::instance()->supports(GLSL) && (effects->compositingType() == OpenGL2Compositing))) return false; - QString cylinderVertexshader = KGlobal::dirs()->findResource("data", m_shadersDir + "cylinder.vert"); - QString sphereVertexshader = KGlobal::dirs()->findResource("data", m_shadersDir + "sphere.vert"); + QString cylinderVertexshader = KGlobal::dirs()->findResource("data", m_shadersDir + QStringLiteral("cylinder.vert")); + QString sphereVertexshader = KGlobal::dirs()->findResource("data", m_shadersDir + QStringLiteral("sphere.vert")); if (cylinderVertexshader.isEmpty() || sphereVertexshader.isEmpty()) { kError(1212) << "Couldn't locate shader files" << endl; return false; diff --git a/effects/cube/cube.kcfg b/effects/cube/cube.kcfg index 8b23c7a4cc..bf49287ce3 100644 --- a/effects/cube/cube.kcfg +++ b/effects/cube/cube.kcfg @@ -31,7 +31,7 @@ QColor(KColorScheme(QPalette::Active, KColorScheme::Window).background().color()) - KGlobal::dirs()->findResource("appdata", "cubecap.png") + KGlobal::dirs()->findResource("appdata", QStringLiteral("cubecap.png")) true diff --git a/effects/cube/cube_config.cpp b/effects/cube/cube_config.cpp index ab2e984a8f..d06d528b97 100644 --- a/effects/cube/cube_config.cpp +++ b/effects/cube/cube_config.cpp @@ -56,25 +56,25 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) : // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("Cube"); + m_actionCollection->setConfigGroup(QStringLiteral("Cube")); m_actionCollection->setConfigGlobal(true); - KAction* cubeAction = (KAction*) m_actionCollection->addAction("Cube"); + KAction* cubeAction = (KAction*) m_actionCollection->addAction(QStringLiteral("Cube")); cubeAction->setText(i18n("Desktop Cube")); cubeAction->setProperty("isConfigurationAction", true); cubeAction->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F11)); - KAction* cylinderAction = (KAction*) m_actionCollection->addAction("Cylinder"); + KAction* cylinderAction = (KAction*) m_actionCollection->addAction(QStringLiteral("Cylinder")); cylinderAction->setText(i18n("Desktop Cylinder")); cylinderAction->setProperty("isConfigurationAction", true); cylinderAction->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); - KAction* sphereAction = (KAction*) m_actionCollection->addAction("Sphere"); + KAction* sphereAction = (KAction*) m_actionCollection->addAction(QStringLiteral("Sphere")); sphereAction->setText(i18n("Desktop Sphere")); sphereAction->setProperty("isConfigurationAction", true); sphereAction->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); m_ui->editor->addCollection(m_actionCollection); connect(m_ui->kcfg_Caps, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged())); - m_ui->kcfg_Wallpaper->setFilter("*.png *.jpeg *.jpg "); + m_ui->kcfg_Wallpaper->setFilter(QStringLiteral("*.png *.jpeg *.jpg ")); addConfig(CubeConfig::self(), m_ui); load(); } @@ -83,7 +83,7 @@ void CubeEffectConfig::save() { KCModule::save(); m_ui->editor->save(); - EffectsHandler::sendReloadMessage("cube"); + EffectsHandler::sendReloadMessage(QStringLiteral("cube")); } void CubeEffectConfig::capsSelectionChanged() diff --git a/effects/cube/cubeslide_config.cpp b/effects/cube/cubeslide_config.cpp index b3203a7353..7a5a0788f3 100644 --- a/effects/cube/cubeslide_config.cpp +++ b/effects/cube/cubeslide_config.cpp @@ -53,7 +53,7 @@ CubeSlideEffectConfig::CubeSlideEffectConfig(QWidget* parent, const QVariantList void CubeSlideEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("cubeslide"); + EffectsHandler::sendReloadMessage(QStringLiteral("cubeslide")); } } // namespace diff --git a/effects/dashboard/dashboard.cpp b/effects/dashboard/dashboard.cpp index 9cfa1c91b7..e5bf396f3e 100644 --- a/effects/dashboard/dashboard.cpp +++ b/effects/dashboard/dashboard.cpp @@ -122,7 +122,7 @@ void DashboardEffect::postPaintScreen() bool DashboardEffect::isDashboard(EffectWindow *w) { - return w->windowRole() == "plasma-dashboard"; + return w->windowRole() == QStringLiteral("plasma-dashboard"); } void DashboardEffect::slotWindowActivated(EffectWindow *w) diff --git a/effects/dashboard/dashboard_config.cpp b/effects/dashboard/dashboard_config.cpp index f1442c0c57..56e43cd4e8 100644 --- a/effects/dashboard/dashboard_config.cpp +++ b/effects/dashboard/dashboard_config.cpp @@ -46,7 +46,7 @@ void DashboardEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("dashboard"); + EffectsHandler::sendReloadMessage(QStringLiteral("dashboard")); } } // namespace KWin diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index dc3d82b187..de7d1394a4 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -71,7 +71,7 @@ DesktopGridEffect::DesktopGridEffect() { // Load shortcuts KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = (KAction*) actionCollection->addAction("ShowDesktopGrid"); + KAction* a = (KAction*) actionCollection->addAction(QStringLiteral("ShowDesktopGrid")); a->setText(i18n("Show Desktop Grid")); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F8)); shortcut = a->globalShortcut(); @@ -1093,7 +1093,7 @@ void DesktopGridEffect::setup() // setup the motion managers if (m_usePresentWindows) - m_proxy = static_cast(effects->getProxy("presentwindows")); + m_proxy = static_cast(effects->getProxy(QStringLiteral("presentwindows"))); if (isUsingPresentWindows()) { for (int i = 1; i <= effects->numberOfDesktops(); i++) { for (int j = 0; j < effects->numScreens(); j++) { @@ -1390,7 +1390,7 @@ DesktopButtonsView::DesktopButtonsView(QWidget *parent) QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); setPalette(pal); - foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { + for (const QString &importPath : KGlobal::dirs()->findDirs("module", QStringLiteral("imports"))) { engine()->addImportPath(importPath); } KDeclarative kdeclarative; @@ -1398,13 +1398,13 @@ DesktopButtonsView::DesktopButtonsView(QWidget *parent) kdeclarative.initialize(); kdeclarative.setupBindings(); - rootContext()->setContextProperty("add", QVariant(true)); - rootContext()->setContextProperty("remove", QVariant(true)); - setSource(QUrl(KStandardDirs::locate("data", QLatin1String("kwin/effects/desktopgrid/main.qml")))); - if (QObject *item = rootObject()->findChild("addButton")) { + rootContext()->setContextProperty(QStringLiteral("add"), QVariant(true)); + rootContext()->setContextProperty(QStringLiteral("remove"), QVariant(true)); + setSource(QUrl(KStandardDirs::locate("data", QStringLiteral("kwin/effects/desktopgrid/main.qml")))); + if (QObject *item = rootObject()->findChild(QStringLiteral("addButton"))) { connect(item, SIGNAL(clicked()), SIGNAL(addDesktop())); } - if (QObject *item = rootObject()->findChild("removeButton")) { + if (QObject *item = rootObject()->findChild(QStringLiteral("removeButton"))) { connect(item, SIGNAL(clicked()), SIGNAL(removeDesktop())); } } @@ -1424,12 +1424,12 @@ void DesktopButtonsView::windowInputMouseEvent(QMouseEvent *e) void DesktopButtonsView::setAddDesktopEnabled(bool enable) { - rootContext()->setContextProperty("add", QVariant(enable)); + rootContext()->setContextProperty(QStringLiteral("add"), QVariant(enable)); } void DesktopButtonsView::setRemoveDesktopEnabled(bool enable) { - rootContext()->setContextProperty("remove", QVariant(enable)); + rootContext()->setContextProperty(QStringLiteral("remove"), QVariant(enable)); } } // namespace diff --git a/effects/desktopgrid/desktopgrid_config.cpp b/effects/desktopgrid/desktopgrid_config.cpp index 45fd205fd9..3bf9505c5e 100644 --- a/effects/desktopgrid/desktopgrid_config.cpp +++ b/effects/desktopgrid/desktopgrid_config.cpp @@ -53,10 +53,10 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("DesktopGrid"); + m_actionCollection->setConfigGroup(QStringLiteral("DesktopGrid")); m_actionCollection->setConfigGlobal(true); - KAction* a = (KAction*) m_actionCollection->addAction("ShowDesktopGrid"); + KAction* a = (KAction*) m_actionCollection->addAction(QStringLiteral("ShowDesktopGrid")); a->setText(i18n("Show Desktop Grid")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F8)); @@ -94,11 +94,11 @@ void DesktopGridEffectConfig::save() DesktopGridConfig::setDesktopNameAlignment(m_ui->desktopNameAlignmentCombo->itemData(m_ui->desktopNameAlignmentCombo->currentIndex()).toInt()); KCModule::save(); - KConfigGroup conf = EffectsHandler::effectConfig("DesktopGrid"); + KConfigGroup conf = EffectsHandler::effectConfig(QStringLiteral("DesktopGrid")); conf.writeEntry("DesktopNameAlignment", DesktopGridConfig::desktopNameAlignment()); conf.sync(); - EffectsHandler::sendReloadMessage("desktopgrid"); + EffectsHandler::sendReloadMessage(QStringLiteral("desktopgrid")); } void DesktopGridEffectConfig::load() diff --git a/effects/diminactive/diminactive_config.cpp b/effects/diminactive/diminactive_config.cpp index 152cb9e141..644f858fae 100644 --- a/effects/diminactive/diminactive_config.cpp +++ b/effects/diminactive/diminactive_config.cpp @@ -60,7 +60,7 @@ DimInactiveEffectConfig::DimInactiveEffectConfig(QWidget* parent, const QVariant void DimInactiveEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("diminactive"); + EffectsHandler::sendReloadMessage(QStringLiteral("diminactive")); } } // namespace diff --git a/effects/dimscreen/dimscreen.cpp b/effects/dimscreen/dimscreen.cpp index 14c8da79e2..81554498bc 100644 --- a/effects/dimscreen/dimscreen.cpp +++ b/effects/dimscreen/dimscreen.cpp @@ -89,11 +89,11 @@ void DimScreenEffect::slotWindowActivated(EffectWindow *w) { if (!w) return; QStringList check; - check << "kdesu kdesu"; - check << "kdesudo kdesudo"; - check << "polkit-kde-manager polkit-kde-manager"; - check << "polkit-kde-authentication-agent-1 polkit-kde-authentication-agent-1"; - check << "pinentry pinentry"; + check << QStringLiteral("kdesu kdesu"); + check << QStringLiteral("kdesudo kdesudo"); + check << QStringLiteral("polkit-kde-manager polkit-kde-manager"); + check << QStringLiteral("polkit-kde-authentication-agent-1 polkit-kde-authentication-agent-1"); + check << QStringLiteral("pinentry pinentry"); if (check.contains(w->windowClass())) { mActivated = true; activateAnimation = true; diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp index 53d25b1dbd..7637ea3461 100644 --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -44,7 +44,7 @@ FallApartEffect::FallApartEffect() void FallApartEffect::reconfigure(ReconfigureFlags) { - KConfigGroup conf = effects->effectConfig("FallApart"); + KConfigGroup conf = effects->effectConfig(QStringLiteral("FallApart")); blockSize = qBound(1, conf.readEntry("BlockSize", 40), 100000); } diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp index 97e0455beb..aa96ff46fd 100644 --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -58,13 +58,13 @@ FlipSwitchEffect::FlipSwitchEffect() m_captionFont.setPointSize(m_captionFont.pointSize() * 2); KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = (KAction*)actionCollection->addAction("FlipSwitchCurrent"); + KAction* a = (KAction*)actionCollection->addAction(QStringLiteral("FlipSwitchCurrent")); a->setText(i18n("Toggle Flip Switch (Current desktop)")); a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); m_shortcutCurrent = a->globalShortcut(); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleActiveCurrent())); connect(a, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChangedCurrent(QKeySequence))); - KAction* b = (KAction*)actionCollection->addAction("FlipSwitchAll"); + KAction* b = (KAction*)actionCollection->addAction(QStringLiteral("FlipSwitchAll")); b->setText(i18n("Toggle Flip Switch (All desktops)")); b->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); m_shortcutAll = b->globalShortcut(); @@ -950,7 +950,7 @@ void FlipSwitchEffect::updateCaption() if (m_selectedWindow->isDesktop()) { m_captionFrame->setText(i18nc("Special entry in alt+tab list for minimizing all windows", "Show Desktop")); - static QPixmap pix = KIcon("user-desktop").pixmap(m_captionFrame->iconSize()); + static QPixmap pix = KIcon(QStringLiteral("user-desktop")).pixmap(m_captionFrame->iconSize()); m_captionFrame->setIcon(pix); } else { m_captionFrame->setText(m_selectedWindow->caption()); diff --git a/effects/flipswitch/flipswitch_config.cpp b/effects/flipswitch/flipswitch_config.cpp index 62a47f9bac..5ef14014c0 100644 --- a/effects/flipswitch/flipswitch_config.cpp +++ b/effects/flipswitch/flipswitch_config.cpp @@ -50,14 +50,14 @@ FlipSwitchEffectConfig::FlipSwitchEffectConfig(QWidget* parent, const QVariantLi // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - KAction* a = (KAction*)m_actionCollection->addAction("FlipSwitchCurrent"); + KAction* a = (KAction*)m_actionCollection->addAction(QStringLiteral("FlipSwitchCurrent")); a->setText(i18n("Toggle Flip Switch (Current desktop)")); a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); - KAction* b = (KAction*)m_actionCollection->addAction("FlipSwitchAll"); + KAction* b = (KAction*)m_actionCollection->addAction(QStringLiteral("FlipSwitchAll")); b->setText(i18n("Toggle Flip Switch (All desktops)")); b->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut); - m_actionCollection->setConfigGroup("FlipSwitch"); + m_actionCollection->setConfigGroup(QStringLiteral("FlipSwitch")); m_actionCollection->setConfigGlobal(true); m_ui->shortcutEditor->addCollection(m_actionCollection); @@ -76,7 +76,7 @@ void FlipSwitchEffectConfig::save() KCModule::save(); m_ui->shortcutEditor->save(); - EffectsHandler::sendReloadMessage("flipswitch"); + EffectsHandler::sendReloadMessage(QStringLiteral("flipswitch")); } diff --git a/effects/glide/glide.cpp b/effects/glide/glide.cpp index 5dda5301af..40d06577e3 100644 --- a/effects/glide/glide.cpp +++ b/effects/glide/glide.cpp @@ -225,7 +225,7 @@ bool GlideEffect::isGlideWindow(EffectWindow* w) return true; if (!w->isManaged() || w->isMenu() || w->isNotification() || w->isDesktop() || w->isDock() || w->isSplash() || w->isToolbar() || - w->windowClass() == "dashboard dashboard") + w->windowClass() == QStringLiteral("dashboard dashboard")) return false; return true; } diff --git a/effects/glide/glide_config.cpp b/effects/glide/glide_config.cpp index a2e6a6b03f..5d11fec467 100644 --- a/effects/glide/glide_config.cpp +++ b/effects/glide/glide_config.cpp @@ -44,7 +44,7 @@ GlideEffectConfig::~GlideEffectConfig() void GlideEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("glide"); + EffectsHandler::sendReloadMessage(QStringLiteral("glide")); } } // namespace KWin #include "glide_config.moc" diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index c412e31644..3ed0fd8b3e 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -46,12 +46,12 @@ InvertEffect::InvertEffect() { KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = (KAction*)actionCollection->addAction("Invert"); + KAction* a = (KAction*)actionCollection->addAction(QStringLiteral("Invert")); a->setText(i18n("Toggle Invert Effect")); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_I)); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleScreenInversion())); - KAction* b = (KAction*)actionCollection->addAction("InvertWindow"); + KAction* b = (KAction*)actionCollection->addAction(QStringLiteral("InvertWindow")); b->setText(i18n("Toggle Invert Effect on Window")); b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_U)); connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleWindow())); @@ -72,15 +72,15 @@ bool InvertEffect::loadData() { m_inited = true; - QString shadersDir = "kwin/shaders/1.10/"; + QString shadersDir = QStringLiteral("kwin/shaders/1.10/"); #ifdef KWIN_HAVE_OPENGLES const qint64 coreVersionNumber = kVersionNumber(3, 0); #else const qint64 coreVersionNumber = kVersionNumber(1, 40); #endif if (GLPlatform::instance()->glslVersion() >= coreVersionNumber) - shadersDir = "kwin/shaders/1.40/"; - const QString fragmentshader = KGlobal::dirs()->findResource("data", shadersDir + "invert.frag"); + shadersDir = QStringLiteral("kwin/shaders/1.40/"); + const QString fragmentshader = KGlobal::dirs()->findResource("data", shadersDir + QStringLiteral("invert.frag")); m_shader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, fragmentshader); if (!m_shader->isValid()) { diff --git a/effects/invert/invert_config.cpp b/effects/invert/invert_config.cpp index c67da28807..cb6b53775c 100644 --- a/effects/invert/invert_config.cpp +++ b/effects/invert/invert_config.cpp @@ -43,12 +43,12 @@ InvertEffectConfig::InvertEffectConfig(QWidget* parent, const QVariantList& args // Shortcut config. The shortcut belongs to the component "kwin"! KActionCollection *actionCollection = new KActionCollection(this, KComponentData("kwin")); - KAction* a = static_cast(actionCollection->addAction("Invert")); + KAction* a = static_cast(actionCollection->addAction(QStringLiteral("Invert"))); a->setText(i18n("Toggle Invert Effect")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_I)); - KAction* b = static_cast(actionCollection->addAction("InvertWindow")); + KAction* b = static_cast(actionCollection->addAction(QStringLiteral("InvertWindow"))); b->setText(i18n("Toggle Invert Effect on Window")); b->setProperty("isConfigurationAction", true); b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_U)); @@ -81,7 +81,7 @@ void InvertEffectConfig::save() mShortcutEditor->save(); // undo() will restore to this state from now on emit changed(false); - EffectsHandler::sendReloadMessage("invert"); + EffectsHandler::sendReloadMessage(QStringLiteral("invert")); } void InvertEffectConfig::defaults() diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 86ccc4e7ea..f1bf3bc7b4 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -282,8 +282,8 @@ void LogoutEffect::slotWindowDeleted(EffectWindow* w) bool LogoutEffect::isLogoutDialog(EffectWindow* w) { // TODO there should be probably a better way (window type?) - if (w->windowClass() == "ksmserver ksmserver" - && (w->windowRole() == "logoutdialog" || w->windowRole() == "logouteffect")) { + if (w->windowClass() == QStringLiteral("ksmserver ksmserver") + && (w->windowRole() == QStringLiteral("logoutdialog") || w->windowRole() == QStringLiteral("logouteffect"))) { return true; } return false; @@ -296,8 +296,8 @@ void LogoutEffect::renderVignetting() return; } if (!m_vignettingShader) { - const char *shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ? - "kwin/vignetting-140.frag" : "kwin/vignetting.frag"; + QString shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ? + QStringLiteral("kwin/vignetting-140.frag") : QStringLiteral("kwin/vignetting.frag"); m_vignettingShader = ShaderManager::instance()->loadFragmentShader(KWin::ShaderManager::ColorShader, KGlobal::dirs()->findResource("data", shader)); if (!m_vignettingShader->isValid()) { @@ -378,8 +378,8 @@ void LogoutEffect::renderBlurTexture() return; } if (!m_blurShader) { - const char *shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ? - "kwin/logout-blur-140.frag" : "kwin/logout-blur.frag"; + QString shader = GLPlatform::instance()->glslVersion() >= kVersionNumber(1, 40) ? + QStringLiteral("kwin/logout-blur-140.frag") : QStringLiteral("kwin/logout-blur.frag"); m_blurShader = ShaderManager::instance()->loadFragmentShader(KWin::ShaderManager::SimpleShader, KGlobal::dirs()->findResource("data", shader)); if (!m_blurShader->isValid()) { diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index 0892650bd5..e24c339e95 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -57,7 +57,7 @@ LookingGlassEffect::LookingGlassEffect() { actionCollection = new KActionCollection(this); actionCollection->setConfigGlobal(true); - actionCollection->setConfigGroup("LookingGlass"); + actionCollection->setConfigGroup(QStringLiteral("LookingGlass")); KAction* a; a = static_cast< KAction* >(actionCollection->addAction(KStandardAction::ZoomIn, this, SLOT(zoomIn()))); @@ -89,7 +89,7 @@ void LookingGlassEffect::reconfigure(ReconfigureFlags) LookingGlassConfig::self()->readConfig(); initialradius = LookingGlassConfig::radius(); radius = initialradius; - kDebug(1212) << QString("Radius from config: %1").arg(radius) << endl; + kDebug(1212) << QStringLiteral("Radius from config: %1").arg(radius) << endl; actionCollection->readSettings(); m_valid = loadData(); } @@ -116,15 +116,15 @@ bool LookingGlassEffect::loadData() return false; } - QString shadersDir = "kwin/shaders/1.10/"; + QString shadersDir = QStringLiteral("kwin/shaders/1.10/"); #ifdef KWIN_HAVE_OPENGLES const qint64 coreVersionNumber = kVersionNumber(3, 0); #else const qint64 coreVersionNumber = kVersionNumber(1, 40); #endif if (GLPlatform::instance()->glslVersion() >= coreVersionNumber) - shadersDir = "kwin/shaders/1.40/"; - const QString fragmentshader = KGlobal::dirs()->findResource("data", shadersDir + "lookingglass.frag"); + shadersDir = QStringLiteral("kwin/shaders/1.40/"); + const QString fragmentshader = KGlobal::dirs()->findResource("data", shadersDir + QStringLiteral("lookingglass.frag")); m_shader = ShaderManager::instance()->loadFragmentShader(ShaderManager::SimpleShader, fragmentshader); if (m_shader->isValid()) { ShaderBinder binder(m_shader); diff --git a/effects/lookingglass/lookingglass_config.cpp b/effects/lookingglass/lookingglass_config.cpp index 80b9fdef26..e47a550f9c 100644 --- a/effects/lookingglass/lookingglass_config.cpp +++ b/effects/lookingglass/lookingglass_config.cpp @@ -60,7 +60,7 @@ LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVaria // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("LookingGlass"); + m_actionCollection->setConfigGroup(QStringLiteral("LookingGlass")); m_actionCollection->setConfigGlobal(true); KAction* a; @@ -92,7 +92,7 @@ void LookingGlassEffectConfig::save() m_ui->editor->save(); // undo() will restore to this state from now on - EffectsHandler::sendReloadMessage("lookingglass"); + EffectsHandler::sendReloadMessage(QStringLiteral("lookingglass")); } void LookingGlassEffectConfig::defaults() diff --git a/effects/magiclamp/magiclamp.cpp b/effects/magiclamp/magiclamp.cpp index 90887fd658..85951683d6 100644 --- a/effects/magiclamp/magiclamp.cpp +++ b/effects/magiclamp/magiclamp.cpp @@ -55,8 +55,8 @@ void MagicLampEffect::reconfigure(ReconfigureFlags) // TODO: rename animationDuration to duration mAnimationDuration = animationTime(MagicLampConfig::animationDuration() != 0 ? MagicLampConfig::animationDuration() : 250); - KConfigGroup conf = effects->effectConfig("MagicLamp"); - conf = effects->effectConfig("Shadow"); + KConfigGroup conf = effects->effectConfig(QStringLiteral("MagicLamp")); + conf = effects->effectConfig(QStringLiteral("Shadow")); int v = conf.readEntry("Size", 5); v += conf.readEntry("Fuzzyness", 10); mShadowOffset[0] = mShadowOffset[1] = -v; diff --git a/effects/magiclamp/magiclamp_config.cpp b/effects/magiclamp/magiclamp_config.cpp index ea4b6486cb..8829a34d5c 100644 --- a/effects/magiclamp/magiclamp_config.cpp +++ b/effects/magiclamp/magiclamp_config.cpp @@ -54,7 +54,7 @@ MagicLampEffectConfig::MagicLampEffectConfig(QWidget* parent, const QVariantList void MagicLampEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("magiclamp"); + EffectsHandler::sendReloadMessage(QStringLiteral("magiclamp")); } } // namespace diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 22b9994a87..7555eb4646 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -73,7 +73,7 @@ MagnifierEffect::~MagnifierEffect() delete m_texture; destroyPixmap(); // Save the zoom value. - KConfigGroup conf = EffectsHandler::effectConfig("Magnifier"); + KConfigGroup conf = EffectsHandler::effectConfig(QStringLiteral("Magnifier")); conf.writeEntry("InitialZoom", target_zoom); conf.sync(); } diff --git a/effects/magnifier/magnifier_config.cpp b/effects/magnifier/magnifier_config.cpp index e68300e70f..70f4d13800 100644 --- a/effects/magnifier/magnifier_config.cpp +++ b/effects/magnifier/magnifier_config.cpp @@ -60,7 +60,7 @@ MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("Magnifier"); + m_actionCollection->setConfigGroup(QStringLiteral("Magnifier")); m_actionCollection->setConfigGlobal(true); KAction* a; @@ -92,7 +92,7 @@ void MagnifierEffectConfig::save() m_ui->editor->save(); // undo() will restore to this state from now on KCModule::save(); - EffectsHandler::sendReloadMessage("magnifier"); + EffectsHandler::sendReloadMessage(QStringLiteral("magnifier")); } void MagnifierEffectConfig::defaults() diff --git a/effects/mouseclick/mouseclick.cpp b/effects/mouseclick/mouseclick.cpp index 0af8a7cf38..adcf3b2858 100644 --- a/effects/mouseclick/mouseclick.cpp +++ b/effects/mouseclick/mouseclick.cpp @@ -45,7 +45,7 @@ MouseClickEffect::MouseClickEffect() { m_enabled = false; KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = static_cast(actionCollection->addAction("ToggleMouseClick")); + KAction* a = static_cast(actionCollection->addAction(QStringLiteral("ToggleMouseClick"))); a->setText(i18n("Toggle Effect")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Asterisk)); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleEnabled())); diff --git a/effects/mouseclick/mouseclick_config.cpp b/effects/mouseclick/mouseclick_config.cpp index b92228f05b..fe4d43974c 100644 --- a/effects/mouseclick/mouseclick_config.cpp +++ b/effects/mouseclick/mouseclick_config.cpp @@ -53,7 +53,7 @@ MouseClickEffectConfig::MouseClickEffectConfig(QWidget* parent, const QVariantLi // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - KAction* a = static_cast(m_actionCollection->addAction("ToggleMouseClick")); + KAction* a = static_cast(m_actionCollection->addAction(QStringLiteral("ToggleMouseClick"))); a->setText(i18n("Toggle Effect")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Asterisk)); @@ -74,7 +74,7 @@ void MouseClickEffectConfig::save() { KCModule::save(); m_ui->editor->save(); // undo() will restore to this state from now on - EffectsHandler::sendReloadMessage("mouseclick"); + EffectsHandler::sendReloadMessage(QStringLiteral("mouseclick")); } } // namespace diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp index 78208e19a8..cab4a30299 100644 --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -49,11 +49,11 @@ KWIN_EFFECT(mousemark, MouseMarkEffect) MouseMarkEffect::MouseMarkEffect() { KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = static_cast< KAction* >(actionCollection->addAction("ClearMouseMarks")); + KAction* a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("ClearMouseMarks"))); a->setText(i18n("Clear All Mouse Marks")); a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11)); connect(a, SIGNAL(triggered(bool)), this, SLOT(clear())); - a = static_cast< KAction* >(actionCollection->addAction("ClearLastMouseMark")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("ClearLastMouseMark"))); a->setText(i18n("Clear Last Mouse Mark")); a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12)); connect(a, SIGNAL(triggered(bool)), this, SLOT(clearLast())); diff --git a/effects/mousemark/mousemark_config.cpp b/effects/mousemark/mousemark_config.cpp index cc0a03082b..2741c8a906 100644 --- a/effects/mousemark/mousemark_config.cpp +++ b/effects/mousemark/mousemark_config.cpp @@ -59,12 +59,12 @@ MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - KAction* a = static_cast< KAction* >(m_actionCollection->addAction("ClearMouseMarks")); + KAction* a = static_cast< KAction* >(m_actionCollection->addAction(QStringLiteral("ClearMouseMarks"))); a->setText(i18n("Clear Mouse Marks")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11)); - a = static_cast< KAction* >(m_actionCollection->addAction("ClearLastMouseMark")); + a = static_cast< KAction* >(m_actionCollection->addAction(QStringLiteral("ClearLastMouseMark"))); a->setText(i18n("Clear Last Mouse Mark")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12)); @@ -88,7 +88,7 @@ void MouseMarkEffectConfig::save() m_actionCollection->writeSettings(); m_ui->editor->save(); // undo() will restore to this state from now on - EffectsHandler::sendReloadMessage("mousemark"); + EffectsHandler::sendReloadMessage(QStringLiteral("mousemark")); } } // namespace diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 116e7eb5e0..e1a59ae892 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -75,19 +75,19 @@ PresentWindowsEffect::PresentWindowsEffect() m_atomWindows = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_GROUP", this); KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = (KAction*)actionCollection->addAction("Expose"); + KAction* a = (KAction*)actionCollection->addAction(QStringLiteral("Expose")); a->setText(i18n("Toggle Present Windows (Current desktop)")); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F9)); shortcut = a->globalShortcut(); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleActive())); connect(a, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChanged(QKeySequence))); - KAction* b = (KAction*)actionCollection->addAction("ExposeAll"); + KAction* b = (KAction*)actionCollection->addAction(QStringLiteral("ExposeAll")); b->setText(i18n("Toggle Present Windows (All desktops)")); b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F10)); shortcutAll = b->globalShortcut(); connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops())); connect(b, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChangedAll(QKeySequence))); - KAction* c = (KAction*)actionCollection->addAction("ExposeClass"); + KAction* c = (KAction*)actionCollection->addAction(QStringLiteral("ExposeClass")); c->setText(i18n("Toggle Present Windows (Window class)")); c->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F7)); connect(c, SIGNAL(triggered(bool)), this, SLOT(toggleActiveClass())); @@ -566,7 +566,7 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) m_dragInProgress = false; m_dragWindow = NULL; if (m_highlightedDropTarget) { - KIcon icon("user-trash"); + KIcon icon(QStringLiteral("user-trash")); m_highlightedDropTarget->setIcon(icon.pixmap(QSize(128, 128), QIcon::Normal)); m_highlightedDropTarget = NULL; } @@ -606,7 +606,7 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) m_dragWindow = NULL; if (m_highlightedDropTarget) { effects->addRepaint(m_highlightedDropTarget->geometry()); - KIcon icon("user-trash"); + KIcon icon(QStringLiteral("user-trash")); m_highlightedDropTarget->setIcon(icon.pixmap(QSize(128, 128), QIcon::Normal)); m_highlightedDropTarget = NULL; } @@ -637,12 +637,12 @@ void PresentWindowsEffect::windowInputMouseEvent(QEvent *e) } if (target && !m_highlightedDropTarget) { m_highlightedDropTarget = target; - KIcon icon("user-trash"); + KIcon icon(QStringLiteral("user-trash")); effects->addRepaint(m_highlightedDropTarget->geometry()); m_highlightedDropTarget->setIcon(icon.pixmap(QSize(128, 128), QIcon::Active)); effects->defineCursor(Qt::DragMoveCursor); } else if (!target && m_highlightedDropTarget) { - KIcon icon("user-trash"); + KIcon icon(QStringLiteral("user-trash")); effects->addRepaint(m_highlightedDropTarget->geometry()); m_highlightedDropTarget->setIcon(icon.pixmap(QSize(128, 128), QIcon::Normal)); m_highlightedDropTarget = NULL; @@ -1925,7 +1925,7 @@ void PresentWindowsEffect::screenCountChanged() if (m_dragToClose) { const QRect screenRect = effects->clientArea(FullScreenArea, i, 1); EffectFrame *frame = effects->effectFrame(EffectFrameNone, false); - KIcon icon("user-trash"); + KIcon icon(QStringLiteral("user-trash")); frame->setIcon(icon.pixmap(QSize(128, 128))); frame->setPosition(QPoint(screenRect.x() + screenRect.width(), screenRect.y())); frame->setAlignment(Qt::AlignRight | Qt::AlignTop); @@ -1947,7 +1947,7 @@ CloseWindowView::CloseWindowView(QWidget *parent) QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); setPalette(pal); - foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { + for (const QString &importPath : KGlobal::dirs()->findDirs("module", QStringLiteral("imports"))) { engine()->addImportPath(importPath); } KDeclarative kdeclarative; @@ -1955,10 +1955,10 @@ CloseWindowView::CloseWindowView(QWidget *parent) kdeclarative.initialize(); kdeclarative.setupBindings(); - rootContext()->setContextProperty("armed", QVariant(false)); + rootContext()->setContextProperty(QStringLiteral("armed"), QVariant(false)); - setSource(QUrl(KStandardDirs::locate("data", QLatin1String("kwin/effects/presentwindows/main.qml")))); - if (QObject *item = rootObject()->findChild("closeButton")) { + setSource(QUrl(KStandardDirs::locate("data", QStringLiteral("kwin/effects/presentwindows/main.qml")))); + if (QObject *item = rootObject()->findChild(QStringLiteral("closeButton"))) { connect(item, SIGNAL(clicked()), SIGNAL(close())); } @@ -1985,12 +1985,12 @@ void CloseWindowView::windowInputMouseEvent(QMouseEvent *e) void CloseWindowView::arm() { - rootContext()->setContextProperty("armed", QVariant(true)); + rootContext()->setContextProperty(QStringLiteral("armed"), QVariant(true)); } void CloseWindowView::disarm() { - rootContext()->setContextProperty("armed", QVariant(false)); + rootContext()->setContextProperty(QStringLiteral("armed"), QVariant(false)); m_armTimer->start(); } diff --git a/effects/presentwindows/presentwindows_config.cpp b/effects/presentwindows/presentwindows_config.cpp index 2d8625a58e..5a416b6d5c 100644 --- a/effects/presentwindows/presentwindows_config.cpp +++ b/effects/presentwindows/presentwindows_config.cpp @@ -52,20 +52,20 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("PresentWindows"); + m_actionCollection->setConfigGroup(QStringLiteral("PresentWindows")); m_actionCollection->setConfigGlobal(true); - KAction* a = (KAction*) m_actionCollection->addAction("ExposeAll"); + KAction* a = (KAction*) m_actionCollection->addAction(QStringLiteral("ExposeAll")); a->setText(i18n("Toggle Present Windows (All desktops)")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F10)); - KAction* b = (KAction*) m_actionCollection->addAction("Expose"); + KAction* b = (KAction*) m_actionCollection->addAction(QStringLiteral("Expose")); b->setText(i18n("Toggle Present Windows (Current desktop)")); b->setProperty("isConfigurationAction", true); b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F9)); - KAction* c = (KAction*)m_actionCollection->addAction("ExposeClass"); + KAction* c = (KAction*)m_actionCollection->addAction(QStringLiteral("ExposeClass")); c->setText(i18n("Toggle Present Windows (Window class)")); c->setProperty("isConfigurationAction", true); c->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::Key_F7)); @@ -89,7 +89,7 @@ void PresentWindowsEffectConfig::save() { KCModule::save(); m_ui->shortcutEditor->save(); - EffectsHandler::sendReloadMessage("presentwindows"); + EffectsHandler::sendReloadMessage(QStringLiteral("presentwindows")); } void PresentWindowsEffectConfig::defaults() diff --git a/effects/resize/resize_config.cpp b/effects/resize/resize_config.cpp index 8527b47ea5..eb051f3cd8 100644 --- a/effects/resize/resize_config.cpp +++ b/effects/resize/resize_config.cpp @@ -54,7 +54,7 @@ ResizeEffectConfig::ResizeEffectConfig(QWidget* parent, const QVariantList& args void ResizeEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("resize"); + EffectsHandler::sendReloadMessage(QStringLiteral("resize")); } } // namespace diff --git a/effects/screenedge/screenedgeeffect.cpp b/effects/screenedge/screenedgeeffect.cpp index 29d23654dd..8c5bea1236 100644 --- a/effects/screenedge/screenedgeeffect.cpp +++ b/effects/screenedge/screenedgeeffect.cpp @@ -42,7 +42,7 @@ ScreenEdgeEffect::ScreenEdgeEffect() , m_glow(new Plasma::Svg(this)) , m_cleanupTimer(new QTimer(this)) { - m_glow->setImagePath("widgets/glowbar"); + m_glow->setImagePath(QStringLiteral("widgets/glowbar")); connect(effects, SIGNAL(screenEdgeApproaching(ElectricBorder,qreal,QRect)), SLOT(edgeApproaching(ElectricBorder,qreal,QRect))); m_cleanupTimer->setInterval(5000); m_cleanupTimer->setSingleShot(true); @@ -218,13 +218,13 @@ T *ScreenEdgeEffect::createCornerGlow(ElectricBorder border) { switch (border) { case ElectricTopLeft: - return new T(m_glow->pixmap("bottomright")); + return new T(m_glow->pixmap(QStringLiteral("bottomright"))); case ElectricTopRight: - return new T(m_glow->pixmap("bottomleft")); + return new T(m_glow->pixmap(QStringLiteral("bottomleft"))); case ElectricBottomRight: - return new T(m_glow->pixmap("topleft")); + return new T(m_glow->pixmap(QStringLiteral("topleft"))); case ElectricBottomLeft: - return new T(m_glow->pixmap("topright")); + return new T(m_glow->pixmap(QStringLiteral("topright"))); default: return NULL; } @@ -234,13 +234,13 @@ QSize ScreenEdgeEffect::cornerGlowSize(ElectricBorder border) const { switch (border) { case ElectricTopLeft: - return m_glow->elementSize("bottomright"); + return m_glow->elementSize(QStringLiteral("bottomright")); case ElectricTopRight: - return m_glow->elementSize("bottomleft"); + return m_glow->elementSize(QStringLiteral("bottomleft")); case ElectricBottomRight: - return m_glow->elementSize("topleft"); + return m_glow->elementSize(QStringLiteral("topleft")); case ElectricBottomLeft: - return m_glow->elementSize("topright"); + return m_glow->elementSize(QStringLiteral("topright")); default: return QSize(); } @@ -253,25 +253,25 @@ T *ScreenEdgeEffect::createEdgeGlow(ElectricBorder border, const QSize &size) QPixmap l, r, c; switch (border) { case ElectricTop: - l = m_glow->pixmap("bottomleft"); - r = m_glow->pixmap("bottomright"); - c = m_glow->pixmap("bottom"); + l = m_glow->pixmap(QStringLiteral("bottomleft")); + r = m_glow->pixmap(QStringLiteral("bottomright")); + c = m_glow->pixmap(QStringLiteral("bottom")); break; case ElectricBottom: - l = m_glow->pixmap("topleft"); - r = m_glow->pixmap("topright"); - c = m_glow->pixmap("top"); + l = m_glow->pixmap(QStringLiteral("topleft")); + r = m_glow->pixmap(QStringLiteral("topright")); + c = m_glow->pixmap(QStringLiteral("top")); pixmapPosition = QPoint(0, size.height() - c.height()); break; case ElectricLeft: - l = m_glow->pixmap("topright"); - r = m_glow->pixmap("bottomright"); - c = m_glow->pixmap("right"); + l = m_glow->pixmap(QStringLiteral("topright")); + r = m_glow->pixmap(QStringLiteral("bottomright")); + c = m_glow->pixmap(QStringLiteral("right")); break; case ElectricRight: - l = m_glow->pixmap("topleft"); - r = m_glow->pixmap("bottomleft"); - c = m_glow->pixmap("left"); + l = m_glow->pixmap(QStringLiteral("topleft")); + r = m_glow->pixmap(QStringLiteral("bottomleft")); + c = m_glow->pixmap(QStringLiteral("left")); pixmapPosition = QPoint(size.width() - c.width(), 0); break; default: diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index 8390716b71..1ea6cd0632 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -45,14 +45,14 @@ ScreenShotEffect::ScreenShotEffect() : m_scheduledScreenshot(0) { connect ( effects, SIGNAL(windowClosed(KWin::EffectWindow*)), SLOT(windowClosed(KWin::EffectWindow*)) ); - QDBusConnection::sessionBus().registerObject("/Screenshot", this, QDBusConnection::ExportScriptableContents); - QDBusConnection::sessionBus().registerService("org.kde.kwin.Screenshot"); + QDBusConnection::sessionBus().registerObject(QStringLiteral("/Screenshot"), this, QDBusConnection::ExportScriptableContents); + QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kwin.Screenshot")); } ScreenShotEffect::~ScreenShotEffect() { - QDBusConnection::sessionBus().unregisterObject("/Screenshot"); - QDBusConnection::sessionBus().unregisterService("org.kde.kwin.Screenshot"); + QDBusConnection::sessionBus().unregisterObject(QStringLiteral("/Screenshot")); + QDBusConnection::sessionBus().unregisterService(QStringLiteral("org.kde.kwin.Screenshot")); } #ifdef KWIN_HAVE_XRENDER_COMPOSITING @@ -305,7 +305,7 @@ QString ScreenShotEffect::blitScreenshot(const QRect &geometry) } KTemporaryFile temp; - temp.setSuffix(".png"); + temp.setSuffix(QStringLiteral(".png")); temp.setAutoRemove(false); if (!temp.open()) { return QString(); diff --git a/effects/showfps/showfps_config.cpp b/effects/showfps/showfps_config.cpp index 8474b4f194..a46babe54e 100644 --- a/effects/showfps/showfps_config.cpp +++ b/effects/showfps/showfps_config.cpp @@ -54,7 +54,7 @@ ShowFpsEffectConfig::~ShowFpsEffectConfig() void ShowFpsEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("showfps"); + EffectsHandler::sendReloadMessage(QStringLiteral("showfps")); } } // namespace diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 22889c577f..b9c51749a5 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -46,9 +46,9 @@ SlidingPopupsEffect::~SlidingPopupsEffect() void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags) { Q_UNUSED(flags) - KConfigGroup conf = effects->effectConfig("SlidingPopups"); - mFadeInTime = animationTime(conf, "SlideInTime", 250); - mFadeOutTime = animationTime(conf, "SlideOutTime", 250); + KConfigGroup conf = effects->effectConfig(QStringLiteral("SlidingPopups")); + mFadeInTime = animationTime(conf, QStringLiteral("SlideInTime"), 250); + mFadeOutTime = animationTime(conf, QStringLiteral("SlideOutTime"), 250); QHash< const EffectWindow*, QTimeLine* >::iterator it = mAppearingWindows.begin(); while (it != mAppearingWindows.end()) { it.value()->setDuration(animationTime(mFadeInTime)); diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp index e0dc7c4445..3486054ed9 100644 --- a/effects/startupfeedback/startupfeedback.cpp +++ b/effects/startupfeedback/startupfeedback.cpp @@ -115,7 +115,7 @@ bool StartupFeedbackEffect::supported() void StartupFeedbackEffect::reconfigure(Effect::ReconfigureFlags flags) { Q_UNUSED(flags) - KConfig conf("klaunchrc", KConfig::NoGlobals); + KConfig conf(QStringLiteral("klaunchrc"), KConfig::NoGlobals); KConfigGroup c = conf.group("FeedbackStyle"); const bool busyCursor = c.readEntry("BusyCursor", true); @@ -132,7 +132,7 @@ void StartupFeedbackEffect::reconfigure(Effect::ReconfigureFlags flags) if (effects->compositingType() == OpenGL2Compositing) { delete m_blinkingShader; m_blinkingShader = 0; - const QString shader = KGlobal::dirs()->findResource("data", "kwin/blinking-startup-fragment.glsl"); + const QString shader = KGlobal::dirs()->findResource("data", QStringLiteral("kwin/blinking-startup-fragment.glsl")); m_blinkingShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::SimpleShader, shader); if (m_blinkingShader->isValid()) { kDebug(1212) << "Blinking Shader is valid"; @@ -321,7 +321,7 @@ void StartupFeedbackEffect::start(const QString& icon) QPixmap iconPixmap = KIconLoader::global()->loadIcon(icon, KIconLoader::Small, 0, KIconLoader::DefaultState, QStringList(), 0, true); // return null pixmap if not found if (iconPixmap.isNull()) - iconPixmap = SmallIcon("system-run"); + iconPixmap = SmallIcon(QStringLiteral("system-run")); prepareTextures(iconPixmap); m_dirtyRect = m_currentGeometry = feedbackRect(); effects->addRepaintFull(); diff --git a/effects/thumbnailaside/thumbnailaside.cpp b/effects/thumbnailaside/thumbnailaside.cpp index f34d38da66..1f18f87c87 100644 --- a/effects/thumbnailaside/thumbnailaside.cpp +++ b/effects/thumbnailaside/thumbnailaside.cpp @@ -35,7 +35,7 @@ KWIN_EFFECT(thumbnailaside, ThumbnailAsideEffect) ThumbnailAsideEffect::ThumbnailAsideEffect() { KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = (KAction*)actionCollection->addAction("ToggleCurrentThumbnail"); + KAction* a = (KAction*)actionCollection->addAction(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_T)); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleCurrentThumbnail())); diff --git a/effects/thumbnailaside/thumbnailaside_config.cpp b/effects/thumbnailaside/thumbnailaside_config.cpp index fc3ad3b9c3..553db1132d 100644 --- a/effects/thumbnailaside/thumbnailaside_config.cpp +++ b/effects/thumbnailaside/thumbnailaside_config.cpp @@ -60,10 +60,10 @@ ThumbnailAsideEffectConfig::ThumbnailAsideEffectConfig(QWidget* parent, const QV // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("ThumbnailAside"); + m_actionCollection->setConfigGroup(QStringLiteral("ThumbnailAside")); m_actionCollection->setConfigGlobal(true); - KAction* a = (KAction*)m_actionCollection->addAction("ToggleCurrentThumbnail"); + KAction* a = (KAction*)m_actionCollection->addAction(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::CTRL + Qt::Key_T)); @@ -82,7 +82,7 @@ ThumbnailAsideEffectConfig::~ThumbnailAsideEffectConfig() void ThumbnailAsideEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("thumbnailaside"); + EffectsHandler::sendReloadMessage(QStringLiteral("thumbnailaside")); } } // namespace diff --git a/effects/trackmouse/trackmouse.cpp b/effects/trackmouse/trackmouse.cpp index e0dc90bd12..600c577844 100644 --- a/effects/trackmouse/trackmouse.cpp +++ b/effects/trackmouse/trackmouse.cpp @@ -61,7 +61,7 @@ TrackMouseEffect::TrackMouseEffect() m_angleBase = 90.0; m_mousePolling = false; KActionCollection *actionCollection = new KActionCollection(this); - m_action = static_cast< KAction* >(actionCollection->addAction("TrackMouse")); + m_action = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("TrackMouse"))); m_action->setText(i18n("Track mouse")); m_action->setGlobalShortcut(KShortcut()); @@ -245,8 +245,8 @@ void TrackMouseEffect::slotMouseChanged(const QPoint&, const QPoint&, void TrackMouseEffect::loadTexture() { - QString f[2] = {KGlobal::dirs()->findResource("appdata", "tm_outer.png"), - KGlobal::dirs()->findResource("appdata", "tm_inner.png")}; + QString f[2] = {KGlobal::dirs()->findResource("appdata", QStringLiteral("tm_outer.png")), + KGlobal::dirs()->findResource("appdata", QStringLiteral("tm_inner.png"))}; if (f[0].isEmpty() || f[1].isEmpty()) return; diff --git a/effects/trackmouse/trackmouse_config.cpp b/effects/trackmouse/trackmouse_config.cpp index 38bebedc8e..b32e449aec 100644 --- a/effects/trackmouse/trackmouse_config.cpp +++ b/effects/trackmouse/trackmouse_config.cpp @@ -56,10 +56,10 @@ TrackMouseEffectConfig::TrackMouseEffectConfig(QWidget* parent, const QVariantLi addConfig(TrackMouseConfig::self(), m_ui); m_actionCollection = new KActionCollection(this, KComponentData("kwin")); - m_actionCollection->setConfigGroup("TrackMouse"); + m_actionCollection->setConfigGroup(QStringLiteral("TrackMouse")); m_actionCollection->setConfigGlobal(true); - KAction *a = static_cast< KAction* >(m_actionCollection->addAction("TrackMouse")); + KAction *a = static_cast< KAction* >(m_actionCollection->addAction(QStringLiteral("TrackMouse"))); a->setText(i18n("Track mouse")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut()); @@ -84,7 +84,7 @@ void TrackMouseEffectConfig::checkModifiers() void TrackMouseEffectConfig::load() { KCModule::load(); - if (KAction *a = qobject_cast(m_actionCollection->action("TrackMouse"))) + if (KAction *a = qobject_cast(m_actionCollection->action(QStringLiteral("TrackMouse")))) m_ui->shortcut->setKeySequence(a->globalShortcut().primary()); checkModifiers(); @@ -95,7 +95,7 @@ void TrackMouseEffectConfig::save() { KCModule::save(); m_actionCollection->writeSettings(); - EffectsHandler::sendReloadMessage("trackmouse"); + EffectsHandler::sendReloadMessage(QStringLiteral("trackmouse")); } void TrackMouseEffectConfig::defaults() @@ -107,7 +107,7 @@ void TrackMouseEffectConfig::defaults() void TrackMouseEffectConfig::shortcutChanged(const QKeySequence &seq) { - if (KAction *a = qobject_cast(m_actionCollection->action("TrackMouse"))) + if (KAction *a = qobject_cast(m_actionCollection->action(QStringLiteral("TrackMouse")))) a->setGlobalShortcut(KShortcut(seq), KAction::ActiveShortcut, KAction::NoAutoloading); // m_actionCollection->writeSettings(); emit changed(true); diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp index 26a15d142f..44ad68aaec 100644 --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -61,7 +61,7 @@ WindowGeometry::WindowGeometry() myMeasure[2]->setAlignment(Qt::AlignRight | Qt::AlignBottom); KActionCollection* actionCollection = new KActionCollection(this); - KAction* a = static_cast< KAction* >(actionCollection->addAction("WindowGeometry")); + KAction* a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("WindowGeometry"))); a->setText(i18n("Toggle window geometry display (effect only)")); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_F11)); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle())); @@ -130,12 +130,12 @@ static inline QString number(int n) QString sign; if (n >= 0) { sign = KGlobal::locale()->positiveSign(); - if (sign.isEmpty()) sign = '+'; + if (sign.isEmpty()) sign = QStringLiteral("+"); } else { n = -n; sign = KGlobal::locale()->negativeSign(); - if (sign.isEmpty()) sign = '-'; + if (sign.isEmpty()) sign = QStringLiteral("-"); } return sign + QString::number(n); } diff --git a/effects/windowgeometry/windowgeometry_config.cpp b/effects/windowgeometry/windowgeometry_config.cpp index 3b5345b786..676cdd973f 100644 --- a/effects/windowgeometry/windowgeometry_config.cpp +++ b/effects/windowgeometry/windowgeometry_config.cpp @@ -45,7 +45,7 @@ WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList& // Shortcut config. The shortcut belongs to the component "kwin"! myActionCollection = new KActionCollection(this, KComponentData("kwin")); - KAction* a = (KAction*)myActionCollection->addAction("WindowGeometry"); + KAction* a = (KAction*)myActionCollection->addAction(QStringLiteral("WindowGeometry")); a->setText(i18n("Toggle KWin composited geometry display")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_F11)); @@ -68,7 +68,7 @@ void WindowGeometryConfig::save() { KCModule::save(); myUi->shortcuts->save(); // undo() will restore to this state from now on - EffectsHandler::sendReloadMessage("windowgeometry"); + EffectsHandler::sendReloadMessage(QStringLiteral("windowgeometry")); } void WindowGeometryConfig::defaults() diff --git a/effects/wobblywindows/wobblywindows.cpp b/effects/wobblywindows/wobblywindows.cpp index ad1842cdb6..0deba19dc2 100644 --- a/effects/wobblywindows/wobblywindows.cpp +++ b/effects/wobblywindows/wobblywindows.cpp @@ -177,7 +177,7 @@ void WobblyWindowsEffect::reconfigure(ReconfigureFlags) WobblyWindowsConfig::self()->readConfig(); QString settingsMode = WobblyWindowsConfig::settings(); - if (settingsMode != "Custom") { + if (settingsMode != QStringLiteral("Custom")) { unsigned int wobblynessLevel = WobblyWindowsConfig::wobblynessLevel(); if (wobblynessLevel > 4) { kDebug(1212) << "Wrong value for \"WobblynessLevel\" : " << wobblynessLevel; diff --git a/effects/wobblywindows/wobblywindows_config.cpp b/effects/wobblywindows/wobblywindows_config.cpp index d9ae7255ff..c35de4d4e0 100644 --- a/effects/wobblywindows/wobblywindows_config.cpp +++ b/effects/wobblywindows/wobblywindows_config.cpp @@ -97,7 +97,7 @@ void WobblyWindowsEffectConfig::save() { KCModule::save(); - EffectsHandler::sendReloadMessage("wobblywindows"); + EffectsHandler::sendReloadMessage(QStringLiteral("wobblywindows")); } void WobblyWindowsEffectConfig::wobblinessChanged() diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 83e7aacb26..470425f28b 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -75,33 +75,33 @@ ZoomEffect::ZoomEffect() a = static_cast< KAction* >(actionCollection->addAction(KStandardAction::ActualSize, this, SLOT(actualSize()))); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_0)); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomLeft")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomLeft"))); a->setText(i18n("Move Zoomed Area to Left")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Left)); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomLeft())); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomRight")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomRight"))); a->setText(i18n("Move Zoomed Area to Right")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Right)); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomRight())); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomUp")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomUp"))); a->setText(i18n("Move Zoomed Area Upwards")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Up)); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomUp())); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomDown")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomDown"))); a->setText(i18n("Move Zoomed Area Downwards")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Down)); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomDown())); // TODO: these two actions don't belong into the effect. They need to be moved into KWin core - a = static_cast< KAction* >(actionCollection->addAction("MoveMouseToFocus")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveMouseToFocus"))); a->setText(i18n("Move Mouse to Focus")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_F5)); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveMouseToFocus())); - a = static_cast< KAction* >(actionCollection->addAction("MoveMouseToCenter")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveMouseToCenter"))); a->setText(i18n("Move Mouse to Center")); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_F6)); connect(a, SIGNAL(triggered(bool)), this, SLOT(moveMouseToCenter())); @@ -121,7 +121,7 @@ ZoomEffect::~ZoomEffect() // switch off and free resources showCursor(); // Save the zoom value. - KConfigGroup conf = EffectsHandler::effectConfig("Zoom"); + KConfigGroup conf = EffectsHandler::effectConfig(QStringLiteral("Zoom")); conf.writeEntry("InitialZoom", target_zoom); conf.sync(); } @@ -164,7 +164,7 @@ void ZoomEffect::hideCursor() void ZoomEffect::recreateTexture() { // read details about the mouse-cursor theme define per default - KConfigGroup mousecfg(KSharedConfig::openConfig("kcminputrc"), "Mouse"); + KConfigGroup mousecfg(KSharedConfig::openConfig(QStringLiteral("kcminputrc")), "Mouse"); QString theme = mousecfg.readEntry("cursorTheme", QString()); QString size = mousecfg.readEntry("cursorSize", QString()); @@ -175,7 +175,7 @@ void ZoomEffect::recreateTexture() iconSize = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); // load the cursor-theme image from the Xcursor-library - XcursorImage *ximg = XcursorLibraryLoadImage("left_ptr", theme.toLocal8Bit(), iconSize); + XcursorImage *ximg = XcursorLibraryLoadImage("left_ptr", theme.toLocal8Bit().constData(), iconSize); if (!ximg) // default is better then nothing, so keep it as backup ximg = XcursorLibraryLoadImage("left_ptr", "default", iconSize); if (ximg) { @@ -212,9 +212,17 @@ void ZoomEffect::reconfigure(ReconfigureFlags) enableFocusTracking = _enableFocusTracking; if (QDBusConnection::sessionBus().isConnected()) { if (enableFocusTracking) - QDBusConnection::sessionBus().connect("org.kde.kaccessibleapp", "/Adaptor", "org.kde.kaccessibleapp.Adaptor", "focusChanged", this, SLOT(focusChanged(int,int,int,int,int,int))); + QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.kaccessibleapp"), + QStringLiteral("/Adaptor"), + QStringLiteral("org.kde.kaccessibleapp.Adaptor"), + QStringLiteral("focusChanged"), + this, SLOT(focusChanged(int,int,int,int,int,int))); else - QDBusConnection::sessionBus().disconnect("org.kde.kaccessibleapp", "/Adaptor", "org.kde.kaccessibleapp.Adaptor", "focusChanged", this, SLOT(focusChanged(int,int,int,int,int,int))); + QDBusConnection::sessionBus().disconnect(QStringLiteral("org.kde.kaccessibleapp"), + QStringLiteral("/Adaptor"), + QStringLiteral("org.kde.kaccessibleapp.Adaptor"), + QStringLiteral("focusChanged"), + this, SLOT(focusChanged(int,int,int,int,int,int))); } } // When the focus changes, move the zoom area to the focused location. diff --git a/effects/zoom/zoom_config.cpp b/effects/zoom/zoom_config.cpp index 00f6c29902..f867343669 100644 --- a/effects/zoom/zoom_config.cpp +++ b/effects/zoom/zoom_config.cpp @@ -55,7 +55,7 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : // Shortcut config. The shortcut belongs to the component "kwin"! KActionCollection *actionCollection = new KActionCollection(this, KComponentData("kwin")); - actionCollection->setConfigGroup("Zoom"); + actionCollection->setConfigGroup(QStringLiteral("Zoom")); actionCollection->setConfigGlobal(true); KAction* a; @@ -71,38 +71,38 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_0)); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomLeft")); - a->setIcon(KIcon("go-previous")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomLeft"))); + a->setIcon(KIcon(QStringLiteral("go-previous"))); a->setText(i18n("Move Left")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Left)); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomRight")); - a->setIcon(KIcon("go-next")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomRight"))); + a->setIcon(KIcon(QStringLiteral("go-next"))); a->setText(i18n("Move Right")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Right)); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomUp")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomUp"))); a->setIcon(KIcon("go-up")); a->setText(i18n("Move Up")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Up)); - a = static_cast< KAction* >(actionCollection->addAction("MoveZoomDown")); - a->setIcon(KIcon("go-down")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveZoomDown"))); + a->setIcon(KIcon(QStringLiteral("go-down"))); a->setText(i18n("Move Down")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_Down)); - a = static_cast< KAction* >(actionCollection->addAction("MoveMouseToFocus")); - a->setIcon(KIcon("view-restore")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveMouseToFocus"))); + a->setIcon(KIcon(QStringLiteral("view-restore"))); a->setText(i18n("Move Mouse to Focus")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_F5)); - a = static_cast< KAction* >(actionCollection->addAction("MoveMouseToCenter")); - a->setIcon(KIcon("view-restore")); + a = static_cast< KAction* >(actionCollection->addAction(QStringLiteral("MoveMouseToCenter"))); + a->setIcon(KIcon(QStringLiteral("view-restore"))); a->setText(i18n("Move Mouse to Center")); a->setProperty("isConfigurationAction", true); a->setGlobalShortcut(KShortcut(Qt::META + Qt::Key_F6)); @@ -121,7 +121,7 @@ void ZoomEffectConfig::save() { m_ui->editor->save(); // undo() will restore to this state from now on KCModule::save(); - EffectsHandler::sendReloadMessage("zoom"); + EffectsHandler::sendReloadMessage(QStringLiteral("zoom")); } } // namespace diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 331574a46a..73c3ff4ca9 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -59,23 +59,23 @@ static bool gs_tripleBufferNeedsDetection = false; void EglOnXBackend::init() { if (!initRenderingContext()) { - setFailed("Could not initialize rendering context"); + setFailed(QStringLiteral("Could not initialize rendering context")); return; } initEGL(); - if (!hasGLExtension("EGL_KHR_image") && - (!hasGLExtension("EGL_KHR_image_base") || - !hasGLExtension("EGL_KHR_image_pixmap"))) { - setFailed("Required support for binding pixmaps to EGLImages not found, disabling compositing"); + if (!hasGLExtension(QStringLiteral("EGL_KHR_image")) && + (!hasGLExtension(QStringLiteral("EGL_KHR_image_base")) || + !hasGLExtension(QStringLiteral("EGL_KHR_image_pixmap")))) { + setFailed(QStringLiteral("Required support for binding pixmaps to EGLImages not found, disabling compositing")); return; } GLPlatform *glPlatform = GLPlatform::instance(); glPlatform->detect(EglPlatformInterface); glPlatform->printResults(); initGL(EglPlatformInterface); - if (!hasGLExtension("GL_OES_EGL_image")) { - setFailed("Required extension GL_OES_EGL_image not found, disabling compositing"); + if (!hasGLExtension(QStringLiteral("GL_OES_EGL_image"))) { + setFailed(QStringLiteral("Required extension GL_OES_EGL_image not found, disabling compositing")); return; } @@ -84,7 +84,7 @@ void EglOnXBackend::init() if (eglQuerySurface(dpy, surface, EGL_POST_SUB_BUFFER_SUPPORTED_NV, &surfaceHasSubPost) == EGL_FALSE) { EGLint error = eglGetError(); if (error != EGL_SUCCESS && error != EGL_BAD_ATTRIBUTE) { - setFailed("query surface failed"); + setFailed(QStringLiteral("query surface failed")); return; } else { surfaceHasSubPost = EGL_FALSE; diff --git a/glxbackend.cpp b/glxbackend.cpp index 65f257d7af..aa4b1411f5 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -77,19 +77,19 @@ void GlxBackend::init() initGLX(); // require at least GLX 1.3 if (!hasGLXVersion(1, 3)) { - setFailed("Requires at least GLX 1.3"); + setFailed(QStringLiteral("Requires at least GLX 1.3")); return; } if (!initDrawableConfigs()) { - setFailed("Could not initialize the drawable configs"); + setFailed(QStringLiteral("Could not initialize the drawable configs")); return; } if (!initBuffer()) { - setFailed("Could not initialize the buffer"); + setFailed(QStringLiteral("Could not initialize the buffer")); return; } if (!initRenderingContext()) { - setFailed("Could not initialize rendering context"); + setFailed(QStringLiteral("Could not initialize rendering context")); return; } // Initialize OpenGL @@ -172,7 +172,7 @@ bool GlxBackend::initRenderingContext() 0 }; - const bool have_robustness = hasGLExtension("GLX_ARB_create_context_robustness"); + const bool have_robustness = hasGLExtension(QStringLiteral("GLX_ARB_create_context_robustness")); // Try to create a 3.1 context first if (options->glCoreProfile()) { diff --git a/group.cpp b/group.cpp index 7d6f4562ce..9b6e3f4b6c 100644 --- a/group.cpp +++ b/group.cpp @@ -437,8 +437,8 @@ void Workspace::checkTransients(xcb_window_t w) bool Toplevel::resourceMatch(const Toplevel* c1, const Toplevel* c2) { // xv has "xv" as resource name, and different strings starting with "XV" as resource class - if (qstrncmp(c1->resourceClass(), "xv", 2) == 0 && c1->resourceName() == "xv") - return qstrncmp(c2->resourceClass(), "xv", 2) == 0 && c2->resourceName() == "xv"; + if (qstrncmp(c1->resourceClass().constData(), "xv", 2) == 0 && c1->resourceName() == "xv") + return qstrncmp(c2->resourceClass().constData(), "xv", 2) == 0 && c2->resourceName() == "xv"; // Mozilla has "Mozilla" as resource name, and different strings as resource class if (c1->resourceName() == "mozilla") return c2->resourceName() == "mozilla"; diff --git a/killer/killer.cpp b/killer/killer.cpp index 56f9ae4ad4..c6ca62dde0 100644 --- a/killer/killer.cpp +++ b/killer/killer.cpp @@ -52,7 +52,7 @@ int main(int argc, char* argv[]) options.add("timestamp