[haiku-commits] Re: haiku: hrev44673 - src/kits/tracker

  • From: kallisti5 <kallisti5@xxxxxxxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Wed, 03 Oct 2012 07:05:32 -0500

On 2012-10-02 3:59 pm, JÃrÃme Duval wrote:
2012/10/2  <kallisti5@xxxxxxxxxxx>:
hrev44673 adds 1 changeset to branch 'master'
old head: 9af3b8357592d97fbe2b01f6f0cbee8d4eade538
new head: ff09527e4f6f674c4df23e39b365b84e87bfac43


----------------------------------------------------------------------------

ff09527: Tracker: Introduce "Restart Deskbar" option (+alpha3)
+       BMenuItem* item;
+
+       BRoster roster;
+       if (!roster.IsRunning(kDeskbarSignature)) {
+               item = new BMenuItem(B_TRANSLATE("Restart Deskbar"),
+                       new BMessage(kRestartDeskbar));
+               menu->AddItem(item);
+               menu->AddSeparatorItem();
+       }
+

IMO the variable declaration should happen where it is used first.

Except variable scope says I can't do it in the if statement as 'item' is also used later in the code :)

 -- Alex

Other related posts: