diff --git a/src/ImagePackModel.cpp b/src/ImagePackModel.cpp index 4345e383381a962664237bf0b51ad55fa46d57c7..9b0dca8d9f2bdb492a4f2f1fbd9f2be638ae4b07 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<int, QByteArray> ImagePackModel::roleNames() const { diff --git a/src/ImagePackModel.h b/src/ImagePackModel.h index 10e71b8fb91efc87bb01ae5c44c493ca044a16f2..937014eccf23e9bcaf8db31308c03cd99bc8bbd8 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<int, QByteArray> 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 ec1b35733dea405ca39418835efa087c66b2372b..3e69f92b79c81ade617196cd1f9cdcb734cb740c 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<size_t>(-1) / 4); stickerModel->setParent(proxy); return proxy; }