Move version stuff to the model and reimplement reordering

This commit is contained in:
Jan Dalheimer
2014-03-14 19:51:56 +01:00
parent de2eb3fc54
commit e5b4dee1c0
5 changed files with 203 additions and 48 deletions

View File

@@ -41,12 +41,22 @@ public:
bool reload(const bool onlyVanilla = false, const QStringList &external = QStringList());
void clear();
void dump() const;
bool canRemove(const int index) const;
QString versionFileId(const int index) const;
// does this instance have an all overriding custom.json
bool isCustom();
// remove custom.json
bool revertToBase();
enum MoveDirection { MoveUp, MoveDown };
void move(const int index, const MoveDirection direction);
void resetOrder();
// clears and reapplies all version files
void reapply(const bool alreadyReseting = false);
public
slots:
bool remove(const int index);
@@ -120,7 +130,9 @@ public:
// QList<Rule> rules;
QList<VersionFilePtr> versionFiles;
VersionFilePtr versionFile(const QString &id);
private:
OneSixInstance *m_instance;
QMap<QString, int> getExistingOrder() const;
};