summaryrefslogtreecommitdiffstats
path: root/src/dialog.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2016-01-26 15:18:50 +0100
committerJonathan Bauer2016-01-26 15:18:50 +0100
commit08ca25dbb84a936df5c597a45fd08b98bb942a98 (patch)
tree6003cb1ea23fef496e7af3caee26b1647f1a2e19 /src/dialog.cpp
parentScroll the item into view when selecting programatically (diff)
downloadvmchooser2-08ca25dbb84a936df5c597a45fd08b98bb942a98.tar.gz
vmchooser2-08ca25dbb84a936df5c597a45fd08b98bb942a98.tar.xz
vmchooser2-08ca25dbb84a936df5c597a45fd08b98bb942a98.zip
reworked session information sent to the session process
exports the Exec= command as SESSION_CMD exports the type of the session (virtual/native) as SESSION_TYPE
Diffstat (limited to 'src/dialog.cpp')
-rw-r--r--src/dialog.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 17fc474..9cb5aeb 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -111,8 +111,14 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index)
setenv("PVS_AUTO_CONNECT", "TRUE", 1);
else
setenv("PVS_AUTO_CONNECT", "FALSE", 1);
- setenv("SESSION_NAME", s->shortDescription().toUtf8(), 1);
-
+ // export session information to the environment of the process to be exec'ed
+ if (s->type() == Session::VSESSION) {
+ setenv("SESSION_TYPE", "VSESSION", 1);
+ setenv("SESSION_CMD", "", 1);
+ } else if (s->type() == Session::XSESSION) {
+ setenv("SESSION_TYPE", "XSESSION", 1);
+ setenv("SESSION_CMD", s->execCommand() != NULL ? s->execCommand().toUtf8() : "", 1);
+ }
// Fork this process twice to detach
pid_t pid = fork();
if (pid == 0) {