mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
FilesystemPanel: Handle root correctly in BuildFilePathFromSelection
This was unnecessary in the past but is necessary for the next commit.
This commit is contained in:
parent
39ff203c1e
commit
2ca5f1dec8
@ -401,15 +401,21 @@ void FilesystemPanel::ExtractDirectories(const std::string& full_path,
|
||||
|
||||
std::pair<wxString, const DiscIO::FileSystem&> FilesystemPanel::BuildFilePathFromSelection() const
|
||||
{
|
||||
wxString file_path = m_tree_ctrl->GetItemText(m_tree_ctrl->GetSelection());
|
||||
const wxTreeItemId root_node = m_tree_ctrl->GetRootItem();
|
||||
wxTreeItemId node = m_tree_ctrl->GetSelection();
|
||||
|
||||
const auto root_node = m_tree_ctrl->GetRootItem();
|
||||
auto node = m_tree_ctrl->GetItemParent(m_tree_ctrl->GetSelection());
|
||||
wxString file_path;
|
||||
|
||||
while (node != root_node)
|
||||
if (node != root_node)
|
||||
{
|
||||
file_path = m_tree_ctrl->GetItemText(node) + DIR_SEP_CHR + file_path;
|
||||
file_path = m_tree_ctrl->GetItemText(node);
|
||||
node = m_tree_ctrl->GetItemParent(node);
|
||||
|
||||
while (node != root_node)
|
||||
{
|
||||
file_path = m_tree_ctrl->GetItemText(node) + DIR_SEP_CHR + file_path;
|
||||
node = m_tree_ctrl->GetItemParent(node);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_has_partitions)
|
||||
|
Loading…
Reference in New Issue
Block a user