diff options
Diffstat (limited to 'kmymoney2/converter/mymoneyqifreader.cpp')
-rw-r--r-- | kmymoney2/converter/mymoneyqifreader.cpp | 472 |
1 files changed, 236 insertions, 236 deletions
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()) { |