@ -56,11 +56,11 @@ using namespace whatthisNameSpace;
//PUBLIC CONSTRUCTORS
// Factory code for KDE 3
typedef KParts : : GenericFactory < K FileReplacePart> FileReplaceFactory ;
typedef KParts : : GenericFactory < TDE FileReplacePart> FileReplaceFactory ;
K_EXPORT_COMPONENT_FACTORY ( libtdefilereplacepart , FileReplaceFactory )
KFileReplacePart: : K FileReplacePart( TQWidget * parentWidget , const char * , TQObject * parent , const char * name , const TQStringList & ) : KParts : : ReadOnlyPart ( parent , name )
TDEFileReplacePart: : TDE FileReplacePart( TQWidget * parentWidget , const char * , TQObject * parent , const char * name , const TQStringList & ) : KParts : : ReadOnlyPart ( parent , name )
{
setInstance ( FileReplaceFactory : : instance ( ) ) ;
TDEGlobal : : locale ( ) - > insertCatalogue ( " tdefilereplace " ) ;
@ -79,7 +79,7 @@ KFileReplacePart::KFileReplacePart(TQWidget* parentWidget, const char* , TQObjec
whatsThis ( ) ;
}
KFileReplacePart: : ~ K FileReplacePart( )
TDEFileReplacePart: : ~ TDE FileReplacePart( )
{
m_view = 0 ; //it's already deleted, so set it to NULL
@ -95,14 +95,14 @@ KFileReplacePart::~KFileReplacePart()
}
//PRIVATE SLOTS
void K FileReplacePart: : slotSetNewParameters ( )
void TDE FileReplacePart: : slotSetNewParameters ( )
{
launchNewProjectDialog ( KURL ( ) ) ;
m_view - > changeView ( m_option - > m_searchingOnlyMode ) ;
emit setStatusBarText ( i18n ( " Ready. " ) ) ;
}
void K FileReplacePart: : slotSearchingOperation ( )
void TDE FileReplacePart: : slotSearchingOperation ( )
{
if ( ! checkBeforeOperation ( ) )
return ;
@ -159,7 +159,7 @@ void KFileReplacePart::slotSearchingOperation()
m_view - > showSemaphore ( " green " ) ;
}
void K FileReplacePart: : slotReplacingOperation ( )
void TDE FileReplacePart: : slotReplacingOperation ( )
{
if ( KMessageBox : : warningContinueCancel ( m_w , i18n ( " <qt>You have selected <b>%1</b> as the encoding of the files.<br>Selecting the correct encoding is very important as if you have files that have some other encoding than the selected one, after a replace you may damage those files.<br><br>In case you do not know the encoding of your files, select <i>utf8</i> and <b>enable</b> the creation of backup files. This setting will autodetect <i>utf8</i> and <i>utf16</i> files, but the changed files will be converted to <i>utf8</i>.</qt> " ) . arg ( m_option - > m_encoding ) , i18n ( " File Encoding Warning " ) , KStdGuiItem : : cont ( ) , " ShowEncodingWarning " ) = = KMessageBox : : Cancel )
return ;
@ -221,14 +221,14 @@ void KFileReplacePart::slotReplacingOperation()
m_view - > showSemaphore ( " green " ) ;
}
void K FileReplacePart: : slotSimulatingOperation ( )
void TDE FileReplacePart: : slotSimulatingOperation ( )
{
m_option - > m_simulation = true ;
slotReplacingOperation ( ) ;
m_option - > m_simulation = false ;
}
void K FileReplacePart: : slotStop ( )
void TDE FileReplacePart: : slotStop ( )
{
emit setStatusBarText ( i18n ( " Stopping... " ) ) ;
m_stop = true ;
@ -236,7 +236,7 @@ void KFileReplacePart::slotStop()
resetActions ( ) ;
}
void K FileReplacePart: : slotCreateReport ( )
void TDE FileReplacePart: : slotCreateReport ( )
{
// Check there are results
TDEListView * rv = m_view - > getResultsView ( ) ,
@ -280,13 +280,13 @@ void KFileReplacePart::slotCreateReport()
//resetActions();
}
void K FileReplacePart: : slotStringsAdd ( )
void TDE FileReplacePart: : slotStringsAdd ( )
{
m_view - > slotStringsAdd ( ) ;
resetActions ( ) ;
}
void K FileReplacePart: : slotQuickStringsAdd ( )
void TDE FileReplacePart: : slotQuickStringsAdd ( )
{
//this slot handles a pair of strings that come from project dialog,
//if the control character 'N' is found at the position 0 of the two strings,
@ -318,33 +318,33 @@ void KFileReplacePart::slotQuickStringsAdd()
slotReplacingOperation ( ) ;
}
void K FileReplacePart: : slotStringsDeleteItem ( )
void TDE FileReplacePart: : slotStringsDeleteItem ( )
{
m_view - > slotStringsDeleteItem ( ) ;
resetActions ( ) ;
}
void K FileReplacePart: : slotStringsEmpty ( )
void TDE FileReplacePart: : slotStringsEmpty ( )
{
m_view - > slotStringsEmpty ( ) ;
resetActions ( ) ;
}
void K FileReplacePart: : slotStringsEdit ( )
void TDE FileReplacePart: : slotStringsEdit ( )
{
m_view - > slotStringsEdit ( ) ;
resetActions ( ) ;
}
void K FileReplacePart: : slotStringsSave ( )
void TDE FileReplacePart: : slotStringsSave ( )
{
m_view - > slotStringsSave ( ) ;
}
void K FileReplacePart: : slotStringsLoad ( )
void TDE FileReplacePart: : slotStringsLoad ( )
{
// Selects the file to load from
TQString menu = " *.kfr| " + i18n ( " K FileReplace strings" ) + " (*.kfr) \n *| " + i18n ( " All Files " ) + " (*) " ;
TQString menu = " *.kfr| " + i18n ( " TDE FileReplace strings" ) + " (*.kfr) \n *| " + i18n ( " All Files " ) + " (*) " ;
TQString fileName = KFileDialog : : getOpenFileName ( TQString ( ) , menu , m_w , i18n ( " Load Strings From File " ) ) ;
if ( ! fileName . isEmpty ( ) )
@ -353,19 +353,19 @@ void KFileReplacePart::slotStringsLoad()
resetActions ( ) ;
}
void K FileReplacePart: : slotStringsInvertCur ( )
void TDE FileReplacePart: : slotStringsInvertCur ( )
{
m_view - > stringsInvert ( false ) ;
resetActions ( ) ;
}
void K FileReplacePart: : slotStringsInvertAll ( )
void TDE FileReplacePart: : slotStringsInvertAll ( )
{
m_view - > stringsInvert ( true ) ;
resetActions ( ) ;
}
void K FileReplacePart: : slotOpenRecentStringFile ( const KURL & urlFile )
void TDE FileReplacePart: : slotOpenRecentStringFile ( const KURL & urlFile )
{
TQString fileName ;
@ -386,37 +386,37 @@ void KFileReplacePart::slotOpenRecentStringFile(const KURL& urlFile)
resetActions ( ) ;
}
void K FileReplacePart: : slotOptionRecursive ( )
void TDE FileReplacePart: : slotOptionRecursive ( )
{
m_option - > m_recursive = ! m_option - > m_recursive ;
resetActions ( ) ;
}
void K FileReplacePart: : slotOptionBackup ( )
void TDE FileReplacePart: : slotOptionBackup ( )
{
m_option - > m_backup = ! m_option - > m_backup ;
resetActions ( ) ;
}
void K FileReplacePart: : slotOptionCaseSensitive ( )
void TDE FileReplacePart: : slotOptionCaseSensitive ( )
{
m_option - > m_caseSensitive = ! m_option - > m_caseSensitive ;
resetActions ( ) ;
}
void K FileReplacePart: : slotOptionVariables ( )
void TDE FileReplacePart: : slotOptionVariables ( )
{
m_option - > m_variables = ! m_option - > m_variables ;
resetActions ( ) ;
}
void K FileReplacePart: : slotOptionRegularExpressions ( )
void TDE FileReplacePart: : slotOptionRegularExpressions ( )
{
m_option - > m_regularExpressions = ! m_option - > m_regularExpressions ;
resetActions ( ) ;
}
void K FileReplacePart: : slotOptionPreferences ( )
void TDE FileReplacePart: : slotOptionPreferences ( )
{
KOptionsDlg dlg ( m_option , m_w , 0 ) ;
@ -429,7 +429,7 @@ void KFileReplacePart::slotOptionPreferences()
resetActions ( ) ;
}
void K FileReplacePart: : showAboutApplication ( )
void TDE FileReplacePart: : showAboutApplication ( )
{
m_aboutDlg = new TDEAboutApplication ( createAboutData ( ) , ( TQWidget * ) 0 , ( const char * ) 0 , false ) ;
if ( m_aboutDlg = = 0 )
@ -441,18 +441,18 @@ void KFileReplacePart::showAboutApplication()
m_aboutDlg - > raise ( ) ;
}
void K FileReplacePart: : appHelpActivated ( )
void TDE FileReplacePart: : appHelpActivated ( )
{
kapp - > invokeHelp ( TQString ( ) , " tdefilereplace " ) ;
}
void K FileReplacePart: : reportBug ( )
void TDE FileReplacePart: : reportBug ( )
{
KBugReport dlg ( m_w , true , createAboutData ( ) ) ;
dlg . exec ( ) ;
}
void K FileReplacePart: : resetActions ( )
void TDE FileReplacePart: : resetActions ( )
{
TDEListView * rv = m_view - > getResultsView ( ) ,
* sv = m_view - > getStringsView ( ) ;
@ -507,16 +507,16 @@ void KFileReplacePart::resetActions()
}
//PUBLIC METHODS
TDEAboutData * K FileReplacePart: : createAboutData ( )
TDEAboutData * TDE FileReplacePart: : createAboutData ( )
{
TDEAboutData * aboutData = new TDEAboutData ( " tdefilereplacepart " ,
I18N_NOOP ( " K FileReplacePart" ) ,
I18N_NOOP ( " TDE FileReplacePart" ) ,
KFR_VERSION ,
I18N_NOOP ( " Batch search and replace tool. " ) ,
TDEAboutData : : License_GPL_V2 ,
" (C) 1999-2002 Fran<61> is Dupoux \n (C) 2003-2004 Andras Mantia \n (C) 2004 Emiliano Gulmini " , I18N_NOOP ( " Part of the KDEWebDev module. " ) , " http://www.kdewebdev.org " ) ;
aboutData - > addAuthor ( " Fran<EFBFBD> is Dupoux " ,
I18N_NOOP ( " Original author of the K FileReplace tool" ) ,
I18N_NOOP ( " Original author of the TDE FileReplace tool" ) ,
" dupoux@dupoux.com " ) ;
aboutData - > addAuthor ( " Emiliano Gulmini " ,
I18N_NOOP ( " Current maintainer, code cleaner and rewriter " ) ,
@ -531,11 +531,11 @@ TDEAboutData* KFileReplacePart::createAboutData()
}
//PROTECTED METHODS
bool K FileReplacePart: : openURL ( const KURL & url )
bool TDE FileReplacePart: : openURL ( const KURL & url )
{
if ( ! url . isEmpty ( ) & & ( url . protocol ( ) ! = " file " ) )
{
KMessageBox : : sorry ( m_w , i18n ( " Sorry, currently the K FileReplace part works only for local files." ) , i18n ( " Non Local File " ) ) ;
KMessageBox : : sorry ( m_w , i18n ( " Sorry, currently the TDE FileReplace part works only for local files." ) , i18n ( " Non Local File " ) ) ;
emit canceled ( " " ) ;
return false ;
}
@ -549,7 +549,7 @@ bool KFileReplacePart::openURL(const KURL &url)
}
//PRIVATE METHODS
void K FileReplacePart: : initGUI ( )
void TDE FileReplacePart: : initGUI ( )
{
setXMLFile ( " tdefilereplacepartui.rc " ) ;
@ -592,7 +592,7 @@ void KFileReplacePart::initGUI()
( void ) new TDEToggleAction ( i18n ( " Case &Sensitive " ) , " casesensitive_option " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotOptionCaseSensitive ( ) ) , actionCollection ( ) , " options_case " ) ;
( void ) new TDEToggleAction ( i18n ( " Enable Commands &in Replace String: [$command:option$] " ) , " command_option " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotOptionVariables ( ) ) , actionCollection ( ) , " options_var " ) ;
( void ) new TDEToggleAction ( i18n ( " Enable &Regular Expressions " ) , " regularexpression_option " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotOptionRegularExpressions ( ) ) , actionCollection ( ) , " options_regularexpressions " ) ;
( void ) new TDEAction ( i18n ( " Configure & K FileReplace..." ) , " configure " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotOptionPreferences ( ) ) , actionCollection ( ) , " configure_tdefilereplace " ) ;
( void ) new TDEAction ( i18n ( " Configure & TDE FileReplace..." ) , " configure " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( slotOptionPreferences ( ) ) , actionCollection ( ) , " configure_tdefilereplace " ) ;
// Results
( void ) new TDEAction ( i18n ( " &Properties " ) , " informations " , 0 , TQT_TQOBJECT ( m_view ) , TQT_SLOT ( slotResultProperties ( ) ) , actionCollection ( ) , " results_infos " ) ;
@ -606,15 +606,15 @@ void KFileReplacePart::initGUI()
( void ) new TDEAction ( i18n ( " &Delete " ) , " editdelete " , 0 , TQT_TQOBJECT ( m_view ) , TQT_SLOT ( slotResultDelete ( ) ) , actionCollection ( ) , " results_delete " ) ;
( void ) new TDEAction ( i18n ( " E&xpand Tree " ) , 0 , TQT_TQOBJECT ( m_view ) , TQT_SLOT ( slotResultTreeExpand ( ) ) , actionCollection ( ) , " results_treeexpand " ) ;
( void ) new TDEAction ( i18n ( " &Reduce Tree " ) , 0 , TQT_TQOBJECT ( m_view ) , TQT_SLOT ( slotResultTreeReduce ( ) ) , actionCollection ( ) , " results_treereduce " ) ;
( void ) new TDEAction ( i18n ( " &About K FileReplace" ) , " tdefilereplace " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showAboutApplication ( ) ) , actionCollection ( ) , " help_about_tdefilereplace " ) ;
( void ) new TDEAction ( i18n ( " K FileReplace &Handbook" ) , " help " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( appHelpActivated ( ) ) , actionCollection ( ) , " help_tdefilereplace " ) ;
( void ) new TDEAction ( i18n ( " &About TDE FileReplace" ) , " tdefilereplace " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( showAboutApplication ( ) ) , actionCollection ( ) , " help_about_tdefilereplace " ) ;
( void ) new TDEAction ( i18n ( " TDE FileReplace &Handbook" ) , " help " , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( appHelpActivated ( ) ) , actionCollection ( ) , " help_tdefilereplace " ) ;
( void ) new TDEAction ( i18n ( " &Report Bug " ) , 0 , 0 , TQT_TQOBJECT ( this ) , TQT_SLOT ( reportBug ( ) ) , actionCollection ( ) , " report_bug " ) ;
}
void K FileReplacePart: : initView ( )
void TDE FileReplacePart: : initView ( )
{
m_view = new K FileReplaceView( m_option , m_parentWidget , " view " ) ;
m_view = new TDE FileReplaceView( m_option , m_parentWidget , " view " ) ;
setWidget ( m_view ) ;
@ -623,7 +623,7 @@ void KFileReplacePart::initView()
m_view - > showSemaphore ( " green " ) ;
}
void K FileReplacePart: : freezeActions ( )
void TDE FileReplacePart: : freezeActions ( )
{
//Disables actions during search/replace operation
actionCollection ( ) - > action ( " new_project " ) - > setEnabled ( false ) ;
@ -661,7 +661,7 @@ void KFileReplacePart::freezeActions()
( ( TDEToggleAction * ) actionCollection ( ) - > action ( " options_regularexpressions " ) ) - > setChecked ( false ) ;
}
void K FileReplacePart: : loadOptionsFromRC ( )
void TDE FileReplacePart: : loadOptionsFromRC ( )
{
m_option = new RCOptions ( ) ;
@ -674,7 +674,7 @@ void KFileReplacePart::loadOptionsFromRC()
loadBackupExtensionOptions ( ) ;
}
void K FileReplacePart: : loadOptions ( )
void TDE FileReplacePart: : loadOptions ( )
{
m_config - > setGroup ( " General Options " ) ;
@ -709,7 +709,7 @@ void KFileReplacePart::loadOptions()
m_option - > m_askConfirmReplace = false ;
}
void K FileReplacePart: : loadFileSizeOptions ( )
void TDE FileReplacePart: : loadFileSizeOptions ( )
{
m_config - > setGroup ( " Size options " ) ;
@ -717,7 +717,7 @@ void KFileReplacePart::loadFileSizeOptions()
m_option - > m_maxSize = m_config - > readNumEntry ( rcMaxFileSize , FileSizeOption ) ;
}
void K FileReplacePart: : loadDateAccessOptions ( )
void TDE FileReplacePart: : loadDateAccessOptions ( )
{
m_config - > setGroup ( " Access options " ) ;
@ -726,7 +726,7 @@ void KFileReplacePart::loadDateAccessOptions()
m_option - > m_maxDate = m_config - > readEntry ( rcMaxDate , AccessDateOption ) ;
}
void K FileReplacePart: : loadOwnerOptions ( )
void TDE FileReplacePart: : loadOwnerOptions ( )
{
m_config - > setGroup ( " Owner options " ) ;
@ -752,7 +752,7 @@ void KFileReplacePart::loadOwnerOptions()
m_option - > m_ownerGroupValue = ownerList [ 3 ] ;
}
void K FileReplacePart: : loadLocationsList ( )
void TDE FileReplacePart: : loadLocationsList ( )
{
m_config - > setGroup ( " Directories " ) ;
TQStringList locationsEntryList ;
@ -768,7 +768,7 @@ void KFileReplacePart::loadLocationsList()
m_option - > m_directories = locationsEntryList ;
}
void K FileReplacePart: : loadFiltersList ( )
void TDE FileReplacePart: : loadFiltersList ( )
{
TQStringList filtersEntryList ;
@ -785,7 +785,7 @@ void KFileReplacePart::loadFiltersList()
m_option - > m_filters = filtersEntryList ;
}
void K FileReplacePart: : loadBackupExtensionOptions ( )
void TDE FileReplacePart: : loadBackupExtensionOptions ( )
{
m_config - > setGroup ( " Options " ) ;
TQStringList bkList = TQStringList : : split ( ' , ' ,
@ -799,7 +799,7 @@ void KFileReplacePart::loadBackupExtensionOptions()
m_option - > m_backupExtension = bkList [ 1 ] ;
}
void K FileReplacePart: : saveOptionsToRC ( )
void TDE FileReplacePart: : saveOptionsToRC ( )
{
saveOptions ( ) ;
saveFileSizeOptions ( ) ;
@ -810,7 +810,7 @@ void KFileReplacePart::saveOptionsToRC()
saveBackupExtensionOptions ( ) ;
}
void K FileReplacePart: : saveOptions ( )
void TDE FileReplacePart: : saveOptions ( )
{
m_config - > setGroup ( " General Options " ) ;
@ -841,7 +841,7 @@ void KFileReplacePart::saveOptions()
m_config - > sync ( ) ;
}
void K FileReplacePart: : saveFileSizeOptions ( )
void TDE FileReplacePart: : saveFileSizeOptions ( )
{
m_config - > setGroup ( " Size options " ) ;
@ -851,7 +851,7 @@ void KFileReplacePart::saveFileSizeOptions()
m_config - > sync ( ) ;
}
void K FileReplacePart: : saveDateAccessOptions ( )
void TDE FileReplacePart: : saveDateAccessOptions ( )
{
m_config - > setGroup ( " Access options " ) ;
@ -862,7 +862,7 @@ void KFileReplacePart::saveDateAccessOptions()
m_config - > sync ( ) ;
}
void K FileReplacePart: : saveOwnerOptions ( )
void TDE FileReplacePart: : saveOwnerOptions ( )
{
m_config - > setGroup ( " Owner options " ) ;
@ -895,7 +895,7 @@ void KFileReplacePart::saveOwnerOptions()
m_config - > sync ( ) ;
}
void K FileReplacePart: : saveLocationsList ( )
void TDE FileReplacePart: : saveLocationsList ( )
{
m_config - > setGroup ( " Directories " ) ;
# if KDE_IS_VERSION(3,1,3)
@ -906,14 +906,14 @@ void KFileReplacePart::saveLocationsList()
m_config - > sync ( ) ;
}
void K FileReplacePart: : saveFiltersList ( )
void TDE FileReplacePart: : saveFiltersList ( )
{
m_config - > setGroup ( " Filters " ) ;
m_config - > writeEntry ( rcFiltersList , m_option - > m_filters ) ;
m_config - > sync ( ) ;
}
void K FileReplacePart: : saveBackupExtensionOptions ( )
void TDE FileReplacePart: : saveBackupExtensionOptions ( )
{
m_config - > setGroup ( " Options " ) ;
TQString bkOptions ;
@ -926,7 +926,7 @@ void KFileReplacePart::saveBackupExtensionOptions()
m_config - > sync ( ) ;
}
void K FileReplacePart: : fileReplace ( )
void TDE FileReplacePart: : fileReplace ( )
{
TQString directoryName = m_option - > m_directories [ 0 ] ;
TQDir d ( directoryName ) ;
@ -949,7 +949,7 @@ void KFileReplacePart::fileReplace()
break ;
// Avoids files that not match requirements
if ( ! K FileReplaceLib: : isAnAccessibleFile ( d . canonicalPath ( ) , fileName , m_option ) )
if ( ! TDE FileReplaceLib: : isAnAccessibleFile ( d . canonicalPath ( ) , fileName , m_option ) )
continue ;
kapp - > processEvents ( ) ;
if ( m_option - > m_backup )
@ -962,7 +962,7 @@ void KFileReplacePart::fileReplace()
}
}
void K FileReplacePart: : recursiveFileReplace ( const TQString & directoryName , int & filesNumber )
void TDE FileReplacePart: : recursiveFileReplace ( const TQString & directoryName , int & filesNumber )
{
//if m_stop == true then interrupts recursion
if ( m_stop )
@ -987,7 +987,7 @@ void KFileReplacePart::recursiveFileReplace(const TQString& directoryName, int&
TQString fileName = ( * filesIt ) ;
// Avoids files that not match requirements
if ( ! K FileReplaceLib: : isAnAccessibleFile ( d . canonicalPath ( ) , fileName , m_option ) )
if ( ! TDE FileReplaceLib: : isAnAccessibleFile ( d . canonicalPath ( ) , fileName , m_option ) )
continue ;
TQString filePath = d . canonicalPath ( ) + " / " + fileName ;
@ -1014,7 +1014,7 @@ void KFileReplacePart::recursiveFileReplace(const TQString& directoryName, int&
}
}
void K FileReplacePart: : replaceAndBackup ( const TQString & currentDir , const TQString & oldFileName )
void TDE FileReplacePart: : replaceAndBackup ( const TQString & currentDir , const TQString & oldFileName )
{
//Creates a path string
TQString oldPathString = currentDir + " / " + oldFileName ;
@ -1033,7 +1033,7 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri
TQString line = currentStream . read ( ) ,
backupLine = line ;
TQString backupSize = K FileReplaceLib: : formatFileSize ( currentFile . size ( ) ) ;
TQString backupSize = TDE FileReplaceLib: : formatFileSize ( currentFile . size ( ) ) ;
currentFile . close ( ) ;
@ -1081,10 +1081,10 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri
if ( atLeastOneStringFound & & item /* && atLeastOneStringConfirmed*/ )
{
K FileReplaceLib: : setIconForFileEntry ( item , currentDir + " / " + oldFileName ) ;
TDE FileReplaceLib: : setIconForFileEntry ( item , currentDir + " / " + oldFileName ) ;
item - > setText ( 0 , oldFileName ) ;
item - > setText ( 1 , currentDir ) ;
TQString newSize = K FileReplaceLib: : formatFileSize ( oldFileInfo . size ( ) ) ;
TQString newSize = TDE FileReplaceLib: : formatFileSize ( oldFileInfo . size ( ) ) ;
if ( ! m_option - > m_simulation )
{
item - > setText ( 2 , backupSize ) ;
@ -1102,7 +1102,7 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri
}
}
void K FileReplacePart: : replaceAndOverwrite ( const TQString & currentDir , const TQString & oldFileName )
void TDE FileReplacePart: : replaceAndOverwrite ( const TQString & currentDir , const TQString & oldFileName )
{
TQString oldPathString = currentDir + " / " + oldFileName ;
TQFile oldFile ( oldPathString ) ;
@ -1114,7 +1114,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS
return ;
}
TQString fileSizeBeforeReplacing = K FileReplaceLib: : formatFileSize ( oldFileInfo . size ( ) ) ;
TQString fileSizeBeforeReplacing = TDE FileReplaceLib: : formatFileSize ( oldFileInfo . size ( ) ) ;
TDEListViewItem * item = 0 ;
TQTextStream oldStream ( & oldFile ) ;
@ -1153,7 +1153,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS
}
TQFileInfo nf ( oldPathString ) ;
TQString fileSizeAfterReplacing = K FileReplaceLib: : formatFileSize ( nf . size ( ) ) ;
TQString fileSizeAfterReplacing = TDE FileReplaceLib: : formatFileSize ( nf . size ( ) ) ;
//if ignoreFiles == false then every files must be show
if ( ! m_option - > m_ignoreFiles )
@ -1161,7 +1161,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS
if ( atLeastOneStringFound & & item /*&& atLeastOneStringConfirmed*/ )
{
K FileReplaceLib: : setIconForFileEntry ( item , currentDir + " / " + oldFileName ) ;
TDE FileReplaceLib: : setIconForFileEntry ( item , currentDir + " / " + oldFileName ) ;
item - > setText ( 0 , oldFileName ) ;
item - > setText ( 1 , currentDir ) ;
item - > setText ( 2 , fileSizeBeforeReplacing ) ;
@ -1176,7 +1176,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS
}
}
void K FileReplacePart: : replacingLoop ( TQString & line , TDEListViewItem * * item , bool & atLeastOneStringFound , int & occur , bool regularExpression , bool & askConfirmReplace )
void TDE FileReplacePart: : replacingLoop ( TQString & line , TDEListViewItem * * item , bool & atLeastOneStringFound , int & occur , bool regularExpression , bool & askConfirmReplace )
{
KeyValueMap tempMap = m_replacementMap ;
KeyValueMap : : Iterator it ;
@ -1244,7 +1244,7 @@ void KFileReplacePart::replacingLoop(TQString& line, TDEListViewItem** item, boo
}
}
void K FileReplacePart: : fileSearch ( const TQString & directoryName , const TQString & filters )
void TDE FileReplacePart: : fileSearch ( const TQString & directoryName , const TQString & filters )
{
TQDir d ( directoryName ) ;
@ -1267,7 +1267,7 @@ void KFileReplacePart::fileSearch(const TQString& directoryName, const TQString&
TQString fileName = ( * filesIt ) ;
// Avoids files that not match
if ( ! K FileReplaceLib: : isAnAccessibleFile ( filePath , fileName , m_option ) )
if ( ! TDE FileReplaceLib: : isAnAccessibleFile ( filePath , fileName , m_option ) )
continue ;
TQFileInfo fileInfo ( filePath + " / " + fileName ) ;
@ -1280,7 +1280,7 @@ void KFileReplacePart::fileSearch(const TQString& directoryName, const TQString&
}
}
void K FileReplacePart: : recursiveFileSearch ( const TQString & directoryName , const TQString & filters , uint & filesNumber )
void TDE FileReplacePart: : recursiveFileSearch ( const TQString & directoryName , const TQString & filters , uint & filesNumber )
{
// if m_stop == true then interrupt recursion
if ( m_stop )
@ -1304,7 +1304,7 @@ void KFileReplacePart::recursiveFileSearch(const TQString& directoryName, const
TQString fileName = ( * filesIt ) ;
// Avoids files that not match
if ( ! K FileReplaceLib: : isAnAccessibleFile ( filePath , fileName , m_option ) )
if ( ! TDE FileReplaceLib: : isAnAccessibleFile ( filePath , fileName , m_option ) )
continue ;
// Composes file path string
@ -1326,7 +1326,7 @@ void KFileReplacePart::recursiveFileSearch(const TQString& directoryName, const
}
}
void K FileReplacePart: : search ( const TQString & currentDir , const TQString & fileName )
void TDE FileReplacePart: : search ( const TQString & currentDir , const TQString & fileName )
{
TQFile file ( currentDir + " / " + fileName ) ;
@ -1470,17 +1470,17 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa
if ( atLeastOneStringFound & & item )
{
K FileReplaceLib: : setIconForFileEntry ( item , currentDir + " / " + fileName ) ;
TDE FileReplaceLib: : setIconForFileEntry ( item , currentDir + " / " + fileName ) ;
item - > setText ( 0 , fileName ) ;
item - > setText ( 1 , currentDir ) ;
item - > setText ( 2 , K FileReplaceLib: : formatFileSize ( fileInfo . size ( ) ) ) ;
item - > setText ( 2 , TDE FileReplaceLib: : formatFileSize ( fileInfo . size ( ) ) ) ;
item - > setText ( 3 , TQString : : number ( occurrence , 10 ) ) ;
item - > setText ( 4 , TQString ( " %1[%2] " ) . arg ( fileInfo . owner ( ) ) . arg ( fileInfo . ownerId ( ) ) ) ;
item - > setText ( 5 , TQString ( " %1[%2] " ) . arg ( fileInfo . group ( ) ) . arg ( fileInfo . groupId ( ) ) ) ;
}
}
void K FileReplacePart: : loadViewContent ( )
void TDE FileReplacePart: : loadViewContent ( )
{
/* Maps the content of the strings view to a TQMap */
KeyValueMap tempMap ;
@ -1499,7 +1499,7 @@ void KFileReplacePart::loadViewContent()
m_replacementMap = tempMap ;
}
void K FileReplacePart: : loadRulesFile ( const TQString & fileName )
void TDE FileReplacePart: : loadRulesFile ( const TQString & fileName )
{
/* Loads a file with kfr extension.
* creates a xml document and browses it */
@ -1519,7 +1519,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName)
KMessageBox : : information ( m_w , i18n ( " <qt>File <b>%1</b> seems not to be written in new kfr format. Remember that the old kfr format will be soon abandoned. You can convert your old rules files by simply saving them with tdefilereplace.</qt> " ) . arg ( fileName ) , i18n ( " Warning " ) ) ;
K FileReplaceLib: : convertOldToNewKFRFormat ( fileName , sv ) ;
TDE FileReplaceLib: : convertOldToNewKFRFormat ( fileName , sv ) ;
return ;
}
@ -1583,7 +1583,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName)
//resetActions();
}
bool K FileReplacePart: : launchNewProjectDialog ( const KURL & startURL )
bool TDE FileReplacePart: : launchNewProjectDialog ( const KURL & startURL )
{
if ( ! startURL . isEmpty ( ) )
m_option - > m_directories . prepend ( startURL . path ( ) ) ;
@ -1607,7 +1607,7 @@ bool KFileReplacePart::launchNewProjectDialog(const KURL & startURL)
return true ;
}
void K FileReplacePart: : setOptionMask ( )
void TDE FileReplacePart: : setOptionMask ( )
{
m_optionMask | = TQDir : : Dirs ;
@ -1618,7 +1618,7 @@ void KFileReplacePart::setOptionMask()
m_optionMask | = TQDir : : NoSymLinks ;
}
bool K FileReplacePart: : checkBeforeOperation ( )
bool TDE FileReplacePart: : checkBeforeOperation ( )
{
loadViewContent ( ) ;
TDEListView * sv = m_view - > getStringsView ( ) ;
@ -1657,7 +1657,7 @@ bool KFileReplacePart::checkBeforeOperation()
return true ;
}
bool K FileReplacePart: : dontAskAgain ( )
bool TDE FileReplacePart: : dontAskAgain ( )
{
m_config - > setGroup ( " Notification Messages " ) ;
TQString dontAskAgain = m_config - > readEntry ( rcDontAskAgain , " no " ) ;
@ -1667,7 +1667,7 @@ bool KFileReplacePart::dontAskAgain()
return false ;
}
void K FileReplacePart: : whatsThis ( )
void TDE FileReplacePart: : whatsThis ( )
{
actionCollection ( ) - > action ( " options_backup " ) - > setWhatsThis ( optionsBackupWhatthis ) ;
actionCollection ( ) - > action ( " options_case " ) - > setWhatsThis ( optionsCaseWhatthis ) ;