From 5e6c401557744fe5f9765471605cc793939fee1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 17 Mar 2022 18:50:52 +0100 Subject: Added controlled conversions to char* instead of automatic ascii conversions. The definition of -UTQT_NO_ASCII_CAST is no longer needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp | 4 ++-- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp | 16 ++++++++-------- kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp | 2 +- kmymoney2/mymoney/storage/mymoneystoragesql.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'kmymoney2/mymoney/storage') 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& 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& 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& 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& 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& 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& 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); } -- cgit v1.2.1