Patch: Show warning icon on collapsed group folder

An RSS/Atom newsreader with features comparable to commercial newsreaders.
MattJeffryes
Harmless
Posts: 1
Joined: Thu Feb 11, 2010 8:20 pm

Patch: Show warning icon on collapsed group folder

Postby MattJeffryes » Thu Feb 11, 2010 8:37 pm

From wishlist. Tried to post this to mailing list as instructions say, but it's read only. Also unable to attach diff to post. So here it is:

Code: Select all

Index: Folder.h
===================================================================
--- Folder.h   (revision 1509)
+++ Folder.h   (working copy)
@@ -103,6 +103,7 @@
 -(BOOL)hasCachedImage;
 -(NSImage *)standardImage;
 -(int)childUnreadCount;
+-(BOOL)childError;
 -(void)clearCache;
 -(BOOL)isGroupFolder;
 -(BOOL)isSmartFolder;
Index: Folder.m
===================================================================
--- Folder.m   (revision 1509)
+++ Folder.m   (working copy)
@@ -313,6 +313,22 @@
    return childUnreadCount;
 }
 
+/* childError
+ * Checks each child folder to see if they are errored.
+ * Stops if any have, and returns
+ */
+-(BOOL)childError
+{
+   BOOL hasErrored = NO;
+   Folder * nextChild = [[Database sharedDatabase] folderFromID:[self firstChildId]];
+   while ((nextChild != nil) && (!hasErrored))
+   {
+      hasErrored = IsError(nextChild);
+      nextChild = [[Database sharedDatabase] folderFromID:[nextChild nextSiblingId]];
+   }
+   return hasErrored;
+}
+
 /* attributes
  * Return the folder attributes.
  */
Index: FoldersTree.m
===================================================================
--- FoldersTree.m   (revision 1509)
+++ FoldersTree.m   (working copy)
@@ -890,7 +890,8 @@
          [realCell setAuxiliaryImage:nil];
          [realCell setInProgress:YES];
       }
-      else if (IsError(folder))
+      //Run either if the folder itself is errored, or if the folder is not expanded, and a child has errored
+      else if ((IsError(folder)) || ([folder childError] && ![olv isItemExpanded:item]))
       {
          [realCell setAuxiliaryImage:folderErrorImage];
          [realCell setInProgress:NO];

User avatar
Michael Ströck
Vienna Team
Posts: 303
Joined: Mon Mar 06, 2006 9:21 am
Location: Vienna, Austria
Contact:

Re: Patch: Show warning icon on collapsed group folder

Postby Michael Ströck » Mon Feb 15, 2010 9:33 pm

Hi Matt!

Thanks for your patch! I'll look into this ASAP!

User avatar
Michael Ströck
Vienna Team
Posts: 303
Joined: Mon Mar 06, 2006 9:21 am
Location: Vienna, Austria
Contact:

Re: Patch: Show warning icon on collapsed group folder

Postby Michael Ströck » Mon Feb 15, 2010 9:41 pm

MattJeffryes wrote:From wishlist. Tried to post this to mailing list as instructions say, but it's read only. Also unable to attach diff to post. So here it is:


This does not work for me at all, unfortunately. Could you please send me the patch to the email-address I've sent you via private message?

Thanks,
Michael


Return to “Vienna”

Who is online

Users browsing this forum: No registered users