diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 9ba634ea56a..60b62d9a275 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -274,6 +274,7 @@ void FileBrowser::addItems(const QString & path ) // try to add all directories from file system alphabetically into the tree QDir cdir( path ); QStringList files = cdir.entryList( QDir::Dirs, QDir::Name ); + files.sort(Qt::CaseInsensitive); for( QStringList::const_iterator it = files.constBegin(); it != files.constEnd(); ++it ) { @@ -1081,8 +1082,13 @@ bool Directory::addItems(const QString & path ) } } + // sorts the path alphabetically instead of just appending to the bottom (see "orphans") + if (added_something) + sortChildren(0, Qt::AscendingOrder); + QList items; files = thisDir.entryList( QDir::Files, QDir::Name ); + files.sort(Qt::CaseInsensitive); for( QStringList::const_iterator it = files.constBegin(); it != files.constEnd(); ++it ) {