Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-06-02 12:19:43 +0300
committerHannah von Reth <vonreth@kde.org>2021-06-02 13:40:18 +0300
commite8ddd54e03617452950b47ff684eee1fa74a0228 (patch)
tree8b4b120b163c6283fd043a67d4e14a2b68568ec0 /src/gui/translations.cpp
parent4765998c6c7f9eea0bd10907caa98d564ac49d74 (diff)
Cleanup the data location handling
Diffstat (limited to 'src/gui/translations.cpp')
-rw-r--r--src/gui/translations.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/translations.cpp b/src/gui/translations.cpp
index 4b2529f43..4f750949a 100644
--- a/src/gui/translations.cpp
+++ b/src/gui/translations.cpp
@@ -24,6 +24,7 @@
#include <QLoggingCategory>
#include <QDir>
#include <QDirIterator>
+#include <QStandardPaths>
namespace OCC {
@@ -43,19 +44,18 @@ namespace Translations {
QString applicationTrPath()
{
- QString devTrPath = qApp->applicationDirPath() + QString::fromLatin1("/../src/gui/");
- if (QDir(devTrPath).exists()) {
+ const auto devTrPath = QDir(qApp->applicationDirPath() + QStringLiteral("/../src/gui/"));
+ if (devTrPath.exists()) {
// might miss Qt, QtKeyChain, etc.
qCWarning(lcTranslations) << "Running from build location! Translations may be incomplete!";
- return devTrPath;
+ return devTrPath.absolutePath();
}
-#if defined(Q_OS_WIN)
- return QApplication::applicationDirPath();
-#elif defined(Q_OS_MAC)
- return QApplication::applicationDirPath() + QLatin1String("/../Resources/Translations"); // path defaults to app dir.
-#elif defined(Q_OS_UNIX)
- return QStringLiteral(SHAREDIR "/" APPLICATION_EXECUTABLE "/i18n/");
+#ifdef Q_OS_MAC
+ const auto translationDir = QStringLiteral("Translations");
+#else
+ const auto translationDir = QStringLiteral("i18n");
#endif
+ return QStandardPaths::locate(QStandardPaths::DataLocation, translationDir, QStandardPaths::LocateDirectory);
}
QSet<QString> listAvailableTranslations()