summaryrefslogtreecommitdiffstats
path: root/tdefilereplace/tdefilereplacepart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdefilereplace/tdefilereplacepart.cpp')
-rw-r--r--tdefilereplace/tdefilereplacepart.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/tdefilereplace/tdefilereplacepart.cpp b/tdefilereplace/tdefilereplacepart.cpp
index ab91ae47..39126044 100644
--- a/tdefilereplace/tdefilereplacepart.cpp
+++ b/tdefilereplace/tdefilereplacepart.cpp
@@ -107,7 +107,7 @@ void KFileReplacePart::slotSearchingOperation()
if(!checkBeforeOperation())
return;
- KListView* rv = m_view->getResultsView();
+ TDEListView* rv = m_view->getResultsView();
rv->clear();
@@ -166,7 +166,7 @@ void KFileReplacePart::slotReplacingOperation()
if(!checkBeforeOperation())
return;
- KListView* rv = m_view->getResultsView();
+ TDEListView* rv = m_view->getResultsView();
if(m_option->m_simulation)
{
@@ -239,7 +239,7 @@ void KFileReplacePart::slotStop()
void KFileReplacePart::slotCreateReport()
{
// Check there are results
- KListView* rv = m_view->getResultsView(),
+ TDEListView* rv = m_view->getResultsView(),
* sv = m_view->getStringsView();
if(rv->firstChild() == 0)
@@ -454,7 +454,7 @@ void KFileReplacePart::reportBug()
void KFileReplacePart::resetActions()
{
- KListView* rv = m_view->getResultsView(),
+ TDEListView* rv = m_view->getResultsView(),
* sv = m_view->getStringsView();
bool hasItems = (sv->firstChild() != 0),
@@ -499,11 +499,11 @@ void KFileReplacePart::resetActions()
actionCollection()->action("results_treereduce")->setEnabled(hasItems);
// Updates menus and toolbar
- ((KToggleAction* ) actionCollection()->action("options_recursive"))->setChecked(m_option->m_recursive);
- ((KToggleAction* ) actionCollection()->action("options_backup"))->setChecked(m_option->m_backup && !searchOnlyMode);
- ((KToggleAction* ) actionCollection()->action("options_case"))->setChecked(m_option->m_caseSensitive);
- ((KToggleAction* ) actionCollection()->action("options_var"))->setChecked(m_option->m_variables && !searchOnlyMode);
- ((KToggleAction* ) actionCollection()->action("options_regularexpressions"))->setChecked(m_option->m_regularExpressions);
+ ((TDEToggleAction* ) actionCollection()->action("options_recursive"))->setChecked(m_option->m_recursive);
+ ((TDEToggleAction* ) actionCollection()->action("options_backup"))->setChecked(m_option->m_backup && !searchOnlyMode);
+ ((TDEToggleAction* ) actionCollection()->action("options_case"))->setChecked(m_option->m_caseSensitive);
+ ((TDEToggleAction* ) actionCollection()->action("options_var"))->setChecked(m_option->m_variables && !searchOnlyMode);
+ ((TDEToggleAction* ) actionCollection()->action("options_regularexpressions"))->setChecked(m_option->m_regularExpressions);
}
//PUBLIC METHODS
@@ -567,48 +567,48 @@ void KFileReplacePart::initGUI()
}
}
// File
- (void)new KAction(i18n("Customize Search/Replace Session..."), "projectopen", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSetNewParameters()), actionCollection(), "new_project");
- (void)new KAction(i18n("&Search"), "filesearch", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSearchingOperation()), actionCollection(), "search");
- (void)new KAction(i18n("S&imulate"), "filesimulate", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSimulatingOperation()), actionCollection(), "file_simulate");
- (void)new KAction(i18n("&Replace"), "filereplace", 0, TQT_TQOBJECT(this), TQT_SLOT(slotReplacingOperation()), actionCollection(), "replace");
- (void)new KAction(i18n("Sto&p"), "stop", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStop()), actionCollection(), "stop");
- (void)new KAction(i18n("Cre&ate Report File..."), "filesaveas", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCreateReport()), actionCollection(), "save_results");
+ (void)new TDEAction(i18n("Customize Search/Replace Session..."), "projectopen", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSetNewParameters()), actionCollection(), "new_project");
+ (void)new TDEAction(i18n("&Search"), "filesearch", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSearchingOperation()), actionCollection(), "search");
+ (void)new TDEAction(i18n("S&imulate"), "filesimulate", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSimulatingOperation()), actionCollection(), "file_simulate");
+ (void)new TDEAction(i18n("&Replace"), "filereplace", 0, TQT_TQOBJECT(this), TQT_SLOT(slotReplacingOperation()), actionCollection(), "replace");
+ (void)new TDEAction(i18n("Sto&p"), "stop", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStop()), actionCollection(), "stop");
+ (void)new TDEAction(i18n("Cre&ate Report File..."), "filesaveas", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCreateReport()), actionCollection(), "save_results");
// Strings
- (void)new KAction(i18n("&Add String..."), "editadd", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsAdd()), actionCollection(), "strings_add");
+ (void)new TDEAction(i18n("&Add String..."), "editadd", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsAdd()), actionCollection(), "strings_add");
- (void)new KAction(i18n("&Delete String"), "editremove", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsDeleteItem()), actionCollection(), "strings_del");
- (void)new KAction(i18n("&Empty Strings List"), "editdelete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsEmpty()), actionCollection(), "strings_empty");
- (void)new KAction(i18n("Edit Selected String..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsEdit()), actionCollection(), "strings_edit");
- (void)new KAction(i18n("&Save Strings List to File..."), "filesaveas", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsSave()), actionCollection(), "strings_save");
- (void)new KAction(i18n("&Load Strings List From File..."), "unsortedList", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsLoad()), actionCollection(), "strings_load");
- (void)new KRecentFilesAction(i18n("&Load Recent Strings Files"), "fileopen", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOpenRecentStringFile(const KURL&)), actionCollection(),"strings_load_recent");
- (void)new KAction(i18n("&Invert Current String (search <--> replace)"), "invert", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsInvertCur()), actionCollection(), "strings_invert");
- (void)new KAction(i18n("&Invert All Strings (search <--> replace)"), "invert", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsInvertAll()), actionCollection(), "strings_invert_all");
+ (void)new TDEAction(i18n("&Delete String"), "editremove", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsDeleteItem()), actionCollection(), "strings_del");
+ (void)new TDEAction(i18n("&Empty Strings List"), "editdelete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsEmpty()), actionCollection(), "strings_empty");
+ (void)new TDEAction(i18n("Edit Selected String..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsEdit()), actionCollection(), "strings_edit");
+ (void)new TDEAction(i18n("&Save Strings List to File..."), "filesaveas", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsSave()), actionCollection(), "strings_save");
+ (void)new TDEAction(i18n("&Load Strings List From File..."), "unsortedList", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsLoad()), actionCollection(), "strings_load");
+ (void)new TDERecentFilesAction(i18n("&Load Recent Strings Files"), "fileopen", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOpenRecentStringFile(const KURL&)), actionCollection(),"strings_load_recent");
+ (void)new TDEAction(i18n("&Invert Current String (search <--> replace)"), "invert", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsInvertCur()), actionCollection(), "strings_invert");
+ (void)new TDEAction(i18n("&Invert All Strings (search <--> replace)"), "invert", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStringsInvertAll()), actionCollection(), "strings_invert_all");
// Options
- (void)new KToggleAction(i18n("&Include Sub-Folders"), "recursive_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionRecursive()), actionCollection(), "options_recursive");
- (void)new KToggleAction(i18n("Create &Backup Files"), "backup_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionBackup()), actionCollection(), "options_backup");
- (void)new KToggleAction(i18n("Case &Sensitive"), "casesensitive_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionCaseSensitive()), actionCollection(), "options_case");
- (void)new KToggleAction(i18n("Enable Commands &in Replace String: [$command:option$]"), "command_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionVariables()), actionCollection(), "options_var");
- (void)new KToggleAction(i18n("Enable &Regular Expressions"), "regularexpression_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionRegularExpressions()), actionCollection(), "options_regularexpressions");
- (void)new KAction(i18n("Configure &KFileReplace..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionPreferences()), actionCollection(), "configure_tdefilereplace");
+ (void)new TDEToggleAction(i18n("&Include Sub-Folders"), "recursive_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionRecursive()), actionCollection(), "options_recursive");
+ (void)new TDEToggleAction(i18n("Create &Backup Files"), "backup_option", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionBackup()), actionCollection(), "options_backup");
+ (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 &KFileReplace..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOptionPreferences()), actionCollection(), "configure_tdefilereplace");
// Results
- (void)new KAction(i18n("&Properties"), "informations", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultProperties()), actionCollection(), "results_infos");
- (void)new KAction(i18n("&Open"), "filenew", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultOpen()), actionCollection(), "results_openfile");
+ (void)new TDEAction(i18n("&Properties"), "informations", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultProperties()), actionCollection(), "results_infos");
+ (void)new TDEAction(i18n("&Open"), "filenew", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultOpen()), actionCollection(), "results_openfile");
if(quantaFound)
{
- (void)new KAction(i18n("&Edit in Quanta"), "quanta", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultEdit()), actionCollection(), "results_editfile");
+ (void)new TDEAction(i18n("&Edit in Quanta"), "quanta", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultEdit()), actionCollection(), "results_editfile");
}
- (void)new KAction(i18n("Open Parent &Folder"), "fileopen", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultDirOpen()), actionCollection(), "results_opendir");
- (void)new KAction(i18n("&Delete"), "editdelete", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultDelete()), actionCollection(), "results_delete");
- (void)new KAction(i18n("E&xpand Tree"), 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultTreeExpand()), actionCollection(), "results_treeexpand");
- (void)new KAction(i18n("&Reduce Tree"), 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultTreeReduce()), actionCollection(), "results_treereduce");
- (void)new KAction(i18n("&About KFileReplace"), "tdefilereplace", 0, TQT_TQOBJECT(this), TQT_SLOT(showAboutApplication()), actionCollection(), "help_about_tdefilereplace");
- (void)new KAction(i18n("KFileReplace &Handbook"), "help", 0, TQT_TQOBJECT(this), TQT_SLOT(appHelpActivated()), actionCollection(), "help_tdefilereplace");
- (void)new KAction(i18n("&Report Bug"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(reportBug()), actionCollection(), "report_bug");
+ (void)new TDEAction(i18n("Open Parent &Folder"), "fileopen", 0, TQT_TQOBJECT(m_view), TQT_SLOT(slotResultDirOpen()), actionCollection(), "results_opendir");
+ (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 KFileReplace"), "tdefilereplace", 0, TQT_TQOBJECT(this), TQT_SLOT(showAboutApplication()), actionCollection(), "help_about_tdefilereplace");
+ (void)new TDEAction(i18n("KFileReplace &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");
}
@@ -654,11 +654,11 @@ void KFileReplacePart::freezeActions()
actionCollection()->action("results_delete")->setEnabled(false);
actionCollection()->action("results_treeexpand")->setEnabled(false);
actionCollection()->action("results_treereduce")->setEnabled(false);
- ((KToggleAction* ) actionCollection()->action("options_recursive"))->setChecked(false);
- ((KToggleAction* ) actionCollection()->action("options_backup"))->setChecked(false);
- ((KToggleAction* ) actionCollection()->action("options_case"))->setChecked(false);
- ((KToggleAction* ) actionCollection()->action("options_var"))->setChecked(false);
- ((KToggleAction* ) actionCollection()->action("options_regularexpressions"))->setChecked(false);
+ ((TDEToggleAction* ) actionCollection()->action("options_recursive"))->setChecked(false);
+ ((TDEToggleAction* ) actionCollection()->action("options_backup"))->setChecked(false);
+ ((TDEToggleAction* ) actionCollection()->action("options_case"))->setChecked(false);
+ ((TDEToggleAction* ) actionCollection()->action("options_var"))->setChecked(false);
+ ((TDEToggleAction* ) actionCollection()->action("options_regularexpressions"))->setChecked(false);
}
void KFileReplacePart::loadOptionsFromRC()
@@ -1040,7 +1040,7 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri
TQString backupExtension = m_option->m_backupExtension;
bool atLeastOneStringFound = false;
- KListViewItem *item = 0;
+ TDEListViewItem *item = 0;
int occurrence = 0;
replacingLoop(line, &item, atLeastOneStringFound, occurrence, m_option->m_regularExpressions, m_option->m_askConfirmReplace);
@@ -1115,7 +1115,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS
}
TQString fileSizeBeforeReplacing = KFileReplaceLib::formatFileSize(oldFileInfo.size());
- KListViewItem *item = 0;
+ TDEListViewItem *item = 0;
TQTextStream oldStream( &oldFile );
if (m_option->m_encoding == "utf8")
@@ -1176,11 +1176,11 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS
}
}
-void KFileReplacePart::replacingLoop(TQString& line, KListViewItem** item, bool& atLeastOneStringFound, int& occur, bool regularExpression, bool& askConfirmReplace)
+void KFileReplacePart::replacingLoop(TQString& line, TDEListViewItem** item, bool& atLeastOneStringFound, int& occur, bool regularExpression, bool& askConfirmReplace)
{
KeyValueMap tempMap = m_replacementMap;
KeyValueMap::Iterator it;
- KListView* rv = m_view->getResultsView();
+ TDEListView* rv = m_view->getResultsView();
for(it = tempMap.begin(); it != tempMap.end(); ++it)
{
@@ -1209,8 +1209,8 @@ void KFileReplacePart::replacingLoop(TQString& line, KListViewItem** item, bool&
entry.columnNumber(line));
if(!*item)
- *item = new KListViewItem(rv);
- KListViewItem* tempItem = new KListViewItem(*item);
+ *item = new TDEListViewItem(rv);
+ TDEListViewItem* tempItem = new TDEListViewItem(*item);
tempItem->setMultiLinesEnabled(true);
tempItem->setText(0,msg);
occur ++;
@@ -1231,8 +1231,8 @@ void KFileReplacePart::replacingLoop(TQString& line, KListViewItem** item, bool&
entry.columnNumber(line));
if(!*item)
- *item = new KListViewItem(rv);
- KListViewItem* tempItem = new KListViewItem(*item);
+ *item = new TDEListViewItem(rv);
+ TDEListViewItem* tempItem = new TDEListViewItem(*item);
tempItem->setMultiLinesEnabled(true);
tempItem->setText(0,msg);
occur ++;
@@ -1346,7 +1346,7 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa
TQFileInfo fileInfo(currentDir+"/"+fileName);
- KListViewItem *item = 0;
+ TDEListViewItem *item = 0;
//Counts occurrences
int occurrence = 0;
@@ -1358,7 +1358,7 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa
KeyValueMap::Iterator it = tempMap.begin();
- KListView* rv = m_view->getResultsView();
+ TDEListView* rv = m_view->getResultsView();
while(it != tempMap.end())
{
@@ -1392,9 +1392,9 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa
int columnNumber = pos - line.findRev('\n',pos);
if (!item)
- item = new KListViewItem(rv);
+ item = new TDEListViewItem(rv);
- KListViewItem* tempItem= new KListViewItem(item);
+ TDEListViewItem* tempItem= new TDEListViewItem(item);
TQString msg,
capturedText;
@@ -1446,8 +1446,8 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa
msg = i18n(" Line:%2, Col:%3 - \"%1\"").arg(capturedText).arg(TQString::number(lineNumber,10)).arg(TQString::number(columnNumber,10));
if(!item)
- item = new KListViewItem(rv);
- KListViewItem* tempItem = new KListViewItem(item);
+ item = new TDEListViewItem(rv);
+ TDEListViewItem* tempItem = new TDEListViewItem(item);
tempItem->setMultiLinesEnabled(true);
tempItem->setText(0,msg);
occurrence++;
@@ -1505,7 +1505,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName)
* creates a xml document and browses it*/
TQDomDocument doc("mydocument");
TQFile file(fileName);
- KListView* sv = m_view->getStringsView();
+ TDEListView* sv = m_view->getStringsView();
if(!file.open(IO_ReadOnly))
{
@@ -1572,7 +1572,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName)
if(!fileList.contains(fileName))
{
fileList.append(fileName);
- ((KRecentFilesAction* ) actionCollection()->action("strings_load_recent"))->setItems(fileList);
+ ((TDERecentFilesAction* ) actionCollection()->action("strings_load_recent"))->setItems(fileList);
m_option->m_recentStringFileList = fileList;
}
@@ -1621,7 +1621,7 @@ void KFileReplacePart::setOptionMask()
bool KFileReplacePart::checkBeforeOperation()
{
loadViewContent();
- KListView* sv = m_view->getStringsView();
+ TDEListView* sv = m_view->getStringsView();
// Checks if there are strings to replace (not need in search operation)
if (sv->childCount() == 0)