X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=1a5e4c4bc732ed169ab32f24b0e172e7aaee3020;hp=861d07cf81008993eb5ccaf10ba7b6557530cf75;hb=4fdf00a414eba03fb95cade3aca3ba53705c7b97;hpb=e9f87d7542d4a9fe0e9c63dec96e93d270667ecd diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 861d07cf..1a5e4c4b 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -72,7 +72,7 @@ public: bool isActive() const; inline Buffer::ActivityLevel activityLevel() const { return _activity; } - bool setActivityLevel(Buffer::ActivityLevel level); + void setActivityLevel(Buffer::ActivityLevel level); void updateActivityLevel(Buffer::ActivityLevel level); void setLastMsgInsert(QDateTime msgDate); @@ -100,7 +100,7 @@ private: QString _bufferName; Buffer::ActivityLevel _activity; - QPointer _ircChannel; + IrcChannel *_ircChannel; }; @@ -146,12 +146,12 @@ private: *****************************************/ class UserCategoryItem : public PropertyMapItem { Q_OBJECT - Q_PROPERTY(QString categoryId READ categoryId) + Q_PROPERTY(QString categoryName READ categoryName) public: UserCategoryItem(int category, AbstractTreeItem *parent); - QString categoryId(); + QString categoryName() const; virtual quint64 id() const; virtual QVariant data(int column, int role) const; @@ -163,13 +163,7 @@ public: private: int _category; - struct Category { - QChar mode; - QString displayString; - inline Category(QChar mode_, QString displayString_) : mode(mode_), displayString(displayString_) {}; - }; - - static const QList categories; + static const QList categories; }; /***************************************** @@ -208,7 +202,7 @@ class NetworkModel : public TreeModel { public: enum myRoles { - BufferTypeRole = Qt::UserRole, + BufferTypeRole = TreeModel::UserRole, ItemActiveRole, BufferActivityRole, BufferIdRole, @@ -217,12 +211,13 @@ public: ItemTypeRole }; - enum itemTypes { - NetworkItemType, - BufferItemType, - UserCategoryItemType, - IrcUserItemType + enum itemType { + NetworkItemType = 0x01, + BufferItemType = 0x02, + UserCategoryItemType = 0x04, + IrcUserItemType = 0x08 }; + Q_DECLARE_FLAGS(itemTypes, itemType); NetworkModel(QObject *parent = 0); static QList defaultHeader(); @@ -258,5 +253,6 @@ private: BufferItem *existsBufferItem(const BufferInfo &bufferInfo); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(NetworkModel::itemTypes); #endif // NETWORKMODEL_H