message context menu began, open and show in folder features

This commit is contained in:
Blue 2021-05-04 17:09:41 +03:00
parent f34289399e
commit d514db9c4a
7 changed files with 108 additions and 6 deletions

View file

@ -379,6 +379,22 @@ void Models::MessageFeed::responseArchive(const std::list<Shared::Message> list,
}
}
QModelIndex Models::MessageFeed::index(int row, int column, const QModelIndex& parent) const
{
if (!hasIndex(row, column, parent)) {
return QModelIndex();
}
StorageByTime::iterator itr = indexByTime.nth(row);
if (itr != indexByTime.end()) {
Shared::Message* msg = *itr;
return createIndex(row, column, msg);
} else {
return QModelIndex();
}
}
QHash<int, QByteArray> Models::MessageFeed::roleNames() const
{
return roles;

View file

@ -61,6 +61,7 @@ public:
bool canFetchMore(const QModelIndex & parent) const override;
void fetchMore(const QModelIndex & parent) override;
QHash<int, QByteArray> roleNames() const override;
QModelIndex index(int row, int column, const QModelIndex & parent) const override;
void responseArchive(const std::list<Shared::Message> list, bool last);
void downloadAttachment(const QString& messageId);