summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-08-17 20:32:16 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-08-17 20:41:31 (GMT)
commitff5332eb8263a57867b16931982dae53f077a940 (patch)
tree5199b374b3cf218e82c7c01ee958cb800cf13d9a
parentcb070e1a77b6a0aa16542cfa3d124befad222c9e (diff)
Only add "kstars" directory if using QStandardPaths::GenericDataLocation
In my current opinion, ideally, we should not be doing this. We should instead use QStandardPaths::AppDataLocation within our code, and reserve GenericDataLocation only when we actually need to store something that is shared across applications. That permits us to actually use QStandardPaths::GenericDataLocation when we actually need it. This patch fixes misbehavior with respect to image handling in the Observation Planner. CCMAIL: afedoskin3@gmail.com, kstars-devel@kde.org
-rw-r--r--kstars/auxiliary/kspaths.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/kstars/auxiliary/kspaths.cpp b/kstars/auxiliary/kspaths.cpp
index eaac7c4..62880f5 100644
--- a/kstars/auxiliary/kspaths.cpp
+++ b/kstars/auxiliary/kspaths.cpp
@@ -14,8 +14,10 @@ QString KSPaths::locate(QStandardPaths::StandardLocation location, const QString
}
return file;
#else
- return QStandardPaths::locate(location, "kstars" + QDir::separator() +
- fileName,options);
+ QString file = fileName;
+ if( location == QStandardPaths::GenericDataLocation || location == QStandardPaths::GenericConfigLocation )
+ file = "kstars" + QDir::separator() + fileName;
+ return QStandardPaths::locate(location, file, options);
#endif
}
@@ -31,7 +33,9 @@ QStringList KSPaths::locateAll(QStandardPaths::StandardLocation location, const
}
return file;
#else
- return QStandardPaths::locateAll(location, "kstars" + QDir::separator() +
- fileName,options);
+ QString file = fileName;
+ if( location == QStandardPaths::GenericDataLocation || location == QStandardPaths::GenericConfigLocation )
+ file = "kstars" + QDir::separator() + fileName;
+ return QStandardPaths::locateAll(location, file, options);
#endif
}