App: Use QStringLiteral

This commit is contained in:
Benjamin Bræstrup Sayoc
2025-02-09 18:39:50 +01:00
parent 8b57e25cb8
commit 2eeb08ccb5

View File

@@ -2599,7 +2599,7 @@ void Application::initConfig(int argc, char ** argv)
// Now it's time to read-in the file branding.xml if it exists
Branding brand;
QString binDir = QString::fromUtf8((mConfig["AppHomePath"] + "bin").c_str());
QFileInfo fi(binDir, QString::fromLatin1("branding.xml"));
QFileInfo fi(binDir, QStringLiteral("branding.xml"));
if (fi.exists() && brand.readFile(fi.absoluteFilePath())) {
Branding::XmlConfig cfg = brand.getUserDefines();
for (Branding::XmlConfig::iterator it = cfg.begin(); it != cfg.end(); ++it) {
@@ -3155,7 +3155,7 @@ QString getOldGenericDataLocation(QString home)
return QString::fromStdString(converter.to_bytes(szPath));
}
#elif defined(FC_OS_MACOSX)
QFileInfo fi(home, QString::fromLatin1("Library/Preferences"));
QFileInfo fi(home, QStringLiteral("Library/Preferences"));
home = fi.absoluteFilePath();
#endif
@@ -3262,9 +3262,9 @@ std::filesystem::path findPath(const QString& stdHome, const QString& customHome
std::tuple<QString, QString, QString> getCustomPaths()
{
QProcessEnvironment env(QProcessEnvironment::systemEnvironment());
QString userHome = env.value(QString::fromLatin1("FREECAD_USER_HOME"));
QString userData = env.value(QString::fromLatin1("FREECAD_USER_DATA"));
QString userTemp = env.value(QString::fromLatin1("FREECAD_USER_TEMP"));
QString userHome = env.value(QStringLiteral("FREECAD_USER_HOME"));
QString userData = env.value(QStringLiteral("FREECAD_USER_DATA"));
QString userTemp = env.value(QStringLiteral("FREECAD_USER_TEMP"));
auto toNativePath = [](QString& path) {
if (!path.isEmpty()) {
@@ -3289,8 +3289,8 @@ std::tuple<QString, QString, QString> getCustomPaths()
// if FREECAD_USER_HOME is set but not FREECAD_USER_TEMP
if (!userHome.isEmpty() && userTemp.isEmpty()) {
QDir dir(userHome);
dir.mkdir(QString::fromLatin1("temp"));
QFileInfo fi(dir, QString::fromLatin1("temp"));
dir.mkdir(QStringLiteral("temp"));
QFileInfo fi(dir, QStringLiteral("temp"));
userTemp = fi.absoluteFilePath();
}