summaryrefslogtreecommitdiff
path: root/src/urlbar/listitem.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-11-22 18:45:06 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-11-22 18:45:06 +0100
commitf0b2b230e1cd4d35f2a95c3bad94e31ecdd70de1 (patch)
tree2b5492ec5c976e75ec12f83e1e3d71989d3f0457 /src/urlbar/listitem.cpp
parentimprovements on urlbar (diff)
downloadrekonq-f0b2b230e1cd4d35f2a95c3bad94e31ecdd70de1.tar.xz
Fix some eventual crashes while clicking engine favicons
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r--src/urlbar/listitem.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 95d8cbb9..a1e3315c 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -355,7 +355,6 @@ void SearchListItem::changeSearchEngine(KService::Ptr engine)
// create a new item && load it...
UrlSuggestionItem item = UrlSuggestionItem(UrlSuggestionItem::Search, SearchEngine::buildQuery(engine, text), text);
-
SearchListItem sItem(item, text, this);
emit itemClicked(&sItem, Qt::LeftButton, Qt::NoModifier);
}
@@ -402,7 +401,10 @@ KAction *EngineBar::newEngineAction(KService::Ptr engine, KService::Ptr selected
KAction *a = new KAction(IconManager::self()->engineFavicon(url), engine->name(), this);
a->setCheckable(true);
- if (engine->desktopEntryName() == selectedEngine->desktopEntryName()) a->setChecked(true);
+ if (engine->desktopEntryName() == selectedEngine->desktopEntryName())
+ {
+ a->setChecked(true);
+ }
a->setData(engine->entryPath());
connect(a, SIGNAL(triggered(bool)), this, SLOT(changeSearchEngine()));
return a;
@@ -412,6 +414,8 @@ KAction *EngineBar::newEngineAction(KService::Ptr engine, KService::Ptr selected
void EngineBar::changeSearchEngine()
{
KAction *a = qobject_cast<KAction*>(sender());
+ if (!a)
+ return;
emit searchEngineChanged(KService::serviceByDesktopPath(a->data().toString()));
}