Commit 42db8781 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use nullptr. Port some code for compiling with strict flags

parent 3d5e8fe1
......@@ -112,7 +112,7 @@ void ActivityRunner::match(Plasma::RunnerContext &context)
QList<Plasma::QueryMatch> matches;
QStringList activities = m_consumer->activities();
qSort(activities);
std::sort(activities.begin(), activities.end());
const QString current = m_activities->currentActivity();
......
......@@ -69,8 +69,8 @@ SearchRunner::SearchRunner(QObject* parent)
qDBusRegisterMetaType<RemoteMatches>();
qDBusRegisterMetaType<RemoteAction>();
qDBusRegisterMetaType<RemoteActions>();
QDBusConnection::sessionBus().registerObject("/runner", this);
QDBusConnection::sessionBus().registerService("org.kde.runners.baloo");
QDBusConnection::sessionBus().registerObject(QStringLiteral("/runner"), this);
QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.runners.baloo"));
}
SearchRunner::~SearchRunner()
......@@ -164,9 +164,9 @@ RemoteMatches SearchRunner::matchInternal(const QString& searchTerm, const QStri
folderPath.replace(0, QDir::homePath().length(), QStringLiteral("~"));
}
properties["urls"] = QStringList({url.toEncoded()});
properties["subtext"] = folderPath;
properties["category"] = category;
properties[QStringLiteral("urls")] = QStringList({QString::fromLocal8Bit(url.toEncoded())});
properties[QStringLiteral("subtext")] = folderPath;
properties[QStringLiteral("category")] = category;
match.properties = properties;
relevance -= 0.05;
......
......@@ -72,7 +72,7 @@ FaviconFromBlob *FaviconFromBlob::chrome(const QString &profileDirectory, QObjec
QString profileName = QFileInfo(profileDirectory).fileName();
QString faviconCache = QStringLiteral("%1/KRunner-Chrome-Favicons-%2.sqlite")
.arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), profileName);
FetchSqlite *fetchSqlite = new FetchSqlite(profileDirectory + "/Favicons", faviconCache, parent);
FetchSqlite *fetchSqlite = new FetchSqlite(profileDirectory + QStringLiteral("/Favicons"), faviconCache, parent);
return new FaviconFromBlob(profileName, new ChromeQuery(), QStringLiteral("image_data"), fetchSqlite, parent);
}
......@@ -125,7 +125,7 @@ QIcon FaviconFromBlob::iconFor(const QString &url)
{
//qDebug() << "got url: " << url;
QString fileChecksum = QString::number(qChecksum(url.toLatin1(), url.toLatin1().size()));
QFile iconFile( m_profileCacheDirectory + QDir::separator() + fileChecksum + "_favicon" );
QFile iconFile( m_profileCacheDirectory + QDir::separator() + fileChecksum + QStringLiteral("_favicon") );
if(iconFile.size() == 0)
iconFile.remove();
if(!iconFile.exists()) {
......
......@@ -82,9 +82,9 @@ void CalculatorRunner::powSubstitutions(QString& cmd)
// the below code is scary mainly because we have to honor priority
// honor decimal numbers and parenthesis.
while (cmd.contains('^')) {
int where = cmd.indexOf('^');
cmd = cmd.replace(where, 1, ',');
while (cmd.contains(QLatin1Char('^'))) {
int where = cmd.indexOf(QLatin1Char('^'));
cmd = cmd.replace(where, 1, QLatin1Char(','));
int preIndex = where - 1;
int postIndex = where + 1;
int count = 0;
......@@ -99,19 +99,19 @@ void CalculatorRunner::powSubstitutions(QString& cmd)
QChar current = cmd.at(preIndex);
QChar next = cmd.at(preIndex-1);
//qDebug() << "index " << preIndex << " char " << current;
if (current == ')') {
if (current == QLatin1Char(')')) {
count++;
} else if (current == '(') {
} else if (current == QLatin1Char('(')) {
count--;
} else {
if (((next <= '9' ) && (next >= '0')) || next == decimalSymbol) {
if (((next <= QLatin1Char('9') ) && (next >= QLatin1Char('0'))) || next == decimalSymbol) {
preIndex--;
continue;
}
}
if (count == 0) {
//check for functions
if (!((next <= 'z' ) && (next >= 'a'))) {
if (!((next <= QLatin1Char('z') ) && (next >= QLatin1Char('a')))) {
break;
}
}
......@@ -125,17 +125,17 @@ void CalculatorRunner::powSubstitutions(QString& cmd)
QChar next=cmd.at(postIndex + 1);
//check for functions
if ((count == 0) && (current <= 'z') && (current >= 'a')) {
if ((count == 0) && (current <= QLatin1Char('z')) && (current >= QLatin1Char('a'))) {
postIndex++;
continue;
}
if (current == '(') {
if (current == QLatin1Char('(')) {
count++;
} else if (current == ')') {
} else if (current == QLatin1Char(')')) {
count--;
} else {
if (((next <= '9' ) && (next >= '0')) || next == decimalSymbol) {
if (((next <= QLatin1Char('9') ) && (next >= QLatin1Char('0'))) || next == decimalSymbol) {
postIndex++;
continue;
}
......@@ -151,7 +151,7 @@ void CalculatorRunner::powSubstitutions(QString& cmd)
cmd.insert(preIndex,QLatin1String("pow("));
// +1 +4 == next position to the last number after we add 4 new characters pow(
cmd.insert(postIndex + 1 + 4, ')');
cmd.insert(postIndex + 1 + 4, QLatin1Char(')'));
//qDebug() << "from" << preIndex << " to " << postIndex << " got: " << cmd;
}
}
......@@ -160,7 +160,7 @@ void CalculatorRunner::hexSubstitutions(QString& cmd)
{
if (cmd.contains(QStringLiteral("0x"))) {
//Append +0 so that the calculator can serve also as a hex converter
cmd.append("+0");
cmd.append(QStringLiteral("+0"));
bool ok;
int pos = 0;
QString hex;
......@@ -171,7 +171,9 @@ void CalculatorRunner::hexSubstitutions(QString& cmd)
for (int q = 0; q < cmd.size(); q++) {//find end of hex number
QChar current = cmd[pos+q+2];
if (((current <= '9' ) && (current >= '0')) || ((current <= 'F' ) && (current >= 'A')) || ((current <= 'f' ) && (current >= 'a'))) { //Check if valid hex sign
if (((current <= QLatin1Char('9') ) && (current >= QLatin1Char('0')))
|| ((current <= QLatin1Char('F') ) && (current >= QLatin1Char('A')))
|| ((current <= QLatin1Char('f') ) && (current >= QLatin1Char('a')))) { //Check if valid hex sign
hex[q] = current;
} else {
break;
......@@ -185,7 +187,7 @@ void CalculatorRunner::hexSubstitutions(QString& cmd)
void CalculatorRunner::userFriendlySubstitutions(QString& cmd)
{
if (cmd.contains(QLocale().decimalPoint(), Qt::CaseInsensitive)) {
cmd=cmd.replace(QLocale().decimalPoint(), QChar('.'), Qt::CaseInsensitive);
cmd=cmd.replace(QLocale().decimalPoint(), QLatin1Char('.'), Qt::CaseInsensitive);
}
// the following substitutions are not needed with libqalculate
......@@ -212,7 +214,7 @@ void CalculatorRunner::match(Plasma::RunnerContext &context)
QString cmd = term;
//no meanless space between friendly guys: helps simplify code
cmd = cmd.trimmed().remove(' ');
cmd = cmd.trimmed().remove(QLatin1Char(' '));
if (cmd.length() < 3) {
return;
......@@ -223,18 +225,18 @@ void CalculatorRunner::match(Plasma::RunnerContext &context)
match.setType(Plasma::QueryMatch::InformationalMatch);
match.setIconName(QStringLiteral("accessories-calculator"));
match.setText(QStringLiteral("42"));
match.setData("42");
match.setData(QStringLiteral("42"));
match.setId(term);
context.addMatch(match);
return;
}
bool toHex = cmd.startsWith(QLatin1String("hex="));
bool startsWithEquals = !toHex && cmd[0] == '=';
bool startsWithEquals = !toHex && cmd[0] == QLatin1Char('=');
if (toHex || startsWithEquals) {
cmd.remove(0, cmd.indexOf('=') + 1);
} else if (cmd.endsWith('=')) {
cmd.remove(0, cmd.indexOf(QLatin1Char('=')) + 1);
} else if (cmd.endsWith(QLatin1Char('='))) {
cmd.chop(1);
} else {
bool foundDigit = false;
......@@ -266,7 +268,7 @@ void CalculatorRunner::match(Plasma::RunnerContext &context)
QString result = calculate(cmd, &isApproximate);
if (!result.isEmpty() && result != cmd) {
if (toHex) {
result = "0x" + QString::number(result.toInt(), 16).toUpper();
result = QStringLiteral("0x") + QString::number(result.toInt(), 16).toUpper();
}
Plasma::QueryMatch match(this);
......@@ -293,7 +295,7 @@ QString CalculatorRunner::calculate(const QString& term, bool *isApproximate)
qDebug() << "qalculate error: " << e.what();
}
return result.replace('.', QLocale().decimalPoint(), Qt::CaseInsensitive);
return result.replace(QLatin1Char('.'), QLocale().decimalPoint(), Qt::CaseInsensitive);
#else
Q_UNUSED(isApproximate);
//qDebug() << "calculating" << term;
......@@ -309,7 +311,7 @@ QString CalculatorRunner::calculate(const QString& term, bool *isApproximate)
return QString();
}
if (!resultString.contains('.')) {
if (!resultString.contains(QLatin1Char('.'))) {
return resultString;
}
......@@ -319,7 +321,7 @@ QString CalculatorRunner::calculate(const QString& term, bool *isApproximate)
var order=Math.pow(10,exponent);\
(order > 0? Math.round(result*order)/order : 0)")).toString();
roundedResultString.replace('.', QLocale().decimalPoint(), Qt::CaseInsensitive);
roundedResultString.replace(QLatin1Char('.'), QLocale().decimalPoint(), Qt::CaseInsensitive);
return roundedResultString;
#endif
......
......@@ -60,12 +60,12 @@ void KillRunner::reloadConfiguration()
KConfigGroup grp = config();
m_triggerWord.clear();
if (grp.readEntry(CONFIG_USE_TRIGGERWORD, true)) {
m_triggerWord = grp.readEntry(CONFIG_TRIGGERWORD, i18n("kill")) + ' ';
m_triggerWord = grp.readEntry(CONFIG_TRIGGERWORD, i18n("kill")) + QLatin1Char(' ');
}
m_sorting = (KillRunnerConfig::Sort) grp.readEntry(CONFIG_SORTING, 0);
QList<Plasma::RunnerSyntax> syntaxes;
syntaxes << Plasma::RunnerSyntax(m_triggerWord + ":q:",
syntaxes << Plasma::RunnerSyntax(m_triggerWord + QStringLiteral(":q:"),
i18n("Terminate running applications whose names match the query."));
setSyntaxes(syntaxes);
}
......
......@@ -24,7 +24,7 @@
#include <KPluginFactory>
#include <krunner/abstractrunner.h>
K_PLUGIN_FACTORY(KillRunnerConfigFactory, registerPlugin<KillRunnerConfig>("kcm_krunner_kill");)
K_PLUGIN_FACTORY(KillRunnerConfigFactory, registerPlugin<KillRunnerConfig>(QStringLiteral("kcm_krunner_kill"));)
KillRunnerConfigForm::KillRunnerConfigForm(QWidget* parent) : QWidget(parent)
{
......
......@@ -145,9 +145,9 @@ void PowerDevilRunner::match(Plasma::RunnerContext &context)
QString parameter;
if (parseQuery(term,
QList<QRegExp>() << QRegExp(i18nc("Note this is a KRunner keyword; %1 is a parameter", "screen brightness %1", "(.*)"), Qt::CaseInsensitive)
QList<QRegExp>() << QRegExp(i18nc("Note this is a KRunner keyword; %1 is a parameter", "screen brightness %1", QStringLiteral("(.*)")), Qt::CaseInsensitive)
<< QRegExp(i18nc("Note this is a KRunner keyword", "screen brightness"), Qt::CaseInsensitive)
<< QRegExp(i18nc("Note this is a KRunner keyword; %1 is a parameter", "dim screen %1", "(.*)"), Qt::CaseInsensitive)
<< QRegExp(i18nc("Note this is a KRunner keyword; %1 is a parameter", "dim screen %1", QStringLiteral("(.*)")), Qt::CaseInsensitive)
<< QRegExp(i18nc("Note this is a KRunner keyword", "dim screen"), Qt::CaseInsensitive),
parameter)) {
if (!parameter.isEmpty()) {
......
......@@ -55,7 +55,7 @@ void ServiceRunnerTest::initTestCase()
auto source = fileInfo.absoluteFilePath();
auto target = appsPath + QDir::separator() + fileInfo.fileName();
QVERIFY2(QFile::copy(fileInfo.absoluteFilePath(), target),
qPrintable(QString("can't copy %1 => %2").arg(source, target)));
qPrintable(QStringLiteral("can't copy %1 => %2").arg(source, target)));
}
setlocale(LC_ALL, "C.utf8");
......@@ -76,7 +76,7 @@ void ServiceRunnerTest::testChromeAppsRelevance()
{
ServiceRunner runner(this, QVariantList());
Plasma::RunnerContext context;
context.setQuery("chrome");
context.setQuery(QStringLiteral("chrome"));
runner.match(context);
......@@ -84,14 +84,14 @@ void ServiceRunnerTest::testChromeAppsRelevance()
bool signalFound = false;
for (auto match : context.matches()) {
qDebug() << "matched" << match.text();
if (!match.text().contains("ServiceRunnerTest")) {
if (!match.text().contains(QStringLiteral("ServiceRunnerTest"))) {
continue;
}
if (match.text() == "Google Chrome ServiceRunnerTest") {
if (match.text() == QStringLiteral("Google Chrome ServiceRunnerTest")) {
QCOMPARE(match.relevance(), 0.8);
chromeFound = true;
} else if (match.text() == "Signal ServiceRunnerTest") {
} else if (match.text() == QStringLiteral("Signal ServiceRunnerTest")) {
// Rates lower because it doesn't have it in the name.
QCOMPARE(match.relevance(), 0.7);
signalFound = true;
......@@ -106,7 +106,7 @@ void ServiceRunnerTest::testKonsoleVsYakuakeComment()
// Yakuake has konsole mentioned in comment, should be rated lower.
ServiceRunner runner(this, QVariantList());
Plasma::RunnerContext context;
context.setQuery("kons");
context.setQuery(QStringLiteral("kons"));
runner.match(context);
......@@ -114,14 +114,14 @@ void ServiceRunnerTest::testKonsoleVsYakuakeComment()
bool yakuakeFound = false;
for (auto match : context.matches()) {
qDebug() << "matched" << match.text();
if (!match.text().contains("ServiceRunnerTest")) {
if (!match.text().contains(QStringLiteral("ServiceRunnerTest"))) {
continue;
}
if (match.text() == "Konsole ServiceRunnerTest") {
if (match.text() == QStringLiteral("Konsole ServiceRunnerTest")) {
QCOMPARE(match.relevance(), 0.99);
konsoleFound = true;
} else if (match.text() == "Yakuake ServiceRunnerTest") {
} else if (match.text() == QStringLiteral("Yakuake ServiceRunnerTest")) {
// Rates lower because it doesn't have it in the name.
QCOMPARE(match.relevance(), 0.59);
yakuakeFound = true;
......@@ -140,7 +140,7 @@ void ServiceRunnerTest::testSystemSettings()
// seen it. This test makes sure we find the right version.
ServiceRunner runner(this, QVariantList());
Plasma::RunnerContext context;
context.setQuery("settings");
context.setQuery(QStringLiteral("settings"));
runner.match(context);
......@@ -148,10 +148,10 @@ void ServiceRunnerTest::testSystemSettings()
bool foreignSystemSettingsFound = false;
for (auto match : context.matches()) {
qDebug() << "matched" << match.text();
if (match.text() == "System Settings ServiceRunnerTest") {
if (match.text() == QStringLiteral("System Settings ServiceRunnerTest")) {
systemSettingsFound = true;
}
if (match.text() == "KDE System Settings ServiceRunnerTest") {
if (match.text() == QStringLiteral("KDE System Settings ServiceRunnerTest")) {
foreignSystemSettingsFound = true;
}
}
......
......@@ -111,19 +111,19 @@ private:
for(int i=1; i<strList.size(); i++)
{
if (category == "Name") {
if (category == QLatin1String("Name")) {
if (service->name().contains(strList[i], Qt::CaseInsensitive)) {
relevanceIncrement += 0.01;
}
} else if (category == "GenericName") {
} else if (category == QLatin1String("GenericName")) {
if (service->genericName().contains(strList[i], Qt::CaseInsensitive)) {
relevanceIncrement += 0.01;
}
} else if (category == "Exec") {
} else if (category == QLatin1String("Exec")) {
if (service->exec().contains(strList[i], Qt::CaseInsensitive)) {
relevanceIncrement += 0.01;
}
} else if (category == "Comment") {
} else if (category == QLatin1String("Comment")) {
if (service->comment().contains(strList[i], Qt::CaseInsensitive)) {
relevanceIncrement += 0.01;
}
......@@ -135,10 +135,10 @@ private:
QString generateQuery(QVector<QStringRef> &strList)
{
QString keywordTemplate = "exist Keywords";
QString genericNameTemplate = "exist GenericName";
QString nameTemplate = "exist Name";
QString commentTemplate = "exist Comment";
QString keywordTemplate = QStringLiteral("exist Keywords");
QString genericNameTemplate = QStringLiteral("exist GenericName");
QString nameTemplate = QStringLiteral("exist Name");
QString commentTemplate = QStringLiteral("exist Comment");
// Search for applications which are executable and the term case-insensitive matches any of
// * a substring of one of the keywords
......@@ -148,10 +148,10 @@ private:
// they exist to prevent a tree evaluation error if they are not defined.
foreach (QStringRef str, strList)
{
keywordTemplate += QString(" and '%1' ~subin Keywords").arg(str.toString());
genericNameTemplate += QString(" and '%1' ~~ GenericName").arg(str.toString());
nameTemplate += QString(" and '%1' ~~ Name").arg(str.toString());
commentTemplate += QString(" and '%1' ~~ Comment").arg(str.toString());
keywordTemplate += QStringLiteral(" and '%1' ~subin Keywords").arg(str.toString());
genericNameTemplate += QStringLiteral(" and '%1' ~~ GenericName").arg(str.toString());
nameTemplate += QStringLiteral(" and '%1' ~~ Name").arg(str.toString());
commentTemplate += QStringLiteral(" and '%1' ~~ Comment").arg(str.toString());
}
QString finalQuery = QStringLiteral("exist Exec and ( (%1) or (%2) or (%3) or ('%4' ~~ Exec) or (%5) )")
......@@ -249,28 +249,28 @@ private:
}
} else if (service->name().contains(queryList[0], Qt::CaseInsensitive)) {
relevance = 0.8;
relevance += increaseMatchRelavance(service, queryList, "Name");
relevance += increaseMatchRelavance(service, queryList, QStringLiteral("Name"));
if (service->name().startsWith(queryList[0], Qt::CaseInsensitive)) {
relevance += 0.1;
}
} else if (service->genericName().contains(queryList[0], Qt::CaseInsensitive)) {
relevance = 0.65;
relevance += increaseMatchRelavance(service, queryList, "GenericName");
relevance += increaseMatchRelavance(service, queryList, QStringLiteral("GenericName"));
if (service->genericName().startsWith(queryList[0], Qt::CaseInsensitive)) {
relevance += 0.05;
}
} else if (service->exec().contains(queryList[0], Qt::CaseInsensitive)) {
relevance = 0.7;
relevance += increaseMatchRelavance(service, queryList, "Exec");
relevance += increaseMatchRelavance(service, queryList, QStringLiteral("Exec"));
if (service->exec().startsWith(queryList[0], Qt::CaseInsensitive)) {
relevance += 0.05;
}
} else if (service->comment().contains(queryList[0], Qt::CaseInsensitive)) {
relevance = 0.5;
relevance += increaseMatchRelavance(service, queryList, "Comment");
relevance += increaseMatchRelavance(service, queryList, QStringLiteral("Comment"));
if (service->comment().startsWith(queryList[0], Qt::CaseInsensitive)) {
relevance += 0.05;
......@@ -290,7 +290,7 @@ private:
QString subtext(QStringLiteral("KDE3"));
if (!match.subtext().isEmpty()) {
subtext.append(", " + match.subtext());
subtext.append(QStringLiteral(", ") + match.subtext());
}
match.setSubtext(subtext);
......
......@@ -130,7 +130,7 @@ void WebshortcutRunner::match(Plasma::RunnerContext &context)
m_lastProvider = filterData.searchProvider();
m_match.setData(filterData.uri());
m_match.setId("WebShortcut:" + key);
m_match.setId(QStringLiteral("WebShortcut:") + key);
m_match.setIconName(filterData.iconName());
m_match.setText(i18n("Search %1 for %2", m_lastProvider, filterData.searchTerm()));
......
......@@ -40,7 +40,7 @@ WindowsRunner::WindowsRunner(QObject* parent, const QVariantList& args)
m_ready(false)
{
Q_UNUSED(args)
setObjectName( QLatin1String("Windows" ));
setObjectName( QLatin1String("Windows") );
addSyntax(Plasma::RunnerSyntax(QStringLiteral(":q:"), i18n("Finds windows whose name, window class or window role match :q:. "
"It is possible to interact with the windows by using one of the following keywords: "
......@@ -183,13 +183,13 @@ void WindowsRunner::match(Plasma::RunnerContext& context)
if (keyword.endsWith(QLatin1Char('='))) {
continue;
}
if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "name") + "=" , Qt::CaseInsensitive)) {
if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "name") + QStringLiteral("=") , Qt::CaseInsensitive)) {
windowName = keyword.split(QStringLiteral("="))[1];
} else if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "class") + "=" , Qt::CaseInsensitive)) {
} else if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "class") + QStringLiteral("=") , Qt::CaseInsensitive)) {
windowClass = keyword.split(QStringLiteral("="))[1];
} else if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "role") + "=" , Qt::CaseInsensitive)) {
} else if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "role") + QStringLiteral("=") , Qt::CaseInsensitive)) {
windowRole = keyword.split(QStringLiteral("="))[1];
} else if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "desktop") + "=" , Qt::CaseInsensitive)) {
} else if (keyword.startsWith(i18nc("Note this is a KRunner keyword", "desktop") + QStringLiteral("=") , Qt::CaseInsensitive)) {
bool ok;
desktop = keyword.split(QStringLiteral("="))[1].toInt(&ok);
if (!ok || desktop > KWindowSystem::numberOfDesktops()) {
......@@ -197,7 +197,7 @@ void WindowsRunner::match(Plasma::RunnerContext& context)
}
} else {
// not a keyword - use as name if name is unused, but another option is set
if (windowName.isEmpty() && !keyword.contains('=') &&
if (windowName.isEmpty() && !keyword.contains(QLatin1Char('=')) &&
(!windowRole.isEmpty() || !windowClass.isEmpty() || desktop != -1)) {
windowName = keyword;
}
......@@ -208,7 +208,7 @@ void WindowsRunner::match(Plasma::RunnerContext& context)
it.next();
WId w = it.key();
KWindowInfo info = it.value();
QString windowClassCompare = QString::fromUtf8(info.windowClassName()) + " " +
QString windowClassCompare = QString::fromUtf8(info.windowClassName()) + QLatin1Char(' ') +
QString::fromUtf8(info.windowClassClass());
// exclude not matching windows
if (!KWindowSystem::hasWId(w)) {
......@@ -398,7 +398,7 @@ Plasma::QueryMatch WindowsRunner::desktopMatch(int desktop, qreal relevance)
Plasma::QueryMatch match(this);
match.setType(Plasma::QueryMatch::ExactMatch);
match.setData(desktop);
match.setId("desktop-" + QString::number(desktop));
match.setId(QStringLiteral("desktop-") + QString::number(desktop));
match.setIconName(QStringLiteral("user-desktop"));
QString desktopName;
if (desktop <= m_desktopNames.size()) {
......@@ -416,7 +416,7 @@ Plasma::QueryMatch WindowsRunner::windowMatch(const KWindowInfo& info, WindowAct
{
Plasma::QueryMatch match(this);
match.setType(type);
match.setData(QString(QString::number((int)action) + "_" + QString::number(info.win())));
match.setData(QString(QString::number((int)action) + QLatin1Char('_') + QString::number(info.win())));
match.setIcon(m_icons[info.win()]);
match.setText(info.name());
QString desktopName;
......
......@@ -47,13 +47,7 @@
//////////////////////////////ContainmentConfigView
ContainmentConfigView::ContainmentConfigView(Plasma::Containment *cont, QWindow *parent)
: ConfigView(cont, parent),
m_containment(cont),
m_wallpaperConfigModel(0),
m_containmentActionConfigModel(0),
m_containmentPluginsConfigModel(0),
m_currentContainmentActionsModel(0),
m_currentWallpaperConfig(0),
m_ownWallpaperConfig(0)
m_containment(cont)
{
qmlRegisterType<QAbstractItemModel>();
rootContext()->setContextProperty(QStringLiteral("configDialog"), this);
......
......@@ -48,7 +48,7 @@ class ContainmentConfigView : public PlasmaQuick::ConfigView
Q_PROPERTY(QString containmentPlugin READ containmentPlugin WRITE setContainmentPlugin NOTIFY containmentPluginChanged)
public:
ContainmentConfigView(Plasma::Containment *interface, QWindow *parent = 0);
ContainmentConfigView(Plasma::Containment *interface, QWindow *parent = nullptr);
~ContainmentConfigView() override;
void init() override;
......@@ -74,14 +74,14 @@ protected:
void syncWallpaperObjects();
private:
Plasma::Containment *m_containment;
PlasmaQuick::ConfigModel *m_wallpaperConfigModel;
PlasmaQuick::ConfigModel *m_containmentActionConfigModel;
PlasmaQuick::ConfigModel *m_containmentPluginsConfigModel;
CurrentContainmentActionsModel *m_currentContainmentActionsModel;
Plasma::Containment *m_containment = nullptr;
PlasmaQuick::ConfigModel *m_wallpaperConfigModel = nullptr;
PlasmaQuick::ConfigModel *m_containmentActionConfigModel = nullptr;
PlasmaQuick::ConfigModel *m_containmentPluginsConfigModel = nullptr;
CurrentContainmentActionsModel *m_currentContainmentActionsModel = nullptr;
QString m_currentWallpaper;
KDeclarative::ConfigPropertyMap *m_currentWallpaperConfig;
KDeclarative::ConfigPropertyMap *m_ownWallpaperConfig;
KDeclarative::ConfigPropertyMap *m_currentWallpaperConfig = nullptr;
KDeclarative::ConfigPropertyMap *m_ownWallpaperConfig = nullptr;
};
#endif // multiple inclusion guard
......@@ -84,7 +84,7 @@ QString CurrentContainmentActionsModel::mouseEventString(int mouseButton, int mo
{
QMouseEvent *mouse = new QMouseEvent(QEvent::MouseButtonRelease, QPoint(), (Qt::MouseButton)mouseButton, (Qt::MouseButton)mouseButton, (Qt::KeyboardModifiers) modifiers);
QString string = Plasma::ContainmentActions::eventToString(mouse);
const QString string = Plasma::ContainmentActions::eventToString(mouse);
delete mouse;
......@@ -95,7 +95,7 @@ QString CurrentContainmentActionsModel::wheelEventString(const QPointF &delta, i
{
QWheelEvent *wheel = new QWheelEvent(QPointF(), QPointF(), delta.toPoint(), QPoint(), 0, qAbs(delta.x()) > qAbs(delta.y()) ? Qt::Horizontal : Qt::Vertical, (Qt::MouseButtons)mouseButtons, (Qt::KeyboardModifiers) modifiers);
QString string = Plasma::ContainmentActions::eventToString(wheel);
const QString string = Plasma::ContainmentActions::eventToString(wheel);
delete wheel;
......
......@@ -36,7 +36,7 @@
#include <KWayland/Client/surface.h>
DesktopView::DesktopView(Plasma::Corona *corona, QScreen *targetScreen)
: PlasmaQuick::ContainmentView(corona, 0),
: PlasmaQuick::ContainmentView(corona, nullptr),
m_windowType(Desktop),
m_shellSurface(nullptr)
{
......@@ -294,7 +294,7 @@ void DesktopView::screenGeometryChanged()
void DesktopView::coronaPackageChanged(const KPackage::Package &package)
{
setContainment(0);