Bug 204139 - file type not correctly recognized when using smb
Summary: file type not correctly recognized when using smb
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: smb (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
Depends on:
Reported: 2009-08-17 10:26 UTC by Martin Koller
Modified: 2009-09-26 02:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2009-08-17 10:26:58 UTC
Version:            (using KDE 4.3.0)
OS:                Linux
Installed from:    SuSE RPMs

when looking at a folder which contains a M$-word document with konqueror from KDE4 on a fileshare I access with smb://host/xxxx it tells me the .doc file is of type plain text. Open with ... also shows the plain text applications  kwrite, vi, kate

When I copy this .doc file to my local disk and open the folder with konqi/KDE4 now it correctly shows up as "Word document" and is associated with OOwriter

When looking at the same smb URL with konqueror from KDE3, it correctly shows the doc file as application/msword and open with ... has OOWriter and kword in it.

I assume the problem might also be related to bug #203706 which says that plain-text has also *.doc as a pattern and I can not remove this pattern.
Comment 1 FiNeX 2009-08-17 12:49:26 UTC
Konqueror uses dolphin for file management. Moved to "dolphin" product...

@Peter: is this a dolphin or a KIO issue?
Comment 2 Peter Penz 2009-08-17 16:24:44 UTC
@FiNeX: it is not Dolphin specific, but I'm not sure whether it is a kio-issue or a general kdelibs issue. Where I'm sure is that David Faure is able to fix this kind of issue :-)
Comment 3 FiNeX 2009-08-17 16:50:30 UTC
Ok, thanks Peter. I've addedd David on CC :-)
Comment 4 David Faure 2009-08-18 18:28:38 UTC
This means kio_smb isn't doing correct mimetype determination; it should read the beginning of the file and pass it to KMimeType::findByNameAndContent, like other ioslaves do.
Comment 5 David Faure 2009-09-26 02:21:24 UTC
SVN commit 1028147 by dfaure:

Sort list of mimetypes before randomly picking one (when we don't have the file content to find out more).
This way, we get a deterministic result rather than depending on qHash(QString),
and as a nice side effect, *.doc defaults to application/msword rather than text/plain, which
restores the kde3 and shared-mime-info behavior (despite our addition of "*.doc
can be text/plain for local files", compared to shared-mime-info).

BUG: 204139

 M  +7 -0      services/kmimetype.cpp  
 M  +1 -3      tests/kmimetypetest.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1028147