[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdelibs/kdecore
From:       David Faure <faure () kde ! org>
Date:       2010-03-02 14:19:38
Message-ID: 1267539578.701691.20442.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1097954 by dfaure:

As discussed with Pino: make alias resolution the default in KMimeType::mimeType.
There is just no good reason not to, aliases can be used anywhere, especially with
shared-mime-info replacing mimetypes with aliases over time (e.g. image/ico).

This fixes at least two bugs:
1) a bug noticed by Pino: if you set the old name as filter in kfiledialog, when
   updating s-m-i it won't work anymore (because aliases are not resolved)
2) the bug that nspluginscan would define mimetypes because "unknown" when they are
   in fact aliases.
BUG: 197346
Fixed for: 4.4.2


 M  +1 -1      services/kmimetype.h  
 M  +8 -4      tests/kmimetypetest.cpp  


--- branches/KDE/4.4/kdelibs/kdecore/services/kmimetype.h #1097953:1097954
@@ -118,7 +118,7 @@
      *         0 if not found
      * @see KServiceType::serviceType
      */
-    static Ptr mimeType( const QString& name, FindByNameOption options = \
DontResolveAlias ); +    static Ptr mimeType( const QString& name, FindByNameOption \
options = ResolveAliases );  
     /**
      * Finds a KMimeType with the given @p url.
--- branches/KDE/4.4/kdelibs/kdecore/tests/kmimetypetest.cpp #1097953:1097954
@@ -193,9 +193,13 @@
     QTest::newRow("doesn't exist but has known extension") << "IDontExist.txt" << \
"text/plain";  
     // Can't use KIconLoader since this is a "without GUI" test.
-    QString fh = KStandardDirs::locate( "icon", "oxygen/22x22/places/folder.png" );
-    QVERIFY( !fh.isEmpty() ); // if the file doesn't exist, please fix the above to \
                point to an existing icon
-    QTest::newRow("png image") << fh << "image/png";
+    if (!KStandardDirs::locate("icon", "oxygen/").isEmpty()) {
+        QString fh = KStandardDirs::locate("icon", \
"oxygen/22x22/places/folder.png"); +        QVERIFY(!fh.isEmpty()); // if the file \
doesn't exist, please fix the above to point to an existing icon +        \
QTest::newRow("png image") << fh << "image/png"; +    } else {
+        kWarning() << "oxygen icon theme not found";
+    }
 
     QString exePath = KStandardDirs::findExe( "kioexec" );
     if ( exePath.isEmpty() )
@@ -466,7 +470,7 @@
 
     const KMimeType::Ptr canonical = KMimeType::mimeType( "application/xml" );
     QVERIFY( canonical );
-    KMimeType::Ptr alias = KMimeType::mimeType( "text/xml" );
+    KMimeType::Ptr alias = KMimeType::mimeType("text/xml", \
KMimeType::DontResolveAlias);  QVERIFY( !alias );
     alias = KMimeType::mimeType( "text/xml", KMimeType::ResolveAliases );
     QVERIFY( alias );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic