mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-09-18 10:50:05 +00:00
Merge pull request #14723 from Dentomologist/resource_pack_manager_fix_crash_when_removing_pack
ResourcePackManager: Fix crash when removing pack and properly update list
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include "DolphinQt/ResourcePackManager.h"
|
#include "DolphinQt/ResourcePackManager.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
@@ -15,6 +17,7 @@
|
|||||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||||
#include "UICommon/ResourcePack/Manager.h"
|
#include "UICommon/ResourcePack/Manager.h"
|
||||||
|
#include "UICommon/ResourcePack/ResourcePack.h"
|
||||||
|
|
||||||
ResourcePackManager::ResourcePackManager(QWidget* widget) : QDialog(widget)
|
ResourcePackManager::ResourcePackManager(QWidget* widget) : QDialog(widget)
|
||||||
{
|
{
|
||||||
@@ -243,8 +246,12 @@ void ResourcePackManager::Remove()
|
|||||||
if (box.exec() != QMessageBox::Yes)
|
if (box.exec() != QMessageBox::Yes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ResourcePack::ResourcePack& selected_pack =
|
||||||
|
ResourcePack::GetPacks()[GetResourcePackIndex(items[0])];
|
||||||
|
const std::string selected_pack_path = selected_pack.GetPath();
|
||||||
Uninstall();
|
Uninstall();
|
||||||
File::Delete(ResourcePack::GetPacks()[GetResourcePackIndex(items[0])].GetPath());
|
ResourcePack::Remove(selected_pack);
|
||||||
|
File::Delete(selected_pack_path);
|
||||||
RepopulateTable();
|
RepopulateTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user