From 94844816550ad672ccfcdc25659c625546239998 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:32:11 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kexi/tests/altertable/1.kexi | Bin 49206 -> 49204 bytes kexi/tests/altertable/altertable.cpp | 66 +++++++++++++++++------------------ 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'kexi/tests/altertable') diff --git a/kexi/tests/altertable/1.kexi b/kexi/tests/altertable/1.kexi index 8c13ad39..5a1b4ebd 100644 Binary files a/kexi/tests/altertable/1.kexi and b/kexi/tests/altertable/1.kexi differ diff --git a/kexi/tests/altertable/altertable.cpp b/kexi/tests/altertable/altertable.cpp index 6155eb63..765457af 100644 --- a/kexi/tests/altertable/altertable.cpp +++ b/kexi/tests/altertable/altertable.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include @@ -56,7 +56,7 @@ KexiProject* prj = 0; void showError(const TQString& msg) { TQString msg_(msg); - msg_.prepend(TQString("Error at line %1: ").tqarg(testLineNumber)); + msg_.prepend(TQString("Error at line %1: ").arg(testLineNumber)); kdDebug() << msg_ << endl; } @@ -119,7 +119,7 @@ tristate readLineFromTestFile(const TQString& expectedCommandName = TQString()) } if (!expectedCommandName.isEmpty() && testFileLine[0]!=expectedCommandName) { showError( TQString("Invalid command '%1', expected '%2'") - .tqarg(testFileLine[0]).tqarg(expectedCommandName)); + .arg(testFileLine[0]).arg(expectedCommandName)); return false; } if (quoted) { @@ -136,9 +136,9 @@ bool checkItemsNumber(int expectedNumberOfItems, int optionalNumberOfItems = -1) ok = ok || optionalNumberOfItems==(int)testFileLine.count(); if (!ok) { TQString msg = TQString("Invalid number of args (%1) for command '%2', expected: %3") - .tqarg(testFileLine.count()).tqarg(testFileLine[0]).tqarg(expectedNumberOfItems); + .arg(testFileLine.count()).arg(testFileLine[0]).arg(expectedNumberOfItems); if (optionalNumberOfItems>0) - msg.append( TQString(" or %1").tqarg(optionalNumberOfItems) ); + msg.append( TQString(" or %1").arg(optionalNumberOfItems) ); showError( msg ); return false; } @@ -167,7 +167,7 @@ TQVariant::Type typeNameToTQVariantType(const TQCString& name_) if (name=="longlong") return TQVariant::LongLong; //todo more types - showError(TQString("Invalid type '%1'").tqarg(name_)); + showError(TQString("Invalid type '%1'").arg(name_)); return TQVariant::Invalid; } @@ -202,7 +202,7 @@ static int getNumber(const TQString& argument, bool& ok) else { result = argument.toInt(&ok); if (!ok) { - showError(TQString("Invalid value '%1'").tqarg(argument)); + showError(TQString("Invalid value '%1'").arg(argument)); return -1; } } @@ -248,7 +248,7 @@ bool AlterTableTester::changeFieldProperty(KexiTableDesignerInterface* designerI else { if (!castStringToTQVariant(propertyValueString, propertyType, newValue)) { showError( TQString("Could not set property '%1' value '%2' of type '%3'") - .tqarg(propertyName).tqarg(propertyValueString).tqarg(propertyType) ); + .arg(propertyName).arg(propertyValueString).arg(propertyType) ); return false; } } @@ -283,7 +283,7 @@ bool AlterTableTester::getSchemaDump(KexiDialogBase* dlg, TQString& schemaDebugS schemaDebugString = designerIface->debugStringForCurrentTableSchema(result); if (true!=result) { showError( TQString("Loading modified schema failed. Result: %1") - .tqarg(~result ? "cancelled" : "false") ); + .arg(~result ? "cancelled" : "false") ); return false; } schemaDebugString.remove(TQRegExp(",$")); //no need to have "," at the end of lines @@ -296,9 +296,9 @@ bool AlterTableTester::showSchema(KexiDialogBase* dlg, bool copyToClipboard) if (!getSchemaDump(dlg, schemaDebugString)) return false; if (copyToClipboard) - TQApplication::tqclipboard()->setText( schemaDebugString ); + TQApplication::clipboard()->setText( schemaDebugString ); else - kdDebug() << TQString("Schema for '%1' table:\n").tqarg(dlg->partItem()->name()) + kdDebug() << TQString("Schema for '%1' table:\n").arg(dlg->partItem()->name()) + schemaDebugString + "\nendSchema" << endl; return true; } @@ -354,8 +354,8 @@ bool AlterTableTester::checkSchema(KexiDialogBase* dlg) if (!getSchemaDump(dlg, schemaDebugString)) return false; bool result = checkInternal(dlg, schemaDebugString, "endSchema", true /*skipColonsAndStripWhiteSpace*/); - kdDebug() << TQString("Schema check for table '%1': %2").tqarg(dlg->partItem()->name()) - .tqarg(result ? "OK" : "Failed") << endl; + kdDebug() << TQString("Schema check for table '%1': %2").arg(dlg->partItem()->name()) + .arg(result ? "OK" : "Failed") << endl; return result; } @@ -367,7 +367,7 @@ bool AlterTableTester::getActionsDump(KexiDialogBase* dlg, TQString& actionsDebu return false; tristate result = designerIface->simulateAlterTableExecution(&actionsDebugString); if (true!=result) { - showError( TQString("Computing simplified actions for table '%1' failed.").tqarg(dlg->partItem()->name()) ); + showError( TQString("Computing simplified actions for table '%1' failed.").arg(dlg->partItem()->name()) ); return false; } return true; @@ -379,9 +379,9 @@ bool AlterTableTester::showActions(KexiDialogBase* dlg, bool copyToClipboard) if (!getActionsDump(dlg, actionsDebugString)) return false; if (copyToClipboard) - TQApplication::tqclipboard()->setText( actionsDebugString ); + TQApplication::clipboard()->setText( actionsDebugString ); else - kdDebug() << TQString("Simplified actions for altering table '%1':\n").tqarg(dlg->partItem()->name()) + kdDebug() << TQString("Simplified actions for altering table '%1':\n").arg(dlg->partItem()->name()) + actionsDebugString+"\n" << endl; return true; } @@ -392,8 +392,8 @@ bool AlterTableTester::checkActions(KexiDialogBase* dlg) if (!getActionsDump(dlg, actionsDebugString)) return false; bool result = checkInternal(dlg, actionsDebugString, "endActions", true /*skipColonsAndStripWhiteSpace*/); - kdDebug() << TQString("Actions check for table '%1': %2").tqarg(dlg->partItem()->name()) - .tqarg(result ? "OK" : "Failed") << endl; + kdDebug() << TQString("Actions check for table '%1': %2").arg(dlg->partItem()->name()) + .arg(result ? "OK" : "Failed") << endl; return result; } @@ -405,7 +405,7 @@ bool AlterTableTester::saveTableDesign(KexiDialogBase* dlg) return false; tristate result = designerIface->executeRealAlterTable(); if (true!=result) { - showError( TQString("Saving design of table '%1' failed.").tqarg(dlg->partItem()->name()) ); + showError( TQString("Saving design of table '%1' failed.").arg(dlg->partItem()->name()) ); return false; } return true; @@ -439,9 +439,9 @@ bool AlterTableTester::showTableData(KexiDialogBase* dlg, bool copyToClipboard) if (!getTableDataDump(dlg, dataString)) return false; if (copyToClipboard) - TQApplication::tqclipboard()->setText( dataString ); + TQApplication::clipboard()->setText( dataString ); else - kdDebug() << TQString("Contents of table '%1':\n").tqarg(dlg->partItem()->name())+dataString+"\n" << endl; + kdDebug() << TQString("Contents of table '%1':\n").arg(dlg->partItem()->name())+dataString+"\n" << endl; return true; } @@ -451,8 +451,8 @@ bool AlterTableTester::checkTableData(KexiDialogBase* dlg) if (!getTableDataDump(dlg, dataString)) return false; bool result = checkInternal(dlg, dataString, "endTableData", false /*!skipColonsAndStripWhiteSpace*/); - kdDebug() << TQString("Table '%1' contents: %2").tqarg(dlg->partItem()->name()) - .tqarg(result ? "OK" : "Failed") << endl; + kdDebug() << TQString("Table '%1' contents: %2").arg(dlg->partItem()->name()) + .arg(result ? "OK" : "Failed") << endl; return result; } @@ -462,8 +462,8 @@ bool AlterTableTester::closeWindow(KexiDialogBase* dlg) return true; TQString name = dlg->partItem()->name(); tristate result = true == win->closeDialog(dlg, true/*layoutTaskBar*/, true/*doNotSaveChanges*/); - kdDebug() << TQString("Closing window for table '%1': %2").tqarg(name) - .tqarg(result==true ? "OK" : (result==false ? "Failed" : "Cancelled")) << endl; + kdDebug() << TQString("Closing window for table '%1': %2").arg(name) + .arg(result==true ? "OK" : (result==false ? "Failed" : "Cancelled")) << endl; return result == true; } @@ -492,13 +492,13 @@ tristate AlterTableTester::run(bool &closeAppRequested) TQString tableName(testFileLine[1]); KexiPart::Item *item = prj->itemForMimeType("kexi/table", tableName); if (!item) { - showError(TQString("No such table '%1'").tqarg(tableName)); + showError(TQString("No such table '%1'").arg(tableName)); return false; } bool openingCancelled; KexiDialogBase* dlg = win->openObject(item, Kexi::DesignViewMode, openingCancelled); if (!dlg) { - showError(TQString("Could not open table '%1'").tqarg(item->name())); + showError(TQString("Could not open table '%1'").arg(item->name())); return false; } KexiTableDesignerInterface* designerIface @@ -570,7 +570,7 @@ tristate AlterTableTester::run(bool &closeAppRequested) bool ok; variableI = command.mid(2).toInt(&ok); if (!ok) { - showError(TQString("Invalid variable initialization '%1'").tqarg(command)); + showError(TQString("Invalid variable initialization '%1'").arg(command)); return false; } continue; @@ -622,7 +622,7 @@ tristate AlterTableTester::run(bool &closeAppRequested) if (command=="stop") { if (!checkItemsNumber(1)) return false; - kdDebug() << TQString("Test STOPPED at line %1.").tqarg(testLineNumber) << endl; + kdDebug() << TQString("Test STOPPED at line %1.").arg(testLineNumber) << endl; break; } else if (command=="closeWindow") { @@ -640,7 +640,7 @@ tristate AlterTableTester::run(bool &closeAppRequested) break; } else { - showError( TQString("No such command '%1'").tqarg(command) ); + showError( TQString("No such command '%1'").arg(command) ); return false; } } @@ -674,7 +674,7 @@ int main(int argc, char *argv[]) testFilename = argv[argc-1]; testFile.setName(testFilename); if (!testFile.open(IO_ReadOnly)) { - kdWarning() << TQString("Opening test file %1 failed.").tqarg(testFilename) << endl; + kdWarning() << TQString("Opening test file %1 failed.").arg(testFilename) << endl; return quit(1); } //load db name @@ -704,10 +704,10 @@ int main(int argc, char *argv[]) res = tester.run(closeAppRequested); if (true != res) { if (false == res) - kdWarning() << TQString("Running test for file '%1' failed.").tqarg(testFilename) << endl; + kdWarning() << TQString("Running test for file '%1' failed.").arg(testFilename) << endl; return quit(res==false ? 1 : 0); } - kdDebug() << TQString("Tests from file '%1': OK").tqarg(testFilename) << endl; + kdDebug() << TQString("Tests from file '%1': OK").arg(testFilename) << endl; result = (closeOnFinish || closeAppRequested) ? 0 : tqApp->exec(); quit(result); return result; -- cgit v1.2.1