diff options
Diffstat (limited to 'Swift/QtUI/ChatList')
-rw-r--r-- | Swift/QtUI/ChatList/ChatListGroupItem.h | 16 | ||||
-rw-r--r-- | Swift/QtUI/ChatList/ChatListItem.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Swift/QtUI/ChatList/ChatListGroupItem.h b/Swift/QtUI/ChatList/ChatListGroupItem.h index a1e479f..17defea 100644 --- a/Swift/QtUI/ChatList/ChatListGroupItem.h +++ b/Swift/QtUI/ChatList/ChatListGroupItem.h @@ -13,14 +13,14 @@ namespace Swift { class ChatListGroupItem : public ChatListItem { public: - ChatListGroupItem(const QString& name, ChatListGroupItem* parent, bool sorted = true) : ChatListItem(parent), name_(name), sorted_(sorted) {}; - void addItem(ChatListItem* item) {items_.push_back(item); if (sorted_) {qStableSort(items_.begin(), items_.end(), pointerItemLessThan);}}; - void remove(int index) {items_.removeAt(index);}; - int rowCount() {return items_.size();}; - ChatListItem* item(int i) {return items_[i];}; - int row(ChatListItem* item) {return items_.indexOf(item);}; - QVariant data(int role) const {return (role == Qt::DisplayRole) ? name_ : QVariant();}; - void clear() {items_.clear();}; + ChatListGroupItem(const QString& name, ChatListGroupItem* parent, bool sorted = true) : ChatListItem(parent), name_(name), sorted_(sorted) {} + void addItem(ChatListItem* item) {items_.push_back(item); if (sorted_) {qStableSort(items_.begin(), items_.end(), pointerItemLessThan);}} + void remove(int index) {items_.removeAt(index);} + int rowCount() {return items_.size();} + ChatListItem* item(int i) {return items_[i];} + int row(ChatListItem* item) {return items_.indexOf(item);} + QVariant data(int role) const {return (role == Qt::DisplayRole) ? name_ : QVariant();} + void clear() {items_.clear();} private: static bool pointerItemLessThan(const ChatListItem* first, const ChatListItem* second) { QString myName = first->data(Qt::DisplayRole).toString().toLower(); diff --git a/Swift/QtUI/ChatList/ChatListItem.h b/Swift/QtUI/ChatList/ChatListItem.h index e7be614..28c0f9c 100644 --- a/Swift/QtUI/ChatList/ChatListItem.h +++ b/Swift/QtUI/ChatList/ChatListItem.h @@ -13,10 +13,10 @@ namespace Swift { class ChatListGroupItem; class ChatListItem { public: - ChatListItem(ChatListGroupItem* parent) {parent_ = parent;}; + ChatListItem(ChatListGroupItem* parent) {parent_ = parent;} virtual ~ChatListItem() {} - ChatListGroupItem* parent() {return parent_;}; + ChatListGroupItem* parent() {return parent_;} virtual QVariant data(int role) const = 0; private: |