@ -125,7 +125,7 @@ void BatchRenamer::processFiles( ProgressDialog* p, TQObject* object )
}
}
p - > print ( TQString ( i18n ( " Filenames Processed after %1 seconds. " ) ) .arg ( t . elapsed ( ) / 1000 ) ) ;
p - > print ( i18n ( " Filenames Processed after %1 seconds. " ) .arg ( t . elapsed ( ) / 1000 ) ) ;
work ( p ) ;
}
@ -258,14 +258,14 @@ void BatchRenamer::work( ProgressDialog* p )
* Give the user some information . . .
*/
if ( m_mode = = COPY )
p - > print ( TQString ( i18n ( " Files will be copied to: %1 " ) ) . arg ( m_files [ 0 ] . dst . directory ) ) ;
p - > print ( i18n ( " Files will be copied to: %1 " ) . arg ( m_files [ 0 ] . dst . directory ) ) ;
else if ( m_mode = = MOVE )
p - > print ( TQString ( i18n ( " Files will be moved to: %1 " ) ) . arg ( m_files [ 0 ] . dst . directory ) ) ;
p - > print ( i18n ( " Files will be moved to: %1 " ) . arg ( m_files [ 0 ] . dst . directory ) ) ;
else if ( m_mode = = LINK )
p - > print ( TQString ( i18n ( " Symbolic links will be created in: %1 " ) ) . arg ( m_files [ 0 ] . dst . directory ) ) ;
p - > print ( i18n ( " Symbolic links will be created in: %1 " ) . arg ( m_files [ 0 ] . dst . directory ) ) ;
else if ( m_mode = = RENAME )
p - > print ( i18n ( " Input files will be renamed. " ) ) ;
p - > print ( i18n ( " Input files will be renamed. " ) ) ;
unsigned int i ;
for ( i = 0 ; i < m_files . count ( ) ; i + + ) {
p - > setProgress ( i + 1 ) ;
@ -317,7 +317,7 @@ void BatchRenamer::work( ProgressDialog* p )
( * tundo ) < < " mv --force -b --suffix=.krename_ \" " < < m_files [ i ] . dst . name
< < " \" \" " < < m_files [ i ] . src . name < < " \" " < < endl ;
} else
p - > warning ( TQString ( i18n ( " Undo is not possible for remote file: %1 " ) ) . arg ( dst . prettyURL ( ) ) ) ;
p - > warning ( i18n ( " Undo is not possible for remote file: %1 " ) . arg ( dst . prettyURL ( ) ) ) ;
}
@ -329,24 +329,24 @@ void BatchRenamer::work( ProgressDialog* p )
}
}
const TQString m = TQString( i18n( " Renamed %1 files successfully. " ) ) . arg ( i - error ) ;
const TQString m = i18n( " Renamed %1 files successfully. " ) . arg ( i - error ) ;
( i - error ) ? p - > print ( m ) : p - > warning ( m ) ;
if ( error > 0 )
p - > warning ( TQString ( i18n ( " %2 errors occurred! " ) ) . arg ( error ) ) ;
p - > warning ( i18n ( " %2 errors occurred! " ) . arg ( error ) ) ;
p - > print ( TQString ( i18n ( " Elapsed time: %1 seconds " ) ) . arg ( t . elapsed ( ) / 1000 ) , " kalarm " ) ;
p - > print ( i18n ( " KRename finished the renaming process. " ) , " krename " ) ;
p - > print ( i18n ( " Press close to quit! " ) ) ;
p - > print ( i18n ( " Elapsed time: %1 seconds " ) . arg ( t . elapsed ( ) / 1000 ) , " kalarm " ) ;
p - > print ( i18n ( " KRename finished the renaming process. " ) , " krename " ) ;
p - > print ( i18n ( " Press close to quit! " ) ) ;
p - > setRenamedFiles ( renamedFiles , m_files . count ( ) ) ;
if ( undo ) {
( * tundo ) < < endl < < " echo \" Finished undoing " < < m_files . count ( ) < < " actions. \" " < < endl ;
delete tundo ;
fundo - > close ( ) ;
// Make fundo exuteable
if ( chmod ( ( const char * ) m_undoScript , ( unsigned int ) S_IRUSR | S_IWUSR | S_IXUSR ) )
if ( chmod ( m_undoScript . local8Bit ( ) , ( unsigned int ) S_IRUSR | S_IWUSR | S_IXUSR ) )
p - > error ( i18n ( " Can't set executable bit on undo script. " ) ) ;
delete fundo ;
}
@ -361,7 +361,7 @@ void BatchRenamer::escape( TQString & text, const TQString & token, const TQStri
text . replace ( token , sequence ) ;
}
TQString & BatchRenamer : : doEscape ( TQString text , bool filename )
TQString & BatchRenamer : : doEscape ( TQString & text , bool filename )
{
if ( filename ) {
BatchRenamer : : escape ( text , " & " , TQChar ( 60000 ) ) ;
@ -840,13 +840,13 @@ void BatchRenamer::parseSubdirs( data* f )
// create the missing subdir now
int i = 0 ;
TQString d = " " ;
while ( ( d = dirs . section ( " / " , i , i , TQString : : SectionSkipEmpty ) ) & & ! d . isEmpty ( ) ) { // asignment here!
while ( ! ( d = dirs . section ( " / " , i , i , TQString : : SectionSkipEmpty ) ) . isEmpty ( ) ) { // asignment here!
KURL url = f - > dst . url ;
// it is important to unescape here
// to support dirnames containing "&" or
// similar tokens
url . addPath ( unEscape ( d ) ) ;
if ( ! NetAccess : : exists ( url ) & & ! NetAccess : : mkdir ( url ) )
if ( ! NetAccess : : exists ( url , false , 0 ) & & ! NetAccess : : mkdir ( url , 0 , - 1 ) )
// TODO: GUI bug report
tqDebug ( " Can't create %s " , url . prettyURL ( ) . latin1 ( ) ) ;