27
27
#import " ArticleRef.h"
28
28
#import " StringExtensions.h"
29
29
#import " GoogleReader.h"
30
- #import " RefreshManager.h"
31
30
#import " ArticleListView.h"
32
31
#import " UnifiedDisplayView.h"
33
32
@@ -660,10 +659,6 @@ -(void)markDeletedByArray:(NSArray *)articleArray deleteFlag:(BOOL)deleteFlag
660
659
else
661
660
[NSApp .mainWindow makeFirstResponder: foldersTree.mainView];
662
661
}
663
-
664
- // If any of the articles we deleted were unread then the
665
- // folder's unread count just changed.
666
- [APPCONTROLLER showUnreadCountOnApplicationIconAndWindowTitle ];
667
662
}
668
663
669
664
/* deleteArticlesByArray
@@ -697,8 +692,6 @@ -(void)deleteArticlesByArray:(NSArray *)articleArray
697
692
} else {
698
693
[NSApp .mainWindow makeFirstResponder: foldersTree.mainView];
699
694
}
700
- // Read and/or unread count may have changed
701
- [APPCONTROLLER showUnreadCountOnApplicationIconAndWindowTitle ];
702
695
}
703
696
704
697
/* markUnflagUndo
@@ -780,10 +773,6 @@ -(void)markReadByArray:(NSArray *)articleArray readFlag:(BOOL)readFlag
780
773
[self innerMarkReadByArray: articleArray readFlag: readFlag];
781
774
782
775
[mainArticleView refreshFolder: MA_Refresh_RedrawList];
783
-
784
- // The info bar has a count of unread articles so we need to
785
- // update that.
786
- [APPCONTROLLER showUnreadCountOnApplicationIconAndWindowTitle ];
787
776
}
788
777
789
778
/* innerMarkReadByArray
@@ -803,14 +792,18 @@ -(void)innerMarkReadByArray:(NSArray *)articleArray readFlag:(BOOL)readFlag
803
792
} else {
804
793
[[Database sharedManager ] markArticleRead: folderId guid: theArticle.guid isRead: readFlag];
805
794
[theArticle markRead: readFlag];
806
- if (folderId != lastFolderId && lastFolderId != -1 )
807
- [foldersTree updateFolder: lastFolderId recurseToParents: YES ];
795
+ if (folderId != lastFolderId && lastFolderId != -1 ) {
796
+ [[NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated"
797
+ object: @(lastFolderId)];
798
+ }
808
799
lastFolderId = folderId;
809
800
}
810
801
}
811
802
}
812
- if (lastFolderId != -1 )
813
- [foldersTree updateFolder: lastFolderId recurseToParents: YES ];
803
+ if (lastFolderId != -1 ) {
804
+ [[NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated"
805
+ object: @(lastFolderId)];
806
+ }
814
807
}
815
808
816
809
/* innerMarkReadByRefsArray
@@ -832,13 +825,17 @@ -(void)innerMarkReadByRefsArray:(NSArray *)articleArray readFlag:(BOOL)readFlag
832
825
}
833
826
} else {
834
827
[db markArticleRead: folderId guid: articleRef.guid isRead: readFlag];
835
- if (folderId != lastFolderId && lastFolderId != -1 )
836
- [foldersTree updateFolder: lastFolderId recurseToParents: YES ];
828
+ if (folderId != lastFolderId && lastFolderId != -1 ) {
829
+ [[NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated"
830
+ object: @(lastFolderId)];
831
+ }
837
832
lastFolderId = folderId;
838
833
}
839
834
}
840
- if (lastFolderId != -1 )
841
- [foldersTree updateFolder: lastFolderId recurseToParents: YES ];
835
+ if (lastFolderId != -1 ) {
836
+ [[NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated"
837
+ object: @(lastFolderId)];
838
+ }
842
839
}
843
840
844
841
/* markAllReadUndo
@@ -874,7 +871,6 @@ -(void)markAllReadByArray:(NSArray *)folderArray withUndo:(BOOL)undoFlag withRef
874
871
if (refreshFlag) {
875
872
[mainArticleView refreshFolder: MA_Refresh_RedrawList];
876
873
}
877
- [APPCONTROLLER showUnreadCountOnApplicationIconAndWindowTitle ];
878
874
}
879
875
880
876
/* wrappedMarkAllReadInArray
@@ -897,10 +893,9 @@ -(NSArray *)wrappedMarkAllReadInArray:(NSArray *)folderArray withUndo:(BOOL)undo
897
893
if (undoFlag) {
898
894
[refArray addObjectsFromArray: [folder arrayOfUnreadArticlesRefs ]];
899
895
}
900
- if ([[Database sharedManager ] markFolderRead: folderId])
901
- {
902
- [foldersTree updateFolder: folderId recurseToParents: YES ];
903
-
896
+ if ([[Database sharedManager ] markFolderRead: folderId]) {
897
+ [[NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated"
898
+ object: @(folderId)];
904
899
}
905
900
}
906
901
else if (IsGoogleReaderFolder (folder))
@@ -952,9 +947,9 @@ -(void)markAllReadByReferencesArray:(NSArray *)refArray readFlag:(BOOL)readFlag
952
947
}
953
948
} else {
954
949
[dbManager markArticleRead: folderId guid: theGuid isRead: readFlag];
955
- if (folderId != lastFolderId && lastFolderId != -1 )
956
- {
957
- [foldersTree updateFolder: lastFolderId recurseToParents: YES ];
950
+ if (folderId != lastFolderId && lastFolderId != -1 ) {
951
+ [[ NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated "
952
+ object: @( lastFolderId) ];
958
953
}
959
954
lastFolderId = folderId;
960
955
}
@@ -964,9 +959,9 @@ -(void)markAllReadByReferencesArray:(NSArray *)refArray readFlag:(BOOL)readFlag
964
959
}
965
960
}
966
961
967
- if (lastFolderId != -1 )
968
- {
969
- [foldersTree updateFolder: lastFolderId recurseToParents: YES ];
962
+ if (lastFolderId != -1 ) {
963
+ [[ NSNotificationCenter defaultCenter ] postNotificationName: @" MA_Notify_FoldersUpdated "
964
+ object: @( lastFolderId) ];
970
965
}
971
966
if (lastFolderId != -1 && !IsRSSFolder ([dbManager folderFromID: currentFolderId])
972
967
&& !IsGoogleReaderFolder ([dbManager folderFromID: currentFolderId])) {
@@ -975,10 +970,6 @@ -(void)markAllReadByReferencesArray:(NSArray *)refArray readFlag:(BOOL)readFlag
975
970
else if (needRefilter) {
976
971
[mainArticleView refreshFolder: MA_Refresh_ReapplyFilter];
977
972
}
978
-
979
- // The info bar has a count of unread articles so we need to
980
- // update that.
981
- [APPCONTROLLER showUnreadCountOnApplicationIconAndWindowTitle ];
982
973
}
983
974
984
975
/* addBacktrack
@@ -1072,7 +1063,9 @@ -(void)handleArticleListContentChange:(NSNotification *)note
1072
1063
{
1073
1064
NSInteger folderId = ((NSNumber *)note.object ).integerValue ;
1074
1065
Folder * currentFolder = [[Database sharedManager ] folderFromID: currentFolderId];
1075
- if ( (folderId == currentFolderId) || (!IsRSSFolder (currentFolder) && !IsGoogleReaderFolder (currentFolder)) )
1066
+ if ( (folderId == currentFolderId)
1067
+ // for group or smart folder, to avoid flickering, we only update when refresh process is finished
1068
+ || (!IsRSSFolder (currentFolder) && !IsGoogleReaderFolder (currentFolder) && !APPCONTROLLER.isConnecting ) )
1076
1069
{
1077
1070
// Note the article that the user might currently be reading
1078
1071
// to be preserved when reloading the array of articles.
0 commit comments