summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Gruber <[email protected]>2015-07-15 12:29:43 +0200
committerJakob Gruber <[email protected]>2015-07-15 12:36:27 +0200
commit6f7d354daef8091dbdb5a1e98a12c4a9026dbb11 (patch)
tree03524d55994879c6c1efb35b871891faa3434935
parentcf54e87b7db2cd4cb0eb1e6903bb8537aa7f5874 (diff)
Search the correct locations in QStandardPath::locate
Passing both an organization name and application name to QCoreApplication resulted in QStandardPaths looking in '/usr/share/picmi/picmi/', which doesn't exist. Leaving the organization name unset fixed this issue, and exposed another problem with our locate() usage in which we incorrectly appended the directory name to the returned path.
-rw-r--r--src/constants.h1
-rw-r--r--src/gui/mainwindow.cpp1
-rw-r--r--src/gui/renderer.cpp4
-rw-r--r--src/logic/levelloader.cpp4
4 files changed, 4 insertions, 6 deletions
diff --git a/src/constants.h b/src/constants.h
index 18c8da8..c7096a4 100644
--- a/src/constants.h
+++ b/src/constants.h
@@ -19,7 +19,6 @@
#ifndef CONSTANTS_H
#define CONSTANTS_H
-const QString ORGANIZATION_NAME = "picmi";
const int ZVALUE_HIGHLIGHT = -3;
const int ZVALUE_CELLFRAME = 0;
const int ZVALUE_STREAKFRAME = 0;
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index 48bd217..f30da09 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -42,7 +42,6 @@ MainWindow::MainWindow(QWidget *parent) :
KXmlGuiWindow(parent),
m_key_pos("window/position"), m_in_progress(false), m_mode(Random)
{
- QCoreApplication::setOrganizationName(ORGANIZATION_NAME);
QCoreApplication::setApplicationName("picmi");
m_timer.setInterval(500);
diff --git a/src/gui/renderer.cpp b/src/gui/renderer.cpp
index 83beab6..cd28aec 100644
--- a/src/gui/renderer.cpp
+++ b/src/gui/renderer.cpp
@@ -59,9 +59,9 @@ void Renderer::loadResources() {
QList<QString> paths;
paths << QString(prefix)
<< QString(FILEPATH "/" + prefix)
- << QStandardPaths::locate(QStandardPaths::DataLocation,
+ << QStandardPaths::locate(QStandardPaths::AppDataLocation,
prefix,
- QStandardPaths::LocateOption::LocateDirectory) + prefix;
+ QStandardPaths::LocateOption::LocateDirectory);
/* try loading first from working directory, then the system directories */
for (int i = 0; i < paths.size(); i++) {
diff --git a/src/logic/levelloader.cpp b/src/logic/levelloader.cpp
index b621018..c722e3d 100644
--- a/src/logic/levelloader.cpp
+++ b/src/logic/levelloader.cpp
@@ -137,9 +137,9 @@ QList<QSharedPointer<Level> > LevelLoader::load() {
QList<QString> paths;
paths << QString(prefix)
<< QString(FILEPATH "/" + prefix)
- << QStandardPaths::locate(QStandardPaths::DataLocation,
+ << QStandardPaths::locate(QStandardPaths::AppDataLocation,
prefix,
- QStandardPaths::LocateOption::LocateDirectory) + prefix;
+ QStandardPaths::LocateOption::LocateDirectory);
LevelList list;