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

Showing in folder instead of launching media files with bad extensions.

Thanks for the report to: Sadegh Ahmadzadegan - Omid Ghaffarinia.
This commit is contained in:
John Preston
2016-06-29 18:21:21 +03:00
parent da293755ef
commit 8909943bd3
4 changed files with 44 additions and 6 deletions

View File

@@ -1541,7 +1541,11 @@ void MainWidget::audioPlayProgress(const AudioMsgId &audioId) {
DocumentData *audio = audioId.audio;
QString filepath = audio->filepath(DocumentData::FilePathResolveSaveFromData);
if (!filepath.isEmpty()) {
psOpenFile(filepath);
if (documentIsValidMediaFile(filepath)) {
psOpenFile(filepath);
} else {
psShowInFolder(filepath);
}
}
}
@@ -1568,7 +1572,11 @@ void MainWidget::documentPlayProgress(const SongMsgId &songId) {
DocumentData *document = songId.song;
QString filepath = document->filepath(DocumentData::FilePathResolveSaveFromData);
if (!filepath.isEmpty()) {
psOpenFile(filepath);
if (documentIsValidMediaFile(filepath)) {
psOpenFile(filepath);
} else {
psShowInFolder(filepath);
}
}
}