[Pkg-owncloud-commits] [owncloud-client] 06/175: shell_integration on OSX: Do not fill the cache with unsolicited statuses #3122
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Aug 8 10:36:20 UTC 2015
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 0a67719f2fce9d46bf009755fd1b1759c57bb4c4
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date: Wed May 6 12:50:53 2015 +0200
shell_integration on OSX: Do not fill the cache with unsolicited statuses #3122
---
shell_integration/MacOSX/OwnCloudFinder/RequestManager.h | 1 +
shell_integration/MacOSX/OwnCloudFinder/RequestManager.m | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h
index 130c885..e5d4c19 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h
+++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.h
@@ -22,6 +22,7 @@
NSMutableArray* _requestQueue;
NSMutableDictionary* _registeredPathes;
+ NSMutableSet* _requestedPaths;
NSString *_shareMenuTitle;
diff --git a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
index 52f5d9f..62399a4 100644
--- a/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
+++ b/shell_integration/MacOSX/OwnCloudFinder/RequestManager.m
@@ -31,6 +31,7 @@ static RequestManager* sharedInstance = nil;
_isConnected = NO;
_registeredPathes = [[NSMutableDictionary alloc] init];
+ _requestedPaths = [[NSMutableSet alloc] init];
_shareMenuTitle = nil;
@@ -106,6 +107,7 @@ static RequestManager* sharedInstance = nil;
NSString *verb = @"RETRIEVE_FILE_STATUS";
if( [self isRegisteredPath:path isDirectory:isDir] ) {
+ [_requestedPaths addObject:path];
if( _isConnected ) {
if(isDir) {
verb = @"RETRIEVE_FOLDER_STATUS";
@@ -141,9 +143,13 @@ static RequestManager* sharedInstance = nil;
path, [chunks objectAtIndex:i+1] ];
}
}
- [contentman setResultForPath:path result:[chunks objectAtIndex:1]];
+ // The client will broadcast all changes, do not fill the cache for paths that Finder didn't ask for.
+ if ([_requestedPaths containsObject:path]) {
+ [contentman setResultForPath:path result:[chunks objectAtIndex:1]];
+ }
} else if( [[chunks objectAtIndex:0] isEqualToString:@"UPDATE_VIEW"] ) {
NSString *path = [chunks objectAtIndex:1];
+ [_requestedPaths removeAllObjects];
[contentman reFetchFileNameCacheForPath:path];
} else if( [[chunks objectAtIndex:0 ] isEqualToString:@"REGISTER_PATH"] ) {
NSNumber *one = [NSNumber numberWithInt:1];
@@ -192,6 +198,7 @@ static RequestManager* sharedInstance = nil;
for( NSString *path in _requestQueue ) {
[self askOnSocket:path query:@"RETRIEVE_FILE_STATUS"];
}
+ [_requestQueue removeAllObjects];
}
ContentManager *contentman = [ContentManager sharedInstance];
@@ -212,6 +219,7 @@ static RequestManager* sharedInstance = nil;
// clear the registered pathes.
[_registeredPathes release];
_registeredPathes = [[NSMutableDictionary alloc] init];
+ [_requestedPaths removeAllObjects];
// clear the caches in conent manager
ContentManager *contentman = [ContentManager sharedInstance];
--
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