Move external video player option handling to SessionController::openDocument

This commit is contained in:
Ilya Fedin
2026-03-07 00:27:20 +00:00
committed by John Preston
parent f6ac2c5aa9
commit c2f64700c1
5 changed files with 22 additions and 19 deletions
@@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "data/data_document_resolver.h"
#include "base/options.h"
#include "base/platform/base_platform_info.h"
#include "boxes/abstract_box.h" // Ui::show().
#include "chat_helpers/ttl_media_layer_widget.h"
@@ -39,13 +38,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Data {
namespace {
base::options::toggle OptionExternalVideoPlayer({
.id = kOptionExternalVideoPlayer,
.name = "External video player",
.description = "Use system video player instead of the internal one. "
"This disabes video playback in messages.",
});
void ConfirmDontWarnBox(
not_null<Ui::GenericBox*> box,
rpl::producer<TextWithEntities> &&text,
@@ -153,8 +145,6 @@ void LaunchWithWarning(
} // namespace
const char kOptionExternalVideoPlayer[] = "external-video-player";
base::binary_guard ReadBackgroundImageAsync(
not_null<Data::DocumentMedia*> media,
FnMut<QImage(QImage)> postprocess,
@@ -199,11 +189,7 @@ void ResolveDocument(
const auto msgId = item ? item->fullId() : FullMsgId();
const auto showDocument = [&] {
if (OptionExternalVideoPlayer.value()
&& document->isVideoFile()
&& !document->filepath().isEmpty()) {
File::Launch(document->location(false).fname);
} else if (controller) {
if (controller) {
controller->openDocument(
document,
true,