mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-15 18:21:35 +03:00
Manged folder list in the tray icon is now sorted
We are using a QHash to store all the folder objects. This does not allow for easy sorting and looks weird to the user. Now they are first inserted into a temp QMap to sort them properly.
This commit is contained in:
parent
e8efaa5ed8
commit
8677fb18bb
1 changed files with 7 additions and 1 deletions
|
@ -323,7 +323,13 @@ void ownCloudGui::setupContextMenu()
|
|||
if ( folderCnt > 1) {
|
||||
_contextMenu->addAction(tr("Managed Folders:"))->setDisabled(true);
|
||||
}
|
||||
foreach (Folder *folder, folderMan->map() ) {
|
||||
|
||||
// Put everything first in a QMap to properly sort
|
||||
QMap<QString, Folder*> folders;
|
||||
for( auto i = folderMan->map().constBegin(); i != folderMan->map().constEnd(); i++) {
|
||||
folders.insert(i.key(), i.value());
|
||||
}
|
||||
foreach (auto folder, folders) {
|
||||
QAction *action = new QAction( tr("Open folder '%1'").arg(folder->alias()), this );
|
||||
connect( action, SIGNAL(triggered()),_folderOpenActionMapper,SLOT(map()));
|
||||
_folderOpenActionMapper->setMapping( action, folder->alias() );
|
||||
|
|
Loading…
Reference in a new issue