Pārlūkot izejas kodu

HackStudio: Fix opened files appearing empty (#5480)

When files where placed in outside of the project root, they would
appear empty because the label in the tree would differ from the
actual file path relative to the root.

Fixes #5471.
Ivan Hansgaard Hansen 4 gadi atpakaļ
vecāks
revīzija
c9cd96894b
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      Userland/DevTools/HackStudio/HackStudioWidget.cpp

+ 2 - 2
Userland/DevTools/HackStudio/HackStudioWidget.cpp

@@ -695,8 +695,8 @@ void HackStudioWidget::create_project_tree_view(GUI::Widget& parent)
     };
     };
 
 
     m_project_tree_view->on_activation = [this](auto& index) {
     m_project_tree_view->on_activation = [this](auto& index) {
-        auto filename = index.data().as_string();
-        open_file(filename);
+        auto full_path_to_file = m_project->model().full_path(index);
+        open_file(full_path_to_file);
     };
     };
 }
 }