KIO::MimeTypeFinderJob with URLs requiring authentication

stefano.crocco at alice.it stefano.crocco at alice.it
Tue Sep 27 19:56:57 BST 2022


Hello to everyone,
does anyone know whether KIO::MimeTypeFinderJob is supposed to work with 
URLs
requiring authentication?

 From my understanding of the documentation, (particular about the
setAuthenticationPromptEnabled and isAuthenticationPromptEnabled), it 
should
work. However, when I tested it using an ftp URL which requires
authentication, the job produced an error with code 1 and error string 
"User
canceled action". This message seems very strange to me, given that I 
did
nothing to cancel the action (and, indeed, I wasn't given any mean to do 
so.

Experimenting with the source code of MimeTypeFinderJob, I found out 
that to
have a login dialog be displayed, I needed to remove this line (line 131 
in
mimetypefinderjob.cpp):

job->setUiDelegate(nullptr);

Here job is a KIO::StatJob used by MimeTypeFinderJob to find out whether 
the
URL corresponds to a directory or not. Since this line is right below 
the
conditional block which checks whether authentication prompts are 
enabled, I
started wondering whether this line is correct or should instead go 
inside the
block, so that it's executed only when authentication prompts are 
disabled, or
even if it's a leftover from when support from when
isAuthenticationPromptEnabled/setAuthenticationPromptEnabled were added.

What do you think? Should I file a bug report about this behaviour, or 
is it
expected?

Thanks in advance

Stefano


More information about the kde-devel mailing list