summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-03-17 18:50:52 +0100
committerSlávek Banko <slavek.banko@axis.cz>2022-03-18 12:45:32 +0100
commit5e6c401557744fe5f9765471605cc793939fee1f (patch)
treefa1c9abe564d03a362378f8a7a6304e27baf9c33 /kmymoney2/mymoney
parenteeae53f59df4d79d0399c2217a165ff2fab754db (diff)
downloadkmymoney-5e6c401557744fe5f9765471605cc793939fee1f.tar.gz
kmymoney-5e6c401557744fe5f9765471605cc793939fee1f.zip
Added controlled conversions to char* instead of automatic ascii conversions.
The definition of -UTQT_NO_ASCII_CAST is no longer needed. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kmymoney2/mymoney')
-rw-r--r--kmymoney2/mymoney/mymoneyaccount.cpp2
-rw-r--r--kmymoney2/mymoney/mymoneyfile.cpp4
-rw-r--r--kmymoney2/mymoney/mymoneymoney.cpp2
-rw-r--r--kmymoney2/mymoney/mymoneyscheduletest.cpp40
-rw-r--r--kmymoney2/mymoney/mymoneystatement.cpp2
-rw-r--r--kmymoney2/mymoney/mymoneytransactionfilter.cpp38
-rw-r--r--kmymoney2/mymoney/mymoneyutils.cpp2
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp4
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp16
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp2
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.cpp4
11 files changed, 58 insertions, 58 deletions
diff --git a/kmymoney2/mymoney/mymoneyaccount.cpp b/kmymoney2/mymoney/mymoneyaccount.cpp
index aaa4372..c35c257 100644
--- a/kmymoney2/mymoney/mymoneyaccount.cpp
+++ b/kmymoney2/mymoney/mymoneyaccount.cpp
@@ -305,7 +305,7 @@ const MyMoneyMoney MyMoneyAccountLoan::interestRate(const TQDate& date) const
for(it = pairs().begin(); it != pairs().end(); ++it) {
if(regExp.search(it.key()) > -1) {
- if(qstrcmp(it.key(),key) <= 0)
+ if(it.key() <= key)
val = *it;
else
break;
diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp
index 95676cd..8ac6bf9 100644
--- a/kmymoney2/mymoney/mymoneyfile.cpp
+++ b/kmymoney2/mymoney/mymoneyfile.cpp
@@ -759,7 +759,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").arg(i18n(MyMoneyFile::OpeningBalancesPrefix.utf8())));
TQValueList<MyMoneyAccount> accounts;
TQValueList<MyMoneyAccount>::Iterator it;
@@ -787,7 +787,7 @@ const MyMoneyAccount MyMoneyFile::createOpeningBalanceAccount(const MyMoneySecur
checkTransaction(__PRETTY_FUNCTION__);
MyMoneyAccount acc;
- TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix));
+ TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix.utf8()));
if(security.id() != baseCurrency().id()) {
name += TQString(" (%1)").arg(security.id());
}
diff --git a/kmymoney2/mymoney/mymoneymoney.cpp b/kmymoney2/mymoney/mymoneymoney.cpp
index ec10a0e..b5d8f6d 100644
--- a/kmymoney2/mymoney/mymoneymoney.cpp
+++ b/kmymoney2/mymoney/mymoneymoney.cpp
@@ -185,7 +185,7 @@ MyMoneyMoney::MyMoneyMoney(const TQString& pszAmount)
}
// tqDebug("4: '%s'", res.data());
if(res.length() > 0)
- m_num = atoll( res );
+ m_num = res.toLongLong();
if(isNegative)
m_num = -m_num;
diff --git a/kmymoney2/mymoney/mymoneyscheduletest.cpp b/kmymoney2/mymoney/mymoneyscheduletest.cpp
index fb6d542..d7a3b07 100644
--- a/kmymoney2/mymoney/mymoneyscheduletest.cpp
+++ b/kmymoney2/mymoney/mymoneyscheduletest.cpp
@@ -1372,26 +1372,26 @@ void MyMoneyScheduleTest::testStringToOccurence()
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Yearly")) == MyMoneySchedule::OCCUR_YEARLY );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every other year")) == MyMoneySchedule::OCCUR_EVERYOTHERYEAR );
// test occurence == stringToOccurence(i18n(occurenceToString(occurence)))
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_ONCE == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_DAILY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_WEEKLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERWEEK == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_FORTNIGHTLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_FORTNIGHTLY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYHALFMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_MONTHLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))) );
- CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERYEAR == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR))) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_ONCE == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_DAILY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_WEEKLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERWEEK == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_FORTNIGHTLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_FORTNIGHTLY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYHALFMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_MONTHLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY).utf8())) );
+ CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERYEAR == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR).utf8())) );
}
void MyMoneyScheduleTest::testEventsPerYear()
{
diff --git a/kmymoney2/mymoney/mymoneystatement.cpp b/kmymoney2/mymoney/mymoneystatement.cpp
index 89a374b..639bcd8 100644
--- a/kmymoney2/mymoney/mymoneystatement.cpp
+++ b/kmymoney2/mymoney/mymoneystatement.cpp
@@ -143,7 +143,7 @@ bool MyMoneyStatement::read(const TQDomElement& _e)
m_dateEnd = TQDate::fromString(_e.attribute("enddate"),Qt::ISODate);
m_closingBalance = MyMoneyMoney(_e.attribute("closingbalance"));
m_accountId = _e.attribute("accountid");
- m_skipCategoryMatching = _e.attribute("skipCategoryMatching");
+ m_skipCategoryMatching = !(_e.attribute("skipCategoryMatching").isEmpty());
int i = kAccountTypeTxt.findIndex(_e.attribute("type",kAccountTypeTxt[1]));
if ( i != -1 )
diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.cpp b/kmymoney2/mymoney/mymoneytransactionfilter.cpp
index 76fc4cb..3382e0f 100644
--- a/kmymoney2/mymoney/mymoneytransactionfilter.cpp
+++ b/kmymoney2/mymoney/mymoneytransactionfilter.cpp
@@ -99,7 +99,7 @@ void MyMoneyTransactionFilter::addAccount(const TQStringList& ids)
void MyMoneyTransactionFilter::addAccount(const TQString& id)
{
if(!m_accounts.isEmpty() && !id.isEmpty()) {
- if(m_accounts.find(id) != 0)
+ if(m_accounts.find(id.utf8()) != 0)
return;
}
if(m_accounts.count() >= m_accounts.size()*2) {
@@ -107,7 +107,7 @@ void MyMoneyTransactionFilter::addAccount(const TQString& id)
}
m_filterSet.singleFilter.accountFilter = 1;
if(!id.isEmpty())
- m_accounts.insert(id, "");
+ m_accounts.insert(id.utf8(), "");
}
void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
@@ -122,7 +122,7 @@ void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
void MyMoneyTransactionFilter::addCategory(const TQString& id)
{
if(!m_categories.isEmpty() && !id.isEmpty()) {
- if(m_categories.find(id) != 0)
+ if(m_categories.find(id.utf8()) != 0)
return;
}
if(m_categories.count() >= m_categories.size()*2) {
@@ -130,7 +130,7 @@ void MyMoneyTransactionFilter::addCategory(const TQString& id)
}
m_filterSet.singleFilter.categoryFilter = 1;
if(!id.isEmpty())
- m_categories.insert(id, "");
+ m_categories.insert(id.utf8(), "");
}
void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to)
@@ -157,7 +157,7 @@ void MyMoneyTransactionFilter::setAmountFilter(const MyMoneyMoney& from, const M
void MyMoneyTransactionFilter::addPayee(const TQString& id)
{
if(!m_payees.isEmpty() && !id.isEmpty()) {
- if(m_payees.find(id) != 0)
+ if(m_payees.find(id.utf8()) != 0)
return;
}
if(m_payees.count() >= m_payees.size()*2) {
@@ -165,7 +165,7 @@ void MyMoneyTransactionFilter::addPayee(const TQString& id)
}
m_filterSet.singleFilter.payeeFilter = 1;
if(!id.isEmpty())
- m_payees.insert(id, "");
+ m_payees.insert(id.utf8(), "");
}
void MyMoneyTransactionFilter::addType(const int type)
@@ -336,7 +336,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
// check if the split references one of the categories in the list
if(m_filterSet.singleFilter.categoryFilter) {
if(m_categories.count() > 0) {
- if(m_categories.find(sp->accountId())) {
+ if(m_categories.find(sp->accountId().utf8())) {
categoryMatched = true;
removeSplit = 0;
}
@@ -351,7 +351,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
// check if the split references one of the accounts in the list
if(m_filterSet.singleFilter.accountFilter) {
if(m_accounts.count() > 0) {
- if(m_accounts.find(sp->accountId())) {
+ if(m_accounts.find(sp->accountId().utf8())) {
accountMatched = true;
removeSplit = 0;
}
@@ -365,7 +365,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
} else {
if(m_filterSet.singleFilter.accountFilter) {
if(m_accounts.count() > 0) {
- if(m_accounts.find(sp->accountId())) {
+ if(m_accounts.find(sp->accountId().utf8())) {
accountMatched = true;
removeSplit = 0;
}
@@ -424,7 +424,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
// check the payee list
if(!removeSplit && m_filterSet.singleFilter.payeeFilter) {
if(m_payees.count() > 0) {
- if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId()))
+ if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId().utf8()))
removeSplit = sp;
} else if(!sp->payeeId().isEmpty())
removeSplit = sp;
@@ -548,17 +548,17 @@ MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransac
bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const
{
- return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat );
+ return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat.utf8() );
}
bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const
{
- return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc );
+ return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc.utf8() );
}
bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const
{
- return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye );
+ return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye.utf8() );
}
bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const
@@ -848,14 +848,14 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
void MyMoneyTransactionFilter::removeReference(const TQString& id)
{
- if(m_accounts.find(id)) {
+ if(m_accounts.find(id.utf8())) {
tqDebug(TQString("Remove account '%1' from report").arg(id));
- m_accounts.remove(id);
- } else if(m_categories.find(id)) {
+ m_accounts.remove(id.utf8());
+ } else if(m_categories.find(id.utf8())) {
tqDebug(TQString("Remove category '%1' from report").arg(id));
- m_categories.remove(id);
- } else if(m_payees.find(id)) {
+ m_categories.remove(id.utf8());
+ } else if(m_payees.find(id.utf8())) {
tqDebug(TQString("Remove payee '%1' from report").arg(id));
- m_payees.remove(id);
+ m_payees.remove(id.utf8());
}
}
diff --git a/kmymoney2/mymoney/mymoneyutils.cpp b/kmymoney2/mymoney/mymoneyutils.cpp
index 49d5cac..93700af 100644
--- a/kmymoney2/mymoney/mymoneyutils.cpp
+++ b/kmymoney2/mymoney/mymoneyutils.cpp
@@ -337,7 +337,7 @@ unsigned long extractId(const TQString& txt)
pos = txt.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- rc = atol(txt.mid(pos));
+ rc = txt.mid(pos).toLong();
}
return rc;
}
diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp
index 08403f2..2c8307c 100644
--- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp
+++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp
@@ -566,7 +566,7 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() {
CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2);
CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id());
} catch (MyMoneyException *e) {
- std::cout << std::endl << e->what() << std::endl;
+ std::cout << std::endl << e->what().local8Bit() << std::endl;
delete e;
CPPUNIT_FAIL("Unexpected exception");
}
@@ -763,7 +763,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() {
CPPUNIT_ASSERT(testBudget.budgetStart() == newBudget.budgetStart());
CPPUNIT_ASSERT(testBudget.name() == newBudget.name());
} catch (TQString& s) {
- std::cout << "Error in testCopyBudget(): " << s << std::endl;
+ std::cout << "Error in testCopyBudget(): " << s.local8Bit() << std::endl;
CPPUNIT_ASSERT(false);
}
}
diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
index 869e2e4..f1420dc 100644
--- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
+++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
@@ -1025,7 +1025,7 @@ void MyMoneySeqAccessMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& ma
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextAccountID = atol(lastId.mid(pos));
+ m_nextAccountID = lastId.mid(pos).toLong();
}
}
@@ -1048,7 +1048,7 @@ void MyMoneySeqAccessMgr::loadTransactions(const TQMap<TQString, MyMoneyTransact
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextTransactionID = atol(lastId.mid(pos));
+ m_nextTransactionID = lastId.mid(pos).toLong();
}
}
@@ -1066,7 +1066,7 @@ void MyMoneySeqAccessMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitut
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextInstitutionID = atol(lastId.mid(pos));
+ m_nextInstitutionID = lastId.mid(pos).toLong();
}
}
@@ -1087,7 +1087,7 @@ void MyMoneySeqAccessMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& map)
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextPayeeID = atol(lastId.mid(pos));
+ m_nextPayeeID = lastId.mid(pos).toLong();
}
}
@@ -1105,7 +1105,7 @@ void MyMoneySeqAccessMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>&
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextSecurityID = atol(lastId.mid(pos));
+ m_nextSecurityID = lastId.mid(pos).toLong();
}
}
@@ -1329,7 +1329,7 @@ void MyMoneySeqAccessMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>&
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextScheduleID = atol(lastId.mid(pos));
+ m_nextScheduleID = lastId.mid(pos).toLong();
}
}
@@ -1531,7 +1531,7 @@ void MyMoneySeqAccessMgr::loadReports(const TQMap<TQString, MyMoneyReport>& map)
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextReportID = atol(lastId.mid(pos));
+ m_nextReportID = lastId.mid(pos).toLong();
}
}
@@ -1605,7 +1605,7 @@ void MyMoneySeqAccessMgr::loadBudgets(const TQMap<TQString, MyMoneyBudget>& map)
int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
- m_nextBudgetID = atol(lastId.mid(pos));
+ m_nextBudgetID = lastId.mid(pos).toLong();
}
}
diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp
index c2f48cf..99f517e 100644
--- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp
+++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp
@@ -486,7 +486,7 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() {
CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2);
CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id());
} catch (MyMoneyException *e) {
- std::cout << std::endl << e->what() << std::endl;
+ std::cout << std::endl << e->what().local8Bit() << std::endl;
delete e;
CPPUNIT_FAIL("Unexpected exception");
}
diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
index 1b8e694..e5914bb 100644
--- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
+++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
@@ -64,10 +64,10 @@ MyMoneySqlQuery::MyMoneySqlQuery (MyMoneyStorageSql* db)
}
bool MyMoneySqlQuery::exec () {
- TRACE(TQString("start sql - %1").arg(lastQuery()));
+ TRACE(TQString("start sql - %1").arg(lastQuery()).local8Bit());
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()));
+ TRACE(msg.arg(TQSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected()).local8Bit());
//DBG (TQString("%1\n***Query returned %2, row count %3").arg(TQSqlQuery::executedQuery()).arg(rc).arg(size()));
return (rc);
}