X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fmessagemodel.h;h=63772822cb1700e001b0d2124a1e13522ef81a3d;hp=75259da76fd12946db4bbc66bd4d60fa7a370feb;hb=8f2ee00f4edef1693628d3af0bdee84d725eb754;hpb=e8a39b4c3c92e193ab861a3fea84a261bb6fbd24 diff --git a/src/client/messagemodel.h b/src/client/messagemodel.h index 75259da7..63772822 100644 --- a/src/client/messagemodel.h +++ b/src/client/messagemodel.h @@ -60,7 +60,7 @@ public: MessageModel(QObject *parent); inline QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; - inline QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); } + inline QModelIndex parent(const QModelIndex &) const override { return {}; } inline int rowCount(const QModelIndex &parent = QModelIndex()) const override { return parent.isValid() ? 0 : messageCount(); } inline int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override { return 3; } @@ -126,7 +126,7 @@ private: QModelIndex MessageModel::index(int row, int column, const QModelIndex &parent) const { if (row < 0 || row >= rowCount(parent) || column < 0 || column >= columnCount(parent)) - return QModelIndex(); + return {}; return createIndex(row, column); } @@ -135,16 +135,15 @@ QModelIndex MessageModel::index(int row, int column, const QModelIndex &parent) // ************************************************** // MessageModelItem // ************************************************** +//! Creates a MessageModelItem from a Message object. +/** This baseclass implementation takes care of all Message data *except* the stylable strings. + * Subclasses need to provide Qt::DisplayRole at least, which should describe the plaintext + * strings without formattings (e.g. for searching purposes). + */ class CLIENT_EXPORT MessageModelItem { public: - //! Creates a MessageModelItem from a Message object. - /** This baseclass implementation takes care of all Message data *except* the stylable strings. - * Subclasses need to provide Qt::DisplayRole at least, which should describe the plaintext - * strings without formattings (e.g. for searching purposes). - */ - MessageModelItem() {} - inline virtual ~MessageModelItem() {} + inline virtual ~MessageModelItem() = default; virtual QVariant data(int column, int role) const; virtual bool setData(int column, const QVariant &value, int role);