Review Request 111951: Fix where some file type associations can't be changed anymore

Mathias Tillman master.homer at gmail.com
Wed Aug 21 23:25:52 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111951/
-----------------------------------------------------------

(Updated Aug. 21, 2013, 10:25 p.m.)


Review request for kdelibs.


Changes
-------

Changed code to comply with KDE coding standards. Removed addInheritedServiceOffer as it was no longer needed.

@Frank Reininghaus
I just couldn't find a good way to use a similar approach to QStringList_removeDuplicates, I did try a few other solutions (one using QSet and another using QMap) but both were considerably slower than this nested loop solution. lstServiceTypes contains a list of mimetypes as specified by the MimeType line in the applications desktop files, so it could potentially contain a list of all possible mimetypes which probably would make it stall for a bit.

@David Faure
I've updated the Bug field; I wasn't sure if it required you to specify the URL or just the ID of the bug. And yes, the unittest from 871cccc8 passes just fine (as do the others).


Description
-------

This fixes a bug introduced by https://projects.kde.org/projects/kde/kdelibs/repository/revisions/871cccc8a88a600c8f850a020d44bfc5f5858caa that made it impossible to re-order file type associations both in System settings and in the open with list. Hence it contains a new way of detecting duplicate (inherited) mimetype entries, that the original was supposed to fix.


This addresses bug 321706.
    http://bugs.kde.org/show_bug.cgi?id=321706


Diffs (updated)
-----

  kdecore/services/kservice.cpp 8e81929b91803a3eed586d9fc15cdd78165b6bce 
  kded/kbuildservicefactory.cpp 7f89a991d088476d8ed94763e6fa65dcc3d0603c 
  kded/kmimeassociations.h 4a2c71312ade32a9ac779495496bf6ebb78b37a4 
  kded/kmimeassociations.cpp b0af7bcc4a39e5cce1fa6abe86cace476313702a 

Diff: http://git.reviewboard.kde.org/r/111951/diff/


Testing
-------

I have tested so that file type associations can be ordered correctly, in addition to making sure that parent mimetypes have precedence when an app lists two or more mimetypes where one is the parent of the other.


Thanks,

Mathias Tillman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130821/05294682/attachment.htm>


More information about the kde-core-devel mailing list