mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-16 21:55:29 +01:00
This commit is contained in:
parent
c88268fbfd
commit
3a36def366
9 changed files with 22 additions and 25 deletions
|
|
@ -397,7 +397,7 @@ func (box *Box) moveTrees0(files []*FileInfo) {
|
|||
}
|
||||
|
||||
treenode.SetBlockTreePath(subTree)
|
||||
sql.UpsertTreeQueue(subTree)
|
||||
sql.RenameTreeQueue(subTree)
|
||||
msg := fmt.Sprintf(Conf.Language(107), subTree.HPath)
|
||||
util.PushStatusBar(msg)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -882,11 +882,11 @@ func indexWriteJSONQueueWithoutChangeTime(tree *parse.Tree) (err error) {
|
|||
return writeJSONQueueWithoutChangeTime(tree)
|
||||
}
|
||||
|
||||
func renameWriteJSONQueue(tree *parse.Tree, oldHPath string) (err error) {
|
||||
func renameWriteJSONQueue(tree *parse.Tree) (err error) {
|
||||
if err = filesys.WriteTree(tree); nil != err {
|
||||
return
|
||||
}
|
||||
sql.RenameTreeQueue(tree, oldHPath)
|
||||
sql.RenameTreeQueue(tree)
|
||||
treenode.IndexBlockTree(tree)
|
||||
return
|
||||
}
|
||||
|
|
@ -1288,12 +1288,10 @@ func RenameDoc(boxID, p, title string) (err error) {
|
|||
}
|
||||
title = strings.ReplaceAll(title, "/", "")
|
||||
|
||||
oldHPath := tree.HPath
|
||||
tree.HPath = path.Join(path.Dir(tree.HPath), title)
|
||||
tree.Root.SetIALAttr("title", title)
|
||||
tree.Root.SetIALAttr("updated", util.CurrentTimeSecondsStr())
|
||||
|
||||
if err = renameWriteJSONQueue(tree, oldHPath); nil != err {
|
||||
if err = renameWriteJSONQueue(tree); nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue