aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ModFolderModel.h
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/mod/ModFolderModel.h')
-rw-r--r--launcher/minecraft/mod/ModFolderModel.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/launcher/minecraft/mod/ModFolderModel.h b/launcher/minecraft/mod/ModFolderModel.h
index 24b4d358..a7d3ece0 100644
--- a/launcher/minecraft/mod/ModFolderModel.h
+++ b/launcher/minecraft/mod/ModFolderModel.h
@@ -101,13 +101,13 @@ public:
{
return size() == 0;
}
- Mod &operator[](size_t index)
+ Mod& operator[](size_t index)
{
- return mods[index];
+ return *mods[index];
}
- const Mod &at(size_t index) const
+ const Mod& at(size_t index) const
{
- return mods.at(index);
+ return *mods.at(index);
}
/// Reloads the mod list and returns true if the list changed.
@@ -118,6 +118,8 @@ public:
*/
bool installMod(const QString& filename);
+ bool uninstallMod(const QString& filename, bool preserve_metadata = false);
+
/// Deletes all the selected mods
bool deleteMods(const QModelIndexList &indexes);
@@ -139,11 +141,13 @@ public:
return { QString("%1/.index").arg(dir().absolutePath()) };
}
- const QList<Mod> & allMods()
+ const QList<Mod::Ptr>& allMods()
{
return mods;
}
+ auto selectedMods(QModelIndexList& indexes) -> QList<Mod::Ptr>;
+
public slots:
void disableInteraction(bool disabled);
@@ -157,7 +161,7 @@ signals:
void updateFinished();
private:
- void resolveMod(Mod& m);
+ void resolveMod(Mod::Ptr m);
bool setModStatus(int index, ModStatusAction action);
protected:
@@ -171,5 +175,5 @@ protected:
QMap<QString, int> modsIndex;
QMap<int, LocalModParseTask::ResultPtr> activeTickets;
int nextResolutionTicket = 0;
- QList<Mod> mods;
+ QList<Mod::Ptr> mods;
};