@ -355,7 +355,7 @@ TQString Synchronizer::getTaskTypeName( TaskType taskType )
SynchronizerFileItem * Synchronizer : : addItem ( SynchronizerFileItem * parent , const TQString & leftFile ,
SynchronizerFileItem * Synchronizer : : addItem ( SynchronizerFileItem * parent , const TQString & leftFile ,
const TQString & rightFile , const TQString & leftDir ,
const TQString & rightFile , const TQString & leftDir ,
const TQString & rightDir , bool existsLeft , bool existsRight ,
const TQString & rightDir , bool existsLeft , bool existsRight ,
KIO: : filesize_t leftSize , K IO: : filesize_t rightSize ,
TDEIO: : filesize_t leftSize , TDE IO: : filesize_t rightSize ,
time_t leftDate , time_t rightDate , const TQString & leftLink ,
time_t leftDate , time_t rightDate , const TQString & leftLink ,
const TQString & rightLink , const TQString & leftOwner ,
const TQString & rightLink , const TQString & leftOwner ,
const TQString & rightOwner , const TQString & leftGroup ,
const TQString & rightOwner , const TQString & leftGroup ,
@ -420,7 +420,7 @@ void Synchronizer::setPermanent( SynchronizerFileItem *item )
}
}
SynchronizerFileItem * Synchronizer : : addLeftOnlyItem ( SynchronizerFileItem * parent ,
SynchronizerFileItem * Synchronizer : : addLeftOnlyItem ( SynchronizerFileItem * parent ,
const TQString & file_name , const TQString & dir , K IO: : filesize_t size ,
const TQString & file_name , const TQString & dir , TDE IO: : filesize_t size ,
time_t date , const TQString & link , const TQString & owner ,
time_t date , const TQString & link , const TQString & owner ,
const TQString & group , mode_t mode , const TQString & acl , bool isDir ,
const TQString & group , mode_t mode , const TQString & acl , bool isDir ,
bool isTemp )
bool isTemp )
@ -431,7 +431,7 @@ SynchronizerFileItem * Synchronizer::addLeftOnlyItem( SynchronizerFileItem *pare
}
}
SynchronizerFileItem * Synchronizer : : addRightOnlyItem ( SynchronizerFileItem * parent ,
SynchronizerFileItem * Synchronizer : : addRightOnlyItem ( SynchronizerFileItem * parent ,
const TQString & file_name , const TQString & dir , K IO: : filesize_t size ,
const TQString & file_name , const TQString & dir , TDE IO: : filesize_t size ,
time_t date , const TQString & link , const TQString & owner ,
time_t date , const TQString & link , const TQString & owner ,
const TQString & group , mode_t mode , const TQString & acl , bool isDir ,
const TQString & group , mode_t mode , const TQString & acl , bool isDir ,
bool isTemp )
bool isTemp )
@ -444,7 +444,7 @@ SynchronizerFileItem * Synchronizer::addRightOnlyItem( SynchronizerFileItem *par
SynchronizerFileItem * Synchronizer : : addDuplicateItem ( SynchronizerFileItem * parent ,
SynchronizerFileItem * Synchronizer : : addDuplicateItem ( SynchronizerFileItem * parent ,
const TQString & leftName , const TQString & rightName ,
const TQString & leftName , const TQString & rightName ,
const TQString & leftDir , const TQString & rightDir ,
const TQString & leftDir , const TQString & rightDir ,
KIO: : filesize_t leftSize , K IO: : filesize_t rightSize , time_t leftDate , time_t rightDate ,
TDEIO: : filesize_t leftSize , TDE IO: : filesize_t rightSize , time_t leftDate , time_t rightDate ,
const TQString & leftLink , const TQString & rightLink ,
const TQString & leftLink , const TQString & rightLink ,
const TQString & leftOwner , const TQString & rightOwner ,
const TQString & leftOwner , const TQString & rightOwner ,
const TQString & leftGroup , const TQString & rightGroup ,
const TQString & leftGroup , const TQString & rightGroup ,
@ -797,8 +797,8 @@ void Synchronizer::copyToRight( SynchronizerFileItem *item )
}
}
}
}
bool Synchronizer : : totalSizes ( int * leftCopyNr , K IO: : filesize_t * leftCopySize , int * rightCopyNr ,
bool Synchronizer : : totalSizes ( int * leftCopyNr , TDE IO: : filesize_t * leftCopySize , int * rightCopyNr ,
K IO: : filesize_t * rightCopySize , int * deleteNr , K IO: : filesize_t * deletableSize )
TDE IO: : filesize_t * rightCopySize , int * deleteNr , TDE IO: : filesize_t * deletableSize )
{
{
bool hasAnythingToDo = false ;
bool hasAnythingToDo = false ;
@ -953,8 +953,8 @@ void Synchronizer::executeTask( SynchronizerFileItem * task )
case TT_COPY_TO_LEFT :
case TT_COPY_TO_LEFT :
if ( task - > isDir ( ) )
if ( task - > isDir ( ) )
{
{
KIO: : SimpleJob * job = K IO: : mkdir ( leftURL ) ;
TDEIO: : SimpleJob * job = TDE IO: : mkdir ( leftURL ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
disableNewTasks = true ;
disableNewTasks = true ;
}
}
@ -965,16 +965,16 @@ void Synchronizer::executeTask( SynchronizerFileItem * task )
destURL = vfs : : fromPathOrURL ( task - > destination ( ) ) ;
destURL = vfs : : fromPathOrURL ( task - > destination ( ) ) ;
if ( task - > rightLink ( ) . isNull ( ) ) {
if ( task - > rightLink ( ) . isNull ( ) ) {
KIO: : FileCopyJob * job = K IO: : file_copy ( rightURL , destURL , - 1 ,
TDEIO: : FileCopyJob * job = TDE IO: : file_copy ( rightURL , destURL , - 1 ,
overWrite | | task - > overWrite ( ) , false , false ) ;
overWrite | | task - > overWrite ( ) , false , false ) ;
connect ( job , TQT_SIGNAL ( processedSize ( KIO: : Job * , K IO: : filesize_t ) ) , this ,
connect ( job , TQT_SIGNAL ( processedSize ( TDEIO: : Job * , TDE IO: : filesize_t ) ) , this ,
TQT_SLOT ( slotProcessedSize ( KIO: : Job * , K IO: : filesize_t ) ) ) ;
TQT_SLOT ( slotProcessedSize ( TDEIO: : Job * , TDE IO: : filesize_t ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
} else {
} else {
KIO: : SimpleJob * job = K IO: : symlink ( task - > rightLink ( ) , destURL ,
TDEIO: : SimpleJob * job = TDE IO: : symlink ( task - > rightLink ( ) , destURL ,
overWrite | | task - > overWrite ( ) , false ) ;
overWrite | | task - > overWrite ( ) , false ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
}
}
}
}
@ -982,8 +982,8 @@ void Synchronizer::executeTask( SynchronizerFileItem * task )
case TT_COPY_TO_RIGHT :
case TT_COPY_TO_RIGHT :
if ( task - > isDir ( ) )
if ( task - > isDir ( ) )
{
{
KIO: : SimpleJob * job = K IO: : mkdir ( rightURL ) ;
TDEIO: : SimpleJob * job = TDE IO: : mkdir ( rightURL ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
disableNewTasks = true ;
disableNewTasks = true ;
}
}
@ -994,24 +994,24 @@ void Synchronizer::executeTask( SynchronizerFileItem * task )
destURL = vfs : : fromPathOrURL ( task - > destination ( ) ) ;
destURL = vfs : : fromPathOrURL ( task - > destination ( ) ) ;
if ( task - > leftLink ( ) . isNull ( ) ) {
if ( task - > leftLink ( ) . isNull ( ) ) {
KIO: : FileCopyJob * job = K IO: : file_copy ( leftURL , destURL , - 1 ,
TDEIO: : FileCopyJob * job = TDE IO: : file_copy ( leftURL , destURL , - 1 ,
overWrite | | task - > overWrite ( ) , false , false ) ;
overWrite | | task - > overWrite ( ) , false , false ) ;
connect ( job , TQT_SIGNAL ( processedSize ( KIO: : Job * , K IO: : filesize_t ) ) , this ,
connect ( job , TQT_SIGNAL ( processedSize ( TDEIO: : Job * , TDE IO: : filesize_t ) ) , this ,
TQT_SLOT ( slotProcessedSize ( KIO: : Job * , K IO: : filesize_t ) ) ) ;
TQT_SLOT ( slotProcessedSize ( TDEIO: : Job * , TDE IO: : filesize_t ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
} else {
} else {
KIO: : SimpleJob * job = K IO: : symlink ( task - > leftLink ( ) , destURL ,
TDEIO: : SimpleJob * job = TDE IO: : symlink ( task - > leftLink ( ) , destURL ,
overWrite | | task - > overWrite ( ) , false ) ;
overWrite | | task - > overWrite ( ) , false ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
}
}
}
}
break ;
break ;
case TT_DELETE :
case TT_DELETE :
{
{
KIO: : DeleteJob * job = K IO: : del ( leftURL , false ) ;
TDEIO: : DeleteJob * job = TDE IO: : del ( leftURL , false ) ;
connect ( job , TQT_SIGNAL ( result ( K IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( K IO: : Job * ) ) ) ;
connect ( job , TQT_SIGNAL ( result ( TDE IO: : Job * ) ) , this , TQT_SLOT ( slotTaskFinished ( TDE IO: : Job * ) ) ) ;
jobMap [ job ] = task ;
jobMap [ job ] = task ;
}
}
break ;
break ;
@ -1020,14 +1020,14 @@ void Synchronizer::executeTask( SynchronizerFileItem * task )
}
}
}
}
void Synchronizer : : slotTaskFinished ( K IO: : Job * job )
void Synchronizer : : slotTaskFinished ( TDE IO: : Job * job )
{
{
inTaskFinished + + ;
inTaskFinished + + ;
SynchronizerFileItem * item = jobMap [ job ] ;
SynchronizerFileItem * item = jobMap [ job ] ;
jobMap . remove ( job ) ;
jobMap . remove ( job ) ;
K IO: : filesize_t receivedSize = 0 ;
TDE IO: : filesize_t receivedSize = 0 ;
if ( receivedMap . contains ( job ) ) {
if ( receivedMap . contains ( job ) ) {
receivedSize = receivedMap [ job ] ;
receivedSize = receivedMap [ job ] ;
@ -1135,9 +1135,9 @@ void Synchronizer::slotTaskFinished(KIO::Job *job )
}
}
else
else
{
{
if ( job - > error ( ) = = K IO: : ERR_FILE_ALREADY_EXIST & & item - > task ( ) ! = TT_DELETE )
if ( job - > error ( ) = = TDE IO: : ERR_FILE_ALREADY_EXIST & & item - > task ( ) ! = TT_DELETE )
{
{
K IO: : RenameDlg_Result result ;
TDE IO: : RenameDlg_Result result ;
TQString newDest ;
TQString newDest ;
if ( autoSkip )
if ( autoSkip )
@ -1150,7 +1150,7 @@ void Synchronizer::slotTaskFinished(KIO::Job *job )
result = Observer : : self ( ) - > open_RenameDlg ( job , i18n ( " File Already Exists " ) ,
result = Observer : : self ( ) - > open_RenameDlg ( job , i18n ( " File Already Exists " ) ,
vfs : : pathOrURL ( rightURL ) , vfs : : pathOrURL ( leftURL ) ,
vfs : : pathOrURL ( rightURL ) , vfs : : pathOrURL ( leftURL ) ,
( KIO: : RenameDlg_Mode ) ( KIO : : M_OVERWRITE | KIO : : M_SKIP | K IO: : M_MULTI ) , newDest ,
( TDEIO: : RenameDlg_Mode ) ( TDEIO : : M_OVERWRITE | TDEIO : : M_SKIP | TDE IO: : M_MULTI ) , newDest ,
item - > rightSize ( ) , item - > leftSize ( ) , ( time_t ) - 1 , ( time_t ) - 1 ,
item - > rightSize ( ) , item - > leftSize ( ) , ( time_t ) - 1 , ( time_t ) - 1 ,
item - > rightDate ( ) , item - > leftDate ( ) ) ;
item - > rightDate ( ) , item - > leftDate ( ) ) ;
@ -1163,7 +1163,7 @@ void Synchronizer::slotTaskFinished(KIO::Job *job )
result = Observer : : self ( ) - > open_RenameDlg ( job , i18n ( " File Already Exists " ) ,
result = Observer : : self ( ) - > open_RenameDlg ( job , i18n ( " File Already Exists " ) ,
vfs : : pathOrURL ( leftURL ) , vfs : : pathOrURL ( rightURL ) ,
vfs : : pathOrURL ( leftURL ) , vfs : : pathOrURL ( rightURL ) ,
( KIO: : RenameDlg_Mode ) ( KIO : : M_OVERWRITE | KIO : : M_SKIP | K IO: : M_MULTI ) , newDest ,
( TDEIO: : RenameDlg_Mode ) ( TDEIO : : M_OVERWRITE | TDEIO : : M_SKIP | TDE IO: : M_MULTI ) , newDest ,
item - > leftSize ( ) , item - > rightSize ( ) , ( time_t ) - 1 , ( time_t ) - 1 ,
item - > leftSize ( ) , item - > rightSize ( ) , ( time_t ) - 1 , ( time_t ) - 1 ,
item - > leftDate ( ) , item - > rightDate ( ) ) ;
item - > leftDate ( ) , item - > rightDate ( ) ) ;
@ -1172,31 +1172,31 @@ void Synchronizer::slotTaskFinished(KIO::Job *job )
switch ( result )
switch ( result )
{
{
case K IO: : R_RENAME :
case TDE IO: : R_RENAME :
item - > setDestination ( newDest ) ;
item - > setDestination ( newDest ) ;
executeTask ( item ) ;
executeTask ( item ) ;
inTaskFinished - - ;
inTaskFinished - - ;
return ;
return ;
case K IO: : R_OVERWRITE :
case TDE IO: : R_OVERWRITE :
item - > setOverWrite ( ) ;
item - > setOverWrite ( ) ;
executeTask ( item ) ;
executeTask ( item ) ;
inTaskFinished - - ;
inTaskFinished - - ;
return ;
return ;
case K IO: : R_OVERWRITE_ALL :
case TDE IO: : R_OVERWRITE_ALL :
overWrite = true ;
overWrite = true ;
executeTask ( item ) ;
executeTask ( item ) ;
inTaskFinished - - ;
inTaskFinished - - ;
return ;
return ;
case K IO: : R_AUTO_SKIP :
case TDE IO: : R_AUTO_SKIP :
autoSkip = true ;
autoSkip = true ;
case K IO: : R_SKIP :
case TDE IO: : R_SKIP :
default :
default :
break ;
break ;
}
}
break ;
break ;
}
}
if ( job - > error ( ) ! = K IO: : ERR_DOES_NOT_EXIST | | item - > task ( ) ! = TT_DELETE )
if ( job - > error ( ) ! = TDE IO: : ERR_DOES_NOT_EXIST | | item - > task ( ) ! = TT_DELETE )
{
{
if ( autoSkip )
if ( autoSkip )
break ;
break ;
@ -1225,17 +1225,17 @@ void Synchronizer::slotTaskFinished(KIO::Job *job )
TQWidget * mainWidget = tqApp - > mainWidget ( ) ; // WORKAROUND, don't give focus to the main widget
TQWidget * mainWidget = tqApp - > mainWidget ( ) ; // WORKAROUND, don't give focus to the main widget
tqApp - > setMainWidget ( syncDlgWidget ) ;
tqApp - > setMainWidget ( syncDlgWidget ) ;
K IO: : SkipDlg_Result result = Observer : : self ( ) - > open_SkipDlg ( job , true , error ) ;
TDE IO: : SkipDlg_Result result = Observer : : self ( ) - > open_SkipDlg ( job , true , error ) ;
tqApp - > setMainWidget ( mainWidget ) ;
tqApp - > setMainWidget ( mainWidget ) ;
switch ( result )
switch ( result )
{
{
case K IO: : S_CANCEL :
case TDE IO: : S_CANCEL :
executeTask ( item ) ; /* simply retry */
executeTask ( item ) ; /* simply retry */
inTaskFinished - - ;
inTaskFinished - - ;
return ;
return ;
case K IO: : S_AUTO_SKIP :
case TDE IO: : S_AUTO_SKIP :
autoSkip = true ;
autoSkip = true ;
default :
default :
break ;
break ;
@ -1272,12 +1272,12 @@ void Synchronizer::slotTaskFinished(KIO::Job *job )
}
}
}
}
void Synchronizer : : slotProcessedSize ( KIO: : Job * job , K IO: : filesize_t size )
void Synchronizer : : slotProcessedSize ( TDEIO: : Job * job , TDE IO: : filesize_t size )
{
{
K IO: : filesize_t dl = 0 , dr = 0 , dd = 0 ;
TDE IO: : filesize_t dl = 0 , dr = 0 , dd = 0 ;
SynchronizerFileItem * item = jobMap [ job ] ;
SynchronizerFileItem * item = jobMap [ job ] ;
K IO: : filesize_t lastProcessedSize = 0 ;
TDE IO: : filesize_t lastProcessedSize = 0 ;
if ( receivedMap . contains ( job ) )
if ( receivedMap . contains ( job ) )
lastProcessedSize = receivedMap [ job ] ;
lastProcessedSize = receivedMap [ job ] ;