summaryrefslogtreecommitdiffstats
path: root/kmymoney2/converter/mymoneygncreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/converter/mymoneygncreader.cpp')
-rw-r--r--kmymoney2/converter/mymoneygncreader.cpp550
1 files changed, 275 insertions, 275 deletions
diff --git a/kmymoney2/converter/mymoneygncreader.cpp b/kmymoney2/converter/mymoneygncreader.cpp
index 40933e3..79f6e89 100644
--- a/kmymoney2/converter/mymoneygncreader.cpp
+++ b/kmymoney2/converter/mymoneygncreader.cpp
@@ -22,12 +22,12 @@ email : mte@users.sourceforge.net
// ----------------------------------------------------------------------------
// QT Includes
-#include <qfile.h>
-#include <qmap.h>
-#include <qobject.h>
-#include <qfiledialog.h>
-#include <qinputdialog.h>
-#include <qdatetime.h>
+#include <tqfile.h>
+#include <tqmap.h>
+#include <tqobject.h>
+#include <tqfiledialog.h>
+#include <tqinputdialog.h>
+#include <tqdatetime.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -58,13 +58,13 @@ email : mte@users.sourceforge.net
#define PASS } catch (MyMoneyException *e) { throw e; }
#else
#include "mymoneymoney.h"
- #include <qtextedit.h>
- #define i18n QObject::tr
+ #include <tqtextedit.h>
+ #define i18n TQObject::tr
#define TRY
#define CATCH
#define PASS
- #define MYMONEYEXCEPTION QString
- #define MyMoneyException QString
+ #define MYMONEYEXCEPTION TQString
+ #define MyMoneyException TQString
#define PACKAGE "KMyMoney"
#endif // _GNCFILEANON
@@ -112,12 +112,12 @@ GncObject::GncObject () {
}
// Check that the current element is of a version we are coded for
-void GncObject::checkVersion (const QString& elName, const QXmlAttributes& elAttrs, const map_elementVersions& map) {
+void GncObject::checkVersion (const TQString& elName, const TQXmlAttributes& elAttrs, const map_elementVersions& map) {
TRY
- if (map.contains(elName)) { // if it's not in the map, there's nothing to check
- if (!map[elName].contains(elAttrs.value("version"))) {
- QString em = i18n("%1: Sorry. This importer cannot handle version %2 of element %3")
- .arg(__func__).arg(elAttrs.value("version")).arg(elName);
+ if (map.tqcontains(elName)) { // if it's not in the map, there's nothing to check
+ if (!map[elName].tqcontains(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);
throw new MYMONEYEXCEPTION (em);
}
}
@@ -126,7 +126,7 @@ void GncObject::checkVersion (const QString& elName, const QXmlAttributes& elAtt
}
// Check if this element is in the current object's sub element list
-GncObject *GncObject::isSubElement (const QString& elName, const QXmlAttributes& elAttrs) {
+GncObject *GncObject::isSubElement (const TQString& elName, const TQXmlAttributes& elAttrs) {
TRY
uint i;
GncObject *next = 0;
@@ -146,7 +146,7 @@ GncObject *GncObject::isSubElement (const QString& elName, const QXmlAttributes&
}
// Check if this element is in the current object's data element list
-bool GncObject::isDataElement (const QString &elName, const QXmlAttributes& elAttrs) {
+bool GncObject::isDataElement (const TQString &elName, const TQXmlAttributes& elAttrs) {
TRY
uint i;
for (i = 0; i < m_dataElementListCount; i++) {
@@ -162,7 +162,7 @@ bool GncObject::isDataElement (const QString &elName, const QXmlAttributes& elAt
}
// return the variable string, decoded if required
-QString GncObject::var (int i) const {
+TQString GncObject::var (int i) const {
return (pMain->m_decoder == 0
? *(m_v.at(i))
: pMain->m_decoder->toUnicode (*(m_v.at(i))));
@@ -173,7 +173,7 @@ void GncObject::adjustHideFactor () {
}
// data anonymizer
-QString GncObject::hide (QString data, unsigned int anonClass) {
+TQString GncObject::hide (TQString data, unsigned int anonClass) {
TRY
if (!pMain->bAnonymize) return (data); // no anonymizing required
// counters used to generate names for anonymizer
@@ -181,35 +181,35 @@ QString GncObject::hide (QString data, unsigned int anonClass) {
static int nextEquity;
static int nextPayee;
static int nextSched;
- static QMap<QString, QString> anonPayees; // to check for duplicate payee names
- static QMap<QString, QString> anonStocks; // for reference to equities
+ static TQMap<TQString, TQString> anonPayees; // to check for duplicate payee names
+ static TQMap<TQString, TQString> anonStocks; // for reference to equities
- QString result (data);
- QMap<QString, QString>::Iterator it;
+ TQString result (data);
+ TQMap<TQString, TQString>::Iterator it;
MyMoneyMoney in, mresult;
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").arg(++nextAccount, -6); break; // generate account name
+ case NXTACC: result = i18n("Account%1").tqarg(++nextAccount, -6); break; // generate account name
case NXTEQU: // generate/return an equity name
- it = anonStocks.find (data);
+ it = anonStocks.tqfind (data);
if (it == anonStocks.end()) {
- result = i18n("Stock%1").arg(++nextEquity, -6);
+ result = i18n("Stock%1").tqarg(++nextEquity, -6);
anonStocks.insert (data, result);
} else {
- result = (*it).data();
+ result = (*it);
}
break;
case NXTPAY: // genearet/return a payee name
- it = anonPayees.find (data);
+ it = anonPayees.tqfind (data);
if (it == anonPayees.end()) {
- result = i18n("Payee%1").arg(++nextPayee, -6);
+ result = i18n("Payee%1").tqarg(++nextPayee, -6);
anonPayees.insert (data, result);
} else {
- result = (*it).data();
+ result = (*it);
}
break;
- case NXTSCHD: result = i18n("Schedule%1").arg(++nextSched, -6); break; // generate a schedule name
+ case NXTSCHD: result = i18n("Schedule%1").tqarg(++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
@@ -240,7 +240,7 @@ void GncObject::debugDump () {
}
//*****************************************************************
GncFile::GncFile () {
- static const QString subEls[] = {"gnc:book", "gnc:count-data", "gnc:commodity", "price",
+ static const TQString subEls[] = {"gnc:book", "gnc:count-data", "gnc:commodity", "price",
"gnc:account", "gnc:transaction", "gnc:template-transactions",
"gnc:schedxaction"
};
@@ -287,29 +287,29 @@ void GncFile::endSubEl(GncObject *subObj) {
//****************************************** GncDate *********************************************
GncDate::GncDate () {
m_subElementListCount = 0;
- static const QString dEls[] = {"ts:date", "gdate"};
+ static const TQString dEls[] = {"ts:date", "gdate"};
m_dataElementList = dEls;
m_dataElementListCount = END_Date_DELS;
static const unsigned int anonClasses[] = {ASIS, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
}
GncDate::~GncDate() {}
//*************************************GncCmdtySpec***************************************
GncCmdtySpec::GncCmdtySpec () {
m_subElementListCount = 0;
- static const QString dEls[] = {"cmdty:space", "cmdty:id"};
+ static const TQString dEls[] = {"cmdty:space", "cmdty:id"};
m_dataElementList = dEls;
m_dataElementListCount = END_CmdtySpec_DELS;
static const unsigned int anonClasses[] = {ASIS, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
}
GncCmdtySpec::~GncCmdtySpec () {}
-QString GncCmdtySpec::hide(QString data, unsigned int) {
+TQString GncCmdtySpec::hide(TQString data, unsigned int) {
// hide equity names, but not currency names
unsigned int newClass = ASIS;
switch (m_state) {
@@ -321,26 +321,26 @@ QString GncCmdtySpec::hide(QString data, unsigned int) {
//************* GncKvp********************************************
GncKvp::GncKvp () {
m_subElementListCount = END_Kvp_SELS;
- static const QString subEls[] = {"slot"}; // kvp's may be nested
+ static const TQString subEls[] = {"slot"}; // kvp's may be nested
m_subElementList = subEls;
m_dataElementListCount = END_Kvp_DELS;
- static const QString dataEls[] = {"slot:key", "slot:value"};
+ static const TQString dataEls[] = {"slot:key", "slot:value"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_kvpList.setAutoDelete (true);
}
GncKvp::~GncKvp () {}
-void GncKvp::dataEl (const QXmlAttributes& elAttrs) {
+void GncKvp::dataEl (const TQXmlAttributes& elAttrs) {
switch (m_state) {
case VALUE:
m_kvpType = elAttrs.value("type");
}
m_dataPtr = m_v.at(m_state);
- if (key().contains ("formula")) {
+ if (key().tqcontains ("formula")) {
m_anonClass = MONEY2;
} else {
m_anonClass = ASIS;
@@ -378,12 +378,12 @@ GncLot::~GncLot() {}
GncCountData::GncCountData() {
m_subElementListCount = 0;
m_dataElementListCount = 0;
- m_v.append (new QString ("")); // only 1 data item
+ m_v.append (new TQString ("")); // only 1 data item
}
GncCountData::~GncCountData () {}
-void GncCountData::initiate (const QString&, const QXmlAttributes& elAttrs) {
+void GncCountData::initiate (const TQString&, const TQXmlAttributes& elAttrs) {
m_countType = elAttrs.value ("cd:type");
m_dataPtr = m_v.at(0);
return ;
@@ -413,12 +413,12 @@ void GncCountData::terminate () {
//*********************************GncCommodity***************************************
GncCommodity::GncCommodity () {
m_subElementListCount = 0;
- static const QString dEls[] = {"cmdty:space", "cmdty:id", "cmdty:name", "cmdty:fraction"};
+ static const TQString dEls[] = {"cmdty:space", "cmdty:id", "cmdty:name", "cmdty:fraction"};
m_dataElementList = dEls;
m_dataElementListCount = END_Commodity_DELS;
static const unsigned int anonClasses[] = {ASIS, NXTEQU, SUPPRESS, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
}
GncCommodity::~GncCommodity () {}
@@ -431,15 +431,15 @@ void GncCommodity::terminate() {
}
//************* GncPrice********************************************
GncPrice::GncPrice () {
- static const QString subEls[] = {"price:commodity", "price:currency", "price:time"};
+ static const TQString subEls[] = {"price:commodity", "price:currency", "price:time"};
m_subElementList = subEls;
m_subElementListCount = END_Price_SELS;
m_dataElementListCount = END_Price_DELS;
- static const QString dataEls[] = {"price:value"};
+ static const TQString dataEls[] = {"price:value"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_vpCommodity = NULL;
m_vpCurrency = NULL;
m_vpPriceDate = NULL;
@@ -483,16 +483,16 @@ void GncPrice::terminate() {
//************* GncAccount********************************************
GncAccount::GncAccount () {
m_subElementListCount = END_Account_SELS;
- static const QString subEls[] = {"act:commodity", "slot", "act:lots"};
+ static const TQString subEls[] = {"act:commodity", "slot", "act:lots"};
m_subElementList = subEls;
m_dataElementListCount = END_Account_DELS;
- static const QString dataEls[] = {"act:id", "act:name", "act:description",
- "act:type", "act:parent"};
+ static const TQString dataEls[] = {"act:id", "act:name", "act:description",
+ "act:type", "act:tqparent"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, NXTACC, SUPPRESS, ASIS, ASIS};
m_anonClassList = anonClasses;
m_kvpList.setAutoDelete (true);
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_vpCommodity = NULL;
}
@@ -534,18 +534,18 @@ void GncAccount::terminate() {
//************* GncTransaction********************************************
GncTransaction::GncTransaction (bool processingTemplates) {
m_subElementListCount = END_Transaction_SELS;
- static const QString subEls[] = {"trn:currency", "trn:date-posted", "trn:date-entered",
+ static const TQString subEls[] = {"trn:currency", "trn:date-posted", "trn:date-entered",
"trn:split", "slot"};
m_subElementList = subEls;
m_dataElementListCount = END_Transaction_DELS;
- static const QString dataEls[] = {"trn:id", "trn:num", "trn:description"};
+ static const TQString dataEls[] = {"trn:id", "trn:num", "trn:description"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, SUPPRESS, NXTPAY};
m_anonClassList = anonClasses;
adjustHideFactor();
m_template = processingTemplates;
m_splitList.setAutoDelete (true);
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_vpCurrency = NULL;
m_vpDateEntered = m_vpDatePosted = NULL;
}
@@ -602,15 +602,15 @@ void GncTransaction::terminate() {
//************* GncSplit********************************************
GncSplit::GncSplit () {
m_subElementListCount = END_Split_SELS;
- static const QString subEls[] = {"split:reconcile-date"};
+ static const TQString subEls[] = {"split:reconcile-date"};
m_subElementList = subEls;
m_dataElementListCount = END_Split_DELS;
- static const QString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value",
+ static const TQString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value",
"split:quantity", "split:account"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, SUPPRESS, ASIS, MONEY1, MONEY1, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_vpDateReconciled = NULL;
}
@@ -639,15 +639,15 @@ void GncSplit::endSubEl(GncObject *subObj) {
//************* GncTemplateSplit********************************************
GncTemplateSplit::GncTemplateSplit () {
m_subElementListCount = END_TemplateSplit_SELS;
- static const QString subEls[] = {"slot"};
+ static const TQString subEls[] = {"slot"};
m_subElementList = subEls;
m_dataElementListCount = END_TemplateSplit_DELS;
- static const QString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value",
+ static const TQString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value",
"split:quantity", "split:account"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, SUPPRESS, ASIS, MONEY1, MONEY1, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_kvpList.setAutoDelete (true);
}
@@ -674,17 +674,17 @@ void GncTemplateSplit::endSubEl(GncObject *subObj) {
//************* GncSchedule********************************************
GncSchedule::GncSchedule () {
m_subElementListCount = END_Schedule_SELS;
- static const QString subEls[] = {"sx:start", "sx:last", "sx:end", "gnc:freqspec", "gnc:recurrence","sx:deferredInstance"};
+ static const TQString subEls[] = {"sx:start", "sx:last", "sx:end", "gnc:freqspec", "gnc:recurrence","sx:deferredInstance"};
m_subElementList = subEls;
m_dataElementListCount = END_Schedule_DELS;
- static const QString dataEls[] = {"sx:name", "sx:enabled", "sx:autoCreate", "sx:autoCreateNotify",
+ static const TQString dataEls[] = {"sx:name", "sx:enabled", "sx:autoCreate", "sx:autoCreateNotify",
"sx:autoCreateDays", "sx:advanceCreateDays", "sx:advanceRemindDays",
"sx:instanceCount", "sx:num-occur",
"sx:rem-occur", "sx:templ-acct"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {NXTSCHD, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_vpStartDate = m_vpLastDate = m_vpEndDate = NULL;
m_vpFreqSpec = NULL;
m_vpRecurrence.clear();
@@ -735,15 +735,15 @@ void GncSchedule::terminate() {
//************* GncFreqSpec********************************************
GncFreqSpec::GncFreqSpec () {
m_subElementListCount = END_FreqSpec_SELS;
- static const QString subEls[] = {"gnc:freqspec"};
+ static const TQString subEls[] = {"gnc:freqspec"};
m_subElementList = subEls;
m_dataElementListCount = END_FreqSpec_DELS;
- static const QString dataEls[] = {"fs:ui_type", "fs:monthly", "fs:daily", "fs:weekly", "fs:interval",
+ static const TQString dataEls[] = {"fs:ui_type", "fs:monthly", "fs:daily", "fs:weekly", "fs:interval",
"fs:offset", "fs:day"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS };
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
m_fsList.setAutoDelete (true);
}
@@ -778,14 +778,14 @@ void GncFreqSpec::terminate() {
//************* GncRecurrence********************************************
GncRecurrence::GncRecurrence () {
m_subElementListCount = END_Recurrence_SELS;
- static const QString subEls[] = {"recurrence:start"};
+ static const TQString subEls[] = {"recurrence:start"};
m_subElementList = subEls;
m_dataElementListCount = END_Recurrence_DELS;
- static const QString dataEls[] = {"recurrence:mult", "recurrence:period_type"};
+ static const TQString dataEls[] = {"recurrence:mult", "recurrence:period_type"};
m_dataElementList = dataEls;
static const unsigned int anonClasses[] = {ASIS, ASIS};
m_anonClassList = anonClasses;
- for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString (""));
+ for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString (""));
}
GncRecurrence::~GncRecurrence () {
@@ -819,7 +819,7 @@ void GncRecurrence::terminate() {
return ;
}
-QString GncRecurrence::getFrequency() const {
+TQString GncRecurrence::getFrequency() const {
// This function converts a gnucash 2.2 recurrence specification into it's previous equivalent
// This will all need re-writing when MTE finishes the schedule re-write
if (periodType() == "once") return("once");
@@ -853,9 +853,9 @@ GncSchedDef::~GncSchedDef () {}
/************************************************************************************************
XML Reader
************************************************************************************************/
-void XmlReader::processFile (QIODevice* pDevice) {
- m_source = new QXmlInputSource (pDevice); // set up the Qt XML reader
- m_reader = new QXmlSimpleReader;
+void XmlReader::processFile (TQIODevice* pDevice) {
+ m_source = new TQXmlInputSource (pDevice); // set up the TQt XML reader
+ m_reader = new TQXmlSimpleReader;
m_reader->setContentHandler (this);
// go read the file
if (!m_reader->parse (m_source)) {
@@ -881,13 +881,13 @@ bool XmlReader::startDocument() {
return (true);
}
-bool XmlReader::startElement (const QString&, const QString&, const QString& elName ,
- const QXmlAttributes& elAttrs) {
+bool XmlReader::startElement (const TQString&, const TQString&, const TQString& elName ,
+ const TQXmlAttributes& elAttrs) {
try {
if (pMain->gncdebug) qDebug ("XML start - %s", elName.latin1());
#ifdef _GNCFILEANON
int i;
- QString spaces;
+ TQString spaces;
// anonymizer - write data
if (elName == "gnc:book" || elName == "gnc:count-data" || elName == "book:id") lastType = -1;
pMain->oStream << endl;
@@ -934,7 +934,7 @@ bool XmlReader::startElement (const QString&, const QString&, const QString& 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").arg(e->what()), PACKAGE);
+ KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE);
qFatal ("%s", e->what().latin1());
#else
qFatal ("%s", e->latin1());
@@ -943,11 +943,11 @@ bool XmlReader::startElement (const QString&, const QString&, const QString& elN
return true; // to keep compiler happy
}
-bool XmlReader::endElement( const QString&, const QString&, const QString&elName ) {
+bool XmlReader::endElement( const TQString&, const TQString&, const TQString&elName ) {
try {
if (pMain->xmldebug) qDebug ("XML end - %s", elName.latin1());
#ifdef _GNCFILEANON
- QString spaces;
+ TQString spaces;
switch (lastType) {
case 2:
indentCount -= 2; spaces.fill (' ', indentCount); pMain->oStream << endl << spaces.latin1(); break;
@@ -958,7 +958,7 @@ bool XmlReader::endElement( const QString&, const QString&, const QString&elName
m_co->resetDataPtr(); // so we don't get extraneous data loaded into the variables
if (elName == m_co->getElName()) { // check if this is the end of the current object
if (pMain->gncdebug) m_co->debugDump(); // dump the object data (temp)
- // call the terminate routine, pop the stack, and advise the parent that it's done
+ // call the terminate routine, pop the stack, and advise the tqparent that it's done
m_co->terminate();
GncObject *temp = m_co;
m_os.pop();
@@ -969,7 +969,7 @@ bool XmlReader::endElement( const QString&, const QString&, const QString&elName
} 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").arg(e->what()), PACKAGE);
+ KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE);
qFatal ("%s", e->what().latin1());
#else
qFatal ("%s", e->latin1());
@@ -978,19 +978,19 @@ bool XmlReader::endElement( const QString&, const QString&, const QString&elName
return (true); // to keep compiler happy
}
-bool XmlReader::characters (const QString &data) {
+bool XmlReader::characters (const TQString &data) {
if (pMain->xmldebug) qDebug ("XML Data received - %d bytes", data.length());
- QString pData = data.stripWhiteSpace(); // data may contain line feeds and indentation spaces
+ TQString pData = data.stripWhiteSpace(); // data may contain line feeds and indentation spaces
if (!pData.isEmpty()) {
if (pMain->developerDebug) qDebug ("XML Data - %s", pData.latin1());
m_co->storeData (pData); //go store it
#ifdef _GNCFILEANON
- QString anonData = m_co->getData ();
+ TQString anonData = m_co->getData ();
if (anonData.isEmpty()) anonData = pData;
- // there must be a Qt standard way of doing the following but I can't ... find it
- anonData.replace ('<', "&lt;");
- anonData.replace ('>', "&gt;");
- anonData.replace ('&', "&amp;");
+ // there must be a TQt standard way of doing the following but I can't ... find it
+ anonData.tqreplace ('<', "&lt;");
+ anonData.tqreplace ('>', "&gt;");
+ anonData.tqreplace ('&', "&amp;");
pMain->oStream << anonData; // write original data
lastType = 1;
#endif // _GNCFILEANON
@@ -1025,7 +1025,7 @@ MyMoneyGncReader::MyMoneyGncReader() {
m_commodityCount = m_priceCount = m_accountCount = m_transactionCount = m_templateCount = m_scheduleCount = 0;
m_decoder = 0;
// build a list of valid versions
- static const QString versionList[] = {"gnc:book 2.0.0", "gnc:commodity 2.0.0", "gnc:pricedb 1",
+ static const TQString versionList[] = {"gnc:book 2.0.0", "gnc:commodity 2.0.0", "gnc:pricedb 1",
"gnc:account 2.0.0", "gnc:transaction 2.0.0", "gnc:schedxaction 1.0.0",
"gnc:schedxaction 2.0.0", // for gnucash 2.2 onward
"gnc:freqspec 1.0.0", "zzz" // zzz = stopper
@@ -1040,7 +1040,7 @@ MyMoneyGncReader::~MyMoneyGncReader() {}
//**************************** Main Entry Point ************************************
#ifndef _GNCFILEANON
-void MyMoneyGncReader::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) {
+void MyMoneyGncReader::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage) {
Q_CHECK_PTR (pDevice);
Q_CHECK_PTR (storage);
@@ -1059,7 +1059,7 @@ void MyMoneyGncReader::readFile(QIODevice* pDevice, IMyMoneySerialize* storage)
terminate (); // do all the wind-up things
ft.commit();
} catch (MyMoneyException *e) {
- KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE);
+ KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE);
qFatal ("%s", e->what().latin1());
} // end catch
signalProgress (0, 1, i18n("Import complete")); // switch off progress bar
@@ -1069,10 +1069,10 @@ void MyMoneyGncReader::readFile(QIODevice* pDevice, IMyMoneySerialize* storage)
}
#else
// Control code for the file anonymizer
-void MyMoneyGncReader::readFile(QString in, QString out) {
- QFile pDevice (in);
+void MyMoneyGncReader::readFile(TQString in, TQString out) {
+ TQFile pDevice (in);
if (!pDevice.open (IO_ReadOnly)) qFatal ("Can't open input file");
- QFile outFile (out);
+ TQFile outFile (out);
if (!outFile.open (IO_WriteOnly)) qFatal ("Can't open output file");
oStream.setDevice (&outFile);
bAnonymize = true;
@@ -1090,16 +1090,16 @@ void MyMoneyGncReader::readFile(QString in, QString out) {
return ;
}
-#include <qapplication.h>
+#include <tqapplication.h>
int main (int argc, char ** argv) {
- QApplication a (argc, argv);
+ TQApplication a (argc, argv);
MyMoneyGncReader m;
- QString inFile, outFile;
+ TQString inFile, outFile;
if (argc > 0) inFile = a.argv()[1];
if (argc > 1) outFile = a.argv()[2];
if (inFile.isEmpty()) {
- inFile = QFileDialog::getOpenFileName("",
+ inFile = TQFileDialog::getOpenFileName("",
"Gnucash files(*.nc *)",
0);
}
@@ -1113,15 +1113,15 @@ int main (int argc, char ** argv) {
void MyMoneyGncReader::setFileHideFactor () {
#define MINFILEHIDEF 0.01
#define MAXFILEHIDEF 99.99
- srand (QTime::currentTime().second()); // seed randomizer for anonymize
+ srand (TQTime::currentTime().second()); // seed randomizer for anonymize
m_fileHideFactor = 0.0;
while (m_fileHideFactor == 0.0) {
- m_fileHideFactor = QInputDialog::getDouble (
+ m_fileHideFactor = TQInputDialog::getDouble (
i18n ("Disguise your wealth"),
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.").arg(MINFILEHIDEF).arg(MAXFILEHIDEF),
+ "These numbers will not be stored in the file.").tqarg(MINFILEHIDEF).tqarg(MAXFILEHIDEF),
(1.0 + (int)(1000.0 * rand() / (RAND_MAX + 1.0))) / 100.0,
MINFILEHIDEF, MAXFILEHIDEF, 2);
}
@@ -1192,22 +1192,22 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
acc.setDescription(gac->desc());
- QDate currentDate = QDate::currentDate();
- acc.setOpeningDate(currentDate);
- acc.setLastModified(currentDate);
- acc.setLastReconciliationDate(currentDate);
+ TQDate tqcurrentDate = TQDate::tqcurrentDate();
+ acc.setOpeningDate(tqcurrentDate);
+ acc.setLastModified(tqcurrentDate);
+ acc.setLastReconciliationDate(tqcurrentDate);
if (gac->commodity()->isCurrency()) {
acc.setCurrencyId (gac->commodity()->id().utf8());
m_currencyCount[gac->commodity()->id()]++;
}
- acc.setParentAccountId (gac->parent().utf8());
- // now determine the account type and its parent id
+ acc.setParentAccountId (gac->tqparent().utf8());
+ // now determine the account type and its tqparent id
/* This list taken from
# Feb 2006: A RELAX NG Compact schema for gnucash "v2" XML files.
# Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
"NO_TYPE" "BANK" "CASH" "CREDIT" "ASSET" "LIABILITY" "STOCK" "MUTUAL" "CURRENCY"
-"INCOME" "EXPENSE" "EQUITY" "RECEIVABLE" "PAYABLE" "CHECKING" "SAVINGS" "MONEYMRKT" "CREDITLINE"
+"INCOME" "EXPENSE" "ETQUITY" "RECEIVABLE" "PAYABLE" "CHECKING" "SAVINGS" "MONEYMRKT" "CREDITLINE"
Some don't seem to be used in practice. Not sure what CREDITLINE s/be converted as.
*/
if ("BANK" == gac->type() || "CHECKING" == gac->type()) {
@@ -1230,7 +1230,7 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
} else {
acc.setAccountType(MyMoneyAccount::Stock);
}
- } else if ("EQUITY" == gac->type()) {
+ } else if ("ETQUITY" == gac->type()) {
acc.setAccountType(MyMoneyAccount::Equity);
} else if ("LIABILITY" == gac->type()) {
acc.setAccountType(MyMoneyAccount::Liability);
@@ -1247,12 +1247,12 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
} else if ("MONEYMRKT" == gac->type()) {
acc.setAccountType(MyMoneyAccount::MoneyMarket);
} else { // we have here an account type we can't currently handle
- QString em =
- i18n("Current importer does not recognize GnuCash account type %1").arg(gac->type());
+ TQString em =
+ i18n("Current importer does not recognize GnuCash account type %1").tqarg(gac->type());
throw new MYMONEYEXCEPTION (em);
}
- // if no parent account is present, assign to one of our standard accounts
- if ((acc.parentAccountId().isEmpty()) || (acc.parentAccountId() == m_rootId)) {
+ // if no tqparent account is present, assign to one of our standard accounts
+ if ((acc.tqparentAccountId().isEmpty()) || (acc.tqparentAccountId() == m_rootId)) {
switch (acc.accountGroup()) {
case MyMoneyAccount::Asset: acc.setParentAccountId (m_storage->asset().id()); break;
case MyMoneyAccount::Liability: acc.setParentAccountId (m_storage->liability().id()); break;
@@ -1281,10 +1281,10 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
// NB: In gnc, this selection is per account, in KMM, per security
// This is unlikely to cause problems in practice. If it does,
// we probably need to introduce a 'pricing basis' in the account class
- QPtrListIterator<GncObject> kvpi (gac->m_kvpList);
+ TQPtrListIterator<GncObject> kvpi (gac->m_kvpList);
GncKvp *k;
while ((k = static_cast<GncKvp *>(kvpi.current())) != 0) {
- if (k->key().contains("price-source") && k->type() == "string") {
+ if (k->key().tqcontains("price-source") && k->type() == "string") {
getPriceSource (e, k->value());
break;
} else {
@@ -1294,10 +1294,10 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
}
// check for tax-related status
- QPtrListIterator<GncObject> kvpi (gac->m_kvpList);
+ TQPtrListIterator<GncObject> kvpi (gac->m_kvpList);
GncKvp *k;
while ((k = static_cast<GncKvp *>(kvpi.current())) != 0) {
- if (k->key().contains("tax-related") && k->type() == "integer" && k->value() == "1") {
+ if (k->key().tqcontains("tax-related") && k->type() == "integer" && k->value() == "1") {
acc.setValue ("Tax", "Yes");
break;
} else {
@@ -1310,9 +1310,9 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
m_storage->addAccount(acc);
m_mapIds[gac->id().utf8()] = acc.id(); // to link gnucash id to ours for tx posting
- if (gncdebug) qDebug("Gnucash account %s has id of %s, type of %s, parent is %s",
+ if (gncdebug) qDebug("Gnucash account %s has id of %s, type of %s, tqparent is %s",
gac->id().latin1(), acc.id().data(),
- KMyMoneyUtils::accountTypeToString(acc.accountType()).latin1(), acc.parentAccountId().data());
+ KMyMoneyUtils::accountTypeToString(acc.accountType()).latin1(), acc.tqparentAccountId().data());
signalProgress (++m_accountCount, 0);
return ;
@@ -1365,7 +1365,7 @@ void MyMoneyGncReader::convertTransaction (const GncTransaction *gtx) {
const GncKvp *slot = gtx->getKvp(i);
if (slot->key() == "notes") tx.setMemo(slot->value());
}
- QValueList<MyMoneySplit>::iterator it = m_splitList.begin();
+ TQValueList<MyMoneySplit>::iterator it = m_splitList.begin();
while (!m_splitList.isEmpty()) {
split = *it;
// at this point, if m_potentialTransfer is still true, it is actually one!
@@ -1389,8 +1389,8 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
MyMoneySplit split;
MyMoneyAccount splitAccount;
// find the kmm account id coresponding to the gnc id
- QString kmmAccountId;
- map_accountIds::Iterator id = m_mapIds.find(gsp->acct().utf8());
+ TQString kmmAccountId;
+ map_accountIds::Iterator id = m_mapIds.tqfind(gsp->acct().utf8());
if (id != m_mapIds.end()) {
kmmAccountId = id.data();
} else { // for the case where the acs not found (which shouldn't happen?), create an account with gnc name
@@ -1406,7 +1406,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
// payee id
split.setPayeeId (m_txPayeeId.utf8());
// reconciled state and date
- switch (gsp->recon().at(0).latin1()) {
+ switch (gsp->recon().tqat(0).latin1()) {
case 'n':
split.setReconcileFlag(MyMoneySplit::NotReconciled); break;
case 'c':
@@ -1425,7 +1425,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
MyMoneyMoney splitValue (convBadValue (gsp->value()));
if (gsp->value() == "-1/0") { // treat gnc invalid value as zero
// it's not quite a consistency check, but easier to treat it as such
- postMessage ("CC", 4, splitAccount.name().latin1(), m_txDatePosted.toString(Qt::ISODate).latin1());
+ postMessage ("CC", 4, splitAccount.name().latin1(), TQString(m_txDatePosted.toString(Qt::ISODate)).latin1());
}
MyMoneyMoney splitQuantity(convBadValue(gsp->qty()));
split.setValue (splitValue);
@@ -1466,7 +1466,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
e.setTradingCurrency (m_txCommodity);
if (gncdebug) qDebug ("added price for %s, %s date %s",
e.name().latin1(), newPrice.toString().latin1(),
- m_txDatePosted.toString(Qt::ISODate).latin1());
+ TQString(m_txDatePosted.toString(Qt::ISODate)).latin1());
m_storage->modifySecurity(e);
MyMoneyPrice dealPrice (e.id(), m_txCommodity, m_txDatePosted, newPrice, i18n("Imported Transaction"));
m_storage->addPrice (dealPrice);
@@ -1479,7 +1479,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
if (split.value().isNegative()) {
bool isNumeric = false;
if (!split.number().isEmpty()) {
- split.number().toLong(&isNumeric); // No QString.isNumeric()??
+ split.number().toLong(&isNumeric); // No TQString.isNumeric()??
}
if (isNumeric) {
split.setAction (MyMoneySplit::ActionCheck);
@@ -1510,7 +1510,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
return ;
}
//********************************* convertTemplateTransaction **********************************************
-MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString& schedName, const GncTransaction *gtx) {
+MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const TQString& schedName, const GncTransaction *gtx) {
Q_CHECK_PTR (gtx);
MyMoneyTransaction tx;
@@ -1540,7 +1540,7 @@ MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString&
convertTemplateSplit (schedName, static_cast<const GncTemplateSplit *>(gtx->getSplit (i)));
}
// determine the action type for the splits and link them to the template tx
- /*QString negativeActionType, positiveActionType;
+ /*TQString negativeActionType, positiveActionType;
if (!m_splitList.isEmpty()) { // if there are asset splits
positiveActionType = MyMoneySplit::ActionDeposit;
negativeActionType = MyMoneySplit::ActionWithdrawal;
@@ -1554,8 +1554,8 @@ MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString&
// also, determine the action type. first off, is it a transfer (can only have 2 splits?)
if (m_splitList.count() != 2) m_potentialTransfer = false;
// at this point, if m_potentialTransfer is still true, it is actually one!
- QString txMemo = "";
- QValueList<MyMoneySplit>::iterator it = m_splitList.begin();
+ TQString txMemo = "";
+ TQValueList<MyMoneySplit>::iterator it = m_splitList.begin();
while (!m_splitList.isEmpty()) {
split = *it;
if (m_potentialTransfer) {
@@ -1583,7 +1583,7 @@ MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString&
return (tx);
}
//********************************* convertTemplateSplit ****************************************************
-void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const GncTemplateSplit *gsp) {
+void MyMoneyGncReader::convertTemplateSplit (const TQString& schedName, const GncTemplateSplit *gsp) {
Q_CHECK_PTR (gsp);
// convertTemplateSplit
MyMoneySplit split;
@@ -1601,14 +1601,14 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc
// read split slots (KVPs)
int xactionCount = 0;
int validSlotCount = 0;
- QString gncAccountId;
+ TQString gncAccountId;
for (i = 0; i < gsp->kvpCount(); i++ ) {
const GncKvp *slot = gsp->getKvp(i);
if ((slot->key() == "sched-xaction") && (slot->type() == "frame")) {
bool bFoundStringCreditFormula = false;
bool bFoundStringDebitFormula = false;
bool bFoundGuidAccountId = false;
- QString gncCreditFormula, gncDebitFormula;
+ TQString gncCreditFormula, gncDebitFormula;
for (j = 0; j < slot->kvpCount(); j++) {
const GncKvp *subSlot = slot->getKvp (j);
// again, see comments above. when we have a full specification
@@ -1635,7 +1635,7 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc
// validate numeric, work out sign
MyMoneyMoney exFormula (0);
exFormula.setNegativeMonetarySignPosition (MyMoneyMoney::BeforeQuantityMoney);
- QString numericTest;
+ TQString numericTest;
char crdr=0 ;
if (!gncCreditFormula.isEmpty()) {
crdr = 'C';
@@ -1646,10 +1646,10 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc
}
kMyMoneyMoneyValidator v (0);
int pos; // useless, but required for validator
- if (v.validate (numericTest, pos) == QValidator::Acceptable) {
+ if (v.validate (numericTest, pos) == TQValidator::Acceptable) {
switch (crdr) {
case 'C':
- exFormula = QString ("-" + numericTest); break;
+ exFormula = TQString ("-" + numericTest); break;
case 'D':
exFormula = numericTest;
}
@@ -1678,8 +1678,8 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc
m_suspectSchedule = true;
}
// find the kmm account id coresponding to the gnc id
- QString kmmAccountId;
- map_accountIds::Iterator id = m_mapIds.find(gncAccountId.utf8());
+ TQString kmmAccountId;
+ map_accountIds::Iterator id = m_mapIds.tqfind(gncAccountId.utf8());
if (id != m_mapIds.end()) {
kmmAccountId = id.data();
} else { // for the case where the acs not found (which shouldn't happen?), create an account with gnc name
@@ -1716,15 +1716,15 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
MyMoneySchedule sc;
MyMoneyTransaction tx;
m_suspectSchedule = false;
- QDate startDate, nextDate, lastDate, endDate; // for date calculations
- QDate today = QDate::currentDate();
+ TQDate startDate, nextDate, lastDate, endDate; // for date calculations
+ TQDate today = TQDate::tqcurrentDate();
int numOccurs, remOccurs;
if (m_scheduleCount == 0) signalProgress (0, m_gncScheduleCount, i18n("Loading schedules..."));
// schedule name
sc.setName(gsc->name());
// find the transaction template as stored earlier
- QPtrListIterator<GncTransaction> itt (m_templateList);
+ TQPtrListIterator<GncTransaction> itt (m_templateList);
GncTransaction *ttx;
while ((ttx = itt.current()) != 0) {
// the id to match against is the split:account value in the splits
@@ -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").arg(sc.name()));
+ throw new MYMONEYEXCEPTION (i18n("Can't find template transaction for schedule %1").tqarg(sc.name()));
} else {
tx = convertTemplateTransaction (sc.name(), *itt);
}
@@ -1740,7 +1740,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
// define the conversion table for intervals
struct convIntvl {
- QString gncType; // the gnucash name
+ TQString gncType; // the gnucash name
unsigned char interval; // for date calculation
unsigned int intervalCount;
MyMoneySchedule::occurenceE occ; // equivalent occurence code
@@ -1765,7 +1765,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
{"monthly", 'm', 1, MyMoneySchedule::OCCUR_MONTHLY, MyMoneySchedule::MoveNothing },
{"two-monthly", 'm', 2, MyMoneySchedule::OCCUR_EVERYOTHERMONTH,
MyMoneySchedule::MoveNothing },
- {"quarterly", 'm', 3, MyMoneySchedule::OCCUR_QUARTERLY, MyMoneySchedule::MoveNothing },
+ {"quarterly", 'm', 3, MyMoneySchedule::OCCUR_TQUARTERLY, MyMoneySchedule::MoveNothing },
{"tri_annually", 'm', 4, MyMoneySchedule::OCCUR_EVERYFOURMONTHS, MyMoneySchedule::MoveNothing },
{"semi_yearly", 'm', 6, MyMoneySchedule::OCCUR_TWICEYEARLY, MyMoneySchedule::MoveNothing },
{"yearly", 'y', 1, MyMoneySchedule::OCCUR_YEARLY, MyMoneySchedule::MoveNothing },
@@ -1775,16 +1775,16 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
// zzz = stopper, may cause problems. what else can we do?
};
- QString frequency = "unknown"; // set default to unknown frequency
+ TQString frequency = "unknown"; // set default to unknown frequency
bool unknownOccurs = false; // may have zero, or more than one frequency/recurrence spec
- QString schedEnabled;
+ TQString schedEnabled;
if (gsc->version() == "2.0.0") {
if (gsc->m_vpRecurrence.count() != 1) {
unknownOccurs = true;
} else {
const GncRecurrence *gre = gsc->m_vpRecurrence.first();
- //qDebug (QString("Sched %1, pt %2, mu %3, sd %4").arg(gsc->name()).arg(gre->periodType())
- // .arg(gre->mult()).arg(gre->startDate().toString(Qt::ISODate)));
+ //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)));
frequency = gre->getFrequency();
schedEnabled = gsc->enabled();
}
@@ -1821,7 +1821,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
// if a last date was specified, use it, otherwise try to work out the last date
sc.setLastPayment(gsc->lastDate());
numOccurs = gsc->numOccurs().toInt();
- if (sc.lastPayment() == QDate()) {
+ if (sc.lastPayment() == TQDate()) {
nextDate = lastDate = gsc->startDate();
while ((nextDate < today) && (numOccurs-- != 0)) {
lastDate = nextDate;
@@ -1837,7 +1837,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
sc.setEndDate(gsc->endDate());
numOccurs = gsc->numOccurs().toInt();
remOccurs = gsc->remOccurs().toInt();
- if ((sc.endDate() == QDate()) && (remOccurs > 0)) {
+ if ((sc.endDate() == TQDate()) && (remOccurs > 0)) {
endDate = sc.lastPayment();
while (remOccurs-- > 0) {
endDate = incrDate (endDate, vi[i].interval, vi[i].intervalCount);
@@ -1853,11 +1853,11 @@ 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(QString("%1 and %2").arg(gsc->autoCreate()).arg(schedEnabled));
+ //qDebug(TQString("%1 and %2").tqarg(gsc->autoCreate()).tqarg(schedEnabled));
sc.setAutoEnter ((gsc->autoCreate() == "y") && (schedEnabled == "y"));
- //qDebug(QString("autoEnter set to %1").arg(sc.autoEnter()));
+ //qDebug(TQString("autoEnter set to %1").tqarg(sc.autoEnter()));
// type
- QString actionType = tx.splits().first().action();
+ TQString actionType = tx.splits().first().action();
if (actionType == MyMoneySplit::ActionDeposit) {
sc.setType((MyMoneySchedule::typeE)MyMoneySchedule::TYPE_DEPOSIT);
} else if (actionType == MyMoneySplit::ActionTransfer) {
@@ -1902,51 +1902,51 @@ void MyMoneyGncReader::terminate () {
}
// first step is to implement the users investment option, now we
// have all the accounts available
- QValueList<QString>::iterator stocks;
+ TQValueList<TQString>::iterator stocks;
for (stocks = m_stockList.begin(); stocks != m_stockList.end(); ++stocks) {
checkInvestmentOption (*stocks);
}
- // Next step is to walk the list and assign the parent/child relationship between the objects.
+ // Next step is to walk the list and assign the tqparent/child relationship between the objects.
unsigned int i = 0;
signalProgress (0, m_accountCount, i18n ("Reorganizing accounts..."));
- QValueList<MyMoneyAccount> list;
- QValueList<MyMoneyAccount>::Iterator acc;
+ TQValueList<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount>::Iterator acc;
m_storage->accountList(list);
for (acc = list.begin(); acc != list.end(); ++acc) {
- if ((*acc).parentAccountId() == m_storage->asset().id()) {
+ if ((*acc).tqparentAccountId() == m_storage->asset().id()) {
MyMoneyAccount assets = m_storage->asset();
m_storage->addAccount(assets, (*acc));
if (gncdebug) qDebug("Account id %s is a child of the main asset account", (*acc).id().data());
- } else if ((*acc).parentAccountId() == m_storage->liability().id()) {
+ } else if ((*acc).tqparentAccountId() == m_storage->liability().id()) {
MyMoneyAccount liabilities = m_storage->liability();
m_storage->addAccount(liabilities, (*acc));
if (gncdebug) qDebug("Account id %s is a child of the main liability account", (*acc).id().data());
- } else if ((*acc).parentAccountId() == m_storage->income().id()) {
+ } else if ((*acc).tqparentAccountId() == m_storage->income().id()) {
MyMoneyAccount incomes = m_storage->income();
m_storage->addAccount(incomes, (*acc));
if (gncdebug) qDebug("Account id %s is a child of the main income account", (*acc).id().data());
- } else if ((*acc).parentAccountId() == m_storage->expense().id()) {
+ } else if ((*acc).tqparentAccountId() == m_storage->expense().id()) {
MyMoneyAccount expenses = m_storage->expense();
m_storage->addAccount(expenses, (*acc));
if (gncdebug) qDebug("Account id %s is a child of the main expense account", (*acc).id().data());
- } else if ((*acc).parentAccountId() == m_storage->equity().id()) {
+ } else if ((*acc).tqparentAccountId() == m_storage->equity().id()) {
MyMoneyAccount equity = m_storage->equity();
m_storage->addAccount(equity, (*acc));
if (gncdebug) qDebug("Account id %s is a child of the main equity account", (*acc).id().data());
- } else if ((*acc).parentAccountId() == m_rootId) {
+ } else if ((*acc).tqparentAccountId() == m_rootId) {
if (gncdebug) qDebug("Account id %s is a child of root", (*acc).id().data());
} else {
- // it is not under one of the main accounts, so find gnucash parent
- QString parentKey = (*acc).parentAccountId();
- if (gncdebug) qDebug ("acc %s, parent %s", (*acc).id().data(),
- (*acc).parentAccountId().data());
- map_accountIds::Iterator id = m_mapIds.find(parentKey);
+ // it is not under one of the main accounts, so find gnucash tqparent
+ TQString tqparentKey = (*acc).tqparentAccountId();
+ if (gncdebug) qDebug ("acc %s, tqparent %s", (*acc).id().data(),
+ (*acc).tqparentAccountId().data());
+ map_accountIds::Iterator id = m_mapIds.tqfind(tqparentKey);
if (id != m_mapIds.end()) {
- if (gncdebug) qDebug("Setting account id %s's parent account id to %s",
+ if (gncdebug) qDebug("Setting account id %s's tqparent account id to %s",
(*acc).id().data(), id.data().data());
- MyMoneyAccount parent = m_storage->account(id.data());
- parent = checkConsistency (parent, (*acc));
- m_storage->addAccount (parent, (*acc));
+ MyMoneyAccount tqparent = m_storage->account(id.data());
+ tqparent = checkConsistency (tqparent, (*acc));
+ m_storage->addAccount (tqparent, (*acc));
} else {
throw new MYMONEYEXCEPTION ("terminate() could not find account id");
}
@@ -1955,9 +1955,9 @@ void MyMoneyGncReader::terminate () {
} // end for account
signalProgress (0, 1, (".")); // debug - get rid of reorg message
// offer the most common account currency as a default
- QString mainCurrency = "";
+ TQString mainCurrency = "";
unsigned int maxCount = 0;
- QMap<QString, unsigned int>::ConstIterator it;
+ TQMap<TQString, unsigned int>::ConstIterator it;
for (it = m_currencyCount.begin(); it != m_currencyCount.end(); ++it) {
if (it.data() > maxCount) {
maxCount = it.data();
@@ -1966,12 +1966,12 @@ void MyMoneyGncReader::terminate () {
}
if (mainCurrency != "") {
- /* fix for qt3.3.4?. According to Qt docs, this should return the enum id of the button pressed, and
+ /* fix for qt3.3.4?. According to TQt docs, this should return the enum id of the button pressed, and
indeed it used to do so. However now it seems to return the index of the button. In this case it doesn't matter,
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 */
- QString question = i18n("Your main currency seems to be %1 (%2); do you want to set this as your base currency?")
- .arg(mainCurrency).arg(m_storage->currency(mainCurrency.utf8()).name());
+ 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());
if(KMessageBox::questionYesNo(0, question, PACKAGE) == KMessageBox::Yes) {
m_storage->setValue ("kmm-baseCurrency", mainCurrency);
}
@@ -1983,7 +1983,7 @@ void MyMoneyGncReader::terminate () {
if ((*m_messageList.at(i)).source == "OR") m_orCount++;
if ((*m_messageList.at(i)).source == "SC") m_scCount++;
}
- QValueList<QString> sectionsToReport; // list of sections needing report
+ TQValueList<TQString> sectionsToReport; // list of sections needing report
sectionsToReport.append ("MN"); // always build the main section
if (m_ccCount > 0) sectionsToReport.append ("CC");
if (m_orCount > 0) sectionsToReport.append ("OR");
@@ -1991,11 +1991,11 @@ void MyMoneyGncReader::terminate () {
// produce the sections in message boxes
bool exit = false;
for (i = 0; (i < sectionsToReport.count()) && !exit; i++) {
- QString button0Text = i18n("More");
+ TQString button0Text = i18n("More");
if (i + 1 == sectionsToReport.count())
button0Text = i18n("Done"); // last section
- KGuiItem yesItem(button0Text, QIconSet(), "", "");
- KGuiItem noItem(i18n("Save Report"), QIconSet(), "", "");
+ KGuiItem yesItem(button0Text, TQIconSet(), "", "");
+ KGuiItem noItem(i18n("Save Report"), TQIconSet(), "", "");
switch(KMessageBox::questionYesNoCancel(0,
buildReportSection (*sectionsToReport.at(i)),
@@ -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?").arg(sc.name()), PACKAGE)) {
+ 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)) {
case KMessageBox::Yes:
s = new KEditScheduleDlg (sc);
// FIXME: connect newCategory to something useful, so that we
@@ -2032,36 +2032,36 @@ void MyMoneyGncReader::terminate () {
PASS
}
//************************************ buildReportSection************************************
-QString MyMoneyGncReader::buildReportSection (const QString& source) {
+TQString MyMoneyGncReader::buildReportSection (const TQString& source) {
TRY
- QString s = "";
+ TQString s = "";
bool more = false;
if (source == "MN") {
s.append (i18n("Found:\n\n"));
- s.append (QString::number(m_commodityCount) + i18n(" commodities (equities)\n"));
- s.append (QString::number(m_priceCount) + i18n(" prices\n"));
- s.append (QString::number(m_accountCount) + i18n(" accounts\n"));
- s.append (QString::number(m_transactionCount) + i18n(" transactions\n"));
- s.append (QString::number(m_scheduleCount) + i18n(" schedules\n"));
+ s.append (TQString::number(m_commodityCount) + i18n(" commodities (equities)\n"));
+ s.append (TQString::number(m_priceCount) + i18n(" prices\n"));
+ s.append (TQString::number(m_accountCount) + i18n(" accounts\n"));
+ s.append (TQString::number(m_transactionCount) + i18n(" transactions\n"));
+ s.append (TQString::number(m_scheduleCount) + i18n(" schedules\n"));
s.append ("\n\n");
if (m_ccCount == 0) {
s.append (i18n("No inconsistencies were detected"));
} else {
- s.append (QString::number(m_ccCount) + i18n(" inconsistencies were detected and corrected\n"));
+ s.append (TQString::number(m_ccCount) + i18n(" inconsistencies were detected and corrected\n"));
more = true;
}
if (m_orCount > 0) {
s.append ("\n\n");
- s.append (QString::number(m_orCount) + i18n(" orphan accounts were created\n"));
+ s.append (TQString::number(m_orCount) + i18n(" orphan accounts were created\n"));
more = true;
}
if (m_scCount > 0) {
s.append ("\n\n");
- s.append (QString::number(m_scCount) + i18n(" possible schedule problems were noted\n"));
+ s.append (TQString::number(m_scCount) + i18n(" possible schedule problems were noted\n"));
more = true;
}
- QString unsupported ("");
- QString lineSep ("\n - ");
+ TQString unsupported ("");
+ TQString lineSep ("\n - ");
if (m_smallBusinessFound) unsupported.append(lineSep + i18n("Small Business Features (Customers, Invoices, etc.)"));
if (m_budgetsFound) unsupported.append(lineSep + i18n("Budgets"));
if (m_lotsFound) unsupported.append(lineSep + i18n("Lots"));
@@ -2076,9 +2076,9 @@ QString MyMoneyGncReader::buildReportSection (const QString& source) {
for (i = 0; i < m_messageList.count(); i++) {
GncMessageArgs *m = m_messageList.at(i);
if (m->source == source) {
- if (gncdebug) qDebug("%s", QString("build text source %1, code %2, argcount %3")
- .arg(m->source).arg(m->code).arg(m->args.count()).data());
- QString ss = GncMessages::text (m->source, m->code);
+ if (gncdebug) qDebug("%s", TQString("build text source %1, code %2, argcount %3")
+ .tqarg(m->source).tqarg(m->code).tqarg(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
// with variables in a different order should still work okay (I think...)
@@ -2088,26 +2088,26 @@ QString MyMoneyGncReader::buildReportSection (const QString& source) {
}
}
if (gncdebug) qDebug ("%s", s.latin1());
- return (static_cast<const QString>(s));
+ return (static_cast<const TQString>(s));
PASS
}
//************************ writeReportToFile*********************************
-bool MyMoneyGncReader::writeReportToFile (const QValueList<QString>& sectionsToReport) {
+bool MyMoneyGncReader::writeReportToFile (const TQValueList<TQString>& sectionsToReport) {
TRY
unsigned int i;
- QFileDialog* fd = new QFileDialog (0, "Save report as", TRUE);
- fd->setMode (QFileDialog::AnyFile);
- if (fd->exec() != QDialog::Accepted) {
+ TQFileDialog* fd = new TQFileDialog (0, "Save report as", TRUE);
+ fd->setMode (TQFileDialog::AnyFile);
+ if (fd->exec() != TQDialog::Accepted) {
delete fd;
return (false);
}
- QFile reportFile(fd->selectedFile());
- QFileInfo fi (reportFile);
+ TQFile reportFile(fd->selectedFile());
+ TQFileInfo fi (reportFile);
if (!reportFile.open (IO_WriteOnly)) {
delete fd;
return (false);
}
- QTextStream stream (&reportFile);
+ TQTextStream stream (&reportFile);
for (i = 0; i < sectionsToReport.count(); i++) {
stream << buildReportSection (*sectionsToReport.at(i)).latin1() << endl;
}
@@ -2121,7 +2121,7 @@ bool MyMoneyGncReader::writeReportToFile (const QValueList<QString>& sectionsToR
*****************************************************************************/
//************************ createPayee ***************************
-QString MyMoneyGncReader::createPayee (const QString& gncDescription) {
+TQString MyMoneyGncReader::createPayee (const TQString& gncDescription) {
MyMoneyPayee payee;
try {
payee = m_storage->payeeByName (gncDescription);
@@ -2133,13 +2133,13 @@ QString MyMoneyGncReader::createPayee (const QString& gncDescription) {
return (payee.id());
}
//************************************** createOrphanAccount *******************************
-QString MyMoneyGncReader::createOrphanAccount (const QString& gncName) {
+TQString MyMoneyGncReader::createOrphanAccount (const TQString& gncName) {
MyMoneyAccount acc;
acc.setName ("orphan_" + gncName);
acc.setDescription (i18n("Orphan created from unknown gnucash account"));
- QDate today = QDate::currentDate();
+ TQDate today = TQDate::tqcurrentDate();
acc.setOpeningDate (today);
acc.setLastModified (today);
@@ -2150,11 +2150,11 @@ QString MyMoneyGncReader::createOrphanAccount (const QString& gncName) {
m_storage->addAccount (acc);
// assign the gnucash id as the key into the map to find our id
m_mapIds[gncName.utf8()] = acc.id();
- postMessage ("OR", 1, acc.name().data());
+ postMessage (TQString("OR"), 1, acc.name().ascii());
return (acc.id());
}
//****************************** incrDate *********************************************
-QDate MyMoneyGncReader::incrDate (QDate lastDate, unsigned char interval, unsigned int intervalCount) {
+TQDate MyMoneyGncReader::incrDate (TQDate lastDate, unsigned char interval, unsigned int intervalCount) {
TRY
switch (interval) {
case 'd':
@@ -2169,79 +2169,79 @@ QDate MyMoneyGncReader::incrDate (QDate lastDate, unsigned char interval, unsign
return (lastDate);
}
throw new MYMONEYEXCEPTION (i18n("Internal error - invalid interval char in incrDate"));
- QDate r = QDate(); return (r); // to keep compiler happy
+ TQDate r = TQDate(); return (r); // to keep compiler happy
PASS
}
//********************************* checkConsistency **********************************
-MyMoneyAccount MyMoneyGncReader::checkConsistency (MyMoneyAccount& parent, MyMoneyAccount& child) {
+MyMoneyAccount MyMoneyGncReader::checkConsistency (MyMoneyAccount& tqparent, MyMoneyAccount& child) {
TRY
// gnucash is flexible/weird enough to allow various inconsistencies
// these are a couple I found in my file, no doubt more will be discovered
if ((child.accountType() == MyMoneyAccount::Investment) &&
- (parent.accountType() != MyMoneyAccount::Asset)) {
+ (tqparent.accountType() != MyMoneyAccount::Asset)) {
postMessage ("CC", 1, child.name().latin1());
return m_storage->asset();
}
if ((child.accountType() == MyMoneyAccount::Income) &&
- (parent.accountType() != MyMoneyAccount::Income)) {
+ (tqparent.accountType() != MyMoneyAccount::Income)) {
postMessage ("CC", 2, child.name().latin1());
return m_storage->income();
}
if ((child.accountType() == MyMoneyAccount::Expense) &&
- (parent.accountType() != MyMoneyAccount::Expense)) {
+ (tqparent.accountType() != MyMoneyAccount::Expense)) {
postMessage ("CC", 3, child.name().latin1());
return m_storage->expense();
}
- return (parent);
+ return (tqparent);
PASS
}
//*********************************** checkInvestmentOption *************************
-void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
+void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
// implement the investment option for stock accounts
- // first check whether the parent account (gnucash id) is actually an
+ // first check whether the tqparent account (gnucash id) is actually an
// investment account. if it is, no further action is needed
MyMoneyAccount stockAcc = m_storage->account (m_mapIds[stockId.utf8()]);
- MyMoneyAccount parent;
- QString parentKey = stockAcc.parentAccountId();
- map_accountIds::Iterator id = m_mapIds.find (parentKey);
+ MyMoneyAccount tqparent;
+ TQString tqparentKey = stockAcc.tqparentAccountId();
+ map_accountIds::Iterator id = m_mapIds.tqfind (tqparentKey);
if (id != m_mapIds.end()) {
- parent = m_storage->account (id.data());
- if (parent.accountType() == MyMoneyAccount::Investment) return ;
+ tqparent = m_storage->account (id.data());
+ if (tqparent.accountType() == MyMoneyAccount::Investment) return ;
}
// so now, check the investment option requested by the user
// option 0 creates a separate investment account for each stock account
if (m_investmentOption == 0) {
MyMoneyAccount invAcc (stockAcc);
invAcc.setAccountType (MyMoneyAccount::Investment);
- invAcc.setCurrencyId (QString("")); // we don't know what currency it is!!
- invAcc.setParentAccountId (parentKey); // intersperse it between old parent and child stock acct
+ invAcc.setCurrencyId (TQString("")); // we don't know what currency it is!!
+ invAcc.setParentAccountId (tqparentKey); // intersperse it between old tqparent and child stock acct
m_storage->addAccount (invAcc);
- m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets parented (again) to investment account later
- if (gncdebug) qDebug ("Created investment account %s as id %s, parent %s", invAcc.name().data(), invAcc.id().data(),
- invAcc.parentAccountId().data());
+ m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets tqparented (again) to investment account later
+ if (gncdebug) qDebug ("Created investment account %s as id %s, tqparent %s", invAcc.name().data(), invAcc.id().data(),
+ invAcc.tqparentAccountId().data());
if (gncdebug) qDebug ("Setting stock %s, id %s, as child of %s", stockAcc.name().data(), stockAcc.id().data(), invAcc.id().data());
stockAcc.setParentAccountId (invAcc.id());
m_storage->addAccount(invAcc, stockAcc);
// investment option 1 creates a single investment account for all stocks
} else if (m_investmentOption == 1) {
- static QString singleInvAccId = "";
+ static TQString singleInvAccId = "";
MyMoneyAccount singleInvAcc;
bool ok = false;
if (singleInvAccId.isEmpty()) { // if the account has not yet been created
- QString invAccName;
+ TQString invAccName;
while (!ok) {
- invAccName = QInputDialog::getText (PACKAGE,
- i18n("Enter the investment account name "), QLineEdit::Normal,
+ invAccName = TQInputDialog::getText (PACKAGE,
+ i18n("Enter the investment account name "), TQLineEdit::Normal,
i18n("My Investments"), &ok);
}
singleInvAcc.setName (invAccName);
singleInvAcc.setAccountType (MyMoneyAccount::Investment);
- singleInvAcc.setCurrencyId (QString(""));
+ singleInvAcc.setCurrencyId (TQString(""));
singleInvAcc.setParentAccountId (m_storage->asset().id());
m_storage->addAccount (singleInvAcc);
- m_mapIds [singleInvAcc.id()] = singleInvAcc.id(); // so stock account gets parented (again) to investment account later
- if (gncdebug) qDebug ("Created investment account %s as id %s, parent %s, reparenting stock",
- singleInvAcc.name().data(), singleInvAcc.id().data(), singleInvAcc.parentAccountId().data());
+ m_mapIds [singleInvAcc.id()] = singleInvAcc.id(); // so stock account gets tqparented (again) to investment account later
+ if (gncdebug) qDebug ("Created investment account %s as id %s, tqparent %s, reparenting stock",
+ singleInvAcc.name().data(), singleInvAcc.id().data(), singleInvAcc.tqparentAccountId().data());
singleInvAccId = singleInvAcc.id();
} else { // the account has already been created
singleInvAcc = m_storage->account (singleInvAccId);
@@ -2254,9 +2254,9 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
} else if (m_investmentOption == 2) {
static int lastSelected = 0;
MyMoneyAccount invAcc (stockAcc);
- QStringList accList;
- QValueList<MyMoneyAccount> list;
- QValueList<MyMoneyAccount>::Iterator acc;
+ TQStringList accList;
+ TQValueList<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount>::Iterator acc;
m_storage->accountList(list);
// build a list of candidates for the input box
for (acc = list.begin(); acc != list.end(); ++acc) {
@@ -2265,12 +2265,12 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
}
//if (accList.isEmpty()) qFatal ("No available accounts");
bool ok = false;
- while (!ok) { // keep going till we have a valid investment parent
- QString invAccName = QInputDialog::getItem (
- PACKAGE, i18n("Select parent investment account or enter new name. Stock %1").arg(stockAcc.name ()),
+ while (!ok) { // keep going till we have a valid investment tqparent
+ TQString invAccName = TQInputDialog::getItem (
+ PACKAGE, i18n("Select tqparent investment account or enter new name. Stock %1").tqarg(stockAcc.name ()),
accList, lastSelected, true, &ok);
if (ok) {
- lastSelected = accList.findIndex (invAccName); // preserve selection for next time
+ lastSelected = accList.tqfindIndex (invAccName); // preserve selection for next time
for (acc = list.begin(); acc != list.end(); ++acc) {
if ((*acc).name() == invAccName) break;
}
@@ -2279,7 +2279,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
} else { // a new account name was entered
invAcc.setAccountType (MyMoneyAccount::Investment);
invAcc.setName (invAccName);
- invAcc.setCurrencyId (QString(""));
+ invAcc.setCurrencyId (TQString(""));
invAcc.setParentAccountId (m_storage->asset().id());
m_storage->addAccount (invAcc);
ok = true;
@@ -2289,14 +2289,14 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
} else {
// this code is probably not going to be implemented coz we can't change account types (??)
#if 0
- QMessageBox mb (PACKAGE,
- i18n ("%1 is not an Investment Account. Do you wish to make it one?").arg(invAcc.name()),
- QMessageBox::Question,
- QMessageBox::Yes | QMessageBox::Default,
- QMessageBox::No | QMessageBox::Escape,
- QMessageBox::NoButton);
+ TQMessageBox mb (PACKAGE,
+ i18n ("%1 is not an Investment Account. Do you wish to make it one?").tqarg(invAcc.name()),
+ TQMessageBox::Question,
+ TQMessageBox::Yes | TQMessageBox::Default,
+ TQMessageBox::No | TQMessageBox::Escape,
+ TQMessageBox::NoButton);
switch (mb.exec()) {
- case QMessageBox::No :
+ case TQMessageBox::No :
ok = false; break;
default:
// convert it - but what if it has splits???
@@ -2305,7 +2305,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
break;
}
#endif
- switch(KMessageBox::questionYesNo(0, i18n ("%1 is not an Investment Account. Do you wish to make it one?").arg(invAcc.name(), PACKAGE))) {
+ switch(KMessageBox::questionYesNo(0, i18n ("%1 is not an Investment Account. Do you wish to make it one?").tqarg(invAcc.name(), PACKAGE))) {
case KMessageBox::Yes:
// convert it - but what if it has splits???
qFatal ("Not yet implemented");
@@ -2318,7 +2318,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
}
} // end if ok - user pressed Cancel
} // end while !ok
- m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets parented (again) to investment account later
+ m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets tqparented (again) to investment account later
m_storage->addAccount(invAcc, stockAcc);
} else { // investment option != 0, 1, 2
qFatal ("Invalid investment option %d", m_investmentOption);
@@ -2326,7 +2326,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) {
}
// get the price source for a stock (gnc account) where online quotes are requested
-void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource) {
+void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, TQString gncSource) {
// if he wants to use Finance::Quote, no conversion of source name is needed
if (m_useFinanceQuote) {
stock.setValue ("kmm-online-quote-system", "Finance::Quote");
@@ -2337,7 +2337,7 @@ void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource)
// first check if we have already asked about this source
// (mapSources is initialy empty. We may be able to pre-fill it with some equivalent
// sources, if such things do exist. User feedback may help here.)
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString>::Iterator it;
for (it = m_mapSources.begin(); it != m_mapSources.end(); it++) {
if (it.key() == gncSource) {
stock.setValue("kmm-online-source", it.data());
@@ -2348,7 +2348,7 @@ void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource)
// not found in map, so ask the user
KGncPriceSourceDlg *dlg = new KGncPriceSourceDlg (stock.name(), gncSource);
dlg->exec();
- QString s = dlg->selectedSource();
+ TQString s = dlg->selectedSource();
if (!s.isEmpty()) {
stock.setValue("kmm-online-source", s);
m_storage->modifySecurity(stock);
@@ -2360,32 +2360,32 @@ void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource)
// functions to control the progress bar
//*********************** setProgressCallback *****************************
-void MyMoneyGncReader::setProgressCallback(void(*callback)(int, int, const QString&)) {
+void MyMoneyGncReader::setProgressCallback(void(*callback)(int, int, const TQString&)) {
m_progressCallback = callback; return ;
}
//************************** signalProgress *******************************
-void MyMoneyGncReader::signalProgress(int current, int total, const QString& msg) {
+void MyMoneyGncReader::signalProgress(int current, int total, const TQString& msg) {
if (m_progressCallback != 0)
(*m_progressCallback)(current, total, msg);
return ;
}
// error and information reporting
//***************************** Information and error messages *********************
-void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const char* arg1) {
- postMessage (source, code, QStringList(arg1));
+void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const char* arg1) {
+ postMessage (source, code, TQStringList(arg1));
}
-void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const char* arg1, const char* arg2) {
- QStringList argList(arg1);
+void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const char* arg1, const char* arg2) {
+ TQStringList argList(arg1);
argList.append(arg2);
postMessage(source, code, argList);
}
-void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const char* arg1, const char* arg2, const char* arg3) {
- QStringList argList(arg1);
+void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const char* arg1, const char* arg2, const char* arg3) {
+ TQStringList argList(arg1);
argList.append(arg2);
argList.append(arg3);
postMessage(source, code, argList);
}
-void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const QStringList& argList) {
+void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const TQStringList& argList) {
unsigned int i;
GncMessageArgs *m = new GncMessageArgs;
@@ -2394,11 +2394,11 @@ void MyMoneyGncReader::postMessage (const QString& source, const unsigned int co
// get the number of args this message requires
const unsigned int argCount = GncMessages::argCount (source, code);
if ((gncdebug) && (argCount != argList.count()))
- qDebug("%s", QString("MyMoneyGncReader::postMessage debug: Message %1, code %2, requires %3 arguments, got %4")
- .arg(source).arg(code).arg(argCount).arg(argList.count()).data());
+ 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());
// store the arguments
for (i = 0; i < argCount; i++) {
- if (i > argList.count()) m->args.append(QString());
+ if (i > argList.count()) m->args.append(TQString());
else m->args.append (argList[i]); //Adds the next argument to the list
}
m_messageList.append (m);
@@ -2426,31 +2426,31 @@ GncMessages::messText GncMessages::texts [] = {
{"ZZ", 0, ""} // stopper
};
//
-QString GncMessages::text (const QString source, const unsigned int code) {
+TQString GncMessages::text (const TQString source, const unsigned int code) {
TRY
unsigned int i;
for (i = 0; texts[i].source != "ZZ"; i++) {
if ((source == texts[i].source) && (code == texts[i].code)) break;
}
if (texts[i].source == "ZZ") {
- QString mess = QString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code);
+ TQString mess = TQString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code);
throw new MYMONEYEXCEPTION (mess);
}
return (texts[i].text);
PASS
}
//
-unsigned int GncMessages::argCount (const QString source, const unsigned int code) {
+unsigned int GncMessages::argCount (const TQString source, const unsigned int code) {
TRY
unsigned int i;
for (i = 0; texts[i].source != "ZZ"; i++) {
if ((source == texts[i].source) && (code == texts[i].code)) break;
}
if (texts[i].source == "ZZ") {
- QString mess = QString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code);
+ TQString mess = TQString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code);
throw new MYMONEYEXCEPTION (mess);
}
- QRegExp argConst ("%\\d");
+ TQRegExp argConst ("%\\d");
int offset = 0;
unsigned int argCount = 0;
while ((offset = argConst.search (texts[i].text, offset)) != -1) {