From eeae53f59df4d79d0399c2217a165ff2fab754db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 17 Mar 2022 09:54:21 +0100 Subject: Replace the use of the old API TQString::data(). The definition of -UTQT_NO_COMPAT 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/mymoneyaccount.cpp | 6 +++--- kmymoney2/mymoney/mymoneyfile.cpp | 16 ++++++++-------- kmymoney2/mymoney/mymoneyobjectcontainer.cpp | 2 +- kmymoney2/mymoney/mymoneyscheduled.cpp | 2 +- kmymoney2/mymoney/mymoneytransactionfilter.cpp | 6 +++--- kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp | 8 ++++---- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp | 8 ++++---- kmymoney2/mymoney/storage/mymoneystoragesql.cpp | 14 +++++++------- 8 files changed, 31 insertions(+), 31 deletions(-) (limited to 'kmymoney2/mymoney') diff --git a/kmymoney2/mymoney/mymoneyaccount.cpp b/kmymoney2/mymoney/mymoneyaccount.cpp index 3b48602..aaa4372 100644 --- a/kmymoney2/mymoney/mymoneyaccount.cpp +++ b/kmymoney2/mymoney/mymoneyaccount.cpp @@ -66,7 +66,7 @@ MyMoneyAccount::MyMoneyAccount(const TQDomElement& node) : setName(node.attribute("name")); - // tqDebug("Reading information for account %s", acc.name().data()); + // tqDebug(TQString("Reading information for account %1").arg(acc.name())); setParentAccountId(TQStringEmpty(node.attribute("parentaccount"))); setLastModified(stringToDate(TQStringEmpty(node.attribute("lastmodified")))); @@ -97,7 +97,7 @@ MyMoneyAccount::MyMoneyAccount(const TQDomElement& node) : if(bOK) { setAccountType(static_cast(type)); } else { - tqWarning("XMLREADER: Account %s had invalid or no account type information.", name().data()); + tqWarning(TQString("XMLREADER: Account %1 had invalid or no account type information.").arg(name())); } if(node.hasAttribute("openingbalance")) { @@ -109,7 +109,7 @@ MyMoneyAccount::MyMoneyAccount(const TQDomElement& node) : setDescription(node.attribute("description")); m_id = TQStringEmpty(node.attribute("id")); - // tqDebug("Account %s has id of %s, type of %d, parent is %s.", acc.name().data(), id.data(), type, acc.parentAccountId().data()); + // tqDebug(TQString("Account %1 has id of %2, type of %3, parent is %4.").arg(acc.name()).arg(id).arg(type).arg(acc.parentAccountId())); // Process any Sub-Account information found inside the account entry. m_accountList.clear(); diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp index 8091e91..95676cd 100644 --- a/kmymoney2/mymoney/mymoneyfile.cpp +++ b/kmymoney2/mymoney/mymoneyfile.cpp @@ -741,7 +741,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount(const MyMoneySecurity& s ft.commit(); } catch(MyMoneyException* e) { - tqDebug("Unable to create opening balance account for security %s", security.id().data()); + tqDebug(TQString("Unable to create opening balance account for security %1").arg(security.id())); delete e; } return acc; @@ -1101,10 +1101,10 @@ void MyMoneyFile::warningMissingRate(const TQString& fromId, const TQString& toI try { from = security(fromId); to = security(toId); - tqWarning("Missing price info for conversion from %s to %s", from.name().latin1(), to.name().latin1()); + tqWarning(TQString("Missing price info for conversion from %1 to %2").arg(from.name()).arg(to.name())); } catch(MyMoneyException *e) { - tqFatal("Missing security caught in MyMoneyFile::warningMissingRate(): %s(%ld) %s", e->file().data(), e->line(), e->what().data()); + tqFatal(TQString("Missing security caught in MyMoneyFile::warningMissingRate(): %1(%2) %3").arg(e->file()).arg(e->line()).arg(e->what())); delete e; } } @@ -1812,11 +1812,11 @@ TQString MyMoneyFile::createCategory(const MyMoneyAccount& base, const TQString& } catch (MyMoneyException *e) { - tqDebug("Unable to add account %s, %s, %s: %s", - categoryAccount.name().latin1(), - parent.name().latin1(), - categoryText.latin1(), - e->what().latin1()); + tqDebug(TQString("Unable to add account %1, %2, %3: %4"). + arg(categoryAccount.name()). + arg(parent.name()). + arg(categoryText). + arg(e->what())); delete e; } diff --git a/kmymoney2/mymoney/mymoneyobjectcontainer.cpp b/kmymoney2/mymoney/mymoneyobjectcontainer.cpp index 63f4d1c..601bbb5 100644 --- a/kmymoney2/mymoney/mymoneyobjectcontainer.cpp +++ b/kmymoney2/mymoney/mymoneyobjectcontainer.cpp @@ -194,7 +194,7 @@ void MyMoneyObjectContainer::refresh(const TQString& id) const MyMoneySchedule& s = m_storage->schedule(id); m_map[id] = new MyMoneySchedule(s); } else { - tqWarning("Ooops, should preload an unknown object with id '%s'", id.data()); + tqWarning(TQString("Ooops, should preload an unknown object with id '%1'").arg(id)); } return; } diff --git a/kmymoney2/mymoney/mymoneyscheduled.cpp b/kmymoney2/mymoney/mymoneyscheduled.cpp index 3891d6b..53e7d77 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.cpp +++ b/kmymoney2/mymoney/mymoneyscheduled.cpp @@ -623,7 +623,7 @@ MyMoneyAccount MyMoneySchedule::account(int cnt) const if(!cnt) return acc; } catch(MyMoneyException *e) { - tqWarning("Schedule '%s' references unknown account '%s'", id().data(), (*it).accountId().data()); + tqWarning(TQString("Schedule '%1' references unknown account '%2'").arg(id()).arg((*it).accountId())); delete e; return MyMoneyAccount(); } diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.cpp b/kmymoney2/mymoney/mymoneytransactionfilter.cpp index fa4fd91..76fc4cb 100644 --- a/kmymoney2/mymoney/mymoneytransactionfilter.cpp +++ b/kmymoney2/mymoney/mymoneytransactionfilter.cpp @@ -849,13 +849,13 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, void MyMoneyTransactionFilter::removeReference(const TQString& id) { if(m_accounts.find(id)) { - tqDebug("%s", (TQString("Remove account '%1' from report").arg(id)).data()); + tqDebug(TQString("Remove account '%1' from report").arg(id)); m_accounts.remove(id); } else if(m_categories.find(id)) { - tqDebug("%s", (TQString("Remove category '%1' from report").arg(id)).data()); + tqDebug(TQString("Remove category '%1' from report").arg(id)); m_categories.remove(id); } else if(m_payees.find(id)) { - tqDebug("%s", (TQString("Remove payee '%1' from report").arg(id)).data()); + tqDebug(TQString("Remove payee '%1' from report").arg(id)); m_payees.remove(id); } } diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp index 4386f63..98b6286 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp @@ -925,7 +925,7 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& MyMoneyAccount acc; TQMap accountList = m_sql->fetchAccounts(/*TQString(id)*/); //TQMap::const_iterator accpos = accountList.find(id); - if (date_ != TQDate()) tqDebug ("request balance for %s at %s", id.data(), TQString(date_.toString(Qt::ISODate)).latin1()); + if (date_ != TQDate()) tqDebug (TQString("request balance for %1 at %2").arg(id).arg(date_.toString(Qt::ISODate))); // if(!date_.isValid() && MyMoneyFile::instance()->account(id).accountType() != MyMoneyAccount::Stock) { // if(accountList.find(id) != accountList.end()) // return accountList[id].balance(); @@ -1224,7 +1224,7 @@ const TQValueList MyMoneyDatabaseMgr::scheduleList(const TQStri // tqDebug("scheduleList()"); for(pos = scheduleList.begin(); pos != scheduleList.end(); ++pos) { - // tqDebug(" '%s'", (*pos).id().data()); + // tqDebug(TQString(" '%1'").arg((*pos).id())); if(type != MyMoneySchedule::TYPE_ANY) { if(type != (*pos).type()) { @@ -1288,7 +1288,7 @@ const TQValueList MyMoneyDatabaseMgr::scheduleList(const TQStri */ } - // tqDebug("Adding '%s'", (*pos).name().latin1()); + // tqDebug(TQString("Adding '%1'").arg((*pos).name())); list << *pos; } return list; @@ -1334,7 +1334,7 @@ const TQValueList MyMoneyDatabaseMgr::scheduleListEx( int sched continue; } -// tqDebug("\tAdding '%s'", (*pos).name().latin1()); +// tqDebug(TQString("\tAdding '%1'").arg((*pos).name()); list << *pos; } diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp index 92db207..869e2e4 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp @@ -874,7 +874,7 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const TQString& id, const TQDate { MyMoneyMoney result(0); MyMoneyAccount acc; - // if (date != TQDate()) tqDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1()); + // if (date != TQDate()) tqDebug(TQString("request balance for %1 at %2").arg(id).arg(date.toString(Qt::ISODate))); if(!date.isValid() && account(id).accountType() != MyMoneyAccount::Stock) { if(m_accountList.find(id) != m_accountList.end()) return m_accountList[id].balance(); @@ -1252,7 +1252,7 @@ const TQValueList MyMoneySeqAccessMgr::scheduleList( // tqDebug("scheduleList()"); for(pos = m_scheduleList.begin(); pos != m_scheduleList.end(); ++pos) { - // tqDebug(" '%s'", qPrintable((*pos).id())); + // tqDebug(TQString(" '%1'").arg(qPrintable((*pos).id()))); if(type != MyMoneySchedule::TYPE_ANY) { if(type != (*pos).type()) { @@ -1309,7 +1309,7 @@ const TQValueList MyMoneySeqAccessMgr::scheduleList( continue; } - // tqDebug("Adding '%s'", (*pos).name().latin1()); + // tqDebug(TQString("Adding '%1'").arg((*pos).name())); list << *pos; } return list; @@ -1378,7 +1378,7 @@ const TQValueList MyMoneySeqAccessMgr::scheduleListEx(int sched continue; } -// tqDebug("\tAdding '%s'", (*pos).name().latin1()); +// tqDebug(TQString("\tAdding '%1'").arg((*pos).name())); list << *pos; } diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp index 5a9dc95..1b8e694 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp @@ -186,7 +186,7 @@ try { } break; default: - tqFatal("%s", TQString("%1 - unknown open mode %2").arg(__func__).arg(openMode).data()); + tqFatal(TQString("%1 - unknown open mode %2").arg(__func__).arg(openMode)); } if (rc != 0) return (rc); // bypass logon check if we are creating a database @@ -199,7 +199,7 @@ try { .arg(m_logonUser) .arg(m_logonAt.date().toString(Qt::ISODate)) .arg(m_logonAt.time().toString("hh.mm.ss")); - tqDebug("%s", m_error.data()); + tqDebug(m_error); close(false); rc = -1; } else { @@ -209,7 +209,7 @@ try { } return(rc); } catch (TQString& s) { - tqDebug("%s",s.data()); + tqDebug(s); return (1); } } @@ -925,7 +925,7 @@ bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) { // as value of this method. bool rc = true; if (callingFunction != m_commitUnitStack.top()) - tqDebug("%s", TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + tqDebug(TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top())); m_commitUnitStack.pop(); if (m_commitUnitStack.isEmpty()) { if (!commit()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "ending commit unit")); @@ -936,7 +936,7 @@ bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) { void MyMoneyStorageSql::cancelCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::cancelCommitUnit"); if (callingFunction != m_commitUnitStack.top()) - tqDebug("%s", TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + tqDebug(TQString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top())); if (m_commitUnitStack.isEmpty()) return; m_commitUnitStack.clear(); if (!rollback()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "cancelling commit unit")); @@ -2921,7 +2921,7 @@ const TQMap MyMoneyStorageSql::fetchTransactions ( int obc = whereClause.contains('('); int cbc = whereClause.contains(')'); if (cbc > obc) { - tqFatal("invalid where clause - %s", whereClause.latin1()); + tqFatal(TQString("invalid where clause - %1").arg(whereClause)); } while (cbc < obc) { whereClause.append(")"); @@ -3801,7 +3801,7 @@ TQString& MyMoneyStorageSql::buildError (const TQSqlQuery& q, const TQString& fu s += TQString ("\nQuery error No %1: %2").arg(e.number()).arg(e.text()); const_cast (this)->m_error = s; - tqDebug("%s", s.ascii()); + tqDebug(s); const_cast (this)->cancelCommitUnit(function); return (const_cast (this)->m_error); } -- cgit v1.2.1