[haiku-commits] haiku: hrev49505 - in src: servers/services_daemon kits/interface kits/tracker

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 3 Aug 2015 17:40:45 +0200 (CEST)

hrev49505 adds 4 changesets to branch 'master'
old head: 52100b0c0e79c475267b510420f1f1da133005ca
new head: e9c7257afb1c888992580c9b8b386d7adcd368e8
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=e9c7257afb1c+%5E52100b0c0e79

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

eae0eccd2ec3: services_daemon: Delete from tree.

Superseded by launch_daemon.

c2e9a9227eca: Revert "BTwoDimensionalLayout: Removed duplicated code."

This reverts commit fd3e3e7bfb6e31cced1a98fc6a24c45f2feeba93.
Apparently this code wasn't duplicated, as it caused all sorts of
problems in applications (e.g. Debugger was blank).

Fixes #12269.

a4db376caae2: Tracker: Fix crash when the VirtualDirectoryWindow can't create
the PoseView.

Fixes #11859. We may want to show an error message rather than failing
silently, but at least that is better than crashing.

e9c7257afb1c: BAlert: Use half-item spacing for layouts. Restores the old
"compact" look.

Fixes #12273.

[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

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

10 files changed, 21 insertions(+), 342 deletions(-)
src/kits/interface/Alert.cpp | 6 +-
src/kits/interface/TwoDimensionalLayout.cpp | 9 +
src/kits/tracker/ContainerWindow.cpp | 2 +-
src/kits/tracker/Tracker.cpp | 6 +
src/kits/tracker/VirtualDirectoryWindow.cpp | 2 +
src/servers/Jamfile | 1 -
src/servers/services_daemon/Jamfile | 9 -
src/servers/services_daemon/ServicesDaemon.cpp | 232 --------------------
src/servers/services_daemon/ServicesDaemon.h | 27 ---
src/servers/services_daemon/ServicesDaemon.rdef | 69 ------

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

Commit: eae0eccd2ec3546db86f887197e6d14d50a5522d
URL: http://cgit.haiku-os.org/haiku/commit/?id=eae0eccd2ec3
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Aug 3 14:21:52 2015 UTC

services_daemon: Delete from tree.

Superseded by launch_daemon.

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

diff --git a/src/servers/Jamfile b/src/servers/Jamfile
index 6719cb1..5a89c6d 100644
--- a/src/servers/Jamfile
+++ b/src/servers/Jamfile
@@ -20,5 +20,4 @@ SubInclude HAIKU_TOP src servers power ;
SubInclude HAIKU_TOP src servers print ;
SubInclude HAIKU_TOP src servers print_addon ;
SubInclude HAIKU_TOP src servers registrar ;
-SubInclude HAIKU_TOP src servers services_daemon ;
SubInclude HAIKU_TOP src servers syslog_daemon ;
diff --git a/src/servers/services_daemon/Jamfile
b/src/servers/services_daemon/Jamfile
deleted file mode 100644
index 74151ae..0000000
--- a/src/servers/services_daemon/Jamfile
+++ /dev/null
@@ -1,9 +0,0 @@
-SubDir HAIKU_TOP src servers services_daemon ;
-
-SetSubDirSupportedPlatformsBeOSCompatible ;
-
-Application services_daemon :
- ServicesDaemon.cpp
- : be media [ TargetLibsupc++ ]
- : ServicesDaemon.rdef
- ;
diff --git a/src/servers/services_daemon/ServicesDaemon.cpp
b/src/servers/services_daemon/ServicesDaemon.cpp
deleted file mode 100644
index ea3ecfc..0000000
--- a/src/servers/services_daemon/ServicesDaemon.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 2005-2006, Haiku, Inc.
- * Distributed under the terms of the MIT license.
- *
- * Author:
- * DarkWyrm <darkwyrm@xxxxxxxxxxxxx>
- */
-#include "ServicesDaemon.h"
-#include <String.h>
-#include <Alert.h>
-#include <OS.h>
-#include <MediaDefs.h>
-#include <be_apps/ServicesDaemon/ServicesDaemon.h>
-
-enum {
- M_RELAUNCH_DESKBAR = 'rtsk',
- M_RELAUNCH_TRACKER,
- M_RELAUNCH_MAIL,
- M_RELAUNCH_PRINT,
- M_RELAUNCH_AUDIO,
- M_RELAUNCH_MEDIA_ADDONS,
- M_RELAUNCH_MEDIA,
- M_RELAUNCH_MIDI
-};
-
-// Time delay in microseconds - 1 second
-const bigtime_t kRelaunchDelay = 1000000;
-
-const char *gSignatures[] = {
- "application/x-vnd.Be-TSKB",
- "application/x-vnd.Be-TRAK",
- "application/x-vnd.Be-POST",
- "application/x-vnd.Be-PSRV",
- "application/x-vnd.Be-AUSV",
- "application/x-vnd.Be.addon-host",
- "application/x-vnd.Be.media-server",
- "application/x-vnd.be-midi-roster",
- NULL
-};
-
-static sem_id sRelaunchSem;
-static sem_id sQuitSem;
-
-
-
-App::App(void)
- : BApplication("application/x-vnd.Haiku-ServicesDaemon"),
- fStatus(B_NO_INIT)
-{
- sRelaunchSem = create_sem(1,"relaunch_sem");
- sQuitSem = create_sem(1,"quit_sem");
-
- // We will release this when we want the relauncher thread to quit
- acquire_sem(sQuitSem);
-
- // We will release this semaphore when we want to activate the
relauncher
- // thread
- acquire_sem(sRelaunchSem);
-
- fRelauncherID = spawn_thread(App::RelauncherThread, "relauncher_thread",
-
B_NORMAL_PRIORITY,this);
- resume_thread(fRelauncherID);
-
- fStatus = be_roster->StartWatching(be_app_messenger, B_REQUEST_QUIT);
- if (fStatus != B_OK)
- PostMessage(B_QUIT_REQUESTED);
-}
-
-
-App::~App(void)
-{
- // Release in this order so that there isn't a race condition when
quitting.
- // The thread waits
- release_sem(sQuitSem);
- release_sem(sRelaunchSem);
-
- int32 dummyval;
- wait_for_thread(fRelauncherID, &dummyval);
-
- for (int32 i = 0; i < fSignatureList.CountItems(); i++) {
- BString *item = (BString*) fSignatureList.ItemAt(i);
- delete item;
- }
-}
-
-
-bool
-App::QuitRequested(void)
-{
- if (fStatus == B_OK)
- be_roster->StopWatching(be_app_messenger);
-
- return true;
-}
-
-
-void
-App::MessageReceived(BMessage *msg)
-{
- switch (msg->what) {
- case B_SOME_APP_QUIT: {
- BString string;
- if (msg->FindString("be:signature",&string) != B_OK)
- return;
-
- // See if the signature belongs to an app that has
requested
- // a restart
- for (int32 i = 0; i < fSignatureList.CountItems(); i++)
{
- BString *item = (BString*)
fSignatureList.ItemAt(i);
- if (string.Compare(*item) == 0) {
- fSignatureList.RemoveItem(item);
- delete item;
-
- be_roster->Launch(string.String());
- return;
- }
- }
-
- int i = 0;
- while (gSignatures[i]) {
- // Checking to see if it's one of the supported
signatures
- // and if it is, add a relaunch message to the
queue which is
- // to be posted here at the
- if (string.Compare(gSignatures[i]) == 0) {
- BMessage *launchmsg = new
BMessage(M_RELAUNCH_DESKBAR + i);
- fRelaunchQueue.AddMessage(launchmsg);
-
- release_sem(sRelaunchSem);
- acquire_sem(sRelaunchSem);
- }
- i++;
- }
- break;
- }
- case B_SERVICES_DAEMON_RESTART: {
- BString signature;
- if (msg->FindString("signature",&signature) == B_OK)
- fSignatureList.AddItem(new BString(signature));
- break;
- }
- case M_RELAUNCH_DESKBAR: {
- be_roster->Launch(gSignatures[msg->what -
M_RELAUNCH_DESKBAR]);
- break;
- }
- case M_RELAUNCH_TRACKER: {
- be_roster->Launch(gSignatures[msg->what -
M_RELAUNCH_DESKBAR]);
- break;
- }
- case M_RELAUNCH_MAIL: {
- be_roster->Launch(gSignatures[msg->what -
M_RELAUNCH_DESKBAR]);
- break;
- }
- case M_RELAUNCH_PRINT: {
- be_roster->Launch(gSignatures[msg->what -
M_RELAUNCH_DESKBAR]);
- break;
- }
- case M_RELAUNCH_AUDIO: {
- be_roster->Launch(gSignatures[msg->what -
M_RELAUNCH_DESKBAR]);
- break;
- }
- case M_RELAUNCH_MEDIA_ADDONS:
- case M_RELAUNCH_MEDIA: {
- shutdown_media_server();
- launch_media_server();
- break;
- }
- case M_RELAUNCH_MIDI: {
- be_roster->Launch(gSignatures[msg->what -
M_RELAUNCH_DESKBAR]);
- break;
- }
-
- default:
- BApplication::MessageReceived(msg);
- }
-}
-
-
-int32
-App::RelauncherThread(void *data)
-{
- App *app = (App*) data;
-
- sem_info quitSemInfo;
- get_sem_info(sQuitSem, &quitSemInfo);
-
- while (quitSemInfo.count > -1) {
- // wait until we need to check for a relaunch
- acquire_sem(sRelaunchSem);
-
- // We can afford to do this because while we have the
semaphore, the
- // app itself is locked.
- BMessage *msg = app->fRelaunchQueue.NextMessage();
-
- release_sem(sRelaunchSem);
-
- get_sem_info(sQuitSem, &quitSemInfo);
- if (quitSemInfo.count > 0) {
- if (msg)
- delete msg;
- break;
- }
-
- if (msg) {
- // Attempt to work around R5 shutdown procedures by
checking for
- // debug_server running state. If it's shut down, then
chances
- // are that the system is shutting down or has already
done so.
- // We use the debug server in particular because it's
one of
- // the few services that is available in safe mode
which is
- // closed on system shutdown.
-
- if (be_roster->IsRunning("application/x-vnd.Be-DBSV")) {
- snooze(kRelaunchDelay);
- app->PostMessage(msg->what);
- delete msg;
- }
- }
-
- get_sem_info(sQuitSem, &quitSemInfo);
- }
-
- return 0;
-}
-
-
-int
-main(void)
-{
- App *app = new App();
- app->Run();
- delete app;
- return 0;
-}
diff --git a/src/servers/services_daemon/ServicesDaemon.h
b/src/servers/services_daemon/ServicesDaemon.h
deleted file mode 100644
index b5b64fd..0000000
--- a/src/servers/services_daemon/ServicesDaemon.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef SERVICES_DAEMON_H
-#define SERVICES_DAEMON_H
-
-#include <Application.h>
-#include <Roster.h>
-#include <MessageQueue.h>
-
-class App : public BApplication
-{
-public:
- App(void);
- ~App(void);
- bool QuitRequested(void);
- void MessageReceived(BMessage *msg);
-
-private:
- static int32 RelauncherThread(void *data);
-
- thread_id fRelauncherID;
- status_t fStatus;
- BMessageQueue fRelaunchQueue;
-
- BList fSignatureList;
-};
-
-
-#endif
diff --git a/src/servers/services_daemon/ServicesDaemon.rdef
b/src/servers/services_daemon/ServicesDaemon.rdef
deleted file mode 100644
index ae85f58..0000000
--- a/src/servers/services_daemon/ServicesDaemon.rdef
+++ /dev/null
@@ -1,69 +0,0 @@
-resource app_signature "application/x-vnd.Haiku-ServicesDaemon";
-
-resource app_version {
- major = 0,
- middle = 0,
- minor = 1,
-
- variety = B_APPV_ALPHA,
- internal = 0,
-
- short_info = "Services Daemon",
- long_info = "Services Daemon © 2006 Haiku"
-};
-
-resource app_flags B_EXCLUSIVE_LAUNCH | B_BACKGROUND_APP;
-
-resource(101, "BEOS:L:STD_ICON") #'ICON' array {
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFF"
- $"FFFFFFFFFF000000000000000000000000000000FFFF003FD9D9D90000FFFFFF"
- $"FFFFFFFF003F3F3F3F3F3F3F3F3F3F3F3F3F3F3F00003FD9D9D9D9D9D90000FF"
- $"FFFFFFFF003FD9D9D9D9D9D9D9D9D9D9D9D9D9D93F3FAAAAD9D9D9D9D9D98300"
- $"FFFFFFFF003FD98383838383838383D9D9D9D9D9D9838383AAAAD9D9D983AA00"
- $"FFFFFFFFFFFF00000000000000003FD9D9D9D9D9833F3FD93F3FAAAA83AAAA00"
- $"FFFF85FFFFFFFFFFFFFF04FFFF3FD9D98383833F3FD9D9D9D9D93F3FAAAAAA00"
- $"FFFFFF989898FFFFFFFF04FF3F98989898989883D9D9D9D93F3FD9D983AA0011"
- $"FFFFFF98989898989898989898989898AA9898989898D9D93F3FD9D9D9AA0017"
- $"FFFFFFFF989898AA9898989898989898AA98989898989898D9D9D9D9D9830011"
- $"FFFFFFFF98989898AAAAAAAAAA98989898AA989898989898D9D9D9D983AA0111"
- $"FFFFFFFFFFFF98989898989898AAAAAAAAAAAA98989898989898D983AA001111"
- $"FFFFFFFFFFFF009898989898AA989898989898AAAAAA9898989898AA001111FF"
- $"FFFFFFFFFF001ED9839898989898989898AAAA989898AAAA989898981111FFFF"
- $"FFFFFFFF003FD9838300040498989898AA98989898989898AAAA989811FFFFFF"
- $"FFFFFF003FD98383001ED9D904041A9898989898989898989898AA98FFFFFFFF"
- $"FFFF003FD98383031ED9D983830004041A0F04AAAA98989898989898FFFFFFFF"
- $"FF003FD98383003FD9D98383003FD9D90404AAAAAA83AA001111FF9898FFFFFF"
- $"003FD98383003FD9D98383003FD9D9838300AAAA83AA001111FFFFFF9898FFFF"
- $"00D98383003FD9D98383003FD9D98383003FD98383001111FFFFFFFFFFFFFFFF"
- $"FF0000003FD9D98383003FD9D98383003FD98383001111FFFFFFFFFFFFFFFFFF"
- $"FFFF003FD9D98383003FD9D98383003FD98383001111FFFFFFFFFFFFFFFFFFFF"
- $"FFFF00D9838306003FD9D98383003FD98383001111FFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFF0000001000D9D98383003FD98383001111FFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFF000000003FD98300001111FFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFF000000111111FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-};
-
-resource(101, "BEOS:M:STD_ICON") #'MICN' array {
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFF0000FFFFFF"
- $"FFFFFFFFFFFFFFFFFF0000D9D90000FF"
- $"FFFFFF000000000000D9D9AAAAD98300"
- $"FFFF00D9D9D9D9D9D983833F3FAAAA00"
- $"FF980000000000D9D9D9D9D9D9D9AA00"
- $"FFFF98989800D998989898D93FD9AA01"
- $"FFFFFF9898AA989898AA9898D9830011"
- $"FFFFFF009898AAAAAAAAAA98980011FF"
- $"FFFF00D983009898AA9898AA980011FF"
- $"FF00D98300D98398989898830098FFFF"
- $"00D98300D98300D904D9830011FF98FF"
- $"008300D98300D900D9830011FFFFFFFF"
- $"FF00D98300D900D9830011FFFFFFFFFF"
- $"FFFF0000000000000011FFFFFFFFFFFF"
- $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
-};

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

