Skip to content

Commit

Permalink
More explicit warning on empty feeds.
Browse files Browse the repository at this point in the history
Marks them as in error, with an explicit message in the Activity window.
  • Loading branch information
barijaona committed Aug 9, 2015
1 parent cd51a95 commit c63ddf2
Show file tree
Hide file tree
Showing 22 changed files with 73 additions and 9 deletions.
3 changes: 3 additions & 0 deletions lproj/cs.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
2 changes: 2 additions & 0 deletions lproj/da.lproj/Localizable.strings
Expand Up @@ -451,3 +451,5 @@
/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/de.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
5 changes: 4 additions & 1 deletion lproj/en.lproj/Localizable.strings
Expand Up @@ -449,4 +449,7 @@
"RSS Icon not found!" = "RSS Icon not found!";

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
5 changes: 4 additions & 1 deletion lproj/es.lproj/Localizable.strings
Expand Up @@ -450,4 +450,7 @@
"RSS Icon not found!" = "¡Icono de la suscripción no encontrado!";

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
5 changes: 4 additions & 1 deletion lproj/eus.lproj/Localizable.strings
Expand Up @@ -449,4 +449,7 @@
"RSS Icon not found!" = "RSS Icon not found!";

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
5 changes: 4 additions & 1 deletion lproj/fr.lproj/Localizable.strings
Expand Up @@ -449,4 +449,7 @@
"RSS Icon not found!" = "Icône RSS non trouvée !";

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Tentative de redirection traitée de façon temporaire par souci de prudence";
"Redirection attempt treated as temporary for safety concern" = "Tentative de redirection traitée de façon temporaire par souci de prudence";

/*Added in 3.0.7 */
"No articles in feed" = "Aucun article dans le flux";
4 changes: 2 additions & 2 deletions lproj/gl.lproj/Localizable.strings
Expand Up @@ -452,5 +452,5 @@
/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "A tentiva de redirección foi tratada como temporal por seguridade";

Status API Training Shop Blog About Help

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/it.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/ja.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/ko.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/nl.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/pt.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/pt_BR.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/ru.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/sv.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/tr.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/uk.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/zh_CN.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
3 changes: 3 additions & 0 deletions lproj/zh_TW.lproj/Localizable.strings
Expand Up @@ -450,3 +450,6 @@

/*Added in 3.0.5 */
"Redirection attempt treated as temporary for safety concern" = "Redirection attempt treated as temporary for safety concern";

/*Added in 3.0.7 */
"No articles in feed" = "No articles in feed";
9 changes: 9 additions & 0 deletions src/RefreshManager.m
Expand Up @@ -858,6 +858,15 @@ -(void)finalizeFolderRefresh:(NSDictionary*)parameters;
// Log number of bytes we received
[connectorItem appendDetail:[NSString stringWithFormat:NSLocalizedString(@"%ld bytes received", nil), [receivedData length]]];

if([[newFeed items] count] == 0)
{
// Mark the feed as empty
[self setFolderErrorFlag:folder flag:YES];
[connectorItem setStatus:NSLocalizedString(@"No articles in feed", nil)];
[newFeed release];
return;
}

// Extract the latest title and description
NSString * feedTitle = [newFeed title];
NSString * feedDescription = [newFeed description];
Expand Down
5 changes: 2 additions & 3 deletions src/RichXMLParser.m
Expand Up @@ -464,7 +464,7 @@ -(void)parseSequence:(NSXMLElement *)seqElement
*/
-(BOOL)initRSSFeedItems:(NSXMLElement *)startElement
{
BOOL success = NO;
BOOL success = YES;

// Allocate an items array
NSAssert(items == nil, @"initRSSFeedItems called more than once per initialisation");
Expand Down Expand Up @@ -596,11 +596,9 @@ -(BOOL)initRSSFeedItems:(NSXMLElement *)startElement
NSUInteger indexOfItem = (orderArray && itemIdentifier) ? [orderArray indexOfStringInArray:itemIdentifier] : NSNotFound;
if (indexOfItem == NSNotFound || indexOfItem >= [items count]) {
[items addObject:newFeedItem];
success = YES;
}
else {
[items insertObject:newFeedItem atIndex:indexOfItem];
success = YES;
}
}
}
Expand Down Expand Up @@ -635,6 +633,7 @@ -(BOOL)initAtomFeed:(NSXMLElement *)atomElement
if ([atomChildElement.name isEqualToString:@"title"])
{
[self setTitle:[[atomChildElement.stringValue stringByUnescapingExtendedCharacters] summaryTextFromHTML]];
success = YES;
continue;
}

Expand Down

0 comments on commit c63ddf2

Please sign in to comment.