From df1b666cc51eccaae0ec19377c113ff9b6616133 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Mon, 17 Dec 2012 01:48:56 +0100 Subject: [PATCH] Fix variables passed to kde4 applications This resolves Bug 1366 --- CMakeLists.txt | 2 ++ config.h.cmake | 3 +++ kio/kio/kservice.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9315a4b25..15d2ac4d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,8 @@ OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_ASPELL "Enable aspell support" OFF ) OPTION( WITH_HSPELL "Enable hspell support" OFF ) +set( KDE4_DEFAULT_HOME ".kde" CACHE PATH "KDE4 home directory passed as KDEHOME to kde4 applications" ) + ##### set PKG_CONFIG_PATH ####################### diff --git a/config.h.cmake b/config.h.cmake index da0a2b72c..e50d7184f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -707,6 +707,9 @@ /* The compiled in system configuration prefix */ #define KDESYSCONFDIR "@CONFIG_INSTALL_DIR@" +/* The default KDE4 home directory */ +#define KDE4_DEFAULT_HOME "@KDE4_DEFAULT_HOME@" + /* what C++ compiler was used for compilation */ #define KDE_COMPILER_VERSION "@KDE_COMPILER_VERSION@" diff --git a/kio/kio/kservice.cpp b/kio/kio/kservice.cpp index 49641032b..5a179dc56 100644 --- a/kio/kio/kservice.cpp +++ b/kio/kio/kservice.cpp @@ -198,7 +198,7 @@ KService::init( KDesktopFile *config ) m_strExec = config->readPathEntry( "Exec" ); if (kde4application && !m_strExec.startsWith("/")) { - m_strExec = "KDEHOME=$HOME/.trinity XDG_DATA_DIRS=/usr/share KDEDIRS=/usr/ XDG_CONFIG_DIRS=/etc/xdg/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$PATH "+m_strExec; + m_strExec = "KDEHOME=$HOME/" KDE4_DEFAULT_HOME " XDG_DATA_DIRS=/usr/share KDEDIRS=/usr/ XDG_CONFIG_DIRS=/etc/xdg/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$PATH "+m_strExec; } else if (config->readBoolEntry("X-KDE-SubstituteUID")) { int space = m_strExec.find(" "); if (space==-1)