Re: a little suggestion for mailcheck-applet



Hi Jens. This is the proper fix and a heads up to anyone developing
applets not to use static global variables when more than one applet can
be added. 

Could you file a bug in bugzilla (mailcheck is now in the gnome-applets
catagory) and then we can look at integrating the patch?

Thanks,
Kevin

On Wed, 2003-04-02 at 04:56, Jens Zechlin wrote:
> Hi everybody,
> I need to run two instances of mailcheck-applet included in gnome-panel.
> The problem is that this doesn't work because a static variable to store
> oldsize of the mailbox is used in the code. 
> My suggestion is to move this variable to MailCheck-Structure. 
> 
> Here is the diff-output of the suggested changes:
> 155d154
> <         off_t oldsize;
> 434c433
> <       //static off_t oldsize = 0;
> ---
> >       static off_t oldsize = 0;
> 458c457
> <                       mc->oldsize = 0;
> ---
> >                       oldsize = 0;
> 468c467
> <               if (newsize != mc->oldsize && mc->unreadmail)
> ---
> >               if (newsize != oldsize && mc->unreadmail)
> 473c472
> <               mc->oldsize = newsize;
> ---
> >               oldsize = newsize;
> 484c483
> <               mc->newmail = newmail > mc->oldsize;
> ---
> >               mc->newmail = newmail > oldsize;
> 486c485
> <               mc->oldsize = newmail;
> ---
> >               oldsize = newmail;
> 
> With these changes it is possible to run several instances of the
> mailcheck-applet. 
> Perhaps you could include these changes in next release of gnome-panel.
> 
> regards 
>  Jens
> 
> (I'm not subscribed to the list, please cc any replies to this mail to
> my mailaddress)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]