mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Drag correct element from file album.
This commit is contained in:
parent
ca1a548fb8
commit
2d67557a91
2 changed files with 12 additions and 6 deletions
|
@ -1856,9 +1856,12 @@ std::unique_ptr<QMimeData> HistoryInner::prepareDrag() {
|
|||
session().data().setMimeForwardIds(std::move(forwardIds));
|
||||
auto result = std::make_unique<QMimeData>();
|
||||
result->setData(u"application/x-td-forward"_q, "1");
|
||||
if (const auto media = pressedView->media()) {
|
||||
if (const auto document = media->getDocument()) {
|
||||
const auto filepath = document->filepath(true);
|
||||
if (pressedHandler) {
|
||||
const auto lnkDocument = reinterpret_cast<DocumentData*>(
|
||||
pressedHandler->property(
|
||||
kDocumentLinkMediaProperty).toULongLong());
|
||||
if (lnkDocument) {
|
||||
const auto filepath = lnkDocument->filepath(true);
|
||||
if (!filepath.isEmpty()) {
|
||||
QList<QUrl> urls;
|
||||
urls.push_back(QUrl::fromLocalFile(filepath));
|
||||
|
|
|
@ -3639,9 +3639,12 @@ std::unique_ptr<QMimeData> ListWidget::prepareDrag() {
|
|||
session().data().setMimeForwardIds(std::move(forwardIds));
|
||||
auto result = std::make_unique<QMimeData>();
|
||||
result->setData(u"application/x-td-forward"_q, "1");
|
||||
if (const auto media = pressedView->media()) {
|
||||
if (const auto document = media->getDocument()) {
|
||||
const auto filepath = document->filepath(true);
|
||||
if (pressedHandler) {
|
||||
const auto lnkDocument = reinterpret_cast<DocumentData*>(
|
||||
pressedHandler->property(
|
||||
kDocumentLinkMediaProperty).toULongLong());
|
||||
if (lnkDocument) {
|
||||
const auto filepath = lnkDocument->filepath(true);
|
||||
if (!filepath.isEmpty()) {
|
||||
QList<QUrl> urls;
|
||||
urls.push_back(QUrl::fromLocalFile(filepath));
|
||||
|
|
Loading…
Add table
Reference in a new issue