2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Correctly check media when editing files.

This commit is contained in:
John Preston
2020-10-20 11:19:48 +03:00
parent c4af731b19
commit a614ccad97
16 changed files with 155 additions and 187 deletions

View File

@@ -329,8 +329,9 @@ QString ImagesOrAllFilter() {
return ImagesFilter() + u";;"_q + AllFilesFilter();
}
QString AlbumFilesFilter() {
return u"Image and Video Files (*.png *.jpg *.jpeg *.mp4 *.mov)"_q;
QString PhotoVideoFilesFilter() {
return u"Image and Video Files (*.png *.jpg *.jpeg *.mp4 *.mov);;"_q
+ AllFilesFilter();
}
namespace internal {

View File

@@ -93,7 +93,7 @@ void GetFolder(
[[nodiscard]] QString ImagesFilter();
[[nodiscard]] QString AllOrImagesFilter();
[[nodiscard]] QString ImagesOrAllFilter();
[[nodiscard]] QString AlbumFilesFilter();
[[nodiscard]] QString PhotoVideoFilesFilter();
namespace internal {

View File

@@ -111,7 +111,7 @@ bool IsMimeSticker(const QString &mime) {
|| IsMimeStickerAnimated(mime);
}
bool IsMimeAcceptedForAlbum(const QString &mime) {
bool IsMimeAcceptedForPhotoVideoAlbum(const QString &mime) {
return (mime == u"image/jpeg"_q)
|| (mime == u"image/png"_q)
|| (mime == u"video/mp4"_q)

View File

@@ -42,7 +42,7 @@ private:
[[nodiscard]] bool IsMimeStickerAnimated(const QString &mime);
[[nodiscard]] bool IsMimeSticker(const QString &mime);
[[nodiscard]] bool IsMimeAcceptedForAlbum(const QString &mime);
[[nodiscard]] bool IsMimeAcceptedForPhotoVideoAlbum(const QString &mime);
[[nodiscard]] bool FileIsImage(const QString &name, const QString &mime);