@ -40,8 +40,8 @@
# define REPORT_TIMEOUT 200
VirtualCopyJob : : VirtualCopyJob ( const TQStringList * names , vfs * vfs , const KURL & dest , const KURL & baseURL ,
PreserveMode pmode , K IO: : CopyJob : : CopyMode mode , bool asMethod , bool showProgressInfo ) :
K IO: : Job ( showProgressInfo ) , m_totalSize ( 0 ) , m_totalFiles ( 0 ) , m_totalSubdirs ( 0 ) ,
PreserveMode pmode , TDE IO: : CopyJob : : CopyMode mode , bool asMethod , bool showProgressInfo ) :
TDE IO: : Job ( showProgressInfo ) , m_totalSize ( 0 ) , m_totalFiles ( 0 ) , m_totalSubdirs ( 0 ) ,
m_processedSize ( 0 ) , m_processedFiles ( 0 ) , m_processedSubdirs ( 0 ) , m_tempSize ( 0 ) , m_tempFiles ( 0 ) ,
m_tempSubdirs ( 0 ) , m_dirsToGetSize ( ) , m_filesToCopy ( ) , m_size ( ) , m_filenum ( ) , m_subdirs ( ) , m_baseURL ( baseURL ) ,
m_dest ( dest ) , m_pmode ( pmode ) , m_mode ( mode ) , m_asMethod ( asMethod ) , m_showProgressInfo ( showProgressInfo ) ,
@ -83,16 +83,16 @@ VirtualCopyJob::VirtualCopyJob( const TQStringList *names, vfs * vfs, const KURL
}
if ( showProgressInfo ) {
connect ( this , TQT_SIGNAL ( totalFiles ( K IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotTotalFiles ( K IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( totalDirs ( K IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotTotalDirs ( K IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( processedFiles ( K IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotProcessedFiles ( K IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( processedDirs ( K IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotProcessedDirs ( K IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( percent ( K IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotPercent ( K IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( totalFiles ( TDE IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotTotalFiles ( TDE IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( totalDirs ( TDE IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotTotalDirs ( TDE IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( processedFiles ( TDE IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotProcessedFiles ( TDE IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( processedDirs ( TDE IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotProcessedDirs ( TDE IO: : Job * , unsigned long ) ) ) ;
connect ( this , TQT_SIGNAL ( percent ( TDE IO: : Job * , unsigned long ) ) ,
Observer : : self ( ) , TQT_SLOT ( slotPercent ( TDE IO: : Job * , unsigned long ) ) ) ;
}
TQTimer : : singleShot ( 0 , this , TQT_SLOT ( slotStart ( ) ) ) ;
@ -100,7 +100,7 @@ VirtualCopyJob::VirtualCopyJob( const TQStringList *names, vfs * vfs, const KURL
void VirtualCopyJob : : slotStart ( ) {
if ( m_showProgressInfo ) {
if ( m_mode = = K IO: : CopyJob : : Move )
if ( m_mode = = TDE IO: : CopyJob : : Move )
Observer : : self ( ) - > slotMoving ( this , m_baseURL , m_dest ) ;
else
Observer : : self ( ) - > slotCopying ( this , m_baseURL , m_dest ) ;
@ -158,10 +158,10 @@ void VirtualCopyJob::statNextDir() {
m_currentDir = KURL : : relativeURL ( m_baseURL , dirToCheck . upURL ( ) ) ;
KDirSize * kds = KDirSize : : dirSizeJob ( dirToCheck ) ;
connect ( kds , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotKdsResult ( K IO: : Job * ) ) ) ;
connect ( kds , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotKdsResult ( TDE IO: : Job * ) ) ) ;
}
void VirtualCopyJob : : slotKdsResult ( K IO: : Job * job ) {
void VirtualCopyJob : : slotKdsResult ( TDE IO: : Job * job ) {
KDirSize * kds = static_cast < KDirSize * > ( job ) ;
m_totalSize + = kds - > totalSize ( ) ;
m_totalFiles + = kds - > totalFiles ( ) ;
@ -188,18 +188,18 @@ void VirtualCopyJob::createNextDir() {
if ( m_currentDir ! = " ./ " & & ! m_currentDir . isEmpty ( ) )
m_current . addPath ( m_currentDir ) ;
KIO: : Job * job = K IO: : stat ( m_current ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotStatResult ( K IO: : Job * ) ) ) ;
TDEIO: : Job * job = TDE IO: : stat ( m_current ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotStatResult ( TDE IO: : Job * ) ) ) ;
}
void VirtualCopyJob : : slotStatResult ( K IO: : Job * job ) {
KURL url = ( static_cast < K IO: : SimpleJob * > ( job ) ) - > url ( ) ;
void VirtualCopyJob : : slotStatResult ( TDE IO: : Job * job ) {
KURL url = ( static_cast < TDE IO: : SimpleJob * > ( job ) ) - > url ( ) ;
if ( job & & job - > error ( ) ) {
if ( job - > error ( ) = = K IO: : ERR_DOES_NOT_EXIST & & ! url . equals ( url . upURL ( ) , true ) ) {
if ( job - > error ( ) = = TDE IO: : ERR_DOES_NOT_EXIST & & ! url . equals ( url . upURL ( ) , true ) ) {
m_dirStack . push_back ( url . fileName ( ) ) ;
KIO: : Job * job = K IO: : stat ( url . upURL ( ) ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotStatResult ( K IO: : Job * ) ) ) ;
TDEIO: : Job * job = TDE IO: : stat ( url . upURL ( ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotStatResult ( TDE IO: : Job * ) ) ) ;
return ;
}
job - > showErrorDialog ( krApp ) ;
@ -213,15 +213,15 @@ void VirtualCopyJob::slotStatResult( KIO::Job *job ) {
url . addPath ( m_dirStack . last ( ) ) ;
m_dirStack . pop_back ( ) ;
KIO: : Job * mkdir_job = K IO: : mkdir ( url ) ;
connect ( mkdir_job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotMkdirResult ( K IO: : Job * ) ) ) ;
TDEIO: : Job * mkdir_job = TDE IO: : mkdir ( url ) ;
connect ( mkdir_job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotMkdirResult ( TDE IO: : Job * ) ) ) ;
}
else
copyCurrentDir ( ) ;
}
void VirtualCopyJob : : slotMkdirResult ( K IO: : Job * job ) {
KURL url = ( static_cast < K IO: : SimpleJob * > ( job ) ) - > url ( ) ;
void VirtualCopyJob : : slotMkdirResult ( TDE IO: : Job * job ) {
KURL url = ( static_cast < TDE IO: : SimpleJob * > ( job ) ) - > url ( ) ;
if ( job & & job - > error ( ) ) {
job - > showErrorDialog ( krApp ) ;
@ -235,8 +235,8 @@ void VirtualCopyJob::slotMkdirResult( KIO::Job *job ) {
url . addPath ( m_dirStack . last ( ) ) ;
m_dirStack . pop_back ( ) ;
KIO: : Job * mkdir_job = K IO: : mkdir ( url ) ;
connect ( mkdir_job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotMkdirResult ( K IO: : Job * ) ) ) ;
TDEIO: : Job * mkdir_job = TDE IO: : mkdir ( url ) ;
connect ( mkdir_job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotMkdirResult ( TDE IO: : Job * ) ) ) ;
}
else
copyCurrentDir ( ) ;
@ -245,25 +245,25 @@ void VirtualCopyJob::slotMkdirResult( KIO::Job *job ) {
void VirtualCopyJob : : copyCurrentDir ( ) {
m_state = ST_COPYING ;
K IO: : CopyJob * copy_job = PreservingCopyJob : : createCopyJob ( m_pmode , * m_filesToCopy [ m_currentDir ] , m_current ,
TDE IO: : CopyJob * copy_job = PreservingCopyJob : : createCopyJob ( m_pmode , * m_filesToCopy [ m_currentDir ] , m_current ,
m_mode , m_asMethod , false ) ;
connect ( copy_job , TQT_SIGNAL ( copying ( K IO: : Job * , const KURL & , const KURL & ) ) ,
this , TQT_SLOT ( slotCopying ( K IO: : Job * , const KURL & , const KURL & ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( moving ( K IO: : Job * , const KURL & , const KURL & ) ) ,
this , TQT_SLOT ( slotMoving ( K IO: : Job * , const KURL & , const KURL & ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( creatingDir ( K IO: : Job * , const KURL & ) ) ,
this , TQT_SLOT ( slotCreatingDir ( K IO: : Job * , const KURL & ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( processedFiles ( K IO: : Job * , unsigned long ) ) ,
this , TQT_SLOT ( slotProcessedFiles ( K IO: : Job * , unsigned long ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( processedDirs ( K IO: : Job * , unsigned long ) ) ,
this , TQT_SLOT ( slotProcessedDirs ( K IO: : Job * , unsigned long ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( processedSize ( KIO: : Job * , K IO: : filesize_t ) ) ,
this , TQT_SLOT ( slotProcessedSize ( KIO: : Job * , K IO: : filesize_t ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotCopyResult ( K IO: : Job * ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( copying ( TDE IO: : Job * , const KURL & , const KURL & ) ) ,
this , TQT_SLOT ( slotCopying ( TDE IO: : Job * , const KURL & , const KURL & ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( moving ( TDE IO: : Job * , const KURL & , const KURL & ) ) ,
this , TQT_SLOT ( slotMoving ( TDE IO: : Job * , const KURL & , const KURL & ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( creatingDir ( TDE IO: : Job * , const KURL & ) ) ,
this , TQT_SLOT ( slotCreatingDir ( TDE IO: : Job * , const KURL & ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( processedFiles ( TDE IO: : Job * , unsigned long ) ) ,
this , TQT_SLOT ( slotProcessedFiles ( TDE IO: : Job * , unsigned long ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( processedDirs ( TDE IO: : Job * , unsigned long ) ) ,
this , TQT_SLOT ( slotProcessedDirs ( TDE IO: : Job * , unsigned long ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( processedSize ( TDEIO: : Job * , TDE IO: : filesize_t ) ) ,
this , TQT_SLOT ( slotProcessedSize ( TDEIO: : Job * , TDE IO: : filesize_t ) ) ) ;
connect ( copy_job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotCopyResult ( TDE IO: : Job * ) ) ) ;
}
void VirtualCopyJob : : slotCopyResult ( K IO: : Job * job ) {
void VirtualCopyJob : : slotCopyResult ( TDE IO: : Job * job ) {
if ( job & & job - > error ( ) ) {
job - > showErrorDialog ( krApp ) ;
}
@ -286,30 +286,30 @@ void VirtualCopyJob::directoryFinished( const TQString &name ) {
m_subdirs . remove ( name ) ;
}
void VirtualCopyJob : : slotCopying ( K IO: : Job * , const KURL & from , const KURL & to ) {
void VirtualCopyJob : : slotCopying ( TDE IO: : Job * , const KURL & from , const KURL & to ) {
if ( m_showProgressInfo )
Observer : : self ( ) - > slotCopying ( this , from , to ) ;
}
void VirtualCopyJob : : slotMoving ( K IO: : Job * , const KURL & from , const KURL & to ) {
void VirtualCopyJob : : slotMoving ( TDE IO: : Job * , const KURL & from , const KURL & to ) {
if ( m_showProgressInfo )
Observer : : self ( ) - > slotMoving ( this , from , to ) ;
}
void VirtualCopyJob : : slotCreatingDir ( K IO: : Job * , const KURL & to ) {
void VirtualCopyJob : : slotCreatingDir ( TDE IO: : Job * , const KURL & to ) {
if ( m_showProgressInfo )
Observer : : self ( ) - > slotCreatingDir ( this , to ) ;
}
void VirtualCopyJob : : slotProcessedFiles ( K IO: : Job * , unsigned long filenum ) {
void VirtualCopyJob : : slotProcessedFiles ( TDE IO: : Job * , unsigned long filenum ) {
m_tempFiles = filenum ;
}
void VirtualCopyJob : : slotProcessedDirs ( K IO: : Job * , unsigned long subdirs ) {
void VirtualCopyJob : : slotProcessedDirs ( TDE IO: : Job * , unsigned long subdirs ) {
m_tempSubdirs = subdirs ;
}
void VirtualCopyJob : : slotProcessedSize ( KIO: : Job * , K IO: : filesize_t size ) {
void VirtualCopyJob : : slotProcessedSize ( TDEIO: : Job * , TDE IO: : filesize_t size ) {
m_tempSize = size ;
}