From a8947aaad876bfdf8c5b2234ef300ef790112b61 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 8 Aug 2022 09:49:51 +0200 Subject: [PATCH] Amend 9e645a5cfc9d6c3e66d Only show "System Default" if auto-open is available for the current format. --- src/frontends/qt/GuiPrefs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index e607471299..5fa3b940d4 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -2325,7 +2325,8 @@ void PrefFileformats::updateViewers() viewerCO->blockSignals(true); viewerCO->clear(); viewerCO->addItem(qt_("None"), QString()); - viewerCO->addItem(qt_("System Default"), QString("auto")); + if (os::canAutoOpenFile(f.extension(), os::VIEW)) + viewerCO->addItem(qt_("System Default"), QString("auto")); updateComboBox(viewer_alternatives, f.name(), viewerCO); viewerCO->addItem(qt_("Custom"), QString("custom viewer")); viewerCO->blockSignals(false); @@ -2349,7 +2350,8 @@ void PrefFileformats::updateEditors() editorCO->blockSignals(true); editorCO->clear(); editorCO->addItem(qt_("None"), QString()); - editorCO->addItem(qt_("System Default"), QString("auto")); + if (os::canAutoOpenFile(f.extension(), os::EDIT)) + editorCO->addItem(qt_("System Default"), QString("auto")); updateComboBox(editor_alternatives, f.name(), editorCO); editorCO->addItem(qt_("Custom"), QString("custom editor")); editorCO->blockSignals(false);