summaryrefslogtreecommitdiffstats
path: root/src/xsession.h
diff options
context:
space:
mode:
authorJonathan Bauer2018-06-26 18:31:57 +0200
committerJonathan Bauer2018-06-26 18:31:57 +0200
commitee5759a157eb3c5c7d0c343aa6ac066f6c14b3f0 (patch)
tree5172781d1f7be6b06def918c77a116385a14dcde /src/xsession.h
parentOnly apply LDAP filter logic if lecture has any filters... (diff)
downloadvmchooser2-ee5759a157eb3c5c7d0c343aa6ac066f6c14b3f0.tar.gz
vmchooser2-ee5759a157eb3c5c7d0c343aa6ac066f6c14b3f0.tar.xz
vmchooser2-ee5759a157eb3c5c7d0c343aa6ac066f6c14b3f0.zip
support for xsessions priority and renaming
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_*/