[Pkg-owncloud-commits] [owncloud-client] 78/219: OS X: Fix Overlay icon retrieval

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 4ce03e8b61f5ed76f8a49c1afe53e595e2ebcd73
Author: Markus Goetz <markus at woboq.com>
Date:   Fri Sep 5 22:25:20 2014 +0200

    OS X: Fix Overlay icon retrieval
    
    Re-retrieve all icons for a path in case we receive UPDATE_VIEW.
    (But in contrast to previous code, don't delete the icons which then
    would have caused screen flickering)
---
 shell_integration/MacOSX/OwnCloudFinder/ContentManager.h |  1 +
 shell_integration/MacOSX/OwnCloudFinder/ContentManager.m | 14 ++++++++++++++
 shell_integration/MacOSX/OwnCloudFinder/RequestManager.m |  6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h
index 7ee3172..841d60f 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h
+++ b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.h
@@ -39,6 +39,7 @@
 - (void)setIcons:(NSDictionary*)iconDictionary filterByFolder:(NSString*)filterFolder;
 - (void)setResultForPath:(NSString*)path result:(NSString*)result;
 - (void)clearFileNameCacheForPath:(NSString*)path;
+- (void)reFetchFileNameCacheForPath:(NSString*)path;
 - (void)repaintAllWindows;
 
 @end
\ No newline at end of file
diff --git a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
index 51f95d8..d14e156 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
@@ -179,6 +179,20 @@ static ContentManager* sharedInstance = nil;
 	}
 }
 
+- (void)reFetchFileNameCacheForPath:(NSString*)path
+{
+	NSLog(@"%@", NSStringFromSelector(_cmd));
+
+	for (id p in [_fileNamesCache keyEnumerator]) {
+		if ( path && [p hasPrefix:path] ) {
+			NSNumber *askState = [[RequestManager sharedInstance] askForIcon:p isDirectory:false]; // FIXME
+			//[_fileNamesCache setObject:askState forKey:p];
+			NSLog(@"%@ %@", NSStringFromSelector(_cmd), p);
+		}
+	}
+}
+
+
 - (void)removeAllIcons
 {
 	[_fileNamesCache removeAllObjects];
diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
index f4ab9cc..2b720b0 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
@@ -136,6 +136,7 @@ static RequestManager* sharedInstance = nil;
 			[contentman setResultForPath:[chunks objectAtIndex:2] result:[chunks objectAtIndex:1]];
 		} else if( [[chunks objectAtIndex:0] isEqualToString:@"UPDATE_VIEW"] ) {
 			NSString *path = [chunks objectAtIndex:1];
+			[contentman reFetchFileNameCacheForPath:path];
 		} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"REGISTER_PATH"] ) {
 			NSNumber *one = [NSNumber numberWithInt:1];
 			NSString *path = [chunks objectAtIndex:1];
@@ -178,6 +179,10 @@ static RequestManager* sharedInstance = nil;
 			[self askOnSocket:path];
 		}
 	}
+
+	ContentManager *contentman = [ContentManager sharedInstance];
+	[contentman clearFileNameCacheForPath:nil];
+	[contentman repaintAllWindows];
 	
 	// Read for the UPDATE_VIEW requests
 	NSData* stop = [@"\n" dataUsingEncoding:NSUTF8StringEncoding];
@@ -202,6 +207,7 @@ static RequestManager* sharedInstance = nil;
     // clear the caches in conent manager
 	ContentManager *contentman = [ContentManager sharedInstance];
 	[contentman clearFileNameCacheForPath:nil];
+	[contentman repaintAllWindows];
 
 	[NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(start) userInfo:nil repeats:NO];
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list