[Pkg-owncloud-commits] [owncloud-client] 180/219: OS X Overlay Icons: Fix request for sync dir itself

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:24 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 02f971b534e12fc0438b71c76a4b005735e4b413
Author: Markus Goetz <markus at woboq.com>
Date:   Tue Sep 30 12:53:35 2014 +0200

    OS X Overlay Icons: Fix request for sync dir itself
---
 .../MacOSX/OwnCloudFinder/ContentManager.m            | 19 +++++++++++++------
 .../MacOSX/OwnCloudFinder/IconOverlayHandlers.m       |  2 +-
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
index b9e49e7..d0a6659 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/ContentManager.m
@@ -118,7 +118,7 @@ static ContentManager* sharedInstance = nil;
 
     if (![_fileNamesCache objectForKey:normalizedPath] || ![[_fileNamesCache objectForKey:normalizedPath] isEqualTo:res]) {
 		[_fileNamesCache setObject:res forKey:normalizedPath];
-		// NSLog(@"SET value %d", [res intValue]);
+		//NSLog(@"SET value %d %@", [res intValue], normalizedPath);
 		_hasChangedContent = YES;
 		[self performSelector:@selector(repaintAllWindowsIfNeeded) withObject:0 afterDelay:1.0]; // 1 sec
 	}
@@ -144,7 +144,7 @@ static ContentManager* sharedInstance = nil;
 	}
 	
 	NSNumber* result = [_fileNamesCache objectForKey:normalizedPath];
-	// NSLog(@"XXXXXXX Asking for icon for path %@ = %d",path, [result intValue]);
+	// NSLog(@"XXXXXXX Asking for icon for path %@ = %d",normalizedPath, [result intValue]);
 	
 	if( result == nil ) {
 		// start the async call
@@ -192,15 +192,22 @@ static ContentManager* sharedInstance = nil;
 
 - (void)reFetchFileNameCacheForPath:(NSString*)path
 {
-	// NSLog(@"%@", NSStringFromSelector(_cmd));
+	 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);
+			[[RequestManager sharedInstance] askForIcon:p isDirectory:false]; // FIXME isDirectory parameter
+			//[_fileNamesCache setObject:askState forKey:p]; We don't do this since we want to keep the old icon meanwhile
+			//NSLog(@"%@ %@", NSStringFromSelector(_cmd), p);
 		}
 	}
+
+	// Ask for directory itself
+	if ([path hasSuffix:@"/"]) {
+		path = [path substringToIndex:path.length - 1];
+	}
+	[[RequestManager sharedInstance] askForIcon:path isDirectory:true];
+	//NSLog(@"%@ %@", NSStringFromSelector(_cmd), path);
 }
 
 
diff --git a/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m b/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m
index ca95923..d51cea9 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/IconOverlayHandlers.m
@@ -77,7 +77,7 @@
 	}
 
 	NSNumber* imageIndex = [[ContentManager sharedInstance] iconByPath:[url path] isDirectory:isDir];
-	// NSLog(@"2 The icon index is %d", [imageIndex intValue]);
+	//NSLog(@"2 The icon index is %d %@ %@", [imageIndex intValue], [url path], isDir ? @"isDir" : @"");
 
 	if ([imageIndex intValue] > 0)
 	{

-- 
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