Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kurifiltersearchprovideractions.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 88 | if (!searchProviders.isEmpty()) { | |||
---|---|---|---|---|---|
89 | QMenu *webShortcutsMenu = new QMenu(menu); | 89 | QMenu *webShortcutsMenu = new QMenu(menu); | ||
90 | webShortcutsMenu->setIcon(QIcon::fromTheme(QStringLiteral("preferences-web-browser-shortcuts"))); | 90 | webShortcutsMenu->setIcon(QIcon::fromTheme(QStringLiteral("preferences-web-browser-shortcuts"))); | ||
91 | 91 | | |||
92 | const QString squeezedText = KStringHandler::rsqueeze(searchText, 21); | 92 | const QString squeezedText = KStringHandler::rsqueeze(searchText, 21); | ||
93 | webShortcutsMenu->setTitle(i18n("Search for '%1' with", squeezedText)); | 93 | webShortcutsMenu->setTitle(i18n("Search for '%1' with", squeezedText)); | ||
94 | 94 | | |||
95 | QActionGroup *actionGroup = new QActionGroup(this); | 95 | QActionGroup *actionGroup = new QActionGroup(this); | ||
96 | connect(actionGroup, &QActionGroup::triggered, this, &KUriFilterSearchProviderActions::slotHandleWebShortcutAction); | 96 | connect(actionGroup, &QActionGroup::triggered, this, &KUriFilterSearchProviderActions::slotHandleWebShortcutAction); | ||
97 | Q_FOREACH (const QString &searchProvider, searchProviders) { | 97 | for (const QString &searchProvider : searchProviders) { | ||
98 | QAction *action = new QAction(i18nc("@action:inmenu Search for <text> with", "%1", searchProvider), webShortcutsMenu); | 98 | QAction *action = new QAction(i18nc("@action:inmenu Search for <text> with", "%1", searchProvider), webShortcutsMenu); | ||
99 | action->setIcon(QIcon::fromTheme(filterData.iconNameForPreferredSearchProvider(searchProvider))); | 99 | action->setIcon(QIcon::fromTheme(filterData.iconNameForPreferredSearchProvider(searchProvider))); | ||
100 | action->setData(filterData.queryForPreferredSearchProvider(searchProvider)); | 100 | action->setData(filterData.queryForPreferredSearchProvider(searchProvider)); | ||
101 | webShortcutsMenu->addAction(action); | 101 | webShortcutsMenu->addAction(action); | ||
102 | actionGroup->addAction(action); | 102 | actionGroup->addAction(action); | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | if (!QStandardPaths::findExecutable(QStringLiteral("kcmshell5")).isEmpty()) { | 105 | if (!QStandardPaths::findExecutable(QStringLiteral("kcmshell5")).isEmpty()) { | ||
Show All 19 Lines |