소스 검색

shell/macOS: Make sure the root folder's cache is cleared on disconnect

The SocketAPI now only sends status pushes for paths requested by the
shell. We have to make sure that Finder doesn't just show the entry
from its cache after a reconnect.
Jocelyn Turcotte 9 년 전
부모
커밋
cb5cfb8cf6
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m

+ 5 - 1
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m

@@ -155,9 +155,13 @@
 {
 	_shareMenuTitle = nil;
 	
+	[_registeredDirectories removeAllObjects];
+	// For some reason the FIFinderSync cache doesn't seem to be cleared for the root item when
+	// we reset the directoryURLs (seen on macOS 10.12 at least).
+	// First setting it to the FS root and then setting it to nil seems to work around the issue.
+	[FIFinderSyncController defaultController].directoryURLs = [NSSet setWithObject:[NSURL fileURLWithPath:@"/"]];
 	// This will tell Finder that this extension isn't attached to any directory
 	// until we can reconnect to the sync client.
-	[_registeredDirectories removeAllObjects];
 	[FIFinderSyncController defaultController].directoryURLs = nil;
 }