Commit 17fb539c authored by Robert Krawitz's avatar Robert Krawitz

Change static QString to QStringLiteral

parent 3201e9cc
......@@ -22,8 +22,7 @@
QString Utilities::stripEndingForwardSlash(const QString &fileName)
{
static QString slash = QString::fromLatin1("/");
if (fileName.endsWith(slash))
if (fileName.endsWith(QStringLiteral("/")))
return fileName.left(fileName.length() - 1);
else
return fileName;
......@@ -41,19 +40,16 @@ QString Utilities::relativeFolderName(const QString &fileName)
QString Utilities::absoluteImageFileName(const QString &relativeName)
{
static QString slash = QString::fromLatin1("/");
return stripEndingForwardSlash(Settings::SettingsData::instance()->imageDirectory()) + slash + relativeName;
return stripEndingForwardSlash(Settings::SettingsData::instance()->imageDirectory()) + QStringLiteral("/") + relativeName;
}
QString Utilities::imageFileNameToAbsolute(const QString &fileName)
{
static QString slash = QString::fromLatin1("/");
static QString fileslashslash = QString::fromLatin1("file://");
if (fileName.startsWith(Settings::SettingsData::instance()->imageDirectory()))
return fileName;
else if (fileName.startsWith(fileslashslash))
else if (fileName.startsWith(QStringLiteral("file://")))
return imageFileNameToAbsolute(fileName.mid(7)); // 7 == length("file://")
else if (fileName.startsWith(slash))
else if (fileName.startsWith(QStringLiteral("/")))
return QString(); // Not within our image root
else
return absoluteImageFileName(fileName);
......
......@@ -99,7 +99,7 @@ void XmlReader::reportError(const QString &text)
message += i18n("<p>Additional error information:<nl/><message>%1</message></p>", errorString());
message += xi18n("<p>Database path: <filename>%1</filename></p>", m_streamName);
m_ui.error(QString::fromUtf8("XmlReader: error in line %1, column %2 (%3)")
m_ui.error(QStringLiteral("XmlReader: error in line %1, column %2 (%3)")
.arg(lineNumber())
.arg(columnNumber())
.arg(errorString()),
......
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