diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-19 11:37:08 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-06-06 03:55:16 +0200 |
commit | 1de308fd3b1aacec7769d867a6eeaa98af69c61c (patch) | |
tree | 0a6433c4fe72a4e70d7686c84dcf9848ff8b7284 /kmymoney2/mymoney/storage | |
parent | e0d4ece30d7c0095bfdd9a81364b66fe18a0f2cb (diff) | |
download | kmymoney-1de308fd3b1aacec7769d867a6eeaa98af69c61c.tar.gz kmymoney-1de308fd3b1aacec7769d867a6eeaa98af69c61c.zip |
Remove additional unneeded tq method conversions
(cherry picked from commit c70e40bd3f54a2c4d9ef57a36f19c996f4e00ed6)
Diffstat (limited to 'kmymoney2/mymoney/storage')
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp | 14 | ||||
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp | 2 | ||||
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp | 18 | ||||
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h | 2 | ||||
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneystorageanon.cpp | 2 | ||||
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneystoragesql.cpp | 100 | ||||
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneystoragexml.cpp | 10 |
7 files changed, 74 insertions, 74 deletions
diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp index 7cbcb6b..6324d4c 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp @@ -220,7 +220,7 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) TQMap<TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(); // make sure they're all here for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { if((*it_t).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").arg("transaction")); } } @@ -228,7 +228,7 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(); // make sure they're all here for(it_s = scheduleList.begin(); it_s != scheduleList.end(); ++it_s) { if((*it_s).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").arg("schedule")); } } // remove any reference to report and/or budget @@ -532,7 +532,7 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool // update information in account list //m_accountList.modify(account.id(), account); - // tqinvalidate cached balance + // invalidate cached balance //FIXME: invalidateBalanceCache(account.id()); // mark file as changed @@ -1344,7 +1344,7 @@ void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency) it = currencyList.find(currency.id()); if(it != currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").arg(currency.id())); } m_sql->addCurrency(currency); @@ -1358,7 +1358,7 @@ void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency) it = currencyList.find(currency.id()); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").arg(currency.id())); } m_sql->modifyCurrency(currency); @@ -1373,7 +1373,7 @@ void MyMoneyDatabaseMgr::removeCurrency(const MyMoneySecurity& currency) it = currencyList.find(currency.id()); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").arg(currency.id())); } m_sql->removeCurrency(currency); @@ -1389,7 +1389,7 @@ const MyMoneySecurity MyMoneyDatabaseMgr::currency(const TQString& id) const it = currencyList.find(id); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").arg(id)); } return *it; diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp index cf76cb6..30fe093 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp @@ -742,7 +742,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { MyMoneyBudget newBudget = oldBudget; newBudget.clearId(); - newBudget.setName(TQString("Copy of %1").tqarg(oldBudget.name())); + newBudget.setName(TQString("Copy of %1").arg(oldBudget.name())); m->addBudget(newBudget); CPPUNIT_ASSERT(m->budgetList().count() == 2); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp index da9a40c..3ab0b72 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp @@ -225,14 +225,14 @@ void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee) // scan all transactions to check if the payee is still referenced for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { if((*it_t).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").arg("transaction")); } } // check referential integrity in schedules for(it_s = m_scheduleList.begin(); it_s != m_scheduleList.end(); ++it_s) { if((*it_s).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").arg("schedule")); } } @@ -503,7 +503,7 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo // update information in account list m_accountList.modify(account.id(), account); - // tqinvalidate cached balance + // invalidate cached balance invalidateBalanceCache(account.id()); } else @@ -817,14 +817,14 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& id) co // get the full key of this transaction, throw exception // if it's invalid (unknown) if(!m_transactionKeys.contains(id)) { - TQString msg = TQString("Invalid transaction id '%1'").tqarg(id); + TQString msg = TQString("Invalid transaction id '%1'").arg(id); throw new MYMONEYEXCEPTION(msg); } // check if this key is in the list, throw exception if not TQString key = m_transactionKeys[id]; if(!m_transactionList.contains(key)) { - TQString msg = TQString("Invalid transaction key '%1'").tqarg(key); + TQString msg = TQString("Invalid transaction key '%1'").arg(key); throw new MYMONEYEXCEPTION(msg); } @@ -1446,7 +1446,7 @@ void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency) it = m_currencyList.find(currency.id()); if(it != m_currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").arg(currency.id())); } m_currencyList.insert(currency.id(), currency); @@ -1458,7 +1458,7 @@ void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency) it = m_currencyList.find(currency.id()); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").arg(currency.id())); } m_currencyList.modify(currency.id(), currency); @@ -1472,7 +1472,7 @@ void MyMoneySeqAccessMgr::removeCurrency(const MyMoneySecurity& currency) it = m_currencyList.find(currency.id()); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").arg(currency.id())); } m_currencyList.remove(currency.id()); @@ -1487,7 +1487,7 @@ const MyMoneySecurity MyMoneySeqAccessMgr::currency(const TQString& id) const it = m_currencyList.find(id); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").arg(id)); } return *it; diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h index e054613..d92d94e 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h @@ -997,7 +997,7 @@ private: void touch(void); /** - * This method is used to tqinvalidate the cached balance for + * This method is used to invalidate the cached balance for * the selected account and all it's parents. * * @param id id of the account in question diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp index db35647..3b2ce54 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp @@ -152,7 +152,7 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneySplit s = (*it_s); - s.setMemo(TQString("%1/%2").tqarg(tn.id()).tqarg(s.id())); + s.setMemo(TQString("%1/%2").arg(tn.id()).arg(s.id())); if(s.value() != MyMoneyMoney::autoCalc) { s.setValue((s.value() * m_factor)); diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp index 7973519..b518585 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").tqarg(lastQuery())); + TRACE(TQString("start sql - %1").arg(lastQuery())); bool rc = TQSqlQuery::exec(); TQString msg("end sql\n%1\n***Query returned %2, row count %3"); - 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())); + 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())); 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").tqarg(driver)); + else throw new MYMONEYEXCEPTION (TQString("Unknown database driver type").arg(driver)); } bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { @@ -182,7 +182,7 @@ try { } break; default: - qFatal("%s", TQString("%1 - unknown open mode %2").tqarg(__func__).tqarg(openMode).data()); + qFatal("%s", TQString("%1 - unknown open mode %2").arg(__func__).arg(openMode).data()); } if (rc != 0) return (rc); // bypass logon check if we are creating a database @@ -192,9 +192,9 @@ try { if (!m_logonUser.isEmpty() && (!m_override)) { m_error = TQString (i18n("Database apparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) - .tqarg(m_logonUser) - .tqarg(m_logonAt.date().toString(Qt::ISODate)) - .tqarg(m_logonAt.time().toString("hh.mm.ss")); + .arg(m_logonUser) + .arg(m_logonAt.date().toString(Qt::ISODate)) + .arg(m_logonAt.time().toString("hh.mm.ss")); qDebug("%s", m_error.data()); close(false); rc = -1; @@ -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")).tqarg(driverName()); + TQString(i18n("Cannot currently create database for driver %1; please create manually")).arg(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;").tqarg(dbName); + TQString qs = TQString("CREATE DATABASE %1;").arg(dbName); qm.prepare (qs); if (!qm.exec()) { - buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).tqarg(dbName)); + buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).arg(dbName)); return (1); } TQSqlDatabase::removeDatabase (maindb); @@ -325,7 +325,7 @@ int MyMoneyStorageSql::upgradeDb() { } } // write updated version to DB - //setVersion(TQString("%1.%2").tqarg(m_dbVersion).tqarg(m_minorVersion)); + //setVersion(TQString("%1.%2").arg(m_dbVersion).arg(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;").tqarg(after); + afterString = TQString("AFTER %1;").arg(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").tqarg(c.name()).tqarg(t.name())); + TQString("Error adding column %1 to table %2").arg(c.name()).arg(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").tqarg(col).tqarg(t.name())); + TQString("Error dropping column %1 from table %2").arg(col).arg(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;").tqarg(tt.data().name())); + q.prepare(TQString("ALTER TABLE %1 ENGINE = InnoDB;").arg(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;").tqarg(table)); + q.prepare(TQString("SELECT COUNT(*) FROM %1;").arg(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").tqarg(tt.key()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").arg(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").tqarg(t.name()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating table/index %1").arg(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;").tqarg((*tt).name())); + q.prepare (TQString("select count(*) from %1;").arg((*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;").tqarg(it.key())); + q.prepare(TQString("DELETE from %1;").arg(it.key())); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("cleaning database"))); ++it; } @@ -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").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(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").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); if (m_commitUnitStack.isEmpty()) return; m_commitUnitStack.clear(); if (!rollback()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "cancelling commit unit")); @@ -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").tqarg(kvpType).tqarg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting kvp for %1 %2").arg(kvpType).arg(kvpId))); m_kvps -= q.numRowsAffected(); } @@ -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'").tqarg(itemConnector).tqarg(*it)); + whereClause.append(TQString("%1id = '%2'").arg(itemConnector).arg(*it)); itemConnector = " or "; } whereClause += ")"; @@ -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'").tqarg(date.addDays(1).toString(Qt::ISODate)); + queryString += TQString(" AND postDate < '%1'").arg(date.addDays(1).toString(Qt::ISODate)); DBG (queryString); q.prepare(queryString); @@ -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'") - .tqarg(itemConnector).tqarg(*it)); + .arg(itemConnector).arg(*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'") - .tqarg(itemConnector).tqarg(*it)); + .arg(itemConnector).arg(*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'") - .tqarg(itemConnector) - .tqarg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); + .arg(itemConnector) + .arg(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')").tqarg(end.addDays(1).toString(Qt::ISODate)); + dateClause = TQString("(postDate < '%1')").arg(end.addDays(1).toString(Qt::ISODate)); connector = " and "; } if (start != TQDate()) { - dateClause += TQString("%1 (postDate >= '%2')").tqarg(connector).tqarg(start.toString(Qt::ISODate)); + dateClause += TQString("%1 (postDate >= '%2')").arg(connector).arg(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)").tqarg(whereClause); + inQuery = TQString("(select distinct transactionId from kmmSplits %1)").arg(whereClause); } else { - inQuery = TQString("(select distinct id from kmmTransactions where %1)").tqarg(dateClause); + inQuery = TQString("(select distinct id from kmmTransactions where %1)").arg(dateClause); txFilterActive = false; // kill off the date filter now } @@ -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").tqarg(kvpType) - .tqarg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp for %1 %2").arg(kvpType) + .arg(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").tqarg(kvpType))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp List for %1").arg(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").tqarg(function).tqarg(message); + TQString s = TQString("Error in function %1 : %2").arg(function).arg(message); TQSqlError e = lastError(); s += TQString ("\nDriver = %1, Host = %2, User = %3, Database = %4") - .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()); + .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()); e = q.lastError(); - s += TQString ("\nExecuted: %1").tqarg(q.executedQuery()); - s += TQString ("\nQuery error No %1: %2").tqarg(e.number()).tqarg(e.text()); + s += TQString ("\nExecuted: %1").arg(q.executedQuery()); + s += TQString ("\nQuery error No %1: %2").arg(e.number()).arg(e.text()); const_cast <MyMoneyStorageSql*> (this)->m_error = s; qDebug("%s", s.ascii()); @@ -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 (").tqarg(name()); + TQString qs = TQString("INSERT INTO %1 (").arg(name()); TQString ws = ") VALUES ("; field_iterator ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += TQString("%1, ").tqarg((*ft)->name()); - ws += TQString(":%1, ").tqarg((*ft)->name()); + qs += TQString("%1, ").arg((*ft)->name()); + ws += TQString(":%1, ").arg((*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").tqarg((*ft)->name()).tqarg((*ft)->name()); + ws += TQString("%1 = :%2").arg((*ft)->name()).arg((*ft)->name()); } else { - qs += TQString("%1 = :%2, ").tqarg((*ft)->name()).tqarg((*ft)->name()); + qs += TQString("%1 = :%2, ").arg((*ft)->name()).arg((*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, ").tqarg((*ft)->name()); + qs += TQString("%1, ").arg((*ft)->name()); ++ft; } return (qs.left(qs.length() - 2)); } const TQString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { - TQString qs = TQString("CREATE TABLE %1 (").tqarg(name()); + TQString qs = TQString("CREATE TABLE %1 (").arg(name()); TQString pkey; for (field_iterator it = m_fields.begin(); it != m_fields.end(); ++it) { qs += (*it)->generateDDL (dbType) + ", "; diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp index 4e6fd19..da3ca93 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp @@ -119,19 +119,19 @@ bool MyMoneyXmlContentHandler::endDocument(void) bool MyMoneyXmlContentHandler::skippedEntity (const TQString & /* name */) { - // qDebug(TQString("Skipped entity '%1'").tqarg(name)); + // qDebug(TQString("Skipped entity '%1'").arg(name)); return true; } bool MyMoneyXmlContentHandler::startPrefixMapping (const TQString& /*prefix */, const TQString & /* uri */) { - // qDebug(TQString("start prefix '%1', '%2'").tqarg(prefix).tqarg(uri)); + // qDebug(TQString("start prefix '%1', '%2'").arg(prefix).arg(uri)); return true; } bool MyMoneyXmlContentHandler::endPrefixMapping (const TQString& /* prefix */) { - // qDebug(TQString("end prefix '%1'").tqarg(prefix)); + // qDebug(TQString("end prefix '%1'").arg(prefix)); return true; } @@ -265,13 +265,13 @@ bool MyMoneyXmlContentHandler::endElement(const TQString& /* namespaceURI */, co MyMoneyPrice p(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity, m_baseNode); m_reader->d->prList[MyMoneySecurityPair(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity)][p.date()] = p; } else { - m_errMsg = i18n("Unknown XML tag %1 found in line %2").tqarg(qName).tqarg(m_loc->lineNumber()); + m_errMsg = i18n("Unknown XML tag %1 found in line %2").arg(qName).arg(m_loc->lineNumber()); kdWarning() << m_errMsg << endl; rc = false; } m_reader->signalProgress(++m_elementCount, 0); } catch(MyMoneyException* e) { - m_errMsg = i18n("Exception while creating a %1 element: %2").tqarg(s).tqarg(e->what()); + m_errMsg = i18n("Exception while creating a %1 element: %2").arg(s).arg(e->what()); kdWarning() << m_errMsg << endl; delete e; rc = false; |