diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2013-11-19 16:39:13 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2013-11-19 17:41:31 +0100 |
commit | 4ff1ef46d5a03e1fe19619ce41070c70a517d41d (patch) | |
tree | 5bd3532aad1d958e6737b620b73ff4f53ceafc7b | |
parent | Adopt a new loading icon. It seems fixing some problems :) (diff) | |
download | rekonq-4ff1ef46d5a03e1fe19619ce41070c70a517d41d.tar.xz |
improvement on urlbar suggestions
STEP 1: clean up!
- remember deleting ASAP the UrlSuggester
- remove preview label icon to let loading being faster
- remove unused opensearch inventories
- let ESC key on suggestions behave like major browser
(restoring original string)
-rw-r--r-- | src/data/CMakeLists.txt | 21 | ||||
-rw-r--r-- | src/data/beolingus.xml | 8 | ||||
-rw-r--r-- | src/data/bing.xml | 8 | ||||
-rw-r--r-- | src/data/db_opensearch.json | 67 | ||||
-rw-r--r-- | src/data/de2en.xml | 8 | ||||
-rw-r--r-- | src/data/dictfr.xml | 8 | ||||
-rw-r--r-- | src/data/facebook.xml | 8 | ||||
-rw-r--r-- | src/data/google.xml | 9 | ||||
-rw-r--r-- | src/data/kde_techbase.xml | 8 | ||||
-rw-r--r-- | src/data/kde_userbase.xml | 8 | ||||
-rw-r--r-- | src/data/voila.xml | 8 | ||||
-rw-r--r-- | src/data/wikia.xml | 8 | ||||
-rw-r--r-- | src/data/wikipedia.xml | 8 | ||||
-rw-r--r-- | src/data/wiktionary.xml | 8 | ||||
-rw-r--r-- | src/data/wr_english.xml | 6 | ||||
-rw-r--r-- | src/data/yahoo.xml | 8 | ||||
-rw-r--r-- | src/data/youtube.xml | 7 | ||||
-rw-r--r-- | src/urlbar/completionwidget.cpp | 6 | ||||
-rw-r--r-- | src/urlbar/listitem.cpp | 122 | ||||
-rw-r--r-- | src/urlbar/listitem.h | 56 | ||||
-rw-r--r-- | src/urlbar/urlsuggester.h | 19 |
21 files changed, 14 insertions, 395 deletions
diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt index 1b6f2ca8..cda545f0 100644 --- a/src/data/CMakeLists.txt +++ b/src/data/CMakeLists.txt @@ -43,24 +43,3 @@ INSTALL( DESTINATION ${DATA_INSTALL_DIR}/rekonq ) -# opensearch engines -INSTALL( - FILES - beolingus.xml - bing.xml - yahoo.xml - de2en.xml - dictfr.xml - facebook.xml - google.xml - kde_techbase.xml - kde_userbase.xml - youtube.xml - voila.xml - wikia.xml - wikipedia.xml - wiktionary.xml - wr_english.xml - db_opensearch.json - DESTINATION ${DATA_INSTALL_DIR}/rekonq/opensearch -) diff --git a/src/data/beolingus.xml b/src/data/beolingus.xml deleted file mode 100644 index 60901163..00000000 --- a/src/data/beolingus.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>De-En Beolingus</ShortName> - <Description>Beolingus: German-English Dictionary</Description> - <Url method="get" template="http://dict.tu-chemnitz.de/?query={searchTerms}"/> - <Url method="get" type="application/x-suggestions+json" template="http://dict.tu-chemnitz.de/sugg.php?json=1;s={searchTerms}"/> - <Image>http://dict.tu-chemnitz.de/pics/beo-de.png</Image> -</OpenSearchDescription> diff --git a/src/data/bing.xml b/src/data/bing.xml deleted file mode 100644 index 5c18a651..00000000 --- a/src/data/bing.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Bing</ShortName> - <Description>Use the Bing Decision Engine to search the Web.</Description> - <Url method="get" type="text/html" template="http://www.bing.com/search?q={searchTerms}&FORM=MO0001"/> - <Url method="get" type="application/x-suggestions+xml" template="http://api.search.live.com/qsml.aspx?query={searchTerms}"/> - <Image width="16" height="16">http://www.bing.com/s/wlflag.ico</Image> -</OpenSearchDescription> diff --git a/src/data/db_opensearch.json b/src/data/db_opensearch.json deleted file mode 100644 index 16fc3f89..00000000 --- a/src/data/db_opensearch.json +++ /dev/null @@ -1,67 +0,0 @@ -[["http://www.7digital.com/osd.xml","7digital"], -["http://dict.tu-chemnitz.de/de-en/opensearch.xml","beolingus"], -["http://www.blip.tv/opensearch.xml","blip"], -["http://b.static.ak.fbcdn.net/rsrc.php/zJ/r/H2SSvhJMJA-.xml","facebook"], -["http://www.flickr.com/opensearch.xml","flickr"], -["https://github.com/opensearch.xml","github"], -["https://bugs.kde.org/search_plugin.cgi","bugft"], -["http://st.pimg.net/tucs/opensearch.xml","cpan"], - -["http://citeseerx.ist.psu.edu/search_plugins/citeseerx_general.xml","citeseerx"], -["http://citeseerx.ist.psu.edu/search_plugins/citeseerx_authorl.xml","citeseerx"], -["http://citeseerx.ist.psu.edu/search_plugins/citeseerx_title.xml","citeseerx"], - -["http://identi.ca/opensearch/people","identica_people"], -["http://identi.ca/opensearch/notice","identica_notices"], - -["http://www.cnrtl.fr/portail/opensearch.xml","dictfr"], - -["http://www.youtube.com/opensearch?locale=en_GB","youtube"], -["http://static1.urbandictionary.com/osd.xml?1292027099","urbandictionary"], - -["http://www.wordreference.com/tools/OpenSearch/enes.xml","en2es"], -["http://www.wordreference.com/tools/OpenSearch/esen.xml","es2en"], -["http://www.wordreference.com/tools/OpenSearch/enfr.xml","en2fr"], -["http://www.wordreference.com/tools/OpenSearch/fren.xml","fr2en"], -["http://www.wordreference.com/tools/OpenSearch/enit.xml","en2it"], -["http://www.wordreference.com/tools/OpenSearch/iten.xml","it2en"], -["http://www.wordreference.com/tools/OpenSearch/definition.xml","wordref"], -["http://dict.tu-chemnitz.de/de-en/opensearch.xml","de2en"], -["http://www.dict.cc/opensearch.xml","en2de"], -["http://dict.leo.org/plugins/Shared/Searches/leo_frde_de.xml","fr2de"], -["http://dict.leo.org/plugins/Shared/Searches/leo_ende_de.xml","leo"], - -["http://opensearch.search.ke.voila.fr/voila.xml","voila"], -["http://www.wikia.com/opensearch_desc.php","wikia"], - -["http://techbase.kde.org/opensearch_desc.php","kde_techbase"], -["http://userbase.kde.org/opensearch_desc.php","kde_userbase"], - -["http://duckduckgo.com/opensearch.xml","duckduckgo"], - -["http://ecosia.org/_files/searchplugin.xml","ecosia"], - -["http://fr.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://en.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://it.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://de.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://es.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://nl.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://pl.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://ja.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://ru.wikipedia.org/w/opensearch_desc.php","wikipedia"], -["http://pt.wikipedia.org/w/opensearch_desc.php","wikipedia"], - -["http://fr.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://en.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://it.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://de.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://es.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://nl.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://pl.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://ja.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://ru.wiktionary.org/w/opensearch_desc.php","wiktionary"], -["http://pt.wiktionary.org/w/opensearch_desc.php","wiktionary"], - -["http://search.yippy.com/search?v:project=opensearch-desc&v:frame=form&","yippy"], -["http://www.wolframalpha.com/searchDescription.xml","wolfram_alpha"]]
\ No newline at end of file diff --git a/src/data/de2en.xml b/src/data/de2en.xml deleted file mode 100644 index 60901163..00000000 --- a/src/data/de2en.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>De-En Beolingus</ShortName> - <Description>Beolingus: German-English Dictionary</Description> - <Url method="get" template="http://dict.tu-chemnitz.de/?query={searchTerms}"/> - <Url method="get" type="application/x-suggestions+json" template="http://dict.tu-chemnitz.de/sugg.php?json=1;s={searchTerms}"/> - <Image>http://dict.tu-chemnitz.de/pics/beo-de.png</Image> -</OpenSearchDescription> diff --git a/src/data/dictfr.xml b/src/data/dictfr.xml deleted file mode 100644 index 64e90ea3..00000000 --- a/src/data/dictfr.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Portail Lexical - CNRTL</ShortName> - <Description>Cherche dans le TLF sur le portail lexical du CNRTL</Description> - <Url method="get" template="http://www.cnrtl.fr/definition/{searchTerms}"/> - <Url method="get" type="application/x-suggestions+json" template="http://www.cnrtl.fr/utilities/OPEN?query={searchTerms}"/> - <Image>http://www.cnrtl.fr/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/facebook.xml b/src/data/facebook.xml deleted file mode 100644 index 612e7cd0..00000000 --- a/src/data/facebook.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Facebook</ShortName> - <Description>Search Facebook</Description> - <Url method="get" template="http://www.facebook.com/search/?src=os&q={searchTerms}"/> - <Url method="get" type="application/x-suggestions+xml" template="http://www.facebook.com/search/opensearch_typeahead.php?format=xml&q={searchTerms}"/> - <Image>http://www.facebook.com/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/google.xml b/src/data/google.xml deleted file mode 100644 index 622a0737..00000000 --- a/src/data/google.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Google</ShortName> - <Description>Google Web Search</Description> - <Url method="get" type="text/html" template="http://www.google.com/search?hl={language}&lr=lang_{language}&q={searchTerms}"/> - <Url method="get" type="application/x-suggestions+json" template="http://suggestqueries.google.com/complete/search?json=t&hl={language}&q={searchTerms}&nolabels=t"/> - <Image width="16" height="16">http://www.google.com/favicon.ico</Image> -</OpenSearchDescription> - diff --git a/src/data/kde_techbase.xml b/src/data/kde_techbase.xml deleted file mode 100644 index 25fc6e4c..00000000 --- a/src/data/kde_techbase.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>KDE TechBase (en)</ShortName> - <Description>KDE TechBase (en)</Description> - <Url method="get" template="http://techbase.kde.org/index.php?title=Special:Search&search={searchTerms}"/> - <Url method="get" type="application/x-suggestions+xml" template="http://techbase.kde.org/api.php?action=opensearch&format=xml&search={searchTerms}&namespace=0"/> - <Image>http://techbase.kde.org/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/kde_userbase.xml b/src/data/kde_userbase.xml deleted file mode 100644 index 64877019..00000000 --- a/src/data/kde_userbase.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>KDE UserBase (en)</ShortName> - <Description>KDE UserBase (en)</Description> - <Url method="get" template="http://userbase.kde.org/index.php?title=Special:Search&search={searchTerms}"/> - <Url method="get" type="application/x-suggestions+xml" template="http://userbase.kde.org/api.php?action=opensearch&format=xml&search={searchTerms}&namespace=0"/> - <Image>http://userbase.kde.org/favicon.png</Image> -</OpenSearchDescription> diff --git a/src/data/voila.xml b/src/data/voila.xml deleted file mode 100644 index 55780275..00000000 --- a/src/data/voila.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Voila</ShortName> - <Description>Moteur de recherche Voila</Description> - <Url method="get" template="http://rws.search.ke.voila.fr/RW/S/opensearch_voila?rdata={searchTerms}"/> - <Url method="get" type="application/x-suggestions+json" template="http://search.ke.voila.fr/fr/cmplopensearch/xml/fullxml?rdata={searchTerms}&amp;id=1&amp;dtd=2.0"/> - <Image>http://www.voila.fr/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/wikia.xml b/src/data/wikia.xml deleted file mode 100644 index 0a1eac69..00000000 --- a/src/data/wikia.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Wikia (en)</ShortName> - <Description>Wikia (en)</Description> - <Url method="get" template="http://www.wikia.com/index.php?title=Special:Search&search={searchTerms}"/> - <Url method="get" type="application/x-suggestions+json" template="http://www.wikia.com/api.php?action=opensearch&search={searchTerms}&namespace=1"/> - <Image>http://images.wikia.com/wikiaglobal/images/6/64/Favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/wikipedia.xml b/src/data/wikipedia.xml deleted file mode 100644 index 9f9bdda4..00000000 --- a/src/data/wikipedia.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Wikipedia</ShortName> - <Description>Wikipedia</Description> - <Url method="get" template="http://{country}.wikipedia.org/w/index.php?title=Sp%C3%A9cial:Recherche&search={searchTerms}"/> - <Url method="get" type="application/x-suggestions+xml" template="http://{country}.wikipedia.org/w/api.php?action=opensearch&format=xml&search={searchTerms}&namespace=0"/> - <Image>http://en.wikipedia.org/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/wiktionary.xml b/src/data/wiktionary.xml deleted file mode 100644 index 033f5b9e..00000000 --- a/src/data/wiktionary.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Wiktionary</ShortName> - <Description>Wiktionary</Description> - <Url method="get" template="http://{country}.wiktionary.org/w/index.php?title=Special:Search&search={searchTerms}"/> - <Url method="get" type="application/x-suggestions+xml" template="http://{country}.wiktionary.org/w/api.php?action=opensearch&format=xml&search={searchTerms}&namespace=0"/> - <Image>http://en.wiktionary.org/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/wr_english.xml b/src/data/wr_english.xml deleted file mode 100644 index 30c9339b..00000000 --- a/src/data/wr_english.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>WR English</ShortName> - <Description>WordReference monolingual English dictionary search</Description> - <Url method="get" template="http://www.wordreference.com/definition/{searchTerms}"/> -</OpenSearchDescription> diff --git a/src/data/yahoo.xml b/src/data/yahoo.xml deleted file mode 100644 index d769ef25..00000000 --- a/src/data/yahoo.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Yahoo!</ShortName> - <Description>Yahoo! Web Search</Description> - <Url method="get" type="text/html" template="http://{country}.search.yahoo.com/search?p={searchTerms}&ie=utf-8"/> - <Url method="get" type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command={searchTerms}"/> - <Image width="16" height="16">http://www.yahoo.com/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/data/youtube.xml b/src/data/youtube.xml deleted file mode 100644 index 1fa8338a..00000000 --- a/src/data/youtube.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>Recherche de vidéos YouTube</ShortName> - <Description>Recherche de vidéos sur YouTube</Description> - <Url method="get" template="http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"/> - <Image>http://www.youtube.com/favicon.ico</Image> -</OpenSearchDescription> diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp index f745afae..b7a7bfdb 100644 --- a/src/urlbar/completionwidget.cpp +++ b/src/urlbar/completionwidget.cpp @@ -334,6 +334,10 @@ bool CompletionWidget::eventFilter(QObject *obj, QEvent *ev) } case Qt::Key_Escape: hide(); + + w = qobject_cast<UrlBar *>(parent()); + w->setText(_typedString); + return true; } } @@ -400,6 +404,8 @@ void CompletionWidget::suggestUrls(const QString &text) // NOTE: It's important to call this AFTER orderedSearchItems() to let everything work res->computeSuggestions(); + + delete res; } diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index 02605167..b8b980c6 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -344,14 +344,6 @@ PreviewListItem::PreviewListItem(const UrlSuggestionItem &item, const QString &t vLayout->addWidget(new TextLabel("<i>" + item.url + "</i>", text, this)); hLayout->addLayout(vLayout); - // preview label icon - QLabel *previewLabelIcon = new QLabel(this); - previewLabelIcon->setFixedSize(45, 33); - new PreviewLabel(item.url, 38, 29, previewLabelIcon); - IconLabel* icon = new IconLabel(item.url, previewLabelIcon); - icon->move(27, 16); - hLayout->addWidget(previewLabelIcon); - setLayout(hLayout); } @@ -359,67 +351,6 @@ PreviewListItem::PreviewListItem(const UrlSuggestionItem &item, const QString &t // --------------------------------------------------------------- -PreviewLabel::PreviewLabel(const QString &url, int width, int height, QWidget *parent) - : QLabel(parent) -{ - setFixedSize(width, height); - setFrameStyle(QFrame::StyledPanel | QFrame::Raised); - - KUrl u = KUrl(url); - if (WebSnap::existsImage(KUrl(u))) - { - QPixmap preview; - preview.load(WebSnap::imagePathFromUrl(u)); - setPixmap(preview.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - } -} - - -// --------------------------------------------------------------- - - -ImageLabel::ImageLabel(const QString &url, int width, int height, QWidget *parent) - : QLabel(parent), - m_url(url) -{ - setFixedSize(width, height); - if (WebSnap::existsImage(KUrl(url))) - { - QPixmap pix; - pix.load(WebSnap::imagePathFromUrl(url)); - setPixmap(pix); - } - else - { - KIO::TransferJob *job = KIO::get(KUrl(url), KIO::NoReload, KIO::HideProgressInfo); - connect(job, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(slotData(KJob*,QByteArray))); - connect(job, SIGNAL(result(KJob*)), - this, SLOT(slotResult(KJob*))); - } -} - - -void ImageLabel::slotData(KJob *job, const QByteArray &data) -{ - Q_UNUSED(job); - m_data.append(data); -} - - -void ImageLabel::slotResult(KJob *) -{ - QPixmap pix; - if (!pix.loadFromData(m_data)) - kDebug() << "error while loading image: "; - setPixmap(pix); - pix.save(WebSnap::imagePathFromUrl(m_url), "PNG"); -} - - -// --------------------------------------------------------------- - - SearchListItem::SearchListItem(const UrlSuggestionItem &item, const QString &text, QWidget *parent) : ListItem(item, parent) , m_text(text) @@ -590,52 +521,6 @@ QString SuggestionListItem::text() // --------------------------------------------------------------- -VisualSuggestionListItem::VisualSuggestionListItem(const UrlSuggestionItem &item, const QString &text, QWidget *parent) - : ListItem(item, parent) - , m_text(item.title) -{ - - QHBoxLayout *hLayout = new QHBoxLayout; - hLayout->setSpacing(4); - QLabel *previewLabelIcon = new QLabel(this); - - if (!item.image.isEmpty()) - { - previewLabelIcon->setFixedSize(item.image_width + 10, item.image_height + 10); - new ImageLabel(item.image, item.image_width, item.image_height, previewLabelIcon); - IconLabel* icon = new IconLabel(item.url, previewLabelIcon); - icon->move(item.image_width - 10, item.image_height - 10); - } - else - { - previewLabelIcon->setFixedSize(18, 18); - new IconLabel(item.url, previewLabelIcon); - } - - hLayout->addWidget(previewLabelIcon); - QVBoxLayout *vLayout = new QVBoxLayout; - vLayout->setMargin(0); - vLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::MinimumExpanding)); - vLayout->addWidget(new TextLabel(item.title, text, this)); - DescriptionLabel *d = new DescriptionLabel("", this); - vLayout->addWidget(d); - vLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::MinimumExpanding)); - hLayout->addLayout(vLayout); - hLayout->addWidget(new TypeIconLabel(item.type, this)); - setLayout(hLayout); - d->setText("<i>" + item.description + "</i>"); -} - - -QString VisualSuggestionListItem::text() -{ - return m_text; -} - - -// --------------------------------------------------------------- - - BrowseListItem::BrowseListItem(const UrlSuggestionItem &item, const QString &text, QWidget *parent) : ListItem(item, parent) { @@ -676,12 +561,7 @@ ListItem *ListItemFactory::create(const UrlSuggestionItem &item, const QString & if (item.type & UrlSuggestionItem::Suggestion) { - if (item.description.isEmpty()) - { - return new SuggestionListItem(item, text, parent); - } - - return new VisualSuggestionListItem(item, text, parent); + return new SuggestionListItem(item, text, parent); } return new PreviewListItem(item, text, parent); diff --git a/src/urlbar/listitem.h b/src/urlbar/listitem.h index 54bff109..f34da334 100644 --- a/src/urlbar/listitem.h +++ b/src/urlbar/listitem.h @@ -97,7 +97,7 @@ class REKONQ_TESTS_EXPORT TypeIconLabel : public QLabel public: explicit TypeIconLabel(int type, QWidget *parent = 0); - + private: QLabel *getIcon(QString icon); }; @@ -126,10 +126,11 @@ class REKONQ_TESTS_EXPORT TextLabel : public QLabel public: explicit TextLabel(const QString &text, const QString &textToPointOut = QString(), QWidget *parent = 0); explicit TextLabel(QWidget *parent = 0); - + void setEngineText(const QString &engine, const QString &text); }; + // ------------------------------------------------------------------------- @@ -151,6 +152,7 @@ class REKONQ_TESTS_EXPORT EngineBar : public KToolBar public: explicit EngineBar(KService::Ptr selectedEngine, QWidget *parent = 0); + void selectNextEngine(); Q_SIGNALS: @@ -175,6 +177,7 @@ class REKONQ_TESTS_EXPORT SearchListItem : public ListItem public: explicit SearchListItem(const UrlSuggestionItem &item, const QString &text, QWidget *parent = 0); + QString text(); public Q_SLOTS: @@ -201,22 +204,7 @@ class REKONQ_TESTS_EXPORT SuggestionListItem : public ListItem public: SuggestionListItem(const UrlSuggestionItem &item, const QString &text, QWidget *parent = 0); - QString text(); - -private: - QString m_text; -}; - - -// ------------------------------------------------------------------------- - - -class REKONQ_TESTS_EXPORT VisualSuggestionListItem : public ListItem -{ - Q_OBJECT - -public: - VisualSuggestionListItem(const UrlSuggestionItem &item, const QString &text, QWidget *parent = 0); + QString text(); private: @@ -239,38 +227,6 @@ public: // ------------------------------------------------------------------------- -class REKONQ_TESTS_EXPORT PreviewLabel : public QLabel -{ - Q_OBJECT - -public: - PreviewLabel(const QString &url, int width, int height, QWidget *parent = 0); -}; - - -// ------------------------------------------------------------------------- - - -class REKONQ_TESTS_EXPORT ImageLabel : public QLabel -{ - Q_OBJECT - -public: - ImageLabel(const QString &url, int width, int height, QWidget *parent); - -private: - QString m_url; - QByteArray m_data; - -private Q_SLOTS: - void slotData(KJob* job, const QByteArray& data); - void slotResult(KJob* job); -}; - - -// ------------------------------------------------------------------------- - - class REKONQ_TESTS_EXPORT BrowseListItem : public ListItem { Q_OBJECT diff --git a/src/urlbar/urlsuggester.h b/src/urlbar/urlsuggester.h index a5914504..14df59fc 100644 --- a/src/urlbar/urlsuggester.h +++ b/src/urlbar/urlsuggester.h @@ -58,9 +58,6 @@ public: QString url; QString title; QString description; - QString image; - int image_width; - int image_height; QString bookmarkPath; UrlSuggestionItem(const UrlSuggestionItem &item) @@ -68,9 +65,6 @@ public: , url(item.url) , title(item.title) , description(item.description) - , image(item.image) - , image_width(item.image_width) - , image_height(item.image_height) {}; UrlSuggestionItem() @@ -78,26 +72,17 @@ public: , url(QString()) , title(QString()) , description(QString()) - , image(QString()) - , image_width(0) - , image_height(0) {}; UrlSuggestionItem(const int &_type, const QString &_url, const QString &_title = QString(), - const QString &_description = QString(), - const QString &_image = QString(), - const int &_image_width = 0, - const int &_image_height = 0 + const QString &_description = QString() ) : type(_type) , url(_url) , title(_title) , description(_description) - , image(_image) - , image_width(_image_width) - , image_height(_image_height) {}; inline bool operator==(const UrlSuggestionItem &i) const @@ -113,8 +98,6 @@ typedef QList <UrlSuggestionItem> UrlSuggestionList; // ---------------------------------------------------------------------- - - class UrlSuggester : public QObject { Q_OBJECT |