mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 15:05:19 +03:00
Merge pull request #3531 from jturcotte/master
Remove need for UPDATE_VIEW to refetch the status #2340
This commit is contained in:
commit
7985c0d7f1
6 changed files with 7 additions and 34 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue