mail_daemon: Replace own_image with the one from PowerStatus.
We probably should make this a common function... Fixes the mail status icon not appearing on x86_64, as __INTEL__ is not defined there.
This commit is contained in:
@@ -56,33 +56,21 @@
|
|||||||
const char* kTrackerSignature = "application/x-vnd.Be-TRAK";
|
const char* kTrackerSignature = "application/x-vnd.Be-TRAK";
|
||||||
|
|
||||||
|
|
||||||
//-----The following #defines get around a bug in get_image_info on ppc---
|
|
||||||
#if __INTEL__
|
|
||||||
#define text_part text
|
|
||||||
#define text_part_size text_size
|
|
||||||
#else
|
|
||||||
#define text_part data
|
|
||||||
#define text_part_size data_size
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" _EXPORT BView* instantiate_deskbar_item(float maxWidth,
|
extern "C" _EXPORT BView* instantiate_deskbar_item(float maxWidth,
|
||||||
float maxHeight);
|
float maxHeight);
|
||||||
|
|
||||||
|
|
||||||
status_t
|
static status_t
|
||||||
our_image(image_info* image)
|
our_image(image_info& image)
|
||||||
{
|
{
|
||||||
int32 cookie = 0;
|
int32 cookie = 0;
|
||||||
status_t ret;
|
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &image) == B_OK) {
|
||||||
while ((ret = get_next_image_info(0, &cookie, image)) == B_OK) {
|
if ((char *)our_image >= (char *)image.text
|
||||||
if ((char*)our_image >= (char*)image->text_part
|
&& (char *)our_image <= (char *)image.text + image.text_size)
|
||||||
&& (char*)our_image <= (char*)image->text_part
|
return B_OK;
|
||||||
+ image->text_part_size)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -338,7 +326,7 @@ DeskbarView::_InitBitmaps()
|
|||||||
fBitmaps[i] = NULL;
|
fBitmaps[i] = NULL;
|
||||||
|
|
||||||
image_info info;
|
image_info info;
|
||||||
if (our_image(&info) != B_OK)
|
if (our_image(info) != B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BFile file(info.name, B_READ_ONLY);
|
BFile file(info.name, B_READ_ONLY);
|
||||||
|
|||||||
Reference in New Issue
Block a user