mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 22:42:18 +00:00
Removed caching for trash and templates as it does not get correctly updated when the respective groups get deleted
This commit is contained in:
@@ -158,6 +158,9 @@
|
|||||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||||
<font key="font" metaFont="smallSystem"/>
|
<font key="font" metaFont="smallSystem"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="emptyTrash:" target="-1" id="uIZ-CN-kXB"/>
|
||||||
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
</subviews>
|
</subviews>
|
||||||
<constraints>
|
<constraints>
|
||||||
|
|||||||
@@ -313,13 +313,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (KPKGroup *)trash {
|
- (KPKGroup *)trash {
|
||||||
static KPKGroup *_trash = nil;
|
/* Caching is dangerous, as we might have deleted the trashcan */
|
||||||
if(self.useTrash) {
|
if(self.useTrash) {
|
||||||
BOOL trashValid = [_trash.uuid isEqual:self.tree.metaData.recycleBinUuid];
|
return [self findGroup:self.tree.metaData.recycleBinUuid];
|
||||||
if(!trashValid) {
|
|
||||||
_trash = [self findGroup:self.tree.metaData.recycleBinUuid];
|
|
||||||
}
|
|
||||||
return _trash;
|
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
@@ -329,12 +325,8 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (KPKGroup *)templates {
|
- (KPKGroup *)templates {
|
||||||
static KPKGroup *_templates = nil;
|
/* Caching is dangerous as we might have deleted the group */
|
||||||
BOOL templateValid = [_templates.uuid isEqual:self.tree.metaData.entryTemplatesGroup];
|
return [self findGroup:self.tree.metaData.entryTemplatesGroup];
|
||||||
if(!templateValid) {
|
|
||||||
_templates = [self findGroup:self.tree.metaData.entryTemplatesGroup];
|
|
||||||
}
|
|
||||||
return _templates;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setTrash:(KPKGroup *)trash {
|
- (void)setTrash:(KPKGroup *)trash {
|
||||||
|
|||||||
Reference in New Issue
Block a user