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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user