Only sort those CLUT file names which are actually regular files.

This commit is contained in:
Adam Reichold
2016-01-11 22:55:04 +01:00
parent cc585058ab
commit 93d497573a

View File

@@ -230,13 +230,6 @@ int ClutComboBox::parseDir (const Glib::ustring& path)
try {
for (const auto& entry : Glib::Dir (path)) {
entries.push_back (entry);
}
} catch (Glib::Exception&) {}
std::sort (entries.begin (), entries.end ());
for (const auto& entry : entries) {
const auto entryPath = Glib::build_filename (path, entry);
@@ -244,6 +237,14 @@ int ClutComboBox::parseDir (const Glib::ustring& path)
continue;
}
entries.push_back (entryPath);
}
} catch (Glib::Exception&) {}
std::sort (entries.begin (), entries.end ());
for (const auto& entry : entries) {
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 ();