Unexpected behavior in KIO::KMimeTypeFinderJob

Stefano Crocco stefano.crocco at alice.it
Tue Aug 6 09:25:12 BST 2024


Hello to everyone,
while investigating a bug in Konqueror, I just found what in my opinion is an 
unexpected behavior of KIO::MimeTypeFinderJob. If I'm reading the code 
correctly, when it uses KIO::get() to determine the mimetype [1], it lets the 
TransferJob go on even after it detected the mimetype.

The documentation for KIO::get() states:
"Special case: if you want to determine the MIME type of the file first, and 
then read it with the appropriate component, you can still use a KIO::get() 
directly. When that job emits the mimeType signal, (which is guaranteed to 
happen before it emits any data), put the job on hold".  Since the task of 
MimeTypeFinderJob is finding the mimetype of the URL, I expected it would put 
the job on hold as soon as it has determined the mimetype, coherently with the 
KIO::get() documentation.

Does anyone know whether the current behavior is expected and, if so, why?

Thanks in advance

Stefano

[1] https://invent.kde.org/frameworks/kio/-/blob/master/src/core/
mimetypefinderjob.cpp#L189




More information about the kde-devel mailing list