[rkward] rkward/misc: QSP::AppDataLocation may or may not contain the application name...
Thomas Friedrichsmeier
null at kde.org
Fri May 4 08:58:23 UTC 2018
Git commit 8ba595aca15e956dd6981e1057fc5ad832b1f8c2 by Thomas Friedrichsmeier.
Committed on 04/05/2018 at 08:57.
Pushed by tfry into branch 'master'.
QSP::AppDataLocation may or may not contain the application name...
M +5 -0 rkward/misc/rkcommonfunctions.cpp
https://commits.kde.org/rkward/8ba595aca15e956dd6981e1057fc5ad832b1f8c2
diff --git a/rkward/misc/rkcommonfunctions.cpp b/rkward/misc/rkcommonfunctions.cpp
index 22117efa..8fe8f036 100644
--- a/rkward/misc/rkcommonfunctions.cpp
+++ b/rkward/misc/rkcommonfunctions.cpp
@@ -159,7 +159,12 @@ namespace RKCommonFunctions {
QString getRKWardDataDir () {
static QString rkward_data_dir;
if (rkward_data_dir.isNull ()) {
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
QStringList candidates = QStandardPaths::locateAll (QStandardPaths::AppDataLocation, "resource.ver");
+ candidates += QStandardPaths::locateAll (QStandardPaths::AppDataLocation, "rkward/resource.ver"); // Well, isn't this just silly? AppDataLocation may or may not contain the application name (on Mac)
+#else
+ QStringList candidates = QStandardPaths::locateAll (QStandardPaths::GenericDataLocation, "resource.ver"); // Fails on Mac with unpatched Qt 5.10 (and before). See https://mail.kde.org/pipermail/kde-frameworks-devel/2018-May/063151.html
+#endif
for (int i = 0; i < candidates.size (); ++i) {
QFile resource_ver (candidates[i]);
if (resource_ver.open (QIODevice::ReadOnly) && (resource_ver.read (100).trimmed () == RKWARD_VERSION)) {
More information about the rkward-tracker
mailing list