[Users] [PATCH 1/4] summaryview: Minor fix

Olivier Brunel jjk at jjacky.com
Wed Jan 18 18:51:08 CET 2017


On Wed, 18 Jan 2017 13:50:43 +0100
wwp <subscript at free.fr> wrote:

> Hello Olivier,
> 
> 
> On Sun, 15 Jan 2017 19:14:18 +0100 Olivier Brunel <jjk at jjacky.com>
> wrote:
> 
> > Update current folder name only if the renamed folder is the
> > current one
> > 
> > Signed-off-by: Olivier Brunel <jjk at jjacky.com>
> > ---
> >  src/summaryview.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/summaryview.c b/src/summaryview.c
> > index ff511add1..9d88202a0 100644
> > --- a/src/summaryview.c
> > +++ b/src/summaryview.c
> > @@ -8082,7 +8082,8 @@ static gboolean
> > summary_update_folder_item_hook(gpointer source, gpointer data)
> > cm_return_val_if_fail(hookdata->item != NULL, FALSE);
> > cm_return_val_if_fail(summaryview != NULL, FALSE); 
> > -	if (hookdata->update_flags & F_ITEM_UPDATE_NAME) {
> > +	if (hookdata->item == summaryview->folder_item
> > +	        && hookdata->update_flags & F_ITEM_UPDATE_NAME) {
> >  		gchar *name = folder_item_get_name(hookdata->item);
> >  		gtk_label_set_text(GTK_LABEL(summaryview->statlabel_folder),
> > name); g_free(name);  
> 
> That sounds correct to me, but could you elaborate a bit about the
> possible problematic conditions, how did you end up w/ that patch?

Well, that label is meant to show the name of the currently opened
folder, but one can rename any folder. I did notice this looking at
the code, but you can reproduce it simply by renaming any folder other
than the current one, and see that the name of the currently open
folder in summaryview is updated to the new name of the renamed folder,
which is obviously wrong.


> Regards,
> 




More information about the Users mailing list