From 98bed93b35be1308bd3d559f88574ab694298519 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 8 Oct 2009 00:48:09 +0200 Subject: fixing right click rekonq crash (at least, hopefully..) --- src/webview.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/webview.cpp b/src/webview.cpp index ac6f4566..1c46041c 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -184,13 +184,16 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) if(!engine.isEmpty()) { service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine)); - const QString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; // FIXME crashed - data.setData(searchProviderPrefix + "some keyword"); - a = new KAction(service->name(), this); - a->setIcon(Application::icon(KUrl(data.uri()))); - a->setData(searchProviderPrefix); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotSearch())); - searchMenu->addAction(a); + if(service) + { + const QString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; + data.setData(searchProviderPrefix + "some keyword"); + a = new KAction(service->name(), this); + a->setIcon(Application::icon(KUrl(data.uri()))); + a->setData(searchProviderPrefix); + connect(a, SIGNAL(triggered(bool)), this, SLOT(slotSearch())); + searchMenu->addAction(a); + } } } -- cgit v1.2.1