replaced QString uses with QStringLiteral

Minor code optimization according to Qt documentation.
This commit is contained in:
itsmattkc
2019-12-10 00:42:31 +11:00
parent f46b1245c4
commit 3bfe333878
8 changed files with 38 additions and 37 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ QIcon olive::icon::Create(const QString& theme, const QString &name)
QIcon icon;
for (int i=0;i<ICON_SIZE_COUNT;i++) {
icon.addFile(QString("%1/png/%2.%3.png").arg(theme, name, QString::number(ICON_SIZES[i])),
icon.addFile(QStringLiteral("%1/png/%2.%3.png").arg(theme, name, QString::number(ICON_SIZES[i])),
QSize(ICON_SIZES[i], ICON_SIZES[i]));
}
+2 -2
View File
@@ -143,7 +143,7 @@ void StyleManager::SetStyle(const QString &style_path)
olive::icon::LoadAll(style_path);
// Set palette for this
QString palette_file = QString("%1/palette.ini").arg(style_path);
QString palette_file = QStringLiteral("%1/palette.ini").arg(style_path);
if (QFileInfo::exists(palette_file)) {
qApp->setPalette(ParsePalette(palette_file));
} else {
@@ -151,7 +151,7 @@ void StyleManager::SetStyle(const QString &style_path)
}
// Set CSS style for this
QFile css_file(QString("%1/style.css").arg(style_path));
QFile css_file(QStringLiteral("%1/style.css").arg(style_path));
if (css_file.exists() && css_file.open(QFile::ReadOnly | QFile::Text)) {
// Read in entire CSS from file and set as the application stylesheet