Commit: c2e9a9227ecadca3a4fdc7e7f7569fb9c7dc1391
URL: http://cgit.haiku-os.org/haiku/commit/?id=c2e9a9227eca
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Aug 3 14:56:40 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/12269

Revert "BTwoDimensionalLayout: Removed duplicated code."

This reverts commit fd3e3e7bfb6e31cced1a98fc6a24c45f2feeba93.
Apparently this code wasn't duplicated, as it caused all sorts of
problems in applications (e.g. Debugger was blank).

Fixes #12269.

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

diff --git a/src/kits/interface/TwoDimensionalLayout.cpp
b/src/kits/interface/TwoDimensionalLayout.cpp
index ffb93b0..a37f67a 100644
--- a/src/kits/interface/TwoDimensionalLayout.cpp
+++ b/src/kits/interface/TwoDimensionalLayout.cpp
@@ -21,6 +21,8 @@
#include "CollapsingLayouter.h"


+
+
// Some words of explanation:
//
// This class is the base class for BLayouts that organize their items
@@ -921,6 +923,13 @@
BTwoDimensionalLayout::VerticalCompoundLayouter::InternalGetHeightForWidth(
}

updateCachedInfo = true;
+
+ // get the height for width info
+ fCachedMinHeightForWidth = fHeightForWidthLayouter->MinSize();
+ fCachedMaxHeightForWidth = fHeightForWidthLayouter->MaxSize();
+ fCachedPreferredHeightForWidth
+ = fHeightForWidthLayouter->PreferredSize();
+
} else if (localLayouter->HasHeightForWidth()) {
// There is a height for width layouter and it has been
initialized
// in the current layout context. So we just add the height for
width

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

Commit: a4db376caae2083d6867ba4c2f5fb6fe423242da
URL: http://cgit.haiku-os.org/haiku/commit/?id=a4db376caae2
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Aug 3 15:32:15 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/11859

Tracker: Fix crash when the VirtualDirectoryWindow can't create the PoseView.

Fixes #11859. We may want to show an error message rather than failing
silently, but at least that is better than crashing.

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

diff --git a/src/kits/tracker/ContainerWindow.cpp
b/src/kits/tracker/ContainerWindow.cpp
index 808e957..4cb4308 100644
--- a/src/kits/tracker/ContainerWindow.cpp
+++ b/src/kits/tracker/ContainerWindow.cpp
@@ -1200,7 +1200,7 @@ BContainerWindow::SaveState(BMessage& message) const
bool
BContainerWindow::StateNeedsSaving() const
{
- return fStateNeedsSaving || PoseView()->StateNeedsSaving();
+ return fPoseView != NULL && (fStateNeedsSaving ||
fPoseView->StateNeedsSaving());
}


diff --git a/src/kits/tracker/Tracker.cpp b/src/kits/tracker/Tracker.cpp
index fd2e0f4..e5426ce 100644
--- a/src/kits/tracker/Tracker.cpp
+++ b/src/kits/tracker/Tracker.cpp
@@ -1113,6 +1113,12 @@ TTracker::OpenContainerWindow(Model* model, BMessage*
originalRefsList,

if (model != NULL && window->LockLooper()) {
window->CreatePoseView(model);
+ if (window->PoseView() == NULL) {
+ // Failed initialization.
+ window->PostMessage(B_QUIT_REQUESTED);
+ window->UnlockLooper();
+ return;
+ }
window->UnlockLooper();
}

diff --git a/src/kits/tracker/VirtualDirectoryWindow.cpp
b/src/kits/tracker/VirtualDirectoryWindow.cpp
index 985bcc3..40e361b 100644
--- a/src/kits/tracker/VirtualDirectoryWindow.cpp
+++ b/src/kits/tracker/VirtualDirectoryWindow.cpp
@@ -76,6 +76,8 @@ void
VirtualDirectoryWindow::CreatePoseView(Model* model)
{
fPoseView = NewPoseView(model, kListMode);
+ if (fPoseView == NULL)
+ return;

fBorderedView->GroupLayout()->AddView(fPoseView);
fBorderedView->EnableBorderHighlight(false);

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

Revision: hrev49505
Commit: e9c7257afb1c888992580c9b8b386d7adcd368e8
URL: http://cgit.haiku-os.org/haiku/commit/?id=e9c7257afb1c
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Aug 3 15:39:32 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/12273

BAlert: Use half-item spacing for layouts. Restores the old "compact" look.

Fixes #12273.

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

diff --git a/src/kits/interface/Alert.cpp b/src/kits/interface/Alert.cpp
index 8c373fd..4226927 100644
--- a/src/kits/interface/Alert.cpp
+++ b/src/kits/interface/Alert.cpp
@@ -501,7 +501,7 @@ BAlert::_Init(const char* text, const char* button0, const
char* button1,
fTextView->SetWordWrap(true);
fTextView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED,
B_SIZE_UNLIMITED));

- fButtonLayout = new BGroupLayout(B_HORIZONTAL);
+ fButtonLayout = new BGroupLayout(B_HORIZONTAL, B_USE_HALF_ITEM_SPACING);

SetType(type);
SetButtonWidth(buttonWidth);
@@ -510,8 +510,8 @@ BAlert::_Init(const char* text, const char* button0, const
char* button1,

BLayoutBuilder::Group<>(this, B_HORIZONTAL, 0)
.Add(fIconView)
- .AddGroup(B_VERTICAL)
- .SetInsets(B_USE_DEFAULT_SPACING)
+ .AddGroup(B_VERTICAL, B_USE_HALF_ITEM_SPACING)
+ .SetInsets(B_USE_HALF_ITEM_INSETS)
.Add(fTextView)
.AddGroup(B_HORIZONTAL, 0)
.AddGlue()


Other related posts: