filemanager/src/filemanager/src/operationservice/fmoperationcopyormove.cpp
changeset 46 d58987eac7e8
parent 37 15bc28c9dd51
equal deleted inserted replaced
37:15bc28c9dd51 46:d58987eac7e8
   125         // formatPath, but do not append splash in the end
   125         // formatPath, but do not append splash in the end
   126         // Otherwise could not get fileName in QFileInfo::fileName
   126         // Otherwise could not get fileName in QFileInfo::fileName
   127         QString checkedSource( FmUtils::formatPath( source ) );
   127         QString checkedSource( FmUtils::formatPath( source ) );
   128         QFileInfo fi( checkedSource );
   128         QFileInfo fi( checkedSource );
   129         if( !fi.exists() ) {
   129         if( !fi.exists() ) {
   130             mErrString = checkedSource;            
   130             mErrString = checkedSource;   
       
   131             emit driveSpaceChanged();
   131             emit notifyError( FmErrSrcPathDoNotExist, mErrString );
   132             emit notifyError( FmErrSrcPathDoNotExist, mErrString );
   132             return;
   133             return;
   133         }
   134         }
   134         QString newName;
   135         QString newName;
   135         bool    isAcceptReplace = false;
   136         bool    isAcceptReplace = false;
   166                 QString targetName = mTargetPath + newName;
   167                 QString targetName = mTargetPath + newName;
   167                 destFi.setFile( targetName );
   168                 destFi.setFile( targetName );
   168             }
   169             }
   169         }
   170         }
   170         if( ret != FmErrNone ) {
   171         if( ret != FmErrNone ) {
   171             emit notifyError( ret, mErrString );
       
   172             // refresh drive space no care if cancel, error or finished.
   172             // refresh drive space no care if cancel, error or finished.
   173             // as filemanger cannot notify drive space changed
   173             // as filemanger cannot notify drive space changed
   174             // do not refresh path as QFileSystemModel will do auto-refresh
   174             // do not refresh path as QFileSystemModel will do auto-refresh
   175             emit driveSpaceChanged();
   175             emit driveSpaceChanged();
       
   176             emit notifyError( ret, mErrString );
   176             return;
   177             return;
   177         }
   178         }
   178         ret = copyOrMove( checkedSource, mTargetPath, newName );
   179         ret = copyOrMove( checkedSource, mTargetPath, newName );
   179         if( ret != FmErrNone ) {
   180         if( ret != FmErrNone ) {
       
   181             emit driveSpaceChanged();
   180             emit notifyError( ret, mErrString );            
   182             emit notifyError( ret, mErrString );            
   181             emit driveSpaceChanged();
       
   182             return;
   183             return;
   183         }
   184         }
   184     }
   185     }    
       
   186     emit driveSpaceChanged();
   185     emit notifyFinish();
   187     emit notifyFinish();
   186     emit driveSpaceChanged();
       
   187 }
   188 }
   188 
   189 
   189 /*
   190 /*
   190  * Copy or move the \a source to \a targetPath
   191  * Copy or move the \a source to \a targetPath
   191  * with \a newTargetName
   192  * with \a newTargetName