Sophie

Sophie

distrib > Mandriva > cs4.0 > i586 > by-pkgid > 6f96ffda8b8309fb9c58db5e0ddbde2c > files > 78

kdebase-3.5.4-2.1.20060mlcs4.src.rpm

--- kdebase-3.5.2/kcontrol/filetypes/typeslistitem.cpp	2006-03-30 14:16:23.000000000 -0500
+++ kdebase-3.5.2/kcontrol/filetypes/typeslistitem.cpp.new	2006-05-03 17:47:41.000000000 -0400
@@ -360,7 +360,7 @@
           {
             QString path = pService->locateLocal();
             KConfig orig(pService->desktopEntryPath(), true, false, "apps");
-            desktop = orig.copyTo(path);
+            desktop = orig.copyTo( pathToCopyEntry(path, pService->menuId() ));
           }
           desktop->setDesktopGroup();
 
@@ -485,7 +485,7 @@
       {
         QString path = pService->locateLocal();
         KConfig orig(pService->desktopEntryPath(), true, false, "apps");
-        desktop = orig.copyTo(path);
+        desktop = orig.copyTo(pathToCopyEntry(path, pService->menuId() ));
       }
 
       desktop->setDesktopGroup();
@@ -504,6 +504,21 @@
   }
 }
 
+QString TypesListItem::pathToCopyEntry( QString path, QString menuId )
+{
+	if( KStandardDirs::menu_type_by_version()=="kde")
+			return path;
+	QString tmpPath = path.remove( menuId );
+    QString element;
+    element = menuId.remove( "Mandrivalinux-" );
+    element=element.replace( QChar( '-' ), "/" );
+    QString newPath = tmpPath+"Mandrivalinux/"+element;
+	KURL url(newPath);
+    KStandardDirs::makeDir( url.directory() );
+	return newPath;
+}
+
+
 void TypesListItem::setIcon( const QString& icon )
 {
   m_icon = icon;
--- kdebase-3.5.2/kcontrol/filetypes/typeslistitem.h	2006-03-30 14:16:23.000000000 -0500
+++ kdebase-3.5.2/kcontrol/filetypes/typeslistitem.h.new	2006-05-03 17:47:06.000000000 -0400
@@ -101,6 +101,7 @@
   void init(KMimeType::Ptr mimetype);
   static int readAutoEmbed( KMimeType::Ptr mimetype );
 
+  QString pathToCopyEntry(QString path, QString menuId );
   KMimeType::Ptr m_mimetype;
   unsigned int groupCount:16; // shared between saveServices and sync
   unsigned int m_autoEmbed:2; // 0 yes, 1 no, 2 use group setting