sort labels in article previewer alphabetically - fixes #978
This commit is contained in:
parent
1cc9b1d773
commit
da4acf9044
@ -2,6 +2,7 @@
|
||||
|
||||
#include "gui/messagepreviewer.h"
|
||||
|
||||
#include "3rd-party/boolinq/boolinq.h"
|
||||
#include "database/databasequeries.h"
|
||||
#include "gui/dialogs/formmain.h"
|
||||
#include "gui/itemdetails.h"
|
||||
@ -282,6 +283,10 @@ void MessagePreviewer::updateLabels(bool only_clear) {
|
||||
m_separator = m_toolBar->addSeparator();
|
||||
auto lbls = m_root.data()->getParentServiceRoot()->labelsNode()->labels();
|
||||
|
||||
std::sort(lbls.begin(), lbls.end(), [](Label* lhs, Label* rhs) {
|
||||
return lhs->title().compare(rhs->title(), Qt::CaseSensitivity::CaseInsensitive) < 0;
|
||||
});
|
||||
|
||||
for (auto* label : lbls) {
|
||||
LabelToolbarAction* act_label = new LabelToolbarAction(this);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user