Hi guys, seems that KService has regressed and now it does not include all the 
mimetypes listed in the .desktop file anymore.

Code to fix BUG 321706 seems to have added a check for 
  // Only add unique mimetypes

When that is not the behavior that kservice used to had, and it's not the 
documented behaviour

    /**
     * Returns the list of mime types that this service supports.
     * Note that this doesn't include inherited mimetypes,
     * only the mimetypes types listed in the .desktop file.
     * @since 4.8.3
     */
    QStringList mimeTypes() const;

By reading that I understand that by using mimeTypes I will get a list of all 
the mimetypes i list in the .desktop file

Attached the test uses kservice on 
/usr/share/kde4/services/libokularGenerator_ghostview.desktop
that has
MimeType=application/postscript;image/x-eps;
but the code only prints
application/postscript

Can anyone fix that please? Okular is acting all weird because of this.

Cheers,
  Albert
#include <kservice.h>
#include <QDebug>

int main(int argc, char **argv)
{
	KService s("/usr/share/kde4/services/libokularGenerator_ghostview.desktop");
	qDebug() << s.mimeTypes();
}

Reply via email to