ProcessController: Remove hacks from BeOS days.
This commit is contained in:
parent
2090ed133e
commit
aa6f1cbe86
@ -1,20 +1,20 @@
|
||||
/*
|
||||
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
|
||||
Copyright (C) 2004 beunited.org
|
||||
Copyright (C) 2004 beunited.org
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
@ -38,11 +38,8 @@ BBitmap*
|
||||
AutoIcon::Bitmap()
|
||||
{
|
||||
if (fBitmap == NULL) {
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
|
||||
#else
|
||||
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8);
|
||||
#endif
|
||||
|
||||
if (fSignature) {
|
||||
entry_ref ref;
|
||||
be_roster->FindApp (fSignature, &ref);
|
||||
|
@ -4,21 +4,21 @@
|
||||
|
||||
ProcessController
|
||||
(c) 2000, Georges-Edouard Berenger, All Rights Reserved.
|
||||
Copyright (C) 2004 beunited.org
|
||||
Copyright (C) 2004 beunited.org
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
#include <NodeInfo.h>
|
||||
#include <Bitmap.h>
|
||||
#include <Roster.h>
|
||||
#include <parsedate.h>
|
||||
|
||||
|
||||
IconMenuItem::IconMenuItem(BBitmap* icon, const char* title,
|
||||
@ -155,22 +154,6 @@ int IconMenuItem::MinHeight()
|
||||
{
|
||||
static int minheight = -1;
|
||||
if (minheight < 0)
|
||||
minheight = before_dano() ? 16 : 17;
|
||||
minheight = 17;
|
||||
return minheight;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
before_dano()
|
||||
{
|
||||
static int old_version = -1;
|
||||
if (old_version < 0) {
|
||||
system_info sys_info;
|
||||
get_system_info(&sys_info);
|
||||
time_t kernelTime = parsedate(sys_info.kernel_build_date, time(NULL));
|
||||
struct tm* date = gmtime(&kernelTime);
|
||||
old_version = (date->tm_year < 101 || (date->tm_year == 101 && date->tm_mon < 10));
|
||||
}
|
||||
|
||||
return old_version;
|
||||
}
|
||||
|
@ -4,21 +4,21 @@
|
||||
|
||||
ProcessController
|
||||
(c) 2000, Georges-Edouard Berenger, All Rights Reserved.
|
||||
Copyright (C) 2004 beunited.org
|
||||
Copyright (C) 2004 beunited.org
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
#ifndef _ICON_MENU_ITEM_H_
|
||||
@ -57,6 +57,4 @@ class IconMenuItem : public BMenuItem {
|
||||
bool fPurge;
|
||||
};
|
||||
|
||||
bool before_dano();
|
||||
|
||||
#endif // _ICON_MENU_ITEM_H_
|
||||
|
@ -921,69 +921,7 @@ status_t
|
||||
thread_debug_thread(void *arg)
|
||||
{
|
||||
Tdebug_thead_param* param = (Tdebug_thead_param*) arg;
|
||||
#ifdef __HAIKU__
|
||||
debug_thread(param->thread);
|
||||
#else // !__HAIKU__
|
||||
thread_info thinfo;
|
||||
get_thread_info(param->thread, &thinfo);
|
||||
char text[4096];
|
||||
sprintf(text, "db %d", int(param->thread));
|
||||
system(text);
|
||||
if (param->sem >= 0 && thinfo.state == B_THREAD_WAITING && param->sem
|
||||
== thinfo.sem) {
|
||||
snooze(1000000);
|
||||
get_thread_info(param->thread, &thinfo);
|
||||
if (thinfo.state == B_THREAD_WAITING
|
||||
&& param->sem == thinfo.sem
|
||||
&& param->totalTime == thinfo.user_time + thinfo.kernel_time) {
|
||||
// the thread has been waiting for this semaphore since the before
|
||||
// the alert, not doing anything... Let's push it out of there!
|
||||
sem_info sinfo;
|
||||
thread_info thinfo;
|
||||
info_pack infos;
|
||||
|
||||
if (get_sem_info(param->sem, &sinfo) == B_OK
|
||||
&& get_thread_info(param->thread, &thinfo) == B_OK
|
||||
&& get_team_info(thinfo.team, &infos.team_info) == B_OK) {
|
||||
sprintf (text, "This thread is waiting for the "
|
||||
"semaphore called \"%s\". As long as it waits for this "
|
||||
"semaphore, you won't be able to debug that thread.\n",
|
||||
sinfo.name);
|
||||
if (sinfo.team == thinfo.team)
|
||||
strcat(text, "This semaphore belongs to the "
|
||||
"thread's team.\n\nShould I release this semaphore?\n");
|
||||
else {
|
||||
get_team_name_and_icon(infos);
|
||||
char moreText[1024];
|
||||
sprintf(moreText, "\nWARNING! This semaphore "
|
||||
"belongs to the team \"%s\"!\n\nShould I release this "
|
||||
"semaphore anyway?\n",
|
||||
infos.team_name);
|
||||
strcat(text, moreText);
|
||||
}
|
||||
|
||||
BAlert* alert = new BAlert("", text, "Cancel", "Release",
|
||||
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||
alert->SetShortcut(0, B_ESCAPE);
|
||||
if (alert->Go()) {
|
||||
get_thread_info (param->thread, &thinfo);
|
||||
if (thinfo.state == B_THREAD_WAITING && param->sem
|
||||
== thinfo.sem
|
||||
&& param->totalTime == thinfo.user_time
|
||||
+ thinfo.kernel_time)
|
||||
release_sem(param->sem);
|
||||
else {
|
||||
alert = new BAlert("", "The semaphore wasn't released, "
|
||||
"because it wasn't necessary anymore!",
|
||||
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !__HAIKU__
|
||||
delete param;
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
/*
|
||||
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
|
||||
Copyright (C) 2004 beunited.org
|
||||
Copyright (C) 2004 beunited.org
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
@ -23,9 +23,7 @@
|
||||
#include "ProcessController.h"
|
||||
#include "icons.h"
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <AppMisc.h>
|
||||
#endif
|
||||
#include <AppMisc.h>
|
||||
#include <Alert.h>
|
||||
#include <Bitmap.h>
|
||||
#include <Deskbar.h>
|
||||
@ -67,18 +65,8 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -87,11 +75,7 @@ get_team_name_and_icon(info_pack& infoPack, bool icon)
|
||||
B_PATH_NAME_LENGTH - 1);
|
||||
|
||||
if (icon) {
|
||||
#ifdef __HAIKU__
|
||||
infoPack.team_icon = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
|
||||
#else
|
||||
infoPack.team_icon = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8);
|
||||
#endif
|
||||
if (!tryTrackerIcon
|
||||
|| BNodeInfo::GetTrackerIcon(&info.ref, infoPack.team_icon,
|
||||
B_MINI_ICON) != B_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user