From cae7797b55a691ccb757474e5f272fbe510d1bda Mon Sep 17 00:00:00 2001 From: AskOldIch Date: Tue, 3 Jan 2023 16:47:15 +0000 Subject: [PATCH 1/3] Added "previewable" for .webm and .weba extension - .webm -- basically is full video container (video+audio) - .weba -- is only audio stream --- retroshare-gui/src/util/misc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/util/misc.cpp b/retroshare-gui/src/util/misc.cpp index c24ea2d11..2f6337d1b 100644 --- a/retroshare-gui/src/util/misc.cpp +++ b/retroshare-gui/src/util/misc.cpp @@ -108,6 +108,8 @@ bool misc::isPreviewable(QString extension) if(extension == "WAV") return true; if(extension == "WMA") return true; if(extension == "WMV") return true; + if(extension == "WEBM") return true; + if(extension == "WEBA") return true; return false; } From c1b71053219e834f5b504dd85249f857736951da Mon Sep 17 00:00:00 2001 From: AskOldIch Date: Tue, 3 Jan 2023 16:54:03 +0000 Subject: [PATCH 2/3] Added extensions to SearchDialog - .webm -- basically is full video container (video+audio) - .weba -- is only audio stream - .webp -- is a picture --- retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index b284fce3d..80087360a 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -286,7 +286,7 @@ void SearchDialog::initialiseFileTypeMappings() /* edit these strings to change the range of extensions recognised by the search */ SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_ANY, ""); SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_AUDIO, - "aac aif flac iff m3u m4a mid midi mp3 mpa ogg ra ram wav wma"); + "aac aif flac iff m3u m4a mid midi mp3 mpa ogg ra ram wav wma weba"); SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_ARCHIVE, "7z bz2 gz pkg rar sea sit sitx tar zip tgz"); SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_CDIMAGE, @@ -295,11 +295,11 @@ void SearchDialog::initialiseFileTypeMappings() "doc odt ott rtf pdf ps txt log msg wpd wps ods xls epub" ); SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_PICTURE, "3dm 3dmf ai bmp drw dxf eps gif ico indd jpe jpeg jpg mng pcx pcc pct pgm " - "pix png psd psp qxd qxprgb sgi svg tga tif tiff xbm xcf"); + "pix png psd psp qxd qxprgb sgi svg tga tif tiff xbm xcf webp"); SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_PROGRAM, "app bat cgi com bin exe js pif py pl sh vb ws bash"); SearchDialog::FileTypeExtensionMap->insert(FILETYPE_IDX_VIDEO, - "3gp asf asx avi mov mp4 mkv flv mpeg mpg qt rm swf vob wmv"); + "3gp asf asx avi mov mp4 mkv flv mpeg mpg qt rm swf vob wmv webm"); SearchDialog::initialised = true; } From 2cf95b410d5f9b1af79de3d465200ddafd44cabe Mon Sep 17 00:00:00 2001 From: AskOldIch Date: Tue, 3 Jan 2023 16:57:42 +0000 Subject: [PATCH 3/3] Added icons association with extensions - .webm -- basically is full video container (video+audio) - .weba -- is only audio stream - .webp -- is a picture --- retroshare-gui/src/gui/common/FilesDefs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/common/FilesDefs.cpp b/retroshare-gui/src/gui/common/FilesDefs.cpp index 0baaea837..0048d5685 100644 --- a/retroshare-gui/src/gui/common/FilesDefs.cpp +++ b/retroshare-gui/src/gui/common/FilesDefs.cpp @@ -33,13 +33,15 @@ static QString getInfoFromFilename(const QString& filename, bool anyForUnknown, { QString ext = QFileInfo(filename).suffix().toLower(); - if (ext == "jpg" || ext == "jpeg" || ext == "tif" || ext == "tiff" || ext == "png" || ext == "gif" || ext == "bmp" || ext == "ico" || ext == "svg") { + if (ext == "jpg" || ext == "jpeg" || ext == "tif" || ext == "tiff" || ext == "png" || ext == "gif" || + ext == "bmp" || ext == "ico" || ext == "svg" || ext == "webp") { return image ? ":/icons/filetype/picture.svg" : QApplication::translate("FilesDefs", "Picture"); } else if (ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "wmv" || ext == "divx" || ext == "ts" || ext == "mkv" || ext == "mp4" || ext == "flv" || ext == "mov" || ext == "asf" || ext == "xvid" || - ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp" || ext == "ogm") { + ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp" || ext == "ogm" || ext == "webm") { return image ? ":/icons/filetype/video.svg" : QApplication::translate("FilesDefs", "Video"); - } else if (ext == "ogg" || ext == "mp3" || ext == "mp1" || ext == "mp2" || ext == "wav" || ext == "wma" || ext == "m4a" || ext == "flac" ||ext == "xpm") { + } else if (ext == "ogg" || ext == "mp3" || ext == "mp1" || ext == "mp2" || ext == "wav" || ext == "wma" || + ext == "m4a" || ext == "flac" || ext == "xpm" || ext == "weba") { return image ? ":/icons/filetype/audio.svg" : QApplication::translate("FilesDefs", "Audio"); } else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "gz" || ext == "7z" || ext == "msi" || ext == "rar" || ext == "rpm" || ext == "ace" || ext == "jar" || ext == "tgz" || ext == "lha" ||