summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-06-04 15:02:32 +0200
committerGitHub <noreply@github.com>2017-06-04 15:02:32 +0200
commit4e584ec039561ae13cecb1f5cd13146821b88d1b (patch)
tree96c42c1d5af104d4c5adad0e9c5d3b2b379af9cf /Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp
parent145483d9a2e6cb9a98b06f8af691ed4f6596dcfa (diff)
parentd664c454a4e8935efe202aba6c91a75bb8f3320e (diff)
Merge pull request #5534 from JosJuice/dont-bind-no-filesystem
DolphinWX: Don't bind context menu when GC filesystem is invalid
Diffstat (limited to 'Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp')
-rw-r--r--Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp b/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp
index 27f96cd3d1..30de05ae5e 100644
--- a/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp
+++ b/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp
@@ -159,10 +159,11 @@ FilesystemPanel::FilesystemPanel(wxWindow* parent, wxWindowID id,
: wxPanel{parent, id}, m_opened_iso{opened_iso}
{
CreateGUI();
- BindEvents();
- PopulateFileSystemTree();
-
- m_tree_ctrl->Expand(m_tree_ctrl->GetRootItem());
+ if (PopulateFileSystemTree())
+ {
+ BindEvents();
+ m_tree_ctrl->Expand(m_tree_ctrl->GetRootItem());
+ }
}
FilesystemPanel::~FilesystemPanel() = default;
@@ -194,7 +195,7 @@ void FilesystemPanel::CreateGUI()
SetSizer(main_sizer);
}
-void FilesystemPanel::PopulateFileSystemTree()
+bool FilesystemPanel::PopulateFileSystemTree()
{
const std::vector<DiscIO::Partition> partitions = m_opened_iso->GetPartitions();
m_has_partitions = !partitions.empty();
@@ -224,10 +225,12 @@ void FilesystemPanel::PopulateFileSystemTree()
{
m_filesystem = DiscIO::CreateFileSystem(m_opened_iso.get(), DiscIO::PARTITION_NONE);
if (!m_filesystem)
- return;
+ return false;
CreateDirectoryTree(m_tree_ctrl, m_tree_ctrl->GetRootItem(), m_filesystem->GetFileList());
}
+
+ return true;
}
void FilesystemPanel::OnRightClickTree(wxTreeEvent& event)