feat: add update mods to the ui / mod model

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-06-04 21:18:51 -03:00
parent 6e2869834f
commit 2d10c246a8
5 changed files with 101 additions and 3 deletions

View File

@ -259,6 +259,18 @@ bool ModFolderModel::isValid()
return m_dir.exists() && m_dir.isReadable();
}
auto ModFolderModel::selectedMods(QModelIndexList& indexes) -> std::list<Mod>
{
std::list<Mod> selected_mods;
for (auto i : indexes) {
if(i.column() != 0)
continue;
selected_mods.push_back(mods[i.row()]);
}
return selected_mods;
}
// FIXME: this does not take disabled mod (with extra .disable extension) into account...
bool ModFolderModel::installMod(const QString &filename)
{

View File

@ -144,6 +144,8 @@ public:
return mods;
}
auto selectedMods(QModelIndexList& indexes) -> std::list<Mod>;
public slots:
void disableInteraction(bool disabled);