Unexpected behavior in KIO::KMimeTypeFinderJob
Albert Astals Cid
aacid at kde.org
Tue Aug 6 23:53:12 BST 2024
El dimarts, 6 d’agost del 2024, a les 10:25:12 (CEST), Stefano Crocco va
escriure:
> 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?
You probably want to ask the kde-frameworks-devel list where frameworks devels
live (and maybe even CC dfaure since he's the author of the code and he is
taking well deserved holidays from KDE development)
On a very quick look I agree with you.
Cheers,
Albert
>
> 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