[haiku-commits] r42660 - haiku/trunk/src/apps/processcontroller

  • From: philippe.houdoin@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 21 Aug 2011 15:34:51 +0200 (CEST)

Author: phoudoin
Date: 2011-08-21 15:34:50 +0200 (Sun, 21 Aug 2011)
New Revision: 42660
Changeset: https://dev.haiku-os.org/changeset/42660

Modified:
   haiku/trunk/src/apps/processcontroller/Jamfile
   haiku/trunk/src/apps/processcontroller/Utilities.cpp
Log:
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.


Modified: haiku/trunk/src/apps/processcontroller/Jamfile
===================================================================
--- haiku/trunk/src/apps/processcontroller/Jamfile      2011-08-21 13:00:21 UTC 
(rev 42659)
+++ haiku/trunk/src/apps/processcontroller/Jamfile      2011-08-21 13:34:50 UTC 
(rev 42660)
@@ -1,7 +1,7 @@
 SubDir HAIKU_TOP src apps processcontroller ;
 
 UsePrivateSystemHeaders ;
-UsePrivateHeaders shared ;
+UsePrivateHeaders app shared ;
 
 Application ProcessController :
        AutoIcon.cpp

Modified: haiku/trunk/src/apps/processcontroller/Utilities.cpp
===================================================================
--- haiku/trunk/src/apps/processcontroller/Utilities.cpp        2011-08-21 
13:00:21 UTC (rev 42659)
+++ haiku/trunk/src/apps/processcontroller/Utilities.cpp        2011-08-21 
13:34:50 UTC (rev 42660)
@@ -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 @@
 
        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 @@
                        kernelPath.Append(systemInfo.kernel_name);
                        get_ref_for_path(kernelPath.Path(), &info.ref);
                        nameFromArgs = true;
+               } else {
+#ifdef __HAIKU__
+                       status = BPrivate::get_app_ref(infoPack.team_info.team, 
&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)
+                               nameFromArgs = true;
+#endif
+                       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;
-               tryTrackerIcon = (status == B_OK);
        }
 
        strncpy(infoPack.team_name, nameFromArgs ? infoPack.team_info.args : 
info.ref.name,
@@ -86,8 +95,8 @@
                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;


Other related posts:

  • » [haiku-commits] r42660 - haiku/trunk/src/apps/processcontroller - philippe . houdoin