projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
client: Don't store the list of properties in every PropertyMapItem
[quassel.git]
/
src
/
client
/
networkmodel.cpp
diff --git
a/src/client/networkmodel.cpp
b/src/client/networkmodel.cpp
index
8214966
..
6df98c3
100644
(file)
--- a/
src/client/networkmodel.cpp
+++ b/
src/client/networkmodel.cpp
@@
-40,7
+40,7
@@
* Network Items
*****************************************/
NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent)
* Network Items
*****************************************/
NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent)
- : PropertyMapItem(
QList<QString>() << "networkName" << "currentServer" << "nickCount",
parent),
+ : PropertyMapItem(parent),
_networkId(netid),
_statusBufferItem(0)
{
_networkId(netid),
_statusBufferItem(0)
{
@@
-53,6
+53,13
@@
NetworkItem::NetworkItem(const NetworkId &netid, AbstractTreeItem *parent)
}
}
+QStringList NetworkItem::propertyOrder() const
+{
+ static QStringList order{"networkName", "currentServer", "nickCount"};
+ return order;
+}
+
+
QVariant NetworkItem::data(int column, int role) const
{
switch (role) {
QVariant NetworkItem::data(int column, int role) const
{
switch (role) {
@@
-283,7
+290,7
@@
void NetworkItem::onNetworkDestroyed()
* Fancy Buffer Items
*****************************************/
BufferItem::BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent)
* Fancy Buffer Items
*****************************************/
BufferItem::BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent)
- : PropertyMapItem(
QStringList() << "bufferName" << "topic" << "nickCount",
parent),
+ : PropertyMapItem(parent),
_bufferInfo(bufferInfo),
_activity(BufferInfo::NoActivity)
{
_bufferInfo(bufferInfo),
_activity(BufferInfo::NoActivity)
{
@@
-291,6
+298,13
@@
BufferItem::BufferItem(const BufferInfo &bufferInfo, AbstractTreeItem *parent)
}
}
+QStringList BufferItem::propertyOrder() const
+{
+ static QStringList order{"bufferName", "topic", "nickCount"};
+ return order;
+}
+
+
void BufferItem::setActivityLevel(BufferInfo::ActivityLevel level)
{
if (_activity != level) {
void BufferItem::setActivityLevel(BufferInfo::ActivityLevel level)
{
if (_activity != level) {
@@
-992,7
+1006,7
@@
void ChannelBufferItem::userModeChanged(IrcUser *ircUser)
const QList<QChar> UserCategoryItem::categories = QList<QChar>() << 'q' << 'a' << 'o' << 'h' << 'v';
UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent)
const QList<QChar> UserCategoryItem::categories = QList<QChar>() << 'q' << 'a' << 'o' << 'h' << 'v';
UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent)
- : PropertyMapItem(
QStringList() << "categoryName",
parent),
+ : PropertyMapItem(parent),
_category(category)
{
setFlags(Qt::ItemIsEnabled);
_category(category)
{
setFlags(Qt::ItemIsEnabled);
@@
-1001,6
+1015,13
@@
UserCategoryItem::UserCategoryItem(int category, AbstractTreeItem *parent)
}
}
+QStringList UserCategoryItem::propertyOrder() const
+{
+ static QStringList order{"categoryName"};
+ return order;
+}
+
+
// caching this makes no sense, since we display the user number dynamically
QString UserCategoryItem::categoryName() const
{
// caching this makes no sense, since we display the user number dynamically
QString UserCategoryItem::categoryName() const
{
@@
-1094,7
+1115,7
@@
QVariant UserCategoryItem::data(int column, int role) const
* Irc User Items
*****************************************/
IrcUserItem::IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent)
* Irc User Items
*****************************************/
IrcUserItem::IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent)
- : PropertyMapItem(
QStringList() << "nickName",
parent),
+ : PropertyMapItem(parent),
_ircUser(ircUser)
{
setObjectName(ircUser->nick());
_ircUser(ircUser)
{
setObjectName(ircUser->nick());
@@
-1104,6
+1125,13
@@
IrcUserItem::IrcUserItem(IrcUser *ircUser, AbstractTreeItem *parent)
}
}
+QStringList IrcUserItem::propertyOrder() const
+{
+ static QStringList order{"nickName"};
+ return order;
+}
+
+
QVariant IrcUserItem::data(int column, int role) const
{
switch (role) {
QVariant IrcUserItem::data(int column, int role) const
{
switch (role) {