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

List:       kde-commits
Subject:    kdebase/kcontrol/kfontinst/kio
From:       Craig Drummond <craig () kde ! org>
Date:       2003-12-12 23:05:29
[Download RAW message or body]

CVS commit by craig: 

Bug #69859 create parent folders when asked to put a file, or create a folder.


  M +18 -9     KioFonts.cpp   1.18


--- kdebase/kcontrol/kfontinst/kio/KioFonts.cpp  #1.17:1.18
@@ -735,6 +735,14 @@ void CKioFonts::put(const KURL &u, int m
             error(KIO::ERR_SLAVE_DEFINED, i18n("Could not access \"%1\" folder.").arg(KIO_FONTS_SYS));
     }
-    else if(putReal(destOrig, destOrigC, EXISTS_NO!=origExists, mode, resume))
+    else
+    {
+        QString dir(CMisc::getDir(destOrig));
+
+        if(!CMisc::dExists(dir))
+            CMisc::createDir(dir);
+
+        if(putReal(destOrig, destOrigC, EXISTS_NO!=origExists, mode, resume))
         modifiedDir(CMisc::getDir(destOrig));
+    }
 
     if(++itsNewFonts>MAX_NEW_FONTS)
@@ -940,4 +948,9 @@ void CKioFonts::copy(const KURL &src, co
         }
 
+        QString destDir(CMisc::getDir(realDest));
+
+        if(!CMisc::dExists(destDir))
+            CMisc::createDir(destDir);
+
         // WABA: Make sure that we keep writing permissions ourselves,
         // otherwise we can be in for a surprise on NFS.
@@ -1188,10 +1201,6 @@ void CKioFonts::mkdir(const KURL &url, i
             }
             else
-                if (EXISTS_NO==exists && 0!=::mkdir(realPath.data(), 0777 /*umask will be applied*/ ))
-                    error(EACCES==errno
-                                  ? KIO::ERR_ACCESS_DENIED
-                                  : ENOSPC==errno
-                                        ? KIO::ERR_DISK_FULL
-                                        : KIO::ERR_COULD_NOT_MKDIR, url.path() );
+                if(!CMisc::createDir(realPath))
+                    error(KIO::ERR_COULD_NOT_MKDIR, url.path());
                 else
                 {


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

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