diff --git a/src/io/recent-files.cpp b/src/io/recent-files.cpp index 4df63056ac8708d5d7005b65c8274d34976f3a3b..2ea50de2c9688d45cef918193a95266095fb8fc5 100644 --- a/src/io/recent-files.cpp +++ b/src/io/recent-files.cpp @@ -28,7 +28,7 @@ std::vector> getInkscapeRecentFiles(unsigned max_f std::vector> output; auto recent_manager = Gtk::RecentManager::get_default(); - // all recent files not necessarily inkscape only (std::vector) + // All recent files, not necessarily inkscape only (std::vector) auto recent_files = recent_manager->get_items(); // Remove non-inkscape files. @@ -37,18 +37,10 @@ std::vector> getInkscapeRecentFiles(unsigned max_f bool valid_file = recent_file->has_application(g_get_prgname()) || recent_file->has_application("org.inkscape.Inkscape") || - recent_file->has_application("inkscape") -#ifdef _WIN32 - || recent_file->has_application("inkscape.exe") -#endif -; + recent_file->has_application("inkscape") || + recent_file->has_application("inkscape.exe"); return !valid_file; }); - - // Truncate to user specified max_files. - if (max_files && recent_files.size() > max_files) { - recent_files.resize(max_files); - } // Ensure that display uri's are unique. It is possible that an XBEL file // has multiple entries for the same file as a path can be written in equivalent @@ -70,6 +62,11 @@ std::vector> getInkscapeRecentFiles(unsigned max_f return a->get_modified().compare(b->get_modified()) > 0; }); + // Truncate to user-specified max_files. + if (max_files && recent_files.size() > max_files) { + recent_files.resize(max_files); + } + return recent_files; } @@ -166,7 +163,6 @@ std::map getShortenedPathMap(std::vectorhas_application(g_get_prgname()) || e->has_application("org.inkscape.Inkscape") || e->has_application("inkscape") -#ifdef _WIN32 || e->has_application("inkscape.exe") -#endif ) { manager->remove_item(e->get_uri()); }