SVN commit 683564 by dfaure: Fix diagnoseMimeType bug found in kde4 by aacid: it included trailing spaces due to the padding done internally in ksycoca. M +1 -1 kio/kservicetypefactory.cpp M +9 -0 tests/kmimetypetest.cpp --- branches/KDE/3.5/kdelibs/kio/kio/kservicetypefactory.cpp #683563:683564 @@ -156,7 +156,7 @@ // don't return newServiceType - there may be an "other" pattern that // matches best this file, like *.tar.bz if (match) - *match = "*."+pattern; + *match = "*."+pattern.stripWhiteSpace(); break; // but get out of the fast patterns } else --- branches/KDE/3.5/kdelibs/kio/tests/kmimetypetest.cpp #683563:683564 @@ -63,5 +63,14 @@ checkIcon( "trash:/foo/", "folder" ); } + QString pdf; + KMimeType::diagnoseFileName("foo.pdf", pdf); + qDebug("extension: '%s'", pdf.latin1()); + assert(pdf == QString("*.pdf")); + QString ps; + KMimeType::diagnoseFileName("foo.ps", ps); + qDebug("extension: '%s'", ps.latin1()); + assert(ps == QString("*.ps")); + return 0; }