From 39356ff58b6a5a76b0ee7fa85c538598ededdeff Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 19 Dec 2011 12:01:04 -0600 Subject: Remove additional unneeded tq method conversions (cherry picked from commit 84c989c19db5daab602a67f47ca0f5fd7a2b53d2) --- kfilereplace/configurationclasses.cpp | 4 ++-- kfilereplace/kfilereplacelib.cpp | 8 +++---- kfilereplace/kfilereplacepart.cpp | 44 +++++++++++++++++------------------ kfilereplace/kfilereplaceview.cpp | 10 ++++---- kfilereplace/report.cpp | 4 ++-- 5 files changed, 35 insertions(+), 35 deletions(-) (limited to 'kfilereplace') diff --git a/kfilereplace/configurationclasses.cpp b/kfilereplace/configurationclasses.cpp index bb66c3ef..f0c6bcc4 100644 --- a/kfilereplace/configurationclasses.cpp +++ b/kfilereplace/configurationclasses.cpp @@ -164,8 +164,8 @@ TQString ResultViewEntry::capturedText(const TQString& line) TQString ResultViewEntry::message(const TQString& capturedText, int x, int y) const { TQString data = m_data; - //return i18n(" captured text \"%1\" replaced with \"%2\" at line: %3, column: %4 ").tqarg(capturedText).tqarg(data).tqarg(TQString::number(x,10)).tqarg(TQString::number(y,10)); - return i18n(" Line:%3,Col:%4 - \"%1\" -> \"%2\"").tqarg(capturedText).tqarg(data).tqarg(TQString::number(x,10)).tqarg(TQString::number(y,10)); + //return i18n(" captured text \"%1\" replaced with \"%2\" at line: %3, column: %4 ").arg(capturedText).arg(data).arg(TQString::number(x,10)).arg(TQString::number(y,10)); + return i18n(" Line:%3,Col:%4 - \"%1\" -> \"%2\"").arg(capturedText).arg(data).arg(TQString::number(x,10)).arg(TQString::number(y,10)); } int ResultViewEntry::keyLength() const diff --git a/kfilereplace/kfilereplacelib.cpp b/kfilereplace/kfilereplacelib.cpp index b9073dea..5a3bfcd4 100644 --- a/kfilereplace/kfilereplacelib.cpp +++ b/kfilereplace/kfilereplacelib.cpp @@ -102,19 +102,19 @@ TQString KFileReplaceLib::formatFileSize(double size) if(size >= kilo && size < mega) { double d = size / kilo; - stringSize = i18n("%1 KB").tqarg(TQString::number(d,'f',2)); + stringSize = i18n("%1 KB").arg(TQString::number(d,'f',2)); } else if(size >= mega && size < giga) { double d = size / mega; - stringSize = i18n("%1 MB").tqarg(TQString::number(d,'f',2)); + stringSize = i18n("%1 MB").arg(TQString::number(d,'f',2)); } else if(size >= giga) { double d = size / giga; - stringSize = i18n("%1 GB").tqarg(TQString::number(d,'f',2)); + stringSize = i18n("%1 GB").arg(TQString::number(d,'f',2)); } return stringSize; } @@ -137,7 +137,7 @@ void KFileReplaceLib::convertOldToNewKFRFormat(const TQString& fileName, KListVi if(!f || (err != 1) || (pgm != "KFileReplace")) { - KMessageBox::error(0, i18n("Cannot open the file %1 and load the string list. This file seems not to be a valid old kfr file or it is broken.").tqarg(fileName)); + KMessageBox::error(0, i18n("Cannot open the file %1 and load the string list. This file seems not to be a valid old kfr file or it is broken.").arg(fileName)); return ; } diff --git a/kfilereplace/kfilereplacepart.cpp b/kfilereplace/kfilereplacepart.cpp index e805d3ea..65ff5ff3 100644 --- a/kfilereplace/kfilereplacepart.cpp +++ b/kfilereplace/kfilereplacepart.cpp @@ -161,7 +161,7 @@ void KFileReplacePart::slotSearchingOperation() void KFileReplacePart::slotReplacingOperation() { - if (KMessageBox::warningContinueCancel(m_w, i18n("You have selected %1 as the encoding of the files.
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.

In case you do not know the encoding of your files, select utf8 and enable the creation of backup files. This setting will autodetect utf8 and utf16 files, but the changed files will be converted to utf8.
").tqarg(m_option->m_encoding), i18n("File Encoding Warning"), KStdGuiItem::cont(), "ShowEncodingWarning") == KMessageBox::Cancel) + if (KMessageBox::warningContinueCancel(m_w, i18n("You have selected %1 as the encoding of the files.
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.

In case you do not know the encoding of your files, select utf8 and enable the creation of backup files. This setting will autodetect utf8 and utf16 files, but the changed files will be converted to utf8.
").arg(m_option->m_encoding), i18n("File Encoding Warning"), KStdGuiItem::cont(), "ShowEncodingWarning") == KMessageBox::Cancel) return; if(!checkBeforeOperation()) return; @@ -258,7 +258,7 @@ void KFileReplacePart::slotCreateReport() TQFileInfo fileInfo(documentName); if(fileInfo.exists()) { - KMessageBox::error(m_w, i18n("A folder or a file named %1 already exists.").tqarg(documentName)); + KMessageBox::error(m_w, i18n("A folder or a file named %1 already exists.").arg(documentName)); return ; } @@ -266,7 +266,7 @@ void KFileReplacePart::slotCreateReport() if(!directoryName.mkdir(documentName, true)) { - KMessageBox::error(m_w, i18n("Cannot create the %1 folder.").tqarg(documentName)); + KMessageBox::error(m_w, i18n("Cannot create the %1 folder.").arg(documentName)); return ; } @@ -1022,7 +1022,7 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri TQFile currentFile(oldPathString); if(!currentFile.open(IO_ReadOnly)) { - KMessageBox::information(m_w, i18n("Cannot open file %1 for reading.").tqarg(oldFileName),TQString(), rcNotifyOnErrors); + KMessageBox::information(m_w, i18n("Cannot open file %1 for reading.").arg(oldFileName),TQString(), rcNotifyOnErrors); return ; } TQTextStream currentStream(¤tFile); @@ -1061,7 +1061,7 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri TQFile newFile(oldPathString); if(!newFile.open(IO_WriteOnly)) { - KMessageBox::information(m_w, i18n("Cannot open file %1 for writing.").tqarg(oldFileName),TQString(), rcNotifyOnErrors); + KMessageBox::information(m_w, i18n("Cannot open file %1 for writing.").arg(oldFileName),TQString(), rcNotifyOnErrors); return ; } TQTextStream newStream(&newFile); @@ -1097,8 +1097,8 @@ void KFileReplacePart::replaceAndBackup(const TQString& currentDir, const TQStri } item->setText(4,TQString::number(occurrence,10)); - item->setText(5,TQString("%1[%2]").tqarg(oldFileInfo.owner()).tqarg(oldFileInfo.ownerId())); - item->setText(6,TQString("%1[%2]").tqarg(oldFileInfo.group()).tqarg(oldFileInfo.groupId())); + item->setText(5,TQString("%1[%2]").arg(oldFileInfo.owner()).arg(oldFileInfo.ownerId())); + item->setText(6,TQString("%1[%2]").arg(oldFileInfo.group()).arg(oldFileInfo.groupId())); } } @@ -1110,7 +1110,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS if (!oldFile.open(IO_ReadOnly)) { - KMessageBox::information(m_w, i18n("Cannot open file %1 for reading.").tqarg(oldFile.name()),TQString(), rcNotifyOnErrors); + KMessageBox::information(m_w, i18n("Cannot open file %1 for reading.").arg(oldFile.name()),TQString(), rcNotifyOnErrors); return ; } @@ -1139,7 +1139,7 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS TQFile newFile(oldPathString); if(!newFile.open(IO_WriteOnly)) { - KMessageBox::information(m_w, i18n("Cannot open file %1 for writing.").tqarg(newFile.name()),TQString(), rcNotifyOnErrors); + KMessageBox::information(m_w, i18n("Cannot open file %1 for writing.").arg(newFile.name()),TQString(), rcNotifyOnErrors); return ; } TQTextStream newStream( &newFile ); @@ -1171,8 +1171,8 @@ void KFileReplacePart::replaceAndOverwrite(const TQString& currentDir, const TQS item->setText(3,"-"); item->setText(4,TQString::number(occurrence,10)); - item->setText(5,TQString("%1[%2]").tqarg(oldFileInfo.owner()).tqarg(oldFileInfo.ownerId())); - item->setText(6,TQString("%1[%2]").tqarg(oldFileInfo.group()).tqarg(oldFileInfo.groupId())); + item->setText(5,TQString("%1[%2]").arg(oldFileInfo.owner()).arg(oldFileInfo.ownerId())); + item->setText(6,TQString("%1[%2]").arg(oldFileInfo.group()).arg(oldFileInfo.groupId())); } } @@ -1196,7 +1196,7 @@ void KFileReplacePart::replacingLoop(TQString& line, KListViewItem** item, bool& if(askConfirmReplace) { int answer = KMessageBox::questionYesNo(0, - i18n("Do you want to replace the string %1 with the string %2?").tqarg(it.key()).tqarg(it.data()), + i18n("Do you want to replace the string %1 with the string %2?").arg(it.key()).arg(it.data()), i18n("Confirm Replace"), i18n("Replace"), i18n("Do Not Replace"), @@ -1332,7 +1332,7 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa if(!file.open(IO_ReadOnly)) { - KMessageBox::information(m_w, i18n("Cannot open file %1 for reading.").tqarg(fileName), TQString(), rcNotifyOnErrors); + KMessageBox::information(m_w, i18n("Cannot open file %1 for reading.").arg(fileName), TQString(), rcNotifyOnErrors); return ; } // Creates a stream with the file @@ -1403,7 +1403,7 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa else capturedText = line.mid(pos,strKey.length()); - msg = i18n(" Line:%2, Col:%3 - \"%1\"").tqarg(capturedText).tqarg(TQString::number(lineNumber,10)).tqarg(TQString::number(columnNumber,10)); + msg = i18n(" Line:%2, Col:%3 - \"%1\"").arg(capturedText).arg(TQString::number(lineNumber,10)).arg(TQString::number(columnNumber,10)); tempItem->setMultiLinesEnabled(true); tempItem->setText(0,msg); occurrence = 1; @@ -1443,7 +1443,7 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa pos = line.find(strKey,pos+strKey.length()); } - msg = i18n(" Line:%2, Col:%3 - \"%1\"").tqarg(capturedText).tqarg(TQString::number(lineNumber,10)).tqarg(TQString::number(columnNumber,10)); + 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); @@ -1475,8 +1475,8 @@ void KFileReplacePart::search(const TQString& currentDir, const TQString& fileNa item->setText(1,currentDir); item->setText(2,KFileReplaceLib::formatFileSize(fileInfo.size())); item->setText(3,TQString::number(occurrence,10)); - item->setText(4,TQString("%1[%2]").tqarg(fileInfo.owner()).tqarg(fileInfo.ownerId())); - item->setText(5,TQString("%1[%2]").tqarg(fileInfo.group()).tqarg(fileInfo.groupId())); + item->setText(4,TQString("%1[%2]").arg(fileInfo.owner()).arg(fileInfo.ownerId())); + item->setText(5,TQString("%1[%2]").arg(fileInfo.group()).arg(fileInfo.groupId())); } } @@ -1509,7 +1509,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName) if(!file.open(IO_ReadOnly)) { - KMessageBox::error(m_w, i18n("Cannot open the file %1 and load the string list.").tqarg(fileName)); + KMessageBox::error(m_w, i18n("Cannot open the file %1 and load the string list.").arg(fileName)); return ; } @@ -1517,7 +1517,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName) { file.close(); - KMessageBox::information(m_w, i18n("File %1 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 kfilereplace.").tqarg(fileName),i18n("Warning")); + KMessageBox::information(m_w, i18n("File %1 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 kfilereplace.").arg(fileName),i18n("Warning")); KFileReplaceLib::convertOldToNewKFRFormat(fileName, sv); @@ -1537,7 +1537,7 @@ void KFileReplacePart::loadRulesFile(const TQString& fileName) if(searchAttribute.isNull() || searchAttribute.isEmpty()) { - int answer = KMessageBox::warningYesNo(m_w, i18n("The format of kfr files has been changed; attempting to load %1. Please see the KFilereplace manual for details. Do you want to load a search-and-replace list of strings?").tqarg(fileName),i18n("Warning"),i18n("Load"),i18n("Do Not Load")); + int answer = KMessageBox::warningYesNo(m_w, i18n("The format of kfr files has been changed; attempting to load %1. Please see the KFilereplace manual for details. Do you want to load a search-and-replace list of strings?").arg(fileName),i18n("Warning"),i18n("Load"),i18n("Do Not Load")); if(answer == KMessageBox::Yes) searchAttribute = "false"; @@ -1639,7 +1639,7 @@ bool KFileReplacePart::checkBeforeOperation() if(!dir.exists()) { - KMessageBox::error(m_w, i18n("The main folder of the project %1 does not exist.").tqarg(directory)); + KMessageBox::error(m_w, i18n("The main folder of the project %1 does not exist.").arg(directory)); return false; } @@ -1647,7 +1647,7 @@ bool KFileReplacePart::checkBeforeOperation() if(!(dirInfo.isReadable() && dirInfo.isExecutable()) || (!m_option->m_searchingOnlyMode && !m_option->m_simulation && !(dirInfo.isWritable()))) { - KMessageBox::error(m_w, i18n("Access denied in the main folder of the project:
%1
").tqarg(directory)); + KMessageBox::error(m_w, i18n("Access denied in the main folder of the project:
%1
").arg(directory)); return false; } diff --git a/kfilereplace/kfilereplaceview.cpp b/kfilereplace/kfilereplaceview.cpp index 104effcb..2de52edd 100644 --- a/kfilereplace/kfilereplaceview.cpp +++ b/kfilereplace/kfilereplaceview.cpp @@ -117,7 +117,7 @@ void KFileReplaceView::stringsInvert(bool invertAll) // Cannot invert the string when search string is empty if (replaceText.isEmpty()) { - KMessageBox::error(0, i18n("Cannot invert string %1, because the search string would be empty.").tqarg(searchText)); + KMessageBox::error(0, i18n("Cannot invert string %1, because the search string would be empty.").arg(searchText)); return; } @@ -256,7 +256,7 @@ void KFileReplaceView::slotResultEdit() if(!success) { - TQString message = i18n("File %1 cannot be opened. Might be a DCOP problem.").tqarg(path); + TQString message = i18n("File %1 cannot be opened. Might be a DCOP problem.").arg(path); KMessageBox::error(parentWidget(), message); } } @@ -278,7 +278,7 @@ void KFileReplaceView::slotResultDelete() if (!currItem.isEmpty()) { TQFile fi; - int answer = KMessageBox::warningContinueCancel(this, i18n("Do you really want to delete %1?").tqarg(currItem), + int answer = KMessageBox::warningContinueCancel(this, i18n("Do you really want to delete %1?").arg(currItem), TQString(),KStdGuiItem::del()); if(answer == KMessageBox::Continue) @@ -417,7 +417,7 @@ void KFileReplaceView::slotStringsSave() body += TQString("\n\t" "\n\t\t" "\n\t\t" - "\n\t").tqarg(lvi->text(0)).tqarg(lvi->text(1)); + "\n\t").arg(lvi->text(0)).arg(lvi->text(1)); lvi = lvi->nextSibling(); } @@ -434,7 +434,7 @@ void KFileReplaceView::slotStringsSave() TQFile file( fileName ); if(!file.open( IO_WriteOnly )) { - KMessageBox::error(0, i18n("File %1 cannot be saved.").tqarg(fileName)); + KMessageBox::error(0, i18n("File %1 cannot be saved.").arg(fileName)); return ; } TQTextStream oTStream( &file ); diff --git a/kfilereplace/report.cpp b/kfilereplace/report.cpp index 92901a53..6d485eba 100644 --- a/kfilereplace/report.cpp +++ b/kfilereplace/report.cpp @@ -38,7 +38,7 @@ void Report::createReportFile() TQFile report(xmlFileName); if (!report.open( IO_WriteOnly )) { - KMessageBox::error(0, i18n("Cannot open the file %1.").tqarg(xmlFileName)); + KMessageBox::error(0, i18n("Cannot open the file %1.").arg(xmlFileName)); return ; } @@ -191,7 +191,7 @@ void Report::createStyleSheet() TQFile styleSheet(cssFileName); if (!styleSheet.open( IO_WriteOnly )) { - KMessageBox::error(0, i18n("Cannot open the file %1.").tqarg(cssFileName)); + KMessageBox::error(0, i18n("Cannot open the file %1.").arg(cssFileName)); return ; } -- cgit v1.2.3