Changeset View
Changeset View
Standalone View
Standalone View
ui/pageview.cpp
Show All 15 Lines | |||||
16 | * * | 16 | * * | ||
17 | * This program is free software; you can redistribute it and/or modify * | 17 | * This program is free software; you can redistribute it and/or modify * | ||
18 | * it under the terms of the GNU General Public License as published by * | 18 | * it under the terms of the GNU General Public License as published by * | ||
19 | * the Free Software Foundation; either version 2 of the License, or * | 19 | * the Free Software Foundation; either version 2 of the License, or * | ||
20 | * (at your option) any later version. * | 20 | * (at your option) any later version. * | ||
21 | ***************************************************************************/ | 21 | ***************************************************************************/ | ||
22 | 22 | | |||
23 | #include "pageview.h" | 23 | #include "pageview.h" | ||
24 | | ||||
25 | // qt/kde includes | 24 | // qt/kde includes | ||
26 | #include <qloggingcategory.h> | 25 | #include <qloggingcategory.h> | ||
27 | #include <qcursor.h> | 26 | #include <qcursor.h> | ||
28 | #include <qevent.h> | 27 | #include <qevent.h> | ||
29 | #include <qimage.h> | 28 | #include <qimage.h> | ||
30 | #include <qpainter.h> | 29 | #include <qpainter.h> | ||
31 | #include <qtimer.h> | 30 | #include <qtimer.h> | ||
32 | #include <qset.h> | 31 | #include <qset.h> | ||
▲ Show 20 Lines • Show All 4365 Lines • ▼ Show 20 Line(s) | 4393 | { | |||
4398 | const QString squeezedText = KStringHandler::rsqueeze( searchText, 21 ); | 4397 | const QString squeezedText = KStringHandler::rsqueeze( searchText, 21 ); | ||
4399 | webShortcutsMenu->setTitle( i18n( "Search for '%1' with", squeezedText ) ); | 4398 | webShortcutsMenu->setTitle( i18n( "Search for '%1' with", squeezedText ) ); | ||
4400 | 4399 | | |||
4401 | QAction *action = nullptr; | 4400 | QAction *action = nullptr; | ||
4402 | 4401 | | |||
4403 | foreach( const QString &searchProvider, searchProviders ) | 4402 | foreach( const QString &searchProvider, searchProviders ) | ||
4404 | { | 4403 | { | ||
4405 | action = new QAction( searchProvider, webShortcutsMenu ); | 4404 | action = new QAction( searchProvider, webShortcutsMenu ); | ||
4405 | | ||||
4406 | if (searchProvider == QLatin1String("Google")) | ||||
4407 | action->setIcon( QIcon::fromTheme( QStringLiteral("im-google") ) ); | ||||
4408 | else if (searchProvider == QLatin1String("Wikipedia - The Free Encyclopedia")) | ||||
4409 | action->setIcon( QIcon::fromTheme( QStringLiteral("text-wiki") ) ); | ||||
4410 | else if (searchProvider == QLatin1String("Yahoo")) | ||||
4411 | action->setIcon( QIcon::fromTheme( QStringLiteral("im-yahoo") ) ); | ||||
4412 | else if (searchProvider == QLatin1String("YouTube")) | ||||
4413 | action->setIcon( QIcon::fromTheme( QStringLiteral("im-youtube") ) ); | ||||
4414 | else | ||||
4406 | action->setIcon( QIcon::fromTheme( filterData.iconNameForPreferredSearchProvider( searchProvider ) ) ); | 4415 | action->setIcon( QIcon::fromTheme( filterData.iconNameForPreferredSearchProvider( searchProvider ) ) ); | ||
4416 | | ||||
4407 | action->setData( filterData.queryForPreferredSearchProvider( searchProvider ) ); | 4417 | action->setData( filterData.queryForPreferredSearchProvider( searchProvider ) ); | ||
4408 | connect( action, &QAction::triggered, this, &PageView::slotHandleWebShortcutAction ); | 4418 | connect( action, &QAction::triggered, this, &PageView::slotHandleWebShortcutAction ); | ||
4409 | webShortcutsMenu->addAction( action ); | 4419 | webShortcutsMenu->addAction( action ); | ||
4410 | } | 4420 | } | ||
4411 | 4421 | | |||
4412 | webShortcutsMenu->addSeparator(); | 4422 | webShortcutsMenu->addSeparator(); | ||
4413 | 4423 | | |||
4414 | action = new QAction( i18n( "Configure Web Shortcuts..." ), webShortcutsMenu ); | 4424 | action = new QAction( i18n( "Configure Web Shortcuts..." ), webShortcutsMenu ); | ||
▲ Show 20 Lines • Show All 1183 Lines • Show Last 20 Lines |