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
This commit is contained in:
@@ -67,8 +67,6 @@ DecorInfo::SetTo(const entry_ref& ref)
|
|||||||
|
|
||||||
BPath path(&ref);
|
BPath path(&ref);
|
||||||
fPath = path.Path();
|
fPath = path.Path();
|
||||||
path.Unset();
|
|
||||||
|
|
||||||
fRef = ref;
|
fRef = ref;
|
||||||
_Init();
|
_Init();
|
||||||
|
|
||||||
@@ -79,10 +77,9 @@ DecorInfo::SetTo(const entry_ref& ref)
|
|||||||
status_t
|
status_t
|
||||||
DecorInfo::SetTo(BString path)
|
DecorInfo::SetTo(BString path)
|
||||||
{
|
{
|
||||||
entry_ref ref;
|
|
||||||
BEntry entry(path.String(), true);
|
BEntry entry(path.String(), true);
|
||||||
|
entry_ref ref;
|
||||||
entry.GetRef(&ref);
|
entry.GetRef(&ref);
|
||||||
entry.Unset();
|
|
||||||
return SetTo(ref);
|
return SetTo(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +118,7 @@ DecorInfo::IsDefault() const
|
|||||||
BString
|
BString
|
||||||
DecorInfo::Path() const
|
DecorInfo::Path() const
|
||||||
{
|
{
|
||||||
return fPath.String();
|
return fPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -281,7 +278,6 @@ DecorInfo::_Init(bool isUpdate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
entry.GetModificationTime(&fModificationTime);
|
entry.GetModificationTime(&fModificationTime);
|
||||||
entry.Unset();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +330,6 @@ DecorInfo::_Init(bool isUpdate)
|
|||||||
infoMessage.FindFloat ("version", &fVersion);
|
infoMessage.FindFloat ("version", &fVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
resources.Unset();
|
|
||||||
fInitStatus = B_OK;
|
fInitStatus = B_OK;
|
||||||
fName = fRef.name;
|
fName = fRef.name;
|
||||||
}
|
}
|
||||||
@@ -362,7 +357,7 @@ DecorInfoUtility::DecorInfoUtility(bool scanNow)
|
|||||||
if (info == NULL || info->InitCheck() != B_OK) {
|
if (info == NULL || info->InitCheck() != B_OK) {
|
||||||
delete info;
|
delete info;
|
||||||
fprintf(stderr, "DecorInfoUtility::constructor\tdefault decorator's "
|
fprintf(stderr, "DecorInfoUtility::constructor\tdefault decorator's "
|
||||||
"DecorInfo failed InitCheck()\n");
|
"DecorInfo failed InitCheck()\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,11 +476,13 @@ DecorInfoUtility::FindDecorator(const BString& string)
|
|||||||
if (decor != NULL)
|
if (decor != NULL)
|
||||||
return decor;
|
return decor;
|
||||||
|
|
||||||
// search by cached name
|
// search by name or short cut name
|
||||||
for (int i = 1; i < fList.CountItems(); ++i) {
|
for (int i = 1; i < fList.CountItems(); ++i) {
|
||||||
decor = fList.ItemAt(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 decor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user