--- src/preferences/appearance/APRView.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/preferences/appearance/APRView.cpp	2011-05-19 18:26:06.000000000 +0200
@@ -39,8 +39,8 @@
 #define DECORATOR_CHANGED 'dcch'
 
 
-APRView::APRView(const char *name, uint32 flags)
- :
+APRView::APRView(const char* name, uint32 flags)
+	:
  	BView(name, flags),
  	fDefaultSet(ColorSet::DefaultColorSet()),
  	fDecorMenu(NULL),
@@ -64,7 +64,7 @@
 		BMenuField* field = new BMenuField("Window Style", fDecorMenu);
 		// TODO: use this menu field.
 	}
-	BMenuItem *marked = fDecorMenu->ItemAt(fDecorUtil->IndexOfCurrentDecorator());
+	BMenuItem* marked = fDecorMenu->ItemAt(fDecorUtil->IndexOfCurrentDecorator());
 	if (marked)
 		marked->SetMarked(true);
 	else {
--- src/preferences/appearance/APRView.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/preferences/appearance/APRView.cpp	2011-05-19 18:26:06.000000000 +0200
@@ -39,8 +39,8 @@
 #define DECORATOR_CHANGED 'dcch'
 
 
-APRView::APRView(const char *name, uint32 flags)
- :
+APRView::APRView(const char* name, uint32 flags)
+	:
  	BView(name, flags),
  	fDefaultSet(ColorSet::DefaultColorSet()),
  	fDecorMenu(NULL),
@@ -64,7 +64,7 @@
 		BMenuField* field = new BMenuField("Window Style", fDecorMenu);
 		// TODO: use this menu field.
 	}
-	BMenuItem *marked = fDecorMenu->ItemAt(fDecorUtil->IndexOfCurrentDecorator());
+	BMenuItem* marked = fDecorMenu->ItemAt(fDecorUtil->IndexOfCurrentDecorator());
 	if (marked)
 		marked->SetMarked(true);
 	else {
--- src/add-ons/decorators/WinDecorator/resources.rdef_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/add-ons/decorators/WinDecorator/resources.rdef	2011-05-19 18:27:35.000000000 +0200
@@ -1,14 +1,10 @@
-
-resource("be:decor:info") message('deco')
-
-{
-	"name" 			= "Windows 95",
-	"authors"		= "",
-	"short_descr"	= "Windows 95",
+resource("be:decor:info") message('deco') {
+	"name"				= "Windows 95",
+	"authors"			= "",
+	"short_descr"		= "Windows 95",
 	"long_descr"		= "",
 	"lic_url"			= "",
-	"lic_name"		= "MIT",
+	"lic_name"			= "MIT",
 	"support_url"		= "http://www.haiku-os.org/",
-	float 	"version" = 1.0
+	float "version"		= 1.0
 };
-
--- src/add-ons/decorators/MacDecorator/resources.rdef_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/add-ons/decorators/MacDecorator/resources.rdef	2011-05-19 18:27:35.000000000 +0200
@@ -1,14 +1,10 @@
-
-resource("be:decor:info") message('deco')
-
-{
-	"name" 			= "MacOS 9",
+resource("be:decor:info") message('deco') {
+	"name"			= "MacOS 9",
 	"authors"		= "",
 	"short_descr"	= "MacOS 9",
-	"long_descr"		= "",
-	"lic_url"			= "",
+	"long_descr"	= "",
+	"lic_url"		= "",
 	"lic_name"		= "MIT",
-	"support_url"		= "http://www.haiku-os.org/",
-	float 	"version" = 1.0
+	"support_url"	= "http://www.haiku-os.org/",
+	float "version"	= 1.0
 };
-
--- src/add-ons/decorators/BeDecorator/resources.rdef_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/add-ons/decorators/BeDecorator/resources.rdef	2011-05-19 18:27:35.000000000 +0200
@@ -1,14 +1,10 @@
-
-resource("be:decor:info") message('deco')
-
-{
-	"name" 			= "Classic BeOS",
+resource("be:decor:info") message('deco') {
+	"name"			= "Classic BeOS",
 	"authors"		= "DarkWyrm, Stephan Aßmus, Clemens Zeidler",
 	"short_descr"	= "Basic appearance of the classic BeOS.",
-	"long_descr"		= "",
-	"lic_url"			= "",
+	"long_descr"	= "",
+	"lic_url"		= "",
 	"lic_name"		= "MIT",
-	"support_url"		= "http://www.haiku-os.org/",
-	float 	"version" = 1.0
+	"support_url"	= "http://www.haiku-os.org/",
+	float "version"	= 1.0
 };
-
--- src/add-ons/decorators/SATDecorator/resources.rdef_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/add-ons/decorators/SATDecorator/resources.rdef	2011-05-19 18:27:35.000000000 +0200
@@ -1,15 +1,11 @@
-
-resource("be:decor:info") message('deco')
-
-{
-	"name" 			= "Stack and Tile",
+resource("be:decor:info") message('deco') {
+	"name"			= "Stack and Tile",
 	"authors"		= "Clemens Zeidler, Ingo Weinhold",
 	"short_descr"	= "Default look with ability to stack & tile windows.",
-	"long_descr"		= "Group windows together and take advantage of those"
+	"long_descr"	= "Group windows together and take advantage of those"
 						" tabs!\n\nTODO: instructions",
-	"lic_url"			= "",
+	"lic_url"		= "",
 	"lic_name"		= "MIT",
-	"support_url"		= "http://www.haiku-os.org/",
-	float 	"version" = 1.0
+	"support_url"	= "http://www.haiku-os.org/",
+	float "version"	= 1.0
 };
-
--- src/bin/setdecor.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/bin/setdecor.cpp	2011-05-19 18:27:35.000000000 +0200
@@ -2,7 +2,6 @@
  * Copyright 2011, Joseph "looncraz" Groover, looncraz@satx.rr.com
  * Copyright 2007, François Revol, revol@free.fr.
  * Distributed under the terms of the MIT license.
- *
  */
 
 
@@ -18,48 +17,52 @@
 #include <private/interface/DecorInfo.h>
 
 
-void	print_decor_info_header()
+void
+print_decor_info_header()
 {
 	printf("    Name      License\t    Description\n");
 	printf("----------------------------------------------------\n");
 }
 
 
-void	print_decor_summary(DecorInfo* decor, bool is_current)
+void
+print_decor_summary(DecorInfo* decor, bool isCurrent)
 {
-	if ( is_current )
+	if (isCurrent)
 		printf("*");
 
-	printf("%-12s\t%-8s  %-30s\n", 	decor->Name().String(),
-							decor->LicenseName().String(),
-							decor->ShortDescription().String());
+	printf("%-12s\t%-8s  %-30s\n", decor->Name().String(),
+		decor->LicenseName().String(), decor->ShortDescription().String());
 }
 
 
-void	print_decor_shortcut(DecorInfo* decor, bool is_current)
+void
+print_decor_shortcut(DecorInfo* decor, bool isCurrent)
 {
-	if ( is_current )
+	if (isCurrent)
 		printf("*");
 
-	printf("%-12s\t%-12s\n", 	decor->ShortcutName().String(),
-							decor->Name().String());
+	printf("%-12s\t%-12s\n", decor->ShortcutName().String(),
+		decor->Name().String());
 }
 
 
-void	print_decor_info_verbose(DecorInfo* decor, bool is_current)
+void
+print_decor_info_verbose(DecorInfo* decor, bool isCurrent)
 {
 	printf("Name:\t\t%s\n", decor->Name().String());
 	printf("Version:\t%f\n", decor->Version());
 	printf("Author(s):\t%s\n", decor->Authors().String());
 	printf("Description:\t%s\n", decor->ShortDescription().String());
 	printf("License:\t%s (%s)\n", decor->LicenseName().String(),
-			decor->LicenseURL().String());
+		decor->LicenseURL().String());
 	printf("Support URL:\t%s\n", decor->SupportURL().String());
-	printf("%s\n", is_current ? "Currently in use." : "Currently not in use.");
+	printf("%s\n", isCurrent ? "Currently in use." : "Currently not in use.");
 }
 
 
-int main(int argc, char **argv)
+int
+main(int argc, char** argv)
 {
 	if (argc < 2) {
 		printf("usage: %s [-l|-c|decorname]\n", argv[0]);
@@ -71,7 +74,7 @@
 		return 1;
 	}
 
-		// combine remaining args into one string:
+	// combine remaining args into one string:
 	BString decoratorName;
 	for (int i = 2; i < argc; ++i)
 		decoratorName << argv[i] << " ";
@@ -83,23 +86,23 @@
 	DecorInfo* decor = NULL;
 
 	if (util == NULL) {
-		fprintf(stderr, "error instantiating DecoratorInfoUtility ( out of"
-				" memory? )\n");
+		fprintf(stderr, "error instantiating DecoratorInfoUtility (out of"
+			" memory?)\n");
 		return 1;
 	}
 
 	// we want the list
 	if (!strcmp(argv[1], "-l")) {
 		// Print default decorator:
-
 		print_decor_info_header();
 		int32 count = util->CountDecorators();
 		for (int32 i = 0; i < count; ++i) {
 			decor = util->DecoratorAt(i);
 			if (decor == NULL) {
 				fprintf(stderr, "error NULL entry @ %li / %li - BUG BUG BUG\n",
-						i, count);
-				return 2; // return 2 to track DecorInfoUtility errors
+					i, count);
+				// return 2 to track DecorInfoUtility errors
+				return 2;
 			}
 			print_decor_summary(decor, util->IsCurrentDecorator(decor));
 		}
@@ -113,7 +116,7 @@
 
 		if (decor == NULL) {
 			fprintf(stderr, "Unable to determine current decorator, sorry! - "
-					"BUG BUG BUG\n");
+				"BUG BUG BUG\n");
 			return 2;
 		}
 
@@ -133,14 +136,14 @@
 			decor = util->DecoratorAt(i);
 			if (decor == NULL) {
 				fprintf(stderr, "error NULL entry @ %li / %li - BUG BUG BUG\n",
-						i, count);
-				return 2; // return 2 to track DecorInfoUtility errors
+					i, count);
+				// return 2 to track DecorInfoUtility errors
+				return 2;
 			}
 			print_decor_shortcut(decor, util->IsCurrentDecorator(decor));
 		}
 
 		return 0;
-
 	}
 
 	// we want detailed information for a specific decorator ( by name or path )
@@ -153,10 +156,10 @@
 		decor = util->FindDecorator(decoratorName.String());
 
 		if (decor == NULL) {
-				fprintf(stderr, "Can't find decor named \"%s\", try again\n",
-						decoratorName.String());
-				return 1;
-			}
+			fprintf(stderr, "Can't find decor named \"%s\", try again\n",
+				decoratorName.String());
+			return 1;
+		}
 
 		print_decor_info_verbose(decor, util->IsCurrentDecorator(decor));
 		return 0;
