From 93d497573a7243297810867d3e8009119d643681 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Mon, 11 Jan 2016 22:55:04 +0100 Subject: [PATCH] Only sort those CLUT file names which are actually regular files. --- rtgui/filmsimulation.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc index feed0ba35..da765ef7a 100644 --- a/rtgui/filmsimulation.cc +++ b/rtgui/filmsimulation.cc @@ -230,7 +230,14 @@ int ClutComboBox::parseDir (const Glib::ustring& path) try { for (const auto& entry : Glib::Dir (path)) { - entries.push_back (entry); + + const auto entryPath = Glib::build_filename (path, entry); + + if (!Glib::file_test (entryPath, Glib::FILE_TEST_IS_REGULAR)) { + continue; + } + + entries.push_back (entryPath); } } catch (Glib::Exception&) {} @@ -238,12 +245,6 @@ int ClutComboBox::parseDir (const Glib::ustring& path) for (const auto& entry : entries) { - const auto entryPath = Glib::build_filename (path, entry); - - if (!Glib::file_test (entryPath, Glib::FILE_TEST_IS_REGULAR)) { - continue; - } - Glib::ustring name, extension, profileName; splitClutFilename (entry, name, extension, profileName); @@ -254,7 +255,7 @@ int ClutComboBox::parseDir (const Glib::ustring& path) auto newRow = row ? *m_model->append (row.children ()) : *m_model->append (); newRow[m_columns.label] = name; - newRow[m_columns.clutFilename] = entryPath; + newRow[m_columns.clutFilename] = entry; if (++fileCount > maxFileCount) { m_model->clear ();