From: Olivier Goffart Date: Mon, 4 Jun 2018 11:48:31 +0000 (+0200) Subject: nautilus shell integration: Fix when there are several branded client installed X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~571 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=919debccfcbe141c3bee5c64ca2502a5cd0c5866;p=nextcloud-desktop.git nautilus shell integration: Fix when there are several branded client installed It appears that several extension can be loaded at the same time, but their classname for the extension need to be different, otherwise only the last loaded one would be active. Issue #6524 --- diff --git a/shell_integration/nautilus/setappname.sh b/shell_integration/nautilus/setappname.sh index d59c3110e..6e8d5f3f7 100755 --- a/shell_integration/nautilus/setappname.sh +++ b/shell_integration/nautilus/setappname.sh @@ -3,4 +3,6 @@ # this script replaces the line # appname = 'Nextcloud' # with the correct branding name in the syncstate.py script -sed -i.org -e 's/appname\s*=\s*'"'"'Nextcloud'"'/appname = '$1'/" syncstate.py +# It also replaces the occurences in the class name so several +# branding can be loaded (see #6524) +sed -i.org -e "s/Nextcloud/$1/g" syncstate.py diff --git a/shell_integration/nautilus/syncstate.py b/shell_integration/nautilus/syncstate.py index a3ff9f4f2..c4dacb5b0 100644 --- a/shell_integration/nautilus/syncstate.py +++ b/shell_integration/nautilus/syncstate.py @@ -28,10 +28,8 @@ import time from gi.repository import GObject, Nautilus -# Please do not touch the following line. -# The reason is that we use a script to adopt this file for branding -# by replacing this line with the branding app name. If the following -# line is changed, the script can not match the pattern and fails. +# Note: setappname.sh will search and replace 'ownCloud' on this file to update this line and other +# occurrences of the name appname = 'Nextcloud' print("Initializing "+appname+"-client-nautilus extension") @@ -177,7 +175,7 @@ class SocketConnect(GObject.GObject): socketConnect = SocketConnect() -class MenuExtension(GObject.GObject, Nautilus.MenuProvider): +class MenuExtension_ownCloud(GObject.GObject, Nautilus.MenuProvider): def __init__(self): GObject.GObject.__init__(self) @@ -348,7 +346,7 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider): socketConnect.sendCommand(action + ":" + filename + "\n") -class SyncStateExtension(GObject.GObject, Nautilus.InfoProvider): +class SyncStateExtension_ownCloud(GObject.GObject, Nautilus.InfoProvider): def __init__(self): GObject.GObject.__init__(self)