Fixed in ProcessController the same icon issue than in Debugger's running teams window.

Also get right of the ugly raster default app icon that was still used and visible in
memory & teams/threads submenus.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42660 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2011-08-21 13:34:50 +00:00
parent dd537d13a8
commit d90bbcc813
2 changed files with 22 additions and 13 deletions

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src apps processcontroller ;
UsePrivateSystemHeaders ;
UsePrivateHeaders shared ;
UsePrivateHeaders app shared ;
Application ProcessController :
AutoIcon.cpp

View File

@ -23,6 +23,9 @@
#include "ProcessController.h"
#include "icons.h"
#ifdef __HAIKU__
#include <AppMisc.h>
#endif
#include <Alert.h>
#include <Bitmap.h>
#include <Deskbar.h>
@ -53,9 +56,9 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
app_info info;
status_t status = be_roster->GetRunningAppInfo(infoPack.team_info.team, &info);
if (status == B_OK || infoPack.team_info.team == B_SYSTEM_TEAM) {
if (status != B_OK) {
if (infoPack.team_info.team == B_SYSTEM_TEAM) {
// Get icon and name from kernel
// Get icon and name from kernel image
system_info systemInfo;
get_system_info(&systemInfo);
@ -63,15 +66,21 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
kernelPath.Append(systemInfo.kernel_name);
get_ref_for_path(kernelPath.Path(), &info.ref);
nameFromArgs = true;
}
} else {
BEntry entry(infoPack.team_info.args, true);
status = entry.GetRef(&info.ref);
if (status != B_OK
|| strncmp(infoPack.team_info.args, systemPath.Path(),
strlen(systemPath.Path())) != 0)
} else {
#ifdef __HAIKU__
status = BPrivate::get_app_ref(infoPack.team_info.team, &info.ref);
nameFromArgs = true;
tryTrackerIcon = (status == B_OK);
#else
BEntry entry(infoPack.team_info.args, true);
status = entry.GetRef(&info.ref);
if (status != B_OK
|| strncmp(infoPack.team_info.args, systemPath.Path(),
strlen(systemPath.Path())) != 0)
nameFromArgs = true;
#endif
tryTrackerIcon = (status == B_OK);
}
}
strncpy(infoPack.team_name, nameFromArgs ? infoPack.team_info.args : info.ref.name,
@ -86,8 +95,8 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
if (!tryTrackerIcon
|| BNodeInfo::GetTrackerIcon(&info.ref, infoPack.team_icon,
B_MINI_ICON) != B_OK) {
// TODO: don't hardcode the "app" icon!
infoPack.team_icon->SetBits(k_app_mini, 256, 0, B_CMAP8);
BMimeType genericAppType(B_APP_MIME_TYPE);
status = genericAppType.GetIcon(infoPack.team_icon, B_MINI_ICON);
}
} else
infoPack.team_icon = NULL;