summaryrefslogtreecommitdiffstats
path: root/kmymoney2/converter/mymoneygncreader.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:31:01 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:31:01 -0600
commit252fce5a2a5384702fbcc1c9987284d7bd2e6943 (patch)
treed5768ff1e9065f29bec60c94d31880b38b4e82f2 /kmymoney2/converter/mymoneygncreader.cpp
parent69ef6c4beaa37474a2170d0bfe842de647f53102 (diff)
downloadkmymoney-252fce5a2a5384702fbcc1c9987284d7bd2e6943.tar.gz
kmymoney-252fce5a2a5384702fbcc1c9987284d7bd2e6943.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'kmymoney2/converter/mymoneygncreader.cpp')
-rw-r--r--kmymoney2/converter/mymoneygncreader.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/kmymoney2/converter/mymoneygncreader.cpp b/kmymoney2/converter/mymoneygncreader.cpp
index bfd6911..7fe9a28 100644
--- a/kmymoney2/converter/mymoneygncreader.cpp
+++ b/kmymoney2/converter/mymoneygncreader.cpp
@@ -58,7 +58,7 @@ email : mte@users.sourceforge.net
#define PASS } catch (MyMoneyException *e) { throw e; }
#else
#include "mymoneymoney.h"
- #include <tqtextedit.h>
+ #include <textedit.h>
#define i18n TQObject::tr
#define TRY
#define CATCH
@@ -117,7 +117,7 @@ void GncObject::checkVersion (const TQString& elName, const TQXmlAttributes& elA
if (map.contains(elName)) { // if it's not in the map, there's nothing to check
if (!map[elName].contains(elAttrs.value("version"))) {
TQString em = i18n("%1: Sorry. This importer cannot handle version %2 of element %3")
- .tqarg(__func__).tqarg(elAttrs.value("version")).tqarg(elName);
+ .arg(__func__).arg(elAttrs.value("version")).arg(elName);
throw new MYMONEYEXCEPTION (em);
}
}
@@ -190,11 +190,11 @@ TQString GncObject::hide (TQString data, unsigned int anonClass) {
switch (anonClass) {
case ASIS: break; // this is not personal data
case SUPPRESS: result = ""; break; // this is personal and is not essential
- case NXTACC: result = i18n("Account%1").tqarg(++nextAccount, -6); break; // generate account name
+ case NXTACC: result = i18n("Account%1").arg(++nextAccount, -6); break; // generate account name
case NXTEQU: // generate/return an equity name
it = anonStocks.find (data);
if (it == anonStocks.end()) {
- result = i18n("Stock%1").tqarg(++nextEquity, -6);
+ result = i18n("Stock%1").arg(++nextEquity, -6);
anonStocks.insert (data, result);
} else {
result = (*it);
@@ -203,13 +203,13 @@ TQString GncObject::hide (TQString data, unsigned int anonClass) {
case NXTPAY: // genearet/return a payee name
it = anonPayees.find (data);
if (it == anonPayees.end()) {
- result = i18n("Payee%1").tqarg(++nextPayee, -6);
+ result = i18n("Payee%1").arg(++nextPayee, -6);
anonPayees.insert (data, result);
} else {
result = (*it);
}
break;
- case NXTSCHD: result = i18n("Schedule%1").tqarg(++nextSched, -6); break; // generate a schedule name
+ case NXTSCHD: result = i18n("Schedule%1").arg(++nextSched, -6); break; // generate a schedule name
case MONEY1:
in = MyMoneyMoney(data);
if (data == "-1/0") in = MyMoneyMoney (0); // spurious gnucash data - causes a crash sometimes
@@ -934,7 +934,7 @@ bool XmlReader::startElement (const TQString&, const TQString&, const TQString&
} catch (MyMoneyException *e) {
#ifndef _GNCFILEANON
// we can't pass on exceptions here coz the XML reader won't catch them and we just abort
- KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE);
+ KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE);
qFatal ("%s", e->what().latin1());
#else
qFatal ("%s", e->latin1());
@@ -969,7 +969,7 @@ bool XmlReader::endElement( const TQString&, const TQString&, const TQString&elN
} catch (MyMoneyException *e) {
#ifndef _GNCFILEANON
// we can't pass on exceptions here coz the XML reader won't catch them and we just abort
- KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE);
+ KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE);
qFatal ("%s", e->what().latin1());
#else
qFatal ("%s", e->latin1());
@@ -1059,7 +1059,7 @@ void MyMoneyGncReader::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage)
terminate (); // do all the wind-up things
ft.commit();
} catch (MyMoneyException *e) {
- KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE);
+ KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE);
qFatal ("%s", e->what().latin1());
} // end catch
signalProgress (0, 1, i18n("Import complete")); // switch off progress bar
@@ -1121,7 +1121,7 @@ void MyMoneyGncReader::setFileHideFactor () {
i18n ("Each monetary value on your file will be multiplied by a random number between 0.01 and 1.99\n"
"with a different value used for each transaction. In addition, to further disguise the true\n"
"values, you may enter a number between %1 and %2 which will be applied to all values.\n"
- "These numbers will not be stored in the file.").tqarg(MINFILEHIDEF).tqarg(MAXFILEHIDEF),
+ "These numbers will not be stored in the file.").arg(MINFILEHIDEF).arg(MAXFILEHIDEF),
(1.0 + (int)(1000.0 * rand() / (RAND_MAX + 1.0))) / 100.0,
MINFILEHIDEF, MAXFILEHIDEF, 2);
}
@@ -1192,10 +1192,10 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
acc.setDescription(gac->desc());
- TQDate tqcurrentDate = TQDate::tqcurrentDate();
- acc.setOpeningDate(tqcurrentDate);
- acc.setLastModified(tqcurrentDate);
- acc.setLastReconciliationDate(tqcurrentDate);
+ TQDate currentDate = TQDate::currentDate();
+ acc.setOpeningDate(currentDate);
+ acc.setLastModified(currentDate);
+ acc.setLastReconciliationDate(currentDate);
if (gac->commodity()->isCurrency()) {
acc.setCurrencyId (gac->commodity()->id().utf8());
m_currencyCount[gac->commodity()->id()]++;
@@ -1248,7 +1248,7 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
acc.setAccountType(MyMoneyAccount::MoneyMarket);
} else { // we have here an account type we can't currently handle
TQString em =
- i18n("Current importer does not recognize GnuCash account type %1").tqarg(gac->type());
+ i18n("Current importer does not recognize GnuCash account type %1").arg(gac->type());
throw new MYMONEYEXCEPTION (em);
}
// if no parent account is present, assign to one of our standard accounts
@@ -1406,7 +1406,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
// payee id
split.setPayeeId (m_txPayeeId.utf8());
// reconciled state and date
- switch (gsp->recon().tqat(0).latin1()) {
+ switch (gsp->recon().at(0).latin1()) {
case 'n':
split.setReconcileFlag(MyMoneySplit::NotReconciled); break;
case 'c':
@@ -1717,7 +1717,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
MyMoneyTransaction tx;
m_suspectSchedule = false;
TQDate startDate, nextDate, lastDate, endDate; // for date calculations
- TQDate today = TQDate::tqcurrentDate();
+ TQDate today = TQDate::currentDate();
int numOccurs, remOccurs;
if (m_scheduleCount == 0) signalProgress (0, m_gncScheduleCount, i18n("Loading schedules..."));
@@ -1732,7 +1732,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
++itt;
}
if (itt == 0) {
- throw new MYMONEYEXCEPTION (i18n("Can't find template transaction for schedule %1").tqarg(sc.name()));
+ throw new MYMONEYEXCEPTION (i18n("Can't find template transaction for schedule %1").arg(sc.name()));
} else {
tx = convertTemplateTransaction (sc.name(), *itt);
}
@@ -1783,8 +1783,8 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
unknownOccurs = true;
} else {
const GncRecurrence *gre = gsc->m_vpRecurrence.first();
- //qDebug (TQString("Sched %1, pt %2, mu %3, sd %4").tqarg(gsc->name()).tqarg(gre->periodType())
- // .tqarg(gre->mult()).tqarg(gre->startDate().toString(Qt::ISODate)));
+ //qDebug (TQString("Sched %1, pt %2, mu %3, sd %4").arg(gsc->name()).arg(gre->periodType())
+ // .arg(gre->mult()).arg(gre->startDate().toString(Qt::ISODate)));
frequency = gre->getFrequency();
schedEnabled = gsc->enabled();
}
@@ -1853,9 +1853,9 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
sc.setPaymentType((MyMoneySchedule::paymentTypeE)MyMoneySchedule::STYPE_OTHER);
sc.setFixed (!m_suspectSchedule); // if any probs were found, set it as variable so user will always be prompted
// we don't currently have a 'disable' option, but just make sure auto-enter is off if not enabled
- //qDebug(TQString("%1 and %2").tqarg(gsc->autoCreate()).tqarg(schedEnabled));
+ //qDebug(TQString("%1 and %2").arg(gsc->autoCreate()).arg(schedEnabled));
sc.setAutoEnter ((gsc->autoCreate() == "y") && (schedEnabled == "y"));
- //qDebug(TQString("autoEnter set to %1").tqarg(sc.autoEnter()));
+ //qDebug(TQString("autoEnter set to %1").arg(sc.autoEnter()));
// type
TQString actionType = tx.splits().first().action();
if (actionType == MyMoneySplit::ActionDeposit) {
@@ -1971,7 +1971,7 @@ void MyMoneyGncReader::terminate () {
since for Yes, the id is 3 and the index is 0, whereas the No button will return 4 or 1. So we test for either Yes case */
/* and now it seems to have changed again, returning 259 for a Yes??? so use KMessagebox */
TQString question = i18n("Your main currency seems to be %1 (%2); do you want to set this as your base currency?")
- .tqarg(mainCurrency).tqarg(m_storage->currency(mainCurrency.utf8()).name());
+ .arg(mainCurrency).arg(m_storage->currency(mainCurrency.utf8()).name());
if(KMessageBox::questionYesNo(0, question, PACKAGE) == KMessageBox::Yes) {
m_storage->setValue ("kmm-baseCurrency", mainCurrency);
}
@@ -2015,7 +2015,7 @@ void MyMoneyGncReader::terminate () {
for (i = 0; i < m_suspectList.count(); i++) {
MyMoneySchedule sc = m_storage->schedule(m_suspectList[i]);
KEditScheduleDlg *s;
- switch(KMessageBox::warningYesNo(0, i18n("Problems were encountered in converting schedule '%1'.\nDo you want to review or edit it now?").tqarg(sc.name()), PACKAGE)) {
+ switch(KMessageBox::warningYesNo(0, i18n("Problems were encountered in converting schedule '%1'.\nDo you want to review or edit it now?").arg(sc.name()), PACKAGE)) {
case KMessageBox::Yes:
s = new KEditScheduleDlg (sc);
// FIXME: connect newCategory to something useful, so that we
@@ -2077,7 +2077,7 @@ TQString MyMoneyGncReader::buildReportSection (const TQString& source) {
GncMessageArgs *m = m_messageList.at(i);
if (m->source == source) {
if (gncdebug) qDebug("%s", TQString("build text source %1, code %2, argcount %3")
- .tqarg(m->source).tqarg(m->code).tqarg(m->args.count()).data());
+ .arg(m->source).arg(m->code).arg(m->args.count()).data());
TQString ss = GncMessages::text (m->source, m->code);
// add variable args. the .arg function seems always to replace the
// lowest numbered placeholder it finds, so translating messages
@@ -2139,7 +2139,7 @@ TQString MyMoneyGncReader::createOrphanAccount (const TQString& gncName) {
acc.setName ("orphan_" + gncName);
acc.setDescription (i18n("Orphan created from unknown gnucash account"));
- TQDate today = TQDate::tqcurrentDate();
+ TQDate today = TQDate::currentDate();
acc.setOpeningDate (today);
acc.setLastModified (today);
@@ -2267,7 +2267,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
bool ok = false;
while (!ok) { // keep going till we have a valid investment parent
TQString invAccName = TQInputDialog::getItem (
- PACKAGE, i18n("Select parent investment account or enter new name. Stock %1").tqarg(stockAcc.name ()),
+ PACKAGE, i18n("Select parent investment account or enter new name. Stock %1").arg(stockAcc.name ()),
accList, lastSelected, true, &ok);
if (ok) {
lastSelected = accList.findIndex (invAccName); // preserve selection for next time
@@ -2290,7 +2290,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
// this code is probably not going to be implemented coz we can't change account types (??)
#if 0
TQMessageBox mb (PACKAGE,
- i18n ("%1 is not an Investment Account. Do you wish to make it one?").tqarg(invAcc.name()),
+ i18n ("%1 is not an Investment Account. Do you wish to make it one?").arg(invAcc.name()),
TQMessageBox::Question,
TQMessageBox::Yes | TQMessageBox::Default,
TQMessageBox::No | TQMessageBox::Escape,
@@ -2305,7 +2305,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
break;
}
#endif
- switch(KMessageBox::questionYesNo(0, i18n ("%1 is not an Investment Account. Do you wish to make it one?").tqarg(invAcc.name(), PACKAGE))) {
+ switch(KMessageBox::questionYesNo(0, i18n ("%1 is not an Investment Account. Do you wish to make it one?").arg(invAcc.name(), PACKAGE))) {
case KMessageBox::Yes:
// convert it - but what if it has splits???
qFatal ("Not yet implemented");
@@ -2395,7 +2395,7 @@ void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int c
const unsigned int argCount = GncMessages::argCount (source, code);
if ((gncdebug) && (argCount != argList.count()))
qDebug("%s", TQString("MyMoneyGncReader::postMessage debug: Message %1, code %2, requires %3 arguments, got %4")
- .tqarg(source).tqarg(code).tqarg(argCount).tqarg(argList.count()).data());
+ .arg(source).arg(code).arg(argCount).arg(argList.count()).data());
// store the arguments
for (i = 0; i < argCount; i++) {
if (i > argList.count()) m->args.append(TQString());