summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/mymoney')
-rw-r--r--kmymoney2/mymoney/mymoneyaccount.cpp6
-rw-r--r--kmymoney2/mymoney/mymoneyaccount.h2
-rw-r--r--kmymoney2/mymoney/mymoneyaccounttest.cpp46
-rw-r--r--kmymoney2/mymoney/mymoneyfile.cpp74
-rw-r--r--kmymoney2/mymoney/mymoneyfile.h2
-rw-r--r--kmymoney2/mymoney/mymoneyfiletest.cpp18
-rw-r--r--kmymoney2/mymoney/mymoneyforecast.cpp106
-rw-r--r--kmymoney2/mymoney/mymoneyforecast.h4
-rw-r--r--kmymoney2/mymoney/mymoneyforecasttest.cpp270
-rw-r--r--kmymoney2/mymoney/mymoneyinstitution.cpp4
-rw-r--r--kmymoney2/mymoney/mymoneymoney.cpp18
-rw-r--r--kmymoney2/mymoney/mymoneypayee.cpp2
-rw-r--r--kmymoney2/mymoney/mymoneyprice.cpp2
-rw-r--r--kmymoney2/mymoney/mymoneyreport.cpp4
-rw-r--r--kmymoney2/mymoney/mymoneyreport.h4
-rw-r--r--kmymoney2/mymoney/mymoneyscheduled.cpp16
-rw-r--r--kmymoney2/mymoney/mymoneyscheduled.h4
-rw-r--r--kmymoney2/mymoney/mymoneyscheduletest.cpp88
-rw-r--r--kmymoney2/mymoney/mymoneystatement.cpp4
-rw-r--r--kmymoney2/mymoney/mymoneytransaction.cpp18
-rw-r--r--kmymoney2/mymoney/mymoneytransactionfilter.cpp74
-rw-r--r--kmymoney2/mymoney/mymoneytransactiontest.cpp6
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp22
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp14
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp24
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h4
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp4
-rw-r--r--kmymoney2/mymoney/storage/mymoneystorageanon.cpp2
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.cpp134
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.h4
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragexml.cpp10
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragexml.h2
32 files changed, 496 insertions, 496 deletions
diff --git a/kmymoney2/mymoney/mymoneyaccount.cpp b/kmymoney2/mymoney/mymoneyaccount.cpp
index 6ef1f9c..5d74e62 100644
--- a/kmymoney2/mymoney/mymoneyaccount.cpp
+++ b/kmymoney2/mymoney/mymoneyaccount.cpp
@@ -98,7 +98,7 @@ MyMoneyAccount::MyMoneyAccount(const TQDomElement& node) :
if(node.hasAttribute("openingbalance")) {
if(!MyMoneyMoney(node.attribute("openingbalance")).isZero()) {
- TQString msg = i18n("Account %1 contains an opening balance. Please use a KMyMoney version >= 0.8 and < 0.9 to correct the problem.").arg(m_name);
+ TQString msg = i18n("Account %1 contains an opening balance. Please use a KMyMoney version >= 0.8 and < 0.9 to correct the problem.").tqarg(m_name);
throw new MYMONEYEXCEPTION(msg);
}
}
@@ -467,7 +467,7 @@ bool MyMoneyAccountLoan::hasReferenceTo(const TQString& id) const
void MyMoneyAccountLoan::setInterestCompounding(int frequency)
{
- setValue("compoundingFrequency", TQString("%1").arg(frequency));
+ setValue("compoundingFrequency", TQString("%1").tqarg(frequency));
}
int MyMoneyAccountLoan::interestCompounding(void) const
@@ -594,7 +594,7 @@ bool MyMoneyAccount::isCategory(void) const
TQString MyMoneyAccount::brokerageName(void) const
{
if(m_accountType == Investment)
- return TQString("%1 (%2)").arg(m_name, i18n("Brokerage (suffix for account names)", "Brokerage"));
+ return TQString("%1 (%2)").tqarg(m_name, i18n("Brokerage (suffix for account names)", "Brokerage"));
return m_name;
}
diff --git a/kmymoney2/mymoney/mymoneyaccount.h b/kmymoney2/mymoney/mymoneyaccount.h
index 8ab368c..968cadb 100644
--- a/kmymoney2/mymoney/mymoneyaccount.h
+++ b/kmymoney2/mymoney/mymoneyaccount.h
@@ -342,7 +342,7 @@ public:
/**
* This method is used to update m_lastModified to the current date
*/
- void touch(void) { setLastModified(TQDate::currentDate()); }
+ void touch(void) { setLastModified(TQDate::tqcurrentDate()); }
/**
* This method returns the type of the account.
diff --git a/kmymoney2/mymoney/mymoneyaccounttest.cpp b/kmymoney2/mymoney/mymoneyaccounttest.cpp
index 12ea7f1..a7c55af 100644
--- a/kmymoney2/mymoney/mymoneyaccounttest.cpp
+++ b/kmymoney2/mymoney/mymoneyaccounttest.cpp
@@ -49,8 +49,8 @@ void MyMoneyAccountTest::testConstructor() {
MyMoneyAccount r;
MyMoneySplit s;
r.setAccountType(MyMoneyAccount::Asset);
- r.setOpeningDate(TQDate::currentDate());
- r.setLastModified(TQDate::currentDate());
+ r.setOpeningDate(TQDate::tqcurrentDate());
+ r.setLastModified(TQDate::tqcurrentDate());
r.setDescription("Desc");
r.setNumber("465500");
r.setParentAccountId(parent);
@@ -65,8 +65,8 @@ void MyMoneyAccountTest::testConstructor() {
CPPUNIT_ASSERT(a.id() == id);
CPPUNIT_ASSERT(a.institutionId().isEmpty());
CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::Asset);
- CPPUNIT_ASSERT(a.openingDate() == TQDate::currentDate());
- CPPUNIT_ASSERT(a.lastModified() == TQDate::currentDate());
+ CPPUNIT_ASSERT(a.openingDate() == TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.number() == "465500");
CPPUNIT_ASSERT(a.description() == "Desc");
CPPUNIT_ASSERT(a.accountList().count() == 0);
@@ -82,7 +82,7 @@ void MyMoneyAccountTest::testConstructor() {
void MyMoneyAccountTest::testSetFunctions() {
MyMoneyAccount a;
- TQDate today(TQDate::currentDate());
+ TQDate today(TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.name().isEmpty());
CPPUNIT_ASSERT(a.lastModified() == TQDate());
CPPUNIT_ASSERT(a.description().isEmpty());
@@ -108,8 +108,8 @@ void MyMoneyAccountTest::testCopyConstructor() {
TQString parent = "ParentAccount";
MyMoneyAccount r;
r.setAccountType(MyMoneyAccount::Expense);
- r.setOpeningDate(TQDate::currentDate());
- r.setLastModified(TQDate::currentDate());
+ r.setOpeningDate(TQDate::tqcurrentDate());
+ r.setLastModified(TQDate::tqcurrentDate());
r.setName("Account");
r.setInstitutionId("Inst1");
r.setDescription("Desc1");
@@ -125,8 +125,8 @@ void MyMoneyAccountTest::testCopyConstructor() {
CPPUNIT_ASSERT(b.name() == "Account");
CPPUNIT_ASSERT(b.institutionId() == institutionid);
CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Expense);
- CPPUNIT_ASSERT(b.lastModified() == TQDate::currentDate());
- CPPUNIT_ASSERT(b.openingDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(b.openingDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(b.description() == "Desc1");
CPPUNIT_ASSERT(b.number() == "Number");
CPPUNIT_ASSERT(b.parentAccountId() == "ParentAccount");
@@ -146,7 +146,7 @@ void MyMoneyAccountTest::testAssignmentConstructor() {
MyMoneyAccount b;
- b.setLastModified(TQDate::currentDate());
+ b.setLastModified(TQDate::tqcurrentDate());
b = a;
@@ -199,13 +199,13 @@ void MyMoneyAccountTest::testEquality()
{
MyMoneyAccount a;
- a.setLastModified(TQDate::currentDate());
+ a.setLastModified(TQDate::tqcurrentDate());
a.setName("Name");
a.setNumber("Number");
a.setDescription("Desc");
a.setInstitutionId("I-ID");
- a.setOpeningDate(TQDate::currentDate());
- a.setLastReconciliationDate(TQDate::currentDate());
+ a.setOpeningDate(TQDate::tqcurrentDate());
+ a.setLastReconciliationDate(TQDate::tqcurrentDate());
a.setAccountType(MyMoneyAccount::Asset);
a.setParentAccountId("P-ID");
a.setId("A-ID");
@@ -221,7 +221,7 @@ void MyMoneyAccountTest::testEquality()
CPPUNIT_ASSERT(!(b == a));
b = a;
- a.setLastModified(TQDate::currentDate().addDays(-1));
+ a.setLastModified(TQDate::tqcurrentDate().addDays(-1));
CPPUNIT_ASSERT(!(b == a));
b = a;
@@ -237,11 +237,11 @@ void MyMoneyAccountTest::testEquality()
CPPUNIT_ASSERT(!(b == a));
b = a;
- a.setOpeningDate(TQDate::currentDate().addDays(-1));
+ a.setOpeningDate(TQDate::tqcurrentDate().addDays(-1));
CPPUNIT_ASSERT(!(b == a));
b = a;
- a.setLastReconciliationDate(TQDate::currentDate().addDays(-1));
+ a.setLastReconciliationDate(TQDate::tqcurrentDate().addDays(-1));
CPPUNIT_ASSERT(!(b == a));
b = a;
@@ -278,8 +278,8 @@ void MyMoneyAccountTest::testWriteXML() {
MyMoneyAccount r;
r.setAccountType(MyMoneyAccount::Asset);
- r.setOpeningDate(TQDate::currentDate());
- r.setLastModified(TQDate::currentDate());
+ r.setOpeningDate(TQDate::tqcurrentDate());
+ r.setLastModified(TQDate::tqcurrentDate());
r.setDescription("Desc");
r.setName("AccountName");
r.setNumber("465500");
@@ -309,7 +309,7 @@ void MyMoneyAccountTest::testWriteXML() {
" </KEYVALUEPAIRS>\n"
" </ACCOUNT>\n"
"</ACCOUNT-CONTAINER>\n").
- arg(TQDate::currentDate().toString(Qt::ISODate)).arg(TQDate::currentDate().toString(Qt::ISODate));
+ arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
CPPUNIT_ASSERT(doc.toString() == ref);
}
@@ -330,7 +330,7 @@ void MyMoneyAccountTest::testReadXML() {
" </KEYVALUEPAIRS>\n"
" </ACCOUNT>\n"
"</ACCOUNT-CONTAINER>\n").
- arg(TQDate::currentDate().toString(Qt::ISODate)).arg(TQDate::currentDate().toString(Qt::ISODate));
+ arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
TQString ref_false = TQString(
"<!DOCTYPE TEST>\n"
@@ -346,7 +346,7 @@ void MyMoneyAccountTest::testReadXML() {
" </KEYVALUEPAIRS>\n"
" </KACCOUNT>\n"
"</ACCOUNT-CONTAINER>\n").
- arg(TQDate::currentDate().toString(Qt::ISODate)).arg(TQDate::currentDate().toString(Qt::ISODate));
+ arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
TQDomDocument doc;
TQDomElement node;
@@ -371,11 +371,11 @@ void MyMoneyAccountTest::testReadXML() {
CPPUNIT_ASSERT(a.id() == "A000001");
CPPUNIT_ASSERT(a.m_name == "AccountName");
CPPUNIT_ASSERT(a.m_parentAccount == "Parent");
- CPPUNIT_ASSERT(a.m_lastModified == TQDate::currentDate());
+ CPPUNIT_ASSERT(a.m_lastModified == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.m_lastReconciliationDate == TQDate());
CPPUNIT_ASSERT(a.m_institution == "B000001");
CPPUNIT_ASSERT(a.m_number == "465500");
- CPPUNIT_ASSERT(a.m_openingDate == TQDate::currentDate());
+ CPPUNIT_ASSERT(a.m_openingDate == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.m_accountType == MyMoneyAccount::Asset);
CPPUNIT_ASSERT(a.m_description == "Desc");
CPPUNIT_ASSERT(a.accountList().count() == 2);
diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp
index 4809b28..c36c163 100644
--- a/kmymoney2/mymoney/mymoneyfile.cpp
+++ b/kmymoney2/mymoney/mymoneyfile.cpp
@@ -146,7 +146,7 @@ void MyMoneyFile::checkTransaction(const char* txt) const
{
checkStorage();
if(!d->m_inTransaction) {
- throw new MYMONEYEXCEPTION(TQString("No transaction started for %1").arg(txt));
+ throw new MYMONEYEXCEPTION(TQString("No transaction started for %1").tqarg(txt));
}
}
@@ -605,7 +605,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
throw new MYMONEYEXCEPTION("Stock account must have investment account as parent ");
if(!account.isInvest() && parent.accountType() == MyMoneyAccount::Investment)
- throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as children");
+ throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as tqchildren");
// clear all changed objects from cache
MyMoneyNotifier notifier(this);
@@ -619,7 +619,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
if(!account.openingDate().isValid()) {
- account.setOpeningDate(TQDate::currentDate());
+ account.setOpeningDate(TQDate::tqcurrentDate());
}
account.setParentAccountId(parent.id());
@@ -757,7 +757,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe
throw new MYMONEYEXCEPTION("Opening balance for non currencies not supported");
MyMoneyAccount acc;
- TQRegExp match(TQString("^%1").arg(i18n(MyMoneyFile::OpeningBalancesPrefix)));
+ TQRegExp match(TQString("^%1").tqarg(i18n(MyMoneyFile::OpeningBalancesPrefix)));
TQValueList<MyMoneyAccount> accounts;
TQValueList<MyMoneyAccount>::Iterator it;
@@ -774,7 +774,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe
}
if(acc.id().isEmpty()) {
- throw new MYMONEYEXCEPTION(TQString("No opening balance account for %1").arg(security.tradingSymbol()));
+ throw new MYMONEYEXCEPTION(TQString("No opening balance account for %1").tqarg(security.tradingSymbol()));
}
return acc;
@@ -787,7 +787,7 @@ const MyMoneyAccount MyMoneyFile::createOpeningBalanceAccount(const MyMoneySecur
MyMoneyAccount acc;
TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix));
if(security.id() != baseCurrency().id()) {
- name += TQString(" (%1)").arg(security.id());
+ name += TQString(" (%1)").tqarg(security.id());
}
acc.setName(name);
acc.setAccountType(MyMoneyAccount::Equity);
@@ -1418,9 +1418,9 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
if((*it_b).id() == parent.id()) {
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
- rc << i18n(" * Loop detected between this account and account '%2'.").arg((*it_b).name());
- rc << i18n(" Reparenting account '%2' to top level account '%1'.").arg(toplevel.name(), (*it_a).name());
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
+ rc << i18n(" * Loop detected between this account and account '%2'.").tqarg((*it_b).name());
+ rc << i18n(" Reparenting account '%2' to top level account '%1'.").tqarg(toplevel.name(), (*it_a).name());
(*it_a).setParentAccountId(toplevel.id());
if(accountRebuild.contains(toplevel.id()) == 0)
accountRebuild << toplevel.id();
@@ -1448,13 +1448,13 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
// the parent belongs to a different group, so we reconnect to the
// master group account (asset, liability, etc) to which this account
// should belong and update it in the engine.
- rc << i18n(" * Parent account '%1' belongs to a different group.").arg(parent.name());
- rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name());
+ rc << i18n(" * Parent account '%1' belongs to a different group.").tqarg(parent.name());
+ rc << i18n(" New parent account is the top level account '%1'.").tqarg(toplevel.name());
(*it_a).setParentAccountId(toplevel.id());
// make sure to rebuild the sub-accounts of the top account
@@ -1467,10 +1467,10 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
// parent exists, but does not have a reference to the account
- rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").arg(parent.name(), problemAccount);
+ rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").tqarg(parent.name(), problemAccount);
if(accountRebuild.contains(parent.id()) == 0)
accountRebuild << parent.id();
}
@@ -1482,10 +1482,10 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
- rc << i18n(" * The parent with id %1 does not exist anymore.").arg(parentId);
- rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name());
+ rc << i18n(" * The parent with id %1 does not exist anymore.").tqarg(parentId);
+ rc << i18n(" New parent account is the top level account '%1'.").tqarg(toplevel.name());
(*it_a).setParentAccountId(toplevel.id());
addNotification((*it_a).id());
@@ -1495,7 +1495,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
accountRebuild << toplevel.id();
}
- // now check that all the children exist and have the correct type
+ // now check that all the tqchildren exist and have the correct type
for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end(); ++it_c) {
// check that the child exists
try {
@@ -1504,9 +1504,9 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
- rc << i18n(" * Child account with id %1 does not exist anymore.").arg(*it_c);
+ rc << i18n(" * Child account with id %1 does not exist anymore.").tqarg(*it_c);
rc << i18n(" The child account list will be reconstructed.");
if(accountRebuild.contains((*it_a).id()) == 0)
accountRebuild << (*it_a).id();
@@ -1540,7 +1540,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
// clear the affected lists
for(it_a = list.begin(); it_a != list.end(); ++it_a) {
if(accountRebuild.contains((*it_a).id())) {
- rc << TQString(" %1").arg((*it_a).name());
+ rc << TQString(" %1").tqarg((*it_a).name());
// clear the account list
for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end();) {
(*it_a).removeAccountId(*it_c);
@@ -1571,7 +1571,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
addNotification((*it_a).id());
} catch (MyMoneyException *e) {
delete e;
- rc << i18n(" * Unable to update account data for account %1 in engine").arg((*it_a).name());
+ rc << i18n(" * Unable to update account data for account %1 in engine").tqarg((*it_a).name());
}
}
}
@@ -1589,7 +1589,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
payee.clearId();
m_storage->addPayee(payee);
payeeConversionMap[(*it_p).id()] = payee.id();
- rc << i18n(" * Payee %1 recreated with fixed id").arg(payee.name());
+ rc << i18n(" * Payee %1 recreated with fixed id").tqarg(payee.name());
++problemCount;
}
}
@@ -1618,7 +1618,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) {
s.setPayeeId(payeeConversionMap[s.payeeId()]);
sChanged = true;
- rc << i18n(" * Payee id updated in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * Payee id updated in split of transaction '%1'.").tqarg(t.id());
++problemCount;
}
@@ -1631,16 +1631,16 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
// use the value as master if the transaction is balanced
if(t.splitSum().isZero()) {
s.setShares(s.value());
- rc << i18n(" * shares set to value in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * shares set to value in split of transaction '%1'.").tqarg(t.id());
} else {
s.setValue(s.shares());
- rc << i18n(" * value set to shares in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * value set to shares in split of transaction '%1'.").tqarg(t.id());
}
sChanged = true;
++problemCount;
}
} catch(MyMoneyException *e) {
- rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").arg(t.id(), (*it_s).id(), (*it_s).accountId());
+ rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").tqarg(t.id(), (*it_s).id(), (*it_s).accountId());
++problemCount;
++unfixedCount;
delete e;
@@ -1651,7 +1651,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
&& s.action() != MyMoneySplit::ActionInterest) {
s.setAction(MyMoneySplit::ActionInterest);
sChanged = true;
- rc << i18n(" * action marked as interest in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * action marked as interest in split of transaction '%1'.").tqarg(t.id());
++problemCount;
}
@@ -1678,13 +1678,13 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) {
s.setPayeeId(payeeConversionMap[s.payeeId()]);
sChanged = true;
- rc << i18n(" * Payee id updated in split of schedule '%1'.").arg((*it_sch).name());
+ rc << i18n(" * Payee id updated in split of schedule '%1'.").tqarg((*it_sch).name());
++problemCount;
}
if(!(*it_s).value().isZero() && (*it_s).shares().isZero()) {
s.setShares(s.value());
sChanged = true;
- rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").arg((*it_sch).name());
+ rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").tqarg((*it_sch).name());
rc << i18n(" Shares set to value.");
++problemCount;
}
@@ -1693,7 +1693,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
if(!(*it_s).bankID().isEmpty()) {
s.setBankID(TQString());
sChanged = true;
- rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").arg((*it_sch).name());
+ rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").tqarg((*it_sch).name());
++problemCount;
}
@@ -1706,16 +1706,16 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
// use the value as master if the transaction is balanced
if(t.splitSum().isZero()) {
s.setShares(s.value());
- rc << i18n(" * shares set to value in split in schedule '%1'.").arg((*it_sch).name());
+ rc << i18n(" * shares set to value in split in schedule '%1'.").tqarg((*it_sch).name());
} else {
s.setValue(s.shares());
- rc << i18n(" * value set to shares in split in schedule '%1'.").arg((*it_sch).name());
+ rc << i18n(" * value set to shares in split in schedule '%1'.").tqarg((*it_sch).name());
}
sChanged = true;
++problemCount;
}
} catch(MyMoneyException *e) {
- rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").arg((*it_sch).name(), (*it_s).id(), (*it_s).accountId());
+ rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").tqarg((*it_sch).name(), (*it_s).id(), (*it_s).accountId());
++problemCount;
++unfixedCount;
delete e;
@@ -1741,7 +1741,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
bool rChanged = false;
for(it_p = pList.begin(); it_p != pList.end(); ++it_p) {
if(payeeConversionMap.find(*it_p) != payeeConversionMap.end()) {
- rc << i18n(" * Payee id updated in report '%1'.").arg((*it_r).name());
+ rc << i18n(" * Payee id updated in report '%1'.").tqarg((*it_r).name());
++problemCount;
r.removeReference(*it_p);
r.addPayee(payeeConversionMap[*it_p]);
@@ -1758,7 +1758,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
for(it_m = payeeConversionMap.begin(); it_m != payeeConversionMap.end(); ++it_m) {
MyMoneyPayee payee = this->payee(it_m.key());
removePayee(payee);
- rc << i18n(" * Payee '%1' removed.").arg(payee.id());
+ rc << i18n(" * Payee '%1' removed.").tqarg(payee.id());
++problemCount;
}
@@ -1768,7 +1768,7 @@ const TQStringList MyMoneyFile::consistencyCheck(void)
rc << i18n("Finish! Data is consistent.");
else
rc << i18n("Finish! %1 problem(s) corrected. %2 problem(s) still present.")
- .arg(problemCount).arg(unfixedCount);
+ .tqarg(problemCount).tqarg(unfixedCount);
return rc;
}
diff --git a/kmymoney2/mymoney/mymoneyfile.h b/kmymoney2/mymoney/mymoneyfile.h
index ceb67ad..410115d 100644
--- a/kmymoney2/mymoney/mymoneyfile.h
+++ b/kmymoney2/mymoney/mymoneyfile.h
@@ -1145,7 +1145,7 @@ public:
* @return price found as MyMoneyPrice object
* @note This throws an exception when the base currency is not set and toId is empty
*/
- const MyMoneyPrice price(const TQString& fromId, const TQString& toId = TQString(), const TQDate& date = TQDate::currentDate(), const bool exactDate = false) const;
+ const MyMoneyPrice price(const TQString& fromId, const TQString& toId = TQString(), const TQDate& date = TQDate::tqcurrentDate(), const bool exactDate = false) const;
/**
* This method returns a list of all prices.
diff --git a/kmymoney2/mymoney/mymoneyfiletest.cpp b/kmymoney2/mymoney/mymoneyfiletest.cpp
index 1c25abd..431debb 100644
--- a/kmymoney2/mymoney/mymoneyfiletest.cpp
+++ b/kmymoney2/mymoney/mymoneyfiletest.cpp
@@ -646,7 +646,7 @@ void MyMoneyFileTest::testRemoveAccountTree() {
delete e;
}
- // make sure that children are re-parented to parent account
+ // make sure that tqchildren are re-parented to parent account
try {
a = m->account("A000001");
CPPUNIT_ASSERT(a.parentAccountId() == m->asset().id());
@@ -761,16 +761,16 @@ void MyMoneyFileTest::testAddTransaction () {
CPPUNIT_ASSERT(t.id() == "T000000000000000001");
CPPUNIT_ASSERT(t.postDate() == TQDate(2002,2,1));
- CPPUNIT_ASSERT(t.entryDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(t.entryDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(m->dirty() == true);
// check the balance of the accounts
a = m->account("A000001");
- CPPUNIT_ASSERT(a.lastModified() == TQDate::currentDate());
+ CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-1000));
MyMoneyAccount b = m->account("A000003");
- CPPUNIT_ASSERT(b.lastModified() == TQDate::currentDate());
+ CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(b.balance() == MyMoneyMoney(1000));
storage->m_dirty = false;
@@ -1290,7 +1290,7 @@ void MyMoneyFileTest::testAddEquityAccount() {
// keep a copy for later use
m_inv = i;
- // make sure, that only equity accounts can be children to it
+ // make sure, that only equity accounts can be tqchildren to it
MyMoneyAccount a;
a.setName("Testaccount");
TQValueList<MyMoneyAccount::accountTypeE> list;
@@ -1389,7 +1389,7 @@ void MyMoneyFileTest::testReparentEquity(TQValueList<MyMoneyAccount::accountType
TQValueList<MyMoneyAccount::accountTypeE>::Iterator it;
MyMoneyFileTransaction ft;
for(it = list.begin(); it != list.end(); ++it) {
- a.setName(TQString("Testaccount %1").arg(*it));
+ a.setName(TQString("Testaccount %1").tqarg(*it));
a.setAccountType(*it);
try {
m->addAccount(a, parent);
@@ -1490,7 +1490,7 @@ void MyMoneyFileTest::testOpeningBalance(void)
openingAcc = m->openingBalanceAccount(m->baseCurrency());
CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id());
CPPUNIT_ASSERT(openingAcc.name() == MyMoneyFile::OpeningBalancesPrefix);
- CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate());
} catch(MyMoneyException *e) {
unexpectedException(e);
}
@@ -1504,12 +1504,12 @@ void MyMoneyFileTest::testOpeningBalance(void)
unexpectedException(e);
}
- TQString refName = TQString("%1 (%2)").arg(MyMoneyFile::OpeningBalancesPrefix).arg("USD");
+ TQString refName = TQString("%1 (%2)").tqarg(MyMoneyFile::OpeningBalancesPrefix).tqarg("USD");
try {
openingAcc = m->openingBalanceAccount(second);
CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id());
CPPUNIT_ASSERT(openingAcc.name() == refName);
- CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate());
} catch(MyMoneyException *e) {
unexpectedException(e);
}
diff --git a/kmymoney2/mymoney/mymoneyforecast.cpp b/kmymoney2/mymoney/mymoneyforecast.cpp
index bfecce0..4365b47 100644
--- a/kmymoney2/mymoney/mymoneyforecast.cpp
+++ b/kmymoney2/mymoney/mymoneyforecast.cpp
@@ -47,8 +47,8 @@ MyMoneyForecast::MyMoneyForecast() :
{
setForecastCycles(KMyMoneyGlobalSettings::forecastCycles());
setAccountsCycle(KMyMoneyGlobalSettings::forecastAccountCycle());
- setHistoryStartDate(TQDate::currentDate().addDays(-forecastCycles()*accountsCycle()));
- setHistoryEndDate(TQDate::currentDate().addDays(-1));
+ setHistoryStartDate(TQDate::tqcurrentDate().addDays(-forecastCycles()*accountsCycle()));
+ setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1));
setForecastDays(KMyMoneyGlobalSettings::forecastDays());
setBeginForecastDay(KMyMoneyGlobalSettings::beginForecastDay());
setForecastMethod(KMyMoneyGlobalSettings::forecastMethod());
@@ -75,12 +75,12 @@ void MyMoneyForecast::doForecast()
//initialize global variables
setForecastDays(fDays);
- setForecastStartDate(TQDate::currentDate().addDays(1));
- setForecastEndDate(TQDate::currentDate().addDays(fDays));
+ setForecastStartDate(TQDate::tqcurrentDate().addDays(1));
+ setForecastEndDate(TQDate::tqcurrentDate().addDays(fDays));
setAccountsCycle(fAccCycle);
setForecastCycles(fCycles);
setHistoryStartDate(forecastCycles() * accountsCycle());
- setHistoryEndDate(TQDate::currentDate().addDays(-1)); //yesterday
+ setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); //yesterday
//clear all data before calculating
m_accountListPast.clear();
@@ -343,14 +343,14 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i
//If it is a new account, we don't take into account the first day
//because it is usually a weird one and it would mess up the trend
- if(openingDate.daysTo(TQDate::currentDate())<trendDays){
+ if(openingDate.daysTo(TQDate::tqcurrentDate())<trendDays){
startDate = (acc.openingDate()).addDays(1);
}
else {
- startDate = TQDate::currentDate().addDays(-trendDays);
+ startDate = TQDate::tqcurrentDate().addDays(-trendDays);
}
//get all transactions for the period
- filter.setDateFilter(startDate, TQDate::currentDate());
+ filter.setDateFilter(startDate, TQDate::tqcurrentDate());
if(acc.accountGroup() == MyMoneyAccount::Income
|| acc.accountGroup() == MyMoneyAccount::Expense) {
filter.addCategory(acc.id());
@@ -377,8 +377,8 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i
MyMoneyMoney accTrend;
//don't take into account the first day of the account
- if(openingDate.daysTo(TQDate::currentDate())<trendDays) {
- accTrend = netIncome/MyMoneyMoney(openingDate.daysTo(TQDate::currentDate())-1,1);
+ if(openingDate.daysTo(TQDate::tqcurrentDate())<trendDays) {
+ accTrend = netIncome/MyMoneyMoney(openingDate.daysTo(TQDate::tqcurrentDate())-1,1);
} else {
accTrend = netIncome/MyMoneyMoney(trendDays,1);
}
@@ -490,7 +490,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances()
break;
case 2:
{
- TQDate baseDate = TQDate::currentDate().addDays(-accountsCycle());
+ TQDate baseDate = TQDate::tqcurrentDate().addDays(-accountsCycle());
for(int t_day = 1; t_day <= accountsCycle(); ++t_day) {
int f_day = 1;
TQDate fDate = baseDate.addDays(accountsCycle()+1);
@@ -536,7 +536,7 @@ MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, TQDate
*/
MyMoneyMoney MyMoneyForecast::forecastBalance (const MyMoneyAccount& acc, int offset )
{
- TQDate forecastDate = TQDate::currentDate().addDays(offset);
+ TQDate forecastDate = TQDate::tqcurrentDate().addDays(offset);
return forecastBalance(acc, forecastDate);
}
@@ -570,7 +570,7 @@ void MyMoneyForecast::doFutureScheduledForecast(void)
MyMoneyMoney rate = MyMoneyMoney ( 1, 1 );
MyMoneyPrice price;
- for (TQDate it_day = TQDate::currentDate(); it_day <= forecastEndDate(); ) {
+ for (TQDate it_day = TQDate::tqcurrentDate(); it_day <= forecastEndDate(); ) {
//get the price for the tradingCurrency that day
price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), it_day );
if ( price.isValid() )
@@ -651,7 +651,7 @@ void MyMoneyForecast::addScheduledTransactions (void)
TQValueList<MyMoneySchedule> schedule;
schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY,
- TQDate::currentDate(), forecastEndDate());
+ TQDate::tqcurrentDate(), forecastEndDate());
if(schedule.count() > 0) {
TQValueList<MyMoneySchedule>::Iterator it;
do {
@@ -698,12 +698,12 @@ void MyMoneyForecast::addScheduledTransactions (void)
if(isForecastAccount(acc)) {
// collect all overdues on the first day
TQDate forecastDate = nextDate;
- if(TQDate::currentDate() >= nextDate)
- forecastDate = TQDate::currentDate().addDays(1);
+ if(TQDate::tqcurrentDate() >= nextDate)
+ forecastDate = TQDate::tqcurrentDate().addDays(1);
dailyBalances balance;
balance = m_accountList[acc.id()];
- for(TQDate f_day = TQDate::currentDate(); f_day < forecastDate; ) {
+ for(TQDate f_day = TQDate::tqcurrentDate(); f_day < forecastDate; ) {
balanceMap[acc.id()] += m_accountList[acc.id()][f_day];
f_day = f_day.addDays(1);
}
@@ -719,14 +719,14 @@ void MyMoneyForecast::addScheduledTransactions (void)
if(isForecastAccount(acc)) {
dailyBalances balance;
balance = m_accountList[acc.id()];
- //int offset = TQDate::currentDate().daysTo(nextDate);
+ //int offset = TQDate::tqcurrentDate().daysTo(nextDate);
//if(offset <= 0) { // collect all overdues on the first day
// offset = 1;
//}
// collect all overdues on the first day
TQDate forecastDate = nextDate;
- if(TQDate::currentDate() >= nextDate)
- forecastDate = TQDate::currentDate().addDays(1);
+ if(TQDate::tqcurrentDate() >= nextDate)
+ forecastDate = TQDate::tqcurrentDate().addDays(1);
if(acc.accountType() == MyMoneyAccount::Income) {
balance[forecastDate] += ((*it_s).shares() * MyMoneyMoney(-1, 1));
@@ -807,9 +807,9 @@ int MyMoneyForecast::daysToMinimumBalance(const MyMoneyAccount& acc)
balance = m_accountList[acc.id()];
- for(TQDate it_day = TQDate::currentDate() ; it_day <= forecastEndDate(); ) {
+ for(TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) {
if(minBalance > balance[it_day]) {
- return TQDate::currentDate().daysTo(it_day);
+ return TQDate::tqcurrentDate().daysTo(it_day);
}
it_day = it_day.addDays(1);
}
@@ -828,20 +828,20 @@ int MyMoneyForecast::daysToZeroBalance(const MyMoneyAccount& acc)
balance = m_accountList[acc.id()];
if (acc.accountGroup() == MyMoneyAccount::Asset) {
- for (TQDate it_day = TQDate::currentDate() ; it_day <= forecastEndDate(); )
+ for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); )
{
if ( balance[it_day] < MyMoneyMoney ( 0, 1 ) )
{
- return TQDate::currentDate().daysTo(it_day);
+ return TQDate::tqcurrentDate().daysTo(it_day);
}
it_day = it_day.addDays(1);
}
} else if (acc.accountGroup() == MyMoneyAccount::Liability) {
- for (TQDate it_day = TQDate::currentDate() ; it_day <= forecastEndDate(); )
+ for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); )
{
if ( balance[it_day] > MyMoneyMoney ( 0, 1 ) )
{
- return TQDate::currentDate().daysTo(it_day);
+ return TQDate::tqcurrentDate().daysTo(it_day);
}
it_day = it_day.addDays(1);
}
@@ -882,7 +882,7 @@ MyMoneyMoney MyMoneyForecast::accountTotalVariation(const MyMoneyAccount& acc)
{
MyMoneyMoney totalVariation;
- totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, TQDate::currentDate());
+ totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, TQDate::tqcurrentDate());
return totalVariation;
}
@@ -891,15 +891,15 @@ TQValueList<TQDate> MyMoneyForecast::accountMinimumBalanceDateList(const MyMoney
TQValueList<TQDate> minBalanceList;
int daysToBeginDay;
- daysToBeginDay = TQDate::currentDate().daysTo(beginForecastDate());
+ daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate());
for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) {
MyMoneyMoney minBalance = forecastBalance(acc, (t_cycle * accountsCycle() + daysToBeginDay));
- TQDate minDate = TQDate::currentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay);
+ TQDate minDate = TQDate::tqcurrentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay);
for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) {
if( minBalance > forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) {
minBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day );
- minDate = TQDate::currentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day);
+ minDate = TQDate::tqcurrentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day);
}
}
minBalanceList.append(minDate);
@@ -912,16 +912,16 @@ TQValueList<TQDate> MyMoneyForecast::accountMaximumBalanceDateList(const MyMoney
TQValueList<TQDate> maxBalanceList;
int daysToBeginDay;
- daysToBeginDay = TQDate::currentDate().daysTo(beginForecastDate());
+ daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate());
for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) {
MyMoneyMoney maxBalance = forecastBalance(acc, ((t_cycle * accountsCycle()) + daysToBeginDay));
- TQDate maxDate = TQDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay);
+ TQDate maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay);
for(int t_day = 0; t_day < accountsCycle() ; ++t_day) {
if( maxBalance < forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) {
maxBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day );
- maxDate = TQDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day);
+ maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day);
}
}
maxBalanceList.append(maxDate);
@@ -947,38 +947,38 @@ int MyMoneyForecast::calculateBeginForecastDay()
//if 0, beginDate is current date and forecastDays remains unchanged
if(beginDay == 0) {
- setBeginForecastDate(TQDate::currentDate());
+ setBeginForecastDate(TQDate::tqcurrentDate());
return fDays;
}
//adjust if beginDay more than days of current month
- if(TQDate::currentDate().daysInMonth() < beginDay)
- beginDay = TQDate::currentDate().daysInMonth();
+ if(TQDate::tqcurrentDate().daysInMonth() < beginDay)
+ beginDay = TQDate::tqcurrentDate().daysInMonth();
//if beginDay still to come, calculate and return
- if(TQDate::currentDate().day() <= beginDay) {
- beginDate = TQDate( TQDate::currentDate().year(), TQDate::currentDate().month(), beginDay);
- fDays += TQDate::currentDate().daysTo(beginDate);
+ if(TQDate::tqcurrentDate().day() <= beginDay) {
+ beginDate = TQDate( TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay);
+ fDays += TQDate::tqcurrentDate().daysTo(beginDate);
setBeginForecastDate(beginDate);
return fDays;
}
//adjust beginDay for next month
- if(TQDate::currentDate().addMonths(1).daysInMonth() < beginDay)
- beginDay = TQDate::currentDate().addMonths(1).daysInMonth();
+ if(TQDate::tqcurrentDate().addMonths(1).daysInMonth() < beginDay)
+ beginDay = TQDate::tqcurrentDate().addMonths(1).daysInMonth();
//if beginDay of next month comes before 1 interval, use beginDay next month
- if(TQDate::currentDate().addDays(accCycle) >=
- (TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) )
+ if(TQDate::tqcurrentDate().addDays(accCycle) >=
+ (TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) )
{
- beginDate = TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1);
- fDays += TQDate::currentDate().daysTo(beginDate);
+ beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1);
+ fDays += TQDate::tqcurrentDate().daysTo(beginDate);
}
else //add intervals to current beginDay and take the first after current date
{
- beginDay = ((((TQDate::currentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay;
- beginDate = TQDate::currentDate().addDays(beginDay - TQDate::currentDate().day());
- fDays += TQDate::currentDate().daysTo(beginDate);
+ beginDay = ((((TQDate::tqcurrentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay;
+ beginDate = TQDate::tqcurrentDate().addDays(beginDay - TQDate::tqcurrentDate().day());
+ fDays += TQDate::tqcurrentDate().daysTo(beginDate);
}
setBeginForecastDate(beginDate);
@@ -1190,15 +1190,15 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc)
//set the default value
MyMoneyMoney rate = MyMoneyMoney ( 1, 1 );
//get te
- MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), TQDate::currentDate() );
+ MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), TQDate::tqcurrentDate() );
if ( price.isValid() )
{
rate = price.rate ( undersecurity.tradingCurrency() );
}
- m_accountList[acc.id()][TQDate::currentDate()] = file->balance(acc.id(), TQDate::currentDate()) * rate;
+ m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()) * rate;
}
} else {
- m_accountList[acc.id()][TQDate::currentDate()] = file->balance(acc.id(), TQDate::currentDate());
+ m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate());
}
//if the method is linear regression, we have to add the opening balance to m_accountListPast
@@ -1267,8 +1267,8 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney
// the payment is overdue then take the current date
dueDate = schedule.nextDueDate();
if(acc.interestCalculation() == MyMoneyAccountLoan::paymentReceived) {
- if(dueDate < TQDate::currentDate())
- dueDate = TQDate::currentDate();
+ if(dueDate < TQDate::tqcurrentDate())
+ dueDate = TQDate::tqcurrentDate();
}
// we need to calculate the balance at the time the payment is due
diff --git a/kmymoney2/mymoney/mymoneyforecast.h b/kmymoney2/mymoney/mymoneyforecast.h
index 6fa231c..7291b2b 100644
--- a/kmymoney2/mymoney/mymoneyforecast.h
+++ b/kmymoney2/mymoney/mymoneyforecast.h
@@ -141,8 +141,8 @@ public:
void setForecastMethod(int forecastMethod) { m_forecastMethod = forecastMethod; }
void setHistoryStartDate(TQDate historyStartDate) { m_historyStartDate = historyStartDate; }
void setHistoryEndDate(TQDate historyEndDate) { m_historyEndDate = historyEndDate; }
- void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(TQDate::currentDate().addDays(-daysToStartDate)); }
- void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(TQDate::currentDate().addDays(-daysToEndDate)); }
+ void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(TQDate::tqcurrentDate().addDays(-daysToStartDate)); }
+ void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(TQDate::tqcurrentDate().addDays(-daysToEndDate)); }
void setForecastStartDate(TQDate _startDate) { m_forecastStartDate = _startDate; }
void setForecastEndDate(TQDate _endDate) { m_forecastEndDate = _endDate; }
void setSkipOpeningDate(bool _skip) { m_skipOpeningDate = _skip; }
diff --git a/kmymoney2/mymoney/mymoneyforecasttest.cpp b/kmymoney2/mymoney/mymoneyforecasttest.cpp
index dc829cd..ffcd232 100644
--- a/kmymoney2/mymoney/mymoneyforecasttest.cpp
+++ b/kmymoney2/mymoney/mymoneyforecasttest.cpp
@@ -78,7 +78,7 @@ void MyMoneyForecastTest::setUp () {
acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild, "USD");
//this account added to have an account to test opening date calculations
- acCash = makeAccount(TQString("Cash"),MyMoneyAccount::Cash,moCreditOpen,TQDate::currentDate().addDays(-2),acAsset, "USD");
+ acCash = makeAccount(TQString("Cash"),MyMoneyAccount::Cash,moCreditOpen,TQDate::tqcurrentDate().addDays(-2),acAsset, "USD");
MyMoneyInstitution i("Bank of the World","","","","","","");
@@ -97,18 +97,18 @@ void MyMoneyForecastTest::testEmptyConstructor() {
MyMoneyForecast a;
MyMoneyAccount b;
- int f = a.forecastBalance(b, TQDate::currentDate());
+ int f = a.forecastBalance(b, TQDate::tqcurrentDate());
CPPUNIT_ASSERT(f == 0);
CPPUNIT_ASSERT(!a.isForecastAccount(b));
- CPPUNIT_ASSERT(a.forecastBalance(b, TQDate::currentDate()) == MyMoneyMoney(0,1));
+ CPPUNIT_ASSERT(a.forecastBalance(b, TQDate::tqcurrentDate()) == MyMoneyMoney(0,1));
CPPUNIT_ASSERT(a.daysToMinimumBalance(b) == -1);
CPPUNIT_ASSERT(a.daysToZeroBalance(b) == -2);
CPPUNIT_ASSERT(a.forecastDays() == KMyMoneyGlobalSettings::forecastDays());
CPPUNIT_ASSERT(a.accountsCycle() == KMyMoneyGlobalSettings::forecastAccountCycle());
CPPUNIT_ASSERT(a.forecastCycles() == KMyMoneyGlobalSettings::forecastCycles());
- CPPUNIT_ASSERT(a.historyStartDate() == TQDate::currentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle()));
- CPPUNIT_ASSERT(a.historyEndDate() == TQDate::currentDate().addDays(-1));
+ CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle()));
+ CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1));
CPPUNIT_ASSERT(a.historyDays() == KMyMoneyGlobalSettings::forecastAccountCycle() * KMyMoneyGlobalSettings::forecastCycles());
}
@@ -177,9 +177,9 @@ void MyMoneyForecastTest::testDoForecast() {
a.doForecast(); //this is just to check nothing goes wrong if forecast is run agains an empty template
//setup some transactions
- TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent);
- TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent);
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking);
a.setForecastMethod(1);
a.setForecastDays(3);
@@ -190,32 +190,32 @@ void MyMoneyForecastTest::testDoForecast() {
a.doForecast();
//checking didn't have balance variations, so the forecast should be equal to the current balance
- MyMoneyMoney b_checking = file->balance(a_checking.id(), TQDate::currentDate());
+ MyMoneyMoney b_checking = file->balance(a_checking.id(), TQDate::tqcurrentDate());
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(1))==b_checking);
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(2))==b_checking);
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(3))==b_checking);
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate())==b_checking);
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(1))==b_checking);
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(2))==b_checking);
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(3))==b_checking);
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate())==b_checking);
//credit had a variation so the forecast should be different for each day
- MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::currentDate());
+ MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit);
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1)));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2)));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1)));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2)));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3));
a.setHistoryMethod(1); //weighted moving average
a.doForecast();
CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit);
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1)));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2)));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1)));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2)));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3));
//insert transactions outside the forecast period. The calculation should be the same.
- TransactionHelper t4( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent );
- TransactionHelper t5( TQDate::currentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent );
- TransactionHelper t6( TQDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent );
+ TransactionHelper t4( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent );
+ TransactionHelper t5( TQDate::tqcurrentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent );
+ TransactionHelper t6( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent );
a.setForecastMethod(1);
a.setForecastDays(3);
@@ -225,14 +225,14 @@ void MyMoneyForecastTest::testDoForecast() {
a.setHistoryMethod(0); //moving average
a.doForecast();
//check forecast
- b_credit = file->balance(a_credit.id(), TQDate::currentDate());
+ b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate());
MyMoneyMoney b_credit_1_exp = (b_credit+((moT2-moT1)));
- MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, TQDate::currentDate().addDays(2));
+ MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2));
MyMoneyMoney b_credit_2_exp = (b_credit+((moT2-moT1)*2));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate())==file->balance(a_credit.id(), TQDate::currentDate()));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1))==b_credit+(moT2-moT1));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate()));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3));
//test weighted moving average
a.setForecastMethod(1);
@@ -244,7 +244,7 @@ void MyMoneyForecastTest::testDoForecast() {
a.doForecast();
CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit);
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1))));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1))));
}
@@ -265,7 +265,7 @@ void MyMoneyForecastTest::testGetForecastAccountList()
void MyMoneyForecastTest::testCalculateAccountTrend()
{
//set up environment
- TransactionHelper t1( TQDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo );
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo );
MyMoneyAccount a_checking = file->account(acChecking);
//test invalid arguments
@@ -296,8 +296,8 @@ void MyMoneyForecastTest::testCalculateAccountTrend()
//test that it does not take into account the transactions of the opening date of the account
MyMoneyAccount a_cash = file->account(acCash);
- TransactionHelper t2( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent );
- TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent );
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent );
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent );
CPPUNIT_ASSERT(MyMoneyForecast::calculateAccountTrend(a_cash,3) == -moT1);
}
@@ -307,9 +307,9 @@ void MyMoneyForecastTest::testGetForecastBalance()
//set up environment
MyMoneyForecast a;
- TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent);
- TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent);
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking);
a.setForecastMethod(1);
a.setForecastDays(3);
@@ -322,23 +322,23 @@ void MyMoneyForecastTest::testGetForecastBalance()
MyMoneyAccount a_credit = file->account(acCredit);
//test invalid arguments
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(-1))==MyMoneyMoney(0,1));
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(-10))==MyMoneyMoney(0,1));
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-1))==MyMoneyMoney(0,1));
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-10))==MyMoneyMoney(0,1));
CPPUNIT_ASSERT(a.forecastBalance(a_checking, -1)==MyMoneyMoney(0,1));
CPPUNIT_ASSERT(a.forecastBalance(a_checking, -100)==MyMoneyMoney(0,1));
//test a date outside the forecast days
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(4))==MyMoneyMoney(0,1));
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(4))==MyMoneyMoney(0,1));
CPPUNIT_ASSERT(a.forecastBalance(a_checking, 4)==MyMoneyMoney(0,1));
- CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::currentDate().addDays(10))==MyMoneyMoney(0,1));
+ CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(10))==MyMoneyMoney(0,1));
CPPUNIT_ASSERT(a.forecastBalance(a_checking, 10)==MyMoneyMoney(0,1));
//test it returns valid results
- MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::currentDate());
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate())==file->balance(a_credit.id(), TQDate::currentDate()));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(1))==b_credit+(moT2-moT1));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2));
- CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3));
+ MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate()));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2));
+ CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3));
}
void MyMoneyForecastTest::testIsForecastAccount()
@@ -364,10 +364,10 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast()
MyMoneyForecast a;
MyMoneyAccount a_cash = file->account(acCash);
- TransactionHelper t1( TQDate::currentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent );
- TransactionHelper t2( TQDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent );
- TransactionHelper t3( TQDate::currentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent );
- TransactionHelper t4( TQDate::currentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent );
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent );
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent );
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent );
+ TransactionHelper t4( TQDate::tqcurrentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent );
a.setForecastMethod(0);
a.setForecastDays(3);
@@ -375,13 +375,13 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast()
a.setForecastCycles(1);
a.doForecast();
- MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::currentDate());
+ MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate());
//test valid results
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate())==b_cash);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(1))==b_cash+moT1);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(2))==b_cash+moT1+moT2);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(3))==b_cash+moT1+moT2+moT3);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash+moT1);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash+moT1+moT2);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash+moT1+moT2+moT3);
}
void MyMoneyForecastTest::testScheduleForecast()
@@ -395,14 +395,14 @@ void MyMoneyForecastTest::testScheduleForecast()
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- TQDate::currentDate().addDays(1),
+ TQDate::tqcurrentDate().addDays(1),
TQDate(),
true,
true);
MyMoneyTransaction t;
- t.setPostDate(TQDate::currentDate().addDays(1));
- t.setEntryDate(TQDate::currentDate().addDays(1));
+ t.setPostDate(TQDate::tqcurrentDate().addDays(1));
+ t.setEntryDate(TQDate::tqcurrentDate().addDays(1));
//t.setId("T000000000000000001");
t.setBankID("BID");
t.setMemo("Wohnung:Miete");
@@ -437,18 +437,18 @@ void MyMoneyForecastTest::testScheduleForecast()
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- TQDate::currentDate().addDays(5),
+ TQDate::tqcurrentDate().addDays(5),
TQDate(),
true,
true);
- //sch.setLastPayment(TQDate::currentDate());
- //sch.recordPayment(TQDate::currentDate().addDays(1));
+ //sch.setLastPayment(TQDate::tqcurrentDate());
+ //sch.recordPayment(TQDate::tqcurrentDate().addDays(1));
//sch.setId("SCH0001");
MyMoneyTransaction t3;
- t3.setPostDate(TQDate::currentDate().addDays(5));
- t3.setEntryDate(TQDate::currentDate().addDays(5));
+ t3.setPostDate(TQDate::tqcurrentDate().addDays(5));
+ t3.setEntryDate(TQDate::tqcurrentDate().addDays(5));
//t.setId("T000000000000000001");
t3.setBankID("BID");
t3.setMemo("Wohnung:Miete");
@@ -484,18 +484,18 @@ void MyMoneyForecastTest::testScheduleForecast()
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- TQDate::currentDate().addDays(2),
+ TQDate::tqcurrentDate().addDays(2),
TQDate(),
true,
true);
- //sch.setLastPayment(TQDate::currentDate());
- //sch.recordPayment(TQDate::currentDate().addDays(1));
+ //sch.setLastPayment(TQDate::tqcurrentDate());
+ //sch.recordPayment(TQDate::tqcurrentDate().addDays(1));
//sch.setId("SCH0001");
MyMoneyTransaction t2;
- t2.setPostDate(TQDate::currentDate().addDays(2));
- t2.setEntryDate(TQDate::currentDate().addDays(2));
+ t2.setPostDate(TQDate::tqcurrentDate().addDays(2));
+ t2.setEntryDate(TQDate::tqcurrentDate().addDays(2));
//t.setId("T000000000000000001");
t2.setBankID("BID");
t2.setMemo("Wohnung:Miete");
@@ -535,13 +535,13 @@ void MyMoneyForecastTest::testScheduleForecast()
a.doForecast();
//check result for single schedule
- MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::currentDate());
- MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(1));
+ MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate());
+ MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1));
//test valid results
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate())==b_cash);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(1))==b_cash-moT2);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(2))==b_cash-moT2-moT1);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash-moT2);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2-moT1);
}
@@ -555,10 +555,10 @@ void MyMoneyForecastTest::testDaysToMinimumBalance()
MyMoneyAccount a_parent = file->account(acParent);
a_cash.setValue("minBalanceAbsolute", "50");
a_credit.setValue("minBalanceAbsolute", "50");
- TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent );
- TransactionHelper t2( TQDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent );
- TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent );
- TransactionHelper t4( TQDate::currentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent );
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent );
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent );
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent );
+ TransactionHelper t4( TQDate::tqcurrentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent );
a.setForecastMethod(0);
a.setForecastDays(3);
@@ -588,9 +588,9 @@ void MyMoneyForecastTest::testDaysToZeroBalance()
MyMoneyAccount a_Credit = file->account(acCredit);
//MyMoneyFileTransaction ft;
- TransactionHelper t1( TQDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo );
- TransactionHelper t2( TQDate::currentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit );
- TransactionHelper t3( TQDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent );
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo );
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit );
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent );
//ft.commit();
MyMoneyForecast a;
@@ -618,7 +618,7 @@ void MyMoneyForecastTest::testDaysToZeroBalance()
//test it warns when inside the forecast period
- MyMoneyMoney fCash = a.forecastBalance(a_Cash, TQDate::currentDate().addDays(2));
+ MyMoneyMoney fCash = a.forecastBalance(a_Cash, TQDate::tqcurrentDate().addDays(2));
CPPUNIT_ASSERT(a.daysToZeroBalance(a_Cash) == 2);
@@ -631,8 +631,8 @@ void MyMoneyForecastTest::testSkipOpeningDate()
//set up environment
MyMoneyForecast a;
- TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
a.setForecastMethod(1);
a.setForecastDays(3);
@@ -644,12 +644,12 @@ void MyMoneyForecastTest::testSkipOpeningDate()
MyMoneyAccount a_cash = file->account(acCash);
//test it has no variation because it skipped the variation of the opening date
- MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::currentDate());
+ MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.skipOpeningDate() == true);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate())==b_cash);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(1))==b_cash);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(2))==b_cash-moT2);
- CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::currentDate().addDays(3))==b_cash-moT2);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2);
+ CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash-moT2);
}
void MyMoneyForecastTest::testAccountMinimumBalanceDateList() {
@@ -657,15 +657,15 @@ void MyMoneyForecastTest::testAccountMinimumBalanceDateList() {
//set up environment
MyMoneyForecast a;
- TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
a.setForecastMethod(1);
a.setForecastDays(6);
a.setAccountsCycle(2);
a.setForecastCycles(3);
a.setHistoryMethod(0);
- a.setBeginForecastDay(TQDate::currentDate().addDays(1).day());
+ a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day());
a.doForecast();
MyMoneyAccount a_cash = file->account(acCash);
@@ -678,13 +678,13 @@ void MyMoneyForecastTest::testAccountMinimumBalanceDateList() {
TQDate minDate = *it;
- CPPUNIT_ASSERT(minDate==TQDate::currentDate().addDays(2));
+ CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(2));
it++;
minDate = *it;
- CPPUNIT_ASSERT(minDate==TQDate::currentDate().addDays(4));
+ CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(4));
it++;
minDate = *it;
- CPPUNIT_ASSERT(minDate==TQDate::currentDate().addDays(6));
+ CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(6));
}
@@ -692,15 +692,15 @@ void MyMoneyForecastTest::testAccountMaximumBalanceDateList() {
//set up environment
MyMoneyForecast a;
- TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
a.setForecastMethod(1);
a.setForecastDays(6);
a.setAccountsCycle(2);
a.setForecastCycles(3);
a.setHistoryMethod(0);
- a.setBeginForecastDay(TQDate::currentDate().addDays(1).day());
+ a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day());
a.doForecast();
MyMoneyAccount a_cash = file->account(acCash);
@@ -713,13 +713,13 @@ void MyMoneyForecastTest::testAccountMaximumBalanceDateList() {
TQDate maxDate = *it;
- CPPUNIT_ASSERT(maxDate==TQDate::currentDate().addDays(1));
+ CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(1));
it++;
maxDate = *it;
- CPPUNIT_ASSERT(maxDate==TQDate::currentDate().addDays(3));
+ CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(3));
it++;
maxDate = *it;
- CPPUNIT_ASSERT(maxDate==TQDate::currentDate().addDays(5));
+ CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(5));
}
@@ -728,8 +728,8 @@ void MyMoneyForecastTest::testAccountAverageBalance() {
//set up environment
MyMoneyForecast a;
- TransactionHelper t1( TQDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo);
a.setForecastMethod(1);
a.setForecastDays(3);
@@ -741,9 +741,9 @@ void MyMoneyForecastTest::testAccountAverageBalance() {
MyMoneyAccount a_cash = file->account(acCash);
//test
- MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(1));
- MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(2));
- MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, TQDate::currentDate().addDays(3));
+ MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1));
+ MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2));
+ MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3));
MyMoneyMoney average = (b_cash1 + b_cash2 +b_cash3)/MyMoneyMoney(3,1);
@@ -765,7 +765,7 @@ void MyMoneyForecastTest::testBeginForecastDate() {
a.doForecast();
//test when using old method without begin day
- CPPUNIT_ASSERT(TQDate::currentDate() == a.beginForecastDate());
+ CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate());
//setup begin to last day of month
a.setBeginForecastDay(31);
@@ -773,22 +773,22 @@ void MyMoneyForecastTest::testBeginForecastDate() {
a.doForecast();
//test
- if(TQDate::currentDate().day() < beginDay)
+ if(TQDate::tqcurrentDate().day() < beginDay)
{
- if(TQDate::currentDate().daysInMonth() < beginDay)
- beginDay = TQDate::currentDate().daysInMonth();
+ if(TQDate::tqcurrentDate().daysInMonth() < beginDay)
+ beginDay = TQDate::tqcurrentDate().daysInMonth();
- beginDate = TQDate(TQDate::currentDate().year(), TQDate::currentDate().month(), beginDay);
+ beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay);
CPPUNIT_ASSERT(beginDate == a.beginForecastDate());
}
//setup begin day to same date
- a.setBeginForecastDay(TQDate::currentDate().day());
+ a.setBeginForecastDay(TQDate::tqcurrentDate().day());
beginDay = a.beginForecastDay();
a.doForecast();
- CPPUNIT_ASSERT(TQDate::currentDate() == a.beginForecastDate());
+ CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate());
//setup to first day of month with small interval
a.setBeginForecastDay(1);
@@ -797,14 +797,14 @@ void MyMoneyForecastTest::testBeginForecastDate() {
a.doForecast();
//test
- if(TQDate::currentDate() == a.beginForecastDate()) {
- CPPUNIT_ASSERT(TQDate::currentDate() == a.beginForecastDate());
+ if(TQDate::tqcurrentDate() == a.beginForecastDate()) {
+ CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate());
} else {
- beginDay = ((((TQDate::currentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay;
- if(beginDay > TQDate::currentDate().daysInMonth())
- beginDay = TQDate::currentDate().daysInMonth();
- beginDate = TQDate(TQDate::currentDate().year(), TQDate::currentDate().month(), beginDay);
- if(TQDate::currentDate().day() == TQDate::currentDate().daysInMonth() ) {
+ beginDay = ((((TQDate::tqcurrentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay;
+ if(beginDay > TQDate::tqcurrentDate().daysInMonth())
+ beginDay = TQDate::tqcurrentDate().daysInMonth();
+ beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay);
+ if(TQDate::tqcurrentDate().day() == TQDate::tqcurrentDate().daysInMonth() ) {
std::cout << std::endl << "testBeginForecastDate(): test of first day of month with small interval skipped because it is the last day of month" << std::endl;
} else {
CPPUNIT_ASSERT(beginDate == a.beginForecastDate());
@@ -813,9 +813,9 @@ void MyMoneyForecastTest::testBeginForecastDate() {
//setup to test when current date plus cycle equals begin day
a.setAccountsCycle(14);
- beginDay = TQDate::currentDate().addDays(14).day();
+ beginDay = TQDate::tqcurrentDate().addDays(14).day();
a.setBeginForecastDay(beginDay);
- beginDate = TQDate::currentDate().addDays(14);
+ beginDate = TQDate::tqcurrentDate().addDays(14);
a.doForecast();
//test
@@ -826,10 +826,10 @@ void MyMoneyForecastTest::testBeginForecastDate() {
a.setAccountsCycle(40);
a.doForecast();
- beginDate = TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1);
+ beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1);
//test
- if(TQDate::currentDate().day() > 1) {
+ if(TQDate::tqcurrentDate().day() > 1) {
CPPUNIT_ASSERT(beginDate == a.beginForecastDate());
} else {
//test is not valid if today is 1st of month
@@ -841,8 +841,8 @@ void MyMoneyForecastTest::testBeginForecastDate() {
{
MyMoneyForecast a;
- CPPUNIT_ASSERT(a.historyStartDate() == TQDate::currentDate().addDays(-a.forecastCycles()*a.accountsCycle()) );
- CPPUNIT_ASSERT(a.historyEndDate() == TQDate::currentDate().addDays(-1) );
+ CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-a.forecastCycles()*a.accountsCycle()) );
+ CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1) );
CPPUNIT_ASSERT(a.historyDays() == a.forecastCycles()*a.accountsCycle());
a.setForecastMethod(1);
@@ -852,9 +852,9 @@ void MyMoneyForecastTest::testBeginForecastDate() {
a.setBeginForecastDay(0);
a.doForecast();
- CPPUNIT_ASSERT(a.historyStartDate() == TQDate::currentDate().addDays(-14*3) );
+ CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-14*3) );
CPPUNIT_ASSERT(a.historyDays() == (14*3));
- CPPUNIT_ASSERT(a.historyEndDate() == (TQDate::currentDate().addDays(-1)) );
+ CPPUNIT_ASSERT(a.historyEndDate() == (TQDate::tqcurrentDate().addDays(-1)) );
}
void MyMoneyForecastTest::testCreateBudget()
@@ -910,14 +910,14 @@ void MyMoneyForecastTest::testCreateBudget()
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_MONTHLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- TQDate::currentDate(),
+ TQDate::tqcurrentDate(),
TQDate(),
true,
true);
MyMoneyTransaction t10;
- t10.setPostDate(TQDate::currentDate().addMonths(1));
- t10.setEntryDate(TQDate::currentDate().addMonths(1));
+ t10.setPostDate(TQDate::tqcurrentDate().addMonths(1));
+ t10.setEntryDate(TQDate::tqcurrentDate().addMonths(1));
//t.setId("T000000000000000001");
t10.setBankID("BID");
t10.setMemo("Wohnung:Miete");
@@ -951,12 +951,12 @@ void MyMoneyForecastTest::testCreateBudget()
MyMoneyForecast c;
c.setForecastMethod(0);
c.setForecastCycles(1);
- c.createBudget(budget, TQDate::currentDate().addYears(-2), TQDate::currentDate().addYears(-1), TQDate::currentDate().addMonths(-2), TQDate::currentDate().addMonths(6), true);
+ c.createBudget(budget, TQDate::tqcurrentDate().addYears(-2), TQDate::tqcurrentDate().addYears(-1), TQDate::tqcurrentDate().addMonths(-2), TQDate::tqcurrentDate().addMonths(6), true);
- MyMoneyMoney c_parent = c.forecastBalance(a_parent, TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1) );
+ MyMoneyMoney c_parent = c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) );
//test valid results
- CPPUNIT_ASSERT(c.forecastBalance(a_parent, TQDate(TQDate::currentDate().addMonths(1).year(), TQDate::currentDate().addMonths(1).month(), 1) ) == (moT2));
+ CPPUNIT_ASSERT(c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ) == (moT2));
}
void MyMoneyForecastTest::testLinearRegression() {
@@ -967,9 +967,9 @@ void MyMoneyForecastTest::testLinearRegression() {
MyMoneyAccount a_credit = file->account(acCredit);
//setup some transactions
- TransactionHelper t1( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo);
- TransactionHelper t2( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent);
- TransactionHelper t3( TQDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking);
+ TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo);
+ TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent);
+ TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking);
//TODO Add tests specific for linear regression
diff --git a/kmymoney2/mymoney/mymoneyinstitution.cpp b/kmymoney2/mymoney/mymoneyinstitution.cpp
index 1576cf3..6e5b102 100644
--- a/kmymoney2/mymoney/mymoneyinstitution.cpp
+++ b/kmymoney2/mymoney/mymoneyinstitution.cpp
@@ -72,7 +72,7 @@ MyMoneyInstitution::MyMoneyInstitution(const TQDomElement& node) :
TQDomNodeList nodeList = node.elementsByTagName("ADDRESS");
if(nodeList.count() == 0) {
- TQString msg = TQString("No ADDRESS in institution %1").arg(m_name);
+ TQString msg = TQString("No ADDRESS in institution %1").tqarg(m_name);
throw new MYMONEYEXCEPTION(msg);
}
@@ -177,6 +177,6 @@ bool MyMoneyInstitution::hasReferenceTo(const TQString& /* id */) const
}
TQPixmap MyMoneyInstitution::pixmap() const {
- return TQPixmap(KGlobal::dirs()->findResource("appdata",TQString( "icons/hicolor/22x22/actions/%1.png").arg("bank")));
+ return TQPixmap(KGlobal::dirs()->findResource("appdata",TQString( "icons/hicolor/22x22/actions/%1.png").tqarg("bank")));
}
diff --git a/kmymoney2/mymoney/mymoneymoney.cpp b/kmymoney2/mymoney/mymoneymoney.cpp
index 2d380d3..5a8b562 100644
--- a/kmymoney2/mymoney/mymoneymoney.cpp
+++ b/kmymoney2/mymoney/mymoneymoney.cpp
@@ -145,7 +145,7 @@ MyMoneyMoney::MyMoneyMoney(const TQString& pszAmount)
// a) numeric
// b) _decimalSeparator
// c) negative indicator
- TQString validChars = TQString("\\d%1").arg(TQChar(decimalSeparator()));
+ TQString validChars = TQString("\\d%1").tqarg(TQChar(decimalSeparator()));
// we need to escape the minus sign here, because later on it will be
// part of "\d,-()" and that does not work. It needs to be "\d,\-()"
// And we need two of them, because we're in C
@@ -158,11 +158,11 @@ MyMoneyMoney::MyMoneyMoney(const TQString& pszAmount)
validChars += negChars;
// qDebug("0: '%s'", validChars.data());
- TQRegExp invChars(TQString("[^%1]").arg(validChars));
+ TQRegExp invChars(TQString("[^%1]").tqarg(validChars));
// qDebug("1: '%s'", res.data());
res.remove(invChars);
- TQRegExp negCharSet(TQString("[%1]").arg(negChars));
+ TQRegExp negCharSet(TQString("[%1]").tqarg(negChars));
bool isNegative = false;
if(res.find(negCharSet) != -1) {
isNegative = true;
@@ -243,12 +243,12 @@ TQString MyMoneyMoney::formatMoney(const TQString& currency, const int prec, boo
// TQString.sprintf("%Ld") did not work :-(, so I had to
// do it the old ugly way.
while(tmp) {
- res.insert(0, TQString("%1").arg(static_cast<int>(tmp % 10)));
+ res.insert(0, TQString("%1").tqarg(static_cast<int>(tmp % 10)));
tmp /= 10;
}
} else
- res = TQString("%1").arg((long)left);
+ res = TQString("%1").tqarg((long)left);
if(showThousandSeparator) {
int pos = res.length();
@@ -262,13 +262,13 @@ TQString MyMoneyMoney::formatMoney(const TQString& currency, const int prec, boo
// using
//
- // res += TQString("%1").arg(right).rightJustify(prec, '0', true);
+ // res += TQString("%1").tqarg(right).rightJustify(prec, '0', true);
//
// caused some weird results if right was rather large. Eg: right being
// 666600000 should have appended a 0, but instead it prepended a 0. With
// res being "2," the result wasn't "2,6666000000" as expected, but rather
// "2,0666600000" which was not usable. The code below works for me.
- TQString rs = TQString("%1").arg(right);
+ TQString rs = TQString("%1").tqarg(right);
if(prec != -1)
rs = rs.rightJustify(prec, '0', true);
else {
@@ -325,7 +325,7 @@ const TQString MyMoneyMoney::toString(void) const
// TQString.sprintf("%Ld") did not work :-(, so I had to
// do it the old ugly way.
while(tmp) {
- res.prepend(TQString("%1").arg(static_cast<int>(tmp % 10)));
+ res.prepend(TQString("%1").tqarg(static_cast<int>(tmp % 10)));
tmp /= 10;
}
if(res.isEmpty())
@@ -336,7 +336,7 @@ const TQString MyMoneyMoney::toString(void) const
tmp = m_denom;
while(tmp) {
- resf.prepend(TQString("%1").arg(static_cast<int>(tmp % 10)));
+ resf.prepend(TQString("%1").tqarg(static_cast<int>(tmp % 10)));
tmp /= 10;
}
return res + "/" + resf;
diff --git a/kmymoney2/mymoney/mymoneypayee.cpp b/kmymoney2/mymoney/mymoneypayee.cpp
index b37b111..b2eab64 100644
--- a/kmymoney2/mymoney/mymoneypayee.cpp
+++ b/kmymoney2/mymoney/mymoneypayee.cpp
@@ -91,7 +91,7 @@ MyMoneyPayee::MyMoneyPayee(const TQDomElement& node) :
TQDomNodeList nodeList = node.elementsByTagName("ADDRESS");
if(nodeList.count() == 0) {
- TQString msg = TQString("No ADDRESS in payee %1").arg(m_name);
+ TQString msg = TQString("No ADDRESS in payee %1").tqarg(m_name);
throw new MYMONEYEXCEPTION(msg);
}
diff --git a/kmymoney2/mymoney/mymoneyprice.cpp b/kmymoney2/mymoney/mymoneyprice.cpp
index 77054b5..df43221 100644
--- a/kmymoney2/mymoney/mymoneyprice.cpp
+++ b/kmymoney2/mymoney/mymoneyprice.cpp
@@ -88,7 +88,7 @@ const MyMoneyMoney MyMoneyPrice::rate(const TQString& id) const
if(id == m_fromSecurity)
return m_invRate;
- TQString msg = TQString("Unknown security id %1 for price info %2/%3.").arg(id).arg(m_fromSecurity).arg(m_toSecurity);
+ TQString msg = TQString("Unknown security id %1 for price info %2/%3.").tqarg(id).tqarg(m_fromSecurity).tqarg(m_toSecurity);
throw new MYMONEYEXCEPTION(msg);
}
diff --git a/kmymoney2/mymoney/mymoneyreport.cpp b/kmymoney2/mymoney/mymoneyreport.cpp
index 432a352..2904ed5 100644
--- a/kmymoney2/mymoney/mymoneyreport.cpp
+++ b/kmymoney2/mymoney/mymoneyreport.cpp
@@ -201,8 +201,8 @@ void MyMoneyReport::validDateRange ( TQDate& _db, TQDate& _de )
tmpBegin = list.front().postDate();
tmpEnd = list.back().postDate();
} else {
- tmpBegin = TQDate ( TQDate::currentDate().year(), 1, 1 ); // the first date in the file
- tmpEnd = TQDate ( TQDate::currentDate().year(), 12, 31 );// the last date in the file
+ tmpBegin = TQDate ( TQDate::tqcurrentDate().year(), 1, 1 ); // the first date in the file
+ tmpEnd = TQDate ( TQDate::tqcurrentDate().year(), 12, 31 );// the last date in the file
}
if ( !_db.isValid() )
_db = tmpBegin;
diff --git a/kmymoney2/mymoney/mymoneyreport.h b/kmymoney2/mymoney/mymoneyreport.h
index a7bfc98..a04573f 100644
--- a/kmymoney2/mymoney/mymoneyreport.h
+++ b/kmymoney2/mymoney/mymoneyreport.h
@@ -45,8 +45,8 @@ class TQDomDocument;
* A report is a transactionfilter, so any report can specify which
* transactions it's interested down to the most minute level of detail.
* It extends the transactionfilter by providing identification (name,
- * comments, group type, etc) as well as layout information (what kind
- * of layout should be used, how the rows & columns should be presented,
+ * comments, group type, etc) as well as tqlayout information (what kind
+ * of tqlayout should be used, how the rows & columns should be presented,
* currency converted, etc.)
*
* As noted above, this class only provides a report DEFINITION. The
diff --git a/kmymoney2/mymoney/mymoneyscheduled.cpp b/kmymoney2/mymoney/mymoneyscheduled.cpp
index a2eb6dd..594bc69 100644
--- a/kmymoney2/mymoney/mymoneyscheduled.cpp
+++ b/kmymoney2/mymoney/mymoneyscheduled.cpp
@@ -680,7 +680,7 @@ bool MyMoneySchedule::isOverdue() const
if (isFinished())
return false;
- if(adjustedNextDueDate() >= TQDate::currentDate())
+ if(adjustedNextDueDate() >= TQDate::tqcurrentDate())
return false;
return true;
@@ -843,14 +843,14 @@ TQString MyMoneySchedule::occurenceToString(int mult, occurenceE type)
switch (mult)
{
case 1: occurenceString = I18N_NOOP("Once"); break;
- default: occurenceString = I18N_NOOP(static_cast<TQString>("%1 times").arg(mult));
+ default: occurenceString = I18N_NOOP(static_cast<TQString>("%1 times").tqarg(mult));
}
else if(type == MyMoneySchedule::OCCUR_DAILY)
switch (mult)
{
case 1: occurenceString = I18N_NOOP("Daily"); break;
case 30: occurenceString = I18N_NOOP("Every thirty days"); break;
- default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 days").arg(mult));
+ default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 days").tqarg(mult));
}
else if(type == MyMoneySchedule::OCCUR_WEEKLY)
switch (mult)
@@ -860,13 +860,13 @@ TQString MyMoneySchedule::occurenceToString(int mult, occurenceE type)
case 3: occurenceString = I18N_NOOP("Every three weeks"); break;
case 4: occurenceString = I18N_NOOP("Every four weeks"); break;
case 8: occurenceString = I18N_NOOP("Every eight weeks"); break;
- default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 weeks").arg(mult));
+ default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 weeks").tqarg(mult));
}
else if(type == MyMoneySchedule::OCCUR_EVERYHALFMONTH)
switch (mult)
{
case 1: occurenceString = I18N_NOOP("Every half month"); break;
- default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 half months").arg(mult));
+ default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 half months").tqarg(mult));
}
else if(type == MyMoneySchedule::OCCUR_MONTHLY)
switch (mult)
@@ -876,14 +876,14 @@ TQString MyMoneySchedule::occurenceToString(int mult, occurenceE type)
case 3: occurenceString = I18N_NOOP("Every three months"); break;
case 4: occurenceString = I18N_NOOP("Every four months"); break;
case 6: occurenceString = I18N_NOOP("Twice yearly"); break;
- default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 months").arg(mult));
+ default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 months").tqarg(mult));
}
else if(type == MyMoneySchedule::OCCUR_YEARLY)
switch (mult)
{
case 1: occurenceString = I18N_NOOP("Yearly"); break;
case 2: occurenceString = I18N_NOOP("Every other year"); break;
- default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 years").arg(mult));
+ default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 years").tqarg(mult));
}
return occurenceString;
}
@@ -1008,7 +1008,7 @@ void MyMoneySchedule::setVariation(int var)
#if 0
deletePair("kmm-variation");
if(var != 0)
- setValue("kmm-variation", TQString("%1").arg(var));
+ setValue("kmm-variation", TQString("%1").tqarg(var));
#endif
}
diff --git a/kmymoney2/mymoney/mymoneyscheduled.h b/kmymoney2/mymoney/mymoneyscheduled.h
index 9f8fedd..cf5cb07 100644
--- a/kmymoney2/mymoney/mymoneyscheduled.h
+++ b/kmymoney2/mymoney/mymoneyscheduled.h
@@ -409,7 +409,7 @@ public:
* are no more payments then an empty/invalid TQDate() will
* be returned.
*/
- TQDate adjustedNextPayment(const TQDate& refDate = TQDate::currentDate()) const;
+ TQDate adjustedNextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const;
/**
* Calculates the date of the next payment.
@@ -422,7 +422,7 @@ public:
* if there is no more payments then an empty/invalid TQDate()
* will be returned.
*/
- TQDate nextPayment(const TQDate& refDate = TQDate::currentDate()) const;
+ TQDate nextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const;
/**
* Calculates the dates of the payment over a certain period of time.
diff --git a/kmymoney2/mymoney/mymoneyscheduletest.cpp b/kmymoney2/mymoney/mymoneyscheduletest.cpp
index 3fe6afe..07b3cc6 100644
--- a/kmymoney2/mymoney/mymoneyscheduletest.cpp
+++ b/kmymoney2/mymoney/mymoneyscheduletest.cpp
@@ -55,7 +55,7 @@ void MyMoneyScheduleTest::testConstructor() {
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 1,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- TQDate::currentDate(),
+ TQDate::tqcurrentDate(),
TQDate(),
true,
true);
@@ -82,8 +82,8 @@ void MyMoneyScheduleTest::testSetFunctions() {
s.setType(MyMoneySchedule::TYPE_BILL);
CPPUNIT_ASSERT(s.type() == MyMoneySchedule::TYPE_BILL);
- s.setEndDate(TQDate::currentDate());
- CPPUNIT_ASSERT(s.endDate() == TQDate::currentDate());
+ s.setEndDate(TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(s.endDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(s.willEnd() == true);
}
@@ -229,16 +229,16 @@ void MyMoneyScheduleTest::testOverdue()
MyMoneySchedule sch_overdue;
MyMoneySchedule sch_intime;
- // the following checks only work correctly, if currentDate() is
+ // the following checks only work correctly, if tqcurrentDate() is
// between the 1st and 27th. If it is between 28th and 31st
// we don't perform them. Note: this should be fixed.
- if(TQDate::currentDate().day() > 27 || TQDate::currentDate().day() == 1) {
+ if(TQDate::tqcurrentDate().day() > 27 || TQDate::tqcurrentDate().day() == 1) {
std::cout << std::endl << "testOverdue() skipped because current day is between 28th and 2nd" << std::endl;
return;
}
- TQDate startDate = TQDate::currentDate().addDays(-1).addMonths(-23);
- TQDate lastPaymentDate = TQDate::currentDate().addDays(-1).addMonths(-1);
+ TQDate startDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-23);
+ TQDate lastPaymentDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-1);
TQString ref = TQString(
"<!DOCTYPE TEST>\n"
@@ -258,13 +258,13 @@ void MyMoneyScheduleTest::testOverdue()
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n");
- TQString ref_overdue = ref.arg(startDate.toString(Qt::ISODate))
- .arg(lastPaymentDate.toString(Qt::ISODate))
- .arg(lastPaymentDate.toString(Qt::ISODate));
+ TQString ref_overdue = ref.tqarg(startDate.toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.toString(Qt::ISODate));
- TQString ref_intime = ref.arg(startDate.addDays(1).toString(Qt::ISODate))
- .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate))
- .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate));
+ TQString ref_intime = ref.tqarg(startDate.addDays(1).toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate))
+ .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate));
TQDomDocument doc;
TQDomElement node;
@@ -1010,13 +1010,13 @@ void MyMoneyScheduleTest::testWriteXML() {
MyMoneySchedule::TYPE_BILL,
MyMoneySchedule::OCCUR_WEEKLY, 123,
MyMoneySchedule::STYPE_DIRECTDEBIT,
- TQDate::currentDate(),
+ TQDate::tqcurrentDate(),
TQDate(),
true,
true);
- sch.setLastPayment(TQDate::currentDate());
- sch.recordPayment(TQDate::currentDate());
+ sch.setLastPayment(TQDate::tqcurrentDate());
+ sch.recordPayment(TQDate::tqcurrentDate());
sch.setId("SCH0001");
MyMoneyTransaction t;
@@ -1070,9 +1070,9 @@ void MyMoneyScheduleTest::testWriteXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
CPPUNIT_ASSERT(doc.toString() == ref);
}
@@ -1098,9 +1098,9 @@ void MyMoneyScheduleTest::testReadXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
// diff to ref_ok1 is that we now have an empty entrydate
// in the transaction parameters
@@ -1122,9 +1122,9 @@ void MyMoneyScheduleTest::testReadXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
TQString ref_false = TQString(
"<!DOCTYPE TEST>\n"
@@ -1144,9 +1144,9 @@ void MyMoneyScheduleTest::testReadXML() {
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
TQDomDocument doc;
TQDomElement node;
@@ -1167,13 +1167,13 @@ void MyMoneyScheduleTest::testReadXML() {
try {
sch = MyMoneySchedule(node);
CPPUNIT_ASSERT(sch.id() == "SCH0002");
- CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::currentDate().addDays(7));
- CPPUNIT_ASSERT(sch.startDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7));
+ CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(sch.endDate() == TQDate());
CPPUNIT_ASSERT(sch.autoEnter() == true);
CPPUNIT_ASSERT(sch.isFixed() == true);
CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing);
- CPPUNIT_ASSERT(sch.lastPayment() == TQDate::currentDate());
+ CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT);
CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL);
CPPUNIT_ASSERT(sch.name() == "A Name");
@@ -1181,7 +1181,7 @@ void MyMoneyScheduleTest::testReadXML() {
CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1);
CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7));
CPPUNIT_ASSERT(sch.recordedPayments().count() == 1);
- CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::currentDate());
+ CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate());
} catch(MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");
@@ -1194,13 +1194,13 @@ void MyMoneyScheduleTest::testReadXML() {
try {
sch = MyMoneySchedule(node);
CPPUNIT_ASSERT(sch.id() == "SCH0002");
- CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::currentDate().addDays(7));
- CPPUNIT_ASSERT(sch.startDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7));
+ CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(sch.endDate() == TQDate());
CPPUNIT_ASSERT(sch.autoEnter() == true);
CPPUNIT_ASSERT(sch.isFixed() == true);
CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing);
- CPPUNIT_ASSERT(sch.lastPayment() == TQDate::currentDate());
+ CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT);
CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL);
CPPUNIT_ASSERT(sch.name() == "A Name");
@@ -1208,7 +1208,7 @@ void MyMoneyScheduleTest::testReadXML() {
CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1);
CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7));
CPPUNIT_ASSERT(sch.recordedPayments().count() == 1);
- CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::currentDate());
+ CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate());
} catch(MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");
@@ -1236,9 +1236,9 @@ void MyMoneyScheduleTest::testHasReferenceTo()
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate))
- .arg(TQDate::currentDate().toString(Qt::ISODate));
+ ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate))
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
TQDomDocument doc;
TQDomElement node;
@@ -1872,7 +1872,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime()
// https://bugs.kde.org/show_bug.cgi?id=231029
MyMoneySchedule sch;
- TQDate paymentInFuture = TQDate::currentDate().addDays(7);
+ TQDate paymentInFuture = TQDate::tqcurrentDate().addDays(7);
TQString ref_ok = TQString(
"<!DOCTYPE TEST>\n"
@@ -1887,9 +1887,9 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime()
" </TRANSACTION>\n"
" </SCHEDULED_TX>\n"
"</SCHEDULE-CONTAINER>\n"
- ).arg(paymentInFuture.toString(Qt::ISODate))
- .arg(paymentInFuture.toString(Qt::ISODate))
- .arg(paymentInFuture.toString(Qt::ISODate));
+ ).tqarg(paymentInFuture.toString(Qt::ISODate))
+ .tqarg(paymentInFuture.toString(Qt::ISODate))
+ .tqarg(paymentInFuture.toString(Qt::ISODate));
TQDomDocument doc;
TQDomElement node;
@@ -1900,7 +1900,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime()
sch = MyMoneySchedule(node);
CPPUNIT_ASSERT(sch.isFinished() == true);
CPPUNIT_ASSERT(sch.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY);
- CPPUNIT_ASSERT(sch.paymentDates(TQDate::currentDate(), TQDate::currentDate().addDays(21)).count() == 0);
+ CPPUNIT_ASSERT(sch.paymentDates(TQDate::tqcurrentDate(), TQDate::tqcurrentDate().addDays(21)).count() == 0);
} catch (MyMoneyException *e) {
delete e;
CPPUNIT_FAIL("Unexpected exception");
diff --git a/kmymoney2/mymoney/mymoneystatement.cpp b/kmymoney2/mymoney/mymoneystatement.cpp
index 6e92d8b..14df720 100644
--- a/kmymoney2/mymoney/mymoneystatement.cpp
+++ b/kmymoney2/mymoney/mymoneystatement.cpp
@@ -27,7 +27,7 @@
#include <tqdom.h>
#include <tqstringlist.h>
#include <tqfile.h>
-#include <textstream.h>
+#include <tqtextstream.h>
// ----------------------------------------------------------------------------
// Project Includes
@@ -245,7 +245,7 @@ void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const TQString&
static unsigned filenum = 1;
TQString filename = _filename;
if ( filename.isEmpty() ) {
- filename = TQString("statement-%1%2.xml").arg((filenum<10)?"0":"").arg(filenum);
+ filename = TQString("statement-%1%2.xml").tqarg((filenum<10)?"0":"").tqarg(filenum);
filenum++;
}
diff --git a/kmymoney2/mymoney/mymoneytransaction.cpp b/kmymoney2/mymoney/mymoneytransaction.cpp
index a46bb79..79f4fd9 100644
--- a/kmymoney2/mymoney/mymoneytransaction.cpp
+++ b/kmymoney2/mymoney/mymoneytransaction.cpp
@@ -39,7 +39,7 @@ MyMoneyTransaction::MyMoneyTransaction(const TQString id, const MyMoneyTransacti
*this = transaction;
m_id = id;
if(m_entryDate == TQDate())
- m_entryDate = TQDate::currentDate();
+ m_entryDate = TQDate::tqcurrentDate();
TQValueList<MyMoneySplit>::Iterator it;
for(it = m_splits.begin(); it != m_splits.end(); ++it) {
@@ -188,7 +188,7 @@ void MyMoneyTransaction::modifySplit(MyMoneySplit& split)
return;
}
}
- throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").arg(split.id()));
+ throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").tqarg(split.id()));
}
void MyMoneyTransaction::removeSplit(const MyMoneySplit& split)
@@ -202,7 +202,7 @@ void MyMoneyTransaction::removeSplit(const MyMoneySplit& split)
}
}
if(it == m_splits.end())
- throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").arg(split.id()));
+ throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").tqarg(split.id()));
}
void MyMoneyTransaction::removeSplits(void)
@@ -219,7 +219,7 @@ const MyMoneySplit& MyMoneyTransaction::splitByPayee(const TQString& payeeId) co
if((*it).payeeId() == payeeId)
return *it;
}
- throw new MYMONEYEXCEPTION(TQString("Split not found for payee '%1'").arg(TQString(payeeId)));
+ throw new MYMONEYEXCEPTION(TQString("Split not found for payee '%1'").tqarg(TQString(payeeId)));
}
const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQString& accountId, const bool match) const
@@ -232,7 +232,7 @@ const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQString& accountId
if(match == false && (*it).accountId() != accountId)
return *it;
}
- throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%2").arg(match?"":"!").arg(TQString(accountId)));
+ throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%2").tqarg(match?"":"!").tqarg(TQString(accountId)));
}
const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQStringList& accountIds, const bool match) const
@@ -245,7 +245,7 @@ const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQStringList& accou
if(match == false && !accountIds.contains((*it).accountId()))
return *it;
}
- throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%1...%2").arg(match?"":"!").arg(accountIds.front(),accountIds.back()));
+ throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%1...%2").tqarg(match?"":"!").tqarg(accountIds.front(),accountIds.back()));
}
const MyMoneySplit& MyMoneyTransaction::splitById(const TQString& splitId) const
@@ -256,7 +256,7 @@ const MyMoneySplit& MyMoneyTransaction::splitById(const TQString& splitId) const
if((*it).id() == splitId)
return *it;
}
- throw new MYMONEYEXCEPTION(TQString("Split not found for id '%1'").arg(TQString(splitId)));
+ throw new MYMONEYEXCEPTION(TQString("Split not found for id '%1'").tqarg(TQString(splitId)));
}
const TQString MyMoneyTransaction::nextSplitID()
@@ -334,7 +334,7 @@ unsigned long MyMoneyTransaction::hash(const TQString& txt, unsigned long h)
unsigned long g;
for(unsigned i=0; i < txt.length(); ++i) {
- unsigned short uc = txt[i].unicode();
+ unsigned short uc = txt[i].tqunicode();
for(unsigned j = 0; j < 2; ++j) {
unsigned char c = uc & 0xff;
// if either the cell or the row of the Unicode char is 0, stop processing
@@ -467,7 +467,7 @@ TQString MyMoneyTransaction::accountSignature(bool includeSplitCount) const
rc += "-";
rc += it_a.key();
if(includeSplitCount)
- rc += TQString("*%1").arg(*it_a);
+ rc += TQString("*%1").tqarg(*it_a);
}
return rc;
}
diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.cpp b/kmymoney2/mymoney/mymoneytransactionfilter.cpp
index d80b8ac..7998051 100644
--- a/kmymoney2/mymoney/mymoneytransactionfilter.cpp
+++ b/kmymoney2/mymoney/mymoneytransactionfilter.cpp
@@ -711,9 +711,9 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
{
bool rc = true;
int yr, mon, day;
- yr = TQDate::currentDate().year();
- mon = TQDate::currentDate().month();
- day = TQDate::currentDate().day();
+ yr = TQDate::tqcurrentDate().year();
+ mon = TQDate::tqcurrentDate().month();
+ day = TQDate::tqcurrentDate().day();
TQDate tmp;
switch(id) {
@@ -723,7 +723,7 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
break;
case MyMoneyTransactionFilter::asOfToday:
start = TQDate();
- end = TQDate::currentDate();
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::currentMonth:
start = TQDate(yr,mon,1);
@@ -735,11 +735,11 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
break;
case MyMoneyTransactionFilter::monthToDate:
start = TQDate(yr,mon,1);
- end = TQDate::currentDate();
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::yearToDate:
start = TQDate(yr,1,1);
- end = TQDate::currentDate();
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::yearToMonth:
start = TQDate(yr,1,1);
@@ -754,56 +754,56 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
end = TQDate(yr,12,31).addYears(-1);
break;
case MyMoneyTransactionFilter::last7Days:
- start = TQDate::currentDate().addDays(-7);
- end = TQDate::currentDate();
+ start = TQDate::tqcurrentDate().addDays(-7);
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::last30Days:
- start = TQDate::currentDate().addDays(-30);
- end = TQDate::currentDate();
+ start = TQDate::tqcurrentDate().addDays(-30);
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::last3Months:
- start = TQDate::currentDate().addMonths(-3);
- end = TQDate::currentDate();
+ start = TQDate::tqcurrentDate().addMonths(-3);
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::last6Months:
- start = TQDate::currentDate().addMonths(-6);
- end = TQDate::currentDate();
+ start = TQDate::tqcurrentDate().addMonths(-6);
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::last11Months:
start = TQDate(yr,mon,1).addMonths(-12);
end = TQDate(yr,mon,1).addDays(-1);
break;
case MyMoneyTransactionFilter::last12Months:
- start = TQDate::currentDate().addMonths(-12);
- end = TQDate::currentDate();
+ start = TQDate::tqcurrentDate().addMonths(-12);
+ end = TQDate::tqcurrentDate();
break;
case MyMoneyTransactionFilter::next7Days:
- start = TQDate::currentDate();
- end = TQDate::currentDate().addDays(7);
+ start = TQDate::tqcurrentDate();
+ end = TQDate::tqcurrentDate().addDays(7);
break;
case MyMoneyTransactionFilter::next30Days:
- start = TQDate::currentDate();
- end = TQDate::currentDate().addDays(30);
+ start = TQDate::tqcurrentDate();
+ end = TQDate::tqcurrentDate().addDays(30);
break;
case MyMoneyTransactionFilter::next3Months:
- start = TQDate::currentDate();
- end = TQDate::currentDate().addMonths(3);
+ start = TQDate::tqcurrentDate();
+ end = TQDate::tqcurrentDate().addMonths(3);
break;
case MyMoneyTransactionFilter::next6Months:
- start = TQDate::currentDate();
- end = TQDate::currentDate().addMonths(6);
+ start = TQDate::tqcurrentDate();
+ end = TQDate::tqcurrentDate().addMonths(6);
break;
case MyMoneyTransactionFilter::next12Months:
- start = TQDate::currentDate();
- end = TQDate::currentDate().addMonths(12);
+ start = TQDate::tqcurrentDate();
+ end = TQDate::tqcurrentDate().addMonths(12);
break;
case MyMoneyTransactionFilter::userDefined:
start = TQDate();
end = TQDate();
break;
case MyMoneyTransactionFilter::last3ToNext3Months:
- start = TQDate::currentDate().addMonths(-3);
- end = TQDate::currentDate().addMonths(3);
+ start = TQDate::tqcurrentDate().addMonths(-3);
+ end = TQDate::tqcurrentDate().addMonths(3);
break;
case MyMoneyTransactionFilter::currentQuarter:
start = TQDate(yr, mon - ((mon-1) % 3), 1);
@@ -818,21 +818,21 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
end = start.addMonths(3).addDays(-1);
break;
case MyMoneyTransactionFilter::currentFiscalYear:
- start = TQDate(TQDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay);
- if(TQDate::currentDate() < start)
+ start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay);
+ if(TQDate::tqcurrentDate() < start)
start = start.addYears(-1);
end = start.addYears(1).addDays(-1);
break;
case MyMoneyTransactionFilter::lastFiscalYear:
- start = TQDate(TQDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay);
- if(TQDate::currentDate() < start)
+ start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay);
+ if(TQDate::tqcurrentDate() < start)
start = start.addYears(-1);
start = start.addYears(-1);
end = start.addYears(1).addDays(-1);
break;
case MyMoneyTransactionFilter::today:
- start = TQDate::currentDate();
- end = TQDate::currentDate();
+ start = TQDate::tqcurrentDate();
+ end = TQDate::tqcurrentDate();
break;
default:
qFatal("Unknown date identifier %d in MyMoneyTransactionFilter::translateDateRange()", id);
@@ -845,13 +845,13 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
void MyMoneyTransactionFilter::removeReference(const TQString& id)
{
if(m_accounts.find(id)) {
- qDebug("%s", (TQString("Remove account '%1' from report").arg(id)).data());
+ qDebug("%s", (TQString("Remove account '%1' from report").tqarg(id)).data());
m_accounts.remove(id);
} else if(m_categories.find(id)) {
- qDebug("%s", (TQString("Remove category '%1' from report").arg(id)).data());
+ qDebug("%s", (TQString("Remove category '%1' from report").tqarg(id)).data());
m_categories.remove(id);
} else if(m_payees.find(id)) {
- qDebug("%s", (TQString("Remove payee '%1' from report").arg(id)).data());
+ qDebug("%s", (TQString("Remove payee '%1' from report").tqarg(id)).data());
m_payees.remove(id);
}
}
diff --git a/kmymoney2/mymoney/mymoneytransactiontest.cpp b/kmymoney2/mymoney/mymoneytransactiontest.cpp
index b69ade8..155dfe0 100644
--- a/kmymoney2/mymoney/mymoneytransactiontest.cpp
+++ b/kmymoney2/mymoney/mymoneytransactiontest.cpp
@@ -49,7 +49,7 @@ void MyMoneyTransactionTest::testConstructor() {
MyMoneyTransaction a("ID", *m);
CPPUNIT_ASSERT(a.id() == "ID");
- CPPUNIT_ASSERT(a.entryDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(a.entryDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(a.memo() == "Memo");
CPPUNIT_ASSERT(a.postDate() == TQDate(1,2,3));
}
@@ -62,7 +62,7 @@ void MyMoneyTransactionTest::testCopyConstructor() {
MyMoneyTransaction n(a);
CPPUNIT_ASSERT(n.id() == "ID");
- CPPUNIT_ASSERT(n.entryDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(n.memo() == "Memo");
CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3));
CPPUNIT_ASSERT(n.value("Key") == "Value");
@@ -78,7 +78,7 @@ void MyMoneyTransactionTest::testAssignmentConstructor() {
n = a;
CPPUNIT_ASSERT(n.id() == "ID");
- CPPUNIT_ASSERT(n.entryDate() == TQDate::currentDate());
+ CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate());
CPPUNIT_ASSERT(n.memo() == "Memo");
CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3));
CPPUNIT_ASSERT(n.value("Key") == "Value");
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<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").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<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").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<MyMoneySchedule> 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 <MyMoneyStorageSql> 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<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").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<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) + ", ";
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