summaryrefslogtreecommitdiffstats
path: root/kmymoney2/converter/mymoneyqifwriter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/converter/mymoneyqifwriter.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/converter/mymoneyqifwriter.cpp')
-rw-r--r--kmymoney2/converter/mymoneyqifwriter.cpp58
1 files changed, 29 insertions, 29 deletions
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;
}