@@ -169,41 +172,35 @@
 			return 1;
 		}
 
-
 		decor = util->FindDecorator(decoratorName.String());
 
 		if (decor == NULL) {
-				fprintf(stderr, "Can't find decor named \"%s\", try again\n",
-						decoratorName.String());
-				return 1;
-			}
+			fprintf(stderr, "Can't find decor named \"%s\", try again\n",
+				decoratorName.String());
+			return 1;
+		}
 
 		printf("Preparing preview...\n");
 
+		BWindow* previewWindow = new BWindow(BRect(150, 150, 390, 490),
+			decor->Name().String(), B_TITLED_WINDOW, B_NOT_ZOOMABLE
+				| B_QUIT_ON_WINDOW_CLOSE | B_NOT_RESIZABLE );
+
+		previewWindow->AddChild(new BView(previewWindow->Bounds(), "",
+			B_FOLLOW_ALL, 0));
+
+		if (util->Preview(decor, previewWindow) != B_OK) {
+			fprintf(stderr, "Unable to preview decorator, sorry!\n");
+			// TODO: more detailed error...
+			return 1;
+		}
 
-		BWindow* win = new BWindow(BRect(50,50,290,390),
-									decor->Name().String(),
-								 	B_TITLED_WINDOW,
-								 	B_NOT_ZOOMABLE
-								 		| B_QUIT_ON_WINDOW_CLOSE
-								 		| B_NOT_RESIZABLE );
-
-		win->MoveBy(100,100);
-		BView* v = new BView(win->Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW);
-		win->AddChild(v);
-
-		if (util->Preview(decor, win) != B_OK) {
-				fprintf(stderr, "Unable to preview decorator, sorry!\n");
-				return 1;	// todo more detailed error...
-			}
-
-		win->Show();
+		previewWindow->Show();
 
-		be_app->Run();
+		app.Run();
 		return 0;
 	}
 
-
 	// we want to change it
 	decoratorName = "";
 	for (int i = 1; i < argc; ++i)
@@ -219,7 +216,7 @@
 
 	if (util->IsCurrentDecorator(decor)) {
 		printf("\"%s\" is already the current decorator\n",
-				decor->Name().String());
+			decor->Name().String());
 		return 0;
 	}
 
--- src/servers/app/DecorManager.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/servers/app/DecorManager.cpp	2011-05-19 18:27:35.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001-2010, Haiku, Inc.
+ * Copyright (c) 2001-2011, Haiku, Inc.
  * Distributed under the terms of the MIT license.
  *
  * Author:
@@ -120,11 +120,12 @@
 }
 
 
