Merge pull request #3531 from jturcotte/master

Remove need for UPDATE_VIEW to refetch the status #2340
This commit is contained in:
Markus Goetz 2015-08-06 11:03:28 +02:00
commit 7985c0d7f1
6 changed files with 7 additions and 34 deletions

View file

@ -286,7 +286,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
OC_TEAM_IDENTIFIER_PREFIX = "";
OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
PRODUCT_NAME = SyncStateFinder;
WRAPPER_EXTENSION = bundle;
};
@ -305,7 +305,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Bundles";
OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
OC_TEAM_IDENTIFIER_PREFIX = "";
OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
PRODUCT_NAME = SyncStateFinder;
WRAPPER_EXTENSION = bundle;
};

View file

@ -59,7 +59,6 @@
_syncClientProxy = [[SyncClientProxy alloc] initWithDelegate:self serverName:serverName];
_registeredDirectories = [[NSMutableSet alloc] init];
_requestedUrls = [[NSMutableSet alloc] init];
_shareMenuTitle = nil;
[_syncClientProxy start];
@ -68,23 +67,8 @@
#pragma mark - Primary Finder Sync protocol methods
- (void)endObservingDirectoryAtURL:(NSURL *)url
{
// The user is no longer seeing the container's contents.
// At this point we know that the status of any file as a direct child of url.filePathURL
// won't be displayed. Filter our _requestedUrls to get rid of them.
NSString *observedDirectoryPath = [url.filePathURL path];
[_requestedUrls filterUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
NSURL *requestedUrl = (NSURL *)evaluatedObject;
NSString *parentDir = [[requestedUrl path] stringByDeletingLastPathComponent];
return [parentDir isEqualToString:observedDirectoryPath];
}]];
}
- (void)requestBadgeIdentifierForURL:(NSURL *)url
{
[_requestedUrls addObject:url.filePathURL];
BOOL isDir;
if ([[NSFileManager defaultManager] fileExistsAtPath:[url path] isDirectory: &isDir] == NO) {
NSLog(@"ERROR: Could not determine file type of %@", [url path]);
@ -128,14 +112,6 @@
- (void)reFetchFileNameCacheForPath:(NSString*)path
{
// This shouldn't be necessary, and will be a problem when we
// filter values of _requestedUrls even though Finder might still
// have an old status in its cache (and therefore won't re-request it)
// but will do OK until we get the socket API to re-push the status of everything needed.
[_requestedUrls enumerateObjectsUsingBlock: ^(id url, BOOL *stop) {
if ([[url path] hasPrefix:path])
[self requestBadgeIdentifierForURL: url];
}];
}
- (void)registerPath:(NSString*)path

View file

@ -429,7 +429,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
OC_APPLICATION_NAME = ownCloud;
OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
OC_TEAM_IDENTIFIER_PREFIX = "";
OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@ -476,7 +476,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
OC_APPLICATION_NAME = ownCloud;
OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
OC_TEAM_IDENTIFIER_PREFIX = "";
OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SDKROOT = macosx;

View file

@ -300,10 +300,6 @@ void SocketApi::slotSyncItemDiscovered(const QString &folder, const SyncFileItem
return;
}
if (item._instruction == CSYNC_INSTRUCTION_NONE) {
return;
}
Folder *f = FolderMan::instance()->folder(folder);
if (!f) {
return;

View file

@ -605,6 +605,7 @@ void PropagateDirectory::slotSubJobFinished(SyncFileItem::Status status)
(sender() == _firstJob.data() && status != SyncFileItem::Success && status != SyncFileItem::Restoration)) {
abort();
_state = Finished;
emit completed(*_item);
emit finished(status);
return;
} else if (status == SyncFileItem::NormalError || status == SyncFileItem::SoftError) {
@ -648,6 +649,7 @@ void PropagateDirectory::finalize()
}
}
_state = Finished;
emit completed(*_item);
emit finished(_hasError == SyncFileItem::NoStatus ? SyncFileItem::Success : _hasError);
}

View file

@ -467,7 +467,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
_journal->setFileRecord(SyncJournalFileRecord(*item, _localPath + item->_file));
item->_should_update_metadata = false;
}
if (item->_isDirectory && (remote || file->should_update_metadata)) {
if (item->_isDirectory && file->should_update_metadata) {
// Because we want still to update etags of directories
dir = SyncFileItem::None;
} else {
@ -476,7 +476,6 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
_hasNoneFiles = true;
}
emit syncItemDiscovered(*item);
return re;
}
break;