diff --git a/kcms/componentchooser/browserconfig_ui.ui b/kcms/componentchooser/browserconfig_ui.ui --- a/kcms/componentchooser/browserconfig_ui.ui +++ b/kcms/componentchooser/browserconfig_ui.ui @@ -30,16 +30,6 @@ - - - - in an application based on the contents of the URL - - - true - - - diff --git a/kcms/componentchooser/componentchooserbrowser.cpp b/kcms/componentchooser/componentchooserbrowser.cpp --- a/kcms/componentchooser/componentchooserbrowser.cpp +++ b/kcms/componentchooser/componentchooserbrowser.cpp @@ -31,7 +31,6 @@ { setupUi(this); connect(lineExec, &KLineEdit::textChanged, this, &CfgBrowser::configChanged); - connect(radioKIO, &QRadioButton::toggled, this, &CfgBrowser::configChanged); connect(radioService, &QRadioButton::toggled, this, &CfgBrowser::selectBrowserApp); connect(browserCombo, static_cast(&QComboBox::activated), this, &CfgBrowser::selectBrowserApp); connect(radioExec, &QRadioButton::toggled, this, &CfgBrowser::configChanged); @@ -61,12 +60,27 @@ void CfgBrowser::load(KConfig *) { + browserCombo->clear(); + const auto &browsers = KServiceTypeTrader::self()->query(QStringLiteral("Application"), + QStringLiteral("'WebBrowser' in Categories")); + for (const auto &service : browsers) { + browserCombo->addItem(QIcon::fromTheme(service->icon()), service->name(), service->storageId()); + + if ((m_browserService && m_browserService->storageId() == service->storageId()) || service->exec() == m_browserExec) { + browserCombo->setCurrentIndex(browserCombo->count() - 1); + radioService->setChecked(true); + } + } + const KConfigGroup config(KSharedConfig::openConfig(QStringLiteral("kdeglobals")), QStringLiteral("General") ); const QString exec = config.readPathEntry( QStringLiteral("BrowserApplication"), QString() ); if (exec.isEmpty()) { - radioKIO->setChecked(true); - m_browserExec = exec; - m_browserService = nullptr; + radioService->setChecked(true); + if (browserCombo->count() > 0) { + const QString &storageId = browserCombo->currentData().toString(); + m_browserService = KService::serviceByStorageId(storageId); + m_browserExec.clear(); + } } else { radioExec->setChecked(true); if (exec.startsWith('!')) { @@ -84,19 +98,6 @@ lineExec->setText(m_browserExec); - browserCombo->clear(); - - const auto &browsers = KServiceTypeTrader::self()->query(QStringLiteral("Application"), - QStringLiteral("'WebBrowser' in Categories")); - for (const auto &service : browsers) { - browserCombo->addItem(QIcon::fromTheme(service->icon()), service->name(), service->storageId()); - - if ((m_browserService && m_browserService->storageId() == service->storageId()) || service->exec() == m_browserExec) { - browserCombo->setCurrentIndex(browserCombo->count() - 1); - radioService->setChecked(true); - } - } - emit changed(false); }