Skip to content
  • Jonathan Marten's avatar
    kfmclient: Fix recursive invocation and handle association correctly · 779c1f43
    Jonathan Marten authored and Stefano Crocco's avatar Stefano Crocco committed
    If 'kcmshell5 componentchooser' is used to set the default web
    browser to Konqueror, then as well as changing the text/html file
    association it sets [General]BrowserApplication=kfmclient_html.desktop
    in kdeglobals.  ClientApp::createNewWindow() looks to see whether this
    setting is present, but actually ignores its value and simply opens
    the original URL via an OpenUrlJob.  The file type association then
    calls kfmclient again and loops endlessly.
    
    Split up the complicated test to handle the two cases appropriately:
    either launching the external browser (setting starting with a '!')
    using a CommandLauncherJob, or starting the service (setting not
    starting with '!') using an ApplicationLauncherJob.  Check in both
    of these code paths that kfmclient would not be called recursively.
    If this happens, or if the setting is absent or there are problems
    launching the job, then fall through to opening the URL in Konqueror
    directly.  This means that it cannot loop and the URL is opened in
    the intended application.
    779c1f43