Skip to content

Commit

Permalink
Reworked read flag syncing.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhartford committed Aug 29, 2011
1 parent 30d1d35 commit 1993d27
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ArticleController.m
Expand Up @@ -680,12 +680,6 @@ -(void)markAllReadByArray:(NSArray *)folderArray withUndo:(BOOL)undoFlag withRef
[theArticle markRead:YES]; [theArticle markRead:YES];
} }


GRSMarkReadOperation * op = [[GRSMarkReadOperation alloc] init];
[op setArticles:folderArrayOfArticles];
[op setReadFlag:YES];
[operationQueue addOperation:op];
[op release];

if (refreshFlag) if (refreshFlag)
[mainArticleView refreshFolder:MA_Refresh_RedrawList]; [mainArticleView refreshFolder:MA_Refresh_RedrawList];
[[NSApp delegate] showUnreadCountOnApplicationIconAndWindowTitle]; [[NSApp delegate] showUnreadCountOnApplicationIconAndWindowTitle];
Expand Down Expand Up @@ -714,6 +708,12 @@ -(NSArray *)wrappedMarkAllReadInArray:(NSArray *)folderArray withUndo:(BOOL)undo
if ([db markFolderRead:folderId]) if ([db markFolderRead:folderId])
{ {
[foldersTree updateFolder:folderId recurseToParents:YES]; [foldersTree updateFolder:folderId recurseToParents:YES];

GRSMarkReadOperation * op = [[GRSMarkReadOperation alloc] init];
[op setArticles:[folder articles]];
[op setReadFlag:YES];
[operationQueue addOperation:op];
[op release];
} }
} }
else else
Expand Down Expand Up @@ -880,9 +880,13 @@ -(void)handleRefreshArticle:(NSNotification *)nc
[mainArticleView handleRefreshArticle:nc]; [mainArticleView handleRefreshArticle:nc];
} }


// TODO this is being called too often by sync operations. We should try to avoid
// querying the database so often. Need to look into having the sync operations know
// when everything has been completed and only query the database once.
-(void)handleArticleListStateChange:(NSNotification *)nc -(void)handleArticleListStateChange:(NSNotification *)nc
{ {
[mainArticleView refreshFolder:MA_Refresh_ReloadFromDatabase]; [mainArticleView refreshFolder:MA_Refresh_ReloadFromDatabase];
//[mainArticleView refreshFolder:MA_Refresh_RedrawList];
} }


/* handleFolderUpdate /* handleFolderUpdate
Expand Down

0 comments on commit 1993d27

Please sign in to comment.