mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 14:36:01 +03:00
Resolve symlinks when checking for registered paths.
Fixes issue #1948: https://github.com/nextcloud/desktop/issues/1948 The client already resolves symlinks when adding new paths to the sync-list, but the Nautilus plugin did not do this yet, causing it to not recognise synced folders if they were accessed via a symlink. Signed-off-by: Daniel Vedder <d.vedder@web.de>
This commit is contained in:
parent
7193d2ffba
commit
0743a0b502
1 changed files with 4 additions and 2 deletions
|
@ -191,11 +191,12 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider):
|
|||
def check_registered_paths(self, filename):
|
||||
topLevelFolder = False
|
||||
internalFile = False
|
||||
absfilename = os.path.realpath(filename)
|
||||
for reg_path in socketConnect.registered_paths:
|
||||
if filename == reg_path:
|
||||
if absfilename == reg_path:
|
||||
topLevelFolder = True
|
||||
break
|
||||
if filename.startswith(reg_path):
|
||||
if absfilename.startswith(reg_path):
|
||||
internalFile = True
|
||||
# you can't have a registered path below another so it is save to break here
|
||||
break
|
||||
|
@ -447,6 +448,7 @@ class SyncStateExtension(GObject.GObject, Nautilus.InfoProvider):
|
|||
return
|
||||
|
||||
filename = get_local_path(item.get_uri())
|
||||
filename = os.path.realpath(filename)
|
||||
if item.is_directory():
|
||||
filename += os.sep
|
||||
|
||||
|
|
Loading…
Reference in a new issue