2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-01 03:12:03 +00:00

Use click handler property instead of dynamic cast.

This commit is contained in:
John Preston
2022-01-13 20:31:35 +03:00
parent 8a071fe1fe
commit f24f78c0cc
6 changed files with 122 additions and 90 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "data/data_file_click_handler.h"
#include "core/click_handler_types.h"
#include "core/file_utilities.h"
#include "data/data_document.h"
#include "data/data_photo.h"
@@ -44,6 +45,9 @@ DocumentClickHandler::DocumentClickHandler(
FullMsgId context)
: FileClickHandler(context)
, _document(document) {
setProperty(
kDocumentLinkMediaIdProperty,
QVariant(qulonglong(_document->id)));
}
DocumentOpenClickHandler::DocumentOpenClickHandler(
@@ -146,6 +150,7 @@ PhotoClickHandler::PhotoClickHandler(
: FileClickHandler(context)
, _photo(photo)
, _peer(peer) {
setProperty(kPhotoLinkMediaIdProperty, QVariant(qulonglong(_photo->id)));
}
not_null<PhotoData*> PhotoClickHandler::photo() const {