From 8102d8b3ad10c3542541b0cdf7ea5036b784b1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 20 May 2011 07:18:40 +0000 Subject: [PATCH] When cleaning up the patch, I accidentally removed some functionality which I misunderstood. setdecor can now refer to decorators by their short (i.e. file system) name as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41602 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/DecorInfo.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/kits/interface/DecorInfo.cpp b/src/kits/interface/DecorInfo.cpp index abec0f34c3..2ef504f487 100644 --- a/src/kits/interface/DecorInfo.cpp +++ b/src/kits/interface/DecorInfo.cpp @@ -67,8 +67,6 @@ DecorInfo::SetTo(const entry_ref& ref) BPath path(&ref); fPath = path.Path(); - path.Unset(); - fRef = ref; _Init(); @@ -79,10 +77,9 @@ DecorInfo::SetTo(const entry_ref& ref) status_t DecorInfo::SetTo(BString path) { - entry_ref ref; BEntry entry(path.String(), true); + entry_ref ref; entry.GetRef(&ref); - entry.Unset(); return SetTo(ref); } @@ -121,7 +118,7 @@ DecorInfo::IsDefault() const BString DecorInfo::Path() const { - return fPath.String(); + return fPath; } @@ -281,7 +278,6 @@ DecorInfo::_Init(bool isUpdate) } entry.GetModificationTime(&fModificationTime); - entry.Unset(); return; } @@ -334,7 +330,6 @@ DecorInfo::_Init(bool isUpdate) infoMessage.FindFloat ("version", &fVersion); } - resources.Unset(); fInitStatus = B_OK; fName = fRef.name; } @@ -362,7 +357,7 @@ DecorInfoUtility::DecorInfoUtility(bool scanNow) if (info == NULL || info->InitCheck() != B_OK) { delete info; fprintf(stderr, "DecorInfoUtility::constructor\tdefault decorator's " - "DecorInfo failed InitCheck()\n"); + "DecorInfo failed InitCheck()\n"); return; } @@ -481,11 +476,13 @@ DecorInfoUtility::FindDecorator(const BString& string) if (decor != NULL) return decor; - // search by cached name + // search by name or short cut name for (int i = 1; i < fList.CountItems(); ++i) { decor = fList.ItemAt(i); - if (string.ICompare(decor->Name()) == 0) + if (string.ICompare(decor->ShortcutName()) == 0 + || string.ICompare(decor->Name()) == 0) { return decor; + } } return NULL;