From 542ee077064750901552bf0edcdb19ce8152e699 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 24 Jul 2012 19:23:39 -0400 Subject: [PATCH] Slight cleanup of previous commit. --- .../processcontroller/ProcessController.cpp | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp index 48f77976a2..168a4ef78b 100644 --- a/src/apps/processcontroller/ProcessController.cpp +++ b/src/apps/processcontroller/ProcessController.cpp @@ -772,30 +772,32 @@ thread_popup(void *arg) addtopbottom(new BSeparatorItem()); - int32 cookie = 0; - image_info info; - while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { - if (info.type == B_APP_IMAGE) { - // only show the Live in Deskbar item if a) we're running in - // deskbar itself, or b) we're running in PC's team. - if (strstr(info.name, "Deskbar") == NULL - && strstr(info.name, "ProcessController") == NULL) { - break; - } - - if (be_roster->IsRunning(kDeskbarSig)) { - item = new BMenuItem(B_TRANSLATE("Live in the Deskbar"), - new BMessage('AlDb')); - BDeskbar deskbar; - item->SetMarked(gInDeskbar - || deskbar.HasItem(kDeskbarItemName)); - item->SetTarget(gPCView); - addtopbottom(item); - addtopbottom(new BSeparatorItem ()); + bool showLiveInDeskbarItem = gInDeskbar; + if (!showLiveInDeskbarItem) { + int32 cookie = 0; + image_info info; + while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { + if (info.type == B_APP_IMAGE) { + // only show the Live in Deskbar item if a) we're running in + // deskbar itself, or b) we're running in PC's team. + if (strstr(info.name, "ProcessController") != NULL) { + showLiveInDeskbarItem = true; + break; + } } } } + if (showLiveInDeskbarItem && be_roster->IsRunning(kDeskbarSig)) { + item = new BMenuItem(B_TRANSLATE("Live in the Deskbar"), + new BMessage('AlDb')); + BDeskbar deskbar; + item->SetMarked(gInDeskbar || deskbar.HasItem(kDeskbarItemName)); + item->SetTarget(gPCView); + addtopbottom(item); + addtopbottom(new BSeparatorItem ()); + } + item = new IconMenuItem(gPCView->fProcessControllerIcon, B_TRANSLATE("About ProcessController"B_UTF8_ELLIPSIS),