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

List:       kde-commits
Subject:    KDE/kdelibs/kioslave
From:       Christian Ehrlicher <Ch.Ehrlicher () gmx ! de>
Date:       2007-12-03 17:30:40
Message-ID: 1196703040.522527.4499.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 744457 by chehrlic:

some more ::rename() -> MoveFileEx for windows

 M  +6 -0      file/file.cpp  
 M  +6 -0      ftp/ftp.cpp  


--- trunk/KDE/kdelibs/kioslave/file/file.cpp #744456:744457
@@ -759,7 +759,13 @@
         if( (_flags & KIO::Overwrite) && S_ISLNK( buff_orig.st_mode ) )
           remove( _dest_orig.data() );
 
+#ifdef Q_OS_WIN
+        if ( MoveFileExA( _dest.data(),
+                          _dest_orig.data(),
+                          MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED ) == 0 )
+#else
         if ( ::rename( _dest.data(), _dest_orig.data() ) )
+#endif
         {
             kWarning(7101) << " Couldn't rename " << _dest << " to " << _dest_orig;
             error( KIO::ERR_CANNOT_RENAME_PARTIAL, dest_orig );
--- trunk/KDE/kdelibs/kioslave/ftp/ftp.cpp #744456:744457
@@ -2327,7 +2327,13 @@
   {
     if(iRes == statusSuccess)
     { // rename ".part" on success
+#ifdef Q_OS_WIN
+        if ( MoveFileExA( sPart.data(),
+                          sDest.data(),
+                          MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED ) == 0 )
+#else
       if ( ::rename( sPart.data(), sDest.data() ) )
+#endif
       {
         kDebug(7102) << "copy: cannot rename " << sPart << " to " << sDest;
         iError = ERR_CANNOT_RENAME_PARTIAL;
[prev in list] [next in list] [prev in thread] [next in thread] 

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