Better version handling

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-04-22 00:47:51 +03:00
parent 10aac4fe17
commit f7931c2ee2
10 changed files with 90 additions and 53 deletions

View File

@@ -80,6 +80,9 @@ class ResourceModel : public QAbstractListModel {
/** Gets the icon at the URL for the given index. If it's not fetched yet, fetch it and update when fisinhed. */
std::optional<QIcon> getIcon(QModelIndex&, const QUrl&);
void addPack(ModPlatform::IndexedPack& add) { m_selected.append(add); }
void removePack(QString& rem);
protected:
/** Resets the model's data. */
void clearData();
@@ -124,6 +127,7 @@ class ResourceModel : public QAbstractListModel {
QSet<QUrl> m_failed_icon_actions;
QList<ModPlatform::IndexedPack> m_packs;
QList<ModPlatform::IndexedPack> m_selected;
// HACK: We need this to prevent callbacks from calling the model after it has already been deleted.
// This leaks a tiny bit of memory per time the user has opened a resource dialog. How to make this better?