Use case insensitive alphabetical sort in tree-browsers (#5875)
* sort items in tree-browsers caseinsensitively in alphabetical order
This commit is contained in:
@@ -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<QTreeWidgetItem*> items;
|
||||
files = thisDir.entryList( QDir::Files, QDir::Name );
|
||||
files.sort(Qt::CaseInsensitive);
|
||||
for( QStringList::const_iterator it = files.constBegin();
|
||||
it != files.constEnd(); ++it )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user