From 6fde9c8fdba47ab9fb7cfda8e12225fc5a64deae Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Wed, 23 Dec 2009 16:40:24 -0800
Subject: [PATCH] DEV-39784 SNOW-218: KDE 4 applications don't recognize
 secondlife:// urls

patch by thickbrick sleaford, reviewed by me (tofu linden)
---
 doc/contributions.txt                         |  1 +
 .../register_secondlifeprotocol.sh            | 22 ++++++++++---------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 4b36c44a5f7..cf10ecccfbb 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -600,6 +600,7 @@ Tharax Ferraris
 Thickbrick Sleaford
 	VWR-7109
 	VWR-9287
+	VWR-13483
 	VWR-13947
 Thraxis Epsilon
 	SVC-371
diff --git a/indra/newview/linux_tools/register_secondlifeprotocol.sh b/indra/newview/linux_tools/register_secondlifeprotocol.sh
index c7b4d554611..16e73cb854f 100755
--- a/indra/newview/linux_tools/register_secondlifeprotocol.sh
+++ b/indra/newview/linux_tools/register_secondlifeprotocol.sh
@@ -22,13 +22,12 @@ else
 fi
 
 # Register handler for KDE-aware apps
-if [ -z "$KDEHOME" ]; then
-    KDEHOME=~/.kde
-fi
-LLKDEPROTDIR=${KDEHOME}/share/services
-if [ -d "$LLKDEPROTDIR" ]; then
-    LLKDEPROTFILE=${LLKDEPROTDIR}/secondlife.protocol
-    cat > ${LLKDEPROTFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTFILE}
+for LLKDECONFIG in kde-config kde4-config; do
+    if [ `which $LLKDECONFIG` ]; then
+        LLKDEPROTODIR=`$LLKDECONFIG --path services | cut -d ':' -f 1`
+        if [ -d "$LLKDEPROTODIR" ]; then
+            LLKDEPROTOFILE=${LLKDEPROTODIR}/secondlife.protocol
+            cat > ${LLKDEPROTOFILE} <<EOF || echo Warning: Did not register secondlife:// handler with KDE: Could not write ${LLKDEPROTOFILE} 
 [Protocol]
 exec=${HANDLER} '%u'
 protocol=secondlife
@@ -41,6 +40,9 @@ writing=false
 makedir=false
 deleting=false
 EOF
-else
-    echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTDIR does not exist.
-fi
+        else
+            echo Warning: Did not register secondlife:// handler with KDE: Directory $LLKDEPROTODIR does not exist.
+        fi
+    fi
+done
+
-- 
GitLab