diff --git a/src/ImagePackModel.cpp b/src/ImagePackModel.cpp index 4345e383..9b0dca8d 100644 --- a/src/ImagePackModel.cpp +++ b/src/ImagePackModel.cpp @@ -26,6 +26,12 @@ ImagePackModel::ImagePackModel(const std::string &roomId, bool stickers, QObject } } +int +ImagePackModel::rowCount(const QModelIndex &) const +{ + return (int)images.size(); +} + QHash ImagePackModel::roleNames() const { diff --git a/src/ImagePackModel.h b/src/ImagePackModel.h index 10e71b8f..937014ec 100644 --- a/src/ImagePackModel.h +++ b/src/ImagePackModel.h @@ -23,11 +23,7 @@ public: ImagePackModel(const std::string &roomId, bool stickers, QObject *parent = nullptr); QHash roleNames() const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const override - { - (void)parent; - return (int)images.size(); - } + int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role) const override; mtx::events::msc2545::PackImage imageAt(int row) diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index ec1b3573..3e69f92b 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -597,7 +597,7 @@ TimelineViewManager::completerFor(QString completerName, QString roomId) return proxy; } else if (completerName == "stickers") { auto stickerModel = new ImagePackModel(roomId.toStdString(), true); - auto proxy = new CompletionProxyModel(stickerModel); + auto proxy = new CompletionProxyModel(stickerModel, 1, static_cast(-1) / 4); stickerModel->setParent(proxy); return proxy; }