Skip to content

Commit

Permalink
Fix json restore for directories and views
Browse files Browse the repository at this point in the history
  • Loading branch information
ailujezi committed Mar 2, 2024
1 parent 72840b8 commit db9f8c9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/gui/src/graph_widget/graph_context_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ namespace hal
continue;
u32 dirParentId = jsondir["parentId"].toInt();

BaseTreeItem* dirParent = nullptr;
BaseTreeItem* dirParent = mContextTreeModel->getRootItem();

if (dirParentId != 0) {
mContextTreeModel->getDirectory(dirParentId);
dirParent = mContextTreeModel->getDirectory(dirParentId);
}

mContextTreeModel->addDirectory(dirName, dirParent, dirId);
Expand All @@ -629,10 +629,11 @@ namespace hal
if (!jsonView.contains("parentId"))
continue;
u32 viewParentId = jsonView["parentId"].toInt();
BaseTreeItem* viewParent = nullptr;

BaseTreeItem* viewParent = mContextTreeModel->getRootItem();

if (viewParentId != 0) {
mContextTreeModel->getDirectory(viewParentId);
viewParent = mContextTreeModel->getDirectory(viewParentId);
}


Expand Down

0 comments on commit db9f8c9

Please sign in to comment.