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