aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorkumquat-ir <66188216+kumquat-ir@users.noreply.github.com>2023-02-13 01:45:23 -0500
committerkumquat-ir <66188216+kumquat-ir@users.noreply.github.com>2023-02-13 01:45:23 -0500
commit9c2a3231c5ee1b15b09bae9b064827ad3dcb86e0 (patch)
tree090fa87f11799b202aff67c4e677ade4c328674f /launcher
parentc07fff750354e23149470d493a7c96624fe2ab26 (diff)
downloadPrismLauncher-9c2a3231c5ee1b15b09bae9b064827ad3dcb86e0.tar.gz
PrismLauncher-9c2a3231c5ee1b15b09bae9b064827ad3dcb86e0.tar.bz2
PrismLauncher-9c2a3231c5ee1b15b09bae9b064827ad3dcb86e0.zip
do not create nilmods folder
"it cant be that easy" - me, clueless Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp2
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp2
-rw-r--r--launcher/minecraft/mod/ModFolderModel.h2
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp6
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.h3
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.h2
7 files changed, 11 insertions, 8 deletions
diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp
index 0737a648..af4da5d0 100644
--- a/launcher/minecraft/MinecraftInstance.cpp
+++ b/launcher/minecraft/MinecraftInstance.cpp
@@ -1135,7 +1135,7 @@ std::shared_ptr<ModFolderModel> MinecraftInstance::nilModList() const
if (!m_nil_mod_list)
{
bool is_indexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
- m_nil_mod_list.reset(new ModFolderModel(nilModsDir(), is_indexed));
+ m_nil_mod_list.reset(new ModFolderModel(nilModsDir(), is_indexed, false));
m_nil_mod_list->disableInteraction(isRunning());
connect(this, &BaseInstance::runningStatusChanged, m_nil_mod_list.get(), &ModFolderModel::disableInteraction);
}
diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp
index f258ad69..2d777656 100644
--- a/launcher/minecraft/mod/ModFolderModel.cpp
+++ b/launcher/minecraft/mod/ModFolderModel.cpp
@@ -50,7 +50,7 @@
#include "minecraft/mod/tasks/ModFolderLoadTask.h"
#include "modplatform/ModIndex.h"
-ModFolderModel::ModFolderModel(const QString &dir, bool is_indexed) : ResourceFolderModel(QDir(dir)), m_is_indexed(is_indexed)
+ModFolderModel::ModFolderModel(const QString &dir, bool is_indexed, bool create_dir) : ResourceFolderModel(QDir(dir), create_dir), m_is_indexed(is_indexed)
{
m_column_sort_keys = { SortType::ENABLED, SortType::NAME, SortType::VERSION, SortType::DATE, SortType::PROVIDER };
}
diff --git a/launcher/minecraft/mod/ModFolderModel.h b/launcher/minecraft/mod/ModFolderModel.h
index 6898f6eb..84e70db9 100644
--- a/launcher/minecraft/mod/ModFolderModel.h
+++ b/launcher/minecraft/mod/ModFolderModel.h
@@ -75,7 +75,7 @@ public:
Enable,
Toggle
};
- ModFolderModel(const QString &dir, bool is_indexed = false);
+ ModFolderModel(const QString &dir, bool is_indexed = false, bool create_dir = true);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
diff --git a/launcher/minecraft/mod/ResourceFolderModel.cpp b/launcher/minecraft/mod/ResourceFolderModel.cpp
index fdfb434b..b8353133 100644
--- a/launcher/minecraft/mod/ResourceFolderModel.cpp
+++ b/launcher/minecraft/mod/ResourceFolderModel.cpp
@@ -12,9 +12,11 @@
#include "tasks/Task.h"
-ResourceFolderModel::ResourceFolderModel(QDir dir, QObject* parent) : QAbstractListModel(parent), m_dir(dir), m_watcher(this)
+ResourceFolderModel::ResourceFolderModel(QDir dir, bool create_dir, QObject* parent) : QAbstractListModel(parent), m_dir(dir), m_watcher(this)
{
- FS::ensureFolderPathExists(m_dir.absolutePath());
+ if (create_dir) {
+ FS::ensureFolderPathExists(m_dir.absolutePath());
+ }
m_dir.setFilter(QDir::Readable | QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs);
m_dir.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
diff --git a/launcher/minecraft/mod/ResourceFolderModel.h b/launcher/minecraft/mod/ResourceFolderModel.h
index f1bc2dd7..e4227a33 100644
--- a/launcher/minecraft/mod/ResourceFolderModel.h
+++ b/launcher/minecraft/mod/ResourceFolderModel.h
@@ -24,7 +24,8 @@ class QSortFilterProxyModel;
class ResourceFolderModel : public QAbstractListModel {
Q_OBJECT
public:
- ResourceFolderModel(QDir, QObject* parent = nullptr);
+ ResourceFolderModel(QDir, bool, QObject* parent = nullptr);
+ ResourceFolderModel(QDir dir, QObject* parent = nullptr) : ResourceFolderModel(dir, true, parent) {};
~ResourceFolderModel() override;
/** Starts watching the paths for changes.
diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp
index 8c87a8a0..4548af59 100644
--- a/launcher/ui/pages/instance/ModFolderPage.cpp
+++ b/launcher/ui/pages/instance/ModFolderPage.cpp
@@ -280,5 +280,5 @@ NilModFolderPage::NilModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolder
bool NilModFolderPage::shouldDisplay() const
{
- return !m_model->dir().isEmpty();
+ return m_model->dir().exists();
}
diff --git a/launcher/ui/pages/instance/ModFolderPage.h b/launcher/ui/pages/instance/ModFolderPage.h
index cad240bd..2fc7b574 100644
--- a/launcher/ui/pages/instance/ModFolderPage.h
+++ b/launcher/ui/pages/instance/ModFolderPage.h
@@ -90,7 +90,7 @@ class NilModFolderPage : public ModFolderPage {
virtual QString displayName() const override { return tr("Nilmods"); }
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("coremods"); }
virtual QString id() const override { return "nilmods"; }
- virtual QString helpPage() const override { return "Nil-mods"; }
+ virtual QString helpPage() const override { return "Nilmods"; }
virtual bool shouldDisplay() const override;
};