@@ -615,7 +615,8 @@ ErrFile EditorView::save(const QString &workSpaceName, const QString &path,
615615 if (needSaveWS) {
616616 WorkSpaceInfo infos;
617617 infos.base = doc->baseAddress ();
618- infos.pluginData = savePluginData ();
618+ savePluginData ();
619+ infos.pluginData = _pluginData;
619620
620621 auto b = WorkSpaceManager::saveWorkSpace (
621622 workSpaceName, fileName.url (), doc->bookMarks (),
@@ -764,9 +765,11 @@ ErrFile EditorView::reload() {
764765 switch (documentType ()) {
765766 case DocumentType::File:
766767 if (m_workSpaceName.isEmpty ()) {
767- return openFile (fileNameUrl ().toLocalFile ());
768+ auto fileName = fileNameUrl ();
769+ return openFile (fileName.toLocalFile ());
768770 } else {
769- return openWorkSpace (m_workSpaceName);
771+ auto fileName = m_workSpaceName;
772+ return openWorkSpace (fileName);
770773 }
771774 case DocumentType::Extension:
772775 return openExtFile (fileNameUrl ());
@@ -938,19 +941,14 @@ void EditorView::setFileNameUrl(const QUrl &fileName) {
938941 }
939942}
940943
941- QMap<QString, QByteArray> EditorView::savePluginData () {
942- QMap<QString, QByteArray> ret;
944+ void EditorView::savePluginData () {
943945 for (auto p = m_others.constKeyValueBegin ();
944946 p != m_others.constKeyValueEnd (); ++p) {
945947 if (p->second ->hasUnsavedState ()) {
946948 auto data = p->second ->saveState ();
947- if (data.isEmpty ()) {
948- continue ;
949- }
950- ret.insert (p->first , data);
949+ _pluginData.insert (p->first , data);
951950 }
952951 }
953- return ret;
954952}
955953
956954bool EditorView::checkHasUnsavedState () const {
0 commit comments