fix: author overwrite when converting from pwf (ref #409)
This commit is contained in:
parent
7990c95629
commit
290681d2d8
1 changed files with 18 additions and 10 deletions
|
|
@ -1565,25 +1565,33 @@ bool BotGraph::convertOldFormat () {
|
||||||
// add to node array
|
// add to node array
|
||||||
m_paths.push (cr::move (path));
|
m_paths.push (cr::move (path));
|
||||||
}
|
}
|
||||||
}
|
fp.close();
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
fp.close ();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// save new format in case loaded older one
|
// save new format in case loaded older one
|
||||||
if (!m_paths.empty ()) {
|
if (!m_paths.empty()) {
|
||||||
ctrl.msg ("Converting old PWF to new format Graph.");
|
ctrl.msg("Converting old PWF to new format Graph.");
|
||||||
|
|
||||||
m_graphAuthor = header.author;
|
m_graphAuthor = header.author;
|
||||||
return saveGraphData ();
|
|
||||||
|
// clean editor so graph will be saved with header's author
|
||||||
|
auto editor = m_editor;
|
||||||
|
m_editor = nullptr;
|
||||||
|
|
||||||
|
auto result = saveGraphData();
|
||||||
|
m_editor = editor;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
return true;
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename U> bool BotGraph::saveStorage (StringRef ext, StringRef name, StorageOption options, StorageVersion version, const SmallArray <U> &data, ExtenHeader *exten) {
|
template <typename U> bool BotGraph::saveStorage (StringRef ext, StringRef name, StorageOption options, StorageVersion version, const SmallArray <U> &data, ExtenHeader *exten) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue