From 4e7354d075975f05d5b6a8b2811c81250aade959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AE=87=E6=B8=85=E9=9F=B3?= <2422523675@qq.com> Date: Fri, 10 Mar 2023 21:27:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dstorychain=E9=80=BB=E8=BE=91b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WordsIDE/storychainspresent.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/WordsIDE/storychainspresent.cpp b/WordsIDE/storychainspresent.cpp index 734ae92..7ff1816 100644 --- a/WordsIDE/storychainspresent.cpp +++ b/WordsIDE/storychainspresent.cpp @@ -166,13 +166,14 @@ void StorychainsPresent::jump_to(const QModelIndex &curr) return; QList 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 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));