From 1f9d00360b9018301630ce062d7dda0c6583edfb Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 16 Dec 2011 09:56:17 -0600 Subject: Revert "Rename a number of old tq methods that are no longer tq specific" This reverts commit 252fce5a2a5384702fbcc1c9987284d7bd2e6943. --- kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp | 22 ++-- .../mymoney/storage/mymoneydatabasemgrtest.cpp | 14 +-- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp | 24 ++-- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h | 4 +- .../mymoney/storage/mymoneyseqaccessmgrtest.cpp | 4 +- kmymoney2/mymoney/storage/mymoneystorageanon.cpp | 2 +- kmymoney2/mymoney/storage/mymoneystoragesql.cpp | 134 ++++++++++----------- kmymoney2/mymoney/storage/mymoneystoragesql.h | 4 +- kmymoney2/mymoney/storage/mymoneystoragexml.cpp | 10 +- kmymoney2/mymoney/storage/mymoneystoragexml.h | 2 +- 10 files changed, 110 insertions(+), 110 deletions(-) (limited to 'kmymoney2/mymoney/storage') diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp index 6324d4c..a80d5af 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp @@ -26,8 +26,8 @@ #define PASS } catch (MyMoneyException *e) { throw; } MyMoneyDatabaseMgr::MyMoneyDatabaseMgr() : -m_creationDate (TQDate::currentDate ()), -m_lastModificationDate (TQDate::currentDate ()), +m_creationDate (TQDate::tqcurrentDate ()), +m_lastModificationDate (TQDate::tqcurrentDate ()), m_sql (0) { } @@ -220,7 +220,7 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) TQMap 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").arg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); } } @@ -228,7 +228,7 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) TQMap 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").arg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("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); - // invalidate cached balance + // tqinvalidate cached balance //FIXME: invalidateBalanceCache(account.id()); // mark file as changed @@ -913,7 +913,7 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& //DEBUG TQDate date_ (date); - //if (date_ == TQDate()) date_ = TQDate::currentDate(); + //if (date_ == TQDate()) date_ = TQDate::tqcurrentDate(); // END DEBUG MyMoneyMoney result(0); @@ -1278,7 +1278,7 @@ const TQValueList MyMoneyDatabaseMgr::scheduleList(const TQStri TQDate nextPayment = (*pos).nextPayment((*pos).lastPayment()); if(!nextPayment.isValid()) continue; - if(nextPayment >= TQDate::currentDate()) + if(nextPayment >= TQDate::tqcurrentDate()) continue; */ } @@ -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").arg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(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").arg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(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").arg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(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'").arg(id)); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); } return *it; diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp index 30fe093..d0d2065 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp @@ -70,7 +70,7 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->payeeList().count() == 0); CPPUNIT_ASSERT(m->scheduleList().count() == 0); - CPPUNIT_ASSERT(m->m_creationDate == TQDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); } void MyMoneyDatabaseMgrTest::testCreateDb() { @@ -118,8 +118,8 @@ void MyMoneyDatabaseMgrTest::testAttachDb() { MyMoneyFile::instance()->detachStorage(); KSharedPtr sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(sql); - int openStatus = sql->open(m_url, IO_ReadWrite); - CPPUNIT_ASSERT(0 == openStatus); + int opentqStatus = sql->open(m_url, IO_ReadWrite); + CPPUNIT_ASSERT(0 == opentqStatus); MyMoneyFile::instance()->attachStorage(m); m->startTransaction(); m_dbAttached = true; @@ -717,7 +717,7 @@ void MyMoneyDatabaseMgrTest::testAddBudget() { MyMoneyBudget budget; budget.setName("TestBudget"); - budget.setBudgetStart(TQDate::currentDate(TQt::LocalTime)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime)); m->addBudget(budget); @@ -742,7 +742,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { MyMoneyBudget newBudget = oldBudget; newBudget.clearId(); - newBudget.setName(TQString("Copy of %1").arg(oldBudget.name())); + newBudget.setName(TQString("Copy of %1").tqarg(oldBudget.name())); m->addBudget(newBudget); CPPUNIT_ASSERT(m->budgetList().count() == 2); @@ -773,7 +773,7 @@ void MyMoneyDatabaseMgrTest::testModifyBudget() { MyMoneyBudget budget = m->budgetByName("TestBudget"); - budget.setBudgetStart(TQDate::currentDate(TQt::LocalTime).addDays(-1)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime).addDays(-1)); m->modifyBudget(budget); @@ -1650,7 +1650,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { // put some accounts in the db, so the tests don't break testReparentAccount(); - TQDate testDate = TQDate::currentDate(); + TQDate testDate = TQDate::tqcurrentDate(); TQDate notOverdue = testDate.addDays(2); TQDate overdue = testDate.addDays(-2); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp index 3ab0b72..ef4c3a9 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp @@ -44,7 +44,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() m_nextBudgetID = 0; m_user = MyMoneyPayee(); m_dirty = false; - m_creationDate = TQDate::currentDate(); + m_creationDate = TQDate::tqcurrentDate(); // setup standard accounts MyMoneyAccount acc_l; @@ -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").arg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("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").arg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); } } @@ -448,7 +448,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const void MyMoneySeqAccessMgr::touch(void) { m_dirty = true; - m_lastModificationDate = TQDate::currentDate(); + m_lastModificationDate = TQDate::tqcurrentDate(); } bool MyMoneySeqAccessMgr::hasActiveSplits(const TQString& id) const @@ -503,7 +503,7 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo // update information in account list m_accountList.modify(account.id(), account); - // invalidate cached balance + // tqinvalidate 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'").arg(id); + TQString msg = TQString("Invalid transaction id '%1'").tqarg(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'").arg(key); + TQString msg = TQString("Invalid transaction key '%1'").tqarg(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").arg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(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").arg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(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").arg(currency.id())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(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'").arg(id)); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); } return *it; @@ -1731,7 +1731,7 @@ const MyMoneyPrice MyMoneySeqAccessMgr::price(const TQString& fromId, const TQSt // If no valid date is passed, we use today's date. if(!date.isValid()) - date = TQDate::currentDate(); + date = TQDate::tqcurrentDate(); // If the caller selected an exact entry, we can search for // it using the date as the key diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h index d92d94e..0aebe23 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h @@ -939,7 +939,7 @@ public: /** * This method retrieves a price from the price list. - * If @p date is inValid, TQDate::currentDate() is assumed. + * If @p date is inValid, TQDate::tqcurrentDate() is assumed. */ const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; @@ -997,7 +997,7 @@ private: void touch(void); /** - * This method is used to invalidate the cached balance for + * This method is used to tqinvalidate 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/mymoneyseqaccessmgrtest.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp index 9c36204..94d98f5 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp @@ -63,7 +63,7 @@ void MyMoneySeqAccessMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->m_scheduleList.count() == 0); CPPUNIT_ASSERT(m->m_dirty == false); - CPPUNIT_ASSERT(m->m_creationDate == TQDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(m->liability().name() == "Liability"); CPPUNIT_ASSERT(m->asset().name() == "Asset"); @@ -1302,7 +1302,7 @@ void MyMoneySeqAccessMgrTest::testRemoveSchedule() { } void MyMoneySeqAccessMgrTest::testScheduleList() { - TQDate testDate = TQDate::currentDate(); + TQDate testDate = TQDate::tqcurrentDate(); TQDate notOverdue = testDate.addDays(2); TQDate overdue = testDate.addDays(-2); diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp index 3b2ce54..db35647 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp @@ -152,7 +152,7 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) TQValueList::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").arg(tn.id()).arg(s.id())); + s.setMemo(TQString("%1/%2").tqarg(tn.id()).tqarg(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 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(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 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 (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 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 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 pid) { const TQMap 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 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 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 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 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 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 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 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 MyMoneyStorageSql::fetchTransactions ( TQString statesClause = ""; for (TQValueList::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 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 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 (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) + ", "; diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.h b/kmymoney2/mymoney/storage/mymoneystoragesql.h index eb7b5a3..4250256 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.h +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.h @@ -402,7 +402,7 @@ public: private: const TQString enclose(const TQString& text) const {return (TQString("'" + text + "'"));}; - static unsigned int m_currentVersion; // The current version of the database layout + static unsigned int m_currentVersion; // The current version of the database tqlayout MyMoneyDbDrivers m_drivers; #define TABLE(name) void name(); #define VIEW(name) void name(); @@ -747,7 +747,7 @@ private: * initial data load and final write */ - bool m_displayStatus; + bool m_displaytqStatus; /** * On occasions, e.g. after a complex transaction search, or for populating a * payee popup list, it becomes necessary to load all data into memory. The diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp index da3ca93..4e6fd19 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'").arg(name)); + // qDebug(TQString("Skipped entity '%1'").tqarg(name)); return true; } bool MyMoneyXmlContentHandler::startPrefixMapping (const TQString& /*prefix */, const TQString & /* uri */) { - // qDebug(TQString("start prefix '%1', '%2'").arg(prefix).arg(uri)); + // qDebug(TQString("start prefix '%1', '%2'").tqarg(prefix).tqarg(uri)); return true; } bool MyMoneyXmlContentHandler::endPrefixMapping (const TQString& /* prefix */) { - // qDebug(TQString("end prefix '%1'").arg(prefix)); + // qDebug(TQString("end prefix '%1'").tqarg(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").arg(qName).arg(m_loc->lineNumber()); + m_errMsg = i18n("Unknown XML tag %1 found in line %2").tqarg(qName).tqarg(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").arg(s).arg(e->what()); + m_errMsg = i18n("Exception while creating a %1 element: %2").tqarg(s).tqarg(e->what()); kdWarning() << m_errMsg << endl; delete e; rc = false; diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.h b/kmymoney2/mymoney/storage/mymoneystoragexml.h index 666fc6b..b74626d 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.h +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.h @@ -61,7 +61,7 @@ protected: * This method returns the version of the underlying file. It * is used by the MyMoney objects contained in a MyMoneyStorageBin object (e.g. * MyMoneyAccount, MyMoneyInstitution, MyMoneyTransaction, etc.) to - * determine the layout used when reading/writing a persistant file. + * determine the tqlayout used when reading/writing a persistant file. * A parameter is used to determine the direction. * * @param dir information about the direction (reading/writing). The -- cgit v1.2.1