From a416707fb352659f395fa4266a9ac8033c1ceb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 7 Feb 2011 23:18:14 +0000 Subject: [PATCH] There is really no reason at all to mess up the current sorting of the attributes just by adding a new attribute. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40379 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/filetypes/AttributeWindow.cpp | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/preferences/filetypes/AttributeWindow.cpp b/src/preferences/filetypes/AttributeWindow.cpp index bb2cb09ff1..83e6ba672c 100644 --- a/src/preferences/filetypes/AttributeWindow.cpp +++ b/src/preferences/filetypes/AttributeWindow.cpp @@ -43,20 +43,6 @@ const uint32 kMsgAlignmentChosen = 'alnc'; const uint32 kMsgAccept = 'acpt'; -static int -compare_attributes(const void* _a, const void* _b) -{ - AttributeItem* a = *(AttributeItem **)_a; - AttributeItem* b = *(AttributeItem **)_b; - - int compare = strcasecmp(a->PublicName(), b->PublicName()); - if (compare != 0) - return compare; - - return strcmp(a->Name(), b->Name()); -} - - static bool compare_display_as(const char* a, const char* b) { @@ -444,7 +430,6 @@ AttributeWindow::MessageReceived(BMessage* message) BList list; const char* newAttribute = fAttributeControl->Text(); - list.AddItem(_NewItemFromCurrent()); const char* attribute; for (int32 i = 0; attributes.FindString("attr:name", i, @@ -460,7 +445,7 @@ AttributeWindow::MessageReceived(BMessage* message) list.AddItem(item); } - list.SortItems(compare_attributes); + list.AddItem(_NewItemFromCurrent()); // Copy them to a new message (their memory is still part of the // original BMessage) @@ -483,9 +468,10 @@ AttributeWindow::MessageReceived(BMessage* message) status = fMimeType.SetAttrInfo(&newAttributes); } - if (status != B_OK) + if (status != B_OK) { error_alert(B_TRANSLATE("Could not change attributes"), status); + } PostMessage(B_QUIT_REQUESTED); break;