Ticket #7004: BIconRuleRemoveIcons.patch
File BIconRuleRemoveIcons.patch, 1.9 KB (added by , 13 years ago) |
---|
-
src/preferences/notifications/IconRule.cpp
12 12 #include <Message.h> 13 13 #include <Bitmap.h> 14 14 #include <Window.h> 15 #include <List.h>16 15 17 16 #include "IconRule.h" 18 #include "IconItem.h"19 17 20 18 const int32 kEdgeOffset = 8; 21 19 const int32 kBorderOffset = 1; … … 27 25 BView(name, B_WILL_DRAW), 28 26 fSelIndex(-1) 29 27 { 30 fIcons = new B List();28 fIcons = new BObjectList<BIconItem>(); 31 29 } 32 30 33 31 … … 161 159 void 162 160 BIconRule::RemoveIconAt(int32 index) 163 161 { 162 int32 count = fIcons->CountItems(); 163 if ((index < count) && (index >= (int32)0)) 164 fIcons->RemoveItemAt((int32)index); 164 165 } 165 166 166 167 167 168 void 168 169 BIconRule::RemoveAllIcons() 169 170 { 171 int32 count = fIcons->CountItems(); 172 for (int32 i = 0; i < count; i++) 173 fIcons->RemoveItemAt(i); 170 174 } 171 175 172 176 -
src/preferences/notifications/IconRule.h
7 7 #define _ICON_RULE_H 8 8 9 9 #include <Invoker.h> 10 #include <ObjectList.h> 10 11 #include <View.h> 11 12 12 class BList; 13 #include "IconItem.h" 14 15 13 16 class BMessage; 14 17 15 18 class BIconRule : public BView, public BInvoker { … … 44 47 virtual BSize PreferredSize(); 45 48 46 49 private: 47 BList* fIcons; 50 typedef BObjectList<BIconItem> IconItems; 51 IconItems* fIcons; 48 52 int32 fSelIndex; 49 53 BMessage* fMessage; 50 54 }; -
src/preferences/notifications/Jamfile
1 1 SubDir HAIKU_TOP src preferences notifications ; 2 2 3 UsePrivateHeaders shared ; 4 3 5 UsePrivateHeaders interface ; 4 6 5 7 Application Notifications :