Only sort those CLUT file names which are actually regular files.
This commit is contained in:
@@ -230,13 +230,6 @@ int ClutComboBox::parseDir (const Glib::ustring& path)
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
for (const auto& entry : Glib::Dir (path)) {
|
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);
|
const auto entryPath = Glib::build_filename (path, entry);
|
||||||
|
|
||||||
@@ -244,6 +237,14 @@ int ClutComboBox::parseDir (const Glib::ustring& path)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entries.push_back (entryPath);
|
||||||
|
}
|
||||||
|
} catch (Glib::Exception&) {}
|
||||||
|
|
||||||
|
std::sort (entries.begin (), entries.end ());
|
||||||
|
|
||||||
|
for (const auto& entry : entries) {
|
||||||
|
|
||||||
Glib::ustring name, extension, profileName;
|
Glib::ustring name, extension, profileName;
|
||||||
splitClutFilename (entry, 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 ();
|
auto newRow = row ? *m_model->append (row.children ()) : *m_model->append ();
|
||||||
newRow[m_columns.label] = name;
|
newRow[m_columns.label] = name;
|
||||||
newRow[m_columns.clutFilename] = entryPath;
|
newRow[m_columns.clutFilename] = entry;
|
||||||
|
|
||||||
if (++fileCount > maxFileCount) {
|
if (++fileCount > maxFileCount) {
|
||||||
m_model->clear ();
|
m_model->clear ();
|
||||||
|
Reference in New Issue
Block a user