From ee5759a157eb3c5c7d0c343aa6ac066f6c14b3f0 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 26 Jun 2018 18:31:57 +0200 Subject: support for xsessions priority and renaming --- src/xsession.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/xsession.h') 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 #include #include +#include #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_*/ -- cgit v1.2.3-55-g7522