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

List:       kde-commits
Subject:    kdebase/kcontrol/filetypes
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-11-18 12:02:46
[Download RAW message or body]

CVS commit by waba: 

Don't add a mimetype explicitly to a service if the mimetype is already
implied due to X-KDE-IsAlso mimetype inheritance.


  M +13 -2     typeslistitem.cpp   1.40


--- kdebase/kcontrol/filetypes/typeslistitem.cpp  #1.39:1.40
@@ -358,4 +358,16 @@ void TypesListItem::sync()
 }
 
+static bool inheritsMimetype(KMimeType::Ptr m, const QStringList &mimeTypeList)
+{
+  for(QStringList::ConstIterator it = mimeTypeList.begin();
+      it != mimeTypeList.end(); ++it)
+  {
+    if (m->is(*it))
+       return true;  
+  }
+
+  return false;
+}
+
 void TypesListItem::saveServices( KConfig & profile, QStringList services, const \
QString & genericServiceType )  {
@@ -386,7 +398,6 @@ void TypesListItem::saveServices( KConfi
        ? (*s_changedServices)[ pService->desktopEntryPath() ] : \
pService->serviceTypes();  
-    if (!mimeTypeList.contains(name()))
+    if (!mimeTypeList.contains(name()) && !inheritsMimetype(m_mimetype, \
mimeTypeList))  {
-
       KConfig *desktop;
       if ( pService->type() == QString("Service") )


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

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