summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-16 09:56:17 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-16 09:56:17 -0600
commit1f9d00360b9018301630ce062d7dda0c6583edfb (patch)
tree1013b917f9a8ad41ed928d62250e9bfe1ed91414 /kmymoney2/mymoney/storage/mymoneystoragesql.cpp
parent252fce5a2a5384702fbcc1c9987284d7bd2e6943 (diff)
downloadkmymoney-1f9d00360b9018301630ce062d7dda0c6583edfb.tar.gz
kmymoney-1f9d00360b9018301630ce062d7dda0c6583edfb.zip
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 252fce5a2a5384702fbcc1c9987284d7bd2e6943.
Diffstat (limited to 'kmymoney2/mymoney/storage/mymoneystoragesql.cpp')
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.cpp134
1 files changed, 67 insertions, 67 deletions
diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
index e14f79e..8f6a4f3 100644
--- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
+++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
@@ -60,11 +60,11 @@ MyMoneySqlQuery::MyMoneySqlQuery (MyMoneyStorageSql* db)
}
bool MyMoneySqlQuery::exec () {
- TRACE(TQString("start sql - %1").arg(lastQuery()));
+ TRACE(TQString("start sql - %1").tqarg(lastQuery()));
bool rc = TQSqlQuery::exec();
TQString msg("end sql\n%1\n***Query returned %2, row count %3");
- TRACE (msg.arg(TQSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected()));
- //DBG (TQString("%1\n***Query returned %2, row count %3").arg(TQSqlQuery::executedQuery()).arg(rc).arg(size()));
+ TRACE (msg.tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(numRowsAffected()));
+ //DBG (TQString("%1\n***Query returned %2, row count %3").tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(size()));
return (rc);
}
@@ -97,7 +97,7 @@ databaseTypeE MyMoneyDbDrivers::driverToType (const TQString& driver) const {
else if (driver == "QPSQL7") return(Postgresql);
else if (driver == "QTDS7") return(Sybase);
else if (driver == "QSQLITE3") return(Sqlite3);
- else throw new MYMONEYEXCEPTION (TQString("Unknown database driver type").arg(driver));
+ else throw new MYMONEYEXCEPTION (TQString("Unknown database driver type").tqarg(driver));
}
bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const {
@@ -118,7 +118,7 @@ MyMoneyStorageSql::MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& ur
DBG("*** Entering MyMoneyStorageSql::MyMoneyStorageSql");
m_dbVersion = 0;
m_progressCallback = 0;
- m_displayStatus = false;
+ m_displaytqStatus = false;
m_storage = storage;
m_storagePtr = dynamic_cast<IMyMoneyStorage*>(storage);
m_newDatabase = false;
@@ -182,7 +182,7 @@ try {
}
break;
default:
- qFatal("%s", TQString("%1 - unknown open mode %2").arg(__func__).arg(openMode).data());
+ qFatal("%s", TQString("%1 - unknown open mode %2").tqarg(__func__).tqarg(openMode).data());
}
if (rc != 0) return (rc);
// bypass logon check if we are creating a database
@@ -192,15 +192,15 @@ try {
if (!m_logonUser.isEmpty() && (!m_override)) {
m_error = TQString
(i18n("Database apparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?"))
- .arg(m_logonUser)
- .arg(m_logonAt.date().toString(Qt::ISODate))
- .arg(m_logonAt.time().toString("hh.mm.ss"));
+ .tqarg(m_logonUser)
+ .tqarg(m_logonAt.date().toString(Qt::ISODate))
+ .tqarg(m_logonAt.time().toString("hh.mm.ss"));
qDebug("%s", m_error.data());
close(false);
rc = -1;
} else {
m_logonUser = url.user() + "@" + url.host();
- m_logonAt = TQDateTime::currentDateTime();
+ m_logonAt = TQDateTime::tqcurrentDateTime();
writeFileInfo();
}
return(rc);
@@ -229,7 +229,7 @@ int MyMoneyStorageSql::createDatabase (const KURL& url) {
if (m_dbType == Sqlite3) return(0); // not needed for sqlite
if (!m_dbType == Mysql) {
m_error =
- TQString(i18n("Cannot currently create database for driver %1; please create manually")).arg(driverName());
+ TQString(i18n("Cannot currently create database for driver %1; please create manually")).tqarg(driverName());
return (1);
}
// create the database (only works for mysql at present)
@@ -241,10 +241,10 @@ int MyMoneyStorageSql::createDatabase (const KURL& url) {
maindb->setPassword (url.pass());
maindb->open();
TQSqlQuery qm(maindb);
- TQString qs = TQString("CREATE DATABASE %1;").arg(dbName);
+ TQString qs = TQString("CREATE DATABASE %1;").tqarg(dbName);
qm.prepare (qs);
if (!qm.exec()) {
- buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).arg(dbName));
+ buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).tqarg(dbName));
return (1);
}
TQSqlDatabase::removeDatabase (maindb);
@@ -325,7 +325,7 @@ int MyMoneyStorageSql::upgradeDb() {
}
}
// write updated version to DB
- //setVersion(TQString("%1.%2").arg(m_dbVersion).arg(m_minorVersion));
+ //setVersion(TQString("%1.%2").tqarg(m_dbVersion).tqarg(m_minorVersion));
q.prepare (TQString("UPDATE kmmFileInfo SET version = :version;"));
q.bindValue(":version", m_dbVersion);
if (!q.exec()) {
@@ -363,12 +363,12 @@ bool MyMoneyStorageSql::addColumn
TQSqlQuery q(this);
TQString afterString = ";";
if (!after.isEmpty())
- afterString = TQString("AFTER %1;").arg(after);
+ afterString = TQString("AFTER %1;").tqarg(after);
q.prepare("ALTER TABLE " + t.name() + " ADD COLUMN " +
c.generateDDL(m_dbType) + afterString);
if (!q.exec()) {
buildError (q, __func__,
- TQString("Error adding column %1 to table %2").arg(c.name()).arg(t.name()));
+ TQString("Error adding column %1 to table %2").tqarg(c.name()).tqarg(t.name()));
return (false);
}
return (true);
@@ -392,7 +392,7 @@ bool MyMoneyStorageSql::dropColumn
+ col + ";");
if (!q.exec()) {
buildError (q, __func__,
- TQString("Error dropping column %1 from table %2").arg(col).arg(t.name()));
+ TQString("Error dropping column %1 from table %2").tqarg(col).tqarg(t.name()));
return (false);
}
return (true);
@@ -657,7 +657,7 @@ int MyMoneyStorageSql::upgradeToV6() {
// upgrade Mysql to InnoDB transaction-safe engine
if (m_dbType == Mysql) {
for (TQMapConstIterator<TQString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) {
- q.prepare(TQString("ALTER TABLE %1 ENGINE = InnoDB;").arg(tt.data().name()));
+ q.prepare(TQString("ALTER TABLE %1 ENGINE = InnoDB;").tqarg(tt.data().name()));
if (!q.exec()) {
buildError (q, __func__, "Error updating to InnoDB");
return (1);
@@ -737,7 +737,7 @@ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) {
long unsigned MyMoneyStorageSql::getRecCount (const TQString& table) const {
DBG("*** Entering MyMoneyStorageSql::getRecCount");
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this));
- q.prepare(TQString("SELECT COUNT(*) FROM %1;").arg(table));
+ q.prepare(TQString("SELECT COUNT(*) FROM %1;").tqarg(table));
if ((!q.exec()) || (!q.next())) {
buildError (q, __func__, "error retrieving record count");
qFatal("Error retrieving record count"); // definitely shouldn't happen
@@ -763,7 +763,7 @@ int MyMoneyStorageSql::createTables () {
for (TQMapConstIterator<TQString, MyMoneyDbView> tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) {
if (!lowerTables.contains(tt.key().lower())) {
q.prepare (tt.data().createString());
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").arg(tt.key())));
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").tqarg(tt.key())));
}
}
@@ -780,7 +780,7 @@ void MyMoneyStorageSql::createTable (const MyMoneyDbTable& t) {
MyMoneySqlQuery q(this);
for (unsigned int i = 0; i < ql.count(); ++i) {
q.prepare (ql[i]);
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating table/index %1").arg(t.name())));
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating table/index %1").tqarg(t.name())));
}
}
@@ -791,7 +791,7 @@ int MyMoneyStorageSql::isEmpty () {
int recordCount = 0;
MyMoneySqlQuery q(this);
while ((tt != m_db.tableEnd()) && (recordCount == 0)) {
- q.prepare (TQString("select count(*) from %1;").arg((*tt).name()));
+ q.prepare (TQString("select count(*) from %1;").tqarg((*tt).name()));
if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "getting record count"));
if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving record count"));
recordCount += q.value(0).toInt();
@@ -811,7 +811,7 @@ void MyMoneyStorageSql::clean() {
TQMapConstIterator<TQString, MyMoneyDbTable> it = m_db.tableBegin();
MyMoneySqlQuery q(this);
while (it != m_db.tableEnd()) {
- q.prepare(TQString("DELETE from %1;").arg(it.key()));
+ q.prepare(TQString("DELETE from %1;").tqarg(it.key()));
if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("cleaning database")));
++it;
}
@@ -821,7 +821,7 @@ void MyMoneyStorageSql::clean() {
bool MyMoneyStorageSql::readFile(void) {
DBG("*** Entering MyMoneyStorageSql::readFile");
- m_displayStatus = true;
+ m_displaytqStatus = true;
try {
readFileInfo();
readInstitutions();
@@ -860,7 +860,7 @@ bool MyMoneyStorageSql::readFile(void) {
// FIXME?? if (m_mode == 0) m_storage = NULL;
// make sure the progress bar is not shown any longer
signalProgress(-1, -1);
- m_displayStatus = false;
+ m_displaytqStatus = false;
//MyMoneySqlQuery::traceOn();
return true;
} catch (TQString& s) {
@@ -876,7 +876,7 @@ bool MyMoneyStorageSql::writeFile(void) {
= m_securities = m_prices = m_currencies = m_schedules = m_reports = m_kvps = m_budgets = 0;
m_hiIdInstitutions = m_hiIdPayees = m_hiIdAccounts = m_hiIdTransactions =
m_hiIdSchedules = m_hiIdSecurities = m_hiIdReports = m_hiIdBudgets = 0;
- m_displayStatus = true;
+ m_displaytqStatus = true;
try{
startCommitUnit(__func__);
writeInstitutions ();
@@ -897,7 +897,7 @@ bool MyMoneyStorageSql::writeFile(void) {
endCommitUnit(__func__);
// make sure the progress bar is not shown any longer
signalProgress(-1, -1);
- m_displayStatus = false;
+ m_displaytqStatus = false;
return true;
} catch (TQString& s) {
return false;
@@ -921,7 +921,7 @@ bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) {
// as value of this method.
bool rc = true;
if (callingFunction != m_commitUnitStack.top())
- qDebug("%s", TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data());
+ qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data());
m_commitUnitStack.pop();
if (m_commitUnitStack.isEmpty()) {
if (!commit()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "ending commit unit"));
@@ -932,7 +932,7 @@ bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) {
void MyMoneyStorageSql::cancelCommitUnit (const TQString& callingFunction) {
DBG("*** Entering MyMoneyStorageSql::cancelCommitUnit");
if (callingFunction != m_commitUnitStack.top())
- qDebug("%s", TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data());
+ qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data());
if (m_commitUnitStack.isEmpty()) return;
m_commitUnitStack.clear();
if (!rollback()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "cancelling commit unit"));
@@ -1973,9 +1973,9 @@ void MyMoneyStorageSql::writeCurrency(const MyMoneySecurity& currency, MyMoneySq
// writing the symbol as three short ints is a PITA, but the
// problem is that database drivers have incompatible ways of declaring UTF8
TQString symbol = currency.tradingSymbol() + " ";
- q.bindValue(":symbol1", symbol.mid(0,1).unicode()->unicode());
- q.bindValue(":symbol2", symbol.mid(1,1).unicode()->unicode());
- q.bindValue(":symbol3", symbol.mid(2,1).unicode()->unicode());
+ q.bindValue(":symbol1", symbol.mid(0,1).tqunicode()->tqunicode());
+ q.bindValue(":symbol2", symbol.mid(1,1).tqunicode()->tqunicode());
+ q.bindValue(":symbol3", symbol.mid(2,1).tqunicode()->tqunicode());
q.bindValue(":symbolString", symbol);
q.bindValue(":partsPerUnit", currency.partsPerUnit());
q.bindValue(":smallestCashFraction", currency.smallestCashFraction());
@@ -2167,7 +2167,7 @@ void MyMoneyStorageSql::writeFileInfo() {
q.bindValue(":fixLevel", m_storage->fileFixVersion());
q.bindValue(":created", TQString(m_storage->creationDate().toString(Qt::ISODate)));
//q.bindValue(":lastModified", m_storage->lastModificationDate().toString(Qt::ISODate));
- q.bindValue(":lastModified", TQString(TQDate::currentDate().toString(Qt::ISODate)));
+ q.bindValue(":lastModified", TQString(TQDate::tqcurrentDate().toString(Qt::ISODate)));
q.bindValue(":baseCurrency", m_storage->pairs()["kmm-baseCurrency"]);
q.bindValue(":institutions", (unsigned long long) m_institutions);
q.bindValue(":accounts", (unsigned long long) m_accounts);
@@ -2239,7 +2239,7 @@ void MyMoneyStorageSql::deleteKeyValuePairs (const TQString& kvpType, const TQSt
q.prepare ("DELETE FROM kmmKeyValuePairs WHERE kvpType = :kvpType AND kvpId = :kvpId;");
q.bindValue(":kvpType", kvpType);
q.bindValue(":kvpId", kvpId);
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting kvp for %1 %2").arg(kvpType).arg(kvpId)));
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting kvp for %1 %2").tqarg(kvpType).tqarg(kvpId)));
m_kvps -= q.numRowsAffected();
}
@@ -2410,7 +2410,7 @@ void MyMoneyStorageSql::readPayees(const TQValueList<TQString> pid) {
const TQMap<TQString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const TQStringList& idList, bool /*forUpdate*/) const {
DBG("*** Entering MyMoneyStorageSql::readPayees");
- if (m_displayStatus) {
+ if (m_displaytqStatus) {
signalProgress(0, m_payees, TQObject::tr("Loading payees..."));
} else {
// if (m_payeeListRead) return;
@@ -2428,7 +2428,7 @@ const TQMap<TQString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const TQStri
TQString itemConnector = "";
TQStringList::ConstIterator it;
for (it = idList.begin(); it != idList.end(); ++it) {
- whereClause.append(TQString("%1id = '%2'").arg(itemConnector).arg(*it));
+ whereClause.append(TQString("%1id = '%2'").tqarg(itemConnector).tqarg(*it));
itemConnector = " or ";
}
whereClause += ")";
@@ -2472,7 +2472,7 @@ const TQMap<TQString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const TQStri
//if(id > lastId)
// lastId = id;
}
- if (m_displayStatus) signalProgress(++progress, 0);
+ if (m_displaytqStatus) signalProgress(++progress, 0);
}
return pList;
}
@@ -2623,7 +2623,7 @@ const TQMap<TQString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const TQStri
// the <= operator misbehave when the date matches. To avoid this, add a day to the
// requested date and use the < operator.
if (date.isValid() && !date.isNull())
- queryString += TQString(" AND postDate < '%1'").arg(date.addDays(1).toString(Qt::ISODate));
+ queryString += TQString(" AND postDate < '%1'").tqarg(date.addDays(1).toString(Qt::ISODate));
DBG (queryString);
q.prepare(queryString);
@@ -2666,7 +2666,7 @@ void MyMoneyStorageSql::readTransactions(const MyMoneyTransactionFilter& filter)
const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const TQString& tidList, const TQString& dateClause, bool /*forUpdate*/) const {
DBG("*** Entering MyMoneyStorageSql::readTransactions");
// if (m_transactionListRead) return; // all list already in memory
- if (m_displayStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions..."));
+ if (m_displaytqStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions..."));
int progress = 0;
// m_payeeList.clear();
TQString whereClause;
@@ -2748,7 +2748,7 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
i != txMapEnd; ++i) {
i.data().setPairs(kvpMap[i.data().id()].pairs());
- if (m_displayStatus) signalProgress(++progress, 0);
+ if (m_displaytqStatus) signalProgress(++progress, 0);
}
if ((tidList.isEmpty()) && (dateClause.isEmpty())) {
@@ -2866,7 +2866,7 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
TQStringList::const_iterator it;
for (it = payees.begin(); it != payees.end(); ++it) {
payeesClause.append(TQString("%1'%2'")
- .arg(itemConnector).arg(*it));
+ .tqarg(itemConnector).tqarg(*it));
itemConnector = ", ";
}
if (!payeesClause.isEmpty()) {
@@ -2885,7 +2885,7 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
for (it = accounts.begin(); it != accounts.end(); ++it) {
// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) {
accountsClause.append(TQString("%1 '%2'")
- .arg(itemConnector).arg(*it));
+ .tqarg(itemConnector).tqarg(*it));
itemConnector = ", ";
//if (accountsOnlyFilter) m_accountsLoaded.append(*it); // a bit premature...
// }
@@ -2904,8 +2904,8 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
TQString statesClause = "";
for (TQValueList<int>::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) {
statesClause.append(TQString(" %1 '%2'")
- .arg(itemConnector)
- .arg(splitState(MyMoneyTransactionFilter::stateOptionE(*it))));
+ .tqarg(itemConnector)
+ .tqarg(splitState(MyMoneyTransactionFilter::stateOptionE(*it))));
itemConnector = ",";
}
if (!statesClause.isEmpty()) {
@@ -2941,19 +2941,19 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
TQString dateClause;
TQString connector = "";
if (end != TQDate()) {
- dateClause = TQString("(postDate < '%1')").arg(end.addDays(1).toString(Qt::ISODate));
+ dateClause = TQString("(postDate < '%1')").tqarg(end.addDays(1).toString(Qt::ISODate));
connector = " and ";
}
if (start != TQDate()) {
- dateClause += TQString("%1 (postDate >= '%2')").arg(connector).arg(start.toString(Qt::ISODate));
+ dateClause += TQString("%1 (postDate >= '%2')").tqarg(connector).tqarg(start.toString(Qt::ISODate));
}
// now get a list of transaction ids
// if we have only a date filter, we need to build the list from the tx table
// otherwise we need to build from the split table
if (splitFilterActive) {
- inQuery = TQString("(select distinct transactionId from kmmSplits %1)").arg(whereClause);
+ inQuery = TQString("(select distinct transactionId from kmmSplits %1)").tqarg(whereClause);
} else {
- inQuery = TQString("(select distinct id from kmmTransactions where %1)").arg(dateClause);
+ inQuery = TQString("(select distinct id from kmmTransactions where %1)").tqarg(dateClause);
txFilterActive = false; // kill off the date filter now
}
@@ -3245,7 +3245,7 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const TQString& fromIdL
TQDate date (date_);
if(!date.isValid())
- date = TQDate::currentDate();
+ date = TQDate::tqcurrentDate();
q.bindValue(":fromId", fromIdList);
q.bindValue(":toId", toIdList);
@@ -3522,8 +3522,8 @@ const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const TQStr
q.prepare ("SELECT kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type and kvpId = :id;");
q.bindValue(":type", kvpType);
q.bindValue(":id", kvpId);
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp for %1 %2").arg(kvpType)
- .arg(kvpId)));
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp for %1 %2").tqarg(kvpType)
+ .tqarg(kvpId)));
while (q.next()) list.setValue(q.value(0).toString(), q.value(1).toString());
return (list);
}
@@ -3542,7 +3542,7 @@ const TQMap<TQString, MyMoneyKeyValueContainer> MyMoneyStorageSql::readKeyValueP
query += " order by kvpId;";
q.prepare (query);
q.bindValue(":type", kvpType);
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp List for %1").arg(kvpType)));
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp List for %1").tqarg(kvpType)));
while (q.next()) {
retval [q.value(0).toString()].setValue(q.value(1).toString(), q.value(2).toString());
}
@@ -3786,15 +3786,15 @@ void MyMoneyStorageSql::signalProgress(int current, int total, const TQString& m
// **************************** Error display routine *******************************
TQString& MyMoneyStorageSql::buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const {
- TQString s = TQString("Error in function %1 : %2").arg(function).arg(message);
+ TQString s = TQString("Error in function %1 : %2").tqarg(function).tqarg(message);
TQSqlError e = lastError();
s += TQString ("\nDriver = %1, Host = %2, User = %3, Database = %4")
- .arg(driverName()).arg(hostName()).arg(userName()).arg(databaseName());
- s += TQString ("\nDriver Error: %1").arg(e.driverText());
- s += TQString ("\nDatabase Error No %1: %2").arg(e.number()).arg(e.databaseText());
+ .tqarg(driverName()).tqarg(hostName()).tqarg(userName()).tqarg(databaseName());
+ s += TQString ("\nDriver Error: %1").tqarg(e.driverText());
+ s += TQString ("\nDatabase Error No %1: %2").tqarg(e.number()).tqarg(e.databaseText());
e = q.lastError();
- s += TQString ("\nExecuted: %1").arg(q.executedQuery());
- s += TQString ("\nQuery error No %1: %2").arg(e.number()).arg(e.text());
+ s += TQString ("\nExecuted: %1").tqarg(q.executedQuery());
+ s += TQString ("\nQuery error No %1: %2").tqarg(e.number()).tqarg(e.text());
const_cast <MyMoneyStorageSql*> (this)->m_error = s;
qDebug("%s", s.ascii());
@@ -4131,9 +4131,9 @@ const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const {
replace = TQString::number
(MyMoneyFile::instance()->storage()->currentFixVersion());
if ((*fit)->name() == "created")
- replace = TQDate::currentDate().toString(Qt::ISODate);
+ replace = TQDate::tqcurrentDate().toString(Qt::ISODate);
if ((*fit)->name() == "lastModified")
- replace = TQDate::currentDate().toString(Qt::ISODate);
+ replace = TQDate::tqcurrentDate().toString(Qt::ISODate);
if ((*fit)->name() == "updateInProgress")
replace = enclose("N");
qs.replace(toReplace, replace);
@@ -4188,12 +4188,12 @@ void MyMoneyDbTable::addIndex(const TQString& name, const TQStringList& columns,
void MyMoneyDbTable::buildSQLStrings (void) {
// build fixed SQL strings for this table
// build the insert string with placeholders for each field
- TQString qs = TQString("INSERT INTO %1 (").arg(name());
+ TQString qs = TQString("INSERT INTO %1 (").tqarg(name());
TQString ws = ") VALUES (";
field_iterator ft = m_fields.begin();
while (ft != m_fields.end()) {
- qs += TQString("%1, ").arg((*ft)->name());
- ws += TQString(":%1, ").arg((*ft)->name());
+ qs += TQString("%1, ").tqarg((*ft)->name());
+ ws += TQString(":%1, ").tqarg((*ft)->name());
++ft;
}
qs = qs.left(qs.length() - 2);
@@ -4210,9 +4210,9 @@ void MyMoneyDbTable::buildSQLStrings (void) {
while (ft != m_fields.end()) {
if ((*ft)->isPrimaryKey()) {
if (!ws.isEmpty()) ws += " AND ";
- ws += TQString("%1 = :%2").arg((*ft)->name()).arg((*ft)->name());
+ ws += TQString("%1 = :%2").tqarg((*ft)->name()).tqarg((*ft)->name());
} else {
- qs += TQString("%1 = :%2, ").arg((*ft)->name()).arg((*ft)->name());
+ qs += TQString("%1 = :%2, ").tqarg((*ft)->name()).tqarg((*ft)->name());
}
++ft;
}
@@ -4230,14 +4230,14 @@ const TQString MyMoneyDbTable::columnList() const {
TQString qs;
ft = m_fields.begin();
while (ft != m_fields.end()) {
- qs += TQString("%1, ").arg((*ft)->name());
+ qs += TQString("%1, ").tqarg((*ft)->name());
++ft;
}
return (qs.left(qs.length() - 2));
}
const TQString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const {
- TQString qs = TQString("CREATE TABLE %1 (").arg(name());
+ TQString qs = TQString("CREATE TABLE %1 (").tqarg(name());
TQString pkey;
for (field_iterator it = m_fields.begin(); it != m_fields.end(); ++it) {
qs += (*it)->generateDDL (dbType) + ", ";