mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Fix pasting images from Firefox on Windows.
Fixes #10564. Together with the image data Firefox sets to the clipboard an URLs list which has a path to local temp file, created from that image. Reading images from disk is slower + sometimes the content of the file is wrong so for this case we prefer to read the image data directly.
This commit is contained in:
@@ -74,7 +74,7 @@ void PrepareDetailsInParallel(PreparedList &result, int previewWidth) {
|
||||
} // namespace
|
||||
|
||||
bool ValidatePhotoEditorMediaDragData(not_null<const QMimeData*> data) {
|
||||
const auto urls = base::GetMimeUrls(data);
|
||||
const auto urls = Core::ReadMimeUrls(data);
|
||||
if (urls.size() > 1) {
|
||||
return false;
|
||||
} else if (data->hasImage()) {
|
||||
@@ -98,7 +98,7 @@ bool ValidatePhotoEditorMediaDragData(not_null<const QMimeData*> data) {
|
||||
bool ValidateEditMediaDragData(
|
||||
not_null<const QMimeData*> data,
|
||||
Ui::AlbumType albumType) {
|
||||
const auto urls = base::GetMimeUrls(data);
|
||||
const auto urls = Core::ReadMimeUrls(data);
|
||||
if (urls.size() > 1) {
|
||||
return false;
|
||||
} else if (data->hasImage()) {
|
||||
@@ -126,7 +126,7 @@ MimeDataState ComputeMimeDataState(const QMimeData *data) {
|
||||
return MimeDataState::Image;
|
||||
}
|
||||
|
||||
const auto urls = base::GetMimeUrls(data);
|
||||
const auto urls = Core::ReadMimeUrls(data);
|
||||
if (urls.isEmpty()) {
|
||||
return MimeDataState::None;
|
||||
}
|
||||
|
Reference in New Issue
Block a user