修复storychain逻辑bug

This commit is contained in:
玉宇清音 2023-03-10 21:27:46 +08:00
parent 4846662044
commit 4e7354d075
1 changed files with 10 additions and 8 deletions

View File

@ -166,13 +166,14 @@ void StorychainsPresent::jump_to(const QModelIndex &curr)
return; return;
QList<QString> path; QList<QString> path;
auto node = curr;
while (true) { while (true) {
auto node = curr.data().toString(); auto node_name = node.data().toString();
if(node.isEmpty()) if (node_name.isEmpty())
break; break;
else path.insert(0, node_name);
path << node; node = node.parent();
} }
disp_core->postCommand(StorychainJumpTo(path)); disp_core->postCommand(StorychainJumpTo(path));
@ -184,13 +185,14 @@ void StorychainsPresent::detail_show(const QModelIndex &curr)
return; return;
QList<QString> path; QList<QString> path;
auto node = curr;
while (true) { while (true) {
auto node = curr.data().toString(); auto node_name = node.data().toString();
if(node.isEmpty()) if (node_name.isEmpty())
break; break;
else path.insert(0, node_name);
path << node; node = node.parent();
} }
disp_core->postCommand(StorychainDetailShow(path)); disp_core->postCommand(StorychainDetailShow(path));