No end in sight :<

This commit is contained in:
Petr Mrázek 2014-03-03 01:44:07 +01:00
parent 29cdc9364b
commit d66f2500a6
3 changed files with 27 additions and 19 deletions

View File

@ -175,6 +175,7 @@ void OneSixModEditDialog::on_moveLibraryUpBtn_clicked()
order[ourId] = ourNewOrder;
order[sortedOrder[sortedOrders[ourIndex - 1]]] = ourOrder;
// FIXME: why is GUI code doing this in particular? why isn't this part of a model?
if (!OneSixVersionBuilder::writeOverrideOrders(order, m_inst))
{
QMessageBox::critical(this, tr("Error"), tr("Couldn't save the new order"));
@ -185,6 +186,8 @@ void OneSixModEditDialog::on_moveLibraryUpBtn_clicked()
ui->libraryTreeView->selectionModel()->select(m_version->index(ourRow - 1), QItemSelectionModel::SelectCurrent);
}
}
// FIXME: WHY IS THIS DUPLICATED?
void OneSixModEditDialog::on_moveLibraryDownBtn_clicked()
{
QMap<QString, int> order = getExistingOrder();
@ -212,6 +215,7 @@ void OneSixModEditDialog::on_moveLibraryDownBtn_clicked()
order[ourId] = ourNewOrder;
order[sortedOrder[sortedOrders[ourIndex + 1]]] = ourOrder;
// FIXME: why is GUI code doing this in particular? why isn't this part of a model?
if (!OneSixVersionBuilder::writeOverrideOrders(order, m_inst))
{
QMessageBox::critical(this, tr("Error"), tr("Couldn't save the new order"));

View File

@ -130,6 +130,10 @@ void OneSixVersionBuilder::buildInternal(const bool onlyVanilla, const QStringLi
} while(0);
// some final touches
finalizeVersion();
}
void OneSixVersionBuilder::finalizeVersion()
{
if (m_version->assets.isEmpty())
{
@ -155,7 +159,6 @@ void OneSixVersionBuilder::buildInternal(const bool onlyVanilla, const QStringLi
}
}
}
}
void OneSixVersionBuilder::readJsonAndApply(const QJsonObject &obj)
{

View File

@ -41,6 +41,7 @@ private:
void buildInternal(const bool onlyVanilla, const QStringList &external);
void readJsonAndApply(const QJsonObject &obj);
void finalizeVersion();
VersionFile parseJsonFile(const QFileInfo &fileInfo, const bool requireOrder, bool isFTB = false);
};