Draft for timeout

This commit is contained in:
michael starke
2014-08-25 02:59:56 +02:00
parent 53a7f92b9b
commit 1daaa2075e

View File

@@ -293,6 +293,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
self.compositeKey = nil; // clear the key?
}
if(isUnlocked) {
self.unlockCount += 1;
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidUnlockDatabaseNotification object:self];
}
@@ -679,6 +680,17 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
}
[self.trash clear];
}
# pragma mark Expiration updates
- (void)_updateExpirationState {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60*60*6* NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
/* TODO: find better way to do this! Test for alle entries if expired */
[[self.tree allEntries] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
KPKEntry *entry = obj;
[entry.timeInfo willChangeValueForKey:NSStringFromSelector(@selector(isExpired))];
[entry.timeInfo didChangeValueForKey:NSStringFromSelector(@selector(isExpired))];
}];
});
}
# pragma mark File Watching
- (void) _watchForFileChanges:(BOOL)watch {