Review Request: KProtocolManager patch to allow componenets to define their own default user-agent string

Dawit Alemayehu adawit at
Tue Apr 13 15:18:41 BST 2010

This is an automatically generated e-mail. To reply, visit:

Review request for kdelibs.


The attached patch changes something that has been hard-coded into KProtocolManager from day one, most likely by myself ;) ; the default user agent string. As a result of this hard coding whenever one enters a url in Konqueror's location bar, the incorrect user-agent string will always be sent. That happens because Konqueror will always attempt to determine the mime-type of the request, specially for the http protocol (see KParts::BrowserRun::scanFile), in order to embed/use the appropriate component. Unfortunately this causes issues like the one described in bug # 231932.

Anyhow, the patch simply attempts to look for a property named "X-KDE-UA-DEFAULT-STRING" in the preferred service handler's .desktop file for the "text/html" mime-type and use that if it is available or default back to the old hard-coded default if not. This string can contain several keywords that will be replaced dynamically. See the patch for details.
I have also updated what information gets sent along with the default string to match the other major browsers. Before only the OS type was sent. With this patch OS type, platform, machine type and language information will be sent by default. Of course, this only affects what is set by default and can be changed back to the previous settings from the configuration dialog.

This addresses bug 231932.


  trunk/KDE/kdelibs/kio/kio/http_slave_defaults.h 1113359 
  trunk/KDE/kdelibs/kio/kio/kprotocolmanager.cpp 1113359 





More information about the kde-core-devel mailing list