mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Use KUrlMimeData for clipboard xdg-desktop-portal integration
This commit is contained in:
@@ -67,7 +67,7 @@ auto ListFromMimeData(not_null<const QMimeData*> data, bool premium) {
|
||||
auto result = data->hasUrls()
|
||||
? Storage::PrepareMediaList(
|
||||
// When we edit media, we need only 1 file.
|
||||
data->urls().mid(0, 1),
|
||||
base::GetMimeUrls(data).mid(0, 1),
|
||||
st::sendMediaPreviewSize,
|
||||
premium)
|
||||
: Ui::PreparedList(Error::EmptyFile, QString());
|
||||
|
@@ -793,13 +793,13 @@ void SendFilesBox::captionResized() {
|
||||
}
|
||||
|
||||
bool SendFilesBox::canAddFiles(not_null<const QMimeData*> data) const {
|
||||
return (data->hasUrls() && CanAddUrls(data->urls())) || data->hasImage();
|
||||
return (data->hasUrls() && CanAddUrls(base::GetMimeUrls(data))) || data->hasImage();
|
||||
}
|
||||
|
||||
bool SendFilesBox::addFiles(not_null<const QMimeData*> data) {
|
||||
const auto premium = _controller->session().premium();
|
||||
auto list = [&] {
|
||||
const auto urls = data->hasUrls() ? data->urls() : QList<QUrl>();
|
||||
const auto urls = data->hasUrls() ? base::GetMimeUrls(data) : QList<QUrl>();
|
||||
auto result = CanAddUrls(urls)
|
||||
? Storage::PrepareMediaList(
|
||||
urls,
|
||||
|
Reference in New Issue
Block a user