-Decorator *
-DecorManager::AllocateDecorator(Window *window)
+Decorator*
+DecorManager::AllocateDecorator(Window* window)
 {
 	// Create a new instance of the current decorator.
 	// Ownership is that of the caller
+
 	if (!fCurrentDecor) {
 		// We should *never* be here. If we do, it's a bug.
 		debugger("DecorManager::AllocateDecorator has a NULL decorator");
@@ -132,19 +133,19 @@
 	}
 
 	// Are we previewing a specific decorator?
-	if ( window == fPreviewWindow ) {
+	if (window == fPreviewWindow) {
 		if (fPreviewDecor != NULL) {
 			return fPreviewDecor->AllocateDecorator(window->Desktop(),
-						window->GetDrawingEngine(), window->Frame(),
-						window->Title(), window->Look(), window->Flags());
+				window->GetDrawingEngine(), window->Frame(), window->Title(),
+				window->Look(), window->Flags());
 		} else {
 			fPreviewWindow = NULL;
 		}
 	}
 
 	return fCurrentDecor->AllocateDecorator(window->Desktop(),
-				window->GetDrawingEngine(), window->Frame(),
-				window->Title(), window->Look(), window->Flags());
+		window->GetDrawingEngine(), window->Frame(), window->Title(),
+		window->Look(), window->Flags());
 }
 
 
@@ -162,8 +163,9 @@
 
 
 void
