Make kfmclient honor the user configured browser settings for local resources
Review Request #103524 - Created Dec. 24, 2011 and discarded
The attached patch changes kfmclient so that it * honors the user configured browser setting when the specified URL is a local page that is to be handled by a browser. * honors the user configured browser setting when the user specified url is ftp.
Change the browser in the default application list to "firefox" and make sure all of the following commands open the URL in firefox: * kfmclient openURL http://www.kde.org * kfmclient openURL /usr/share/doc/qt/html/index.html * kfmclient openURL ftp://ftp.kde.org
|The code later on uses "new KRun" for the case of a user-defined browser, given that KRun can handle that. ...||David Faure|
FTP requires a file manager, not a web browser. You get a much better experience with a FTP url in e.g. dolphin than in firefox, IMHO. Using web browsers for FTP urls is a historic relic from before proper network transparency in file managers.
The naming is confusing. From the code, this method really checks if konqueror is the preferred service, right? In fact this sounds very much like KonqMainWindow::isMimeTypeAssociatedWithSelf(mimetype). Not that you can call that method, but you could compare the implementations, and call this isMimeTypeAssociatedWithKonqueror here, or better, isKonquerorPreferred.
The check for == 100 seems too strict to me, you get 80 in many cases, iirc. In fact I'm thinking of removing the accuracy stuff in qt5, because there's no good way of doing something with that number...
The code later on uses "new KRun" for the case of a user-defined browser, given that KRun can handle that. Why not factorize this and call that code for local files too? It would make the code shorter and easier to maintain.