summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-12-03 18:04:01 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-12-03 18:04:01 +0100
commit187b4578d0ffefe9e9a47876322d4f444da7ba2d (patch)
tree2ac568c26477364a8d19bb6495d6b5af74525b02
parent6ead1060deb12181721fcc598b44f4e8c400abf1 (diff)
downloadkiosktool-187b4578d0ffefe9e9a47876322d4f444da7ba2d.tar.gz
kiosktool-187b4578d0ffefe9e9a47876322d4f444da7ba2d.zip
Add test whether the ICEauthority file exists in the folder
specified by the XDG_RUNTIME_DIR variable. This relates to bug 3027. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--kiosktool/kioskrun.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/kiosktool/kioskrun.cpp b/kiosktool/kioskrun.cpp
index bc6acfe..e4eede9 100644
--- a/kiosktool/kioskrun.cpp
+++ b/kiosktool/kioskrun.cpp
@@ -749,9 +749,22 @@ KioskRun::setupRuntimeEnv()
TDEStandardDirs::makeDir(cacheDir);
deleteDir(m_homeDir+"/.qt");
::unlink(TQFile::encodeName(m_homeDir+".tderc"));
-
- TQString iceAuth = TQString("%1/.ICEauthority").arg(TQDir::homeDirPath());
+ TQString iceFileBase = "ICEauthority";
+ TQString iceAuth;
+ if (getenv("XDG_RUNTIME_DIR"))
+ {
+ iceAuth = TQString("%1/%2").arg(getenv("XDG_RUNTIME_DIR")).arg(iceFileBase);
+ TQFileInfo fi(iceAuth);
+ if (!fi.exists())
+ {
+ iceAuth = TQString::null;
+ }
+ }
+ if (iceAuth.isEmpty())
+ {
+ iceAuth = TQString("%1/.%2").arg(TQDir::homeDirPath()).arg(iceFileBase);
+ }
setenv("ICEAUTHORITY", TQFile::encodeName(iceAuth), 0); // Don't overwrite existing setting
TQString xAuth = TQString("%1/.Xauthority").arg(TQDir::homeDirPath());