Skip to content

When finding a job delegate extension, also try the uiDelegate() of its parent

Ahmad Samir requested to merge work/ahmad/composite-delegate into master

A use case for this is an OpenUrlJob, urlJob, that has a KIO::JobUiDelegate, it tries to open a .desktop file, and ends up creating an ApplicationLauncherJob subjob, appJob:

  • calling appJob->setUiDelegate(urlJob->uiDelegate()) won't work because the uiDelegate() of urlJob is already tracking a job
  • creating a new, basic, KJobUiDelegate for appJob won't work because we need a KIO::JobUiDelegate (e.g. to get a untrustedProgramInterface if the .desktop file isn't owned by root and isn't executable), however KIO::JobUiDelegate is in KIOWidgets and those jobs are in KIOGui

Instead, change KIO::delegateExtension() to check the uiDelegate() of the parent of its KJob arg.

BUG: 436049

Edited by Ahmad Samir

Merge request reports