Browse Source

bug-fix: skip system file when saving opened files before close

Le Tan 8 years ago
parent
commit
a5e7fc18ab
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/vmainwindow.cpp

+ 7 - 0
src/vmainwindow.cpp

@@ -2060,6 +2060,13 @@ void VMainWindow::closeEvent(QCloseEvent *event)
             fileInfos.reserve(tabs.size());
 
             for (auto const & tab : tabs) {
+                // Skip system file.
+                VFile *file = tab.m_editTab->getFile();
+                if (file->getType() == FileType::Orphan
+                    && dynamic_cast<VOrphanFile *>(file)->isSystemFile()) {
+                    continue;
+                }
+
                 VFileSessionInfo info = VFileSessionInfo::fromEditTabInfo(&tab);
                 fileInfos.push_back(info);