Right now we hardcode DuckDuckGo, which ignores the user's preference
and doesn't work in Indonesia, where it's currently blocked.
Instead, get the actual configured default search engine, which the user
can change if desired or needed.
BUG: 502908
FIXED-IN: 6.4.0
Gbp-Pq: Name upstream_1e71f6c7_Respect-systemwide-default-search-engine.patch
KF6::I18n
KF6::ConfigGui
KF6::KIOCore
+ KF6::KIOGui
KF6::WindowSystem
KF6::Notifications
KF6::JobWidgets
#include <KSharedConfig>
#include <KStatusNotifierItem>
#include <KUiServerV2JobTracker>
+#include <KUriFilter>
#include <kcoreaddons_version.h>
// #include <KSwitchLanguageDialog>
clipboard->setText(text);
}
+QUrl DiscoverObject::searchUrl(const QString searchText)
+{
+ KUriFilterData filterData(searchText);
+ if (KUriFilter::self()->filterSearchUri(filterData, KUriFilter::NormalTextFilter)) {
+ return filterData.uri();
+ }
+ return {};
+}
+
void DiscoverObject::setAboutToPowerOff()
{
for (auto backend : ResourcesModel::global()->backends()) {
QQuickWindow *mainWindow() const;
void showError(const QString &msg);
Q_INVOKABLE void copyTextToClipboard(const QString text);
+ Q_INVOKABLE QUrl searchUrl(const QString searchText);
QString describeSources() const;
Q_SCRIPTABLE void restore();
icon.name: "internet-web-browser"
onTriggered: {
const searchTerm = encodeURIComponent("Linux " + appsModel.search);
- Qt.openUrlExternally(i18nc("If appropriate, localize this URL to be something more relevant to the language. %1 is the text that will be searched for.", "https://duckduckgo.com/?q=%1", searchTerm));
+ Qt.openUrlExternally(app.searchUrl(searchTerm));
}
}