diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:32:11 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:32:11 -0600 |
commit | 94844816550ad672ccfcdc25659c625546239998 (patch) | |
tree | e35fc60fd736c645d59f6408af032774ad8023d3 /kexi/plugins/scripting | |
parent | 2a811c38c74c03648ecf857e566c44483cbad706 (diff) | |
download | koffice-94844816550ad672ccfcdc25659c625546239998.tar.gz koffice-94844816550ad672ccfcdc25659c625546239998.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'kexi/plugins/scripting')
10 files changed, 41 insertions, 41 deletions
diff --git a/kexi/plugins/scripting/kexidb/kexidbconnection.cpp b/kexi/plugins/scripting/kexidb/kexidbconnection.cpp index f64a089f..9d577ec1 100644 --- a/kexi/plugins/scripting/kexidb/kexidbconnection.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbconnection.cpp @@ -102,7 +102,7 @@ const TQString KexiDBConnection::getClassName() const { if(! m_connection) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Connection is NULL.")) ); //if(m_connection->error()) - // throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Connection error: %1").tqarg(m_connection->errorMsg())) ); + // throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Connection error: %1").arg(m_connection->errorMsg())) ); return m_connection; } @@ -140,9 +140,9 @@ KexiDBCursor* KexiDBConnection::executeQueryString(const TQString& sqlquery) { // or e.g. a DROP TABLE operation. So, let's check for such dangerous operations right now. ::KexiDB::Parser parser( connection() ); if(! parser.parse(sqlquery)) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to parse query: %1 %2").tqarg(parser.error().type()).tqarg(parser.error().error())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to parse query: %1 %2").arg(parser.error().type()).arg(parser.error().error())) ); if( parser.query() == 0 || parser.operation() != ::KexiDB::Parser::OP_Select ) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid query operation \"%1\"").tqarg(parser.operationString()) ) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid query operation \"%1\"").arg(parser.operationString()) ) ); ::KexiDB::Cursor* cursor = connection()->executeQuery(sqlquery); return cursor ? new KexiDBCursor(cursor) : 0; } diff --git a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp index c2475276..00b5a21d 100644 --- a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp @@ -66,7 +66,7 @@ const TQString KexiDBDriverManager::getClassName() const { KexiDB::DriverManager& KexiDBDriverManager::driverManager() { if(m_drivermanager.error()) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::DriverManager error: %1").tqarg(m_drivermanager.errorMsg())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::DriverManager error: %1").arg(m_drivermanager.errorMsg())) ); return m_drivermanager; } @@ -77,7 +77,7 @@ const TQStringList KexiDBDriverManager::driverNames() { KexiDBDriver* KexiDBDriverManager::driver(const TQString& drivername) { TQGuardedPtr< ::KexiDB::Driver > driver = driverManager().driver(drivername); // caching is done by the DriverManager if(! driver) return 0; - if(driver->error()) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Driver error for drivername '%1': %2").tqarg(drivername).tqarg(driver->errorMsg())) ); + if(driver->error()) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Driver error for drivername '%1': %2").arg(drivername).arg(driver->errorMsg())) ); return new KexiDBDriver(driver); } @@ -139,7 +139,7 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const TQSt data->password = config.readEntry("encryptedPassword"); uint len = data->password.length(); for (uint i=0; i<len; i++) - data->password[i] = TQChar( data->password[i].tqunicode() - 47 - i ); + data->password[i] = TQChar( data->password[i].unicode() - 47 - i ); } if(data->password.isEmpty()) data->password = config.readEntry("password"); diff --git a/kexi/plugins/scripting/kexidb/kexidbschema.cpp b/kexi/plugins/scripting/kexidb/kexidbschema.cpp index 2ac40342..c45eedfc 100644 --- a/kexi/plugins/scripting/kexidb/kexidbschema.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbschema.cpp @@ -179,11 +179,11 @@ bool KexiDBQuerySchema::setWhereExpression(const TQString& whereexpression) { ::KexiDB::Field* field = static_cast< ::KexiDB::QuerySchema* >(m_schema)->field(key); if(! field) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid WHERE-expression: Field \"%1\" does not exists in tableschema \"%2\".").tqarg(key).tqarg(m_schema->name())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid WHERE-expression: Field \"%1\" does not exists in tableschema \"%2\".").arg(key).arg(m_schema->name())) ); TQVariant v(value); if(! v.cast(field->variantType())) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid WHERE-expression: The for Field \"%1\" defined value is of type \"%2\" rather then the expected type \"%3\"").tqarg(key).tqarg(v.typeName()).tqarg(field->variantType())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid WHERE-expression: The for Field \"%1\" defined value is of type \"%2\" rather then the expected type \"%3\"").arg(key).arg(v.typeName()).arg(field->variantType())) ); static_cast< ::KexiDB::QuerySchema* >(m_schema)->addToWhereExpression(field,v); } diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp index 421bc31f..e9de3f46 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp +++ b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp @@ -28,12 +28,12 @@ #include <kross/main/scriptaction.h> #include <kross/api/interpreter.h> -#include <tqlayout.h> +#include <layout.h> #include <tqsplitter.h> #include <tqtimer.h> #include <tqdatetime.h> #include <tqdom.h> -#include <tqstylesheet.h> +#include <stylesheet.h> #include <ktextbrowser.h> #include <kdebug.h> @@ -73,8 +73,8 @@ KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, TQWidget *pa TQSplitter* splitter = new TQSplitter(this); splitter->setOrientation(Qt::Vertical); - TQHBoxLayout* tqlayout = new TQHBoxLayout(this); - tqlayout->addWidget(splitter); + TQHBoxLayout* layout = new TQHBoxLayout(this); + layout->addWidget(splitter); d->editor = new KexiScriptEditor(mainWin, splitter, "ScriptEditor"); splitter->setFocusProxy(d->editor); @@ -191,7 +191,7 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope if(property.name() == "language") { TQString language = property.value().toString(); - kdDebug() << TQString("KexiScriptDesignView::slotPropertyChanged() language=%1").tqarg(language) << endl; + kdDebug() << TQString("KexiScriptDesignView::slotPropertyChanged() language=%1").arg(language) << endl; d->scriptaction->setInterpreterName( language ); // We assume Kross and the HighlightingInterface are using same // names for the support languages... @@ -201,7 +201,7 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope else { bool ok = d->scriptaction->setOption( property.name(), property.value() ); if(! ok) { - kdWarning() << TQString("KexiScriptDesignView::slotPropertyChanged() unknown property '%1'.").tqarg(TQString(property.name())) << endl; + kdWarning() << TQString("KexiScriptDesignView::slotPropertyChanged() unknown property '%1'.").arg(TQString(property.name())) << endl; return; } } @@ -214,12 +214,12 @@ void KexiScriptDesignView::execute() d->statusbrowser->clear(); TQTime time; time.start(); - d->statusbrowser->append( i18n("Execution of the script \"%1\" started.").tqarg(d->scriptaction->name()) ); + d->statusbrowser->append( i18n("Execution of the script \"%1\" started.").arg(d->scriptaction->name()) ); d->scriptaction->activate(); if( d->scriptaction->hadException() ) { TQString errormessage = d->scriptaction->getException()->getError(); - d->statusbrowser->append(TQString("<b>%2</b><br>").tqarg(TQStyleSheet::escape(errormessage)) ); + d->statusbrowser->append(TQString("<b>%2</b><br>").arg(TQStyleSheet::escape(errormessage)) ); TQString tracedetails = d->scriptaction->getException()->getTrace(); d->statusbrowser->append( TQStyleSheet::escape(tracedetails) ); @@ -229,7 +229,7 @@ void KexiScriptDesignView::execute() d->editor->setLineNo(lineno); } else { - d->statusbrowser->append( i18n("Successfully executed. Time elapsed: %1ms").tqarg(time.elapsed()) ); + d->statusbrowser->append( i18n("Successfully executed. Time elapsed: %1ms").arg(time.elapsed()) ); } } diff --git a/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp b/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp index 8aec288b..08820522 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp +++ b/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp @@ -76,7 +76,7 @@ void KexiScriptEditor::initialize(Kross::Api::ScriptAction* scriptaction) "support in Kexi. The scripting API may change in details\n" "in the next Kexi version.\n" "For more information and documentation see\n%1" - ).tqarg("http://www.kexi-project.org/scripting/"), true).join("\n# ") + "\n"; + ).arg("http://www.kexi-project.org/scripting/"), true).join("\n# ") + "\n"; } KexiEditor::setText(code); // We assume Kross and the HighlightingInterface are using same diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp b/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp index cb66734d..84fbe4ec 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp +++ b/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp @@ -95,7 +95,7 @@ bool KexiScriptPart::execute(KexiPart::Item* item, TQObject* sender) bool exec = (dontask == "yes"); if( !exec && dontask != "no" ) { exec = KMessageBox::warningContinueCancel(0, - i18n("Do you want to execute the script \"%1\"?\n\nScripts obtained from unknown sources can contain dangerous code.").tqarg(scriptaction->text()), + i18n("Do you want to execute the script \"%1\"?\n\nScripts obtained from unknown sources can contain dangerous code.").arg(scriptaction->text()), i18n("Execute Script?"), KGuiItem(i18n("Execute"), "exec"), dontAskAgainName, KMessageBox::Notify | KMessageBox::Dangerous ) == KMessageBox::Continue; diff --git a/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py b/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py index 6f75bdea..f244ae39 100644 --- a/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py +++ b/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py @@ -93,10 +93,10 @@ def runGuiApp(copycenter, name): qt.QDialog.__init__(self, parent, "ProgressDialog", 1) self.parent = parent self.setCaption(caption) - tqlayout = qt.QVBoxLayout(self) + layout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(2) - tqlayout.addWidget(box) + layout.addWidget(box) self.listview = qt.QListView(box) self.listview.setAllColumnsShowFocus(True) self.listview.header().setStretchEnabled(True,0) @@ -216,7 +216,7 @@ def runGuiApp(copycenter, name): print "CopyJobWidget.writeOptions" writer.write("<%s plugin=\"%s\">\n" % (plugininst.plugintype, pluginname)) for optionname in plugininst.options: - value = self.escape( tqunicode(plugininst.options[optionname]).encode("utf-8") ) + value = self.escape( unicode(plugininst.options[optionname]).encode("utf-8") ) writer.write("\t<%s value=\"%s\" />\n" % (optionname,value)) writer.write("</%s>\n" % plugininst.plugintype) @@ -309,31 +309,31 @@ def runGuiApp(copycenter, name): self.starttime = None qt.QDialog.__init__(self, dialog, "ProgressDialog", 1) self.setCaption("Copying...") - tqlayout = qt.QVBoxLayout(self) + layout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setSpacing(6) box.setMargin(6) - tqlayout.addWidget(box) + layout.addWidget(box) self.textbrowser = qt.QTextBrowser(box) self.textbrowser.setWordWrap(qt.QTextEdit.WidgetWidth) self.textbrowser.setTextFormat(qt.Qt.RichText) statusbox = qt.QFrame(box) - tqlayout = qt.QGridLayout(statusbox,4,2,0,2) - tqlayout.addWidget(qt.QLabel("Number of records done:",statusbox),0,0) + layout = qt.QGridLayout(statusbox,4,2,0,2) + layout.addWidget(qt.QLabel("Number of records done:",statusbox),0,0) self.donecounter = 0 self.donelabel = qt.QLabel("-",statusbox) - tqlayout.addWidget(self.donelabel,0,1) - tqlayout.addWidget(qt.QLabel("Successfully copied records:",statusbox),1,0) + layout.addWidget(self.donelabel,0,1) + layout.addWidget(qt.QLabel("Successfully copied records:",statusbox),1,0) self.successcounter = 0 self.successlabel = qt.QLabel("-",statusbox) - tqlayout.addWidget(self.successlabel,1,1) - tqlayout.addWidget(qt.QLabel("Failed to copy records:",statusbox),2,0) + layout.addWidget(self.successlabel,1,1) + layout.addWidget(qt.QLabel("Failed to copy records:",statusbox),2,0) self.failedcounter = 0 self.failedlabel = qt.QLabel("-",statusbox) - tqlayout.addWidget(self.failedlabel,2,1) - tqlayout.addWidget(qt.QLabel("Elapsed time in seconds:",statusbox),3,0) + layout.addWidget(self.failedlabel,2,1) + layout.addWidget(qt.QLabel("Elapsed time in seconds:",statusbox),3,0) self.elapsedlabel = qt.QLabel("-",statusbox) - tqlayout.addWidget(self.elapsedlabel,3,1) + layout.addWidget(self.elapsedlabel,3,1) btnbox = qt.QHBox(box) btnbox.setSpacing(6) self.donebtn = qt.QPushButton(btnbox) @@ -530,11 +530,11 @@ def runGuiApp(copycenter, name): self.ListViewDialog = ListViewDialog qt.QDialog.__init__(self, parent, "Dialog", 1, qt.Qt.WDestructiveClose) self.setCaption("Copy Center") - tqlayout = qt.QVBoxLayout(self) + layout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(6) box.setSpacing(6) - tqlayout.addWidget(box) + layout.addWidget(box) self.tab = qt.QTabWidget(box) self.tab.setMargin(6) box.setStretchFactor(self.tab,1) diff --git a/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py b/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py index 678cf40b..985d757d 100644 --- a/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py +++ b/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py @@ -84,7 +84,7 @@ class CopyCenterPlugin: return None record = [] for fieldname in self.fieldlist: - record.append( tqunicode(self.cursor.value(fieldname).toString()).encode("latin-1") ) + record.append( unicode(self.cursor.value(fieldname).toString()).encode("latin-1") ) #print "read record: %s" % record return record @@ -145,8 +145,8 @@ class CopyCenterPlugin: cursorrecord.setValue(self.fieldlist[i], v) rowcount = self.cursor.insert() if rowcount < 1: - drv = tqunicode(self.cursor.lastError().driverText()).encode("latin-1") - db = tqunicode(self.cursor.lastError().databaseText()).encode("latin-1") + drv = unicode(self.cursor.lastError().driverText()).encode("latin-1") + db = unicode(self.cursor.lastError().databaseText()).encode("latin-1") print "failed: %s %s" % (drv,db) self.copierer.writeFailed(record) else: diff --git a/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py b/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py index d0d1f0cc..cace0340 100644 --- a/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py +++ b/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py @@ -131,7 +131,7 @@ class HtmlExporter: if items == None: break output.write("<tr>") for item in items: - u = tqunicode(str(self.htmlescape(item)),"latin-1") + u = unicode(str(self.htmlescape(item)),"latin-1") output.write("<td>%s</td>" % u.encode("utf-8")) output.write("</tr>\n") output.write("</table>\n") diff --git a/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py b/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py index 6ca94f9a..200b3dee 100755 --- a/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py +++ b/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py @@ -124,9 +124,9 @@ class SaxInput: was parsed. """ if self.field != None: - # the xml-data is tqunicode and we need to encode it + # the xml-data is unicode and we need to encode it # to latin-1 cause KexiDB deals only with latin-1. - u = tqunicode(chars[offset:offset+length]) + u = unicode(chars[offset:offset+length]) self.field.append(u.encode("latin-1")) # start the job |