Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle count of new Google Reader articles.

  • Loading branch information...
commit 39fcf3a992e4ebfc0a6279af809f3ed673a27056 1 parent 04823f3
Barijaona Ramaholimihaso barijaona authored
Showing with 15 additions and 1 deletion.
  1. +1 −1  AppController.m
  2. +2 −0  GoogleReader.h
  3. +12 −0 GoogleReader.m
2  AppController.m
View
@@ -2454,7 +2454,7 @@ -(void)handleRefreshStatusChange:(NSNotification *)nc
[articleController refreshCurrentFolder];
// Bounce the dock icon for 1 second if the bounce method has been selected.
- int newUnread = [[RefreshManager sharedManager] countOfNewArticles];
+ int newUnread = [[RefreshManager sharedManager] countOfNewArticles] + [[GoogleReader sharedManager] countOfNewArticles];
if (newUnread > 0 && [prefs newArticlesNotification] == MA_NewArticlesNotification_Bounce)
[NSApp requestUserAttention:NSInformationalRequest];
2  GoogleReader.h
View
@@ -24,6 +24,7 @@
NSString * readerUser;
NSTimer * tokenTimer;
NSTimer * actionTokenTimer;
+ NSUInteger countOfNewArticles;
}
@property (nonatomic, copy) NSArray * readingList;
@@ -55,5 +56,6 @@
-(ASIHTTPRequest*)refreshFeed:(Folder*)thisFolder withLog:(ActivityItem *)aItem shouldIgnoreArticleLimit:(BOOL)ignoreLimit;
-(NSString *)getGoogleOAuthToken;
-(NSString *)getGoogleActionToken;
+-(NSUInteger)countOfNewArticles;
@end
12 GoogleReader.m
View
@@ -77,11 +77,20 @@ - (id)init
jsonDecoder = [[JSONDecoder decoder] retain];
googleReaderStatus = notAuthenticated;
[self authenticate];
+ countOfNewArticles = 0;
}
return self;
}
+/* countOfNewArticles
+ */
+-(NSUInteger)countOfNewArticles
+{
+ NSUInteger count = countOfNewArticles;
+ countOfNewArticles = 0;
+ return count;
+}
// default handler for didFailSelector
- (void)requestFailed:(ASIHTTPRequest *)request
@@ -260,6 +269,9 @@ - (void)feedRequestDone:(ASIHTTPRequest *)request
[db setFolderLastUpdate:[refreshedFolder itemId] lastUpdate:[NSDate date]];
} //@synchronized
+ // Add to count of new articles so far
+ countOfNewArticles += newArticlesFromFeed;
+
AppController *controller = [NSApp delegate];
// Unread count may have changed
Please sign in to comment.
Something went wrong with that request. Please try again.