Fix windows boot drive folder bug, fixes #4629

This commit is contained in:
heckflosse
2018-06-21 14:39:27 +02:00
parent 2e0f18dce7
commit 2faa8ec4f1

View File

@@ -48,14 +48,26 @@ std::vector<Glib::ustring> listSubDirs (const Glib::RefPtr<Gio::File>& dir, bool
auto enumerator = dir->enumerate_children ("standard::name,standard::type,standard::is-hidden");
while (auto file = enumerator->next_file ()) {
if (file->get_file_type () != Gio::FILE_TYPE_DIRECTORY) {
continue;
while (true) {
try {
auto file = enumerator->next_file ();
if (!file) {
break;
}
if (file->get_file_type () != Gio::FILE_TYPE_DIRECTORY) {
continue;
}
if (!addHidden && file->is_hidden ()) {
continue;
}
subDirs.push_back (file->get_name ());
} catch (const Glib::Exception& exception) {
if (options.rtSettings.verbose) {
std::cerr << exception.what () << std::endl;
}
}
if (!addHidden && file->is_hidden ()) {
continue;
}
subDirs.push_back (file->get_name ());
}
} catch (const Glib::Exception& exception) {