summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Roster/Roster.cpp9
-rw-r--r--Swift/Controllers/Roster/Roster.h6
2 files changed, 12 insertions, 3 deletions
diff --git a/Swift/Controllers/Roster/Roster.cpp b/Swift/Controllers/Roster/Roster.cpp
index 44cf03d..4dbc453 100644
--- a/Swift/Controllers/Roster/Roster.cpp
+++ b/Swift/Controllers/Roster/Roster.cpp
@@ -197,7 +197,13 @@ void Roster::applyOnAllItems(const RosterItemOperation& operation) {
filterAll();
}
-void Roster::removeFilter(RosterFilter *filter) {
+void Roster::addFilter(RosterFilter* filter) {
+ filters_.push_back(filter);
+ filterAll();
+ onFilterAdded(filter);
+}
+
+void Roster::removeFilter(RosterFilter* filter) {
for (unsigned int i = 0; i < filters_.size(); i++) {
if (filters_[i] == filter) {
filters_.erase(filters_.begin() + i);
@@ -205,6 +211,7 @@ void Roster::removeFilter(RosterFilter *filter) {
}
}
filterAll();
+ onFilterRemoved(filter);
}
void Roster::filterContact(ContactRosterItem* contact, GroupRosterItem* group) {
diff --git a/Swift/Controllers/Roster/Roster.h b/Swift/Controllers/Roster/Roster.h
index b60eafa..9956cb9 100644
--- a/Swift/Controllers/Roster/Roster.h
+++ b/Swift/Controllers/Roster/Roster.h
@@ -38,14 +38,16 @@ class Roster {
void applyOnItems(const RosterItemOperation& operation);
void applyOnAllItems(const RosterItemOperation& operation);
void applyOnItem(const RosterItemOperation& operation, const JID& jid);
- void addFilter(RosterFilter *filter) {filters_.push_back(filter);filterAll();}
- void removeFilter(RosterFilter *filter);
+ void addFilter(RosterFilter* filter);
+ void removeFilter(RosterFilter* filter);
GroupRosterItem* getRoot();
std::vector<RosterFilter*> getFilters() {return filters_;}
boost::signal<void (GroupRosterItem*)> onChildrenChanged;
boost::signal<void (GroupRosterItem*)> onGroupAdded;
boost::signal<void (RosterItem*)> onDataChanged;
boost::signal<void (JID&)> onVCardUpdateRequested;
+ boost::signal<void (RosterFilter* filter)> onFilterAdded;
+ boost::signal<void (RosterFilter* filter)> onFilterRemoved;
GroupRosterItem* getGroup(const std::string& groupName);
void setBlockingSupported(bool isSupported);