[En-Nut-Discussion] Optimizing nutconf

"Jörg Hermann" jhermann at gmx.net
Wed Jan 14 14:21:05 CET 2009


Hi Thiago,
thanks for your feedback; I will include this a.s.a.p.
Another question: are you familiar with wxWidgets?
nutconf is now running with this fix, but I still have some
strange behavior in the left pane showing the feature tree:
- first I got two scroll bars (one additional at the border line
  between the two columns). I could remove this also by a 
  small fix (I can post the patch)
- still unresolved: scrolling does not work properly:
  The gridlines seem to be stucked at their position, i.e.
   they don't move with the the tree entries.
- The tree scrolls as expected, but when clicking in an entry,
   most of the area is greyed out and the selected item does
   not match the previously visible item.
   This state can only be left by completely collapsing the tree.
Do you have any ideas?


> On Tue, Jan 13, 2009 at 7:12 PM, Ole Reinhardt
> <ole.reinhardt at embedded-it.de> wrote:
> > Hi Jörg,
> >
> >> I will re-post the patch as attachment (maybe someone else also
> >> wants to give it a try...), but I unfortunately cannot do this berfore
> >> Thursday evening, since I'm travelling and I have the patch on my
> >> PC at home only.
> >
> > Harald forwarded me your mail directly again and there the mail body 
> was
> > intact, so I could extract your patch.
> >
> > For me too, this patch fixes the segmentation fault and nutconf works.
> > >From the C++ / WXwidgets side of view I don't have an opinion to your
> > patch since I'm no WX nor a C++ expert. If you and others don't have 
> any
> > objections I could checkin the patch to CVS.
> >
> 
> I would like to offer a few comments.
> 
> 
> diff -b -U3 -r1.18 nutconf.cpp
> --- tools/nutconf/nutconf.cpp    18 Sep 2008 09:53:22 -0000    1.18
> +++ tools/nutconf/nutconf.cpp    16 Dec 2008 11:26:15 -0000
> @@ -166,11 +166,20 @@
>       * Splash display.
>       */
>      wxBitmap bmp(wxBITMAP(SSB_NUTCONF));
> -    wxSplashScreen* splash = new wxSplashScreen(bmp,
> wxSPLASH_CENTRE_ON_SCREEN, 0, NULL, -1);
> -    for (int i = 0; i < 5; i++) {
> +    wxSplashScreen* splash = new wxSplashScreen(bmp,
> +          wxSPLASH_CENTRE_ON_SCREEN,
> +          0, NULL, -1, wxDefaultPosition, wxDefaultSize,
> +          wxSIMPLE_BORDER|wxSTAY_ON_TOP);
> +//     wxSplashScreen* splash = new wxSplashScreen(bmp,
> +//           wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
> +//           6000, NULL, -1, wxDefaultPosition, wxDefaultSize,
> +//           wxSIMPLE_BORDER|wxSTAY_ON_TOP);
> 
> 
> 
> Looks great, but I guess we should loose the commented out lines,
> that's what we have CVS for :)
> Removing the loop might get it to show for a bit less time, but that's
> quite aestetic.
> 
> [snip]
> +    if(splash) {
> +        splash->Destroy();
> +    }
> +
>      return true;
>  }
> 
> I know you just moved this block, but unless wxSplashScreen::Destroy()
> commits suicide ( delete this ), this will leak memory. If it's
> destructor calls Destroy, you can just delete it:
> 
> delete splash;
> 
>  No if checking is necessary, because in C++ it's safe to delete 0;
> 
> Kind Regards,
>     Thiago A. Correa
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
        
-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a


More information about the En-Nut-Discussion mailing list