diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-06 05:13:23 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-06 05:13:23 +0200 |
commit | 58ceabb21192742a46c9edf321459e54de23f0aa (patch) | |
tree | fc2ca5528f9dee68aa9013fb1b7424cd54bf45b1 /facetracknoir/ui.cpp | |
parent | 873667c7b59aeb02ffc813630736c87b11664c9b (diff) | |
parent | 0f7a4ba62369a42cf6b513ce0fa59d117551f0ed (diff) |
Merge branch 'unstable' into trackhat-ui
* unstable:
ui: sort combobox items according to their name, not filename
mouse: remove GPL, has since been rewritten
mouse: decruft
freetrack: new game definitions
Diffstat (limited to 'facetracknoir/ui.cpp')
-rw-r--r-- | facetracknoir/ui.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index eb6cf7e1..43358f1b 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -21,6 +21,13 @@ # include <windows.h> #endif +template<typename t> +static QList<t> sorted(QList<t> xs) +{ + std::sort(xs.begin(), xs.end(), [&](const t& a, const t& b) { return a->name.toLower() < b->name.toLower(); }); + return xs; +} + MainWindow::MainWindow() : pose_update_timer(this), kbd_quit(QKeySequence("Ctrl+Q"), this), @@ -39,7 +46,7 @@ MainWindow::MainWindow() : connect(ui.btnShortcuts, SIGNAL(clicked()), this, SLOT(show_options_dialog())); connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showProtocolSettings())); - for (auto x : modules.protocols()) + for (auto x : sorted(modules.protocols())) ui.iconcomboProtocol->addItem(x->icon, x->name); refresh_config_list(); |