From a5e7fc18ab9b4feed3482a7d954af2172425631b Mon Sep 17 00:00:00 2001 From: Le Tan Date: Fri, 20 Oct 2017 19:45:26 +0800 Subject: [PATCH] bug-fix: skip system file when saving opened files before close --- src/vmainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vmainwindow.cpp b/src/vmainwindow.cpp index e737d32a..48c3ca74 100644 --- a/src/vmainwindow.cpp +++ b/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(file)->isSystemFile()) { + continue; + } + VFileSessionInfo info = VFileSessionInfo::fromEditTabInfo(&tab); fileInfos.push_back(info);