summaryrefslogtreecommitdiffstats
path: root/application/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-05-13 01:24:15 +0200
committerPetr Mrázek <peterix@gmail.com>2017-05-13 01:24:15 +0200
commit868669a497fd08524eec6d31ac483f431b95198c (patch)
treea46fa4fa4e6baaf14720f10b3a2d09df3c98aaf6 /application/MultiMC.cpp
parent4cf4110d9dc694d2c28feca38656925980b57a4d (diff)
downloadMultiMC-868669a497fd08524eec6d31ac483f431b95198c.tar
MultiMC-868669a497fd08524eec6d31ac483f431b95198c.tar.gz
MultiMC-868669a497fd08524eec6d31ac483f431b95198c.tar.lz
MultiMC-868669a497fd08524eec6d31ac483f431b95198c.tar.xz
MultiMC-868669a497fd08524eec6d31ac483f431b95198c.zip
NOISSUE add a linux system packaging install layout
Diffstat (limited to 'application/MultiMC.cpp')
-rw-r--r--application/MultiMC.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 52755e84..495b14a0 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -79,6 +79,9 @@
#include <stdio.h>
#endif
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+
static const QLatin1String liveCheckFile("live.check");
using namespace Commandline;
@@ -138,7 +141,7 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
parser.addShortOpt("version", 'V');
parser.addDocumentation("version", "display program version and exit.");
// --dir
- parser.addOption("dir", applicationDirPath());
+ parser.addOption("dir");
parser.addShortOpt("dir", 'd');
parser.addDocumentation("dir", "use the supplied folder as MultiMC root instead of "
"the binary location (use '.' for current)");
@@ -199,8 +202,19 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
}
else
{
+#ifdef MULTIMC_LINUX_DATADIR
+ QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME"));
+ if (xdgDataHome.isEmpty())
+ xdgDataHome = QDir::homePath() + QLatin1String("/.local/share");
+ dataPath = xdgDataHome + "/multimc";
+ printf("BLAH %s", xdgDataHome.toStdString().c_str());
+
+ adjustedBy += "XDG standard " + dataPath;
+
+#else
dataPath = applicationDirPath();
adjustedBy += "Fallback to binary path " + dataPath;
+#endif
}
if (!FS::ensureFolderPathExists(dataPath))
@@ -297,6 +311,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
{
qDebug() << "ID of instance to launch : " << m_instanceIdToLaunch;
}
+#ifdef MULTIMC_JARS_LOCATION
+ ENV.setJarsPath( TOSTRING(MULTIMC_JARS_LOCATION) );
+#endif
do // once
{