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

List:       kde-commits
Subject:    branches/KDE/4.6/kdelibs/kdecore/services
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2011-01-26 16:19:30
Message-ID: 20110126161930.7FA71AC8BA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1217308 by lunakl:

Backport r1216757.
Make KMimeTypeRepository::matchFileName() public as
KMimeType::matchFileName(), as filename pattern matching may
be occassionally useful outside of kdelibs.



 M  +6 -0      kmimetype.cpp  
 M  +6 -0      kmimetype.h  
 M  +5 -5      kmimetyperepository_p.h  


--- branches/KDE/4.6/kdelibs/kdecore/services/kmimetype.cpp #1217307:1217308
@@ -26,6 +26,7 @@
 #include <kde_file.h> // KDE::stat
 #include <kdeversion.h> // KDE_MAKE_VERSION
 #include <klocale.h>
+#include <kmimetyperepository_p.h>
 #include <kprotocolinfo.h>
 #include <kprotocolinfofactory.h>
 #include <kstandarddirs.h>
@@ -736,6 +737,11 @@
     return QString();
 }
 
+bool KMimeType::matchFileName( const QString &filename, const QString &pattern )
+{
+    return KMimeTypeRepository::matchFileName( filename, pattern );
+}
+
 int KMimeTypePrivate::serviceOffersOffset() const
 {
     return KMimeTypeFactory::self()->serviceOffersOffset(name());
--- branches/KDE/4.6/kdelibs/kdecore/services/kmimetype.h #1217307:1217308
@@ -400,6 +400,12 @@
     static QString extractKnownExtension( const QString &fileName );
 
     /**
+     * Returns true if the given filename matches the given pattern.
+     * @since 4.6.1
+     */
+    static bool matchFileName( const QString &filename, const QString &pattern );
+
+    /**
      * Returns the version of the installed update-mime-database program
      * (from freedesktop.org shared-mime-info). This is used by unit tests
      * and by the code that writes out icon definitions.
--- branches/KDE/4.6/kdelibs/kdecore/services/kmimetyperepository_p.h #1217307:1217308
@@ -86,6 +86,11 @@
 
     int sharedMimeInfoVersion();
 
+    /**
+     * @internal
+     */
+    static bool matchFileName( const QString &filename, const QString &pattern );
+
 private: // only for KMimeType and unittests
     friend class KMimeType;
     friend class KMimeFileParserTest;
@@ -128,11 +133,6 @@
      */
     QList<KMimeMagicRule> parseMagicFile(QIODevice* file, const QString& fileName) const;
 
-    /**
-     * @internal (public for unit tests only)
-     */
-    static bool matchFileName( const QString &filename, const QString &pattern );
-
     // Read magic files
     void parseMagic();
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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