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>
pull/7/head
Slávek Banko 5 years ago
parent 6ead1060de
commit 187b4578d0
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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());

Loading…
Cancel
Save