[rekonq] Segfault after selecting nonexisting searchEngine

Benjamin Poulain benjamin.poulain at nokia.com
Fri May 21 14:22:44 CEST 2010


Zellner Johannes (Nokia-D/Munich) wrote:
+    if (!engine) return "";

Please use the default constructor of QString() instead of the implicit 
constructor with the string "". By using "", you will go through an 
unnecessary code path of encoding the string, with QString() Qt simply 
use the shared null string.


+    service = 
KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(engine));

You should probably use QString::fromLatin1() instead of the constructor 
QString("").


For the two if-else, Qt coding style forbid single line branching. KDE 
has the same rule IIRC.


 > I just enabled "wolfram" searchengine and got a segfault, since the
 > corresponding desktop file for this service is not installed.

Should "wolfram" be in the list of search engine when the service is not 
installed?

cheers,
Benjamin


More information about the rekonq mailing list