Bug 184181

Summary: Cannot change file association with mime type
Product: [Applications] systemsettings Reporter: S. Bryant <steve>
Component: kcm_filetypesAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description S. Bryant 2009-02-12 23:16:05 UTC
Version:            (using KDE 4.2.0)
Compiler:          gcc version 4.3.2 
OS:                Linux
Installed from:    SuSE RPMs

I cannot get a file name pattern to be associated with a MIME type other than the system default.

In this case, I wish *.ts to mean transport stream files, and be treated the same as other patterns associated with video/mpeg (like *.mpg, *.vob etc), and be opened with the same applications.

My system has *.ts associated with application/x-linguist by default.  Despite removing the pattern via the file associations dialog (and adding it to video/mpeg) there is no change in behaviour.  The next time I open the dialog, the pattern appears under both types.

Removing the x-linguist MIME type and pressing OK appears to work (ie: no error message), but if I open the dialog again, both it and the *.ts pattern are back.

The only thing that did work: removing qtlinguist as the default application for application/x-linguist.

Adding an application for *.ts adds it to application/x-linguist.  The fact that *.ts is also under video/mpeg is ignored.

In summary: system settings for file associations cannot be overridden.

I'm using OpenSUSE 11.1 x86_64, with the KDE 4.2 packages from the repository, in case it makes any difference.

Steve
Comment 1 David Faure 2009-03-21 13:06:33 UTC
SVN commit 942204 by dfaure:

Improve usability, especially of the "Remove" button:
For system-defined mimetypes, don't offer to "Remove", but only to "Revert" to the system mimetype.
With full tooltip+whatsThis in both cases, removing and reverting.

In theory the user should be able to make a system mimetype unused for local files
by clearing its patterns list, but that is a missing feature in shared-mime-info
(no patterns -> the global ones are used again), I just emailed the xdg list about it.
Meanwhile you have to add a dummy pattern (*.willneverexist) to achieve this.
CCBUG: 184181


 M  +108 -63   filetypesview.cpp  
 M  +3 -1      filetypesview.h  
 M  +5 -5      keditfiletype.cpp  
 M  +1 -1      keditfiletype.h  
 M  +5 -1      mimetypedata.cpp  
 M  +1 -0      newtypedlg.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=942204
Comment 2 David Faure 2009-04-10 18:22:38 UTC
SVN commit 951933 by dfaure:

Add support for the new <glob-deleteall> element in shared-mime-info, and change
kbuildsycoca's globs2 file parser to add rather than replace, by default, as
discussed on xdg-list.
This allows users to delete all patterns from a mimetype in keditfiletype.
BUG: 184181

Note: this will only really work after the next shared-mime-info release.
With shared-mime-info <= 0.60, deleteall has no effect so globs are always appended.


 M  +4 -0      kdebase/runtime/keditfiletype/mimetypewriter.cpp  
 M  +3 -2      kdebase/runtime/keditfiletype/tests/filetypestest.cpp  
 M  +16 -18    kdelibs/kded/kmimefileparser.cpp  
 M  +1 -1      kdelibs/kded/kmimefileparser.h  
 M  +45 -7     kdelibs/kded/test/kmimefileparsertest.cpp  


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