mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 23:06:07 -04:00
Force refreshing version list when remove version from disk
This commit is contained in:
parent
c209617ee7
commit
1956ba7a73
@ -50,9 +50,7 @@ public class Versions {
|
|||||||
isMovingToTrashSupported ? i18n("version.manage.remove.confirm.trash", version, version + "_removed") :
|
isMovingToTrashSupported ? i18n("version.manage.remove.confirm.trash", version, version + "_removed") :
|
||||||
i18n("version.manage.remove.confirm", version);
|
i18n("version.manage.remove.confirm", version);
|
||||||
Controllers.confirmDialog(message, i18n("message.confirm"), () -> {
|
Controllers.confirmDialog(message, i18n("message.confirm"), () -> {
|
||||||
if (profile.getRepository().removeVersionFromDisk(version)) {
|
profile.getRepository().removeVersionFromDisk(version);
|
||||||
profile.getRepository().refreshVersionsAsync().start();
|
|
||||||
}
|
|
||||||
}, null);
|
}, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +166,7 @@ public class DefaultGameRepository implements GameRepository {
|
|||||||
if (!file.renameTo(removedFile))
|
if (!file.renameTo(removedFile))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
try {
|
||||||
versions.remove(id);
|
versions.remove(id);
|
||||||
|
|
||||||
if (FileUtils.isMovingToTrashSupported() && FileUtils.moveToTrash(removedFile)) {
|
if (FileUtils.isMovingToTrashSupported() && FileUtils.moveToTrash(removedFile)) {
|
||||||
@ -185,6 +186,9 @@ public class DefaultGameRepository implements GameRepository {
|
|||||||
LOG.log(Level.WARNING, "Unable to remove version folder: " + file, e);
|
LOG.log(Level.WARNING, "Unable to remove version folder: " + file, e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
} finally {
|
||||||
|
refreshVersionsAsync().start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void refreshVersionsImpl() {
|
protected void refreshVersionsImpl() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user