summaryrefslogtreecommitdiffstats
path: root/src/xsession.h
diff options
context:
space:
mode:
authorSimon Rettberg2018-07-26 17:16:12 +0200
committerSimon Rettberg2018-07-26 17:16:12 +0200
commit25a457eaf54c9ff371481f1a871846918baf9826 (patch)
treeac6defd9c1982574aa8459eac5925f44e3d1ab96 /src/xsession.h
parentCleanup code style (C++11, casts, etc) (diff)
parentkeep 0 as default priority (diff)
downloadvmchooser2-25a457eaf54c9ff371481f1a871846918baf9826.tar.gz
vmchooser2-25a457eaf54c9ff371481f1a871846918baf9826.tar.xz
vmchooser2-25a457eaf54c9ff371481f1a871846918baf9826.zip
Merge branch 'master' of git.openslx.org:openslx-ng/vmchooser2
Diffstat (limited to 'src/xsession.h')
-rw-r--r--src/xsession.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xsession.h b/src/xsession.h
index 27e431e..fcef5d4 100644
--- a/src/xsession.h
+++ b/src/xsession.h
@@ -6,6 +6,7 @@
#include <QDomDocument>
#include <QDir>
#include <QProcess>
+#include <QRegularExpression>
#include "session.h"
class XSession : public Session {
@@ -17,7 +18,6 @@ class XSession : public Session {
bool isActive() const;
bool isLocked() const;
bool isValid() const;
- int priority() const;
SectionType section() const {
return SECTION_XSESSION;
@@ -35,6 +35,10 @@ class XSession : public Session {
return this->exec_;
}
+ int priority() const {
+ return this->priority_;
+ }
+
QIcon icon() const;
bool run() const;
@@ -52,8 +56,23 @@ class XSession : public Session {
QString exec_;
QString comment_;
QString icon_;
+ int priority_;
QProcess *_process;
+
+ static void loadXSessionsConfig();
+
+ static inline int find(QChar c, int start, const QString& line)
+ {
+ do {
+ int next = line.indexOf(c, start);
+ if (next == -1)
+ return -1;
+ if (line.at(next - 1) != '\\')
+ return next;
+ start = next + 1;
+ } while (true);
+ }
};
#endif /*VMCHOOSER_XSESSION_H_*/