[haiku-commits] haiku: hrev49439 - in src: apps/processcontroller preferences/filetypes

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 23 Jul 2015 17:51:21 +0200 (CEST)

hrev49439 adds 4 changesets to branch 'master'
old head: 34671d601a9a471323f61c2ee40bd779dad5f139
new head: aa6f1cbe86782d8ea6616f2d3b2c9ce10483c2e7
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=aa6f1cbe8678+%5E34671d601a9a

----------------------------------------------------------------------------

0267bc5f2243: FileTypes: We don't plan on building for BeOS, so get rid of the
ifdef.

f3dd3a96c837: FileTypes: ApplicationTypesWindow: Fix UI updates when the file
doesn't exist.

If the filetype existed but the entry_ref did not, then the path from
the previously shown application would be used. This fixes that.

2090ed133e77: Tracker: IconMenuItem: Don't "use namespace" in a shared header.

aa6f1cbe8678: ProcessController: Remove hacks from BeOS days.

[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

7 files changed, 58 insertions(+), 161 deletions(-)
headers/private/tracker/IconMenuItem.h | 4 +-
src/apps/processcontroller/AutoIcon.cpp | 29 ++++-----
src/apps/processcontroller/IconMenuItem.cpp | 43 ++++----------
src/apps/processcontroller/IconMenuItem.h | 26 ++++----
src/apps/processcontroller/ProcessController.cpp | 62 --------------------
src/apps/processcontroller/Utilities.cpp | 42 ++++---------
.../filetypes/ApplicationTypesWindow.cpp | 13 ++--

############################################################################

Commit: 0267bc5f2243f0b9e2fb2cfe1daa2c8ba9a1020d
URL: http://cgit.haiku-os.org/haiku/commit/?id=0267bc5f2243
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Thu Jul 23 14:52:57 2015 UTC

FileTypes: We don't plan on building for BeOS, so get rid of the ifdef.

----------------------------------------------------------------------------

diff --git a/src/preferences/filetypes/ApplicationTypesWindow.cpp
b/src/preferences/filetypes/ApplicationTypesWindow.cpp
index 936dd90..424bfd7 100644
--- a/src/preferences/filetypes/ApplicationTypesWindow.cpp
+++ b/src/preferences/filetypes/ApplicationTypesWindow.cpp
@@ -70,15 +70,6 @@ const uint32 kMsgEdit = 'edit';
const char*
variety_to_text(uint32 variety)
{
-#if defined(HAIKU_TARGET_PLATFORM_BEOS) || defined(HAIKU_TARGET_PLATFORM_BONE)
-# define B_DEVELOPMENT_VERSION 0
-# define B_ALPHA_VERSION 1
-# define B_BETA_VERSION 2
-# define B_GAMMA_VERSION 3
-# define B_GOLDEN_MASTER_VERSION 4
-# define B_FINAL_VERSION 5
-#endif
-
switch (variety) {
case B_DEVELOPMENT_VERSION:
return B_TRANSLATE("Development");

############################################################################

Commit: f3dd3a96c8376a066ccb6c86478db20aaa8c03cc
URL: http://cgit.haiku-os.org/haiku/commit/?id=f3dd3a96c837
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Thu Jul 23 15:03:40 2015 UTC

FileTypes: ApplicationTypesWindow: Fix UI updates when the file doesn't exist.

If the filetype existed but the entry_ref did not, then the path from
the previously shown application would be used. This fixes that.

----------------------------------------------------------------------------

diff --git a/src/preferences/filetypes/ApplicationTypesWindow.cpp
b/src/preferences/filetypes/ApplicationTypesWindow.cpp
index 424bfd7..f191ed6 100644
--- a/src/preferences/filetypes/ApplicationTypesWindow.cpp
+++ b/src/preferences/filetypes/ApplicationTypesWindow.cpp
@@ -413,6 +413,10 @@ ApplicationTypesWindow::_SetType(BMimeType* type, int32
forceUpdate)
fTrackerButton->SetMessage(NULL);
appFound = false;
}
+ } else if ((forceUpdate & B_APP_HINT_CHANGED) != 0) {
+ fLaunchButton->SetMessage(NULL);
+ fPathView->SetText(NULL);
+ fTrackerButton->SetMessage(NULL);
}

if (forceUpdate == B_EVERYTHING_CHANGED) {

############################################################################

Commit: 2090ed133e77bfb400880189aa0f0b29e95173a7
URL: http://cgit.haiku-os.org/haiku/commit/?id=2090ed133e77
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Thu Jul 23 15:22:43 2015 UTC

Tracker: IconMenuItem: Don't "use namespace" in a shared header.

----------------------------------------------------------------------------

diff --git a/headers/private/tracker/IconMenuItem.h
b/headers/private/tracker/IconMenuItem.h
index 98ab41d..3ac0b3e 100644
--- a/headers/private/tracker/IconMenuItem.h
+++ b/headers/private/tracker/IconMenuItem.h
@@ -122,6 +122,8 @@ class SpecialModelMenuItem : public ModelMenuItem {

} // namespace BPrivate

-using namespace BPrivate;
+using BPrivate::IconMenuItem;
+using BPrivate::ModelMenuItem;
+using BPrivate::SpecialModelMenuItem;

#endif // ICON_MENU_ITEM_H

############################################################################

Revision: hrev49439
Commit: aa6f1cbe86782d8ea6616f2d3b2c9ce10483c2e7
URL: http://cgit.haiku-os.org/haiku/commit/?id=aa6f1cbe8678
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Thu Jul 23 15:40:31 2015 UTC

ProcessController: Remove hacks from BeOS days.

----------------------------------------------------------------------------

diff --git a/src/apps/processcontroller/AutoIcon.cpp
b/src/apps/processcontroller/AutoIcon.cpp
index f5ef281..6b9d247 100644
--- a/src/apps/processcontroller/AutoIcon.cpp
+++ b/src/apps/processcontroller/AutoIcon.cpp
@@ -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);
diff --git a/src/apps/processcontroller/IconMenuItem.cpp
b/src/apps/processcontroller/IconMenuItem.cpp
index 53abd59..06835bf 100644
--- a/src/apps/processcontroller/IconMenuItem.cpp
+++ b/src/apps/processcontroller/IconMenuItem.cpp
@@ -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;
-}
diff --git a/src/apps/processcontroller/IconMenuItem.h
b/src/apps/processcontroller/IconMenuItem.h
index 175c5f3..afcc1e1 100644
--- a/src/apps/processcontroller/IconMenuItem.h
+++ b/src/apps/processcontroller/IconMenuItem.h
@@ -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_
diff --git a/src/apps/processcontroller/ProcessController.cpp
b/src/apps/processcontroller/ProcessController.cpp
index bfe9a0e..22ecdad 100644
--- a/src/apps/processcontroller/ProcessController.cpp
+++ b/src/apps/processcontroller/ProcessController.cpp
@@ -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;
}
diff --git a/src/apps/processcontroller/Utilities.cpp
b/src/apps/processcontroller/Utilities.cpp
index cb7e64b..144b306 100644
--- a/src/apps/processcontroller/Utilities.cpp
+++ b/src/apps/processcontroller/Utilities.cpp
@@ -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) {


Other related posts:

  • » [haiku-commits] haiku: hrev49439 - in src: apps/processcontroller preferences/filetypes - waddlesplash