summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2017-05-07 14:25:35 -0400
committerKurt Hindenburg <[email protected]>2017-05-07 14:25:59 -0400
commitb4b4a502bfe3d9470abfd50e451da56290efa4cf (patch)
tree957567ba7ce7e0640f5eb75292d21a6f7002b197
parent80321deea3a8596be6a6b69b77f2d27345f0c7b9 (diff)
More changes to QLatin1String, QLatin1Char and QStringLiteral
-rw-r--r--src/ProfileManager.cpp6
-rw-r--r--src/ProfileReader.cpp4
-rw-r--r--src/ProfileWriter.cpp4
-rw-r--r--src/Pty.cpp12
-rw-r--r--src/Session.cpp2
-rw-r--r--src/SessionListModel.cpp4
-rw-r--r--src/SessionManager.cpp4
-rw-r--r--src/ShellCommand.cpp2
8 files changed, 19 insertions, 19 deletions
diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp
index 0023814..36768f4 100644
--- a/src/ProfileManager.cpp
+++ b/src/ProfileManager.cpp
@@ -139,7 +139,7 @@ Profile::Ptr ProfileManager::loadProfile(const QString& shortPath)
return Profile::Ptr();
if (fileInfo.suffix() != QLatin1String("profile"))
- path.append(".profile");
+ path.append(QLatin1String(".profile"));
if (fileInfo.path().isEmpty() || fileInfo.path() == QLatin1String("."))
path.prepend(QLatin1String("konsole") + QDir::separator());
@@ -368,7 +368,7 @@ void ProfileManager::changeProfile(Profile::Ptr profile,
newName = QStringLiteral("Profile ") + QString::number(nameSuffix);
newTranslatedName = i18nc("The default name of a profile", "Profile #%1", nameSuffix);
// TODO: remove the # above and below - too many issues
- newTranslatedName.remove('#');
+ newTranslatedName.remove(QLatin1Char('#'));
nameSuffix++;
} while (existingProfileNames.contains(newName));
@@ -376,7 +376,7 @@ void ProfileManager::changeProfile(Profile::Ptr profile,
newProfile->clone(profile, true);
newProfile->setProperty(Profile::UntranslatedName, newName);
newProfile->setProperty(Profile::Name, newTranslatedName);
- newProfile->setProperty(Profile::MenuIndex, QString("0"));
+ newProfile->setProperty(Profile::MenuIndex, QStringLiteral("0"));
newProfile->setHidden(false);
addProfile(newProfile);
diff --git a/src/ProfileReader.cpp b/src/ProfileReader.cpp
index 50147e2..aa9ce99 100644
--- a/src/ProfileReader.cpp
+++ b/src/ProfileReader.cpp
@@ -50,7 +50,7 @@ QStringList KDE4ProfileReader::findProfiles()
Q_FOREACH (const QString& dir, dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.profile"));
Q_FOREACH (const QString& file, fileNames) {
- profiles.append(dir + '/' + file);
+ profiles.append(dir + QLatin1Char('/') + file);
}
}
return profiles;
@@ -68,7 +68,7 @@ void KDE4ProfileReader::readProperties(const KConfig& config, Profile::Ptr profi
groupName = properties->group;
}
- QString name(properties->name);
+ QString name(QLatin1String(properties->name));
if (group.hasKey(name))
profile->setProperty(properties->property,
diff --git a/src/ProfileWriter.cpp b/src/ProfileWriter.cpp
index d73b853..e66b1dd 100644
--- a/src/ProfileWriter.cpp
+++ b/src/ProfileWriter.cpp
@@ -44,7 +44,7 @@ QString KDE4ProfileWriter::getPath(const Profile::Ptr profile)
// the Konsole part can write/save profiles
static const QString localDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/konsole");
- return localDataLocation % "/" % profile->untranslatedName() % ".profile";
+ return localDataLocation % QLatin1String("/") % profile->untranslatedName() % QLatin1String(".profile");
}
void KDE4ProfileWriter::writeProperties(KConfig& config,
const Profile::Ptr profile,
@@ -61,7 +61,7 @@ void KDE4ProfileWriter::writeProperties(KConfig& config,
}
if (profile->isPropertySet(properties->property))
- group.writeEntry(QString(properties->name),
+ group.writeEntry(QLatin1String(properties->name),
profile->property<QVariant>(properties->property));
}
diff --git a/src/Pty.cpp b/src/Pty.cpp
index c6c787a..a958665 100644
--- a/src/Pty.cpp
+++ b/src/Pty.cpp
@@ -194,8 +194,8 @@ void Pty::setInitialWorkingDirectory(const QString& dir)
setWorkingDirectory(pwd);
// setting PWD to "." will cause problem for bash & zsh
- if (pwd != ".")
- setEnv("PWD", pwd);
+ if (pwd != QLatin1String("."))
+ setEnv(QStringLiteral("PWD"), pwd);
}
void Pty::addEnvironmentVariables(const QStringList& environmentVariables)
@@ -204,7 +204,7 @@ void Pty::addEnvironmentVariables(const QStringList& environmentVariables)
foreach(const QString& pair, environmentVariables) {
// split on the first '=' character
- const int separator = pair.indexOf('=');
+ const int separator = pair.indexOf(QLatin1Char('='));
if (separator >= 0) {
QString variable = pair.left(separator);
@@ -212,7 +212,7 @@ void Pty::addEnvironmentVariables(const QStringList& environmentVariables)
setEnv(variable, value);
- if (variable == "TERM") {
+ if (variable == QLatin1String("TERM")) {
isTermEnvAdded = true;
}
}
@@ -220,7 +220,7 @@ void Pty::addEnvironmentVariables(const QStringList& environmentVariables)
// extra safeguard to make sure $TERM is always set
if (!isTermEnvAdded) {
- setEnv("TERM", "xterm-256color");
+ setEnv(QStringLiteral("TERM"), QStringLiteral("xterm-256color"));
}
}
@@ -249,7 +249,7 @@ int Pty::start(const QString& programName,
// does not have a translation for
//
// BR:149300
- setEnv("LANGUAGE", QString(), false /* do not overwrite existing value if any */);
+ setEnv(QStringLiteral("LANGUAGE"), QString(), false /* do not overwrite existing value if any */);
KProcess::start();
diff --git a/src/Session.cpp b/src/Session.cpp
index 896a9a1..4c052ef 100644
--- a/src/Session.cpp
+++ b/src/Session.cpp
@@ -370,7 +370,7 @@ void Session::terminalWarning(const QString& message)
QString Session::shellSessionId() const
{
QString friendlyUuid(_uniqueIdentifier.toString());
- friendlyUuid.remove('-').remove('{').remove('}');
+ friendlyUuid.remove(QLatin1Char('-')).remove(QLatin1Char('{')).remove(QLatin1Char('}'));
return friendlyUuid;
}
diff --git a/src/SessionListModel.cpp b/src/SessionListModel.cpp
index c9dbf07..15f5015 100644
--- a/src/SessionListModel.cpp
+++ b/src/SessionListModel.cpp
@@ -68,10 +68,10 @@ QVariant SessionListModel::data(const QModelIndex& index, int role) const
// special handling for the "%w" marker which is replaced with the
// window title set by the shell
- title.replace("%w", _sessions[row]->userTitle());
+ title.replace(QLatin1String("%w"), _sessions[row]->userTitle());
// special handling for the "%#" marker which is replaced with the
// number of the shell
- title.replace("%#", QString::number(_sessions[row]->sessionId()));
+ title.replace(QLatin1String("%#"), QString::number(_sessions[row]->sessionId()));
return title;
} else if (column == 0) {
return _sessions[row]->sessionId();
diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp
index d9c5878..ced2a0e 100644
--- a/src/SessionManager.cpp
+++ b/src/SessionManager.cpp
@@ -176,8 +176,8 @@ void SessionManager::applyProfile(Session* session, const Profile::Ptr profile ,
// add environment variable containing home directory of current profile
// (if specified)
QStringList environment = profile->environment();
- environment << QString("PROFILEHOME=%1").arg(profile->defaultWorkingDirectory());
- environment << QString("KONSOLE_PROFILE_NAME=%1").arg(profile->name());
+ environment << QStringLiteral("PROFILEHOME=%1").arg(profile->defaultWorkingDirectory());
+ environment << QStringLiteral("KONSOLE_PROFILE_NAME=%1").arg(profile->name());
session->setEnvironment(environment);
}
diff --git a/src/ShellCommand.cpp b/src/ShellCommand.cpp
index e900d17..fd99c7a 100644
--- a/src/ShellCommand.cpp
+++ b/src/ShellCommand.cpp
@@ -48,7 +48,7 @@ QString ShellCommand::fullCommand() const
if (hasSpace)
quotedArgs[i] = '\"' + arg + '\"';
}
- return quotedArgs.join(QChar(' '));
+ return quotedArgs.join(QLatin1Char(' '));
}
QString ShellCommand::command() const
{