summaryrefslogtreecommitdiffstats
path: root/kmymoney2/converter
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/converter')
-rw-r--r--kmymoney2/converter/convertertest.cpp78
-rw-r--r--kmymoney2/converter/imymoneyreader.h23
-rw-r--r--kmymoney2/converter/mymoneygncreader.cpp550
-rw-r--r--kmymoney2/converter/mymoneygncreader.h326
-rw-r--r--kmymoney2/converter/mymoneyqifprofile.cpp266
-rw-r--r--kmymoney2/converter/mymoneyqifprofile.h123
-rw-r--r--kmymoney2/converter/mymoneyqifreader.cpp472
-rw-r--r--kmymoney2/converter/mymoneyqifreader.h89
-rw-r--r--kmymoney2/converter/mymoneyqifwriter.cpp58
-rw-r--r--kmymoney2/converter/mymoneyqifwriter.h29
-rw-r--r--kmymoney2/converter/mymoneystatementreader.cpp254
-rw-r--r--kmymoney2/converter/mymoneystatementreader.h21
-rw-r--r--kmymoney2/converter/mymoneytemplate.cpp142
-rw-r--r--kmymoney2/converter/mymoneytemplate.h42
-rw-r--r--kmymoney2/converter/webpricequote.cpp316
-rw-r--r--kmymoney2/converter/webpricequote.h132
16 files changed, 1465 insertions, 1456 deletions
diff --git a/kmymoney2/converter/convertertest.cpp b/kmymoney2/converter/convertertest.cpp
index aef63d9..70124ad 100644
--- a/kmymoney2/converter/convertertest.cpp
+++ b/kmymoney2/converter/convertertest.cpp
@@ -19,10 +19,10 @@
#include <config.h>
#endif
-#include <qvaluelist.h>
-#include <qvaluevector.h>
-#include <qdom.h>
-#include <qfile.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
+#include <tqdom.h>
+#include <tqfile.h>
#include <kdebug.h>
#include <kdeversion.h>
@@ -64,7 +64,7 @@ void ConverterTest::setUp () {
file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$"));
file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$"));
- file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1));
+ file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1));
file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#"));
file->setBaseCurrency(file->currency("USD"));
@@ -77,12 +77,12 @@ void ConverterTest::setUp () {
acLiability = (MyMoneyFile::instance()->liability().id());
acExpense = (MyMoneyFile::instance()->expense().id());
acIncome = (MyMoneyFile::instance()->income().id());
- acChecking = makeAccount("Checking Account",MyMoneyAccount::Checkings,moConverterCheckingOpen,QDate(2004,5,15),acAsset);
- acCredit = makeAccount("Credit Card",MyMoneyAccount::CreditCard,moConverterCreditOpen,QDate(2004,7,15),acLiability);
- acSolo = makeAccount("Solo",MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense);
- acParent = makeAccount("Parent",MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense);
- acChild = makeAccount("Child",MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent);
- acForeign = makeAccount("Foreign",MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense);
+ acChecking = makeAccount("Checking Account",MyMoneyAccount::Checkings,moConverterCheckingOpen,TQDate(2004,5,15),acAsset);
+ acCredit = makeAccount("Credit Card",MyMoneyAccount::CreditCard,moConverterCreditOpen,TQDate(2004,7,15),acLiability);
+ acSolo = makeAccount("Solo",MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense);
+ acParent = makeAccount("Parent",MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense);
+ acChild = makeAccount("Child",MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent);
+ acForeign = makeAccount("Foreign",MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense);
MyMoneyInstitution i("Bank of the World","","","","","","");
file->addInstitution(i);
@@ -112,8 +112,8 @@ void ConverterTest::testWebQuotes()
CPPUNIT_ASSERT(qr.m_errors.count() == 0);
// Quote date should be within the last week, or something bad is going on.
- CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate());
- CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7));
+ CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate());
+ CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7));
// Quote value should at least be positive
CPPUNIT_ASSERT(qr.m_price.isPositive());
@@ -123,8 +123,8 @@ void ConverterTest::testWebQuotes()
// kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl;
CPPUNIT_ASSERT(qr.m_errors.count() == 0);
- CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1));
- CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7));
+ CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1));
+ CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7));
CPPUNIT_ASSERT(qr.m_price.isPositive());
q.launch("EUR > USD","Yahoo Currency");
@@ -132,8 +132,8 @@ void ConverterTest::testWebQuotes()
// kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl;
CPPUNIT_ASSERT(qr.m_errors.count() == 0);
- CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1));
- CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7));
+ CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1));
+ CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7));
CPPUNIT_ASSERT(qr.m_price.isPositive());
q.launch("50492","Globe & Mail");
@@ -141,8 +141,8 @@ void ConverterTest::testWebQuotes()
// kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl;
CPPUNIT_ASSERT(qr.m_errors.count() == 0);
- CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1));
- CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7));
+ CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1));
+ CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7));
CPPUNIT_ASSERT(qr.m_price.isPositive());
q.launch("TDB647","MSN.CA");
@@ -150,8 +150,8 @@ void ConverterTest::testWebQuotes()
// kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl;
CPPUNIT_ASSERT(qr.m_errors.count() == 0);
- CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1));
- CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7));
+ CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1));
+ CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7));
CPPUNIT_ASSERT(qr.m_price.isPositive());
}
@@ -168,39 +168,39 @@ void ConverterTest::testDateFormat()
{
MyMoneyDateFormat format("%mm-%dd-%yyyy");
- CPPUNIT_ASSERT(format.convertString("1-5-2005") == QDate(2005,1,5));
- CPPUNIT_ASSERT(format.convertString("jan-15-2005") == QDate(2005,1,15));
- CPPUNIT_ASSERT(format.convertString("august-25-2005") == QDate(2005,8,25));
+ CPPUNIT_ASSERT(format.convertString("1-5-2005") == TQDate(2005,1,5));
+ CPPUNIT_ASSERT(format.convertString("jan-15-2005") == TQDate(2005,1,15));
+ CPPUNIT_ASSERT(format.convertString("august-25-2005") == TQDate(2005,8,25));
format = MyMoneyDateFormat("%mm/%dd/%yy");
- CPPUNIT_ASSERT(format.convertString("1/5/05") == QDate(2005,1,5));
- CPPUNIT_ASSERT(format.convertString("jan/15/05") == QDate(2005,1,15));
- CPPUNIT_ASSERT(format.convertString("august/25/05") == QDate(2005,8,25));
+ CPPUNIT_ASSERT(format.convertString("1/5/05") == TQDate(2005,1,5));
+ CPPUNIT_ASSERT(format.convertString("jan/15/05") == TQDate(2005,1,15));
+ CPPUNIT_ASSERT(format.convertString("august/25/05") == TQDate(2005,8,25));
format = MyMoneyDateFormat("%d\\.%m\\.%yy");
- CPPUNIT_ASSERT(format.convertString("1.5.05") == QDate(2005,5,1));
- CPPUNIT_ASSERT(format.convertString("15.jan.05") == QDate(2005,1,15));
- CPPUNIT_ASSERT(format.convertString("25.august.05") == QDate(2005,8,25));
+ CPPUNIT_ASSERT(format.convertString("1.5.05") == TQDate(2005,5,1));
+ CPPUNIT_ASSERT(format.convertString("15.jan.05") == TQDate(2005,1,15));
+ CPPUNIT_ASSERT(format.convertString("25.august.05") == TQDate(2005,8,25));
format = MyMoneyDateFormat("%yyyy\\\\%dddd\\\\%mmmmmmmmmmm");
- CPPUNIT_ASSERT(format.convertString("2005\\31\\12") == QDate(2005,12,31));
- CPPUNIT_ASSERT(format.convertString("2005\\15\\jan") == QDate(2005,1,15));
- CPPUNIT_ASSERT(format.convertString("2005\\25\\august") == QDate(2005,8,25));
+ CPPUNIT_ASSERT(format.convertString("2005\\31\\12") == TQDate(2005,12,31));
+ CPPUNIT_ASSERT(format.convertString("2005\\15\\jan") == TQDate(2005,1,15));
+ CPPUNIT_ASSERT(format.convertString("2005\\25\\august") == TQDate(2005,8,25));
format = MyMoneyDateFormat("%m %dd, %yyyy");
- CPPUNIT_ASSERT(format.convertString("jan 15, 2005") == QDate(2005,1,15));
- CPPUNIT_ASSERT(format.convertString("august 25, 2005") == QDate(2005,8,25));
- CPPUNIT_ASSERT(format.convertString("january 1st, 2005") == QDate(2005,1,1));
+ CPPUNIT_ASSERT(format.convertString("jan 15, 2005") == TQDate(2005,1,15));
+ CPPUNIT_ASSERT(format.convertString("august 25, 2005") == TQDate(2005,8,25));
+ CPPUNIT_ASSERT(format.convertString("january 1st, 2005") == TQDate(2005,1,1));
format = MyMoneyDateFormat("%m %d %y");
- CPPUNIT_ASSERT(format.convertString("12/31/50",false,2000) == QDate(1950,12,31));
- CPPUNIT_ASSERT(format.convertString("1/1/90",false,2000) == QDate(1990,1,1));
- CPPUNIT_ASSERT(format.convertString("december 31st, 5",false) == QDate(2005,12,31));
+ CPPUNIT_ASSERT(format.convertString("12/31/50",false,2000) == TQDate(1950,12,31));
+ CPPUNIT_ASSERT(format.convertString("1/1/90",false,2000) == TQDate(1990,1,1));
+ CPPUNIT_ASSERT(format.convertString("december 31st, 5",false) == TQDate(2005,12,31));
}
catch (MyMoneyException* e)
{
diff --git a/kmymoney2/converter/imymoneyreader.h b/kmymoney2/converter/imymoneyreader.h
index 6222af5..6fa530d 100644
--- a/kmymoney2/converter/imymoneyreader.h
+++ b/kmymoney2/converter/imymoneyreader.h
@@ -26,9 +26,9 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qobject.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -45,13 +45,14 @@
* @author Kevin Tambascio
*/
-class IMyMoneyReader : public QObject
+class IMyMoneyReader : public TQObject
{
public:
IMyMoneyReader() {}
virtual ~IMyMoneyReader() {}
Q_OBJECT
+ TQ_OBJECT
/**
* This method is used to store the filename into the object.
@@ -62,7 +63,7 @@ public:
*
* @param name path and name of the file to be imported
*/
- virtual void setFilename(const QString& name)=0;
+ virtual void setFilename(const TQString& name)=0;
/**
* This method is used to store the name of the profile into the object.
@@ -71,16 +72,16 @@ public:
* the file is send through this filter and the result
* is stored in the m_tempFile file.
*
- * @param name QString reference to the name of the profile
+ * @param name TQString reference to the name of the profile
*/
- virtual void setProfile(const QString& name)=0;
+ virtual void setProfile(const TQString& name)=0;
/**
* This method actually starts the import of data from the selected file
* into the MyMoney engine.
*
* This method also starts the user defined import filter program
- * defined in the QIF profile(when a QIF file is selected). If none is
+ * defined in the TQIF profile(when a TQIF file is selected). If none is
* defined, the file is read as is (actually the UNIX command
* 'cat -' is used as the filter).
*
@@ -123,12 +124,12 @@ public:
virtual void setAskPayeeCategory(const bool ask)=0;
virtual const MyMoneyAccount& account() const { return m_account; };
- virtual void setProgressCallback(void(*callback)(int, int, const QString&)) { m_progressCallback = callback; }
+ virtual void setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; }
private:
MyMoneyAccount m_account;
- void (*m_progressCallback)(int, int, const QString&);
- QString m_filename;
+ void (*m_progressCallback)(int, int, const TQString&);
+ TQString m_filename;
};
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) {
diff --git a/kmymoney2/converter/mymoneygncreader.h b/kmymoney2/converter/mymoneygncreader.h
index df08913..fcda8ea 100644
--- a/kmymoney2/converter/mymoneygncreader.h
+++ b/kmymoney2/converter/mymoneygncreader.h
@@ -24,7 +24,7 @@ The main class of this module, MyMoneyGncReader, contains only a readFile()
function, which controls the import of data from an XML file created by the
current GnuCash version (1.8.8).
-The XML is processed in class XmlReader, which is an implementation of the Qt
+The XML is processed in class XmlReader, which is an implementation of the TQt
SAX2 reader class.
Data in the input file is processed as a set of objects which fortunately,
@@ -48,7 +48,7 @@ the 'container' elements are ignored.
XmlReader
-This is an implementation of the Qt QXmlDefaultHandler class, which provides
+This is an implementation of the TQt TQXmlDefaultHandler class, which provides
three main function calls in addition to start and end of document. The
startElement() and endElement() calls are self-explanatory, the characters()
function provides data strings. Thus in the above example, the sequence of calls
@@ -96,14 +96,14 @@ element name which started the current object. If so, the object's terminate()
function is called. If the object represents a similar KMM object, this will
normally result in a call to a conversion routine in the main
(MyMoneyGncReader) class to convert the data to native format and place it in
-storage. The stack is then popped, and the parent (now current) object notified
+storage. The stack is then popped, and the tqparent (now current) object notified
by a call to its endSubEl() function. Again depending on the type of object,
this will either delete the instance, or save it in its own storage for later
processing.
For example, a GncSplit object makes little sense outside the context of its
transaction, so will be saved by the transaction. A GncTransaction object on the
other hand will be converted, along with its attendant splits, and then deleted
-by its parent.
+by its tqparent.
Since at any one time an object will only be processing either a subobject or a
data element, a single object variable, m_state, is used to determine the actual
@@ -149,15 +149,15 @@ allow us to test the structure, if not the data content, of the file.
// ----------------------------------------------------------------------------
// QT Includes
-#include <qdatastream.h>
-class QIODevice;
-#include <qobject.h>
-#include <qvaluelist.h>
-#include <qptrlist.h>
-#include <qptrstack.h>
-#include <qxml.h>
-#include <qdatetime.h>
-#include <qtextcodec.h>
+#include <tqdatastream.h>
+class TQIODevice;
+#include <tqobject.h>
+#include <tqvaluelist.h>
+#include <tqptrlist.h>
+#include <tqptrstack.h>
+#include <tqxml.h>
+#include <tqdatetime.h>
+#include <tqtextcodec.h>
// ----------------------------------------------------------------------------
// Project Includes
@@ -175,11 +175,11 @@ class QIODevice;
#define VERSION_0_61_XML 0x10000011 // use 8 bytes for MyMoneyMoney objects
#define GNUCASH_ID_KEY "GNUCASH_ID"
-typedef QMap<QString, QString> map_accountIds;
+typedef TQMap<TQString, TQString> map_accountIds;
typedef map_accountIds::iterator map_accountIds_iter;
typedef map_accountIds::const_iterator map_accountIds_citer;
-typedef QMap<QString, QStringList> map_elementVersions;
+typedef TQMap<TQString, TQStringList> map_elementVersions;
class MyMoneyGncReader;
@@ -199,29 +199,29 @@ protected:
friend class MyMoneyGncReader;
// check for sub object element; if it is, create the object
- GncObject *isSubElement (const QString &elName, const QXmlAttributes& elAttrs);
+ GncObject *isSubElement (const TQString &elName, const TQXmlAttributes& elAttrs);
// check for data element; if so, set data pointer
- bool isDataElement (const QString &elName, const QXmlAttributes& elAttrs);
+ bool isDataElement (const TQString &elName, const TQXmlAttributes& elAttrs);
// process start element for 'this'; normally for attribute checking; other initialization done in constructor
- virtual void initiate (const QString&, const QXmlAttributes&) { return ;};
+ virtual void initiate (const TQString&, const TQXmlAttributes&) { return ;};
// a sub object has completed; process the data it gathered
virtual void endSubEl(GncObject *) {m_dataPtr = 0; return ;};
// store data for data element
- void storeData (const QString& pData) // NB - data MAY come in chunks, and may need to be anonymized
+ void storeData (const TQString& pData) // NB - data MAY come in chunks, and may need to be anonymized
{if (m_dataPtr != 0)
m_dataPtr->append (hide (pData, m_anonClass)); return ;}
// following is provided only for a future file anonymizer
- QString getData () const { return ((m_dataPtr != 0) ? *m_dataPtr : "");};
+ TQString getData () const { return ((m_dataPtr != 0) ? *m_dataPtr : "");};
void resetDataPtr() {m_dataPtr = 0;};
// process end element for 'this'; usually to convert to KMM format
virtual void terminate() { return ;};
- void setVersion (const QString& v) {m_version = v; return; };
- QString version() const {return (m_version);};
+ void setVersion (const TQString& v) {m_version = v; return; };
+ TQString version() const {return (m_version);};
// some gnucash elements have version attribute; check it
- void checkVersion (const QString&, const QXmlAttributes&, const map_elementVersions&);
+ void checkVersion (const TQString&, const TQXmlAttributes&, const map_elementVersions&);
// get name of element processed by 'this'
- QString getElName () const { return (m_elementName);};
+ TQString getElName () const { return (m_elementName);};
// pass 'main' pointer to object
void setPm (MyMoneyGncReader *pM) {pMain = pM;};
// debug only
@@ -230,24 +230,24 @@ protected:
// called by isSubElement to create appropriate sub object
virtual GncObject *startSubEl() { return (0);};
// called by isDataElement to set variable pointer
- virtual void dataEl(const QXmlAttributes&) {m_dataPtr = m_v.at(m_state); m_anonClass = m_anonClassList[m_state];};
+ virtual void dataEl(const TQXmlAttributes&) {m_dataPtr = m_v.at(m_state); m_anonClass = m_anonClassList[m_state];};
// return gnucash data string variable pointer
- virtual QString var (int i) const;
+ virtual TQString var (int i) const;
// anonymize data
- virtual QString hide (QString, unsigned int);
+ virtual TQString hide (TQString, unsigned int);
MyMoneyGncReader *pMain; // pointer to 'main' class
// used at start of each transaction so same money hide factor is applied to all splits
void adjustHideFactor();
- QString m_elementName; // save 'this' element's name
- QString m_version; // and it's gnucash version
- const QString *m_subElementList; // list of sub object element names for 'this'
+ TQString m_elementName; // save 'this' element's name
+ TQString m_version; // and it's gnucash version
+ const TQString *m_subElementList; // list of sub object element names for 'this'
unsigned int m_subElementListCount; // count of above
- const QString *m_dataElementList; // ditto for data elements
+ const TQString *m_dataElementList; // ditto for data elements
unsigned int m_dataElementListCount;
- QString *m_dataPtr; // pointer to m_v variable for current data item
- mutable QPtrList<QString> m_v; // storage for variable pointers
+ TQString *m_dataPtr; // pointer to m_v variable for current data item
+ mutable TQPtrList<TQString> m_v; // storage for variable pointers
unsigned int m_state; // effectively, the index to subElementList or dataElementList, whichever is currently in use
@@ -283,13 +283,13 @@ public:
protected:
friend class MyMoneyGncReader;
friend class GncTransaction;
- bool isCurrency() const { return (*m_v.at(CMDTYSPC) == QString("ISO4217"));};
- QString id() const { return (*m_v.at(CMDTYID));};
- QString space() const { return (*m_v.at(CMDTYSPC));};
+ bool isCurrency() const { return (*m_v.at(CMDTYSPC) == TQString("ISO4217"));};
+ TQString id() const { return (*m_v.at(CMDTYID));};
+ TQString space() const { return (*m_v.at(CMDTYSPC));};
private:
// data elements
enum CmdtySpecDataEls {CMDTYSPC, CMDTYID, END_CmdtySpec_DELS};
- virtual QString hide (QString, unsigned int);
+ virtual TQString hide (TQString, unsigned int);
};
// *********************************************************************
// date; maybe one of two types, ts:date which is date/time, gdate which is date only
@@ -305,11 +305,11 @@ protected:
friend class GncSplit;
friend class GncSchedule;
friend class GncRecurrence;
- const QDate date() const { return (QDate::fromString(m_v.at(TSDATE)->section(' ', 0, 0), Qt::ISODate));};
+ const TQDate date() const { return (TQDate::fromString(m_v.at(TSDATE)->section(' ', 0, 0), Qt::ISODate));};
private:
// data elements
enum DateDataEls {TSDATE, GDATE, END_Date_DELS};
- virtual void dataEl(const QXmlAttributes&) {m_dataPtr = m_v.at(TSDATE); m_anonClass = GncObject::ASIS;}
+ virtual void dataEl(const TQXmlAttributes&) {m_dataPtr = m_v.at(TSDATE); m_anonClass = GncObject::ASIS;}
; // treat both date types the same
};
// ************* GncKvp********************************************
@@ -324,9 +324,9 @@ public:
protected:
friend class MyMoneyGncReader;
- QString key() const { return (var(KEY));};
- QString value() const { return (var(VALUE));};
- QString type() const { return (m_kvpType);};
+ TQString key() const { return (var(KEY));};
+ TQString value() const { return (var(VALUE));};
+ TQString type() const { return (m_kvpType);};
unsigned int kvpCount() const { return (m_kvpList.count());};
const GncKvp *getKvp(unsigned int i) const { return (static_cast<GncKvp *>(m_kvpList.at(i)));};
private:
@@ -336,9 +336,9 @@ private:
virtual void endSubEl(GncObject *);
// data elements
enum KvpDataEls {KEY, VALUE, END_Kvp_DELS };
- virtual void dataEl (const QXmlAttributes&);
- mutable QPtrList<GncObject> m_kvpList;
- QString m_kvpType; // type is an XML attribute
+ virtual void dataEl (const TQXmlAttributes&);
+ mutable TQPtrList<GncObject> m_kvpList;
+ TQString m_kvpType; // type is an XML attribute
};
// ************* GncLot********************************************
// KMM doesn't have support for lots as yet
@@ -361,9 +361,9 @@ public:
GncCountData ();
~GncCountData ();
private:
- virtual void initiate (const QString&, const QXmlAttributes&);
+ virtual void initiate (const TQString&, const TQXmlAttributes&);
virtual void terminate();
- QString m_countType; // type of element being counted
+ TQString m_countType; // type of element being counted
};
//********************************************************************
class GncCommodity : public GncObject {
@@ -373,11 +373,11 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values
- bool isCurrency() const { return (var(SPACE) == QString("ISO4217"));};
- QString space() const { return (var(SPACE));};
- QString id() const { return (var(ID));};
- QString name() const { return (var(NAME));};
- QString fraction() const { return (var(FRACTION));};
+ bool isCurrency() const { return (var(SPACE) == TQString("ISO4217"));};
+ TQString space() const { return (var(SPACE));};
+ TQString id() const { return (var(ID));};
+ TQString name() const { return (var(NAME));};
+ TQString fraction() const { return (var(FRACTION));};
private:
virtual void terminate();
// data elements
@@ -393,8 +393,8 @@ protected:
// access data values
const GncCmdtySpec *commodity() const { return (m_vpCommodity);};
const GncCmdtySpec *currency() const { return (m_vpCurrency);};
- QString value() const { return (var(VALUE));};
- QDate priceDate () const { return (m_vpPriceDate->date());};
+ TQString value() const { return (var(VALUE));};
+ TQDate priceDate () const { return (m_vpPriceDate->date());};
private:
virtual void terminate();
// sub object elements
@@ -415,11 +415,11 @@ protected:
friend class MyMoneyGncReader;
// access data values
GncCmdtySpec *commodity() const { return (m_vpCommodity);};
- QString id () const { return (var(ID));};
- QString name () const { return (var(NAME));};
- QString desc () const { return (var(DESC));};
- QString type () const { return (var(TYPE));};
- QString parent () const { return (var(PARENT));};
+ TQString id () const { return (var(ID));};
+ TQString name () const { return (var(NAME));};
+ TQString desc () const { return (var(DESC));};
+ TQString type () const { return (var(TYPE));};
+ TQString tqparent () const { return (var(PARENT));};
private:
// subsidiary objects/elements
enum AccountSubEls {CMDTY, KVP, LOTS, END_Account_SELS };
@@ -429,7 +429,7 @@ private:
// data elements
enum AccountDataEls {ID, NAME, DESC, TYPE, PARENT, END_Account_DELS };
GncCmdtySpec *m_vpCommodity;
- QPtrList<GncObject> m_kvpList;
+ TQPtrList<GncObject> m_kvpList;
};
// ************* GncSplit********************************************
class GncSplit : public GncObject {
@@ -439,20 +439,20 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values
- QString id() const { return (var(ID));};
- QString memo() const { return (var(MEMO));};
- QString recon() const { return (var(RECON));};
- QString value() const { return (var(VALUE));};
- QString qty() const { return (var(QTY));};
- QString acct() const { return (var(ACCT));};
-const QDate reconDate() const {QDate x = QDate(); return (m_vpDateReconciled == NULL ? x : m_vpDateReconciled->date());};
+ TQString id() const { return (var(ID));};
+ TQString memo() const { return (var(MEMO));};
+ TQString recon() const { return (var(RECON));};
+ TQString value() const { return (var(VALUE));};
+ TQString qty() const { return (var(TQTY));};
+ TQString acct() const { return (var(ACCT));};
+const TQDate reconDate() const {TQDate x = TQDate(); return (m_vpDateReconciled == NULL ? x : m_vpDateReconciled->date());};
private:
// subsidiary objects/elements
enum TransactionSubEls {RECDATE, END_Split_SELS };
virtual GncObject *startSubEl();
virtual void endSubEl(GncObject *);
// data elements
- enum SplitDataEls {ID, MEMO, RECON, VALUE, QTY, ACCT, END_Split_DELS };
+ enum SplitDataEls {ID, MEMO, RECON, VALUE, TQTY, ACCT, END_Split_DELS };
GncDate *m_vpDateReconciled;
};
// ************* GncTransaction********************************************
@@ -463,12 +463,12 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values
- QString id() const { return (var(ID));};
- QString no() const { return (var(NO));};
- QString desc() const { return (var(DESC));};
- QString currency() const { return (m_vpCurrency == NULL ? QString () : m_vpCurrency->id());};
- QDate dateEntered() const { return (m_vpDateEntered->date());};
- QDate datePosted() const { return (m_vpDatePosted->date());};
+ TQString id() const { return (var(ID));};
+ TQString no() const { return (var(NO));};
+ TQString desc() const { return (var(DESC));};
+ TQString currency() const { return (m_vpCurrency == NULL ? TQString () : m_vpCurrency->id());};
+ TQDate dateEntered() const { return (m_vpDateEntered->date());};
+ TQDate datePosted() const { return (m_vpDatePosted->date());};
bool isTemplate() const { return (m_template);};
unsigned int splitCount() const { return (m_splitList.count());};
unsigned int kvpCount() const { return (m_kvpList.count());};
@@ -484,9 +484,9 @@ private:
enum TransactionDataEls {ID, NO, DESC, END_Transaction_DELS };
GncCmdtySpec *m_vpCurrency;
GncDate *m_vpDateEntered, *m_vpDatePosted;
- mutable QPtrList<GncObject> m_splitList;
+ mutable TQPtrList<GncObject> m_splitList;
bool m_template; // true if this is a template for scheduled transaction
- mutable QPtrList<GncObject> m_kvpList;
+ mutable TQPtrList<GncObject> m_kvpList;
};
// ************* GncTemplateSplit********************************************
@@ -497,12 +497,12 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values
- QString id() const { return (var(ID));};
- QString memo() const { return (var(MEMO));};
- QString recon() const { return (var(RECON));};
- QString value() const { return (var(VALUE));};
- QString qty() const { return (var(QTY));};
- QString acct() const { return (var(ACCT));};
+ TQString id() const { return (var(ID));};
+ TQString memo() const { return (var(MEMO));};
+ TQString recon() const { return (var(RECON));};
+ TQString value() const { return (var(VALUE));};
+ TQString qty() const { return (var(TQTY));};
+ TQString acct() const { return (var(ACCT));};
unsigned int kvpCount() const { return (m_kvpList.count());};
const GncKvp *getKvp(unsigned int i) const { return (static_cast<GncKvp *>(m_kvpList.at(i)));};
private:
@@ -511,8 +511,8 @@ private:
virtual GncObject *startSubEl();
virtual void endSubEl(GncObject *);
// data elements
- enum TemplateSplitDataEls {ID, MEMO, RECON, VALUE, QTY, ACCT, END_TemplateSplit_DELS };
- mutable QPtrList<GncObject> m_kvpList;
+ enum TemplateSplitDataEls {ID, MEMO, RECON, VALUE, TQTY, ACCT, END_TemplateSplit_DELS };
+ mutable TQPtrList<GncObject> m_kvpList;
};
// ************* GncSchedule********************************************
class GncFreqSpec;
@@ -525,23 +525,23 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values
- QString name() const { return (var(NAME));};
- QString enabled() const {return var(ENABLED);};
- QString autoCreate() const { return (var(AUTOC));};
- QString autoCrNotify() const { return (var(AUTOCN));};
- QString autoCrDays() const { return (var(AUTOCD));};
- QString advCrDays() const { return (var(ADVCD));};
- QString advCrRemindDays() const { return (var(ADVRD));};
- QString instanceCount() const { return (var(INSTC));};
- QString numOccurs() const { return (var(NUMOCC));};
- QString remOccurs() const { return (var(REMOCC));};
- QString templId() const { return (var(TEMPLID));};
- QDate startDate () const
- {QDate x = QDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());};
- QDate lastDate () const
- {QDate x = QDate(); return (m_vpLastDate == NULL ? x : m_vpLastDate->date());};
- QDate endDate() const
- {QDate x = QDate(); return (m_vpEndDate == NULL ? x : m_vpEndDate->date());};
+ TQString name() const { return (var(NAME));};
+ TQString enabled() const {return var(ENABLED);};
+ TQString autoCreate() const { return (var(AUTOC));};
+ TQString autoCrNotify() const { return (var(AUTOCN));};
+ TQString autoCrDays() const { return (var(AUTOCD));};
+ TQString advCrDays() const { return (var(ADVCD));};
+ TQString advCrRemindDays() const { return (var(ADVRD));};
+ TQString instanceCount() const { return (var(INSTC));};
+ TQString numOccurs() const { return (var(NUTQMOCC));};
+ TQString remOccurs() const { return (var(RETQMOCC));};
+ TQString templId() const { return (var(TEMPLID));};
+ TQDate startDate () const
+ {TQDate x = TQDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());};
+ TQDate lastDate () const
+ {TQDate x = TQDate(); return (m_vpLastDate == NULL ? x : m_vpLastDate->date());};
+ TQDate endDate() const
+ {TQDate x = TQDate(); return (m_vpEndDate == NULL ? x : m_vpEndDate->date());};
const GncFreqSpec *getFreqSpec() const { return (m_vpFreqSpec);};
const GncSchedDef *getSchedDef() const { return (m_vpSchedDef);};
private:
@@ -552,10 +552,10 @@ private:
virtual void terminate();
// data elements
enum ScheduleDataEls {NAME, ENABLED, AUTOC, AUTOCN, AUTOCD, ADVCD, ADVRD, INSTC,
- NUMOCC, REMOCC, TEMPLID, END_Schedule_DELS };
+ NUTQMOCC, RETQMOCC, TEMPLID, END_Schedule_DELS };
GncDate *m_vpStartDate, *m_vpLastDate, *m_vpEndDate;
GncFreqSpec *m_vpFreqSpec;
- mutable QPtrList<GncRecurrence> m_vpRecurrence; // gnc handles multiple occurrences
+ mutable TQPtrList<GncRecurrence> m_vpRecurrence; // gnc handles multiple occurrences
GncSchedDef *m_vpSchedDef;
};
// ************* GncFreqSpec********************************************
@@ -566,7 +566,7 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values (only interval type used at present)
- QString intervalType() const { return (var(INTVT));};
+ TQString intervalType() const { return (var(INTVT));};
private:
// subsidiary objects/elements
enum FreqSpecSubEls {COMPO, END_FreqSpec_SELS };
@@ -575,7 +575,7 @@ private:
// data elements
enum FreqSpecDataEls {INTVT, MONTHLY, DAILY, WEEKLY, INTVI, INTVO, INTVD, END_FreqSpec_DELS};
virtual void terminate();
- mutable QPtrList<GncObject> m_fsList;
+ mutable TQPtrList<GncObject> m_fsList;
};
// ************* GncRecurrence********************************************
@@ -587,11 +587,11 @@ public:
protected:
friend class MyMoneyGncReader;
// access data values
- QDate startDate () const
- {QDate x = QDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());};
- QString mult() const {return (var(MULT));};
- QString periodType() const {return (var(PERIODTYPE));};
- QString getFrequency() const;
+ TQDate startDate () const
+ {TQDate x = TQDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());};
+ TQString mult() const {return (var(MULT));};
+ TQString periodType() const {return (var(PERIODTYPE));};
+ TQString getFrequency() const;
private:
// subsidiary objects/elements
enum RecurrenceSubEls {STARTDATE, END_Recurrence_SELS };
@@ -618,25 +618,25 @@ class GncSchedDef : public GncObject {
// ****************************************************************************************
/**
XML Reader
- The XML reader is an implementation of the Qt SAX2 XML parser. It determines the type
+ The XML reader is an implementation of the TQt SAX2 XML parser. It determines the type
of object represented by the XMl, and calls the appropriate object functions
*/
// *****************************************************************************************
-class XmlReader : public QXmlDefaultHandler {
+class XmlReader : public TQXmlDefaultHandler {
protected:
friend class MyMoneyGncReader;
XmlReader (MyMoneyGncReader *pM) : pMain(pM) {} // keep pointer to 'main'
- void processFile (QIODevice*); // main entry point of reader
+ void processFile (TQIODevice*); // main entry point of reader
// define xml content handler functions
bool startDocument ();
- bool startElement (const QString&, const QString&, const QString&, const QXmlAttributes&);
- bool endElement (const QString&, const QString&, const QString&);
- bool characters (const QString &);
+ bool startElement (const TQString&, const TQString&, const TQString&, const TQXmlAttributes&);
+ bool endElement (const TQString&, const TQString&, const TQString&);
+ bool characters (const TQString &);
bool endDocument();
private:
- QXmlInputSource *m_source;
- QXmlSimpleReader *m_reader;
- QPtrStack<GncObject> m_os; // stack of sub objects
+ TQXmlInputSource *m_source;
+ TQXmlSimpleReader *m_reader;
+ TQPtrStack<GncObject> m_os; // stack of sub objects
GncObject *m_co; // current object, for ease of coding (=== m_os.top)
MyMoneyGncReader *pMain; // the 'main' pointer, to pass on to objects
bool m_headerFound; // check for gnc-v2 header
@@ -652,21 +652,21 @@ private:
class GncMessageArgs {
protected:
friend class MyMoneyGncReader;
- QString source; // 'type of message
+ TQString source; // 'type of message
unsigned int code; // to identify actual message
- QValueList<QString> args; // variable arguments
+ TQValueList<TQString> args; // variable arguments
};
class GncMessages {
protected:
friend class MyMoneyGncReader;
- static QString text (const QString, const unsigned int); // returns text of identified message
- static unsigned int argCount (const QString, const unsigned int); // returns no. of args required
+ static TQString text (const TQString, const unsigned int); // returns text of identified message
+ static unsigned int argCount (const TQString, const unsigned int); // returns no. of args required
private:
typedef struct {
- const QString source;
+ const TQString source;
const unsigned int code;
- QString text;
+ TQString text;
}
messText;
static messText texts [];
@@ -695,12 +695,12 @@ public:
*
*/
#ifndef _GNCFILEANON
- void readFile (QIODevice* pDevice, IMyMoneySerialize* storage); // main entry point, IODevice is gnucash file
- void writeFile (QIODevice*, IMyMoneySerialize*) { return ;}; // dummy entry needed by kmymoneywiew. we will not be writing
+ void readFile (TQIODevice* pDevice, IMyMoneySerialize* storage); // main entry point, IODevice is gnucash file
+ void writeFile (TQIODevice*, IMyMoneySerialize*) { return ;}; // dummy entry needed by kmymoneywiew. we will not be writing
#else
- void readFile (QString, QString);
+ void readFile (TQString, TQString);
#endif // _GNCFILEANON
- QTextCodec *m_decoder;
+ TQTextCodec *m_decoder;
protected:
friend class GncObject; // pity we can't just say GncObject. And compiler doesn't like multiple friends on one line...
friend class GncFile; // there must be a better way...
@@ -743,12 +743,12 @@ protected:
void convertFreqSpec (const GncFreqSpec *) {return;};
#endif // _GNCFILEANON
/** to post messages for final report */
- void postMessage (const QString&, const unsigned int, const char *);
- void postMessage (const QString&, const unsigned int, const char *, const char *);
- void postMessage (const QString&, const unsigned int, const char *, const char *, const char *);
- void postMessage (const QString&, const unsigned int, const QStringList&);
- void setProgressCallback (void(*callback)(int, int, const QString&));
- void signalProgress (int current, int total, const QString& = "");
+ void postMessage (const TQString&, const unsigned int, const char *);
+ void postMessage (const TQString&, const unsigned int, const char *, const char *);
+ void postMessage (const TQString&, const unsigned int, const char *, const char *, const char *);
+ void postMessage (const TQString&, const unsigned int, const TQStringList&);
+ void setProgressCallback (void(*callback)(int, int, const TQString&));
+ void signalProgress (int current, int total, const TQString& = "");
/** user options */
/**
Scheduled Transactions
@@ -809,24 +809,24 @@ private:
void setOptions (); // to set user options from dialog
void setFileHideFactor ();
// the following handles the gnucash indicator for a bad value (-1/0) which causes us probs
- QString convBadValue (QString gncValue) const {return (gncValue == "-1/0" ? "0/1" : gncValue); };
+ TQString convBadValue (TQString gncValue) const {return (gncValue == "-1/0" ? "0/1" : gncValue); };
#ifndef _GNCFILEANON
- MyMoneyTransaction convertTemplateTransaction (const QString&, const GncTransaction *);
- void convertTemplateSplit (const QString&, const GncTemplateSplit *);
+ MyMoneyTransaction convertTemplateTransaction (const TQString&, const GncTransaction *);
+ void convertTemplateSplit (const TQString&, const GncTemplateSplit *);
#endif // _GNCFILEANON
// wind up when all done
void terminate();
- QString buildReportSection (const QString&);
- bool writeReportToFile (const QValueList<QString>&);
+ TQString buildReportSection (const TQString&);
+ bool writeReportToFile (const TQValueList<TQString>&);
// main storage
#ifndef _GNCFILEANON
IMyMoneyStorage *m_storage;
#else
- QTextStream oStream;
+ TQTextStream oStream;
#endif // _GNCFILEANON
XmlReader *m_xr;
/** to hold the callback pointer for the progress bar */
- void (*m_progressCallback)(int, int, const QString&);
+ void (*m_progressCallback)(int, int, const TQString&);
// a map of which versions of the various elements (objects) we can import
map_elementVersions m_versionList;
// counters holding count data from the Gnc 'count-data' section
@@ -851,53 +851,53 @@ private:
// counters for error reporting
int m_ccCount, m_orCount, m_scCount;
// currency counter
- QMap<QString, unsigned int> m_currencyCount;
+ TQMap<TQString, unsigned int> m_currencyCount;
/**
* Map gnucash vs. Kmm ids for accounts, equities, schedules, price sources
*/
- QMap<QString, QString> m_mapIds;
- QString m_rootId; // save the root id for terminate()
- QMap<QString, QString> m_mapEquities;
- QMap<QString, QString> m_mapSchedules;
- QMap<QString, QString> m_mapSources;
+ TQMap<TQString, TQString> m_mapIds;
+ TQString m_rootId; // save the root id for terminate()
+ TQMap<TQString, TQString> m_mapEquities;
+ TQMap<TQString, TQString> m_mapSchedules;
+ TQMap<TQString, TQString> m_mapSources;
/**
* A list of stock accounts (gnc ids) which will be held till the end
so we can implement the user's investment option
*/
- QValueList<QString> m_stockList;
+ TQValueList<TQString> m_stockList;
/**
* Temporary storage areas for transaction processing
*/
- QString m_txCommodity; // save commodity for current transaction
- QString m_txPayeeId; // gnc has payee at tx level, we need it at split level
- QDate m_txDatePosted; // ditto for post date
- QString m_txChequeNo; // ditto for cheque number
+ TQString m_txCommodity; // save commodity for current transaction
+ TQString m_txPayeeId; // gnc has payee at tx level, we need it at split level
+ TQDate m_txDatePosted; // ditto for post date
+ TQString m_txChequeNo; // ditto for cheque number
/** In kmm, the order of splits is critical to some operations. These
* areas will hold the splits until we've read them all */
- QValueList<MyMoneySplit> m_splitList, m_liabilitySplitList, m_otherSplitList;
+ TQValueList<MyMoneySplit> m_splitList, m_liabilitySplitList, m_otherSplitList;
bool m_potentialTransfer; // to determine whether this might be a transfer
/** Schedules are processed through 3 different functions, any of which may set this flag */
bool m_suspectSchedule;
/**
* A holding area for template txs while we're waiting for the schedules
*/
- QPtrList<GncTransaction> m_templateList;
+ TQPtrList<GncTransaction> m_templateList;
/** Hold a list of suspect schedule ids for later processing? */
- QValueList<QString> m_suspectList;
+ TQValueList<TQString> m_suspectList;
/**
* To hold message data till final report
*/
- QPtrList<GncMessageArgs> m_messageList;
+ TQPtrList<GncMessageArgs> m_messageList;
GncMessages *m_messageTexts;
/**
* Internal utility functions
*/
- QString createPayee (const QString&); // create a payee and return it's id
- QString createOrphanAccount (const QString&); // create unknown account and return the id
- QDate incrDate (QDate lastDate, unsigned char interval, unsigned int intervalCount); // for date calculations
- MyMoneyAccount checkConsistency (MyMoneyAccount& parent, MyMoneyAccount& child); // gnucash is sometimes TOO flexible
- void checkInvestmentOption (QString stockId); // implement user investment option
- void getPriceSource (MyMoneySecurity stock, QString gncSource);
+ TQString createPayee (const TQString&); // create a payee and return it's id
+ TQString createOrphanAccount (const TQString&); // create unknown account and return the id
+ TQDate incrDate (TQDate lastDate, unsigned char interval, unsigned int intervalCount); // for date calculations
+ MyMoneyAccount checkConsistency (MyMoneyAccount& tqparent, MyMoneyAccount& child); // gnucash is sometimes TOO flexible
+ void checkInvestmentOption (TQString stockId); // implement user investment option
+ void getPriceSource (MyMoneySecurity stock, TQString gncSource);
#endif // _GNCFILEANON
};
diff --git a/kmymoney2/converter/mymoneyqifprofile.cpp b/kmymoney2/converter/mymoneyqifprofile.cpp
index b8fe97c..3093941 100644
--- a/kmymoney2/converter/mymoneyqifprofile.cpp
+++ b/kmymoney2/converter/mymoneyqifprofile.cpp
@@ -18,8 +18,8 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qregexp.h>
-#include <qvaluevector.h>
+#include <tqregexp.h>
+#include <tqvaluevector.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -58,17 +58,17 @@ class MyMoneyQifProfile::Private {
}
void getThirdPosition(void);
- void dissectDate(QValueVector<QString>& parts, const QString& txt) const;
+ void dissectDate(TQValueVector<TQString>& parts, const TQString& txt) const;
- QValueVector<int> m_changeCount;
- QValueVector<int> m_lastValue;
- QValueVector<int> m_largestValue;
- QMap<QChar, int> m_partPos;
+ TQValueVector<int> m_changeCount;
+ TQValueVector<int> m_lastValue;
+ TQValueVector<int> m_largestValue;
+ TQMap<TQChar, int> m_partPos;
};
-void MyMoneyQifProfile::Private::dissectDate(QValueVector<QString>& parts, const QString& txt) const
+void MyMoneyQifProfile::Private::dissectDate(TQValueVector<TQString>& parts, const TQString& txt) const
{
- QRegExp nonDelimChars("[ 0-9a-zA-Z]");
+ TQRegExp nonDelimChars("[ 0-9a-zA-Z]");
int part = 0; // the current part we scan
unsigned int pos; // the current scan position
unsigned int maxPartSize = txt.length() > 6 ? 4 : 2;
@@ -114,12 +114,12 @@ void MyMoneyQifProfile::Private::getThirdPosition(void)
{
// if we have detected two parts we can calculate the third and its position
if(m_partPos.count() == 2) {
- QValueList<QChar> partsPresent = m_partPos.keys();
- QStringList partsAvail = QStringList::split(",", "d,m,y");
+ TQValueList<TQChar> partsPresent = m_partPos.keys();
+ TQStringList partsAvail = TQStringList::split(",", "d,m,y");
int missingIndex = -1;
int value = 0;
for(int i = 0; i < 3; ++i) {
- if(!partsPresent.contains(partsAvail[i][0])) {
+ if(!partsPresent.tqcontains(partsAvail[i][0])) {
missingIndex = i;
} else {
value += m_partPos[partsAvail[i][0]];
@@ -138,7 +138,7 @@ MyMoneyQifProfile::MyMoneyQifProfile() :
clear();
}
-MyMoneyQifProfile::MyMoneyQifProfile(const QString& name) :
+MyMoneyQifProfile::MyMoneyQifProfile(const TQString& name) :
d(new Private),
m_isDirty(false)
{
@@ -184,7 +184,7 @@ void MyMoneyQifProfile::clear(void)
m_attemptMatchDuplicates = true;
}
-void MyMoneyQifProfile::loadProfile(const QString& name)
+void MyMoneyQifProfile::loadProfile(const TQString& name)
{
KConfig* config = KGlobal::config();
config->setGroup(name);
@@ -208,7 +208,7 @@ void MyMoneyQifProfile::loadProfile(const QString& name)
// make sure, we remove any old stuff for now
config->deleteEntry("FilterScript");
- QString tmp = QString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] +
+ TQString tmp = TQString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] +
m_decimal['$'] + m_decimal['O'];
tmp = config->readEntry("Decimal", tmp);
m_decimal['Q'] = tmp[0];
@@ -217,7 +217,7 @@ void MyMoneyQifProfile::loadProfile(const QString& name)
m_decimal['$'] = tmp[3];
m_decimal['O'] = tmp[4];
- tmp = QString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] +
+ tmp = TQString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] +
m_thousands['$'] + m_thousands['O'];
tmp = config->readEntry("Thousand", tmp);
m_thousands['Q'] = tmp[0];
@@ -247,19 +247,19 @@ void MyMoneyQifProfile::saveProfile(void)
config->writeEntry("FilterFileType", m_filterFileType);
config->writeEntry("AttemptMatchDuplicates", m_attemptMatchDuplicates);
- QString tmp;
+ TQString tmp;
- tmp = QString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] +
+ tmp = TQString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] +
m_decimal['$'] + m_decimal['O'];
config->writeEntry("Decimal", tmp);
- tmp = QString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] +
+ tmp = TQString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] +
m_thousands['$'] + m_thousands['O'];
config->writeEntry("Thousand", tmp);
}
m_isDirty = false;
}
-void MyMoneyQifProfile::setProfileName(const QString& name)
+void MyMoneyQifProfile::setProfileName(const TQString& name)
{
if(m_profileName != name)
m_isDirty = true;
@@ -267,7 +267,7 @@ void MyMoneyQifProfile::setProfileName(const QString& name)
m_profileName = name;
}
-void MyMoneyQifProfile::setProfileDescription(const QString& desc)
+void MyMoneyQifProfile::setProfileDescription(const TQString& desc)
{
if(m_profileDescription != desc)
m_isDirty = true;
@@ -275,14 +275,14 @@ void MyMoneyQifProfile::setProfileDescription(const QString& desc)
m_profileDescription = desc;
}
-void MyMoneyQifProfile::setProfileType(const QString& type)
+void MyMoneyQifProfile::setProfileType(const TQString& type)
{
if(m_profileType != type)
m_isDirty = true;
m_profileType = type;
}
-void MyMoneyQifProfile::setOutputDateFormat(const QString& dateFormat)
+void MyMoneyQifProfile::setOutputDateFormat(const TQString& dateFormat)
{
if(m_dateFormat != dateFormat)
m_isDirty = true;
@@ -290,7 +290,7 @@ void MyMoneyQifProfile::setOutputDateFormat(const QString& dateFormat)
m_dateFormat = dateFormat;
}
-void MyMoneyQifProfile::setInputDateFormat(const QString& dateFormat)
+void MyMoneyQifProfile::setInputDateFormat(const TQString& dateFormat)
{
int j = -1;
if(dateFormat.length() > 0) {
@@ -302,7 +302,7 @@ void MyMoneyQifProfile::setInputDateFormat(const QString& dateFormat)
}
}
-void MyMoneyQifProfile::setApostropheFormat(const QString& apostropheFormat)
+void MyMoneyQifProfile::setApostropheFormat(const TQString& apostropheFormat)
{
if(m_apostropheFormat != apostropheFormat)
m_isDirty = true;
@@ -310,10 +310,10 @@ void MyMoneyQifProfile::setApostropheFormat(const QString& apostropheFormat)
m_apostropheFormat = apostropheFormat;
}
-void MyMoneyQifProfile::setAmountDecimal(const QChar& def, const QChar& chr)
+void MyMoneyQifProfile::setAmountDecimal(const TQChar& def, const TQChar& chr)
{
- QChar ch(chr);
- if(ch == QChar())
+ TQChar ch(chr);
+ if(ch == TQChar())
ch = ' ';
if(m_decimal[def] != ch)
@@ -322,10 +322,10 @@ void MyMoneyQifProfile::setAmountDecimal(const QChar& def, const QChar& chr)
m_decimal[def] = ch;
}
-void MyMoneyQifProfile::setAmountThousands(const QChar& def, const QChar& chr)
+void MyMoneyQifProfile::setAmountThousands(const TQChar& def, const TQChar& chr)
{
- QChar ch(chr);
- if(ch == QChar())
+ TQChar ch(chr);
+ if(ch == TQChar())
ch = ' ';
if(m_thousands[def] != ch)
@@ -334,21 +334,21 @@ void MyMoneyQifProfile::setAmountThousands(const QChar& def, const QChar& chr)
m_thousands[def] = ch;
}
-QChar MyMoneyQifProfile::amountDecimal(const QChar& def) const
+TQChar MyMoneyQifProfile::amountDecimal(const TQChar& def) const
{
- QChar chr = m_decimal[def];
+ TQChar chr = m_decimal[def];
return chr;
}
-QChar MyMoneyQifProfile::amountThousands(const QChar& def) const
+TQChar MyMoneyQifProfile::amountThousands(const TQChar& def) const
{
- QChar chr = m_thousands[def];
+ TQChar chr = m_thousands[def];
return chr;
}
-void MyMoneyQifProfile::setAccountDelimiter(const QString& delim)
+void MyMoneyQifProfile::setAccountDelimiter(const TQString& delim)
{
- QString txt(delim);
+ TQString txt(delim);
if(txt.isEmpty())
txt = " ";
@@ -360,23 +360,23 @@ void MyMoneyQifProfile::setAccountDelimiter(const QString& delim)
m_accountDelimiter = txt[0];
}
-void MyMoneyQifProfile::setOpeningBalanceText(const QString& txt)
+void MyMoneyQifProfile::setOpeningBalanceText(const TQString& txt)
{
if(m_openingBalanceText != txt)
m_isDirty = true;
m_openingBalanceText = txt;
}
-void MyMoneyQifProfile::setVoidMark(const QString& txt)
+void MyMoneyQifProfile::setVoidMark(const TQString& txt)
{
if(m_voidMark != txt)
m_isDirty = true;
m_voidMark = txt;
}
-QString MyMoneyQifProfile::accountDelimiter(void) const
+TQString MyMoneyQifProfile::accountDelimiter(void) const
{
- QString rc;
+ TQString rc;
switch(m_accountDelimiter[0]) {
case ' ':
@@ -389,47 +389,47 @@ QString MyMoneyQifProfile::accountDelimiter(void) const
return rc;
}
-QString MyMoneyQifProfile::date(const QDate& datein) const
+TQString MyMoneyQifProfile::date(const TQDate& datein) const
{
const char* format = m_dateFormat.latin1();
- QString buffer;
- QChar delim;
- int maskLen;
- char maskChar;
+ TQString buffer;
+ TQChar delim;
+ int tqmaskLen;
+ char tqmaskChar;
while(*format) {
switch(*format) {
case '%':
- maskLen = 0;
- maskChar = *++format;
- while(*format && *format == maskChar) {
- ++maskLen;
+ tqmaskLen = 0;
+ tqmaskChar = *++format;
+ while(*format && *format == tqmaskChar) {
+ ++tqmaskLen;
++format;
}
- switch(maskChar) {
+ switch(tqmaskChar) {
case 'd':
if(delim)
buffer += delim;
- buffer += QString::number(datein.day()).rightJustify(2, '0');
+ buffer += TQString::number(datein.day()).rightJustify(2, '0');
break;
case 'm':
if(delim)
buffer += delim;
- if(maskLen == 3)
+ if(tqmaskLen == 3)
buffer += KGlobal::locale()->calendar()->monthName(datein.month(), datein.year(), true);
else
- buffer += QString::number(datein.month()).rightJustify(2, '0');
+ buffer += TQString::number(datein.month()).rightJustify(2, '0');
break;
case 'y':
- if(maskLen == 2) {
+ if(tqmaskLen == 2) {
buffer += twoDigitYear(delim, datein.year());
} else {
if(delim)
buffer += delim;
- buffer += QString::number(datein.year());
+ buffer += TQString::number(datein.year());
}
break;
default:
@@ -449,13 +449,13 @@ QString MyMoneyQifProfile::date(const QDate& datein) const
return buffer;
}
-const QDate MyMoneyQifProfile::date(const QString& datein) const
+const TQDate MyMoneyQifProfile::date(const TQString& datein) const
{
// in case we don't know the format, we return an invalid date
if(d->m_partPos.count() != 3)
- return QDate();
+ return TQDate();
- QValueVector<QString> scannedParts(3);
+ TQValueVector<TQString> scannedParts(3);
d->dissectDate(scannedParts, datein);
int yr, mon, day;
@@ -463,7 +463,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
yr = scannedParts[d->m_partPos['y']].toInt();
mon = scannedParts[d->m_partPos['m']].toInt(&ok);
if(!ok) {
- QStringList monthNames = QStringList::split(",", "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec");
+ TQStringList monthNames = TQStringList::split(",", "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec");
int j;
for(j = 1; j <= 12; ++j) {
if((KGlobal::locale()->calendar()->monthName(j, 2000, true).lower() == scannedParts[d->m_partPos['m']].lower())
@@ -474,7 +474,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
}
if(j == 13) {
qWarning("Unknown month '%s'", scannedParts[d->m_partPos['m']].data());
- return QDate();
+ return TQDate();
}
}
@@ -485,12 +485,12 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
else
yr += 1900;
}
- return QDate(yr, mon, day);
+ return TQDate(yr, mon, day);
#if 0
- QString scannedDelim[2];
- QString formatParts[3];
- QString formatDelim[2];
+ TQString scannedDelim[2];
+ TQString formatParts[3];
+ TQString formatDelim[2];
int part;
int delim;
unsigned int i,j;
@@ -501,8 +501,8 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
if(m_dateFormat[i] == '%') {
++part;
if(part == 3) {
- qWarning("MyMoneyQifProfile::date(const QString& datein) Too many parts in date format");
- return QDate();
+ qWarning("MyMoneyQifProfile::date(const TQString& datein) Too many parts in date format");
+ return TQDate();
}
++i;
}
@@ -517,15 +517,15 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
case '.':
case '\'':
if(delim == 2) {
- qWarning("MyMoneyQifProfile::date(const QString& datein) Too many delimiters in date format");
- return QDate();
+ qWarning("MyMoneyQifProfile::date(const TQString& datein) Too many delimiters in date format");
+ return TQDate();
}
formatDelim[delim] = m_dateFormat[i];
++delim;
break;
default:
- qWarning("MyMoneyQifProfile::date(const QString& datein) Invalid char in date format");
- return QDate();
+ qWarning("MyMoneyQifProfile::date(const TQString& datein) Invalid char in date format");
+ return TQDate();
}
}
@@ -540,8 +540,8 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
case '-':
case '\'':
if(delim == 2) {
- qWarning("MyMoneyQifProfile::date(const QString& datein) Too many delimiters in date field");
- return QDate();
+ qWarning("MyMoneyQifProfile::date(const TQString& datein) Too many delimiters in date field");
+ return TQDate();
}
scannedDelim[delim] = datein[i];
++delim;
@@ -557,7 +557,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
if(datein[i].isLetter())
prevWasChar = true;
// replace blank with 0
- scannedParts[part] += (datein[i] == ' ') ? QChar('0') : datein[i];
+ scannedParts[part] += (datein[i] == ' ') ? TQChar('0') : datein[i];
break;
}
}
@@ -568,14 +568,14 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
bool ok = false;
for(i = 0; i < 2; ++i) {
if(scannedDelim[i] != formatDelim[i]
- && scannedDelim[i] != QChar('\'')) {
- qWarning("MyMoneyQifProfile::date(const QString& datein) Invalid delimiter '%s' when '%s' was expected",
+ && scannedDelim[i] != TQChar('\'')) {
+ qWarning("MyMoneyQifProfile::date(const TQString& datein) Invalid delimiter '%s' when '%s' was expected",
scannedDelim[i].latin1(), formatDelim[i].latin1());
- return QDate();
+ return TQDate();
}
}
- QString msg;
+ TQString msg;
for(i = 0; i < 3; ++i) {
switch(formatParts[i][0].latin1()) {
case 'd':
@@ -610,7 +610,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
if(yr < 100) { // two digit year info
if(i > 1) {
ok = true;
- if(scannedDelim[i-1] == QChar('\'')) {
+ if(scannedDelim[i-1] == TQChar('\'')) {
if(m_apostropheFormat == "1900-1949") {
if(yr < 50)
yr += 1900;
@@ -648,24 +648,24 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const
ok = true;
}
} else {
- msg = QString("Length of year (%1) does not match expected length (%2).")
- .arg(scannedParts[i].length()).arg(formatParts[i].length());
+ msg = TQString("Length of year (%1) does not match expected length (%2).")
+ .tqarg(scannedParts[i].length()).tqarg(formatParts[i].length());
}
break;
}
if(!msg.isEmpty()) {
- qWarning("MyMoneyQifProfile::date(const QString& datein) %s",msg.latin1());
- return QDate();
+ qWarning("MyMoneyQifProfile::date(const TQString& datein) %s",msg.latin1());
+ return TQDate();
}
}
- return QDate(yr, mon, day);
+ return TQDate(yr, mon, day);
#endif
}
-QString MyMoneyQifProfile::twoDigitYear(const QChar delim, int yr) const
+TQString MyMoneyQifProfile::twoDigitYear(const TQChar delim, int yr) const
{
- QChar realDelim = delim;
- QString buffer;
+ TQChar realDelim = delim;
+ TQString buffer;
if(delim) {
if((m_apostropheFormat == "1900-1949" && yr <= 1949)
@@ -681,15 +681,15 @@ QString MyMoneyQifProfile::twoDigitYear(const QChar delim, int yr) const
if(yr < 10)
buffer += "0";
- buffer += QString::number(yr);
+ buffer += TQString::number(yr);
return buffer;
}
-QString MyMoneyQifProfile::value(const QChar& def, const MyMoneyMoney& valuein) const
+TQString MyMoneyQifProfile::value(const TQChar& def, const MyMoneyMoney& valuein) const
{
unsigned char _decimalSeparator;
unsigned char _thousandsSeparator;
- QString res;
+ TQString res;
_decimalSeparator = MyMoneyMoney::decimalSeparator();
_thousandsSeparator = MyMoneyMoney::thousandSeparator();
@@ -708,7 +708,7 @@ QString MyMoneyQifProfile::value(const QChar& def, const MyMoneyMoney& valuein)
return res;
}
-MyMoneyMoney MyMoneyQifProfile::value(const QChar& def, const QString& valuein) const
+MyMoneyMoney MyMoneyQifProfile::value(const TQChar& def, const TQString& valuein) const
{
unsigned char _decimalSeparator;
unsigned char _thousandsSeparator;
@@ -731,7 +731,7 @@ MyMoneyMoney MyMoneyQifProfile::value(const QChar& def, const QString& valuein)
return res;
}
-void MyMoneyQifProfile::setFilterScriptImport(const QString& script)
+void MyMoneyQifProfile::setFilterScriptImport(const TQString& script)
{
if(m_filterScriptImport != script)
m_isDirty = true;
@@ -739,7 +739,7 @@ void MyMoneyQifProfile::setFilterScriptImport(const QString& script)
m_filterScriptImport = script;
}
-void MyMoneyQifProfile::setFilterScriptExport(const QString& script)
+void MyMoneyQifProfile::setFilterScriptExport(const TQString& script)
{
if(m_filterScriptExport != script)
m_isDirty = true;
@@ -747,7 +747,7 @@ void MyMoneyQifProfile::setFilterScriptExport(const QString& script)
m_filterScriptExport = script;
}
-void MyMoneyQifProfile::setFilterFileType(const QString& txt)
+void MyMoneyQifProfile::setFilterFileType(const TQString& txt)
{
if(m_filterFileType != txt)
m_isDirty = true;
@@ -763,25 +763,25 @@ void MyMoneyQifProfile::setAttemptMatchDuplicates(bool f)
m_attemptMatchDuplicates = f;
}
-QString MyMoneyQifProfile::inputDateFormat(void) const
+TQString MyMoneyQifProfile::inputDateFormat(void) const
{
- QStringList list;
+ TQStringList list;
possibleDateFormats(list);
if(list.count() == 1)
return list.first();
- return QString();
+ return TQString();
}
-void MyMoneyQifProfile::possibleDateFormats(QStringList& list) const
+void MyMoneyQifProfile::possibleDateFormats(TQStringList& list) const
{
- QStringList defaultList = QStringList::split(":", "y,m,d:y,d,m:m,d,y:m,y,d:d,m,y:d,y,m");
+ TQStringList defaultList = TQStringList::split(":", "y,m,d:y,d,m:m,d,y:m,y,d:d,m,y:d,y,m");
list.clear();
- QStringList::const_iterator it_d;
+ TQStringList::const_iterator it_d;
for(it_d = defaultList.begin(); it_d != defaultList.end(); ++it_d) {
- QStringList parts = QStringList::split(",", *it_d);
+ TQStringList parts = TQStringList::split(",", *it_d);
int i;
for(i = 0; i < 3; ++i) {
- if(d->m_partPos.contains(parts[i][0])) {
+ if(d->m_partPos.tqcontains(parts[i][0])) {
if(d->m_partPos[parts[i][0]] != i)
break;
}
@@ -794,11 +794,11 @@ void MyMoneyQifProfile::possibleDateFormats(QStringList& list) const
}
// matches all tests
if(i == 3) {
- QString format = *it_d;
- format.replace('y', "%y");
- format.replace('m', "%m");
- format.replace('d', "%d");
- format.replace(',', " ");
+ TQString format = *it_d;
+ format.tqreplace('y', "%y");
+ format.tqreplace('m', "%m");
+ format.tqreplace('d', "%d");
+ format.tqreplace(',', " ");
list << format;
}
}
@@ -806,26 +806,26 @@ void MyMoneyQifProfile::possibleDateFormats(QStringList& list) const
// in this case, we present the full list and let the user decide
if(list.count() == 0) {
for(it_d = defaultList.begin(); it_d != defaultList.end(); ++it_d) {
- QString format = *it_d;
- format.replace('y', "%y");
- format.replace('m', "%m");
- format.replace('d', "%d");
- format.replace(',', " ");
+ TQString format = *it_d;
+ format.tqreplace('y', "%y");
+ format.tqreplace('m', "%m");
+ format.tqreplace('d', "%d");
+ format.tqreplace(',', " ");
list << format;
}
}
}
-void MyMoneyQifProfile::autoDetect(const QStringList& lines)
+void MyMoneyQifProfile::autoDetect(const TQStringList& lines)
{
- m_dateFormat = QString();
+ m_dateFormat = TQString();
m_decimal.clear();
m_thousands.clear();
- QString numericRecords = "BT$OIQ";
- QStringList::const_iterator it;
+ TQString numericRecords = "BT$OIQ";
+ TQStringList::const_iterator it;
int datesScanned = 0;
- // section: used to switch between different QIF sections,
+ // section: used to switch between different TQIF sections,
// because the Record identifiers are ambigous between sections
// eg. in transaction records, T identifies a total amount, in
// account sections it's the type.
@@ -835,11 +835,11 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines)
// 2 - transactions
// 3 - prices
int section = 0;
- QRegExp price("\"(.*)\",(.*),\"(.*)\"");
+ TQRegExp price("\"(.*)\",(.*),\"(.*)\"");
for(it = lines.begin(); it != lines.end(); ++it) {
- QChar c((*it)[0]);
+ TQChar c((*it)[0]);
if(c == '!') {
- QString sname = (*it).lower();
+ TQString sname = (*it).lower();
section = 0;
if(sname.startsWith("!account"))
section = 1;
@@ -863,7 +863,7 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines)
}
break;
case 2:
- if(numericRecords.contains(c)) {
+ if(numericRecords.tqcontains(c)) {
scanNumeric((*it).mid(1), m_decimal[c], m_thousands[c]);
} else if((c == 'D') && (m_dateFormat.isEmpty())) {
if(d->m_partPos.count() != 3) {
@@ -891,9 +891,9 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines)
// results are inaccurate which leads to a reduced number of
// date formats presented to choose from.
if(d->m_partPos.count() != 3 && datesScanned > 20) {
- QMap<int, int> sortedPos;
+ TQMap<int, int> sortedPos;
// make sure to reset the known parts for the following algorithm
- if(d->m_partPos.contains('y')) {
+ if(d->m_partPos.tqcontains('y')) {
d->m_changeCount[d->m_partPos['y']] = -1;
for(int i = 0; i < 3; ++i) {
if(d->m_partPos['y'] == i)
@@ -904,9 +904,9 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines)
}
}
}
- if(d->m_partPos.contains('d'))
+ if(d->m_partPos.tqcontains('d'))
d->m_changeCount[d->m_partPos['d']] = -1;
- if(d->m_partPos.contains('m'))
+ if(d->m_partPos.tqcontains('m'))
d->m_changeCount[d->m_partPos['m']] = -1;
for(int i = 0; i < 3; ++i) {
@@ -915,8 +915,8 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines)
}
}
- QMap<int, int>::const_iterator it_a;
- QMap<int, int>::const_iterator it_b;
+ TQMap<int, int>::const_iterator it_a;
+ TQMap<int, int>::const_iterator it_b;
switch(sortedPos.count()) {
case 1: // all the same
// let the user decide, we can't figure it out
@@ -962,10 +962,10 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines)
}
}
-void MyMoneyQifProfile::scanNumeric(const QString& txt, QChar& decimal, QChar& thousands) const
+void MyMoneyQifProfile::scanNumeric(const TQString& txt, TQChar& decimal, TQChar& thousands) const
{
- QChar first, second;
- QRegExp numericChars("[0-9-()]");
+ TQChar first, second;
+ TQRegExp numericChars("[0-9-()]");
for(unsigned int i = 0; i < txt.length(); ++i) {
if(numericChars.search(txt[i]) == -1) {
first = second;
@@ -978,10 +978,10 @@ void MyMoneyQifProfile::scanNumeric(const QString& txt, QChar& decimal, QChar& t
thousands = first;
}
-void MyMoneyQifProfile::scanDate(const QString& txt) const
+void MyMoneyQifProfile::scanDate(const TQString& txt) const
{
// extract the parts from the txt
- QValueVector<QString> parts(3); // the various parts of the date
+ TQValueVector<TQString> parts(3); // the various parts of the date
d->dissectDate(parts, txt);
// now analyse the parts
@@ -1003,7 +1003,7 @@ void MyMoneyQifProfile::scanDate(const QString& txt) const
}
// and if it's in between 12 and 32 and we already identified the
// position for the year it must be days
- if((value > 12) && (value < 32) && d->m_partPos.contains('y')) {
+ if((value > 12) && (value < 32) && d->m_partPos.tqcontains('y')) {
d->m_partPos['d'] = i;
}
}
diff --git a/kmymoney2/converter/mymoneyqifprofile.h b/kmymoney2/converter/mymoneyqifprofile.h
index bd6b328..5df8c41 100644
--- a/kmymoney2/converter/mymoneyqifprofile.h
+++ b/kmymoney2/converter/mymoneyqifprofile.h
@@ -15,15 +15,15 @@
* *
***************************************************************************/
-#ifndef MYMONEYQIFPROFILE_H
-#define MYMONEYQIFPROFILE_H
+#ifndef MYMONEYTQIFPROFILE_H
+#define MYMONEYTQIFPROFILE_H
// ----------------------------------------------------------------------------
// QT Includes
-#include <qobject.h>
-#include <qstring.h>
-class QDate;
+#include <tqobject.h>
+#include <tqstring.h>
+class TQDate;
// ----------------------------------------------------------------------------
// KDE Includes
@@ -37,47 +37,48 @@ class MyMoneyMoney;
* @author Thomas Baumgart
*/
-class MyMoneyQifProfile : public QObject
+class MyMoneyQifProfile : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
MyMoneyQifProfile();
- MyMoneyQifProfile(const QString& name);
+ MyMoneyQifProfile(const TQString& name);
~MyMoneyQifProfile();
- const QString& profileName(void) const { return m_profileName; }
- void setProfileName(const QString& name);
+ const TQString& profileName(void) const { return m_profileName; }
+ void setProfileName(const TQString& name);
- void loadProfile(const QString& name);
+ void loadProfile(const TQString& name);
void saveProfile(void);
- const QDate date(const QString& datein) const;
- QString date(const QDate& datein) const;
-
- MyMoneyMoney value(const QChar& def, const QString& valuein) const;
- QString value(const QChar& def, const MyMoneyMoney& valuein) const;
-
- const QString& outputDateFormat(void) const { return m_dateFormat; }
- QString inputDateFormat(void) const;
- const QString& apostropheFormat(void) const { return m_apostropheFormat; }
- QChar amountDecimal(const QChar& def) const;
- QChar amountThousands(const QChar& def) const;
- const QString& profileDescription(void) const { return m_profileDescription; }
- const QString& profileType(void) const { return m_profileType; }
- const QString& openingBalanceText(void) const { return m_openingBalanceText; }
- QString accountDelimiter(void) const;
- const QString& voidMark(void) const { return m_voidMark; }
- const QString& filterScriptImport(void) const { return m_filterScriptImport; }
- const QString& filterScriptExport(void) const { return m_filterScriptExport; }
- const QString& filterFileType(void) const { return m_filterFileType; }
+ const TQDate date(const TQString& datein) const;
+ TQString date(const TQDate& datein) const;
+
+ MyMoneyMoney value(const TQChar& def, const TQString& valuein) const;
+ TQString value(const TQChar& def, const MyMoneyMoney& valuein) const;
+
+ const TQString& outputDateFormat(void) const { return m_dateFormat; }
+ TQString inputDateFormat(void) const;
+ const TQString& apostropheFormat(void) const { return m_apostropheFormat; }
+ TQChar amountDecimal(const TQChar& def) const;
+ TQChar amountThousands(const TQChar& def) const;
+ const TQString& profileDescription(void) const { return m_profileDescription; }
+ const TQString& profileType(void) const { return m_profileType; }
+ const TQString& openingBalanceText(void) const { return m_openingBalanceText; }
+ TQString accountDelimiter(void) const;
+ const TQString& voidMark(void) const { return m_voidMark; }
+ const TQString& filterScriptImport(void) const { return m_filterScriptImport; }
+ const TQString& filterScriptExport(void) const { return m_filterScriptExport; }
+ const TQString& filterFileType(void) const { return m_filterFileType; }
bool attemptMatchDuplicates(void) const { return m_attemptMatchDuplicates; }
/**
* This method scans all strings contained in @a lines and tries to figure
* out the settings for m_decimal, m_thousands and m_dateFormat
*/
- void autoDetect(const QStringList& lines);
+ void autoDetect(const TQStringList& lines);
/**
* This method returns a list of possible date formats the user
@@ -85,7 +86,7 @@ public:
* contains all possible date formats, in the other case, the @a list
* is adjusted to those that will match the data scanned.
*/
- void possibleDateFormats(QStringList& list) const;
+ void possibleDateFormats(TQStringList& list) const;
/**
* This method presets the member variables with the default values.
@@ -98,25 +99,25 @@ public:
bool isDirty(void) const { return m_isDirty; };
public slots:
- void setProfileDescription(const QString& desc);
- void setProfileType(const QString& type);
- void setOutputDateFormat(const QString& dateFormat);
- void setInputDateFormat(const QString& dateFormat);
- void setApostropheFormat(const QString& apostropheFormat);
- void setAmountDecimal(const QChar& def, const QChar& chr);
- void setAmountThousands(const QChar& def, const QChar& chr);
- void setAccountDelimiter(const QString& delim);
- void setOpeningBalanceText(const QString& text);
- void setVoidMark(const QString& txt);
- void setFilterScriptImport(const QString& txt);
- void setFilterScriptExport(const QString& txt);
- void setFilterFileType(const QString& txt);
+ void setProfileDescription(const TQString& desc);
+ void setProfileType(const TQString& type);
+ void setOutputDateFormat(const TQString& dateFormat);
+ void setInputDateFormat(const TQString& dateFormat);
+ void setApostropheFormat(const TQString& apostropheFormat);
+ void setAmountDecimal(const TQChar& def, const TQChar& chr);
+ void setAmountThousands(const TQChar& def, const TQChar& chr);
+ void setAccountDelimiter(const TQString& delim);
+ void setOpeningBalanceText(const TQString& text);
+ void setVoidMark(const TQString& txt);
+ void setFilterScriptImport(const TQString& txt);
+ void setFilterScriptExport(const TQString& txt);
+ void setFilterFileType(const TQString& txt);
void setAttemptMatchDuplicates(bool);
private:
- QString twoDigitYear(const QChar delim, int yr) const;
- void scanNumeric(const QString& txt, QChar& decimal, QChar& thousands) const;
- void scanDate(const QString& txt) const;
+ TQString twoDigitYear(const TQChar delim, int yr) const;
+ void scanNumeric(const TQString& txt, TQChar& decimal, TQChar& thousands) const;
+ void scanDate(const TQString& txt) const;
private:
/// \internal d-pointer class.
@@ -124,20 +125,20 @@ private:
/// \internal d-pointer instance.
Private* const d;
bool m_isDirty;
- QString m_profileName;
- QString m_profileDescription;
- QString m_dateFormat;
- QString m_apostropheFormat;
- QString m_valueMode;
- QString m_profileType;
- QString m_openingBalanceText;
- QString m_voidMark;
- QString m_accountDelimiter;
- QString m_filterScriptImport;
- QString m_filterScriptExport;
- QString m_filterFileType; /*< The kind of input files the filter will expect, e.g. "*.qif" */
- QMap<QChar, QChar> m_decimal;
- QMap<QChar, QChar> m_thousands;
+ TQString m_profileName;
+ TQString m_profileDescription;
+ TQString m_dateFormat;
+ TQString m_apostropheFormat;
+ TQString m_valueMode;
+ TQString m_profileType;
+ TQString m_openingBalanceText;
+ TQString m_voidMark;
+ TQString m_accountDelimiter;
+ TQString m_filterScriptImport;
+ TQString m_filterScriptExport;
+ TQString m_filterFileType; /*< The kind of input files the filter will expect, e.g. "*.qif" */
+ TQMap<TQChar, TQChar> m_decimal;
+ TQMap<TQChar, TQChar> m_thousands;
bool m_attemptMatchDuplicates;
};
diff --git a/kmymoney2/converter/mymoneyqifreader.cpp b/kmymoney2/converter/mymoneyqifreader.cpp
index 60b0604..fde43a4 100644
--- a/kmymoney2/converter/mymoneyqifreader.cpp
+++ b/kmymoney2/converter/mymoneyqifreader.cpp
@@ -26,12 +26,12 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qfile.h>
-#include <qstringlist.h>
-#include <qtimer.h>
-#include <qtextedit.h>
-#include <qregexp.h>
-#include <qbuffer.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
+#include <tqtextedit.h>
+#include <tqregexp.h>
+#include <tqbuffer.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -72,29 +72,29 @@ class MyMoneyQifReader::Private {
mapCategories(true)
{}
- QString accountTypeToQif(MyMoneyAccount::accountTypeE type) const;
+ TQString accountTypeToQif(MyMoneyAccount::accountTypeE type) const;
/**
* finalize the current statement and add it to the statement list
*/
void finishStatement(void);
- bool isTransfer(QString& name, const QString& leftDelim, const QString& rightDelim);
+ bool isTransfer(TQString& name, const TQString& leftDelim, const TQString& rightDelim);
/**
- * Converts the QIF specific N-record of investment transactions into
+ * Converts the TQIF specific N-record of investment transactions into
* a category name
*/
- QString typeToAccountName(const QString& type) const;
+ TQString typeToAccountName(const TQString& type) const;
/**
- * Converts the QIF reconcile state to the KMyMoney reconcile state
+ * Converts the TQIF reconcile state to the KMyMoney reconcile state
*/
- MyMoneySplit::reconcileFlagE reconcileState(const QString& state) const;
+ MyMoneySplit::reconcileFlagE reconcileState(const TQString& state) const;
/**
*/
- void fixMultiLineMemo(QString& memo) const;
+ void fixMultiLineMemo(TQString& memo) const;
public:
/**
@@ -104,24 +104,24 @@ class MyMoneyQifReader::Private {
/**
* the list of all statements to be sent to MyMoneyStatementReader
*/
- QValueList<MyMoneyStatement> statements;
+ TQValueList<MyMoneyStatement> statements;
/**
* a list of already used hashes in this file
*/
- QMap<QString, bool> m_hashMap;
+ TQMap<TQString, bool> m_hashMap;
- QString st_AccountName;
- QString st_AccountId;
+ TQString st_AccountName;
+ TQString st_AccountId;
MyMoneyAccount::accountTypeE accountType;
bool firstTransaction;
bool mapCategories;
MyMoneyQifReader::QifEntryTypeE transactionType;
};
-void MyMoneyQifReader::Private::fixMultiLineMemo(QString& memo) const
+void MyMoneyQifReader::Private::fixMultiLineMemo(TQString& memo) const
{
- memo.replace("\\n", "\n");
+ memo.tqreplace("\\n", "\n");
}
void MyMoneyQifReader::Private::finishStatement(void)
@@ -138,9 +138,9 @@ void MyMoneyQifReader::Private::finishStatement(void)
st.m_eType = (transactionType == MyMoneyQifReader::EntryTransaction) ? MyMoneyStatement::etCheckings : MyMoneyStatement::etInvestment;
}
-QString MyMoneyQifReader::Private::accountTypeToQif(MyMoneyAccount::accountTypeE type) const
+TQString MyMoneyQifReader::Private::accountTypeToQif(MyMoneyAccount::accountTypeE type) const
{
- QString rc = "Bank";
+ TQString rc = "Bank";
switch(type) {
default:
@@ -164,7 +164,7 @@ QString MyMoneyQifReader::Private::accountTypeToQif(MyMoneyAccount::accountTypeE
return rc;
}
-QString MyMoneyQifReader::Private::typeToAccountName(const QString& type) const
+TQString MyMoneyQifReader::Private::typeToAccountName(const TQString& type) const
{
if(type == "reinvdiv")
return i18n("Category name", "Reinvested dividend");
@@ -202,10 +202,10 @@ QString MyMoneyQifReader::Private::typeToAccountName(const QString& type) const
if(type == "sell" || type == "buy")
return i18n("Category name", "Investment fees");
- return i18n("Unknown QIF type %1").arg(type);
+ return i18n("Unknown TQIF type %1").tqarg(type);
}
-bool MyMoneyQifReader::Private::isTransfer(QString& tmp, const QString& leftDelim, const QString& rightDelim)
+bool MyMoneyQifReader::Private::isTransfer(TQString& tmp, const TQString& leftDelim, const TQString& rightDelim)
{
// it's a transfer, extract the account name
// I've seen entries like this
@@ -213,7 +213,7 @@ bool MyMoneyQifReader::Private::isTransfer(QString& tmp, const QString& leftDeli
// S[Mehrwertsteuer]/_VATCode_N_I
//
// so extracting is a bit more complex and we use a regexp for it
- QRegExp exp(QString("\\%1(.*)\\%2(.*)").arg(leftDelim, rightDelim));
+ TQRegExp exp(TQString("\\%1(.*)\\%2(.*)").tqarg(leftDelim, rightDelim));
bool rc;
if((rc = (exp.search(tmp) != -1)) == true) {
@@ -223,7 +223,7 @@ bool MyMoneyQifReader::Private::isTransfer(QString& tmp, const QString& leftDeli
return rc;
}
-MyMoneySplit::reconcileFlagE MyMoneyQifReader::Private::reconcileState(const QString& state) const
+MyMoneySplit::reconcileFlagE MyMoneyQifReader::Private::reconcileState(const TQString& state) const
{
if(state == "X" || state == "R") // Reconciled
return MyMoneySplit::Reconciled;
@@ -250,10 +250,10 @@ MyMoneyQifReader::MyMoneyQifReader() :
m_warnedSecurity = false;
m_warnedPrice = false;
- connect(&m_filter, SIGNAL(wroteStdin(KProcess*)), this, SLOT(slotSendDataToFilter()));
- connect(&m_filter, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(slotReceivedDataFromFilter(KProcess*, char*, int)));
- connect(&m_filter, SIGNAL(processExited(KProcess*)), this, SLOT(slotImportFinished()));
- connect(&m_filter, SIGNAL(receivedStderr(KProcess*, char*, int)), this, SLOT(slotReceivedErrorFromFilter(KProcess*, char*, int)));
+ connect(&m_filter, TQT_SIGNAL(wroteStdin(KProcess*)), this, TQT_SLOT(slotSendDataToFilter()));
+ connect(&m_filter, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedDataFromFilter(KProcess*, char*, int)));
+ connect(&m_filter, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotImportFinished()));
+ connect(&m_filter, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedErrorFromFilter(KProcess*, char*, int)));
}
MyMoneyQifReader::~MyMoneyQifReader()
@@ -273,14 +273,14 @@ void MyMoneyQifReader::setURL(const KURL& url)
m_url = url;
}
-void MyMoneyQifReader::setProfile(const QString& profile)
+void MyMoneyQifReader::setProfile(const TQString& profile)
{
m_qifProfile.loadProfile("Profile-" + profile);
}
void MyMoneyQifReader::slotSendDataToFilter(void)
{
- Q_LONG len;
+ TQ_LONG len;
if(m_file->atEnd()) {
// m_filter.flushStdin();
@@ -288,7 +288,7 @@ void MyMoneyQifReader::slotSendDataToFilter(void)
} else {
len = m_file->readBlock(m_buffer, sizeof(m_buffer));
if(len == -1) {
- qWarning("Failed to read block from QIF import file");
+ qWarning("Failed to read block from TQIF import file");
m_filter.closeStdin();
m_filter.kill();
} else {
@@ -299,7 +299,7 @@ void MyMoneyQifReader::slotSendDataToFilter(void)
void MyMoneyQifReader::slotReceivedErrorFromFilter(KProcess* /* proc */, char *buff, int len)
{
- QByteArray data;
+ TQByteArray data;
data.duplicate(buff, len);
qWarning("%s",static_cast<const char*>(data));
}
@@ -314,9 +314,9 @@ void MyMoneyQifReader::slotReceivedDataFromFilter(KProcess* /* proc */, char *bu
if(*buff == '\n' || *buff == '\r') {
// found EOL
if(!m_lineBuffer.isEmpty()) {
- m_qifLines << QString::fromUtf8(m_lineBuffer.stripWhiteSpace());
+ m_qifLines << TQString::fromUtf8(m_lineBuffer.stripWhiteSpace());
}
- m_lineBuffer = QCString();
+ m_lineBuffer = TQCString();
} else {
// collect all others
m_lineBuffer += (*buff);
@@ -330,10 +330,10 @@ void MyMoneyQifReader::slotImportFinished(void)
{
// check if the last EOL char was missing and add the trailing line
if(!m_lineBuffer.isEmpty()) {
- m_qifLines << QString::fromUtf8(m_lineBuffer.stripWhiteSpace());
+ m_qifLines << TQString::fromUtf8(m_lineBuffer.stripWhiteSpace());
}
qDebug("Read %d bytes", m_pos);
- QTimer::singleShot(0, this, SLOT(slotProcessData()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotProcessData()));
}
void MyMoneyQifReader::slotProcessData(void)
@@ -346,9 +346,9 @@ void MyMoneyQifReader::slotProcessData(void)
// the detection is accurate for numeric values, but it could be
// that the dates were too ambiguous so that we have to let the user
// decide which one to pick.
- QStringList dateFormats;
+ TQStringList dateFormats;
m_qifProfile.possibleDateFormats(dateFormats);
- QStringList list;
+ TQStringList list;
if(dateFormats.count() > 1) {
list << dateFormats.first();
bool ok;
@@ -363,8 +363,8 @@ void MyMoneyQifReader::slotProcessData(void)
qDebug("Selected date format: '%s'", list.first().data());
- signalProgress(0, m_qifLines.count(), i18n("Importing QIF ..."));
- QStringList::iterator it;
+ signalProgress(0, m_qifLines.count(), i18n("Importing TQIF ..."));
+ TQStringList::iterator it;
for(it = m_qifLines.begin(); m_userAbort == false && it != m_qifLines.end(); ++it) {
++m_linenumber;
// qDebug("Proc: '%s'", (*it).data());
@@ -399,27 +399,27 @@ bool MyMoneyQifReader::startImport(void)
m_userAbort = false;
m_pos = 0;
m_linenumber = 0;
- m_filename = QString::null;
+ m_filename = TQString();
m_data.clear();
if(!KIO::NetAccess::download(m_url, m_filename, NULL)) {
KMessageBox::detailedError(0,
- i18n("Error while loading file '%1'!").arg(m_url.prettyURL()),
+ i18n("Error while loading file '%1'!").tqarg(m_url.prettyURL()),
KIO::NetAccess::lastErrorString(),
i18n("File access error"));
return false;
}
- m_file = new QFile(m_filename);
+ m_file = new TQFile(m_filename);
if(m_file->open(IO_ReadOnly)) {
#ifdef DEBUG_IMPORT
- Q_LONG len;
+ TQ_LONG len;
while(!m_file->atEnd()) {
len = m_file->readBlock(m_buffer, sizeof(m_buffer));
if(len == -1) {
- qWarning("Failed to read block from QIF import file");
+ qWarning("Failed to read block from TQIF import file");
} else {
slotReceivedDataFromFilter(0, m_buffer, len);
}
@@ -433,13 +433,13 @@ bool MyMoneyQifReader::startImport(void)
m_filter << "cat";
m_filter << "-";
} else {
- m_filter << QStringList::split(" ", m_qifProfile.filterScriptImport(), true);
+ m_filter << TQStringList::split(" ", m_qifProfile.filterScriptImport(), true);
}
m_entryType = EntryUnknown;
if(m_filter.start(KProcess::NotifyOnExit, KProcess::All)) {
m_filter.resume();
- signalProgress(0, m_file->size(), i18n("Reading QIF ..."));
+ signalProgress(0, m_file->size(), i18n("Reading TQIF ..."));
slotSendDataToFilter();
rc = true;
} else {
@@ -460,8 +460,8 @@ bool MyMoneyQifReader::finishImport(void)
// remove the Don't ask again entries
KConfig* config = KGlobal::config();
- config->setGroup(QString::fromLatin1("Notification Messages"));
- QStringList::ConstIterator it;
+ config->setGroup(TQString::tqfromLatin1("Notification Messages"));
+ TQStringList::ConstIterator it;
for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) {
config->deleteEntry(*it);
@@ -480,8 +480,8 @@ bool MyMoneyQifReader::finishImport(void)
// remove the Don't ask again entries
KConfig* config = KGlobal::config();
- config->setGroup(QString::fromLatin1("Notification Messages"));
- QStringList::ConstIterator it;
+ config->setGroup(TQString::tqfromLatin1("Notification Messages"));
+ TQStringList::ConstIterator it;
for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) {
config->deleteEntry(*it);
@@ -511,7 +511,7 @@ bool MyMoneyQifReader::finishImport(void)
dlg.show();
kapp->processEvents();
MyMoneyFile* file = MyMoneyFile::instance();
- QValueList<MyMoneyTransaction>::iterator it = m_transactionCache.begin();
+ TQValueList<MyMoneyTransaction>::iterator it = m_transactionCache.begin();
MyMoneyFileTransaction ft;
try
{
@@ -531,55 +531,55 @@ bool MyMoneyQifReader::finishImport(void)
ft.commit();
} catch(MyMoneyException *e) {
KMessageBox::detailedSorry(0, i18n("Unable to add transactions"),
- (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line()));
+ (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line()));
delete e;
rc = false;
}
#endif
// Now to import the statements
- QValueList<MyMoneyStatement>::const_iterator it_st;
+ TQValueList<MyMoneyStatement>::const_iterator it_st;
for(it_st = d->statements.begin(); it_st != d->statements.end(); ++it_st)
kmymoney2->slotStatementImport(*it_st);
return rc;
}
-void MyMoneyQifReader::processQifSpecial(const QString& _line)
+void MyMoneyQifReader::processQifSpecial(const TQString& _line)
{
- QString line = _line.mid(1); // get rid of exclamation mark
- // QString test = line.left(5).lower();
- if(line.left(5).lower() == QString("type:")) {
+ TQString line = _line.mid(1); // get rid of exclamation mark
+ // TQString test = line.left(5).lower();
+ if(line.left(5).lower() == TQString("type:")) {
line = line.mid(5);
// exportable accounts
- if(line.lower() == "ccard" || KMyMoneyGlobalSettings::qifCreditCard().lower().contains(line.lower())) {
+ if(line.lower() == "ccard" || KMyMoneyGlobalSettings::qifCreditCard().lower().tqcontains(line.lower())) {
d->accountType = MyMoneyAccount::CreditCard;
d->firstTransaction = true;
d->transactionType = m_entryType = EntryTransaction;
- } else if(line.lower() == "bank" || KMyMoneyGlobalSettings::qifBank().lower().contains(line.lower())) {
+ } else if(line.lower() == "bank" || KMyMoneyGlobalSettings::qifBank().lower().tqcontains(line.lower())) {
d->accountType = MyMoneyAccount::Checkings;
d->firstTransaction = true;
d->transactionType = m_entryType = EntryTransaction;
- } else if(line.lower() == "cash" || KMyMoneyGlobalSettings::qifCash().lower().contains(line.lower())) {
+ } else if(line.lower() == "cash" || KMyMoneyGlobalSettings::qifCash().lower().tqcontains(line.lower())) {
d->accountType = MyMoneyAccount::Cash;
d->firstTransaction = true;
d->transactionType = m_entryType = EntryTransaction;
- } else if(line.lower() == "oth a" || KMyMoneyGlobalSettings::qifAsset().lower().contains(line.lower())) {
+ } else if(line.lower() == "oth a" || KMyMoneyGlobalSettings::qifAsset().lower().tqcontains(line.lower())) {
d->accountType = MyMoneyAccount::Asset;
d->firstTransaction = true;
d->transactionType = m_entryType = EntryTransaction;
- } else if(line.lower() == "oth l" || line.lower() == i18n("QIF tag for liability account", "Oth L").lower()) {
+ } else if(line.lower() == "oth l" || line.lower() == i18n("TQIF tag for liability account", "Oth L").lower()) {
d->accountType = MyMoneyAccount::Liability;
d->firstTransaction = true;
d->transactionType = m_entryType = EntryTransaction;
- } else if(line.lower() == "invst" || line.lower() == i18n("QIF tag for investment account", "Invst").lower()) {
+ } else if(line.lower() == "invst" || line.lower() == i18n("TQIF tag for investment account", "Invst").lower()) {
d->transactionType = m_entryType = EntryInvestmentTransaction;
- } else if(line.lower() == "invoice" || KMyMoneyGlobalSettings::qifInvoice().lower().contains(line.lower())) {
+ } else if(line.lower() == "invoice" || KMyMoneyGlobalSettings::qifInvoice().lower().tqcontains(line.lower())) {
m_entryType = EntrySkip;
} else if(line.lower() == "tax") {
@@ -589,19 +589,19 @@ void MyMoneyQifReader::processQifSpecial(const QString& _line)
m_entryType = EntrySkip;
// exportable lists
- } else if(line.lower() == "cat" || line.lower() == i18n("QIF tag for category", "Cat").lower()) {
+ } else if(line.lower() == "cat" || line.lower() == i18n("TQIF tag for category", "Cat").lower()) {
m_entryType = EntryCategory;
- } else if(line.lower() == "security" || line.lower() == i18n("QIF tag for security", "Security").lower()) {
+ } else if(line.lower() == "security" || line.lower() == i18n("TQIF tag for security", "Security").lower()) {
m_entryType = EntrySecurity;
- } else if(line.lower() == "prices" || line.lower() == i18n("QIF tag for prices", "Prices").lower()) {
+ } else if(line.lower() == "prices" || line.lower() == i18n("TQIF tag for prices", "Prices").lower()) {
m_entryType = EntryPrice;
} else if(line.lower() == "payee") {
m_entryType = EntryPayee;
- } else if(line.lower() == "class" || line.lower() == i18n("QIF tag for a class", "Class").lower()) {
+ } else if(line.lower() == "class" || line.lower() == i18n("TQIF tag for a class", "Class").lower()) {
m_entryType = EntryClass;
} else if(line.lower() == "memorized") {
@@ -617,7 +617,7 @@ void MyMoneyQifReader::processQifSpecial(const QString& _line)
m_entryType = EntrySkip;
} else {
- qWarning("Unknown export header '!Type:%s' in QIF file on line %d: Skipping section.", line.data(), m_linenumber);
+ qWarning("Unknown export header '!Type:%s' in TQIF file on line %d: Skipping section.", line.data(), m_linenumber);
m_entryType = EntrySkip;
}
@@ -635,7 +635,7 @@ void MyMoneyQifReader::processQifSpecial(const QString& _line)
void MyMoneyQifReader::processQifEntry(void)
{
- // This method processes a 'QIF Entry' which is everything between two caret
+ // This method processes a 'TQIF Entry' which is everything between two caret
// signs
//
try {
@@ -698,9 +698,9 @@ void MyMoneyQifReader::processQifEntry(void)
}
}
-const QString MyMoneyQifReader::extractLine(const QChar id, int cnt)
+const TQString MyMoneyQifReader::extractLine(const TQChar id, int cnt)
{
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
m_extractedLine = -1;
for(it = m_qifEntry.begin(); it != m_qifEntry.end(); ++it) {
@@ -708,20 +708,20 @@ const QString MyMoneyQifReader::extractLine(const QChar id, int cnt)
if((*it)[0] == id) {
if(cnt-- == 1) {
if((*it).mid(1).isEmpty())
- return QString(" ");
+ return TQString(" ");
return (*it).mid(1);
}
}
}
m_extractedLine = -1;
- return QString();
+ return TQString();
}
-void MyMoneyQifReader::extractSplits(QValueList<qSplit>& listqSplits) const
+void MyMoneyQifReader::extractSplits(TQValueList<qSplit>& listqSplits) const
{
-// *** With apologies to QString MyMoneyQifReader::extractLine ***
+// *** With apologies to TQString MyMoneyQifReader::extractLine ***
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for(it = m_qifEntry.begin(); it != m_qifEntry.end(); ++it) {
if((*it)[0] == "S") {
@@ -744,13 +744,13 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE
if(extractLine('P').lower() == m_qifProfile.openingBalanceText().lower()) {
m_account = MyMoneyAccount();
m_account.setAccountType(accountType);
- QString txt = extractLine('T');
+ TQString txt = extractLine('T');
MyMoneyMoney balance = m_qifProfile.value('T', txt);
- QDate date = m_qifProfile.date(extractLine('D'));
+ TQDate date = m_qifProfile.date(extractLine('D'));
m_account.setOpeningDate(date);
- QString name = extractLine('L');
+ TQString name = extractLine('L');
if(name.left(1) == m_qifProfile.accountDelimiter().left(1)) {
name = name.mid(1, name.length()-2);
}
@@ -761,7 +761,7 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE
if ( ! balance.isZero() )
{
MyMoneyFile* file = MyMoneyFile::instance();
- QString openingtxid = file->openingBalanceTransaction(m_account);
+ TQString openingtxid = file->openingBalanceTransaction(m_account);
MyMoneyFileTransaction ft;
if ( ! openingtxid.isEmpty() )
{
@@ -772,8 +772,8 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE
{
const MyMoneySecurity& sec = file->security(m_account.currencyId());
if ( KMessageBox::questionYesNo(
- qApp->mainWidget(),
- i18n("The %1 account currently has an opening balance of %2. This QIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the QIF file?").arg(m_account.name(), split.shares().formatMoney(m_account, sec),balance.formatMoney(m_account, sec)),
+ tqApp->mainWidget(),
+ i18n("The %1 account currently has an opening balance of %2. This TQIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the TQIF file?").tqarg(m_account.name(), split.shares().formatMoney(m_account, sec),balance.formatMoney(m_account, sec)),
i18n("Overwrite opening balance"),
KStdGuiItem::yes(),
KStdGuiItem::no(),
@@ -817,7 +817,7 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE
// Lines 1-5 are processed via processQifEntry() and processAccountEntry()
// Then Quicken issues line 6 but since the account does not carry any
// transaction does not write an end delimiter. Arrrgh! So we end up with
- // a QIF entry comprising of lines 6-11 and end up in this routine. Actually,
+ // a TQIF entry comprising of lines 6-11 and end up in this routine. Actually,
// lines 7-11 are the leadin for the next account. So we check here if
// the !Type:xxx record also contains an !Account line and process the
// entry as required.
@@ -832,7 +832,7 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE
// Line 12 would set the mode to "cc transaction entries"
// Lines 13+ would be interpreted as cc transaction entries, and life is good
int exclamationCnt = 1;
- QString category;
+ TQString category;
do {
category = extractLine('!', exclamationCnt++);
} while(!category.isEmpty() && category != "Account");
@@ -870,13 +870,13 @@ void MyMoneyQifReader::processCategoryEntry(void)
account.setName(extractLine('N'));
account.setDescription(extractLine('D'));
- MyMoneyAccount parentAccount;
+ MyMoneyAccount tqparentAccount;
if(!extractLine('I').isEmpty()) {
account.setAccountType(MyMoneyAccount::Income);
- parentAccount = file->income();
+ tqparentAccount = file->income();
} else if(!extractLine('E').isEmpty()) {
account.setAccountType(MyMoneyAccount::Expense);
- parentAccount = file->expense();
+ tqparentAccount = file->expense();
}
// check if we can find the account already in the file
@@ -886,20 +886,20 @@ void MyMoneyQifReader::processCategoryEntry(void)
if(acc.id().isEmpty()) {
MyMoneyAccount brokerage;
MyMoneyMoney balance;
- kmymoney2->createAccount(account, parentAccount, brokerage, balance);
+ kmymoney2->createAccount(account, tqparentAccount, brokerage, balance);
}
}
-QString MyMoneyQifReader::transferAccount(QString name, bool useBrokerage)
+TQString MyMoneyQifReader::transferAccount(TQString name, bool useBrokerage)
{
- QString accountId;
- QStringList tmpEntry = m_qifEntry; // keep temp copies
+ TQString accountId;
+ TQStringList tmpEntry = m_qifEntry; // keep temp copies
MyMoneyAccount tmpAccount = m_account;
m_qifEntry.clear(); // and construct a temp entry to create/search the account
- m_qifEntry << QString("N%1").arg(name);
- m_qifEntry << QString("Tunknown");
- m_qifEntry << QString("D%1").arg(i18n("Autogenerated by QIF importer"));
+ m_qifEntry << TQString("N%1").tqarg(name);
+ m_qifEntry << TQString("Tunknown");
+ m_qifEntry << TQString("D%1").tqarg(i18n("Autogenerated by TQIF importer"));
accountId = processAccountEntry(false);
// in case we found a reference to an investment account, we need
@@ -908,9 +908,9 @@ QString MyMoneyQifReader::transferAccount(QString name, bool useBrokerage)
if(useBrokerage && (acc.accountType() == MyMoneyAccount::Investment)) {
name = acc.brokerageName();
m_qifEntry.clear(); // and construct a temp entry to create/search the account
- m_qifEntry << QString("N%1").arg(name);
- m_qifEntry << QString("Tunknown");
- m_qifEntry << QString("D%1").arg(i18n("Autogenerated by QIF importer"));
+ m_qifEntry << TQString("N%1").tqarg(name);
+ m_qifEntry << TQString("Tunknown");
+ m_qifEntry << TQString("D%1").tqarg(i18n("Autogenerated by TQIF importer"));
accountId = processAccountEntry(false);
}
m_qifEntry = tmpEntry; // restore local copies
@@ -925,16 +925,16 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp
// if we don't have a name for the current account we need to extract the name from the L-record
if(m_account.name().isEmpty()) {
- QString name = extractLine('L');
+ TQString name = extractLine('L');
if(name.isEmpty()) {
- name = i18n("QIF imported, no account name supplied");
+ name = i18n("TQIF imported, no account name supplied");
}
d->isTransfer(name, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1,1));
- QStringList entry = m_qifEntry; // keep a temp copy
+ TQStringList entry = m_qifEntry; // keep a temp copy
m_qifEntry.clear(); // and construct a temp entry to create/search the account
- m_qifEntry << QString("N%1").arg(name);
- m_qifEntry << QString("T%1").arg(d->accountTypeToQif(accType));
- m_qifEntry << QString("D%1").arg(i18n("Autogenerated by QIF importer"));
+ m_qifEntry << TQString("N%1").tqarg(name);
+ m_qifEntry << TQString("T%1").tqarg(d->accountTypeToQif(accType));
+ m_qifEntry << TQString("D%1").tqarg(i18n("Autogenerated by TQIF importer"));
processAccountEntry();
m_qifEntry = entry; // restore local copy
}
@@ -949,7 +949,7 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp
acc = file->accountByName(m_account.brokerageName());
// check if we already have an opening balance transaction
- QString tid = file->openingBalanceTransaction(acc);
+ TQString tid = file->openingBalanceTransaction(acc);
MyMoneyTransaction ot;
if(!tid.isEmpty()) {
ot = file->transaction(tid);
@@ -960,7 +960,7 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp
}
if(needCreate) {
// in case we create it anyway, we issue a warning to the user to check it manually
- KMessageBox::sorry(0, QString("<qt>%1</qt>").arg(i18n("KMyMoney has imported a second opening balance transaction into account <b>%1</b> which differs from the one found already on file. Please correct this manually once the import is done.").arg(acc.name())), i18n("Opening balance problem"));
+ KMessageBox::sorry(0, TQString("<qt>%1</qt>").tqarg(i18n("KMyMoney has imported a second opening balance transaction into account <b>%1</b> which differs from the one found already on file. Please correct this manually once the import is done.").tqarg(acc.name())), i18n("Opening balance problem"));
}
}
@@ -984,7 +984,7 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp
} catch(MyMoneyException* e) {
KMessageBox::detailedError(0,
i18n("Error while creating opening balance transaction"),
- QString("%1(%2):%3").arg(e->file()).arg(e->line()).arg(e->what()),
+ TQString("%1(%2):%3").tqarg(e->file()).tqarg(e->line()).tqarg(e->what()),
i18n("File access error"));
delete e;
}
@@ -1004,22 +1004,22 @@ void MyMoneyQifReader::processTransactionEntry(void)
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneyStatement::Split s1;
MyMoneyStatement::Transaction tr;
- QString tmp;
- QString accountId;
+ TQString tmp;
+ TQString accountId;
int pos;
- QString payee = extractLine('P');
+ TQString payee = extractLine('P');
unsigned long h;
h = MyMoneyTransaction::hash(m_qifEntry.join(";"));
- QString hashBase;
+ TQString hashBase;
hashBase.sprintf("%s-%07lx", m_qifProfile.date(extractLine('D')).toString(Qt::ISODate).data(), h);
int idx = 1;
- QString hash;
+ TQString hash;
for(;;) {
- hash = QString("%1-%2").arg(hashBase).arg(idx);
- QMap<QString, bool>::const_iterator it;
- it = d->m_hashMap.find(hash);
+ hash = TQString("%1-%2").tqarg(hashBase).tqarg(idx);
+ TQMap<TQString, bool>::const_iterator it;
+ it = d->m_hashMap.tqfind(hash);
if(it == d->m_hashMap.end()) {
d->m_hashMap[hash] = true;
break;
@@ -1030,7 +1030,7 @@ void MyMoneyQifReader::processTransactionEntry(void)
if(d->firstTransaction) {
// check if this is an opening balance transaction and process it out of the statement
- if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().contains(payee.lower()))) {
+ if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().tqcontains(payee.lower()))) {
createOpeningBalance();
d->firstTransaction = false;
return;
@@ -1053,12 +1053,12 @@ void MyMoneyQifReader::processTransactionEntry(void)
"date profile setting of \"%2\".\n\nPressing \"Continue\" will "
"assign todays date to the transaction. Pressing \"Cancel\" will abort "
"the import operation. You can then restart the import and select a different "
- "QIF profile or create a new one.")
- .arg(extractLine('D')).arg(m_qifProfile.inputDateFormat()),
+ "TQIF profile or create a new one.")
+ .tqarg(extractLine('D')).tqarg(m_qifProfile.inputDateFormat()),
i18n("Invalid date format"));
switch(rc) {
case KMessageBox::Continue:
- tr.m_datePosted = (QDate::currentDate());
+ tr.m_datePosted = (TQDate::tqcurrentDate());
break;
case KMessageBox::Cancel:
@@ -1068,7 +1068,7 @@ void MyMoneyQifReader::processTransactionEntry(void)
}
tmp = extractLine('L');
- pos = tmp.findRev("--");
+ pos = tmp.tqfindRev("--");
if(tmp.left(1) == m_qifProfile.accountDelimiter().left(1)) {
// it's a transfer, so we wipe the memo
// tmp = ""; why??
@@ -1081,18 +1081,18 @@ void MyMoneyQifReader::processTransactionEntry(void)
// t.setMemo(tmp);
// Assign the "#" field to the transaction's bank id
- // This is the custom KMM extension to QIF for a unique ID
+ // This is the custom KMM extension to TQIF for a unique ID
tmp = extractLine('#');
if(!tmp.isEmpty())
{
- tr.m_strBankID = QString("ID %1").arg(tmp);
+ tr.m_strBankID = TQString("ID %1").tqarg(tmp);
}
#if 0
// Collect data for the account's split
s1.m_accountId = m_account.id();
tmp = extractLine('S');
- pos = tmp.findRev("--");
+ pos = tmp.tqfindRev("--");
if(pos != -1) {
tmp = tmp.left(pos);
}
@@ -1101,7 +1101,7 @@ void MyMoneyQifReader::processTransactionEntry(void)
tmp = tmp.mid(1, tmp.length()-2);
s1.m_strCategoryName = tmp;
#endif
- // TODO (Ace) Deal with currencies more gracefully. QIF cannot deal with multiple
+ // TODO (Ace) Deal with currencies more gracefully. TQIF cannot deal with multiple
// currencies, so we should assume that transactions imported into a given
// account are in THAT ACCOUNT's currency. If one of those involves a transfer
// to an account with a different currency, value and shares should be
@@ -1140,7 +1140,7 @@ void MyMoneyQifReader::processTransactionEntry(void)
accountId = transferAccount(tmp, false);
} else {
-/* pos = tmp.findRev("--");
+/* pos = tmp.tqfindRev("--");
if(pos != -1) {
t.setValue("Dialog", tmp.mid(pos+2));
tmp = tmp.left(pos);
@@ -1164,12 +1164,12 @@ void MyMoneyQifReader::processTransactionEntry(void)
if ( account.id() == m_account.id() )
{
kdDebug(0) << "Line " << m_linenumber << ": Cannot transfer to the same account. Transfer ignored." << endl;
- accountId = QString();
+ accountId = TQString();
}
} catch (MyMoneyException *e) {
kdDebug(0) << "Line " << m_linenumber << ": Account with id " << accountId.data() << " not found" << endl;
- accountId = QString();
+ accountId = TQString();
delete e;
}
}
@@ -1182,7 +1182,7 @@ void MyMoneyQifReader::processTransactionEntry(void)
} else {
// split transaction
- QValueList<qSplit> listqSplits;
+ TQValueList<qSplit> listqSplits;
extractSplits(listqSplits); // ****** ensure each field is ******
// * attached to correct split *
@@ -1200,7 +1200,7 @@ void MyMoneyQifReader::processTransactionEntry(void)
accountId = transferAccount(tmp, false);
} else {
- pos = tmp.findRev("--");
+ pos = tmp.tqfindRev("--");
if(pos != -1) {
/// t.setValue("Dialog", tmp.mid(pos+2));
tmp = tmp.left(pos);
@@ -1223,12 +1223,12 @@ void MyMoneyQifReader::processTransactionEntry(void)
if ( account.id() == m_account.id() )
{
kdDebug(0) << "Line " << m_linenumber << ": Cannot transfer to the same account. Transfer ignored." << endl;
- accountId = QString();
+ accountId = TQString();
}
} catch (MyMoneyException *e) {
kdDebug(0) << "Line " << m_linenumber << ": Account with id " << accountId.data() << " not found" << endl;
- accountId = QString();
+ accountId = TQString();
delete e;
}
}
@@ -1290,7 +1290,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
// t.setCommodity(m_account.currencyId());
// 'D' field: Date
- QDate date = m_qifProfile.date(extractLine('D'));
+ TQDate date = m_qifProfile.date(extractLine('D'));
if(date.isValid())
tr.m_datePosted = date;
else
@@ -1300,12 +1300,12 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
"date profile setting of \"%2\".\n\nPressing \"Continue\" will "
"assign todays date to the transaction. Pressing \"Cancel\" will abort "
"the import operation. You can then restart the import and select a different "
- "QIF profile or create a new one.")
- .arg(extractLine('D')).arg(m_qifProfile.inputDateFormat()),
+ "TQIF profile or create a new one.")
+ .tqarg(extractLine('D')).tqarg(m_qifProfile.inputDateFormat()),
i18n("Invalid date format"));
switch(rc) {
case KMessageBox::Continue:
- tr.m_datePosted = QDate::currentDate();
+ tr.m_datePosted = TQDate::tqcurrentDate();
break;
case KMessageBox::Cancel:
@@ -1315,21 +1315,21 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
}
// 'M' field: Memo
- QString memo = extractLine('M');
+ TQString memo = extractLine('M');
d->fixMultiLineMemo(memo);
tr.m_strMemo = memo;
unsigned long h;
h = MyMoneyTransaction::hash(m_qifEntry.join(";"));
- QString hashBase;
+ TQString hashBase;
hashBase.sprintf("%s-%07lx", m_qifProfile.date(extractLine('D')).toString(Qt::ISODate).data(), h);
int idx = 1;
- QString hash;
+ TQString hash;
for(;;) {
- hash = QString("%1-%2").arg(hashBase).arg(idx);
- QMap<QString, bool>::const_iterator it;
- it = d->m_hashMap.find(hash);
+ hash = TQString("%1-%2").tqarg(hashBase).tqarg(idx);
+ TQMap<TQString, bool>::const_iterator it;
+ it = d->m_hashMap.tqfind(hash);
if(it == d->m_hashMap.end()) {
d->m_hashMap[hash] = true;
break;
@@ -1339,9 +1339,9 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
tr.m_strBankID = hash;
// '#' field: BankID
- QString tmp = extractLine('#');
+ TQString tmp = extractLine('#');
if ( ! tmp.isEmpty() )
- tr.m_strBankID = QString("ID %1").arg(tmp);
+ tr.m_strBankID = TQString("ID %1").tqarg(tmp);
// Reconciliation flag
tr.m_reconcile = d->reconcileState(extractLine('C'));
@@ -1361,7 +1361,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
#if 0 // we must check for that later, because certain activities don't need a security
// 'Y' field: Security name
- QString securityname = extractLine('Y').lower();
+ TQString securityname = extractLine('Y').lower();
if ( securityname.isEmpty() )
{
kdDebug(2) << "Line " << m_linenumber << ": Investment transaction without a security is not supported." << endl;
@@ -1379,13 +1379,13 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
// abbreviations or ordered words differently, etc.
//
// If there is a perfect name match with a subordinate stock account, great.
- // More likely, we have to rely on the QIF file containing !Type:Security
+ // More likely, we have to rely on the TQIF file containing !Type:Security
// records, which tell us the mapping from name to symbol.
//
- // Therefore, generally it is not recommended to import a QIF file containing
+ // Therefore, generally it is not recommended to import a TQIF file containing
// investment transactions but NOT containing security records.
- QString securitysymbol = m_investmentMap[securityname];
+ TQString securitysymbol = m_investmentMap[securityname];
// the correct account is the stock account which matches two criteria:
// (1) it is a sub-account of the selected investment account, and either
@@ -1395,14 +1395,14 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
// search through each subordinate account
bool found = false;
MyMoneyAccount thisaccount = m_account;
- QStringList accounts = thisaccount.accountList();
- QStringList::const_iterator it_account = accounts.begin();
+ TQStringList accounts = thisaccount.accountList();
+ TQStringList::const_iterator it_account = accounts.begin();
while( !found && it_account != accounts.end() )
{
- QString currencyid = file->account(*it_account).currencyId();
+ TQString currencyid = file->account(*it_account).currencyId();
MyMoneySecurity security = file->security( currencyid );
- QString symbol = security.tradingSymbol().lower();
- QString name = security.name().lower();
+ TQString symbol = security.tradingSymbol().lower();
+ TQString name = security.name().lower();
if ( securityname == name || securitysymbol == symbol )
{
@@ -1414,7 +1414,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
#if 0
// update the price, while we're here. in the future, this should be
// an option
- QString basecurrencyid = file->baseCurrency().id();
+ TQString basecurrencyid = file->baseCurrency().id();
MyMoneyPrice price = file->price( currencyid, basecurrencyid, t_in.m_datePosted, true );
if ( !price.isValid() )
{
@@ -1434,9 +1434,9 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
// If the security is not known, notify the user
// TODO (Ace) A "SelectOrCreateAccount" interface for investments
KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. "
- "Transactions involving this security will be ignored.").arg(securityname),
+ "Transactions involving this security will be ignored.").tqarg(securityname),
i18n("Security not found"),
- QString("MissingSecurity%1").arg(securityname.stripWhiteSpace()));
+ TQString("MissingSecurity%1").tqarg(securityname.stripWhiteSpace()));
return;
}
#endif
@@ -1448,7 +1448,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
MyMoneyMoney quantity = m_qifProfile.value('T', extractLine('Q'));
// 'N' field: Action
- QString action = extractLine('N').lower();
+ TQString action = extractLine('N').lower();
// remove trailing X, which seems to have no purpose (?!)
bool xAction = false;
@@ -1458,7 +1458,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
}
// Whether to create a cash split for the other side of the value
- QString accountname ;//= extractLine('L');
+ TQString accountname ;//= extractLine('L');
if ( action == "reinvdiv" || action == "reinvlg" || action == "reinvsh" )
{
d->st.m_listPrices += price;
@@ -1475,7 +1475,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
{
tr.m_eAction = (MyMoneyStatement::Transaction::eaCashDividend);
- QString tmp = extractLine('L');
+ TQString tmp = extractLine('L');
// if the action ends in an X, the L-Record contains the asset account
// to which the dividend should be transferred. In the other cases, it
// may contain a category that identifies the income category for the
@@ -1512,7 +1512,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
if(action == "miscexp")
tr.m_eAction = (MyMoneyStatement::Transaction::eaFees);
- QString tmp = extractLine('L');
+ TQString tmp = extractLine('L');
// if the action ends in an X, the L-Record contains the asset account
// to which the dividend should be transferred. In the other cases, it
// may contain a category that identifies the income category for the
@@ -1538,19 +1538,19 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
tr.m_amount = -(amount - tr.m_fees);
if(tr.m_strMemo.isEmpty())
- tr.m_strMemo = (QString("%1 %2").arg(extractLine('Y')).arg(d->typeToAccountName(action))).stripWhiteSpace();
+ tr.m_strMemo = (TQString("%1 %2").tqarg(extractLine('Y')).tqarg(d->typeToAccountName(action))).stripWhiteSpace();
}
else if (action == "xin" || action == "xout")
{
- QString payee = extractLine('P');
- if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().contains(payee.lower()))) {
+ TQString payee = extractLine('P');
+ if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().tqcontains(payee.lower()))) {
createOpeningBalance(MyMoneyAccount::Investment);
return;
}
tr.m_eAction = (MyMoneyStatement::Transaction::eaNone);
MyMoneyStatement::Split s2;
- QString tmp = extractLine('L');
+ TQString tmp = extractLine('L');
if(d->isTransfer(tmp, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1, 1))) {
s2.m_accountId = transferAccount(tmp);
s2.m_strCategoryName = tmp;
@@ -1569,7 +1569,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
}
else if (action == "buy")
{
- QString tmp = extractLine('L');
+ TQString tmp = extractLine('L');
if(d->isTransfer(tmp, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1, 1)) == true) {
tr.m_strBrokerageAccount = tmp;
transferAccount(tmp); // make sure the account exists
@@ -1581,7 +1581,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
}
else if (action == "sell")
{
- QString tmp = extractLine('L');
+ TQString tmp = extractLine('L');
if(d->isTransfer(tmp, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1, 1)) == true) {
tr.m_strBrokerageAccount = tmp;
transferAccount(tmp); // make sure the account exists
@@ -1844,16 +1844,16 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void)
*/
}
-const QString MyMoneyQifReader::findOrCreateIncomeAccount(const QString& searchname)
+const TQString MyMoneyQifReader::findOrCreateIncomeAccount(const TQString& searchname)
{
- QString result;
+ TQString result;
MyMoneyFile *file = MyMoneyFile::instance();
// First, try to find this account as an income account
MyMoneyAccount acc = file->income();
- QStringList list = acc.accountList();
- QStringList::ConstIterator it_accid = list.begin();
+ TQStringList list = acc.accountList();
+ TQStringList::ConstIterator it_accid = list.begin();
while ( it_accid != list.end() )
{
acc = file->account(*it_accid);
@@ -1883,16 +1883,16 @@ const QString MyMoneyQifReader::findOrCreateIncomeAccount(const QString& searchn
// TODO (Ace) Combine this and the previous function
-const QString MyMoneyQifReader::findOrCreateExpenseAccount(const QString& searchname)
+const TQString MyMoneyQifReader::findOrCreateExpenseAccount(const TQString& searchname)
{
- QString result;
+ TQString result;
MyMoneyFile *file = MyMoneyFile::instance();
// First, try to find this account as an income account
MyMoneyAccount acc = file->expense();
- QStringList list = acc.accountList();
- QStringList::ConstIterator it_accid = list.begin();
+ TQStringList list = acc.accountList();
+ TQStringList::ConstIterator it_accid = list.begin();
while ( it_accid != list.end() )
{
acc = file->account(*it_accid);
@@ -1920,16 +1920,16 @@ const QString MyMoneyQifReader::findOrCreateExpenseAccount(const QString& search
return result;
}
-QString MyMoneyQifReader::checkCategory(const QString& name, const MyMoneyMoney value, const MyMoneyMoney value2)
+TQString MyMoneyQifReader::checkCategory(const TQString& name, const MyMoneyMoney value, const MyMoneyMoney value2)
{
- QString accountId;
+ TQString accountId;
MyMoneyFile *file = MyMoneyFile::instance();
MyMoneyAccount account;
bool found = true;
if(!name.isEmpty()) {
// The category might be constructed with an arbitraty depth (number of
- // colon delimited fields). We try to find a parent account within this
+ // colon delimited fields). We try to find a tqparent account within this
// hierarchy by searching the following sequence:
//
// aaaa:bbbb:cccc:ddddd
@@ -1941,40 +1941,40 @@ QString MyMoneyQifReader::checkCategory(const QString& name, const MyMoneyMoney
// 5. don't search , create aaaa:bbbb:cccc:dddd
account.setName(name);
- QString accName; // part to be created (right side in above list)
- QString parent(name); // a possible parent part (left side in above list)
+ TQString accName; // part to be created (right side in above list)
+ TQString tqparent(name); // a possible tqparent part (left side in above list)
do {
- accountId = file->categoryToAccount(parent);
+ accountId = file->categoryToAccount(tqparent);
if(accountId.isEmpty()) {
found = false;
// prepare next step
if(!accName.isEmpty())
accName.prepend(':');
- accName.prepend(parent.section(':', -1));
+ accName.prepend(tqparent.section(':', -1));
account.setName(accName);
- parent = parent.section(':', 0, -2);
+ tqparent = tqparent.section(':', 0, -2);
} else if(!accName.isEmpty()) {
account.setParentAccountId(accountId);
}
}
- while(!parent.isEmpty() && accountId.isEmpty());
+ while(!tqparent.isEmpty() && accountId.isEmpty());
// if we did not find the category, we create it
if(!found) {
- MyMoneyAccount parent;
- if(account.parentAccountId().isEmpty()) {
+ MyMoneyAccount tqparent;
+ if(account.tqparentAccountId().isEmpty()) {
if(!value.isNegative() && value2.isNegative())
- parent = file->income();
+ tqparent = file->income();
else
- parent = file->expense();
+ tqparent = file->expense();
} else {
- parent = file->account(account.parentAccountId());
+ tqparent = file->account(account.tqparentAccountId());
}
account.setAccountType((!value.isNegative() && value2.isNegative()) ? MyMoneyAccount::Income : MyMoneyAccount::Expense);
MyMoneyAccount brokerage;
- // clear out the parent id, because createAccount() does not like that
- account.setParentAccountId(QString());
- kmymoney2->createAccount(account, parent, brokerage, MyMoneyMoney());
+ // clear out the tqparent id, because createAccount() does not like that
+ account.setParentAccountId(TQString());
+ kmymoney2->createAccount(account, tqparent, brokerage, MyMoneyMoney());
accountId = account.id();
}
}
@@ -1982,12 +1982,12 @@ QString MyMoneyQifReader::checkCategory(const QString& name, const MyMoneyMoney
return accountId;
}
-QString MyMoneyQifReader::processAccountEntry(bool resetAccountId)
+TQString MyMoneyQifReader::processAccountEntry(bool resetAccountId)
{
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneyAccount account;
- QString tmp;
+ TQString tmp;
account.setName(extractLine('N'));
// qDebug("Process account '%s'", account.name().data());
@@ -2003,8 +2003,8 @@ QString MyMoneyQifReader::processAccountEntry(bool resetAccountId)
account.setValue("lastStatementDate", m_qifProfile.date(tmp).toString("yyyy-MM-dd"));
QifEntryTypeE transactionType = EntryTransaction;
- QString type = extractLine('T').lower().remove(QRegExp("\\s+"));
- if(type == m_qifProfile.profileType().lower().remove(QRegExp("\\s+"))) {
+ TQString type = extractLine('T').lower().remove(TQRegExp("\\s+"));
+ if(type == m_qifProfile.profileType().lower().remove(TQRegExp("\\s+"))) {
account.setAccountType(MyMoneyAccount::Checkings);
} else if(type == "ccard" || type == "creditcard") {
account.setAccountType(MyMoneyAccount::CreditCard);
@@ -2036,30 +2036,30 @@ QString MyMoneyQifReader::processAccountEntry(bool resetAccountId)
if(account.accountType() == MyMoneyAccount::UnknownAccountType)
account.setAccountType(MyMoneyAccount::Checkings);
- MyMoneyAccount parentAccount;
+ MyMoneyAccount tqparentAccount;
MyMoneyAccount brokerage;
MyMoneyMoney balance;
// in case it's a stock account, we need to setup a fix investment account
if(account.isInvest()) {
- acc.setName(i18n("%1 (Investment)").arg(account.name())); // use the same name for the investment account
- acc.setDescription(i18n("Autogenerated by QIF importer from type Mutual account entry"));
+ acc.setName(i18n("%1 (Investment)").tqarg(account.name())); // use the same name for the investment account
+ acc.setDescription(i18n("Autogenerated by TQIF importer from type Mutual account entry"));
acc.setAccountType(MyMoneyAccount::Investment);
- parentAccount = file->asset();
- kmymoney2->createAccount(acc, parentAccount, brokerage, MyMoneyMoney());
- parentAccount = acc;
+ tqparentAccount = file->asset();
+ kmymoney2->createAccount(acc, tqparentAccount, brokerage, MyMoneyMoney());
+ tqparentAccount = acc;
qDebug("We still need to create the stock account in MyMoneyQifReader::processAccountEntry()");
} else {
- // setup parent according the type of the account
+ // setup tqparent according the type of the account
switch(account.accountGroup()) {
case MyMoneyAccount::Asset:
default:
- parentAccount = file->asset();
+ tqparentAccount = file->asset();
break;
case MyMoneyAccount::Liability:
- parentAccount = file->liability();
+ tqparentAccount = file->liability();
break;
case MyMoneyAccount::Equity:
- parentAccount = file->equity();
+ tqparentAccount = file->equity();
break;
}
}
@@ -2071,7 +2071,7 @@ QString MyMoneyQifReader::processAccountEntry(bool resetAccountId)
brokerage.setAccountType(MyMoneyAccount::Checkings);
brokerage.setCurrencyId(MyMoneyFile::instance()->baseCurrency().id());
}
- kmymoney2->createAccount(account, parentAccount, brokerage, balance);
+ kmymoney2->createAccount(account, tqparentAccount, brokerage, balance);
acc = account;
// qDebug("Account created");
} else {
@@ -2092,13 +2092,13 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
{
MyMoneyFile* file = MyMoneyFile::instance();
- QString accountId;
- QString msg;
- QString typeStr;
- QString leadIn;
+ TQString accountId;
+ TQString msg;
+ TQString typeStr;
+ TQString leadIn;
KMyMoneyUtils::categoryTypeE type;
- QMap<QString, QString>::ConstIterator it;
+ TQMap<TQString, TQString>::ConstIterator it;
type = KMyMoneyUtils::none;
switch(account.accountGroup()) {
@@ -2123,14 +2123,14 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
if(!msg.isEmpty())
accountSelect.setCaption(msg);
- it = m_accountTranslation.find((leadIn + MyMoneyFile::AccountSeperator + account.name()).lower());
+ it = m_accountTranslation.tqfind((leadIn + MyMoneyFile::AccountSeperator + account.name()).lower());
if(it != m_accountTranslation.end()) {
try {
account = file->account(*it);
return;
} catch (MyMoneyException *e) {
- QString message(i18n("Account \"%1\" disappeared: ").arg(account.name()));
+ TQString message(i18n("Account \"%1\" disappeared: ").tqarg(account.name()));
message += e->what();
KMessageBox::error(0, message);
delete e;
@@ -2152,7 +2152,7 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
} else {
switch(KMessageBox::questionYesNo(0,
i18n("The %1 '%2' does not exist. Do you "
- "want to create it?").arg(typeStr).arg(account.name()))) {
+ "want to create it?").tqarg(typeStr).tqarg(account.name()))) {
case KMessageBox::Yes:
break;
case KMessageBox::No:
@@ -2160,25 +2160,25 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
}
}
} else {
- accountSelect.setHeader(i18n("Select %1").arg(typeStr));
+ accountSelect.setHeader(i18n("Select %1").tqarg(typeStr));
if(!accountId.isEmpty()) {
msg = i18n("The %1 <b>%2</b> currently exists. Do you want "
"to import transactions to this account?")
- .arg(typeStr).arg(account.name());
+ .tqarg(typeStr).tqarg(account.name());
} else {
msg = i18n("The %1 <b>%2</b> currently does not exist. You can "
"create a new %3 by pressing the <b>Create</b> button "
"or select another %4 manually from the selection box.")
- .arg(typeStr).arg(account.name()).arg(typeStr).arg(typeStr);
+ .tqarg(typeStr).tqarg(account.name()).tqarg(typeStr).tqarg(typeStr);
}
}
} else {
- accountSelect.setHeader(i18n("Import transactions to %1").arg(typeStr));
- msg = i18n("No %1 information has been found in the selected QIF file. "
+ accountSelect.setHeader(i18n("Import transactions to %1").tqarg(typeStr));
+ msg = i18n("No %1 information has been found in the selected TQIF file. "
"Please select an account using the selection box in the dialog or "
"create a new %2 by pressing the <b>Create</b> button.")
- .arg(typeStr).arg(typeStr);
+ .tqarg(typeStr).tqarg(typeStr);
}
accountSelect.setDescription(msg);
@@ -2187,18 +2187,18 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
accountSelect.showAbortButton(true);
// display current entry in widget, the offending line (if any) will be shown in red
- QStringList::Iterator it_e;
+ TQStringList::Iterator it_e;
int i = 0;
for(it_e = m_qifEntry.begin(); it_e != m_qifEntry.end(); ++it_e) {
if(m_extractedLine == i)
- accountSelect.m_qifEntry->setColor(QColor("red"));
+ accountSelect.m_qifEntry->setColor(TQColor("red"));
accountSelect.m_qifEntry->append(*it_e);
- accountSelect.m_qifEntry->setColor(QColor("black"));
+ accountSelect.m_qifEntry->setColor(TQColor("black"));
++i;
}
for(;;) {
- if(accountSelect.exec() == QDialog::Accepted) {
+ if(accountSelect.exec() == TQDialog::Accepted) {
if(!accountSelect.selectedAccount().isEmpty()) {
accountId = accountSelect.selectedAccount();
@@ -2211,7 +2211,7 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
account = file->account(accountId);
if ( ! balance.isZero() )
{
- QString openingtxid = file->openingBalanceTransaction(account);
+ TQString openingtxid = file->openingBalanceTransaction(account);
MyMoneyFileTransaction ft;
if ( ! openingtxid.isEmpty() )
{
@@ -2222,8 +2222,8 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
{
const MyMoneySecurity& sec = file->security(account.currencyId());
if ( KMessageBox::questionYesNo(
- qApp->mainWidget(),
- i18n("The %1 account currently has an opening balance of %2. This QIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the QIF file?").arg(account.name(), split.shares().formatMoney(account, sec), balance.formatMoney(account, sec)),
+ tqApp->mainWidget(),
+ i18n("The %1 account currently has an opening balance of %2. This TQIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the TQIF file?").tqarg(account.name(), split.shares().formatMoney(account, sec), balance.formatMoney(account, sec)),
i18n("Overwrite opening balance"),
KStdGuiItem::yes(),
KStdGuiItem::no(),
@@ -2256,12 +2256,12 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone
}
}
-void MyMoneyQifReader::setProgressCallback(void(*callback)(int, int, const QString&))
+void MyMoneyQifReader::setProgressCallback(void(*callback)(int, int, const TQString&))
{
m_progressCallback = callback;
}
-void MyMoneyQifReader::signalProgress(int current, int total, const QString& msg)
+void MyMoneyQifReader::signalProgress(int current, int total, const TQString& msg)
{
if(m_progressCallback != 0)
(*m_progressCallback)(current, total, msg);
@@ -2287,23 +2287,23 @@ void MyMoneyQifReader::processPriceEntry(void)
*/
- QStringList::const_iterator it_line = m_qifEntry.begin();
+ TQStringList::const_iterator it_line = m_qifEntry.begin();
// Make a price for each line
- QRegExp priceExp("\"(.*)\",(.*),\"(.*)\"");
+ TQRegExp priceExp("\"(.*)\",(.*),\"(.*)\"");
while ( it_line != m_qifEntry.end() )
{
if(priceExp.search(*it_line) != -1) {
MyMoneyStatement::Price price;
price.m_strSecurity = priceExp.cap(1);
- QString pricestr = priceExp.cap(2);
- QString datestr = priceExp.cap(3);
+ TQString pricestr = priceExp.cap(2);
+ TQString datestr = priceExp.cap(3);
kdDebug(0) << "Price:" << price.m_strSecurity << " / " << pricestr << " / " << datestr << endl;
// Only add the price if the date is valid. If invalid, fail silently. See note above.
// Also require the price value to not have any slashes. Old prices will be something like
// "25 9/16", which we do not support. So we'll skip the price for now.
- QDate date = m_qifProfile.date(datestr);
+ TQDate date = m_qifProfile.date(datestr);
MyMoneyMoney rate(m_qifProfile.value('P', pricestr));
if(date.isValid() && !rate.isZero())
{
diff --git a/kmymoney2/converter/mymoneyqifreader.h b/kmymoney2/converter/mymoneyqifreader.h
index 77bf5ad..385b1ff 100644
--- a/kmymoney2/converter/mymoneyqifreader.h
+++ b/kmymoney2/converter/mymoneyqifreader.h
@@ -20,15 +20,15 @@
* *
***************************************************************************/
-#ifndef MYMONEYQIFREADER_H
-#define MYMONEYQIFREADER_H
+#ifndef MYMONEYTQIFREADER_H
+#define MYMONEYTQIFREADER_H
// ----------------------------------------------------------------------------
// QT Headers
-#include <qobject.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -49,9 +49,10 @@ class MyMoneyFileTransaction;
/**
* @author Thomas Baumgart
*/
-class MyMoneyQifReader : public QObject
+class MyMoneyQifReader : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
friend class Private;
private:
@@ -71,9 +72,9 @@ private:
struct qSplit
{
- QString m_strCategoryName;
- QString m_strMemo;
- QString m_amount;
+ TQString m_strCategoryName;
+ TQString m_strMemo;
+ TQString m_amount;
};
@@ -99,16 +100,16 @@ public:
* the file is send through this filter and the result
* is stored in the m_tempFile file.
*
- * @param name QString reference to the name of the profile
+ * @param name TQString reference to the name of the profile
*/
- void setProfile(const QString& name);
+ void setProfile(const TQString& name);
/**
* This method actually starts the import of data from the selected file
* into the MyMoney engine.
*
* This method also starts the user defined import filter program
- * defined in the QIF profile. If none is defined, the file is read
+ * defined in the TQIF profile. If none is defined, the file is read
* as is (actually the UNIX command 'cat -' is used as the filter).
*
* If data from the filter program is available, the slot
@@ -138,7 +139,7 @@ public:
const MyMoneyAccount& account() const { return m_account; };
- void setProgressCallback(void(*callback)(int, int, const QString&));
+ void setProgressCallback(void(*callback)(int, int, const TQString&));
private:
/**
@@ -147,11 +148,11 @@ private:
*
* For a parameter description see KMyMoneyView::progressCallback().
*/
- void signalProgress(int current, int total, const QString& = "");
+ void signalProgress(int current, int total, const TQString& = "");
/**
* This method scans a transaction contained in
- * a QIF file formatted as an account record. This
+ * a TQIF file formatted as an account record. This
* format is used by MS-Money. If the specific data
* is not found, then the data in the entry is treated
* as a transaction. In this case, the user will be asked to
@@ -174,7 +175,7 @@ private:
*
* The id of the account will be returned.
*/
- QString processAccountEntry(bool resetAccountId = true);
+ TQString processAccountEntry(bool resetAccountId = true);
/**
* This method scans the m_qifEntry object as a category record specified
@@ -217,15 +218,15 @@ private:
/**
* This method process a line starting with an exclamation mark
*/
- void processQifSpecial(const QString& _line);
+ void processQifSpecial(const TQString& _line);
/**
* This method is used to get the account id of the split for
- * a transaction from the text found in the QIF $ or L record.
+ * a transaction from the text found in the TQIF $ or L record.
* If an account with the name is not found, the user is asked
* if it should be created.
*
- * @param name name of account as found in the QIF file
+ * @param name name of account as found in the TQIF file
* @param value value found in the T record
* @param value2 value found in the $ record for splitted transactions
*
@@ -233,27 +234,27 @@ private:
* or the account was not found and not created the
* return value will be "".
*/
- QString checkCategory(const QString& name, const MyMoneyMoney value, const MyMoneyMoney value2);
+ TQString checkCategory(const TQString& name, const MyMoneyMoney value, const MyMoneyMoney value2);
/**
* This method extracts the line beginning with the letter @p id
- * from the lines contained in the QStringList object @p m_qifEntry.
- * An empty QString is returned, if the line is not found.
+ * from the lines contained in the TQStringList object @p m_qifEntry.
+ * An empty TQString is returned, if the line is not found.
*
- * @param id QChar containing the letter to be found
+ * @param id TQChar containing the letter to be found
* @param cnt return cnt'th of occurance of id in lines. cnt defaults to 1.
*
- * @return QString with the remainder of the line or empty if
+ * @return TQString with the remainder of the line or empty if
* @p id is not found in @p lines
*/
- const QString extractLine(const QChar id, int cnt = 1);
+ const TQString extractLine(const TQChar id, int cnt = 1);
/**
- * This method examines each line in the QStringList object @p m_qifEntry,
+ * This method examines each line in the TQStringList object @p m_qifEntry,
* searching for split entries, which it extracts into a struct qSplit and
* stores all splits found in @p listqSplits .
*/
- void extractSplits(QValueList<qSplit>& listqSplits) const;
+ void extractSplits(TQValueList<qSplit>& listqSplits) const;
enum SelectCreateMode {
Create = 0,
@@ -303,9 +304,9 @@ private:
* @p searchname as a name, and returns the id if the newly created account
*
* @param searchname The name of the account to find or create
- * @return QString id of the found or created account
+ * @return TQString id of the found or created account
*/
- static const QString findOrCreateIncomeAccount(const QString& searchname);
+ static const TQString findOrCreateIncomeAccount(const TQString& searchname);
/**
* This method looks up the @p searchname account by name and returns its id
@@ -313,9 +314,9 @@ private:
* @p searchname as a name, and returns the id if the newly created account
*
* @param searchname The name of the account to find or create
- * @return QString id of the found or created account
+ * @return TQString id of the found or created account
*/
- static const QString findOrCreateExpenseAccount(const QString& searchname);
+ static const TQString findOrCreateExpenseAccount(const TQString& searchname);
/**
* This method returns the account id for a given account @a name. In
@@ -323,7 +324,7 @@ private:
* (the default), the id of the corresponding brokerage account will be
* returned. In case an account is not existant, it will be created.
*/
- QString transferAccount(QString name, bool useBrokerage = true);
+ TQString transferAccount(TQString name, bool useBrokerage = true);
// void processQifLine(void);
void createOpeningBalance(MyMoneyAccount::_accountTypeE accType = MyMoneyAccount::Checkings);
@@ -356,22 +357,22 @@ private:
Private* const d;
KProcess m_filter;
- QString m_filename;
+ TQString m_filename;
KURL m_url;
MyMoneyQifProfile m_qifProfile;
MyMoneyAccount m_account;
unsigned long m_transactionsSkipped;
unsigned long m_transactionsProcessed;
- QStringList m_dontAskAgain;
- QMap<QString, QString> m_accountTranslation;
- QMap<QString, QString> m_investmentMap;
- QFile *m_file;
+ TQStringList m_dontAskAgain;
+ TQMap<TQString, TQString> m_accountTranslation;
+ TQMap<TQString, TQString> m_investmentMap;
+ TQFile *m_file;
char m_buffer[1024];
- QCString m_lineBuffer;
- QStringList m_qifEntry;
+ TQCString m_lineBuffer;
+ TQStringList m_qifEntry;
int m_extractedLine;
- QString m_qifLine;
- QStringList m_qifLines;
+ TQString m_qifLine;
+ TQStringList m_qifLines;
QifEntryTypeE m_entryType;
bool m_skipAccount;
bool m_processingData;
@@ -382,11 +383,11 @@ private:
bool m_warnedInvestment;
bool m_warnedSecurity;
bool m_warnedPrice;
- QValueList<MyMoneyTransaction> m_transactionCache;
+ TQValueList<MyMoneyTransaction> m_transactionCache;
- QValueList<QByteArray> m_data;
+ TQValueList<TQByteArray> m_data;
- void (*m_progressCallback)(int, int, const QString&);
+ void (*m_progressCallback)(int, int, const TQString&);
MyMoneyFileTransaction* m_ft;
};
diff --git a/kmymoney2/converter/mymoneyqifwriter.cpp b/kmymoney2/converter/mymoneyqifwriter.cpp
index 9526acd..8ab5c0f 100644
--- a/kmymoney2/converter/mymoneyqifwriter.cpp
+++ b/kmymoney2/converter/mymoneyqifwriter.cpp
@@ -22,8 +22,8 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -45,16 +45,16 @@ MyMoneyQifWriter::~MyMoneyQifWriter()
{
}
-void MyMoneyQifWriter::write(const QString& filename, const QString& profile,
- const QString& accountId, const bool accountData,
+void MyMoneyQifWriter::write(const TQString& filename, const TQString& profile,
+ const TQString& accountId, const bool accountData,
const bool categoryData,
- const QDate& startDate, const QDate& endDate)
+ const TQDate& startDate, const TQDate& endDate)
{
m_qifProfile.loadProfile("Profile-" + profile);
- QFile qifFile(filename);
+ TQFile qifFile(filename);
if(qifFile.open(IO_WriteOnly)) {
- QTextStream s(&qifFile);
+ TQTextStream s(&qifFile);
try {
if(categoryData) {
@@ -67,9 +67,9 @@ void MyMoneyQifWriter::write(const QString& filename, const QString& profile,
emit signalProgress(-1, -1);
} catch(MyMoneyException *e) {
- QString errMsg = i18n("Unexpected exception '%1' thrown in %2, line %3 "
+ TQString errMsg = i18n("Unexpected exception '%1' thrown in %2, line %3 "
"caught in MyMoneyQifWriter::write()")
- .arg(e->what()).arg(e->file()).arg(e->line());
+ .tqarg(e->what()).tqarg(e->file()).tqarg(e->line());
KMessageBox::error(0, errMsg);
delete e;
@@ -77,11 +77,11 @@ void MyMoneyQifWriter::write(const QString& filename, const QString& profile,
qifFile.close();
} else {
- KMessageBox::error(0, i18n("Unable to open file '%1' for writing").arg(filename));
+ KMessageBox::error(0, i18n("Unable to open file '%1' for writing").tqarg(filename));
}
}
-void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountId, const QDate& startDate, const QDate& endDate)
+void MyMoneyQifWriter::writeAccountEntry(TQTextStream &s, const TQString& accountId, const TQDate& startDate, const TQDate& endDate)
{
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneyAccount account;
@@ -89,8 +89,8 @@ void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountI
account = file->account(accountId);
MyMoneyTransactionFilter filter(accountId);
filter.setDateFilter(startDate, endDate);
- QValueList<MyMoneyTransaction> list = file->transactionList(filter);
- QString openingBalanceTransactionId;
+ TQValueList<MyMoneyTransaction> list = file->transactionList(filter);
+ TQString openingBalanceTransactionId;
s << "!Type:" << m_qifProfile.profileType() << endl;
if(!startDate.isValid() || startDate <= account.openingDate()) {
@@ -117,7 +117,7 @@ void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountI
s << endl;
s << "^" << endl;
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::ConstIterator it;
signalProgress(0, list.count());
int count = 0;
for(it = list.begin(); it != list.end(); ++it) {
@@ -128,7 +128,7 @@ void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountI
}
}
-void MyMoneyQifWriter::writeCategoryEntries(QTextStream &s)
+void MyMoneyQifWriter::writeCategoryEntries(TQTextStream &s)
{
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneyAccount income;
@@ -138,9 +138,9 @@ void MyMoneyQifWriter::writeCategoryEntries(QTextStream &s)
expense = file->expense();
s << "!Type:Cat" << endl;
- QStringList list = income.accountList() + expense.accountList();
+ TQStringList list = income.accountList() + expense.accountList();
emit signalProgress(0, list.count());
- QStringList::Iterator it;
+ TQStringList::Iterator it;
int count = 0;
for(it = list.begin(); it != list.end(); ++it) {
writeCategoryEntry(s, *it, "");
@@ -148,24 +148,24 @@ void MyMoneyQifWriter::writeCategoryEntries(QTextStream &s)
}
}
-void MyMoneyQifWriter::writeCategoryEntry(QTextStream &s, const QString& accountId, const QString& leadIn)
+void MyMoneyQifWriter::writeCategoryEntry(TQTextStream &s, const TQString& accountId, const TQString& leadIn)
{
MyMoneyAccount acc = MyMoneyFile::instance()->account(accountId);
- QString name = acc.name();
+ TQString name = acc.name();
s << "N" << leadIn << name << endl;
s << (MyMoneyAccount::accountGroup(acc.accountType()) == MyMoneyAccount::Expense ? "E" : "I") << endl;
s << "^" << endl;
- QStringList list = acc.accountList();
- QStringList::Iterator it;
+ TQStringList list = acc.accountList();
+ TQStringList::Iterator it;
name += ":";
for(it = list.begin(); it != list.end(); ++it) {
writeCategoryEntry(s, *it, name);
}
}
-void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransaction& t, const QString& accountId)
+void MyMoneyQifWriter::writeTransactionEntry(TQTextStream &s, const MyMoneyTransaction& t, const TQString& accountId)
{
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneySplit split = t.splitByAccount(accountId);
@@ -187,8 +187,8 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa
}
if(split.memo().length() > 0) {
- QString m = split.memo();
- m.replace('\n', "\\n");
+ TQString m = split.memo();
+ m.tqreplace('\n', "\\n");
s << "M" << m << endl;
}
@@ -202,7 +202,7 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa
s << "P" << payee.name() << endl;
}
- QValueList<MyMoneySplit> list = t.splits();
+ TQValueList<MyMoneySplit> list = t.splits();
if(list.count() > 1) {
MyMoneySplit sp = t.splitByAccount(accountId, false);
MyMoneyAccount acc = file->account(sp.accountId());
@@ -215,7 +215,7 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa
s << "L" << file->accountToCategory(sp.accountId()) << endl;
}
if(list.count() > 2) {
- QValueList<MyMoneySplit>::ConstIterator it;
+ TQValueList<MyMoneySplit>::ConstIterator it;
for(it = list.begin(); it != list.end(); ++it) {
if(!((*it) == split)) {
writeSplitEntry(s, *it);
@@ -226,7 +226,7 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa
s << "^" << endl;
}
-void MyMoneyQifWriter::writeSplitEntry(QTextStream& s, const MyMoneySplit& split)
+void MyMoneyQifWriter::writeSplitEntry(TQTextStream& s, const MyMoneySplit& split)
{
MyMoneyFile* file = MyMoneyFile::instance();
@@ -243,8 +243,8 @@ void MyMoneyQifWriter::writeSplitEntry(QTextStream& s, const MyMoneySplit& split
s << endl;
if(split.memo().length() > 0) {
- QString m = split.memo();
- m.replace('\n', "\\n");
+ TQString m = split.memo();
+ m.tqreplace('\n', "\\n");
s << "E" << m << endl;
}
diff --git a/kmymoney2/converter/mymoneyqifwriter.h b/kmymoney2/converter/mymoneyqifwriter.h
index f77e612..1398161 100644
--- a/kmymoney2/converter/mymoneyqifwriter.h
+++ b/kmymoney2/converter/mymoneyqifwriter.h
@@ -20,14 +20,14 @@
* *
***************************************************************************/
-#ifndef MYMONEYQIFWRITER_H
-#define MYMONEYQIFWRITER_H
+#ifndef MYMONEYTQIFWRITER_H
+#define MYMONEYTQIFWRITER_H
// ----------------------------------------------------------------------------
// QT Headers
-#include <qobject.h>
-#include <qdatetime.h>
+#include <tqobject.h>
+#include <tqdatetime.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -44,14 +44,15 @@ class MyMoneySplit;
*/
/**
- * This class represents the QIF writer. All conversion between the
+ * This class represents the TQIF writer. All conversion between the
* internal representation of accounts, transactions is handled in this
* object. The conversion is controlled using a MyMoneyQifProfile to allow
* the user to control the conversion.
*/
-class MyMoneyQifWriter : public QObject
+class MyMoneyQifWriter : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
MyMoneyQifWriter();
@@ -70,10 +71,10 @@ public:
* @param startDate Transations before this date will not be exported
* @param endDate Transactions after this date will not be exported
*/
- void write(const QString& filename, const QString& profile,
- const QString& accountId, const bool accountData,
+ void write(const TQString& filename, const TQString& profile,
+ const TQString& accountId, const bool accountData,
const bool categoryData,
- const QDate& startDate, const QDate& endDate);
+ const TQDate& startDate, const TQDate& endDate);
private:
/**
@@ -87,7 +88,7 @@ private:
* @param startDate date from which entries are written
* @param endDate date until which entries are written
*/
- void writeAccountEntry(QTextStream& s, const QString& accountId, const QDate& startDate, const QDate& endDate);
+ void writeAccountEntry(TQTextStream& s, const TQString& accountId, const TQDate& startDate, const TQDate& endDate);
/**
* This method writes the category entries to the stream
@@ -96,7 +97,7 @@ private:
*
* @param s reference to textstream
*/
- void writeCategoryEntries(QTextStream& s);
+ void writeCategoryEntries(TQTextStream& s);
/**
* This method writes the category entry for account with
@@ -107,10 +108,10 @@ private:
* @param accountId id of the account to be written
* @param leadIn constant text that will be prepended to the account's name
*/
- void writeCategoryEntry(QTextStream& s, const QString& accountId, const QString& leadIn);
+ void writeCategoryEntry(TQTextStream& s, const TQString& accountId, const TQString& leadIn);
- void writeTransactionEntry(QTextStream &s, const MyMoneyTransaction& t, const QString& accountId);
- void writeSplitEntry(QTextStream &s, const MyMoneySplit& t);
+ void writeTransactionEntry(TQTextStream &s, const MyMoneyTransaction& t, const TQString& accountId);
+ void writeSplitEntry(TQTextStream &s, const MyMoneySplit& t);
signals:
/**
diff --git a/kmymoney2/converter/mymoneystatementreader.cpp b/kmymoney2/converter/mymoneystatementreader.cpp
index b804a59..8268d89 100644
--- a/kmymoney2/converter/mymoneystatementreader.cpp
+++ b/kmymoney2/converter/mymoneystatementreader.cpp
@@ -26,10 +26,10 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qfile.h>
-#include <qstringlist.h>
-#include <qtimer.h>
-#include <qtextedit.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
+#include <tqtextedit.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -39,8 +39,8 @@
#include <kconfig.h>
#include <kdebug.h>
#include <kdialogbase.h>
-#include <qvbox.h>
-#include <qlabel.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
// ----------------------------------------------------------------------------
// Project Headers
@@ -68,73 +68,73 @@ class MyMoneyStatementReader::Private
scannedCategories(false)
{}
- const QString& feeId(const MyMoneyAccount& invAcc);
- const QString& interestId(const MyMoneyAccount& invAcc);
- QString interestId(const QString& name);
- QString feeId(const QString& name);
+ const TQString& feeId(const MyMoneyAccount& invAcc);
+ const TQString& interestId(const MyMoneyAccount& invAcc);
+ TQString interestId(const TQString& name);
+ TQString feeId(const TQString& name);
void assignUniqueBankID(MyMoneySplit& s, const MyMoneyStatement::Transaction& t_in);
MyMoneyAccount lastAccount;
- QValueList<MyMoneyTransaction> transactions;
- QValueList<MyMoneyPayee> payees;
+ TQValueList<MyMoneyTransaction> transactions;
+ TQValueList<MyMoneyPayee> payees;
int transactionsCount;
int transactionsAdded;
int transactionsMatched;
int transactionsDuplicate;
- QMap<QString, bool> uniqIds;
- QMap<QString, MyMoneySecurity> securitiesBySymbol;
- QMap<QString, MyMoneySecurity> securitiesByName;
+ TQMap<TQString, bool> uniqIds;
+ TQMap<TQString, MyMoneySecurity> securitiesBySymbol;
+ TQMap<TQString, MyMoneySecurity> securitiesByName;
bool m_skipCategoryMatching;
private:
- void scanCategories(QString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& parentAccount, const QString& defaultName);
- QString nameToId(const QString&name, MyMoneyAccount& parent);
+ void scanCategories(TQString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& tqparentAccount, const TQString& defaultName);
+ TQString nameToId(const TQString&name, MyMoneyAccount& tqparent);
private:
- QString m_feeId;
- QString m_interestId;
+ TQString m_feeId;
+ TQString m_interestId;
bool scannedCategories;
};
-const QString& MyMoneyStatementReader::Private::feeId(const MyMoneyAccount& invAcc)
+const TQString& MyMoneyStatementReader::Private::feeId(const MyMoneyAccount& invAcc)
{
scanCategories(m_feeId, invAcc, MyMoneyFile::instance()->expense(), i18n("_Fees"));
return m_feeId;
}
-const QString& MyMoneyStatementReader::Private::interestId(const MyMoneyAccount& invAcc)
+const TQString& MyMoneyStatementReader::Private::interestId(const MyMoneyAccount& invAcc)
{
scanCategories(m_interestId, invAcc, MyMoneyFile::instance()->income(), i18n("_Dividend"));
return m_interestId;
}
-QString MyMoneyStatementReader::Private::nameToId(const QString&name, MyMoneyAccount& parent)
+TQString MyMoneyStatementReader::Private::nameToId(const TQString&name, MyMoneyAccount& tqparent)
{
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneyAccount acc = file->accountByName(name);
// if it does not exist, we have to create it
if(acc.id().isEmpty()) {
acc.setName( name );
- acc.setAccountType( parent.accountType() );
- acc.setCurrencyId(parent.currencyId());
- file->addAccount(acc, parent);
+ acc.setAccountType( tqparent.accountType() );
+ acc.setCurrencyId(tqparent.currencyId());
+ file->addAccount(acc, tqparent);
}
return acc.id();
}
-QString MyMoneyStatementReader::Private::interestId(const QString& name)
+TQString MyMoneyStatementReader::Private::interestId(const TQString& name)
{
- MyMoneyAccount parent = MyMoneyFile::instance()->income();
- return nameToId(name, parent);
+ MyMoneyAccount tqparent = MyMoneyFile::instance()->income();
+ return nameToId(name, tqparent);
}
-QString MyMoneyStatementReader::Private::feeId(const QString& name)
+TQString MyMoneyStatementReader::Private::feeId(const TQString& name)
{
- MyMoneyAccount parent = MyMoneyFile::instance()->expense();
- return nameToId(name, parent);
+ MyMoneyAccount tqparent = MyMoneyFile::instance()->expense();
+ return nameToId(name, tqparent);
}
-void MyMoneyStatementReader::Private::scanCategories(QString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& parentAccount, const QString& defaultName)
+void MyMoneyStatementReader::Private::scanCategories(TQString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& tqparentAccount, const TQString& defaultName)
{
if(!scannedCategories) {
KMyMoneyUtils::previouslyUsedCategories(invAcc.id(), m_feeId, m_interestId);
@@ -146,11 +146,11 @@ void MyMoneyStatementReader::Private::scanCategories(QString& id, const MyMoneyA
MyMoneyAccount acc = file->accountByName(defaultName);
// if it does not exist, we have to create it
if(acc.id().isEmpty()) {
- MyMoneyAccount parent = parentAccount;
+ MyMoneyAccount tqparent = tqparentAccount;
acc.setName( defaultName );
- acc.setAccountType( parent.accountType() );
- acc.setCurrencyId(parent.currencyId());
- file->addAccount(acc, parent);
+ acc.setAccountType( tqparent.accountType() );
+ acc.setCurrencyId(tqparent.currencyId());
+ file->addAccount(acc, tqparent);
}
id = acc.id();
}
@@ -161,17 +161,17 @@ void MyMoneyStatementReader::Private::assignUniqueBankID(MyMoneySplit& s, const
if( ! t_in.m_strBankID.isEmpty() ) {
// make sure that id's are unique from this point on by appending a -#
// postfix if needed
- QString base(t_in.m_strBankID);
- QString hash(base);
+ TQString base(t_in.m_strBankID);
+ TQString hash(base);
int idx = 1;
for(;;) {
- QMap<QString, bool>::const_iterator it;
- it = uniqIds.find(hash);
+ TQMap<TQString, bool>::const_iterator it;
+ it = uniqIds.tqfind(hash);
if(it == uniqIds.end()) {
uniqIds[hash] = true;
break;
}
- hash = QString("%1-%2").arg(base).arg(idx);
+ hash = TQString("%1-%2").tqarg(base).tqarg(idx);
++idx;
}
@@ -210,7 +210,7 @@ void MyMoneyStatementReader::setAskPayeeCategory(bool ask)
m_askPayeeCategory = ask;
}
-bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& messages)
+bool MyMoneyStatementReader::import(const MyMoneyStatement& s, TQStringList& messages)
{
//
// For testing, save the statement to an XML file
@@ -291,7 +291,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
if(!m_account.name().isEmpty())
- messages += i18n("Importing statement for account %1").arg(m_account.name());
+ messages += i18n("Importing statement for account %1").tqarg(m_account.name());
else if(s.m_listTransactions.count() == 0)
messages += i18n("Importing statement without transactions");
@@ -302,7 +302,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
//
signalProgress(0, s.m_listSecurities.count(), "Importing Statement ...");
int progress = 0;
- QValueList<MyMoneyStatement::Security>::const_iterator it_s = s.m_listSecurities.begin();
+ TQValueList<MyMoneyStatement::Security>::const_iterator it_s = s.m_listSecurities.begin();
while ( it_s != s.m_listSecurities.end() )
{
processSecurityEntry(*it_s);
@@ -321,7 +321,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
qDebug("Processing transactions (%s)", m_account.name().data());
signalProgress(0, s.m_listTransactions.count(), "Importing Statement ...");
int progress = 0;
- QValueList<MyMoneyStatement::Transaction>::const_iterator it_t = s.m_listTransactions.begin();
+ TQValueList<MyMoneyStatement::Transaction>::const_iterator it_t = s.m_listTransactions.begin();
while ( it_t != s.m_listTransactions.end() )
{
processTransactionEntry(*it_t);
@@ -347,15 +347,15 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
{
try {
signalProgress(0, s.m_listPrices.count(), "Importing Statement ...");
- QValueList<MyMoneySecurity> slist = MyMoneyFile::instance()->securityList();
- QValueList<MyMoneySecurity>::const_iterator it_s;
+ TQValueList<MyMoneySecurity> slist = MyMoneyFile::instance()->securityList();
+ TQValueList<MyMoneySecurity>::const_iterator it_s;
for(it_s = slist.begin(); it_s != slist.end(); ++it_s) {
d->securitiesBySymbol[(*it_s).tradingSymbol()] = *it_s;
d->securitiesByName[(*it_s).name()] = *it_s;
}
int progress = 0;
- QValueList<MyMoneyStatement::Price>::const_iterator it_p = s.m_listPrices.begin();
+ TQValueList<MyMoneyStatement::Price>::const_iterator it_p = s.m_listPrices.begin();
while(it_p != s.m_listPrices.end()) {
processPriceEntry(*it_p);
signalProgress(++progress, 0);
@@ -375,7 +375,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
// delete all payees created in vain
int payeeCount = d->payees.count();
- QValueList<MyMoneyPayee>::const_iterator it_p;
+ TQValueList<MyMoneyPayee>::const_iterator it_p;
for(it_p = d->payees.begin(); it_p != d->payees.end(); ++it_p) {
try {
MyMoneyFile::instance()->removePayee(*it_p);
@@ -389,21 +389,21 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
if(s.m_closingBalance.isAutoCalc()) {
messages += i18n(" Statement balance is not contained in statement.");
} else {
- messages += i18n(" Statement balance on %1 is reported to be %2").arg(s.m_dateEnd.toString(Qt::ISODate)).arg(s.m_closingBalance.formatMoney("",2));
+ messages += i18n(" Statement balance on %1 is reported to be %2").tqarg(s.m_dateEnd.toString(Qt::ISODate)).tqarg(s.m_closingBalance.formatMoney("",2));
}
messages += i18n(" Transactions");
- messages += i18n(" %1 processed").arg(d->transactionsCount);
- messages += i18n(" %1 added").arg(d->transactionsAdded);
- messages += i18n(" %1 matched").arg(d->transactionsMatched);
- messages += i18n(" %1 duplicates").arg(d->transactionsDuplicate);
+ messages += i18n(" %1 processed").tqarg(d->transactionsCount);
+ messages += i18n(" %1 added").tqarg(d->transactionsAdded);
+ messages += i18n(" %1 matched").tqarg(d->transactionsMatched);
+ messages += i18n(" %1 duplicates").tqarg(d->transactionsDuplicate);
messages += i18n(" Payees");
- messages += i18n(" %1 created").arg(payeeCount);
- messages += QString();
+ messages += i18n(" %1 created").tqarg(payeeCount);
+ messages += TQString();
// remove the Don't ask again entries
KConfig* config = KGlobal::config();
- config->setGroup(QString::fromLatin1("Notification Messages"));
- QStringList::ConstIterator it;
+ config->setGroup(TQString::tqfromLatin1("Notification Messages"));
+ TQStringList::ConstIterator it;
for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) {
config->deleteEntry(*it);
@@ -426,20 +426,20 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
void MyMoneyStatementReader::processPriceEntry(const MyMoneyStatement::Price& p_in)
{
- if(d->securitiesBySymbol.contains(p_in.m_strSecurity)) {
+ if(d->securitiesBySymbol.tqcontains(p_in.m_strSecurity)) {
MyMoneyPrice price(d->securitiesBySymbol[p_in.m_strSecurity].id(),
MyMoneyFile::instance()->baseCurrency().id(),
p_in.m_date,
- p_in.m_amount, "QIF");
+ p_in.m_amount, "TQIF");
MyMoneyFile::instance()->addPrice(price);
- } else if(d->securitiesByName.contains(p_in.m_strSecurity)) {
+ } else if(d->securitiesByName.tqcontains(p_in.m_strSecurity)) {
MyMoneyPrice price(d->securitiesByName[p_in.m_strSecurity].id(),
MyMoneyFile::instance()->baseCurrency().id(),
p_in.m_date,
- p_in.m_amount, "QIF");
+ p_in.m_amount, "TQIF");
MyMoneyFile::instance()->addPrice(price);
}
@@ -456,8 +456,8 @@ void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Securi
// In a statement, we do not know what type of security this is, so we will
// not use type as a matching factor.
MyMoneySecurity security;
- QValueList<MyMoneySecurity> list = file->securityList();
- QValueList<MyMoneySecurity>::ConstIterator it = list.begin();
+ TQValueList<MyMoneySecurity> list = file->securityList();
+ TQValueList<MyMoneySecurity>::ConstIterator it = list.begin();
while ( it != list.end() && security.id().isEmpty() )
{
if(sec_in.m_strSymbol.isEmpty()) {
@@ -485,7 +485,7 @@ void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Securi
ft.commit();
kdDebug(0) << "Created " << security.name() << " with id " << security.id() << endl;
} catch(MyMoneyException *e) {
- KMessageBox::error(0, i18n("Error creating security record: %1").arg(e->what()), i18n("Error"));
+ KMessageBox::error(0, i18n("Error creating security record: %1").tqarg(e->what()), i18n("Error"));
}
} else {
kdDebug(0) << "Found " << security.name() << " with id " << security.id() << endl;
@@ -499,8 +499,8 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
MyMoneyTransaction t;
#if 0
- QString dbgMsg;
- dbgMsg = QString("Process %1, '%3', %2").arg(t_in.m_datePosted.toString(Qt::ISODate)).arg(t_in.m_amount.formatMoney("", 2)).arg(t_in.m_strBankID);
+ TQString dbgMsg;
+ dbgMsg = TQString("Process %1, '%3', %2").tqarg(t_in.m_datePosted.toString(Qt::ISODate)).tqarg(t_in.m_amount.formatMoney("", 2)).tqarg(t_in.m_strBankID);
qDebug("%s", dbgMsg.data());
#endif
@@ -540,7 +540,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// If the user has chosen to import into an investment account, determine the correct account to use
MyMoneyAccount thisaccount = m_account;
- QString brokerageactid;
+ TQString brokerageactid;
if ( thisaccount.accountType() == MyMoneyAccount::Investment )
{
@@ -565,11 +565,11 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// search through each subordinate account
bool found = false;
- QStringList accounts = thisaccount.accountList();
- QStringList::const_iterator it_account = accounts.begin();
+ TQStringList accounts = thisaccount.accountList();
+ TQStringList::const_iterator it_account = accounts.begin();
while( !found && it_account != accounts.end() )
{
- QString currencyid = file->account(*it_account).currencyId();
+ TQString currencyid = file->account(*it_account).currencyId();
MyMoneySecurity security = file->security( currencyid );
if((t_in.m_strSymbol.lower() == security.tradingSymbol().lower())
|| (t_in.m_strSecurity.lower() == security.name().lower()))
@@ -584,7 +584,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
{
// update the price, while we're here. in the future, this should be
// an option
- QString basecurrencyid = file->baseCurrency().id();
+ TQString basecurrencyid = file->baseCurrency().id();
MyMoneyPrice price = file->price( currencyid, basecurrencyid, t_in.m_datePosted, true );
if ( !price.isValid() && ((!t_in.m_amount.isZero() && !t_in.m_shares.isZero()) || !t_in.m_price.isZero()))
{
@@ -614,14 +614,14 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
if ( t_in.m_strSecurity.isEmpty() )
{
- KMessageBox::information(0, i18n("This imported statement contains investment transactions with no security. These transactions will be ignored.").arg(t_in.m_strSecurity),i18n("Security not found"),QString("BlankSecurity"));
+ KMessageBox::information(0, i18n("This imported statement contains investment transactions with no security. These transactions will be ignored.").tqarg(t_in.m_strSecurity),i18n("Security not found"),TQString("BlankSecurity"));
return;
}
else
{
MyMoneySecurity security;
- QValueList<MyMoneySecurity> list = MyMoneyFile::instance()->securityList();
- QValueList<MyMoneySecurity>::ConstIterator it = list.begin();
+ TQValueList<MyMoneySecurity> list = MyMoneyFile::instance()->securityList();
+ TQValueList<MyMoneySecurity>::ConstIterator it = list.begin();
while ( it != list.end() && security.id().isEmpty() )
{
if(t_in.m_strSecurity.lower() == (*it).tradingSymbol().lower()
@@ -646,7 +646,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// This should be rare. A statement should have a security entry for any
// of the securities referred to in the transactions. The only way to get
// here is if that's NOT the case.
- KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.").arg(t_in.m_strSecurity),i18n("Security not found"),QString("MissingSecurity%1").arg(t_in.m_strSecurity.stripWhiteSpace()));
+ KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.").tqarg(t_in.m_strSecurity),i18n("Security not found"),TQString("MissingSecurity%1").tqarg(t_in.m_strSecurity.stripWhiteSpace()));
return;
}
}
@@ -784,7 +784,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// written. However, if a user has an associated brokerage account,
// we can stuff the transaction there.
- QString brokerageactid = m_account.value("kmm-brokerage-account").utf8();
+ TQString brokerageactid = m_account.value("kmm-brokerage-account").utf8();
if (brokerageactid.isEmpty() )
{
brokerageactid = file->accountByName(m_account.brokerageName()).id();
@@ -823,29 +823,29 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
- QString payeename = t_in.m_strPayee;
+ TQString payeename = t_in.m_strPayee;
if(!payeename.isEmpty())
{
- QString payeeid;
+ TQString payeeid;
try {
- QValueList<MyMoneyPayee> pList = file->payeeList();
- QValueList<MyMoneyPayee>::const_iterator it_p;
- QMap<int, QString> matchMap;
+ TQValueList<MyMoneyPayee> pList = file->payeeList();
+ TQValueList<MyMoneyPayee>::const_iterator it_p;
+ TQMap<int, TQString> matchMap;
for(it_p = pList.begin(); it_p != pList.end(); ++it_p) {
bool ignoreCase;
- QStringList keys;
- QStringList::const_iterator it_s;
+ TQStringList keys;
+ TQStringList::const_iterator it_s;
switch((*it_p).matchData(ignoreCase, keys)) {
case MyMoneyPayee::matchDisabled:
break;
case MyMoneyPayee::matchName:
- keys << QString("%1").arg(QRegExp::escape((*it_p).name()));
+ keys << TQString("%1").tqarg(TQRegExp::escape((*it_p).name()));
// tricky fall through here
case MyMoneyPayee::matchKey:
for(it_s = keys.begin(); it_s != keys.end(); ++it_s) {
- QRegExp exp(*it_s, !ignoreCase);
+ TQRegExp exp(*it_s, !ignoreCase);
if(exp.search(payeename) != -1) {
matchMap[exp.matchedLength()] = (*it_p).id();
}
@@ -863,7 +863,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// in case of a) we take the one with the largest matchedLength()
// which happens to be the last one in the map
if(matchMap.count() > 1) {
- QMap<int, QString>::const_iterator it_m = matchMap.end();
+ TQMap<int, TQString>::const_iterator it_m = matchMap.end();
--it_m;
payeeid = *it_m;
} else if(matchMap.count() == 1)
@@ -882,16 +882,16 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
if(m_autoCreatePayee == false) {
// Ask the user if that is what he intended to do?
- QString msg = i18n("Do you want to add \"%1\" as payee/receiver?\n\n").arg(payeename);
+ TQString msg = i18n("Do you want to add \"%1\" as payee/receiver?\n\n").tqarg(payeename);
msg += i18n("Selecting \"Yes\" will create the payee, \"No\" will skip "
"creation of a payee record and remove the payee information "
"from this transaction. Selecting \"Cancel\" aborts the import "
"operation.\n\nIf you select \"No\" here and mark the \"Don't ask "
"again\" checkbox, the payee information for all following transactions "
- "referencing \"%1\" will be removed.").arg(payeename);
+ "referencing \"%1\" will be removed.").tqarg(payeename);
- QString askKey = QString("Statement-Import-Payee-")+payeename;
- if(!m_dontAskAgain.contains(askKey)) {
+ TQString askKey = TQString("Statement-Import-Payee-")+payeename;
+ if(!m_dontAskAgain.tqcontains(askKey)) {
m_dontAskAgain += askKey;
}
rc = KMessageBox::questionYesNoCancel(0, msg, i18n("New payee/receiver"),
@@ -909,12 +909,12 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// is called in the context of an automatic procedure it
// might distract the user.
payee.setName(payeename);
- payee.setMatchData(MyMoneyPayee::matchName, true, QStringList());
+ payee.setMatchData(MyMoneyPayee::matchName, true, TQStringList());
if (m_askPayeeCategory) {
- // We use a QGuardedPtr because the dialog may get deleted
- // during exec() if the parent of the dialog gets deleted.
+ // We use a TQGuardedPtr because the dialog may get deleted
+ // during exec() if the tqparent of the dialog gets deleted.
// In that case the guarded ptr will reset to 0.
- QGuardedPtr<KDialogBase> dialog = new KDialogBase(
+ TQGuardedPtr<KDialogBase> dialog = new KDialogBase(
"Default Category for Payee",
KDialogBase::Yes | KDialogBase::No | KDialogBase::Cancel,
KDialogBase::Yes, KDialogBase::Cancel,
@@ -922,20 +922,20 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
KGuiItem(i18n("Save Category")),
KGuiItem(i18n("No Category")),
KGuiItem(i18n("Abort")));
- QVBox *topcontents = new QVBox (dialog);
+ TQVBox *topcontents = new TQVBox (dialog);
topcontents->setSpacing(KDialog::spacingHint()*2);
topcontents->setMargin(KDialog::marginHint());
//add in caption? and account combo here
- QLabel *label1 = new QLabel( topcontents);
- label1->setText(i18n("Please select a default category for payee '%1':").arg(payee.name().data()));
+ TQLabel *label1 = new TQLabel( topcontents);
+ label1->setText(i18n("Please select a default category for payee '%1':").tqarg(payee.name()));
- QGuardedPtr<KMyMoneyAccountCombo> accountCombo = new KMyMoneyAccountCombo(topcontents);
+ TQGuardedPtr<KMyMoneyAccountCombo> accountCombo = new KMyMoneyAccountCombo(topcontents);
dialog->setMainWidget(topcontents);
int result = dialog->exec();
- QString accountId;
+ TQString accountId;
if (accountCombo && !accountCombo->selectedAccounts().isEmpty()) {
accountId = accountCombo->selectedAccounts().front();
}
@@ -961,13 +961,13 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
} catch(MyMoneyException *e) {
KMessageBox::detailedSorry(0, i18n("Unable to add payee/receiver"),
- (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line()));
+ (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line()));
delete e;
}
} else if(rc == KMessageBox::No) {
- s1.setPayeeId(QString());
+ s1.setPayeeId(TQString());
} else {
throw new MYMONEYEXCEPTION("USERABORT");
@@ -995,7 +995,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
MyMoneySplit s;
s.setReconcileFlag(MyMoneySplit::Cleared);
s.clearId();
- s.setBankID(QString());
+ s.setBankID(TQString());
s.setShares(-s1.shares());
s.setValue(-s1.value());
s.setAccountId(payeeObj.defaultAccountId());
@@ -1004,7 +1004,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
else if (t_in.m_listSplits.isEmpty() && !d->m_skipCategoryMatching) {
MyMoneyTransactionFilter filter(thisaccount.id());
filter.addPayee(payeeid);
- QValueList<MyMoneyTransaction> list = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction> list = file->transactionList(filter);
if(!list.empty())
{
// Default to using the most recent transaction as the reference
@@ -1015,7 +1015,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// with the same VALUE as our imported transaction, and if so take that one.
if ( list.count() > 1 )
{
- QValueList<MyMoneyTransaction>::ConstIterator it_trans = list.fromLast();
+ TQValueList<MyMoneyTransaction>::ConstIterator it_trans = list.fromLast();
while ( it_trans != list.end() )
{
MyMoneySplit s = (*it_trans).splitByAccount(thisaccount.id());
@@ -1028,7 +1028,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
}
- QValueList<MyMoneySplit>::ConstIterator it_split;
+ TQValueList<MyMoneySplit>::ConstIterator it_split;
for(it_split = t_old.splits().begin(); it_split != t_old.splits().end(); ++it_split)
{
// We don't need the split that covers this account,
@@ -1038,7 +1038,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
MyMoneySplit s(*it_split);
s.setReconcileFlag(MyMoneySplit::NotReconciled);
s.clearId();
- s.setBankID(QString());
+ s.setBankID(TQString());
if ( t_old.splits().count() == 2 )
{
@@ -1085,7 +1085,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// process splits
//******************************************
- QValueList<MyMoneyStatement::Split>::const_iterator it_s;
+ TQValueList<MyMoneyStatement::Split>::const_iterator it_s;
for(it_s = t_in.m_listSplits.begin(); it_s != t_in.m_listSplits.end(); ++it_s) {
MyMoneySplit s2;
s2.setAccountId((*it_s).m_accountId);
@@ -1101,7 +1101,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
#if 0
- QString accountId;
+ TQString accountId;
int count;
int cnt = 0;
count = t_in.m_listSplits.count();
@@ -1113,7 +1113,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
s2.clearId();
s2.setValue(t_in.m_listSplits[cnt].m_amount);
s2.setShares(t_in.m_listSplits[cnt].m_amount);
- s2.setAccountId(QString(t_in.m_listSplits[cnt].m_accountId));
+ s2.setAccountId(TQString(t_in.m_listSplits[cnt].m_accountId));
#if 0
accountId = file->nameToAccount(t_in.m_listSplits[cnt].m_strCategoryName);
if (accountId.isEmpty())
@@ -1164,7 +1164,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// to enter the schedule and match it agains the new transaction. Otherwise, we
// just leave the transaction as imported.
MyMoneySchedule schedule(*(dynamic_cast<const MyMoneySchedule*>(o)));
- if(KMessageBox::questionYesNo(0, QString("<qt>%1</qt>").arg(i18n("KMyMoney has found a scheduled transaction named <b>%1</b> which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ").arg(schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) {
+ if(KMessageBox::questionYesNo(0, TQString("<qt>%1</qt>").tqarg(i18n("KMyMoney has found a scheduled transaction named <b>%1</b> which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ").tqarg(schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) {
KEnterScheduleDlg dlg(0, schedule);
TransactionEditor* editor = dlg.startEdit();
if(editor) {
@@ -1197,7 +1197,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
editor->createTransaction(torig, dlg.transaction(), dlg.transaction().splits()[0], true);
- QString newId;
+ TQString newId;
if(editor->enterTransactions(newId, false, true)) {
if(!newId.isEmpty()) {
torig = MyMoneyFile::instance()->transaction(newId);
@@ -1221,7 +1221,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
delete o;
} catch (MyMoneyException *e) {
- QString message(i18n("Problem adding or matching imported transaction with id '%1': %2").arg(t_in.m_strBankID).arg(e->what()));
+ TQString message(i18n("Problem adding or matching imported transaction with id '%1': %2").tqarg(t_in.m_strBankID).tqarg(e->what()));
qDebug("%s", message.data());
delete e;
@@ -1237,22 +1237,22 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
MyMoneyFile* file = MyMoneyFile::instance();
- QString accountId;
+ TQString accountId;
// Try to find an existing account in the engine which matches this one.
// There are two ways to be a "matching account". The account number can
// match the statement account OR the "StatementKey" property can match.
// Either way, we'll update the "StatementKey" property for next time.
- QString accountNumber = account.number();
+ TQString accountNumber = account.number();
if ( ! accountNumber.isEmpty() )
{
// Get a list of all accounts
- QValueList<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> accounts;
file->accountList(accounts);
// Iterate through them
- QValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
+ TQValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
while ( it_account != accounts.end() )
{
if (
@@ -1270,13 +1270,13 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
}
}
- QString msg = i18n("<b>You have downloaded a statement for the following account:</b><br><br>");
- msg += i18n(" - Account Name: %1").arg(account.name()) + "<br>";
- msg += i18n(" - Account Type: %1").arg(KMyMoneyUtils::accountTypeToString(account.accountType())) + "<br>";
- msg += i18n(" - Account Number: %1").arg(account.number()) + "<br>";
+ TQString msg = i18n("<b>You have downloaded a statement for the following account:</b><br><br>");
+ msg += i18n(" - Account Name: %1").tqarg(account.name()) + "<br>";
+ msg += i18n(" - Account Type: %1").tqarg(KMyMoneyUtils::accountTypeToString(account.accountType())) + "<br>";
+ msg += i18n(" - Account Number: %1").tqarg(account.number()) + "<br>";
msg += "<br>";
- QString header;
+ TQString header;
if(!account.name().isEmpty())
{
@@ -1302,11 +1302,11 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
accountSelect.setMode(false);
accountSelect.showAbortButton(true);
accountSelect.m_qifEntry->hide();
- QString accname;
+ TQString accname;
bool done = false;
while ( !done )
{
- if ( accountSelect.exec() == QDialog::Accepted && !accountSelect.selectedAccount().isEmpty() )
+ if ( accountSelect.exec() == TQDialog::Accepted && !accountSelect.selectedAccount().isEmpty() )
{
result = true;
done = true;
@@ -1332,18 +1332,18 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
//throw new MYMONEYEXCEPTION("USERABORT");
done = true;
else
- KMessageBox::error(0, QString("<qt>%1</qt>").arg(i18n("You must select an account, create a new one, or press the <b>Abort</b> button.")));
+ KMessageBox::error(0, TQString("<qt>%1</qt>").tqarg(i18n("You must select an account, create a new one, or press the <b>Abort</b> button.")));
}
}
return result;
}
-void MyMoneyStatementReader::setProgressCallback(void(*callback)(int, int, const QString&))
+void MyMoneyStatementReader::setProgressCallback(void(*callback)(int, int, const TQString&))
{
m_progressCallback = callback;
}
-void MyMoneyStatementReader::signalProgress(int current, int total, const QString& msg)
+void MyMoneyStatementReader::signalProgress(int current, int total, const TQString& msg)
{
if(m_progressCallback != 0)
(*m_progressCallback)(current, total, msg);
diff --git a/kmymoney2/converter/mymoneystatementreader.h b/kmymoney2/converter/mymoneystatementreader.h
index 46d74d7..6ea2ef9 100644
--- a/kmymoney2/converter/mymoneystatementreader.h
+++ b/kmymoney2/converter/mymoneystatementreader.h
@@ -27,9 +27,9 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qobject.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -45,16 +45,17 @@
#include "../mymoney/mymoneystatement.h"
class MyMoneyFileTransaction;
-class QStringList;
+class TQStringList;
/**
* This is a pared-down version of a MyMoneyQifReader object
*
* @author Ace Jones
*/
-class MyMoneyStatementReader : public QObject
+class MyMoneyStatementReader : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
MyMoneyStatementReader();
@@ -68,7 +69,7 @@ public:
* @retval true the import was processed successfully
* @retval false the import resulted in a failure.
*/
- bool import(const MyMoneyStatement& s, QStringList& messages);
+ bool import(const MyMoneyStatement& s, TQStringList& messages);
/**
* This method is used to modify the auto payee creation flag.
@@ -87,7 +88,7 @@ public:
const MyMoneyAccount& account() const { return m_account; };
- void setProgressCallback(void(*callback)(int, int, const QString&));
+ void setProgressCallback(void(*callback)(int, int, const TQString&));
/**
* Returns true in case any transaction has been added to the engine
@@ -103,7 +104,7 @@ private:
*
* For a parameter description see KMyMoneyView::progressCallback().
*/
- void signalProgress(int current, int total, const QString& = "");
+ void signalProgress(int current, int total, const TQString& = "");
void processTransactionEntry(const MyMoneyStatement::Transaction& t_in);
void processSecurityEntry(const MyMoneyStatement::Security& s_in);
@@ -138,14 +139,14 @@ private:
/// \internal d-pointer instance.
Private* const d;
MyMoneyAccount m_account;
- QStringList m_dontAskAgain;
+ TQStringList m_dontAskAgain;
bool m_skipAccount;
bool m_userAbort;
bool m_autoCreatePayee;
bool m_askPayeeCategory;
MyMoneyFileTransaction* m_ft;
- void (*m_progressCallback)(int, int, const QString&);
+ void (*m_progressCallback)(int, int, const TQString&);
};
#endif
diff --git a/kmymoney2/converter/mymoneytemplate.cpp b/kmymoney2/converter/mymoneytemplate.cpp
index 63305c6..1a8860b 100644
--- a/kmymoney2/converter/mymoneytemplate.cpp
+++ b/kmymoney2/converter/mymoneytemplate.cpp
@@ -20,9 +20,9 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qapplication.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqapplication.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -54,7 +54,7 @@ MyMoneyTemplate::~MyMoneyTemplate()
bool MyMoneyTemplate::loadTemplate(const KURL& url)
{
- QString filename;
+ TQString filename;
if(!url.isValid()) {
qDebug("Invalid template URL '%s'", url.url().latin1());
@@ -67,10 +67,10 @@ bool MyMoneyTemplate::loadTemplate(const KURL& url)
} else {
bool rc;
- rc = KIO::NetAccess::download(url, filename, qApp->mainWidget());
+ rc = KIO::NetAccess::download(url, filename, tqApp->mainWidget());
if(!rc) {
- KMessageBox::detailedError(qApp->mainWidget(),
- i18n("Error while loading file '%1'!").arg(url.url()),
+ KMessageBox::detailedError(tqApp->mainWidget(),
+ i18n("Error while loading file '%1'!").tqarg(url.url()),
KIO::NetAccess::lastErrorString(),
i18n("File access error"));
return false;
@@ -78,27 +78,27 @@ bool MyMoneyTemplate::loadTemplate(const KURL& url)
}
bool rc = true;
- QFile file(filename);
- QFileInfo info(file);
+ TQFile file(filename);
+ TQFileInfo info(file);
if(!info.isFile()) {
- QString msg=i18n("<b>%1</b> is not a template file.").arg(filename);
- KMessageBox::error(qApp->mainWidget(), QString("<p>")+msg, i18n("Filetype Error"));
+ TQString msg=i18n("<b>%1</b> is not a template file.").tqarg(filename);
+ KMessageBox::error(tqApp->mainWidget(), TQString("<p>")+msg, i18n("Filetype Error"));
return false;
}
if(file.open(IO_ReadOnly)) {
- QString errMsg;
+ TQString errMsg;
int errLine, errColumn;
if(!m_doc.setContent(&file, &errMsg, &errLine, &errColumn)) {
- QString msg=i18n("Error while reading template file <b>%1</b> in line %2, column %3").arg(filename).arg(errLine).arg(errColumn);
- KMessageBox::detailedError(qApp->mainWidget(), QString("<p>")+msg, errMsg, i18n("Template Error"));
+ TQString msg=i18n("Error while reading template file <b>%1</b> in line %2, column %3").tqarg(filename).tqarg(errLine).tqarg(errColumn);
+ KMessageBox::detailedError(tqApp->mainWidget(), TQString("<p>")+msg, errMsg, i18n("Template Error"));
rc = false;
} else {
rc = loadDescription();
}
file.close();
} else {
- KMessageBox::sorry(qApp->mainWidget(), i18n("File '%1' not found!").arg(filename));
+ KMessageBox::sorry(tqApp->mainWidget(), i18n("File '%1' not found!").tqarg(filename));
rc = false;
}
@@ -119,12 +119,12 @@ bool MyMoneyTemplate::loadDescription(void)
const int invalid = 0x10;
const int validHeader = 0x0F;
- QDomElement rootElement = m_doc.documentElement();
+ TQDomElement rootElement = m_doc.documentElement();
if(!rootElement.isNull()
&& rootElement.tagName() == "kmymoney-account-template") {
- QDomNode child = rootElement.firstChild();
+ TQDomNode child = rootElement.firstChild();
while(!child.isNull() && child.isElement()) {
- QDomElement childElement = child.toElement();
+ TQDomElement childElement = child.toElement();
// qDebug("MyMoneyTemplate::import: Processing child node %s", childElement.tagName().data());
if(childElement.tagName() == "accounts") {
m_accounts = childElement.firstChild();
@@ -139,7 +139,7 @@ bool MyMoneyTemplate::loadDescription(void)
m_longDesc = childElement.text();
validMask |= validLong;
} else {
- KMessageBox::error(qApp->mainWidget(), QString("<p>")+i18n("Invalid tag <b>%1</b> in template file <b>%2</b>!").arg(childElement.tagName()).arg(m_source.prettyURL()));
+ KMessageBox::error(tqApp->mainWidget(), TQString("<p>")+i18n("Invalid tag <b>%1</b> in template file <b>%2</b>!").tqarg(childElement.tagName()).tqarg(m_source.prettyURL()));
validMask |= invalid;
}
child = child.nextSibling();
@@ -148,14 +148,14 @@ bool MyMoneyTemplate::loadDescription(void)
return validMask == validHeader;
}
-bool MyMoneyTemplate::hierarchy(QMap<QString, QListViewItem*>& list, const QString& parent, QDomNode account)
+bool MyMoneyTemplate::hierarchy(TQMap<TQString, TQListViewItem*>& list, const TQString& tqparent, TQDomNode account)
{
bool rc = true;
while(rc == true && !account.isNull()) {
if(account.isElement()) {
- QDomElement accountElement = account.toElement();
+ TQDomElement accountElement = account.toElement();
if(accountElement.tagName() == "account") {
- QString name = QString("%1:%2").arg(parent).arg(accountElement.attribute("name"));
+ TQString name = TQString("%1:%2").tqarg(tqparent).tqarg(accountElement.attribute("name"));
list[name] = 0;
hierarchy(list, name, account.firstChild());
}
@@ -165,12 +165,12 @@ bool MyMoneyTemplate::hierarchy(QMap<QString, QListViewItem*>& list, const QStri
return rc;
}
-void MyMoneyTemplate::hierarchy(QMap<QString, QListViewItem*>& list)
+void MyMoneyTemplate::hierarchy(TQMap<TQString, TQListViewItem*>& list)
{
bool rc = !m_accounts.isNull();
- QDomNode accounts = m_accounts;
+ TQDomNode accounts = m_accounts;
while(rc == true && !accounts.isNull() && accounts.isElement()) {
- QDomElement childElement = accounts.toElement();
+ TQDomElement childElement = accounts.toElement();
if(childElement.tagName() == "account"
&& childElement.attribute("name") == "") {
switch(childElement.attribute("type").toUInt()) {
@@ -206,44 +206,44 @@ void MyMoneyTemplate::hierarchy(QMap<QString, QListViewItem*>& list)
}
}
-bool MyMoneyTemplate::importTemplate(void(*callback)(int, int, const QString&))
+bool MyMoneyTemplate::importTemplate(void(*callback)(int, int, const TQString&))
{
m_progressCallback = callback;
bool rc = !m_accounts.isNull();
MyMoneyFile* file = MyMoneyFile::instance();
- signalProgress(0, m_doc.elementsByTagName("account").count(), i18n("Loading template %1").arg(m_source.url()));
+ signalProgress(0, m_doc.elementsByTagName("account").count(), i18n("Loading template %1").tqarg(m_source.url()));
m_accountsRead = 0;
while(rc == true && !m_accounts.isNull() && m_accounts.isElement()) {
- QDomElement childElement = m_accounts.toElement();
+ TQDomElement childElement = m_accounts.toElement();
if(childElement.tagName() == "account"
&& childElement.attribute("name") == "") {
++m_accountsRead;
- MyMoneyAccount parent;
+ MyMoneyAccount tqparent;
switch(childElement.attribute("type").toUInt()) {
case MyMoneyAccount::Asset:
- parent = file->asset();
+ tqparent = file->asset();
break;
case MyMoneyAccount::Liability:
- parent = file->liability();
+ tqparent = file->liability();
break;
case MyMoneyAccount::Income:
- parent = file->income();
+ tqparent = file->income();
break;
case MyMoneyAccount::Expense:
- parent = file->expense();
+ tqparent = file->expense();
break;
case MyMoneyAccount::Equity:
- parent = file->equity();
+ tqparent = file->equity();
break;
default:
- KMessageBox::error(qApp->mainWidget(), QString("<p>")+i18n("Invalid top-level account type <b>%1</b> in template file <b>%2</b>!").arg(childElement.attribute("type")).arg(m_source.prettyURL()));
+ KMessageBox::error(tqApp->mainWidget(), TQString("<p>")+i18n("Invalid top-level account type <b>%1</b> in template file <b>%2</b>!").tqarg(childElement.attribute("type")).tqarg(m_source.prettyURL()));
rc = false;
}
if(rc == true) {
- rc = createAccounts(parent, childElement.firstChild());
+ rc = createAccounts(tqparent, childElement.firstChild());
}
} else {
rc = false;
@@ -254,20 +254,20 @@ bool MyMoneyTemplate::importTemplate(void(*callback)(int, int, const QString&))
return rc;
}
-bool MyMoneyTemplate::createAccounts(MyMoneyAccount& parent, QDomNode account)
+bool MyMoneyTemplate::createAccounts(MyMoneyAccount& tqparent, TQDomNode account)
{
bool rc = true;
while(rc == true && !account.isNull()) {
MyMoneyAccount acc;
if(account.isElement()) {
- QDomElement accountElement = account.toElement();
+ TQDomElement accountElement = account.toElement();
if(accountElement.tagName() == "account") {
signalProgress(++m_accountsRead, 0);
- QValueList<MyMoneyAccount> subAccountList;
- QValueList<MyMoneyAccount>::ConstIterator it;
+ TQValueList<MyMoneyAccount> subAccountList;
+ TQValueList<MyMoneyAccount>::ConstIterator it;
it = subAccountList.end();
- if(!parent.accountList().isEmpty()) {
- MyMoneyFile::instance()->accountList(subAccountList, parent.accountList());
+ if(!tqparent.accountList().isEmpty()) {
+ MyMoneyFile::instance()->accountList(subAccountList, tqparent.accountList());
for(it = subAccountList.begin(); it != subAccountList.end(); ++it) {
if((*it).name() == accountElement.attribute("name")) {
acc = *it;
@@ -281,7 +281,7 @@ bool MyMoneyTemplate::createAccounts(MyMoneyAccount& parent, QDomNode account)
acc.setAccountType(static_cast<MyMoneyAccount::_accountTypeE>(accountElement.attribute("type").toUInt()));
setFlags(acc, account.firstChild());
try {
- MyMoneyFile::instance()->addAccount(acc, parent);
+ MyMoneyFile::instance()->addAccount(acc, tqparent);
} catch(MyMoneyException *e) {
delete e;
}
@@ -294,19 +294,19 @@ bool MyMoneyTemplate::createAccounts(MyMoneyAccount& parent, QDomNode account)
return rc;
}
-bool MyMoneyTemplate::setFlags(MyMoneyAccount& acc, QDomNode flags)
+bool MyMoneyTemplate::setFlags(MyMoneyAccount& acc, TQDomNode flags)
{
bool rc = true;
while(rc == true && !flags.isNull()) {
if(flags.isElement()) {
- QDomElement flagElement = flags.toElement();
+ TQDomElement flagElement = flags.toElement();
if(flagElement.tagName() == "flag") {
// make sure, we only store flags we know!
- QString value = flagElement.attribute("name");
+ TQString value = flagElement.attribute("name");
if(value == "Tax") {
acc.setValue(value.latin1(), "Yes");
} else {
- KMessageBox::error(qApp->mainWidget(), QString("<p>")+i18n("Invalid flag type <b>%1</b> for account <b>%3</b> in template file <b>%2</b>!").arg(flagElement.attribute("name")).arg(m_source.prettyURL()).arg(acc.name()));
+ KMessageBox::error(tqApp->mainWidget(), TQString("<p>")+i18n("Invalid flag type <b>%1</b> for account <b>%3</b> in template file <b>%2</b>!").tqarg(flagElement.attribute("name")).tqarg(m_source.prettyURL()).tqarg(acc.name()));
rc = false;
}
}
@@ -316,34 +316,34 @@ bool MyMoneyTemplate::setFlags(MyMoneyAccount& acc, QDomNode flags)
return rc;
}
-void MyMoneyTemplate::signalProgress(int current, int total, const QString& msg)
+void MyMoneyTemplate::signalProgress(int current, int total, const TQString& msg)
{
if(m_progressCallback != 0)
(*m_progressCallback)(current, total, msg);
}
-bool MyMoneyTemplate::exportTemplate(void(*callback)(int, int, const QString&))
+bool MyMoneyTemplate::exportTemplate(void(*callback)(int, int, const TQString&))
{
m_progressCallback = callback;
- m_doc = QDomDocument("KMYMONEY-TEMPLATE");
+ m_doc = TQDomDocument("KMYMONEY-TEMPLATE");
- QDomProcessingInstruction instruct = m_doc.createProcessingInstruction(QString("xml"), QString("version=\"1.0\" encoding=\"utf-8\""));
+ TQDomProcessingInstruction instruct = m_doc.createProcessingInstruction(TQString("xml"), TQString("version=\"1.0\" encoding=\"utf-8\""));
m_doc.appendChild(instruct);
- QDomElement mainElement = m_doc.createElement("kmymoney-account-template");
+ TQDomElement mainElement = m_doc.createElement("kmymoney-account-template");
m_doc.appendChild(mainElement);
- QDomElement title = m_doc.createElement("title");
+ TQDomElement title = m_doc.createElement("title");
mainElement.appendChild(title);
- QDomElement shortDesc = m_doc.createElement("shortdesc");
+ TQDomElement shortDesc = m_doc.createElement("shortdesc");
mainElement.appendChild(shortDesc);
- QDomElement longDesc = m_doc.createElement("longdesc");
+ TQDomElement longDesc = m_doc.createElement("longdesc");
mainElement.appendChild(longDesc);
- QDomElement accounts = m_doc.createElement("accounts");
+ TQDomElement accounts = m_doc.createElement("accounts");
mainElement.appendChild(accounts);
// addAccountStructure(accounts, MyMoneyFile::instance()->asset());
@@ -355,24 +355,24 @@ bool MyMoneyTemplate::exportTemplate(void(*callback)(int, int, const QString&))
return true;
}
-bool MyMoneyTemplate::addAccountStructure(QDomElement& parent, const MyMoneyAccount& acc)
+bool MyMoneyTemplate::addAccountStructure(TQDomElement& tqparent, const MyMoneyAccount& acc)
{
- QDomElement account = m_doc.createElement("account");
- parent.appendChild(account);
+ TQDomElement account = m_doc.createElement("account");
+ tqparent.appendChild(account);
if(MyMoneyFile::instance()->isStandardAccount(acc.id()))
- account.setAttribute(QString("name"), QString());
+ account.setAttribute(TQString("name"), TQString());
else
- account.setAttribute(QString("name"), acc.name());
- account.setAttribute(QString("type"), acc.accountType());
+ account.setAttribute(TQString("name"), acc.name());
+ account.setAttribute(TQString("type"), acc.accountType());
// FIXME: add tax flag stuff
// any child accounts?
if(acc.accountList().count() > 0) {
- QValueList<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount> list;
MyMoneyFile::instance()->accountList(list, acc.accountList(), false);
- QValueList<MyMoneyAccount>::Iterator it;
+ TQValueList<MyMoneyAccount>::Iterator it;
for(it = list.begin(); it != list.end(); ++it) {
addAccountStructure(account, *it);
}
@@ -382,7 +382,7 @@ bool MyMoneyTemplate::addAccountStructure(QDomElement& parent, const MyMoneyAcco
bool MyMoneyTemplate::saveTemplate(const KURL& url)
{
- QString filename;
+ TQString filename;
if(!url.isValid()) {
qDebug("Invalid template URL '%s'", url.url().latin1());
@@ -395,25 +395,25 @@ bool MyMoneyTemplate::saveTemplate(const KURL& url)
if(qfile.status() == 0) {
saveToLocalFile(qfile.file());
if(!qfile.close()) {
- throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename));
+ throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename));
}
} else {
- throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename));
+ throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename));
}
} else {
KTempFile tmpfile;
saveToLocalFile(tmpfile.file());
if(!KIO::NetAccess::upload(tmpfile.name(), url, NULL))
- throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").arg(url.url()));
+ throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").tqarg(url.url()));
tmpfile.unlink();
}
return true;
}
-bool MyMoneyTemplate::saveToLocalFile(QFile* qfile)
+bool MyMoneyTemplate::saveToLocalFile(TQFile* qfile)
{
- QTextStream stream(qfile);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(qfile);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << m_doc.toString();
return true;
diff --git a/kmymoney2/converter/mymoneytemplate.h b/kmymoney2/converter/mymoneytemplate.h
index 5c96b1f..352fd4e 100644
--- a/kmymoney2/converter/mymoneytemplate.h
+++ b/kmymoney2/converter/mymoneytemplate.h
@@ -21,9 +21,9 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qdom.h>
-class QFile;
-class QListViewItem;
+#include <tqdom.h>
+class TQFile;
+class TQListViewItem;
// ----------------------------------------------------------------------------
// KDE Includes
@@ -55,22 +55,22 @@ public:
bool loadTemplate(const KURL& url);
bool saveTemplate(const KURL& url);
- bool importTemplate(void(*callback)(int, int, const QString&));
- bool exportTemplate(void(*callback)(int, int, const QString&));
+ bool importTemplate(void(*callback)(int, int, const TQString&));
+ bool exportTemplate(void(*callback)(int, int, const TQString&));
- const QString& title(void) const { return m_title; }
- const QString& shortDescription(void) const { return m_shortDesc; }
- const QString& longDescription(void) const { return m_longDesc; }
+ const TQString& title(void) const { return m_title; }
+ const TQString& shortDescription(void) const { return m_shortDesc; }
+ const TQString& longDescription(void) const { return m_longDesc; }
- void hierarchy(QMap<QString, QListViewItem*>& list);
+ void hierarchy(TQMap<TQString, TQListViewItem*>& list);
protected:
bool loadDescription(void);
- bool createAccounts(MyMoneyAccount& parent, QDomNode account);
- bool setFlags(MyMoneyAccount& acc, QDomNode flags);
- bool saveToLocalFile(QFile* qfile);
- bool addAccountStructure(QDomElement& parent, const MyMoneyAccount& acc);
- bool hierarchy(QMap<QString, QListViewItem*>& list, const QString& parent, QDomNode account);
+ bool createAccounts(MyMoneyAccount& tqparent, TQDomNode account);
+ bool setFlags(MyMoneyAccount& acc, TQDomNode flags);
+ bool saveToLocalFile(TQFile* qfile);
+ bool addAccountStructure(TQDomElement& tqparent, const MyMoneyAccount& acc);
+ bool hierarchy(TQMap<TQString, TQListViewItem*>& list, const TQString& tqparent, TQDomNode account);
/**
* This method is used to update the progress information. It
@@ -78,16 +78,16 @@ protected:
*
* For a parameter description see KMyMoneyView::progressCallback().
*/
- void signalProgress(int current, int total, const QString& = "");
+ void signalProgress(int current, int total, const TQString& = "");
private:
- QDomDocument m_doc;
- QDomNode m_accounts;
- QString m_title;
- QString m_shortDesc;
- QString m_longDesc;
+ TQDomDocument m_doc;
+ TQDomNode m_accounts;
+ TQString m_title;
+ TQString m_shortDesc;
+ TQString m_longDesc;
KURL m_source;
- void (*m_progressCallback)(int, int, const QString&);
+ void (*m_progressCallback)(int, int, const TQString&);
int m_accountsRead;
};
diff --git a/kmymoney2/converter/webpricequote.cpp b/kmymoney2/converter/webpricequote.cpp
index de30963..325560b 100644
--- a/kmymoney2/converter/webpricequote.cpp
+++ b/kmymoney2/converter/webpricequote.cpp
@@ -18,10 +18,10 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qfile.h>
-#include <qregexp.h>
-#include <qtextstream.h>
-#include <qprocess.h>
+#include <tqfile.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
+#include <tqprocess.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -46,51 +46,51 @@
#include "webpricequote.h"
// define static members
-QString WebPriceQuote::m_financeQuoteScriptPath;
-QStringList WebPriceQuote::m_financeQuoteSources;
+TQString WebPriceQuote::m_financeQuoteScriptPath;
+TQStringList WebPriceQuote::m_financeQuoteSources;
-QString * WebPriceQuote::lastErrorMsg;
+TQString * WebPriceQuote::lastErrorMsg;
int WebPriceQuote::lastErrorCode = 0;
-WebPriceQuote::WebPriceQuote( QObject* _parent, const char* _name ):
- QObject( _parent, _name )
+WebPriceQuote::WebPriceQuote( TQObject* _parent, const char* _name ):
+ TQObject( _parent, _name )
{
m_financeQuoteScriptPath =
- KGlobal::dirs()->findResource("appdata", QString("misc/financequote.pl"));
- connect(&m_filter,SIGNAL(processExited(const QString&)),this,SLOT(slotParseQuote(const QString&)));
+ KGlobal::dirs()->findResource("appdata", TQString("misc/financequote.pl"));
+ connect(&m_filter,TQT_SIGNAL(processExited(const TQString&)),this,TQT_SLOT(slotParseQuote(const TQString&)));
}
WebPriceQuote::~WebPriceQuote()
{
}
-bool WebPriceQuote::launch( const QString& _symbol, const QString& _id, const QString& _sourcename )
+bool WebPriceQuote::launch( const TQString& _symbol, const TQString& _id, const TQString& _sourcename )
{
- if (_sourcename.contains("Finance::Quote"))
+ if (_sourcename.tqcontains("Finance::Quote"))
return (launchFinanceQuote (_symbol, _id, _sourcename));
else
return (launchNative (_symbol, _id, _sourcename));
}
-bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, const QString& _sourcename ) {
+bool WebPriceQuote::launchNative( const TQString& _symbol, const TQString& _id, const TQString& _sourcename ) {
bool result = true;
m_symbol = _symbol;
m_id = _id;
-// emit status(QString("(Debug) symbol=%1 id=%2...").arg(_symbol,_id));
+// emit status(TQString("(Debug) symbol=%1 id=%2...").tqarg(_symbol,_id));
// if we're running normally, with a UI, we can just get these the normal way,
// from the config file
if ( kapp )
{
- QString sourcename = _sourcename;
+ TQString sourcename = _sourcename;
if ( sourcename.isEmpty() )
sourcename = "Yahoo";
- if ( quoteSources().contains(sourcename) )
+ if ( quoteSources().tqcontains(sourcename) )
m_source = WebPriceQuoteSource(sourcename);
else
- emit error(QString("Source <%1> does not exist.").arg(sourcename));
+ emit error(TQString("Source <%1> does not exist.").tqarg(sourcename));
}
// otherwise, if we have no kapp, we have no config. so we just get them from
// the defaults
@@ -105,21 +105,21 @@ bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, co
KURL url;
// if the source has room for TWO symbols..
- if ( m_source.m_url.contains("%2") )
+ if ( m_source.m_url.tqcontains("%2") )
{
// this is a two-symbol quote. split the symbol into two. valid symbol
// characters are: 0-9, A-Z and the dot. anything else is a separator
- QRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/);
+ TQRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/);
// if we've truly found 2 symbols delimited this way...
if ( splitrx.search(m_symbol) != -1 )
- url = KURL::fromPathOrURL(m_source.m_url.arg(splitrx.cap(1),splitrx.cap(2)));
+ url = KURL::fromPathOrURL(m_source.m_url.tqarg(splitrx.cap(1),splitrx.cap(2)));
else
- kdDebug(2) << "WebPriceQuote::launch() did not find 2 symbols" << endl;
+ kdDebug(2) << "WebPriceQuote::launch() did not tqfind 2 symbols" << endl;
}
else
// a regular one-symbol quote
- url = KURL::fromPathOrURL(m_source.m_url.arg(m_symbol));
+ url = KURL::fromPathOrURL(m_source.m_url.tqarg(m_symbol));
// If we're running a non-interactive session (with no UI), we can't
// use KIO::NetAccess, so we have to get our web data the old-fashioned
@@ -133,10 +133,10 @@ bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, co
if ( url.isLocalFile() )
{
- emit status(QString("Executing %1...").arg(url.path()));
+ emit status(TQString("Executing %1...").tqarg(url.path()));
m_filter.clearArguments();
- m_filter << QStringList::split(" ",url.path());
+ m_filter << TQStringList::split(" ",url.path());
m_filter.setSymbol(m_symbol);
// if we're running non-interactive, we'll need to block.
@@ -152,52 +152,52 @@ bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, co
}
else
{
- emit error(QString("Unable to launch: %1").arg(url.path()));
- slotParseQuote(QString());
+ emit error(TQString("Unable to launch: %1").tqarg(url.path()));
+ slotParseQuote(TQString());
}
}
else
{
- emit status(QString("Fetching URL %1...").arg(url.prettyURL()));
+ emit status(TQString("Fetching URL %1...").tqarg(url.prettyURL()));
- QString tmpFile;
+ TQString tmpFile;
if( download( url, tmpFile, NULL ) )
{
kdDebug(2) << "Downloaded " << tmpFile << endl;
- QFile f(tmpFile);
+ TQFile f(tmpFile);
if ( f.open( IO_ReadOnly ) )
{
result = true;
- QString quote = QTextStream(&f).read();
+ TQString quote = TQTextStream(&f).read();
f.close();
slotParseQuote(quote);
}
else
{
- slotParseQuote(QString());
+ slotParseQuote(TQString());
}
removeTempFile( tmpFile );
}
else
{
emit error(KIO::NetAccess::lastErrorString());
- slotParseQuote(QString());
+ slotParseQuote(TQString());
}
}
return result;
}
-void WebPriceQuote::removeTempFile(const QString& tmpFile)
+void WebPriceQuote::removeTempFile(const TQString& tmpFile)
{
if(tmpFile == m_tmpFile) {
unlink(tmpFile);
- m_tmpFile = QString();
+ m_tmpFile = TQString();
}
}
-bool WebPriceQuote::download(const KURL& u, QString & target, QWidget* window)
+bool WebPriceQuote::download(const KURL& u, TQString & target, TQWidget* window)
{
- m_tmpFile = QString();
+ m_tmpFile = TQString();
// the following code taken and adapted from KIO::NetAccess::download()
if (target.isEmpty())
@@ -218,8 +218,8 @@ bool WebPriceQuote::download(const KURL& u, QString & target, QWidget* window)
KIO::Job * job = KIO::file_copy( u, dest, -1, true, false, false );
job->setWindow (window);
job->addMetaData("cache", "reload"); // bypass cache
- connect( job, SIGNAL( result (KIO::Job *) ),
- this, SLOT( slotResult (KIO::Job *) ) );
+ connect( job, TQT_SIGNAL( result (KIO::Job *) ),
+ this, TQT_SLOT( slotResult (KIO::Job *) ) );
enter_loop();
return bJobOK;
@@ -229,15 +229,15 @@ bool WebPriceQuote::download(const KURL& u, QString & target, QWidget* window)
// The following parts are copied and adjusted from KIO::NetAccess
// If a troll sees this, he kills me
-void qt_enter_modal( QWidget *widget );
-void qt_leave_modal( QWidget *widget );
+void qt_enter_modal( TQWidget *widget );
+void qt_leave_modal( TQWidget *widget );
void WebPriceQuote::enter_loop(void)
{
- QWidget dummy(0,0,WType_Dialog | WShowModal);
- dummy.setFocusPolicy( QWidget::NoFocus );
+ TQWidget dummy(0,0,WType_Dialog | WShowModal);
+ dummy.setFocusPolicy( TQ_NoFocus );
qt_enter_modal(&dummy);
- qApp->enter_loop();
+ tqApp->enter_loop();
qt_leave_modal(&dummy);
}
@@ -248,34 +248,34 @@ void WebPriceQuote::slotResult( KIO::Job * job )
if ( !bJobOK )
{
if ( !lastErrorMsg )
- lastErrorMsg = new QString;
+ lastErrorMsg = new TQString;
*lastErrorMsg = job->errorString();
}
- qApp->exit_loop();
+ tqApp->exit_loop();
}
// The above parts are copied and adjusted from KIO::NetAccess
-bool WebPriceQuote::launchFinanceQuote ( const QString& _symbol, const QString& _id,
- const QString& _sourcename ) {
+bool WebPriceQuote::launchFinanceQuote ( const TQString& _symbol, const TQString& _id,
+ const TQString& _sourcename ) {
bool result = true;
m_symbol = _symbol;
m_id = _id;
- QString FQSource = _sourcename.section (" ", 1);
+ TQString FTQSource = _sourcename.section (" ", 1);
m_source = WebPriceQuoteSource (_sourcename, m_financeQuoteScriptPath,
"\"([^,\"]*)\",.*", // symbol regexp
"[^,]*,[^,]*,\"([^\"]*)\"", // price regexp
"[^,]*,([^,]*),.*", // date regexp
"%y-%m-%d"); // date format
- //emit status(QString("(Debug) symbol=%1 id=%2...").arg(_symbol,_id));
+ //emit status(TQString("(Debug) symbol=%1 id=%2...").tqarg(_symbol,_id));
m_filter.clearArguments();
- m_filter << "perl" << m_financeQuoteScriptPath << FQSource << KProcess::quote(_symbol);
+ m_filter << "perl" << m_financeQuoteScriptPath << FTQSource << KProcess::quote(_symbol);
m_filter.setUseShell(true);
m_filter.setSymbol(m_symbol);
- emit status(QString("Executing %1 %2 %3...").arg(m_financeQuoteScriptPath).arg(FQSource).arg(_symbol));
+ emit status(TQString("Executing %1 %2 %3...").tqarg(m_financeQuoteScriptPath).tqarg(FTQSource).tqarg(_symbol));
// if we're running non-interactive, we'll need to block.
// otherwise, just let us know when it's done.
@@ -290,16 +290,16 @@ bool WebPriceQuote::launchFinanceQuote ( const QString& _symbol, const QString&
}
else
{
- emit error(QString("Unable to launch: %1").arg(m_financeQuoteScriptPath));
- slotParseQuote(QString());
+ emit error(TQString("Unable to launch: %1").tqarg(m_financeQuoteScriptPath));
+ slotParseQuote(TQString());
}
return result;
}
-void WebPriceQuote::slotParseQuote(const QString& _quotedata)
+void WebPriceQuote::slotParseQuote(const TQString& _quotedata)
{
- QString quotedata = _quotedata;
+ TQString quotedata = _quotedata;
bool gotprice = false;
bool gotdate = false;
@@ -313,10 +313,10 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata)
//
// HTML tags
- quotedata.remove(QRegExp("<[^>]*>"));
+ quotedata.remove(TQRegExp("<[^>]*>"));
// &...;'s
- quotedata.replace(QRegExp("&\\w+;")," ");
+ quotedata.tqreplace(TQRegExp("&\\w+;")," ");
// Extra white space
quotedata = quotedata.simplifyWhiteSpace();
@@ -324,20 +324,20 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata)
#if KMM_DEBUG
// Enable to get a look at the data coming back from the source after it's stripped
- QFile file("stripped.txt");
+ TQFile file("stripped.txt");
if ( file.open( IO_WriteOnly ) )
{
- QTextStream( &file ) << quotedata;
+ TQTextStream( &file ) << quotedata;
file.close();
}
#endif
- QRegExp symbolRegExp(m_source.m_sym);
- QRegExp dateRegExp(m_source.m_date);
- QRegExp priceRegExp(m_source.m_price);
+ TQRegExp symbolRegExp(m_source.m_sym);
+ TQRegExp dateRegExp(m_source.m_date);
+ TQRegExp priceRegExp(m_source.m_price);
if( symbolRegExp.search(quotedata) > -1)
- emit status(i18n("Symbol found: %1").arg(symbolRegExp.cap(1)));
+ emit status(i18n("Symbol found: %1").tqarg(symbolRegExp.cap(1)));
if(priceRegExp.search(quotedata)> -1)
{
@@ -350,39 +350,39 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata)
//
// Remove all non-digits from the price string except the last one, and
// set the last one to a period.
- QString pricestr = priceRegExp.cap(1);
+ TQString pricestr = priceRegExp.cap(1);
- int pos = pricestr.findRev(QRegExp("\\D"));
+ int pos = pricestr.tqfindRev(TQRegExp("\\D"));
if ( pos > 0 )
{
pricestr[pos] = '.';
- pos = pricestr.findRev(QRegExp("\\D"),pos-1);
+ pos = pricestr.tqfindRev(TQRegExp("\\D"),pos-1);
}
while ( pos > 0 )
{
pricestr.remove(pos,1);
- pos = pricestr.findRev(QRegExp("\\D"),pos);
+ pos = pricestr.tqfindRev(TQRegExp("\\D"),pos);
}
m_price = pricestr.toDouble();
- emit status(i18n("Price found: %1 (%2)").arg(pricestr).arg(m_price));
+ emit status(i18n("Price found: %1 (%2)").tqarg(pricestr).tqarg(m_price));
}
if(dateRegExp.search(quotedata) > -1)
{
- QString datestr = dateRegExp.cap(1);
+ TQString datestr = dateRegExp.cap(1);
MyMoneyDateFormat dateparse(m_source.m_dateformat);
try
{
m_date = dateparse.convertString( datestr,false /*strict*/ );
gotdate = true;
- emit status(i18n("Date found: %1").arg(m_date.toString()));;
+ emit status(i18n("Date found: %1").tqarg(m_date.toString()));;
}
catch (MyMoneyException* e)
{
- // emit error(i18n("Unable to parse date %1 using format %2: %3").arg(datestr,dateparse.format(),e->what()));
- m_date = QDate::currentDate();
+ // emit error(i18n("Unable to parse date %1 using format %2: %3").tqarg(datestr,dateparse.format(),e->what()));
+ m_date = TQDate::tqcurrentDate();
gotdate = true;
delete e;
}
@@ -394,20 +394,20 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata)
}
else
{
- emit error(i18n("Unable to update price for %1").arg(m_symbol));
+ emit error(i18n("Unable to update price for %1").tqarg(m_symbol));
emit failed( m_id, m_symbol );
}
}
else
{
- emit error(i18n("Unable to update price for %1").arg(m_symbol));
+ emit error(i18n("Unable to update price for %1").tqarg(m_symbol));
emit failed( m_id, m_symbol );
}
}
-QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
+TQMap<TQString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
{
- QMap<QString,WebPriceQuoteSource> result;
+ TQMap<TQString,WebPriceQuoteSource> result;
result["Yahoo"] = WebPriceQuoteSource("Yahoo",
"http://finance.yahoo.com/d/quotes.csv?s=%1&f=sl1d1",
@@ -448,7 +448,7 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
result["Globe & Mail"] = WebPriceQuoteSource("Globe & Mail",
"http://globefunddb.theglobeandmail.com/gishome/plsql/gis.price_history?pi_fund_id=%1",
- QString(), // symbolregexp
+ TQString(), // symbolregexp
"Reinvestment Price \\w+ \\d+, \\d+ (\\d+\\.\\d+)", // priceregexp
"Reinvestment Price (\\w+ \\d+, \\d+)", // dateregexp
"%m %d %y" // dateformat
@@ -456,7 +456,7 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
result["MSN.CA"] = WebPriceQuoteSource("MSN.CA",
"http://ca.moneycentral.msn.com/investor/quotes/quotes.asp?symbol=%1",
- QString(), // symbolregexp
+ TQString(), // symbolregexp
"Net Asset Value (\\d+\\.\\d+)", // priceregexp
"NAV update (\\d+\\D+\\d+\\D+\\d+)", // dateregexp
"%d %m %y" // dateformat
@@ -464,7 +464,7 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
// Finanztreff (replaces VWD.DE) and boerseonline supplied by Micahel Zimmerman
result["Finanztreff"] = WebPriceQuoteSource("Finanztreff",
"http://finanztreff.de/kurse_einzelkurs_detail.htn?u=100&i=%1",
- QString(), // symbolregexp
+ TQString(), // symbolregexp
"([0-9]+,\\d+).+Gattung:Fonds", // priceregexp
"\\).(\\d+\\D+\\d+\\D+\\d+)", // dateregexp (doesn't work; date in chart
"%d.%m.%y" // dateformat
@@ -472,7 +472,7 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
result["boerseonline"] = WebPriceQuoteSource("boerseonline",
"http://www.boerse-online.de/tools/boerse/einzelkurs_kurse.htm?&s=%1",
- QString(), // symbolregexp
+ TQString(), // symbolregexp
"Akt\\. Kurs.(\\d+,\\d\\d)", // priceregexp
"Datum.(\\d+\\.\\d+\\.\\d+)", // dateregexp (doesn't work; date in chart
"%d.%m.%y" // dateformat
@@ -538,7 +538,7 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
result["Gielda Papierow Wartosciowych (GPW)"] = WebPriceQuoteSource("Gielda Papierow Wartosciowych (GPW)",
"http://stooq.com/q/?s=%1",
- QString(), // symbol regexp
+ TQString(), // symbol regexp
"Kurs.*(\\d+\\.\\d+).*Data", // price regexp
"(\\d{4,4}-\\d{2,2}-\\d{2,2})", // date regexp
"%y %m %d" // date format
@@ -548,7 +548,7 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
// at OMX Baltic market.
result["OMX Baltic funds"] = WebPriceQuoteSource("OMX Baltic funds",
"http://www.baltic.omxgroup.com/market/?pg=nontradeddetails&currency=0&instrument=%1",
- QString(), // symbolregexp
+ TQString(), // symbolregexp
"NAV (\\d+,\\d+)", // priceregexp
"Kpv (\\d+.\\d+.\\d+)", // dateregexp
"%d.%m.%y" // dateformat
@@ -589,20 +589,20 @@ QMap<QString,WebPriceQuoteSource> WebPriceQuote::defaultQuoteSources(void)
return result;
}
-QStringList WebPriceQuote::quoteSources (const _quoteSystemE _system) {
+TQStringList WebPriceQuote::quoteSources (const _quoteSystemE _system) {
if (_system == Native)
return (quoteSourcesNative());
else
return (quoteSourcesFinanceQuote());
}
-QStringList WebPriceQuote::quoteSourcesNative()
+TQStringList WebPriceQuote::quoteSourcesNative()
{
KConfig *kconfig = KGlobal::config();
- QStringList groups = kconfig->groupList();
+ TQStringList groups = kconfig->groupList();
- QStringList::Iterator it;
- QRegExp onlineQuoteSource(QString("^Online-Quote-Source-(.*)$"));
+ TQStringList::Iterator it;
+ TQRegExp onlineQuoteSource(TQString("^Online-Quote-Source-(.*)$"));
// get rid of all 'non online quote source' entries
for(it = groups.begin(); it != groups.end(); it = groups.remove(it)) {
@@ -617,14 +617,14 @@ QStringList WebPriceQuote::quoteSourcesNative()
if ( ! groups.count() && kconfig->hasGroup("Online Quotes Options") )
{
kconfig->setGroup("Online Quotes Options");
- QString url(kconfig->readEntry("URL","http://finance.yahoo.com/d/quotes.csv?s=%1&f=sl1d1"));
- QString symbolRegExp(kconfig->readEntry("SymbolRegex","\"([^,\"]*)\",.*"));
- QString priceRegExp(kconfig->readEntry("PriceRegex","[^,]*,([^,]*),.*"));
- QString dateRegExp(kconfig->readEntry("DateRegex","[^,]*,[^,]*,\"([^\"]*)\""));
+ TQString url(kconfig->readEntry("URL","http://finance.yahoo.com/d/quotes.csv?s=%1&f=sl1d1"));
+ TQString symbolRegExp(kconfig->readEntry("SymbolRegex","\"([^,\"]*)\",.*"));
+ TQString priceRegExp(kconfig->readEntry("PriceRegex","[^,]*,([^,]*),.*"));
+ TQString dateRegExp(kconfig->readEntry("DateRegex","[^,]*,[^,]*,\"([^\"]*)\""));
kconfig->deleteGroup("Online Quotes Options");
groups += "Old Source";
- kconfig->setGroup(QString("Online-Quote-Source-%1").arg("Old Source"));
+ kconfig->setGroup(TQString("Online-Quote-Source-%1").tqarg("Old Source"));
kconfig->writeEntry("URL", url);
kconfig->writeEntry("SymbolRegex", symbolRegExp);
kconfig->writeEntry("PriceRegex",priceRegExp);
@@ -635,11 +635,11 @@ QStringList WebPriceQuote::quoteSourcesNative()
// Set up each of the default sources. These are done piecemeal so that
// when we add a new source, it's automatically picked up.
- QMap<QString,WebPriceQuoteSource> defaults = defaultQuoteSources();
- QMap<QString,WebPriceQuoteSource>::const_iterator it_source = defaults.begin();
+ TQMap<TQString,WebPriceQuoteSource> defaults = defaultQuoteSources();
+ TQMap<TQString,WebPriceQuoteSource>::const_iterator it_source = defaults.begin();
while ( it_source != defaults.end() )
{
- if ( ! groups.contains( (*it_source).m_name ) )
+ if ( ! groups.tqcontains( (*it_source).m_name ) )
{
groups += (*it_source).m_name;
(*it_source).write();
@@ -651,15 +651,15 @@ QStringList WebPriceQuote::quoteSourcesNative()
return groups;
}
-QStringList WebPriceQuote::quoteSourcesFinanceQuote()
+TQStringList WebPriceQuote::quoteSourcesFinanceQuote()
{
if (m_financeQuoteSources.empty()) { // run the process one time only
FinanceQuoteProcess getList;
m_financeQuoteScriptPath =
- KGlobal::dirs()->findResource("appdata", QString("misc/financequote.pl"));
+ KGlobal::dirs()->findResource("appdata", TQString("misc/financequote.pl"));
getList.launch( m_financeQuoteScriptPath );
while (!getList.isFinished()) {
- qApp->processEvents();
+ tqApp->processEvents();
}
m_financeQuoteSources = getList.getSourceList();
}
@@ -670,7 +670,7 @@ QStringList WebPriceQuote::quoteSourcesFinanceQuote()
// Helper class to load/save an individual source
//
-WebPriceQuoteSource::WebPriceQuoteSource(const QString& name, const QString& url, const QString& sym, const QString& price, const QString& date, const QString& dateformat):
+WebPriceQuoteSource::WebPriceQuoteSource(const TQString& name, const TQString& url, const TQString& sym, const TQString& price, const TQString& date, const TQString& dateformat):
m_name(name),
m_url(url),
m_sym(sym),
@@ -680,11 +680,11 @@ WebPriceQuoteSource::WebPriceQuoteSource(const QString& name, const QString& url
{
}
-WebPriceQuoteSource::WebPriceQuoteSource(const QString& name)
+WebPriceQuoteSource::WebPriceQuoteSource(const TQString& name)
{
m_name = name;
KConfig *kconfig = KGlobal::config();
- kconfig->setGroup(QString("Online-Quote-Source-%1").arg(m_name));
+ kconfig->setGroup(TQString("Online-Quote-Source-%1").tqarg(m_name));
m_sym = kconfig->readEntry("SymbolRegex");
m_date = kconfig->readEntry("DateRegex");
m_dateformat = kconfig->readEntry("DateFormatRegex","%m %d %y");
@@ -696,7 +696,7 @@ WebPriceQuoteSource::WebPriceQuoteSource(const QString& name)
void WebPriceQuoteSource::write(void) const
{
KConfig *kconfig = KGlobal::config();
- kconfig->setGroup(QString("Online-Quote-Source-%1").arg(m_name));
+ kconfig->setGroup(TQString("Online-Quote-Source-%1").tqarg(m_name));
kconfig->writeEntry("URL", m_url);
kconfig->writeEntry("PriceRegex", m_price);
kconfig->writeEntry("DateRegex", m_date);
@@ -708,7 +708,7 @@ void WebPriceQuoteSource::write(void) const
kconfig->deleteEntry("SkipStripping");
}
-void WebPriceQuoteSource::rename(const QString& name)
+void WebPriceQuoteSource::rename(const TQString& name)
{
remove();
m_name = name;
@@ -718,7 +718,7 @@ void WebPriceQuoteSource::rename(const QString& name)
void WebPriceQuoteSource::remove(void) const
{
KConfig *kconfig = KGlobal::config();
- kconfig->deleteGroup(QString("Online-Quote-Source-%1").arg(m_name));
+ kconfig->deleteGroup(TQString("Online-Quote-Source-%1").tqarg(m_name));
}
//
@@ -727,17 +727,17 @@ void WebPriceQuoteSource::remove(void) const
WebPriceQuoteProcess::WebPriceQuoteProcess(void)
{
- connect(this, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(slotReceivedDataFromFilter(KProcess*, char*, int)));
- connect(this, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*)));
+ connect(this, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedDataFromFilter(KProcess*, char*, int)));
+ connect(this, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotProcessExited(KProcess*)));
}
void WebPriceQuoteProcess::slotReceivedDataFromFilter(KProcess* /*_process*/, char* _pcbuffer, int _nbufferlen)
{
- QByteArray data;
+ TQByteArray data;
data.duplicate(_pcbuffer, _nbufferlen);
-// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << QString(data) << endl;
- m_string += QString(data);
+// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << TQString(data) << endl;
+ m_string += TQString(data);
}
void WebPriceQuoteProcess::slotProcessExited(KProcess*)
@@ -809,17 +809,17 @@ FinanceQuoteProcess::FinanceQuoteProcess(void)
m_fqNames["yahoo_europe"] = "Yahoo Europe";
m_fqNames["yahoo_nz"] = "Yahoo New Zealand";
m_fqNames["zifunds"] = "Zuerich Investments";
- connect(this, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(slotReceivedDataFromFilter(KProcess*, char*, int)));
- connect(this, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*)));
+ connect(this, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedDataFromFilter(KProcess*, char*, int)));
+ connect(this, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotProcessExited(KProcess*)));
}
void FinanceQuoteProcess::slotReceivedDataFromFilter(KProcess* /*_process*/, char* _pcbuffer, int _nbufferlen)
{
- QByteArray data;
+ TQByteArray data;
data.duplicate(_pcbuffer, _nbufferlen);
-// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << QString(data) << endl;
- m_string += QString(data);
+// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << TQString(data) << endl;
+ m_string += TQString(data);
}
void FinanceQuoteProcess::slotProcessExited(KProcess*)
@@ -828,19 +828,19 @@ void FinanceQuoteProcess::slotProcessExited(KProcess*)
m_isDone = true;
}
-void FinanceQuoteProcess::launch (const QString& scriptPath) {
+void FinanceQuoteProcess::launch (const TQString& scriptPath) {
clearArguments();
- arguments.append(QCString("perl"));
- arguments.append (QCString(scriptPath));
- arguments.append (QCString("-l"));
+ arguments.append(TQCString("perl"));
+ arguments.append (TQCString(scriptPath));
+ arguments.append (TQCString("-l"));
if (!start(KProcess::NotifyOnExit, KProcess::Stdout)) qFatal ("Unable to start FQ script");
return;
}
-QStringList FinanceQuoteProcess::getSourceList() {
- QStringList raw = QStringList::split(0x0A, m_string);
- QStringList sources;
- QStringList::iterator it;
+TQStringList FinanceQuoteProcess::getSourceList() {
+ TQStringList raw = TQStringList::split(0x0A, m_string);
+ TQStringList sources;
+ TQStringList::iterator it;
for (it = raw.begin(); it != raw.end(); ++it) {
if (m_fqNames[*it].isEmpty()) sources.append(*it);
else sources.append(m_fqNames[*it]);
@@ -849,8 +849,8 @@ QStringList FinanceQuoteProcess::getSourceList() {
return (sources);
}
-const QString FinanceQuoteProcess::crypticName(const QString& niceName) {
- QString ret (niceName);
+const TQString FinanceQuoteProcess::crypticName(const TQString& niceName) {
+ TQString ret (niceName);
fqNameMap::iterator it;
for (it = m_fqNames.begin(); it != m_fqNames.end(); ++it) {
if (niceName == it.data()) {
@@ -861,8 +861,8 @@ const QString FinanceQuoteProcess::crypticName(const QString& niceName) {
return (ret);
}
-const QString FinanceQuoteProcess::niceName(const QString& crypticName) {
- QString ret (m_fqNames[crypticName]);
+const TQString FinanceQuoteProcess::niceName(const TQString& crypticName) {
+ TQString ret (m_fqNames[crypticName]);
if (ret.isEmpty()) ret = crypticName;
return (ret);
}
@@ -870,29 +870,29 @@ const QString FinanceQuoteProcess::niceName(const QString& crypticName) {
// Universal date converter
//
-// In 'strict' mode, this is designed to be compatable with the QIF profile date
+// In 'strict' mode, this is designed to be compatable with the TQIF profile date
// converter. However, that converter deals with the concept of an apostrophe
// format in a way I don't understand. So for the moment, they are 99%
// compatable, waiting on that issue. (acejones)
-QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigned _centurymidpoint) const
+TQDate MyMoneyDateFormat::convertString(const TQString& _in, bool _strict, unsigned _centurymidpoint) const
{
//
// Break date format string into component parts
//
- QRegExp formatrex("%([mdy]+)(\\W+)%([mdy]+)(\\W+)%([mdy]+)",false /* case sensitive */);
+ TQRegExp formatrex("%([mdy]+)(\\W+)%([mdy]+)(\\W+)%([mdy]+)",false /* case sensitive */);
if ( formatrex.search(m_format) == -1 )
{
throw new MYMONEYEXCEPTION("Invalid format string");
}
- QStringList formatParts;
+ TQStringList formatParts;
formatParts += formatrex.cap(1);
formatParts += formatrex.cap(3);
formatParts += formatrex.cap(5);
- QStringList formatDelimiters;
+ TQStringList formatDelimiters;
formatDelimiters += formatrex.cap(2);
formatDelimiters += formatrex.cap(4);
@@ -901,13 +901,13 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
// using the delimiters found in the format string
//
- QRegExp inputrex;
+ TQRegExp inputrex;
inputrex.setCaseSensitive(false);
// strict mode means we must enforce the delimiters as specified in the
// format. non-strict allows any delimiters
if ( _strict )
- inputrex.setPattern(QString("(\\w+)%1(\\w+)%2(\\w+)").arg(formatDelimiters[0],formatDelimiters[1]));
+ inputrex.setPattern(TQString("(\\w+)%1(\\w+)%2(\\w+)").tqarg(formatDelimiters[0],formatDelimiters[1]));
else
inputrex.setPattern("(\\w+)\\W+(\\w+)\\W+(\\w+)");
@@ -916,7 +916,7 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
throw new MYMONEYEXCEPTION("Invalid input string");
}
- QStringList scannedParts;
+ TQStringList scannedParts;
scannedParts += inputrex.cap(1).lower();
scannedParts += inputrex.cap(2).lower();
scannedParts += inputrex.cap(3).lower();
@@ -927,9 +927,9 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
unsigned day = 0, month = 0, year = 0;
bool ok;
- QRegExp digitrex("(\\d+)");
- QStringList::const_iterator it_scanned = scannedParts.begin();
- QStringList::const_iterator it_format = formatParts.begin();
+ TQRegExp digitrex("(\\d+)");
+ TQStringList::const_iterator it_scanned = scannedParts.begin();
+ TQStringList::const_iterator it_format = formatParts.begin();
while ( it_scanned != scannedParts.end() )
{
switch ( (*it_format)[0] )
@@ -940,7 +940,7 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
if ( digitrex.search(*it_scanned) != -1 )
day = digitrex.cap(1).toUInt(&ok);
if ( !ok || day > 31 )
- throw new MYMONEYEXCEPTION(QString("Invalid day entry: %1").arg(*it_scanned));
+ throw new MYMONEYEXCEPTION(TQString("Invalid day entry: %1").tqarg(*it_scanned));
break;
case 'm':
month = (*it_scanned).toUInt(&ok);
@@ -958,18 +958,18 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
}
if ( month < 1 || month > 12 )
- throw new MYMONEYEXCEPTION(QString("Invalid month entry: %1").arg(*it_scanned));
+ throw new MYMONEYEXCEPTION(TQString("Invalid month entry: %1").tqarg(*it_scanned));
break;
case 'y':
if ( _strict && (*it_scanned).length() != (*it_format).length())
- throw new MYMONEYEXCEPTION(QString("Length of year (%1) does not match expected length (%2).")
- .arg(*it_scanned,*it_format));
+ throw new MYMONEYEXCEPTION(TQString("Length of year (%1) does not match expected length (%2).")
+ .tqarg(*it_scanned,*it_format));
year = (*it_scanned).toUInt(&ok);
if (!ok)
- throw new MYMONEYEXCEPTION(QString("Invalid year entry: %1").arg(*it_scanned));
+ throw new MYMONEYEXCEPTION(TQString("Invalid year entry: %1").tqarg(*it_scanned));
//
// 2-digit year case
@@ -988,7 +988,7 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
}
if ( year < 1900 )
- throw new MYMONEYEXCEPTION(QString("Invalid year (%1)").arg(year));
+ throw new MYMONEYEXCEPTION(TQString("Invalid year (%1)").tqarg(year));
break;
default:
@@ -999,9 +999,9 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
++it_format;
}
- QDate result(year,month,day);
+ TQDate result(year,month,day);
if ( ! result.isValid() )
- throw new MYMONEYEXCEPTION(QString("Invalid date (yr%1 mo%2 dy%3)").arg(year).arg(month).arg(day));
+ throw new MYMONEYEXCEPTION(TQString("Invalid date (yr%1 mo%2 dy%3)").tqarg(year).tqarg(month).tqarg(day));
return result;
}
@@ -1010,35 +1010,35 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne
// Unit test helpers
//
-convertertest::QuoteReceiver::QuoteReceiver(WebPriceQuote* q, QObject* parent, const char *name) :
- QObject(parent,name)
+convertertest::QuoteReceiver::QuoteReceiver(WebPriceQuote* q, TQObject* tqparent, const char *name) :
+ TQObject(tqparent,name)
{
- connect(q,SIGNAL(quote(const QString&,const QDate&, const double&)),
- this,SLOT(slotGetQuote(const QString&,const QDate&, const double&)));
- connect(q,SIGNAL(status(const QString&)),
- this,SLOT(slotStatus(const QString&)));
- connect(q,SIGNAL(error(const QString&)),
- this,SLOT(slotError(const QString&)));
+ connect(q,TQT_SIGNAL(quote(const TQString&,const TQDate&, const double&)),
+ this,TQT_SLOT(slotGetQuote(const TQString&,const TQDate&, const double&)));
+ connect(q,TQT_SIGNAL(status(const TQString&)),
+ this,TQT_SLOT(slottqStatus(const TQString&)));
+ connect(q,TQT_SIGNAL(error(const TQString&)),
+ this,TQT_SLOT(slotError(const TQString&)));
}
convertertest::QuoteReceiver::~QuoteReceiver()
{
}
-void convertertest::QuoteReceiver::slotGetQuote(const QString&,const QDate& d, const double& m)
+void convertertest::QuoteReceiver::slotGetQuote(const TQString&,const TQDate& d, const double& m)
{
// kdDebug(2) << "test::QuoteReceiver::slotGetQuote( , " << d << " , " << m.toString() << " )" << endl;
m_price = MyMoneyMoney(m);
m_date = d;
}
-void convertertest::QuoteReceiver::slotStatus(const QString& msg)
+void convertertest::QuoteReceiver::slottqStatus(const TQString& msg)
{
-// kdDebug(2) << "test::QuoteReceiver::slotStatus( " << msg << " )" << endl;
+// kdDebug(2) << "test::QuoteReceiver::slottqStatus( " << msg << " )" << endl;
m_statuses += msg;
}
-void convertertest::QuoteReceiver::slotError(const QString& msg)
+void convertertest::QuoteReceiver::slotError(const TQString& msg)
{
// kdDebug(2) << "test::QuoteReceiver::slotError( " << msg << " )" << endl;
diff --git a/kmymoney2/converter/webpricequote.h b/kmymoney2/converter/webpricequote.h
index e25dfb8..ba8146b 100644
--- a/kmymoney2/converter/webpricequote.h
+++ b/kmymoney2/converter/webpricequote.h
@@ -15,16 +15,16 @@
* *
***************************************************************************/
-#ifndef WEBPRICEQUOTE_H
-#define WEBPRICEQUOTE_H
+#ifndef WEBPRICETQUOTE_H
+#define WEBPRICETQUOTE_H
// ----------------------------------------------------------------------------
// QT Headers
-#include <qobject.h>
-#include <qdatetime.h>
-#include <qstringlist.h>
-#include <qmap.h>
+#include <tqobject.h>
+#include <tqdatetime.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -48,20 +48,21 @@ of a local script being used to fetch the quote.
class WebPriceQuoteProcess: public KProcess
{
Q_OBJECT
+ TQ_OBJECT
public:
WebPriceQuoteProcess(void);
- void setSymbol(const QString& _symbol) { m_symbol = _symbol; m_string.truncate(0); }
+ void setSymbol(const TQString& _symbol) { m_symbol = _symbol; m_string.truncate(0); }
public slots:
void slotReceivedDataFromFilter(KProcess*, char*, int);
void slotProcessExited(KProcess*);
signals:
- void processExited(const QString&);
+ void processExited(const TQString&);
private:
- QString m_symbol;
- QString m_string;
+ TQString m_symbol;
+ TQString m_string;
};
/**
@@ -75,13 +76,14 @@ by the Finance::Quote package, and more user-friendly names.
class FinanceQuoteProcess: public KProcess
{
Q_OBJECT
+ TQ_OBJECT
public:
FinanceQuoteProcess(void);
- void launch (const QString& scriptPath);
+ void launch (const TQString& scriptPath);
bool isFinished() { return(m_isDone);};
- QStringList getSourceList();
- const QString crypticName(const QString& niceName);
- const QString niceName(const QString& crypticName);
+ TQStringList getSourceList();
+ const TQString crypticName(const TQString& niceName);
+ const TQString niceName(const TQString& crypticName);
public slots:
void slotReceivedDataFromFilter(KProcess*, char*, int);
@@ -89,8 +91,8 @@ class FinanceQuoteProcess: public KProcess
private:
bool m_isDone;
- QString m_string;
- typedef QMap<QString, QString> fqNameMap;
+ TQString m_string;
+ typedef TQMap<TQString, TQString> fqNameMap;
fqNameMap m_fqNames;
};
@@ -103,20 +105,20 @@ class FinanceQuoteProcess: public KProcess
struct WebPriceQuoteSource
{
WebPriceQuoteSource() {}
- WebPriceQuoteSource(const QString& name);
- WebPriceQuoteSource(const QString& name, const QString& url, const QString& sym, const QString& price, const QString& date, const QString& dateformat);
+ WebPriceQuoteSource(const TQString& name);
+ WebPriceQuoteSource(const TQString& name, const TQString& url, const TQString& sym, const TQString& price, const TQString& date, const TQString& dateformat);
~WebPriceQuoteSource() {}
void write(void) const;
- void rename(const QString& name);
+ void rename(const TQString& name);
void remove(void) const;
- QString m_name;
- QString m_url;
- QString m_sym;
- QString m_price;
- QString m_date;
- QString m_dateformat;
+ TQString m_name;
+ TQString m_url;
+ TQString m_sym;
+ TQString m_price;
+ TQString m_date;
+ TQString m_dateformat;
bool m_skipStripping;
};
@@ -125,11 +127,12 @@ Retrieves a price quote from a web-based quote source
@author Ace Jones <acejones@users.sourceforge.net>
*/
-class WebPriceQuote: public QObject
+class WebPriceQuote: public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- WebPriceQuote( QObject* = 0, const char* = 0 );
+ WebPriceQuote( TQObject* = 0, const char* = 0 );
~WebPriceQuote();
typedef enum _quoteSystemE {
@@ -146,78 +149,78 @@ public:
* @param _id an arbitrary identifier, which will be emitted in the quote
* signal when a price is sent back.
* @param _source the source of the quote (must be a valid value returned
- * by quoteSources(). Send QString() to use the default
+ * by quoteSources(). Send TQString() to use the default
* source.
* @return bool Whether the quote fetch process was launched successfully
*/
- bool launch(const QString& _symbol, const QString& _id, const QString& _source=QString());
+ bool launch(const TQString& _symbol, const TQString& _id, const TQString& _source=TQString());
/**
* This returns a list of the names of the quote sources
* currently defined.
*
* @param _system whether to return Native or Finance::Quote source list
- * @return QStringList of quote source names
+ * @return TQStringList of quote source names
*/
- static QStringList quoteSources(const _quoteSystemE _system=Native);
+ static TQStringList quoteSources(const _quoteSystemE _system=Native);
signals:
- void quote(const QString&, const QString&, const QDate&, const double&);
- void failed(const QString&, const QString&);
- void status(const QString&);
- void error(const QString&);
+ void quote(const TQString&, const TQString&, const TQDate&, const double&);
+ void failed(const TQString&, const TQString&);
+ void status(const TQString&);
+ void error(const TQString&);
protected slots:
- void slotParseQuote(const QString&);
+ void slotParseQuote(const TQString&);
protected:
- static QMap<QString,WebPriceQuoteSource> defaultQuoteSources(void);
+ static TQMap<TQString,WebPriceQuoteSource> defaultQuoteSources(void);
private:
- bool download(const KURL& u, QString & target, QWidget* window);
- void removeTempFile(const QString& tmpFile);
+ bool download(const KURL& u, TQString & target, TQWidget* window);
+ void removeTempFile(const TQString& tmpFile);
private slots:
void slotResult( KIO::Job * job );
private:
- bool launchNative(const QString& _symbol, const QString& _id, const QString& _source=QString());
- bool launchFinanceQuote(const QString& _symbol, const QString& _id, const QString& _source=QString());
+ bool launchNative(const TQString& _symbol, const TQString& _id, const TQString& _source=TQString());
+ bool launchFinanceQuote(const TQString& _symbol, const TQString& _id, const TQString& _source=TQString());
void enter_loop(void);
- static QStringList quoteSourcesNative();
- static QStringList quoteSourcesFinanceQuote();
+ static TQStringList quoteSourcesNative();
+ static TQStringList quoteSourcesFinanceQuote();
WebPriceQuoteProcess m_filter;
- QString m_symbol;
- QString m_id;
- QDate m_date;
+ TQString m_symbol;
+ TQString m_id;
+ TQDate m_date;
double m_price;
WebPriceQuoteSource m_source;
- static QString m_financeQuoteScriptPath;
- static QStringList m_financeQuoteSources;
+ static TQString m_financeQuoteScriptPath;
+ static TQStringList m_financeQuoteSources;
/**
* Whether the download succeeded or not. Taken from KIO::NetAccess
*/
bool bJobOK;
- static QString* lastErrorMsg;
+ static TQString* lastErrorMsg;
static int lastErrorCode;
- QString m_tmpFile;
+ TQString m_tmpFile;
};
class MyMoneyDateFormat
{
public:
- MyMoneyDateFormat(const QString& _format): m_format(_format) {}
- QString convertDate(const QDate& _in) const;
- QDate convertString(const QString& _in, bool _strict=true, unsigned _centurymidpoint = QDate::currentDate().year() ) const;
- const QString& format(void) const { return m_format; }
+ MyMoneyDateFormat(const TQString& _format): m_format(_format) {}
+ TQString convertDate(const TQDate& _in) const;
+ TQDate convertString(const TQString& _in, bool _strict=true, unsigned _centurymidpoint = TQDate::tqcurrentDate().year() ) const;
+ const TQString& format(void) const { return m_format; }
private:
- QString m_format;
+ TQString m_format;
};
namespace convertertest {
@@ -227,26 +230,27 @@ Simple class to handle signals/slots for unit tests
@author Ace Jones <acejones@users.sourceforge.net>
*/
-class QuoteReceiver : public QObject
+class QuoteReceiver : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- QuoteReceiver(WebPriceQuote* q, QObject *parent = 0, const char *name = 0);
+ QuoteReceiver(WebPriceQuote* q, TQObject *tqparent = 0, const char *name = 0);
~QuoteReceiver();
public slots:
- void slotGetQuote(const QString&,const QDate&, const double&);
- void slotStatus(const QString&);
- void slotError(const QString&);
+ void slotGetQuote(const TQString&,const TQDate&, const double&);
+ void slottqStatus(const TQString&);
+ void slotError(const TQString&);
public:
- QStringList m_statuses;
- QStringList m_errors;
+ TQStringList m_statuses;
+ TQStringList m_errors;
MyMoneyMoney m_price;
- QDate m_date;
+ TQDate m_date;
};
} // end namespace convertertest
-#endif // WEBPRICEQUOTE_H
+#endif // WEBPRICETQUOTE_H
// vim:cin:si:ai:et:ts=2:sw=2: