X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Firclistmodel.cpp;h=97dcdfc6b164c3cbdfdb62108842b7b5f5ea26a1;hp=91ea7ec01dfe98ce9793c74822c467fd46f1c84e;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=30b159cb876a9495de42e9a3e70ca050516f0805 diff --git a/src/client/irclistmodel.cpp b/src/client/irclistmodel.cpp index 91ea7ec0..97dcdfc6 100644 --- a/src/client/irclistmodel.cpp +++ b/src/client/irclistmodel.cpp @@ -22,13 +22,11 @@ #include -IrcListModel::IrcListModel(QObject *parent) +IrcListModel::IrcListModel(QObject* parent) : QAbstractItemModel(parent) -{ -} +{} - -QVariant IrcListModel::data(const QModelIndex &index, int role) const +QVariant IrcListModel::data(const QModelIndex& index, int role) const { if (!index.isValid() || index.row() >= rowCount() || index.column() >= columnCount() || role != Qt::DisplayRole) return QVariant(); @@ -47,8 +45,7 @@ QVariant IrcListModel::data(const QModelIndex &index, int role) const } } - -Qt::ItemFlags IrcListModel::flags(const QModelIndex &index) const +Qt::ItemFlags IrcListModel::flags(const QModelIndex& index) const { if (!index.isValid()) { return Qt::ItemIsDropEnabled; @@ -58,13 +55,10 @@ Qt::ItemFlags IrcListModel::flags(const QModelIndex &index) const } } - QVariant IrcListModel::headerData(int section, Qt::Orientation orientation, int role) const { QStringList header; - header << tr("Channel") - << tr("Users") - << tr("Topic"); + header << tr("Channel") << tr("Users") << tr("Topic"); if (orientation == Qt::Horizontal && role == Qt::DisplayRole) return header[section]; @@ -72,8 +66,7 @@ QVariant IrcListModel::headerData(int section, Qt::Orientation orientation, int return QVariant(); } - -QModelIndex IrcListModel::index(int row, int column, const QModelIndex &parent) const +QModelIndex IrcListModel::index(int row, int column, const QModelIndex& parent) const { Q_UNUSED(parent); if (row >= rowCount() || column >= columnCount()) @@ -82,8 +75,7 @@ QModelIndex IrcListModel::index(int row, int column, const QModelIndex &parent) return createIndex(row, column); } - -void IrcListModel::setChannelList(const QList &channelList) +void IrcListModel::setChannelList(const QList& channelList) { if (rowCount() > 0) { beginRemoveRows(QModelIndex(), 0, _channelList.count() - 1);