From a9e9c0d5adb607073bf1f80496e54f51d97a6f61 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 9 Sep 2016 14:01:57 +0300 Subject: [PATCH] Clear a list of recent files from non-existent files. --HG-- branch : develop --- src/libs/vmisc/vcommonsettings.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index b780b2744..10f888ba1 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -368,7 +368,18 @@ void VCommonSettings::SetUndoCount(const int &value) //--------------------------------------------------------------------------------------------------------------------- QStringList VCommonSettings::GetRecentFileList() const { - return value(SettingGeneralRecentFileList).toStringList(); + const QStringList files = value(SettingGeneralRecentFileList).toStringList(); + QStringList cleared; + + for (int i = 0; i < files.size(); ++i) + { + if (QFileInfo(files.at(i)).exists()) + { + cleared.append(files.at(i)); + } + } + + return cleared; } //---------------------------------------------------------------------------------------------------------------------