aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--buildconfig/BuildConfig.cpp.in1
-rw-r--r--buildconfig/BuildConfig.h1
-rw-r--r--launcher/Application.cpp2
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.cpp14
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.h3
6 files changed, 12 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 131d3e53..97bad31b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,7 +249,7 @@ if(UNIX AND APPLE)
elseif(UNIX)
set(BINARY_DEST_DIR "bin")
set(LIBRARY_DEST_DIR "lib${LIB_SUFFIX}")
- set(JARS_DEST_DIR "share/jars")
+ set(JARS_DEST_DIR "share/${Launcher_APP_BINARY_NAME}")
set(LAUNCHER_DESKTOP_DEST_DIR "share/applications" CACHE STRING "Path to the desktop file directory")
set(LAUNCHER_METAINFO_DEST_DIR "share/metainfo" CACHE STRING "Path to the metainfo directory")
set(LAUNCHER_ICON_DEST_DIR "share/icons/hicolor/scalable/apps" CACHE STRING "Path to the scalable icon directory")
diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in
index 50e5e8a4..b8fa5133 100644
--- a/buildconfig/BuildConfig.cpp.in
+++ b/buildconfig/BuildConfig.cpp.in
@@ -42,6 +42,7 @@ Config::Config()
{
// Name and copyright
LAUNCHER_NAME = "@Launcher_Name@";
+ LAUNCHER_APP_BINARY_NAME = "@Launcher_APP_BINARY_NAME@";
LAUNCHER_DISPLAYNAME = "@Launcher_DisplayName@";
LAUNCHER_COPYRIGHT = "@Launcher_Copyright@";
LAUNCHER_DOMAIN = "@Launcher_Domain@";
diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h
index ef384ed2..13ccdaa1 100644
--- a/buildconfig/BuildConfig.h
+++ b/buildconfig/BuildConfig.h
@@ -44,6 +44,7 @@ class Config {
public:
Config();
QString LAUNCHER_NAME;
+ QString LAUNCHER_APP_BINARY_NAME;
QString LAUNCHER_DISPLAYNAME;
QString LAUNCHER_COPYRIGHT;
QString LAUNCHER_DOMAIN;
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 6ffec1ae..97f757f7 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -1571,7 +1571,7 @@ QString Application::getJarPath(QString jarFile)
{
QStringList potentialPaths = {
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
- FS::PathCombine(m_rootPath, "share/jars"),
+ FS::PathCombine(m_rootPath, "share/" + BuildConfig.LAUNCHER_APP_BINARY_NAME),
#endif
FS::PathCombine(m_rootPath, "jars"),
FS::PathCombine(applicationDirPath(), "jars")
diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp
index 0b2431f7..c50abb8f 100644
--- a/launcher/modplatform/flame/FileResolvingTask.cpp
+++ b/launcher/modplatform/flame/FileResolvingTask.cpp
@@ -12,6 +12,8 @@ bool Flame::FileResolvingTask::abort()
bool aborted = true;
if (m_dljob)
aborted &= m_dljob->abort();
+ if (m_checkJob)
+ aborted &= m_checkJob->abort();
return aborted ? Task::abort() : false;
}
@@ -40,7 +42,7 @@ void Flame::FileResolvingTask::netJobFinished()
setProgress(1, 3);
int index = 0;
// job to check modrinth for blocked projects
- auto job = new NetJob("Modrinth check", m_network);
+ m_checkJob = new NetJob("Modrinth check", m_network);
blockedProjects = QMap<File *,QByteArray *>();
auto doc = Json::requireDocument(*result);
auto array = Json::requireArray(doc.object()["data"]);
@@ -60,19 +62,15 @@ void Flame::FileResolvingTask::netJobFinished()
out.resolved = true;
});
- job->addNetAction(dl);
+ m_checkJob->addNetAction(dl);
blockedProjects.insert(&out, output);
}
}
index++;
}
- connect(job, &NetJob::finished, this,
- [this, &job] {
- modrinthCheckFinished();
- job->deleteLater();
- });
+ connect(m_checkJob.get(), &NetJob::finished, this, &Flame::FileResolvingTask::modrinthCheckFinished);
- job->start();
+ m_checkJob->start();
}
void Flame::FileResolvingTask::modrinthCheckFinished() {
diff --git a/launcher/modplatform/flame/FileResolvingTask.h b/launcher/modplatform/flame/FileResolvingTask.h
index f71b87ce..8fc17ea9 100644
--- a/launcher/modplatform/flame/FileResolvingTask.h
+++ b/launcher/modplatform/flame/FileResolvingTask.h
@@ -30,8 +30,9 @@ protected slots:
private: /* data */
shared_qobject_ptr<QNetworkAccessManager> m_network;
Flame::Manifest m_toProcess;
- std::shared_ptr<QByteArray> result;
+ std::shared_ptr<QByteArray> result;
NetJob::Ptr m_dljob;
+ NetJob::Ptr m_checkJob;
void modrinthCheckFinished();