Ticket #7004: BIconRuleRemoveIcons.patch

File BIconRuleRemoveIcons.patch, 1.9 KB (added by Karvjorm, 13 years ago)

An updated BIconRuleRemoveIcons patch

  • src/preferences/notifications/IconRule.cpp

     
    1212#include <Message.h>
    1313#include <Bitmap.h>
    1414#include <Window.h>
    15 #include <List.h>
    1615
    1716#include "IconRule.h"
    18 #include "IconItem.h"
    1917
    2018const int32 kEdgeOffset = 8;
    2119const int32 kBorderOffset = 1;
     
    2725    BView(name, B_WILL_DRAW),
    2826    fSelIndex(-1)
    2927{
    30     fIcons = new BList();
     28    fIcons = new BObjectList<BIconItem>();
    3129}
    3230
    3331
     
    161159void
    162160BIconRule::RemoveIconAt(int32 index)
    163161{
     162    int32 count = fIcons->CountItems();
     163    if ((index < count) && (index >= (int32)0))
     164        fIcons->RemoveItemAt((int32)index);
    164165}
    165166
    166167
    167168void
    168169BIconRule::RemoveAllIcons()
    169170{
     171    int32 count = fIcons->CountItems();
     172    for (int32 i = 0; i < count; i++)
     173        fIcons->RemoveItemAt(i);
    170174}
    171175
    172176
  • src/preferences/notifications/IconRule.h

     
    77#define _ICON_RULE_H
    88
    99#include <Invoker.h>
     10#include <ObjectList.h>
    1011#include <View.h>
    1112
    12 class BList;
     13#include "IconItem.h"
     14
     15
    1316class BMessage;
    1417
    1518class BIconRule : public BView, public BInvoker {
     
    4447    virtual BSize       PreferredSize();
    4548
    4649private:
    47             BList*      fIcons;
     50            typedef BObjectList<BIconItem> IconItems;
     51            IconItems*  fIcons;
    4852            int32       fSelIndex;
    4953            BMessage*   fMessage;
    5054};
  • src/preferences/notifications/Jamfile

     
    11SubDir HAIKU_TOP src preferences notifications ;
    22
     3UsePrivateHeaders shared ;
     4
    35UsePrivateHeaders interface ;
    46
    57Application Notifications :