summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 91b39e7..68f92ef 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,12 +7,17 @@
#include <QMap>
#include <QString>
#include <QSettings>
+#include <QtAlgorithms>
#include "save_restore_session.h"
#include "xsession.h"
#include "vsession.h"
#include "globals.h"
#include "command_line_options.h"
+bool myLessThan(Session* a, Session* b) {
+ return *a < *b;
+}
+
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
@@ -146,13 +151,14 @@ int main(int argc, char *argv[]) {
Dialog w;
w.resize(width, height);
if (xsessions.size()) {
+ qSort(xsessions.begin(), xsessions.end(), myLessThan);
w.addItems(xsessions, a.translate("Dialog", "X Sessions"));
}
if (vsessions.size()) {
+ qSort(vsessions.begin(), vsessions.end(), myLessThan);
w.addItems(vsessions, a.translate("Dialog", "Virtual Sessions"));
}
w.selectSession(defaultSession);
w.show();
return a.exec();
}
-