summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-03-14 21:18:17 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-03-14 21:18:17 +0100
commit42a85def60036a5788a9dd862d0c6f835b62337c (patch)
tree157eceb8abcd2521220a1ba48dd54bedd45cdec3
parente95619fa67239b709522a66b8bb7403bb7b84098 (diff)
downloadMultiMC-42a85def60036a5788a9dd862d0c6f835b62337c.tar
MultiMC-42a85def60036a5788a9dd862d0c6f835b62337c.tar.gz
MultiMC-42a85def60036a5788a9dd862d0c6f835b62337c.tar.lz
MultiMC-42a85def60036a5788a9dd862d0c6f835b62337c.tar.xz
MultiMC-42a85def60036a5788a9dd862d0c6f835b62337c.zip
Get rid of one reloadInstanceVersion
-rw-r--r--gui/dialogs/OneSixModEditDialog.cpp4
-rw-r--r--logic/VersionFinal.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/gui/dialogs/OneSixModEditDialog.cpp b/gui/dialogs/OneSixModEditDialog.cpp
index 7dac68e5..2d459001 100644
--- a/gui/dialogs/OneSixModEditDialog.cpp
+++ b/gui/dialogs/OneSixModEditDialog.cpp
@@ -145,10 +145,6 @@ void OneSixModEditDialog::on_removeLibraryBtn_clicked()
{
QMessageBox::critical(this, tr("Error"), tr("Couldn't remove file"));
}
- else
- {
- reloadInstanceVersion();
- }
}
}
diff --git a/logic/VersionFinal.cpp b/logic/VersionFinal.cpp
index 2901fcf9..d0e85c15 100644
--- a/logic/VersionFinal.cpp
+++ b/logic/VersionFinal.cpp
@@ -72,9 +72,13 @@ bool VersionFinal::canRemove(const int index) const
}
bool VersionFinal::remove(const int index)
{
- if (canRemove(index))
+ if (canRemove(index) && QFile::remove(versionFiles.at(index)->filename))
{
- return QFile::remove(versionFiles.at(index)->filename);
+ beginResetModel();
+ versionFiles.removeAt(index);
+ reapply(true);
+ endResetModel();
+ return true;
}
return false;
}