-DecorManager::CleanupForWindow(Window *window)
-{	// given window is being deleted, do any cleanup needed
+DecorManager::CleanupForWindow(Window* window)
+{
+	// Given window is being deleted, do any cleanup needed
 	if (fPreviewWindow == window && window != NULL){
 		fPreviewWindow = NULL;
 
@@ -176,43 +178,43 @@
 
 
 status_t
-DecorManager::PreviewDecorator(BString path, Window *window)
+DecorManager::PreviewDecorator(BString path, Window* window)
 {
 	if (fPreviewWindow != NULL && fPreviewWindow != window){
-	// reset other window to current decorator - only one can preview
-		Window * old_preview_window = fPreviewWindow;
+		// Reset other window to current decorator - only one can preview
+		Window* oldPreviewWindow = fPreviewWindow;
 		fPreviewWindow = NULL;
-		old_preview_window->ReloadDecor();
+		oldPreviewWindow->ReloadDecor();
 	}
 
 	if (window == NULL)
 		return B_BAD_VALUE;
 
-	status_t error = B_OK;
 	// We have to jump some hoops because the window must be able to
 	// delete its decorator before we unload the add-on
-	DecorAddOn* decorPtr = _LoadDecor(path, error),
-			* oldDecor = fPreviewDecor;
-
+	status_t error = B_OK;
+	DecorAddOn* decorPtr = _LoadDecor(path, error);
 	if (decorPtr == NULL)
 		return error == B_OK ? B_ERROR : error;
 
-	BRegion border, newBorder;
+	BRegion border;
 	window->GetBorderRegion(&border);
 
-
+	DecorAddOn* oldDecor = fPreviewDecor;
 	fPreviewDecor = decorPtr;
 	fPreviewWindow = window;
-	fPreviewWindow->ReloadDecor(); // window deletes its decorator here
+	// After this call, the window has deleted its decorator.
+	fPreviewWindow->ReloadDecor();
 
+	BRegion newBorder;
 	window->GetBorderRegion(&newBorder);
+
 	border.Include(&newBorder);
 	window->Desktop()->RebuildAndRedrawAfterWindowChange(window, border);
 
 	if (oldDecor != NULL)
 		unload_add_on(oldDecor->ImageID());
 
-
 	return B_OK;
 }
 
@@ -235,13 +237,11 @@
 DecorManager::SetDecorator(BString path, Desktop* desktop)
 {
 	status_t error = B_OK;
+	DecorAddOn* newDecor = _LoadDecor(path, error);
+	if (newDecor == NULL)
+		return error == B_OK ? B_ERROR : error;
 
-	DecorAddOn *newDecor = _LoadDecor(path, error);
-
-	if (!newDecor)
-		return B_ERROR;
-
-	DecorAddOn *oldDecor = fCurrentDecor;
+	DecorAddOn* oldDecor = fCurrentDecor;
 	BString oldPath = fCurrentDecorPath;
 	image_id oldImage = fCurrentDecor->ImageID();
 
@@ -250,16 +250,17 @@
 
 	if (desktop->ReloadDecor()) {
 		// now safe to unload all old decorator data
-		unload_add_on(oldImage); // saves us from deleting oldDecor...
+		// saves us from deleting oldDecor...
+		unload_add_on(oldImage);
 		_SaveSettingsToDisk();
 		return B_OK;
 	}
+
 	// TODO: unloading the newDecor and its image
-	// problem is we don't know how many windows failed...
-		// or why they failed...
+	// problem is we don't know how many windows failed... or why they failed...
 	syslog(LOG_WARNING,
-			"app_server:DecorManager:SetDecorator:\"%s\" *partly* failed\n",
-			fCurrentDecorPath.String());
+		"app_server:DecorManager:SetDecorator:\"%s\" *partly* failed\n",
+		fCurrentDecorPath.String());
 
 	fCurrentDecor = oldDecor;
 	fCurrentDecorPath = oldPath;
@@ -267,53 +268,38 @@
 }
 
 
-
 DecorAddOn*
-DecorManager::_LoadDecor(BString _path, status_t &error )
+DecorManager::_LoadDecor(BString _path, status_t& error )
 {
 	if (_path == "Default") {
 		error = B_OK;
 		return &fDefaultDecor;
 	}
 
-	image_id image = -1;
-	DecorAddOn* newDecor = NULL;
-	entry_ref ref;
-
 	BEntry entry(_path.String(), true);
-
 	if (!entry.Exists()) {
-		entry.Unset();
 		error = B_ENTRY_NOT_FOUND;
 		return NULL;
 	}
 
 	BPath path(&entry);
-	entry.GetRef(&ref);
-	entry.Unset();
-
-	image = load_add_on(path.Path());
-
-	path.Unset();
-
+	image_id image = load_add_on(path.Path());
 	if (image < 0) {
 		error = B_BAD_IMAGE_ID;
 		return NULL;
 	}
 
 	create_decor_addon*	createFunc;
-
-	if (get_image_symbol(image,
-				"instantiate_decor_addon",
-				B_SYMBOL_TYPE_TEXT,
-			   	(void**)&createFunc) != B_OK) {
+	if (get_image_symbol(image, "instantiate_decor_addon", B_SYMBOL_TYPE_TEXT,
+			(void**)&createFunc) != B_OK) {
 		unload_add_on(image);
 		error = B_MISSING_SYMBOL;
 		return NULL;
 	}
 
-	newDecor = createFunc(image, ref.name);
-
+	char name[B_FILE_NAME_LENGTH];
+	entry.GetName(name);
+	DecorAddOn* newDecor = createFunc(image, name);
 	if (newDecor == NULL || newDecor->InitCheck() != B_OK) {
 		unload_add_on(image);
 		error = B_ERROR;
@@ -324,8 +310,6 @@
 }
 
 
-
-
 static const char* kSettingsDir = "system/app_server";
 static const char* kSettingsFile = "decorator_settings";
 
@@ -351,7 +335,7 @@
 		if (settings.FindString("decorator", &itemPath) == B_OK) {
 			status_t error = B_OK;
 			DecorAddOn* decor = _LoadDecor(itemPath, error);
-			if (decor) {
+			if (decor != NULL) {
 				fCurrentDecor = decor;
 				return true;
 			} else {
--- src/servers/app/ServerApp.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/servers/app/ServerApp.cpp	2011-05-19 18:27:35.000000000 +0200
@@ -648,7 +648,7 @@
 		case AS_SET_DECORATOR:
 		{
 			// Attached Data:
-			// entry_ref to decorator
+			// path to decorator add-on
 
 			BString path;
 			link.ReadString(path);
--- src/servers/app/Window.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/servers/app/Window.cpp	2011-05-19 18:27:35.000000000 +0200
@@ -1108,11 +1108,11 @@
 bool
 Window::SetDecoratorSettings(const BMessage& settings, BRegion& dirty)
 {
-	if (settings.what == 'prVu') { // 'prVu' == preview a decorator!
+	if (settings.what == 'prVu') {
+		// 'prVu' == preview a decorator!
 		BString path;
-		if (settings.FindString("preview", &path) == B_OK){
+		if (settings.FindString("preview", &path) == B_OK)
 			return gDecorManager.PreviewDecorator(path, this) == B_OK;
-		}
 		return false;
 	}
 
--- src/servers/app/Desktop.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/servers/app/Desktop.cpp	2011-05-19 18:27:35.000000000 +0200
@@ -2059,17 +2059,19 @@
 
 	for (Window* window = fAllWindows.FirstWindow(); window != NULL;
 			window = window->NextWindow(kAllWindowList)) {
-			BRegion oldBorder;
-			window->GetBorderRegion(&oldBorder);
+		BRegion oldBorder;
+		window->GetBorderRegion(&oldBorder);
 
-			if (!window->ReloadDecor())
-				returnValue = false; // prevent unloading previous add-on
+		if (!window->ReloadDecor()) {
+			// prevent unloading previous add-on
+			returnValue = false;
+		}
 
-			BRegion border;
-			window->GetBorderRegion(&border);
+		BRegion border;
+		window->GetBorderRegion(&border);
 
-			border.Include(&oldBorder);
-			RebuildAndRedrawAfterWindowChange(window, border);
+		border.Include(&oldBorder);
+		RebuildAndRedrawAfterWindowChange(window, border);
 	}
 
 	// register new listeners
--- src/servers/app/DecorManager.h_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/servers/app/DecorManager.h	2011-05-19 18:27:35.000000000 +0200
@@ -39,57 +39,57 @@
 
 	virtual status_t			InitCheck() const;
 
-		image_id				ImageID() const { return fImageID; }
+			image_id			ImageID() const { return fImageID; }
 
-		Decorator*				AllocateDecorator(Desktop* desktop,
+			Decorator*			AllocateDecorator(Desktop* desktop,
 									DrawingEngine* engine, BRect rect,
 									const char* title, window_look look,
 									uint32 flags);
 
-	virtual WindowBehaviour*	AllocateWindowBehaviour(Window* window);
+	virtual	WindowBehaviour*	AllocateWindowBehaviour(Window* window);
 
-	virtual const DesktopListenerList&	GetDesktopListeners();
+	virtual const DesktopListenerList& GetDesktopListeners();
 
 protected:
 	virtual Decorator*			_AllocateDecorator(DesktopSettings& settings,
 									BRect rect, window_look look, uint32 flags);
 
-		DesktopListenerList		fDesktopListeners;
+			DesktopListenerList	fDesktopListeners;
 
 private:
-		image_id				fImageID;
-		BString 				fName;
+			image_id			fImageID;
+			BString 			fName;
 };
 
 
-class DecorManager
-{
+class DecorManager {
 public:
-							DecorManager();
-							~DecorManager();
+								DecorManager();
+								~DecorManager();
 
-		Decorator*			AllocateDecorator(Window *window);
-		WindowBehaviour*	AllocateWindowBehaviour(Window *window);
-		void				CleanupForWindow(Window *window);
+			Decorator*			AllocateDecorator(Window *window);
+			WindowBehaviour*	AllocateWindowBehaviour(Window *window);
+			void				CleanupForWindow(Window *window);
 
-		status_t			PreviewDecorator(BString path, Window *window);
+			status_t			PreviewDecorator(BString path, Window *window);
 
-	const DesktopListenerList&	GetDesktopListeners();
+			const DesktopListenerList& GetDesktopListeners();
 
-		BString 			GetCurrentDecorator() const;
-		status_t			SetDecorator(BString path, Desktop *desktop);
+			BString 			GetCurrentDecorator() const;
+			status_t			SetDecorator(BString path, Desktop *desktop);
 
 private:
-		DecorAddOn*			_LoadDecor(BString path, status_t &error);
-		bool				_LoadSettingsFromDisk();
-		bool				_SaveSettingsToDisk();
-
-		DecorAddOn			fDefaultDecor,
-							*fCurrentDecor,
-							*fPreviewDecor;
+			DecorAddOn*			_LoadDecor(BString path, status_t &error);
+			bool				_LoadSettingsFromDisk();
+			bool				_SaveSettingsToDisk();
 
-		Window				*fPreviewWindow;
-		BString				fCurrentDecorPath;
+private:
+			DecorAddOn			fDefaultDecor;
+			DecorAddOn*			fCurrentDecor;
+			DecorAddOn*			fPreviewDecor;
+
+			Window*				fPreviewWindow;
+			BString				fCurrentDecorPath;
 };
 
 extern DecorManager gDecorManager;
--- src/kits/interface/DecorInfo.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/kits/interface/DecorInfo.cpp	2011-05-19 18:28:05.000000000 +0200
@@ -6,13 +6,16 @@
  */
 
 
-#include <stdio.h>
 #include <DecorInfo.h>
-#include <Path.h>
-#include <Resources.h>
 
+#include <new>
+#include <stdio.h>
+
+#include <Autolock.h>
 #include <Directory.h>
 #include <FindDirectory.h>
+#include <Path.h>
+#include <Resources.h>
 
 
 DecorInfo::DecorInfo()
@@ -23,20 +26,21 @@
 {
 }
 
-DecorInfo::DecorInfo(BString path)
+
+DecorInfo::DecorInfo(const BString& path)
 	:
-	fPath(path.String()),
+	fPath(path),
 	fVersion(0),
 	fModificationTime(0),
 	fInitStatus(B_NO_INIT)
 {
 	BEntry entry(path.String(), true);
 	entry.GetRef(&fRef);
-	entry.Unset();
 
 	_Init();
 }
 
+
 DecorInfo::DecorInfo(const entry_ref& ref)
 	:
 	fRef(ref),
@@ -46,15 +50,16 @@
 {
 	BPath path(&ref);
 	fPath = path.Path();
-	path.Unset();
 
 	_Init();
 }
 
+
 DecorInfo::~DecorInfo()
 {
 }
 
+
 status_t
 DecorInfo::SetTo(const entry_ref& ref)
 {
@@ -70,6 +75,7 @@
 	return InitCheck();
 }
 
+
 status_t
 DecorInfo::SetTo(BString path)
 {
@@ -80,12 +86,14 @@
 	return SetTo(ref);
 }
 
+
 status_t
 DecorInfo::InitCheck()	const
 {
-		return fInitStatus;
+	return fInitStatus;
 }
 
+
 void
 DecorInfo::Unset()
 {
@@ -106,7 +114,7 @@
 bool
 DecorInfo::IsDefault() const
 {
-	return (fInitStatus == B_OK && Path() == "default");
+	return fInitStatus == B_OK && fPath == "Default";
 }
 
 
@@ -116,11 +124,11 @@
 	return fPath.String();
 }
 
+
 const entry_ref*
 DecorInfo::Ref() const
 {
-	if (InitCheck() != B_OK
-		||	IsDefault())
+	if (InitCheck() != B_OK || IsDefault())
 		return NULL;
 	return &fRef;
 }
@@ -145,76 +153,79 @@
 BString
 DecorInfo::Authors() const
 {
-		return fAuthors;
+	return fAuthors;
 }
 
+
 BString
 DecorInfo::ShortDescription() const
 {
-		return fShortDescription;
+	return fShortDescription;
 }
 
+
 BString
 DecorInfo::LongDescription() const
 {
-		return fLongDescription;
+	return fLongDescription;
 }
 
+
 BString
 DecorInfo::LicenseURL() const
 {
-		return fLicenseURL;
+	return fLicenseURL;
 }
 
+
 BString
 DecorInfo::LicenseName() const
 {
-		return fLicenseName;
+	return fLicenseName;
 }
 
+
 BString
 DecorInfo::SupportURL() const
 {
-		return fSupportURL;
+	return fSupportURL;
 }
 
+
 float
 DecorInfo::Version() const
 {
 	return fVersion;
 }
 
+
 time_t
 DecorInfo::ModificationTime() const
 {
 	return fModificationTime;
 }
 
+
 bool
-DecorInfo::CheckForChanges(bool &deleted)
+DecorInfo::CheckForChanges(bool& deleted)
 {
 	if (InitCheck() != B_OK)
 		return false;
 
 	BEntry entry(&fRef);
 
-	if (entry.InitCheck() != B_OK) {
-		entry.Unset();
+	if (entry.InitCheck() != B_OK)
 		return false;
-	}
 
 	if (!entry.Exists()) {
-		entry.Unset();
 		deleted = true;
 		return true;
 	}
 
 	time_t modtime = 0;
-
 	if (entry.GetModificationTime(&modtime) != B_OK) {
-		entry.Unset();
 		fprintf(stderr, "DecorInfo::CheckForChanges()\tERROR: "
-				"BEntry:GetModificationTime() failed\n");
+			"BEntry:GetModificationTime() failed\n");
 		return false;
 	}
 
@@ -225,31 +236,29 @@
 
 	return false;
 }
-			// checks for changes (by modification time), and updates data
-			// accordingly
+
 
 void
-DecorInfo::_Init(bool is_update)
+DecorInfo::_Init(bool isUpdate)
 {
-	if (!is_update && InitCheck() != B_NO_INIT)
-		{ // TODO: remove after validation
-				fprintf(stderr, "DecorInfo::_Init()\tImproper init state\n");
-				return;
-		}
+	if (!isUpdate && InitCheck() != B_NO_INIT) {
+		// TODO: remove after validation
+		fprintf(stderr, "DecorInfo::_Init()\tImproper init state\n");
+		return;
+	}
 
 	BEntry entry;
 
-	if (fPath == "Default")
-	{
-		if (is_update){
+	if (fPath == "Default") {
+		if (isUpdate){
+			// should never happen
 			fprintf(stderr, "DecorInfo::_Init(true)\tBUG BUG updating default"
-					"decorator!?!?!\n");
-			return;	// should never happen
+				"decorator!?!?!\n");
+			return;
 		}
 
 		fName = "Default";
-		fAuthors = "DarkWyrm, Stephan Aßmus, Clemens Zeidler, ";
-			fAuthors << "Ingo Weinhold";
+		fAuthors = "DarkWyrm, Stephan Aßmus, Clemens Zeidler, Ingo Weinhold";
 		fShortDescription = "Default Haiku window decorator.";
 		fLongDescription = fShortDescription;
 		fLicenseURL = "http://";
@@ -258,22 +267,16 @@
 		fVersion = 0.5;
 		fInitStatus = B_OK;
 
-		// the following is to get the modification time of the app_server
-			// and, thusly, the Default decorator...
-			// if you can make it more simple, please do!
-
+		// The following is to get the modification time of the app_server
+		// and, thusly, the Default decorator...
+		// If you can make it more simple, please do!
 		BPath path;
-			find_directory(B_BEOS_SERVERS_DIRECTORY, &path );
-			path.Append("app_server");
-			entry.SetTo(path.Path(), true);
-		path.Unset();
-
+		find_directory(B_BEOS_SERVERS_DIRECTORY, &path);
+		path.Append("app_server");
+		entry.SetTo(path.Path(), true);
 		if (!entry.Exists()) {
-			fprintf(stderr, "server MIA"
-							"the world has become its slave!"
-							"call the CIA\n");
-
-			entry.Unset();
+			fprintf(stderr, "Server MIA the world has become its slave! "
+				"Call the CIA!\n");
 			return;
 		}
 
@@ -284,17 +287,14 @@
 
 	// Is a file system object...
 
-	entry.SetTo(&fRef, true);	// follow links
-
+	entry.SetTo(&fRef, true);	// follow link
 	if (entry.InitCheck() != B_OK) {
 		fInitStatus = entry.InitCheck();
-		entry.Unset();
 		return;
 	}
 
 	if (!entry.Exists()) {
-		entry.Unset();
-		if (is_update) {
+		if (isUpdate) {
 			fprintf(stderr, "DecorInfo::_Init()\tERROR: decorator deleted"
 					" after CheckForChanges() found it!\n");
 			fprintf(stderr, "DecorInfo::_Init()\tERROR: DecorInfo will "
@@ -303,75 +303,64 @@
 		}
 		return;
 	}
-	// update fRef to match file system object
 
+	// update fRef to match file system object
 	entry.GetRef(&fRef);
-		entry.GetModificationTime(&fModificationTime);
-	entry.Unset();
+	entry.GetModificationTime(&fModificationTime);
 
-	BResources	rsrc(&fRef);
-
-	if (rsrc.InitCheck() != B_OK) {
-		fprintf(stderr, "DecorInfo::_Init()\t BResource InitCheck() "
-				"failure\n");
-		rsrc.Unset();
+	BResources resources(&fRef);
+	if (resources.InitCheck() != B_OK) {
+		fprintf(stderr, "DecorInfo::_Init()\t BResource InitCheck() failure\n");
 		return;
 	}
 
-	size_t	sz = 0;
-
-	const void* ptr = rsrc.LoadResource(B_MESSAGE_TYPE, "be:decor:info", &sz);
-	BMessage* msg = new BMessage();
+	size_t infoSize = 0;
+	const void* infoData = resources.LoadResource(B_MESSAGE_TYPE,
+		"be:decor:info", &infoSize);
+	BMessage infoMessage;
 
-	if (!ptr || !msg || sz <= 0) {
+	if (infoData == NULL || infoSize == 0
+		|| infoMessage.Unflatten((const char*)infoData) != B_OK) {
 		fprintf(stderr, "DecorInfo::_init()\tNo extended information found for"
-				" \"%s\"\n", fRef.name);
-	}else{
-		msg->Unflatten((const char*)ptr);
-		msg->FindString("name", 		&fName);
-		msg->FindString("authors", 		&fAuthors);
-		msg->FindString("short_descr", 	&fShortDescription);
-		msg->FindString("long_descr",	&fLongDescription);
-		msg->FindString("lic_url", 		&fLicenseURL);
-		msg->FindString("lic_name", 	&fLicenseName);
-		msg->FindString("support_url",	&fSupportURL);
-		msg->FindFloat ("version", 		&fVersion);
+			" \"%s\"\n", fRef.name);
+	} else {
+		infoMessage.FindString("name", &fName);
+		infoMessage.FindString("authors", &fAuthors);
+		infoMessage.FindString("short_descr", &fShortDescription);
+		infoMessage.FindString("long_descr", &fLongDescription);
+		infoMessage.FindString("lic_url", &fLicenseURL);
+		infoMessage.FindString("lic_name", &fLicenseName);
+		infoMessage.FindString("support_url", &fSupportURL);
+		infoMessage.FindFloat ("version", &fVersion);
 	}
 
-	rsrc.Unset();
+	resources.Unset();
 	fInitStatus = B_OK;
-
-	if (fName == "")
-		fName = fRef.name;
+	fName = fRef.name;
 }
 
 
-/*
+// #pragma mark - DecorInfoUtility
 
-	DecorInfoUtility below this point
-
-*/
-
-
-namespace BPrivate{	// kits/interface/InterfaceDefs.cpp
-	bool		get_decorator(BString*);
-	status_t	set_decorator(BString);
-	status_t	preview_decorator(BString, BWindow*);
 
+namespace BPrivate {
+	// kits/interface/InterfaceDefs.cpp
+	bool get_decorator(BString&);
+	status_t set_decorator(const BString&);
+	status_t preview_decorator(const BString&, BWindow*);
 };
 
 using namespace BPrivate;
 
 
-DecorInfoUtility::DecorInfoUtility(bool scan_now)
+DecorInfoUtility::DecorInfoUtility(bool scanNow)
 	:
 	fHasScanned(false)
 {
 	// get default decorator from app_server
-
-	DecorInfo* info = new DecorInfo("Default");
-
-	if (info->InitCheck() != B_OK)	{
+	DecorInfo* info = new(std::nothrow) DecorInfo("Default");
+	if (info == NULL || info->InitCheck() != B_OK)	{
+		delete info;
 		fprintf(stderr, "DecorInfoUtility::constructor\tdefault decorator's "
 				"DecorInfo failed InitCheck()\n");
 		return;
@@ -379,27 +368,16 @@
 
 	fList.AddItem(info);
 
-	if (scan_now)
+	if (scanNow)
 		ScanDecorators();
 }
 
 
 DecorInfoUtility::~DecorInfoUtility()
 {
-	fLock.Lock();
-
-	DecorInfo* decor = NULL;
-
-	for	(int i = fList.CountItems() - 1; i >= 0; --i) {
-		decor = fList.ItemAt(i);
-		if (!decor)	{
-			fprintf(stderr, "DecorInfoUtility::destructor\tNULL DecorInfo "
-					"in list!\n");
-			continue;
-		}
-		delete decor;
-		fList.RemoveItemAt(i);
-	}
+	BAutolock _(fLock);
+	for	(int i = fList.CountItems() - 1; i >= 0; --i)
+		delete fList.ItemAt(i);
 }
 
 
@@ -407,91 +385,61 @@
 DecorInfoUtility::ScanDecorators()
 {
 	BPath decorPath;
-
-	find_directory(B_USER_ADDONS_DIRECTORY, &decorPath);
-
-	decorPath.Append("decorators");
+	status_t ret = find_directory(B_USER_ADDONS_DIRECTORY, &decorPath);
+	if (ret != B_OK)
+		return ret;
+	ret = decorPath.Append("decorators");
+	if (ret != B_OK)
+		return ret;
 
 	BDirectory dir(decorPath.Path());
-
-	if (dir.InitCheck() != B_OK) {
-			fprintf(stderr, "DecorInfoUtility::ScanDecorators:\tERROR: "
-					"DECORATORS_DIR not found!\n");
-			dir.Unset();
-			return B_ENTRY_NOT_FOUND;
-		}
-
-
-	BString* tstr = new BString();
-
-	if (!get_decorator(tstr)) {
-		fprintf(stderr, "DecorInfoUtility::ScanDecorators()\tERROR: no can "
-				"speak to app_server!\n");
-		return B_ERROR;
+	ret = dir.InitCheck();
+	if (ret != B_OK) {
+		fprintf(stderr, "DecorInfoUtility::ScanDecorators:\tERROR: "
+			"DECORATORS_DIR not found!\n");
+		return ret;
 	}
 
-	BString cur_decor = tstr->String();
-
-	DecorInfo* decor_ptr = NULL;
-
-	fLock.Lock();
+	BAutolock _(fLock);
 	// First, run through our list and DecorInfos CheckForChanges()
 
 	if (fHasScanned) {
-		for (int i = fList.CountItems() - 1; i >= 0; --i) {
-			decor_ptr = fList.ItemAt(i);
+		for (int i = fList.CountItems() - 1; i > 0; --i) {
+			DecorInfo* decorInfo = fList.ItemAt(i);
+
+			bool deleted = false;
+			decorInfo->CheckForChanges(deleted);
 
-			if (decor_ptr) {
-				if (decor_ptr->IsDefault())
-					continue;
-
-				bool deleted = false;
-				decor_ptr->CheckForChanges(deleted);
-
-				if (deleted) {
-							fList.RemoveItem(decor_ptr);
-							delete decor_ptr;
-				}
+			if (deleted) {
+				fList.RemoveItem(decorInfo);
+				delete decorInfo;
 			}
-			else
-				fprintf(stderr, "DecorInfoUtility::ScanDecorators()\tFound "
-						"NULL entry in list @ %i _ BUG BUG BUG\n", i);
 		}
 	}
 
-	decor_ptr = NULL;
-
-	DecorInfo* decor = NULL;
 	BPath path;
 	entry_ref ref;
-	// Now, look at file system:
+	// Now, look at file system, skip the entries for which we already have
+	// a DecorInfo in the list.
 	while (dir.GetNextRef(&ref) == B_OK) {
-		path.Unset();
 		path.SetTo(decorPath.Path());
 		path.Append(ref.name);
-
-		decor_ptr = _find_decor(path.Path());
-
-		if (decor_ptr)
+		if (_FindDecor(path.Path()) != NULL)
 			continue;
 
-		decor = new DecorInfo(ref);
-
-		if (decor->InitCheck() != B_OK) {
+		DecorInfo* decorInfo = new(std::nothrow) DecorInfo(ref);
+		if (decorInfo == NULL || decorInfo->InitCheck() != B_OK) {
 			fprintf(stderr, "DecorInfoUtility::ScanDecorators()\tInitCheck() "
-					"failure on decorator, skipping\n");
-			delete decor;
-			decor = NULL;
+				"failure on decorator, skipping\n");
+			delete decorInfo;
 			continue;
 		}
 
-		fList.AddItem(decor);
+		fList.AddItem(decorInfo);
 	}
 
 	fHasScanned = true;
-	fLock.Unlock();
-	path.Unset();
-	decorPath.Unset();
+
 	return B_OK;
 }
 
@@ -499,6 +447,7 @@
 int32
 DecorInfoUtility::CountDecorators()
 {
+	BAutolock _(fLock);
 	if (!fHasScanned)
 		ScanDecorators();
 
@@ -507,68 +456,38 @@
 
 
 DecorInfo*
-DecorInfoUtility::DecoratorAt(int32 indx)
+DecorInfoUtility::DecoratorAt(int32 index)
 {
-	return fList.ItemAt(indx);
+	BAutolock _(fLock);
+	return fList.ItemAt(index);
 }
 
 
 DecorInfo*
-DecorInfoUtility::FindDecorator(BString str)
+DecorInfoUtility::FindDecorator(const BString& string)
 {
-	if (!fHasScanned)
-		ScanDecorators();
+	if (string.Length() == 0)
+		return CurrentDecorator();
 
-	BString tmp = str.String();
-	if (tmp.ToLower() == "default")
+	if (string.ICompare("default") == 0)
 		return DefaultDecorator();
 
-	if (str == "")
-		return CurrentDecorator();
-
-	fLock.Lock();
+	BAutolock _(fLock);
+	if (!fHasScanned)
+		ScanDecorators();
 
 	// search by path
-	DecorInfo* ptr = _find_decor(str);
-
-	if (ptr) {
-		fLock.Unlock();
-		return ptr;
-	}
-
-	// scan through Name()
-	str.ToLower();
-
-	BString lc_comp, lc_comp2;
+	DecorInfo* decor = _FindDecor(string);
+	if (decor != NULL)
+		return decor;
 
+	// search by cached name
 	for (int i = 1; i < fList.CountItems(); ++i) {
-		ptr = fList.ItemAt(i);
-
-		if (ptr == NULL) {
-			fprintf(stderr, "DecorInfoUtility::FindDecorator()\tFound NULL "
-					"entry @ %i BUG BUG\n", i);
-			continue;
-		}
-		// last, but not least, we compare lower-case
-
-		lc_comp = ptr->Name();
-		lc_comp.ToLower();
-		lc_comp2 = "";
-
-		if (ptr->Ref())
-			lc_comp2 = ptr->Ref()->name;
-
-		lc_comp2.ToLower();
-
-		// if "fancy" name or the file's name match, we are golden!
-		if (lc_comp == str
-			|| str == lc_comp2) {
-				fLock.Unlock();
-				return ptr;
-			}
+		decor = fList.ItemAt(i);
+		if (string.ICompare(decor->Name()) == 0)
+			return decor;
 	}
 
-	fLock.Unlock();
 	return NULL;
 }
 
@@ -576,18 +495,20 @@
 DecorInfo*
 DecorInfoUtility::CurrentDecorator()
 {
+	BAutolock _(fLock);
 	if (!fHasScanned)
 		ScanDecorators();
 
-	BString str;
-	get_decorator(&str);
-	return FindDecorator(str);
+	BString name;
+	get_decorator(name);
+	return FindDecorator(name);
 }
 
 
 DecorInfo*
 DecorInfoUtility::DefaultDecorator()
 {
+	BAutolock _(fLock);
 	return fList.ItemAt(0);
 }
 
@@ -595,9 +516,10 @@
 bool
 DecorInfoUtility::IsCurrentDecorator(DecorInfo* decor)
 {
+	BAutolock _(fLock);
 	if (decor == NULL)
 		 return false;
-	return decor->Path() == CurrentDecorator()->Path().String();
+	return decor->Path() == CurrentDecorator()->Path();
 }
 
 
@@ -607,6 +529,7 @@
 	if (decor == NULL)
 		return B_BAD_VALUE;
 
+	BAutolock _(fLock);
 	if (decor->IsDefault())
 		return set_decorator("Default");
 
@@ -615,14 +538,14 @@
 
 
 status_t
-DecorInfoUtility::SetDecorator(int32 indx)
+DecorInfoUtility::SetDecorator(int32 index)
 {
+	BAutolock _(fLock);
 	if (!fHasScanned)
 		return B_ERROR;
 
-	DecorInfo* decor = DecoratorAt(indx);;
-
-	if (!decor)
+	DecorInfo* decor = DecoratorAt(index);
+	if (decor == NULL)
 		return B_BAD_INDEX;
 
 	return SetDecorator(decor);
@@ -639,43 +562,32 @@
 }
 
 
-// P R I V A T E
-	// ENFORCE LOCKING!
+// #pargma mark - private
+
 
 DecorInfo*
-DecorInfoUtility::_find_decor(BString _path)
-{		// find decor by path and path alone!
+DecorInfoUtility::_FindDecor(const BString& pathString)
+{
+	// find decor by path and path alone!
 	if (!fLock.IsLocked()) {
 		fprintf(stderr, "DecorInfoUtility::_find_decor()\tfailure to lock! - "
-				"BUG BUG BUG\n");
+			"BUG BUG BUG\n");
 		return NULL;
 	}
 
-	BString tmp = _path;
-	if (tmp.ToLower() == "default")
+	if (pathString == "Default")
 		return fList.ItemAt(0);
 
-	DecorInfo* decor = NULL;
-
-	BPath path;
-
-	for ( int i = 1; i < fList.CountItems(); ++i ) {
-		decor = fList.ItemAt(i);
-		if (decor == NULL) {
-			fprintf(stderr, "DecorInfoUtility::_find_decor()\tfound NULL @ %i!"
-					" - BUG BUG BUG\n", i);
-			continue;
-		}
-
-		path.SetTo(decor->Ref());
-
-		if (path.Path() == _path
-			||decor->Path() == _path) {
-					path.Unset();
-					return decor;
-			}
-
-		path.Unset();
+	for (int i = 1; i < fList.CountItems(); ++i) {
+		DecorInfo* decor = fList.ItemAt(i);
+		// Find the DecoratorInfo either by its true current location or by
+		// what we still think the location is (before we had a chance to
+		// update). NOTE: This will only catch the case when the user moved the
+		// folder in which the add-on file lives. It will not work when the user
+		// moves the add-on file itself or renames it.
+		BPath path(decor->Ref());
+		if (path.Path() == pathString || decor->Path() == pathString)
+			return decor;
 	}
 
 	return NULL;
--- src/kits/interface/InterfaceDefs.cpp_patched	2011-05-19 18:24:58.000000000 +0200
+++ src/kits/interface/InterfaceDefs.cpp	2011-05-19 18:28:05.000000000 +0200
@@ -1196,11 +1196,8 @@
 	\return boolean true/false
 */
 bool
-get_decorator(BString * path)
+get_decorator(BString& path)
 {
-	if ( ! path )
-		return false;
-
 	BPrivate::AppServerLink link;
 	link.StartMessage(AS_GET_DECORATOR);
 
@@ -1208,7 +1205,7 @@
 	if (link.FlushWithReply(code) != B_OK || code != B_OK)
 		return false;
 
- 	return ( link.ReadString(*path) == B_OK );
+ 	return link.ReadString(path) == B_OK;
 }
 
 
@@ -1218,7 +1215,7 @@
 	Will return detailed error status via status_t
 */
 status_t
-set_decorator(BString path)
+set_decorator(const BString& path)
 {
 	BPrivate::AppServerLink link;
 
@@ -1233,6 +1230,7 @@
 	return error;
 }
 
+
 /*! \brief sets a window to preview a given decorator
 	\param path path to any given decorator add-on
 	\param window pointer to BWindow which will show decorator
@@ -1240,7 +1238,7 @@
 	Piggy-backs on BWindow::SetDecoratorSettings(...)
 */
 status_t
-preview_decorator(BString path, BWindow * window)
+preview_decorator(const BString& path, BWindow* window)
 {
 	if (window == NULL)
 		return B_ERROR;
--- headers/private/interface/DecorInfo.h_patched	2011-05-19 18:24:58.000000000 +0200
+++ headers/private/interface/DecorInfo.h	2011-05-19 18:28:05.000000000 +0200
@@ -17,99 +17,108 @@
 #include <ObjectList.h>
 
 
+// NOTE: DecorInfo itself is not thread-safe
 class DecorInfo {
-	public:	// DecorInfo is not thread-safe
-						DecorInfo();
-						DecorInfo(BString path);
-						DecorInfo(const entry_ref& ref);
-						~DecorInfo();
-
-			status_t	SetTo(const entry_ref& ref);
-			status_t	SetTo(BString path);
-			status_t	InitCheck()	const;
-			void		Unset();
-
-			bool		IsDefault()	const;
-
-			BString		Path()	const;
-					// "Default" is a possible result
-
-		const entry_ref*	Ref() const;
-			// returns NULL if virtual ( default ) or InitCheck() != B_OK
-			// the ref returned may NOT be the same as the one given to SetTo
-			// or the constructor - we may have traversed a Symlink!
-
-			BString		Name() const;
-			BString		ShortcutName() const;
-
-			BString		Authors() const;
-			BString		ShortDescription() const;
-			BString		LongDescription() const;
-			BString		LicenseURL() const;
-			BString		LicenseName() const;
-			BString		SupportURL() const;
-
-			float		Version() const;
-			time_t		ModificationTime() const;
-
-			bool		CheckForChanges(bool &deleted);
-	private:
-			void		_Init(bool is_update = false);
-			entry_ref	fRef;
-
-			BString		fPath,
-						fName,
-						fAuthors,
-						fShortDescription,
-						fLongDescription,
-						fLicenseURL,
-						fLicenseName,
-						fSupportURL;
+public:
+								DecorInfo();
+								DecorInfo(const BString& path);
+								DecorInfo(const entry_ref& ref);
+								~DecorInfo();
+
+			status_t			SetTo(const entry_ref& ref);
+			status_t			SetTo(BString path);
+			status_t			InitCheck()	const;
+			void				Unset();
+
+			bool				IsDefault()	const;
+
+			BString				Path()	const;
+					// Returns "Default" for the default decorator
+
+			const entry_ref*	Ref() const;
+				// Returns NULL if virtual (default) or InitCheck() != B_OK
+				// The ref returned may NOT be the same as the one given to
+				// SetTo or the constructor - we may have traversed a Symlink!
+
+			BString				Name() const;
+			BString				ShortcutName() const;
+
+			BString				Authors() const;
+			BString				ShortDescription() const;
+			BString				LongDescription() const;
+			BString				LicenseURL() const;
+			BString				LicenseName() const;
+			BString				SupportURL() const;
+
+			float				Version() const;
+			time_t				ModificationTime() const;
+
+			bool				CheckForChanges(bool &deleted);
+
+private:
+			void				_Init(bool is_update = false);
+
+private:
+			entry_ref			fRef;
+
+			BString				fPath;
+			BString				fName;
+			BString				fAuthors;
+			BString				fShortDescription;
+			BString				fLongDescription;
+			BString				fLicenseURL;
+			BString				fLicenseName;
+			BString				fSupportURL;
 
-			float		fVersion;
+			float				fVersion;
 
-			time_t		fModificationTime;
+			time_t				fModificationTime;
 
-			status_t	fInitStatus;
+			status_t			fInitStatus;
 };
 
 
 class DecorInfoUtility{
-	public:
-						DecorInfoUtility(bool scan_now = true);
-									// scan now or as neeeded?
+public:
+								DecorInfoUtility(bool scanNow = true);
+									// NOTE: When scanNow is passed false,
+									// scanning will be performed lazily, such
+									// as in CountDecorators() and other
+									// methods.
 
-						~DecorInfoUtility();
+								~DecorInfoUtility();
 
-			status_t	ScanDecorators();
-				// can also be used to rescan for changes.
-				// warning: potentially destructive as we will remove
-				// all DecorInfo objects which no longer have a file
-				// system cousin.
-				// TODO: would a call-back mechanism worthwhile here?
+			status_t			ScanDecorators();
+									// Can also be used to rescan for changes.
+									// Warning: potentially destructive as we
+									// will remove all DecorInfo objects which
+									// no longer have a file system cousin.
+									// TODO: Would a call-back mechanism be
+									// worthwhile here?
 
-			int32		CountDecorators();
+			int32				CountDecorators();
 
-			DecorInfo*	DecoratorAt(int32);
+			DecorInfo*			DecoratorAt(int32);
 
-			DecorInfo*	FindDecorator(BString);
-				// checks for ref.name, path, fName, and "Default,"
-				// an empty-string returns the current decorator
-				// NULL on match failure
+			DecorInfo*			FindDecorator(const BString& string);
+									// Checks for ref.name, path, fName, and
+									// "Default," an empty-string returns the
+									// current decorator NULL on match failure
 
-			DecorInfo*	CurrentDecorator();
-			DecorInfo*	DefaultDecorator();
+			DecorInfo*			CurrentDecorator();
+			DecorInfo*			DefaultDecorator();
 
-			bool		IsCurrentDecorator(DecorInfo*);
+			bool				IsCurrentDecorator(DecorInfo*);
 
-			status_t	SetDecorator(DecorInfo*);
-			status_t	SetDecorator(int32);
+			status_t			SetDecorator(DecorInfo*);
+			status_t			SetDecorator(int32);
 
-			status_t	Preview(DecorInfo* decor, BWindow* window);
+			status_t			Preview(DecorInfo* decor, BWindow* window);
 
-	private:
-			DecorInfo*	_find_decor(BString path);
+private:
+			DecorInfo*			_FindDecor(const BString& path);
 
+private:
 			BObjectList<DecorInfo>	fList;
 			BLocker					fLock;
 			bool					fHasScanned;
