X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Faliasesmodel.h;h=74a0cfd65bfce173e618a90b118c3fb9af8c71b9;hb=3efffa2c3f687b21c8040e9a7ee3830e8f539abf;hp=c6e829511ecddfaa27799355e5f98013fefe5838;hpb=6d32c3e6a04a358789c469948d044715d6fb5aed;p=quassel.git diff --git a/src/qtui/settingspages/aliasesmodel.h b/src/qtui/settingspages/aliasesmodel.h index c6e82951..74a0cfd6 100644 --- a/src/qtui/settingspages/aliasesmodel.h +++ b/src/qtui/settingspages/aliasesmodel.h @@ -43,8 +43,8 @@ public: inline QModelIndex parent(const QModelIndex &) const { return QModelIndex(); } - inline int rowCount(const QModelIndex &parent = QModelIndex()) const { Q_UNUSED(parent) return aliasManager().count(); } - inline int columnCount(const QModelIndex &parent = QModelIndex()) const { Q_UNUSED(parent) return 2; } + inline int rowCount(const QModelIndex &parent = QModelIndex()) const; + inline int columnCount(const QModelIndex &parent = QModelIndex()) const; inline bool configChanged() const { return _configChanged; } inline bool isReady() const { return _modelReady; } @@ -75,4 +75,16 @@ private slots: void initDone(); }; +// Inlines +int AliasesModel::rowCount(const QModelIndex &parent) const { + Q_UNUSED(parent); + return isReady() ? aliasManager().count() : 0; +} + +int AliasesModel::columnCount(const QModelIndex &parent) const { + Q_UNUSED(parent); + return isReady() ? 2 : 0; +} + + #endif //ALIASESMODEL_H