summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Roster/GroupRosterItem.h')
m---------Swiften0
-rw-r--r--Swiften/Roster/GroupRosterItem.h68
2 files changed, 0 insertions, 68 deletions
diff --git a/Swiften b/Swiften
new file mode 160000
+Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c
diff --git a/Swiften/Roster/GroupRosterItem.h b/Swiften/Roster/GroupRosterItem.h
deleted file mode 100644
index 2ab59ea..0000000
--- a/Swiften/Roster/GroupRosterItem.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef SWIFTEN_GroupRosterItem_H
-#define SWIFTEN_GroupRosterItem_H
-
-#include "Swiften/Roster/RosterItem.h"
-#include "Swiften/Base/String.h"
-#include "Swiften/Roster/TreeWidget.h"
-#include "Swiften/Roster/TreeWidgetFactory.h"
-#include "Swiften/Roster/TreeWidgetItem.h"
-#include "Swiften/Roster/ContactRosterItem.h"
-
-#include <list>
-
-namespace Swift {
-
-class GroupRosterItem : public RosterItem {
- public:
- GroupRosterItem(const String& name, TreeWidget* tree, TreeWidgetFactory* factory) : name_(name) {
- widget_ = factory->createTreeWidgetItem(tree);
- widget_->setExpanded(true);
- widget_->setText(name);
- }
-
- ~GroupRosterItem() {
- delete widget_;
- }
-
- const String& getName() const {
- return name_;
- }
-
- TreeWidgetItem* getWidget() const {
- return widget_;
- }
-
- const std::list<RosterItem*>& getChildren() const {
- return children_;
- }
-
- void addChild(RosterItem* item) {
- children_.push_back(item);
- }
-
- void removeChild(const JID& jid) {
- std::list<RosterItem*>::iterator it = children_.begin();
- while (it != children_.end()) {
- ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(*it);
- if (contact && contact->getJID() == jid) {
- delete contact;
- it = children_.erase(it);
- continue;
- }
- GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(*it);
- if (group) {
- group->removeChild(jid);
- }
- it++;
- }
- }
-
- private:
- String name_;
- TreeWidgetItem* widget_;
- std::list<RosterItem*> children_;
-};
-
-}
-#endif
-