Permalink
Browse files

Reworked read flag syncing.

  • Loading branch information...
1 parent 30d1d35 commit 1993d27d6d13ca45a89846f12352b7af1deaea89 @adamhartford adamhartford committed Aug 29, 2011
Showing with 11 additions and 7 deletions.
  1. +11 −7 ArticleController.m
View
@@ -680,12 +680,6 @@ -(void)markAllReadByArray:(NSArray *)folderArray withUndo:(BOOL)undoFlag withRef
[theArticle markRead:YES];
}
- GRSMarkReadOperation * op = [[GRSMarkReadOperation alloc] init];
- [op setArticles:folderArrayOfArticles];
- [op setReadFlag:YES];
- [operationQueue addOperation:op];
- [op release];
-
if (refreshFlag)
[mainArticleView refreshFolder:MA_Refresh_RedrawList];
[[NSApp delegate] showUnreadCountOnApplicationIconAndWindowTitle];
@@ -714,6 +708,12 @@ -(NSArray *)wrappedMarkAllReadInArray:(NSArray *)folderArray withUndo:(BOOL)undo
if ([db markFolderRead:folderId])
{
[foldersTree updateFolder:folderId recurseToParents:YES];
+
+ GRSMarkReadOperation * op = [[GRSMarkReadOperation alloc] init];
+ [op setArticles:[folder articles]];
+ [op setReadFlag:YES];
+ [operationQueue addOperation:op];
+ [op release];
}
}
else
@@ -880,9 +880,13 @@ -(void)handleRefreshArticle:(NSNotification *)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
{
- [mainArticleView refreshFolder:MA_Refresh_ReloadFromDatabase];
+ [mainArticleView refreshFolder:MA_Refresh_ReloadFromDatabase];
+ //[mainArticleView refreshFolder:MA_Refresh_RedrawList];
}
/* handleFolderUpdate

0 comments on commit 1993d27

Please sign in to comment.