Commit 145310d8 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Use QStringLiteral and QLatin1String

parent f9b0d40f
......@@ -195,7 +195,7 @@ void Application::processTabsFromFileArgs(KCmdLineArgs* args,
continue;
QHash<QString, QString> lineTokens;
QStringList lineParts = lineString.split(";;", QString::SkipEmptyParts);
QStringList lineParts = lineString.split(QStringLiteral(";;"), QString::SkipEmptyParts);
for (int i = 0; i < lineParts.size(); ++i) {
QString key = lineParts.at(i).section(':', 0, 0).trimmed().toLower();
......@@ -203,7 +203,7 @@ void Application::processTabsFromFileArgs(KCmdLineArgs* args,
lineTokens[key] = value;
}
// should contain at least one of 'command' and 'profile'
if (lineTokens.contains("command") || lineTokens.contains("profile")) {
if (lineTokens.contains(QLatin1String("command")) || lineTokens.contains(QStringLiteral("profile"))) {
createTabFromArgs(args, window, lineTokens);
sessions++;
} else {
......@@ -337,7 +337,7 @@ Profile::Ptr Application::processProfileSelectArgs(KCmdLineArgs* args)
if (profile)
return profile;
} else if (args->isSet("fallback-profile")) {
Profile::Ptr profile = ProfileManager::instance()->loadProfile("FALLBACK/");
Profile::Ptr profile = ProfileManager::instance()->loadProfile(QStringLiteral("FALLBACK/"));
if (profile)
return profile;
}
......
......@@ -82,7 +82,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
// transparency slider
QFontMetrics metrics(font());
_ui->transparencyPercentLabel->setMinimumWidth(metrics.width("100%"));
_ui->transparencyPercentLabel->setMinimumWidth(metrics.width(QStringLiteral("100%")));
connect(_ui->transparencySlider , &QSlider::valueChanged , this , &Konsole::ColorSchemeEditor::setTransparencyPercentLabel);
......@@ -118,7 +118,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
_ui->colorTable->horizontalHeader()->setSectionResizeMode(COLOR_COLUMN, QHeaderView::Stretch);
_ui->colorTable->horizontalHeader()->setSectionResizeMode(INTENSE_COLOR_COLUMN, QHeaderView::Stretch);
QTableWidgetItem* item = new QTableWidgetItem("Test");
QTableWidgetItem* item = new QTableWidgetItem(QStringLiteral("Test"));
_ui->colorTable->setItem(0, 0, item);
_ui->colorTable->verticalHeader()->hide();
......@@ -173,11 +173,11 @@ void ColorSchemeEditor::selectWallpaper()
{
// Get supported image formats and convert to QString for getOpenFileName()
const QList<QByteArray> mimeTypes = QImageReader::supportedImageFormats();
QString fileFormats = "(";
QString fileFormats = QStringLiteral("(");
Q_FOREACH (const QByteArray &mime, mimeTypes) {
fileFormats += "*." + QString::fromLatin1(mime) + " ";
fileFormats += QStringLiteral("*.%1 ").arg(QLatin1String(mime));
}
fileFormats += ")";
fileFormats += QLatin1String(")");
const QString fileName = QFileDialog::getOpenFileName(this,
i18nc("@title:window", "Select wallpaper image file"),
......@@ -208,7 +208,7 @@ void ColorSchemeEditor::setDescription(const QString& text)
}
void ColorSchemeEditor::setTransparencyPercentLabel(int percent)
{
_ui->transparencyPercentLabel->setText(QString("%1%").arg(percent));
_ui->transparencyPercentLabel->setText(QStringLiteral("%1%").arg(percent));
const qreal opacity = (100.0 - percent) / 100.0;
_colors->setOpacity(opacity);
......
......@@ -113,7 +113,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath)
QStringList ColorSchemeManager::listColorSchemes()
{
QStringList colorschemes;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "konsole", QStandardPaths::LocateDirectory);
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("konsole"), QStandardPaths::LocateDirectory);
colorschemes.reserve(dirs.size());
Q_FOREACH (const QString& dir, dirs) {
......@@ -176,7 +176,7 @@ const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name)
// A fix to prevent infinite loops if users puts / in ColorScheme name
// Konsole will create a sub-folder in that case (bko 315086)
// More code will have to go in to prevent the users from doing that.
if (name.contains("/")) {
if (name.contains(QLatin1String("/"))) {
qWarning() << name << " has an invalid character / in the name ... skipping";
return defaultColorScheme();
}
......
......@@ -164,7 +164,7 @@ QString EditProfileDialog::groupProfileNames(const ProfileGroup::Ptr group, int
caption += ',';
// limit caption length to prevent very long window titles
if (maxLength > 0 && caption.length() > maxLength) {
caption += "...";
caption += QLatin1String("...");
break;
}
}
......@@ -334,7 +334,7 @@ void EditProfileDialog::showEnvironmentEditor()
QString text = QInputDialog::getMultiLineText(this,
i18n("Edit Environment"),
i18n("One environment variable per line"),
currentEnvironment.join("\n"),
currentEnvironment.join(QStringLiteral("\n")),
&ok);
if (ok && !text.isEmpty()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment