- shut up debug output

- fix decor fallback for dano


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27807 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-10-01 03:10:18 +00:00
parent 2e631be55d
commit 3f8cbad2d0
2 changed files with 14 additions and 10 deletions

View File

@ -608,7 +608,7 @@ status_t MSThemeImporter::ParseWinPath(BDirectory &rootDir, const char *from, BP
BDirectory dir;
while (p.Length()) {
BString component;
PRINT(("ParseWinPath: p.L %d p '%s'\n", p.Length(), p.String()));
//PRINT(("ParseWinPath: p.L %d p '%s'\n", p.Length(), p.String()));
int32 len = p.FindFirst('\\');
if (len < 0)
len = p.Length();
@ -617,8 +617,8 @@ status_t MSThemeImporter::ParseWinPath(BDirectory &rootDir, const char *from, BP
err = dir.SetTo(to.Path());
if (err < B_OK)
return err;
PRINT(("ParseWinPath: at '%s'\n", to.Path()));
PRINT(("ParseWinPath: testing '%s'\n", component.String()));
//PRINT(("ParseWinPath: at '%s'\n", to.Path()));
//PRINT(("ParseWinPath: testing '%s'\n", component.String()));
if (dir.Contains(component.String())) {
to.Append(component.String());
continue;
@ -626,25 +626,25 @@ status_t MSThemeImporter::ParseWinPath(BDirectory &rootDir, const char *from, BP
// can't find as is, try various capitalizations
// (caseless fs SUXOR)
component.Capitalize();
PRINT(("ParseWinPath: testing '%s'\n", component.String()));
//PRINT(("ParseWinPath: testing '%s'\n", component.String()));
if (dir.Contains(component.String())) {
to.Append(component.String());
continue;
}
component.CapitalizeEachWord();
PRINT(("ParseWinPath: testing '%s'\n", component.String()));
//PRINT(("ParseWinPath: testing '%s'\n", component.String()));
if (dir.Contains(component.String())) {
to.Append(component.String());
continue;
}
component.ToLower();
PRINT(("ParseWinPath: testing '%s'\n", component.String()));
//PRINT(("ParseWinPath: testing '%s'\n", component.String()));
if (dir.Contains(component.String())) {
to.Append(component.String());
continue;
}
component.ToUpper();
PRINT(("ParseWinPath: testing '%s'\n", component.String()));
//PRINT(("ParseWinPath: testing '%s'\n", component.String()));
if (dir.Contains(component.String())) {
to.Append(component.String());
continue;

View File

@ -7,6 +7,7 @@
#include <Alert.h>
#include <Application.h>
#include <Debug.h>
#include <Directory.h>
#include <Entry.h>
#include <InterfaceDefs.h>
@ -48,11 +49,13 @@
status_t set_window_decor_safe(const char *name, BMessage *globals)
{
// make sure the decor exists (set_window_decor() always returns B_OK)
//PRINT(("set_window_decor_safe(%s, %p)\n", name, globals));
BPath p("/etc/decors/");
p.Append(name);
BNode n(p.Path());
if (n.InitCheck() < B_OK || !n.IsFile())
return ENOENT;
//PRINT(("set_window_decor_safe: found\n"));
set_window_decor(name, globals);
return B_OK;
}
@ -135,8 +138,9 @@ status_t DecorThemesAddon::ApplyTheme(BMessage &theme, uint32 flags)
#ifdef B_BEOS_VERSION_DANO
bool decorDone = false;
int i;
// try each name until one works
for (int i = 0; window_decor.FindString("window:decor", i, &decorName) == B_OK; i++) {
for (i = 0; window_decor.FindString("window:decor", i, &decorName) == B_OK; i++) {
err = set_window_decor_safe(decorName.String(),
(window_decor.FindMessage("window:decor_globals", &globals) == B_OK)?&globals:NULL);
if (err < B_OK)
@ -145,9 +149,9 @@ status_t DecorThemesAddon::ApplyTheme(BMessage &theme, uint32 flags)
break;
}
// none match but we did have one, force the default with the globals
if (!decorDone && decorName.Length()) {
if (!decorDone && i > 0) {
decorDone = true;
set_window_decor_safe(decorName.String(),
set_window_decor("Default",
(window_decor.FindMessage("window:decor_globals", &globals) == B_OK)?&globals:NULL);
}
// none... maybe R5 number ?