Commit 5648ec1a authored by Kurt Hindenburg's avatar Kurt Hindenburg

Use QLatin1* to handle casts from ascii

parent e56bbb5b
......@@ -149,7 +149,7 @@ QString ColorScheme::colorNameForIndex(int index)
{
Q_ASSERT(index >= 0 && index < TABLE_COLORS);
return QString(colorNames[index]);
return QString(QLatin1String(colorNames[index]));
}
QString ColorScheme::translatedColorNameForIndex(int index)
......
......@@ -94,7 +94,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
// wallpaper stuff
auto dirModel = new QFileSystemModel(this);
dirModel->setFilter(QDir::AllEntries);
dirModel->setRootPath(QString('/'));
dirModel->setRootPath(QLatin1String("/"));
auto completer = new QCompleter(this);
completer->setModel(dirModel);
_ui->wallpaperPath->setCompleter(completer);
......
......@@ -120,7 +120,7 @@ QStringList ColorSchemeManager::listColorSchemes()
Q_FOREACH (const QString& dir, dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.colorscheme"));
Q_FOREACH (const QString& file, fileNames) {
colorschemes.append(dir + '/' + file);
colorschemes.append(dir + QLatin1Char('/') + file);
}
}
return colorschemes;
......
......@@ -156,7 +156,7 @@ QString EditProfileDialog::groupProfileNames(const ProfileGroup::Ptr group, int
for (int i = 0; i < count; i++) {
caption += group->profiles()[i]->name();
if (i < (count - 1)) {
caption += ',';
caption += QLatin1Char(',');
// limit caption length to prevent very long window titles
if (maxLength > 0 && caption.length() > maxLength) {
caption += QLatin1String("...");
......@@ -308,7 +308,7 @@ void EditProfileDialog::showEnvironmentEditor()
&ok);
if (ok && !text.isEmpty()) {
QStringList newEnvironment = text.split('\n');
QStringList newEnvironment = text.split(QLatin1Char('\n'));
updateTempProfileProperty(Profile::Environment, newEnvironment);
}
}
......@@ -460,8 +460,8 @@ void EditProfileDialog::showAllFontsButtonWarning(bool enable)
{
if (enable) {
KMessageBox::information(this,
"By its very nature, a terminal program requires font characters that are equal width (monospace). Any non monospaced font may cause display issues. This should not be necessary except in rare cases.",
"Warning");
QLatin1String("By its very nature, a terminal program requires font characters that are equal width (monospace). Any non monospaced font may cause display issues. This should not be necessary except in rare cases."),
QLatin1String("Warning"));
}
}
......
......@@ -81,7 +81,7 @@ HistoryFile::HistoryFile()
QDir().mkpath(*historyFileLocation());
}
const QString tmpDir = *historyFileLocation();
const QString tmpFormat = tmpDir + QLatin1Char('/') + "konsole-XXXXXX.history";
const QString tmpFormat = tmpDir + QLatin1Char('/') + QLatin1String("konsole-XXXXXX.history");
_tmpFile.setFileTemplate(tmpFormat);
if (_tmpFile.open()) {
_tmpFile.setAutoRemove(true);
......
......@@ -91,7 +91,7 @@ void KeyboardTranslatorManager::findTranslators()
Q_FOREACH (const QString& dir, dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.keytab"));
Q_FOREACH (const QString& file, fileNames) {
list.append(dir + '/' + file);
list.append(dir + QLatin1Char('/') + file);
}
}
......
......@@ -32,7 +32,7 @@ using namespace std;
static quint32 charVal(QChar val)
{
if (val == ' ')
if (val == QLatin1Char(' '))
return 0;
else
return 1;
......@@ -42,7 +42,7 @@ static quint32 readGlyphLine(QTextStream& input)
{
QString line = input.readLine();
while (line.length() < 5)
line += ' ';
line += QLatin1Char(' ');
quint32 val = charVal(line[0]) |
(charVal(line[1]) << 1) |
......@@ -67,7 +67,7 @@ int main(int argc, char **argv)
qWarning("usage: fontembedder LineFont.src > LineFont.h");
exit(1);
}
QFile inFile(argv[1]);
QFile inFile(QString::fromLocal8Bit(argv[1]));
if (!inFile.open(QIODevice::ReadOnly)) {
qWarning("Can not open %s", argv[1]);
exit(1);
......@@ -89,7 +89,7 @@ int main(int argc, char **argv)
line = line.trimmed();
if (line.isEmpty())
continue; //Skip empty lines
if (line[0] == '#')
if (line[0] == QLatin1Char('#'))
continue; //Skip comments
//Must be a glyph ID.
......
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