From d102e6a5841750d109e36d46c95fcac536276a58 Mon Sep 17 00:00:00 2001 From: Barijaona Ramaholimihaso Date: Mon, 29 Jul 2024 11:53:12 +0300 Subject: [PATCH] Extend tree recovery to group folders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ‑loadTree:rootNode: returns NO, recover group folders as well as RSS and OpenReader folders by reattaching them under the root folder. A user reported in issue #1784 losing group folders which just went invisible but were still present in database. --- Vienna/Sources/Main window/FoldersTree.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Vienna/Sources/Main window/FoldersTree.m b/Vienna/Sources/Main window/FoldersTree.m index 5eb6dcfbdd..4802d64d74 100644 --- a/Vienna/Sources/Main window/FoldersTree.m +++ b/Vienna/Sources/Main window/FoldersTree.m @@ -159,12 +159,9 @@ -(void)reloadDatabase:(NSArray *)stateArray // recover from problems by putting missing folders under root node NSArray *allFolders = [[[Database sharedManager] arrayOfAllFolders] sortedArrayUsingSelector:@selector(folderNameCompare:)]; // all RSS and group folders - NSArray *installedFolders = [self folders:0]; // RSS folders already present for (Folder *folder in allFolders) { - if ((folder.type == VNAFolderTypeRSS || folder.type == VNAFolderTypeOpenReader) - && ![installedFolders containsObject:folder]) - { - (void)[[TreeNode alloc] init:self.rootNode atIndex:-1 folder:folder canHaveChildren:NO]; + if (![[self children:0] containsObject:folder]) { // not in already installed RSS and group folders + (void)[[TreeNode alloc] init:self.rootNode atIndex:-1 folder:folder canHaveChildren:folder.isGroupFolder]; } } // save the state after recovery