From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: 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 --- kmymoney2/mymoney/storage/imymoneyserialize.h | 94 +- kmymoney2/mymoney/storage/imymoneystorage.cpp | 2 +- kmymoney2/mymoney/storage/imymoneystorage.h | 170 +-- kmymoney2/mymoney/storage/imymoneystorageformat.h | 16 +- kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp | 674 +++++------ kmymoney2/mymoney/storage/mymoneydatabasemgr.h | 214 ++-- .../mymoney/storage/mymoneydatabasemgrtest.cpp | 218 ++-- kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h | 4 +- kmymoney2/mymoney/storage/mymoneymap.h | 84 +- kmymoney2/mymoney/storage/mymoneymaptest.cpp | 2 +- kmymoney2/mymoney/storage/mymoneymaptest.h | 2 +- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp | 612 +++++----- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h | 264 ++--- .../mymoney/storage/mymoneyseqaccessmgrtest.cpp | 142 +-- .../mymoney/storage/mymoneyseqaccessmgrtest.h | 8 +- kmymoney2/mymoney/storage/mymoneystorageanon.cpp | 76 +- kmymoney2/mymoney/storage/mymoneystorageanon.h | 32 +- kmymoney2/mymoney/storage/mymoneystoragedump.cpp | 92 +- kmymoney2/mymoney/storage/mymoneystoragedump.h | 12 +- kmymoney2/mymoney/storage/mymoneystoragesql.cpp | 1178 ++++++++++---------- kmymoney2/mymoney/storage/mymoneystoragesql.h | 324 +++--- kmymoney2/mymoney/storage/mymoneystoragexml.cpp | 334 +++--- kmymoney2/mymoney/storage/mymoneystoragexml.h | 80 +- 23 files changed, 2313 insertions(+), 2321 deletions(-) (limited to 'kmymoney2/mymoney/storage') diff --git a/kmymoney2/mymoney/storage/imymoneyserialize.h b/kmymoney2/mymoney/storage/imymoneyserialize.h index a0c12ca..c900687 100644 --- a/kmymoney2/mymoney/storage/imymoneyserialize.h +++ b/kmymoney2/mymoney/storage/imymoneyserialize.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -59,14 +59,14 @@ public: // general get functions virtual const MyMoneyPayee user(void) const = 0; - virtual const QDate creationDate(void) const = 0; - virtual const QDate lastModificationDate(void) const = 0; + virtual const TQDate creationDate(void) const = 0; + virtual const TQDate lastModificationDate(void) const = 0; virtual unsigned int currentFixVersion(void) const = 0; virtual unsigned int fileFixVersion(void) const = 0; // general set functions virtual void setUser(const MyMoneyPayee& val) = 0; - virtual void setCreationDate(const QDate& val) = 0; + virtual void setCreationDate(const TQDate& val) = 0; virtual void setFileFixVersion(const unsigned int v) = 0; /** * This method is used to get a SQL reader for subsequent database access @@ -86,26 +86,26 @@ public: * therefor be called as last operation when loading from a * file. * - * @param val QDate of last modification + * @param val TQDate of last modification */ - virtual void setLastModificationDate(const QDate& val) = 0; + virtual void setLastModificationDate(const TQDate& val) = 0; /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList& list) const = 0; + virtual void accountList(TQValueList& list) const = 0; /** * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QMap containing the institution information + * @return TQMap containing the institution information */ - virtual const QValueList institutionList(void) const = 0; + virtual const TQValueList institutionList(void) const = 0; /** * This method is used to pull a list of transactions from the file @@ -113,25 +113,25 @@ public: * that match the filter passed as argument. If the filter is empty, * the whole journal will be returned. * - * @param list reference to QValueList receiving + * @param list reference to TQValueList receiving * the set of transactions * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const = 0; /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - virtual bool isDuplicateTransaction(const QString&) const = 0; + virtual bool isDuplicateTransaction(const TQString&) const = 0; /** * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - virtual const QValueList payeeList(void) const = 0; + virtual const TQValueList payeeList(void) const = 0; /** * This method returns a list of the scheduled transactions @@ -139,19 +139,19 @@ public: * list of the transactions, all arguments should be used with their * default arguments. */ - virtual const QValueList scheduleList(const QString& = QString(), + virtual const TQValueList scheduleList(const TQString& = TQString(), const MyMoneySchedule::typeE = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE = MyMoneySchedule::STYPE_ANY, - const QDate& = QDate(), - const QDate& = QDate(), + const TQDate& = TQDate(), + const TQDate& = TQDate(), const bool = false) const = 0; /** * This method returns a list of security objects that the engine has * knowledge of. */ - virtual const QValueList securityList(void) const = 0; + virtual const TQValueList securityList(void) const = 0; /** * This method is used to return the standard liability account @@ -194,12 +194,12 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added * * @deprecated This method is only provided as long as we provide @@ -207,7 +207,7 @@ public: * this compatability mode this method will disappear from * this interface! */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) = 0; + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) = 0; /** * This method is used to create a new payee @@ -227,7 +227,7 @@ public: /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -244,7 +244,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * as QString with the object. + * as TQString with the object. * * An exception will be thrown upon error conditions. * @@ -262,15 +262,15 @@ public: */ virtual void addTransaction(MyMoneyTransaction& transaction, const bool skipAccountUpdate = false) = 0; - virtual void loadAccounts(const QMap& map) = 0; - virtual void loadTransactions(const QMap& map) = 0; - virtual void loadInstitutions(const QMap& map) = 0; - virtual void loadPayees(const QMap& map) = 0; - virtual void loadSchedules(const QMap& map) = 0; - virtual void loadSecurities(const QMap& map) = 0; - virtual void loadCurrencies(const QMap& map) = 0; - virtual void loadReports( const QMap& reports ) = 0; - virtual void loadBudgets( const QMap& budgets ) = 0; + virtual void loadAccounts(const TQMap& map) = 0; + virtual void loadTransactions(const TQMap& map) = 0; + virtual void loadInstitutions(const TQMap& map) = 0; + virtual void loadPayees(const TQMap& map) = 0; + virtual void loadSchedules(const TQMap& map) = 0; + virtual void loadSecurities(const TQMap& map) = 0; + virtual void loadCurrencies(const TQMap& map) = 0; + virtual void loadReports( const TQMap& reports ) = 0; + virtual void loadBudgets( const TQMap& budgets ) = 0; virtual void loadPrices(const MyMoneyPriceList& list) = 0; virtual unsigned long accountId(void) const = 0; @@ -296,10 +296,10 @@ public: * from the container. It is meant to be used for permanent storage * functionality. See MyMoneyKeyValueContainer::pairs() for details. * - * @return QMap containing all key/value pairs of + * @return TQMap containing all key/value pairs of * this container. */ - virtual const QMap pairs(void) const = 0; + virtual const TQMap pairs(void) const = 0; /** * This method is used to initially store a set of key/value pairs @@ -307,18 +307,18 @@ public: * from permanent storage. See MyMoneyKeyValueContainer::setPairs() * for details * - * @param list const QMap containing the set of + * @param list const TQMap containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - virtual void setPairs(const QMap& list) = 0; + virtual void setPairs(const TQMap& list) = 0; - virtual const QValueList scheduleListEx( int scheduleTypes, + virtual const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const = 0; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const = 0; /** * This method is used to retrieve the list of all currencies @@ -326,9 +326,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList currencyList(void) const = 0; + virtual const TQValueList currencyList(void) const = 0; /** * This method is used to retrieve the list of all reports @@ -336,9 +336,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList reportList( void ) const = 0; + virtual const TQValueList reportList( void ) const = 0; /** * This method is used to retrieve the list of all budgets @@ -346,9 +346,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList budgetList( void ) const = 0; + virtual const TQValueList budgetList( void ) const = 0; /** diff --git a/kmymoney2/mymoney/storage/imymoneystorage.cpp b/kmymoney2/mymoney/storage/imymoneystorage.cpp index dc67726..f70de9c 100644 --- a/kmymoney2/mymoney/storage/imymoneystorage.cpp +++ b/kmymoney2/mymoney/storage/imymoneystorage.cpp @@ -25,7 +25,7 @@ bool MyMoneyFileBitArray::testBit(uint index) const { if(index < size()) - return QBitArray::testBit(index); + return TQBitArray::testBit(index); return false; } diff --git a/kmymoney2/mymoney/storage/imymoneystorage.h b/kmymoney2/mymoney/storage/imymoneystorage.h index a4e55dd..a4ff2af 100644 --- a/kmymoney2/mymoney/storage/imymoneystorage.h +++ b/kmymoney2/mymoney/storage/imymoneystorage.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -48,15 +48,15 @@ /** * @author Thomas Baumgart * - * A simple replacement for QBitArray that does not bark if testBit() + * A simple replacement for TQBitArray that does not bark if testBit() * is called with an index out of bounds. It silently returns false * in that case, otherwise calls the base classes implementation. */ -class MyMoneyFileBitArray : public QBitArray +class MyMoneyFileBitArray : public TQBitArray { public: - MyMoneyFileBitArray() : QBitArray() {} - MyMoneyFileBitArray(int size) : QBitArray(size) {} + MyMoneyFileBitArray() : TQBitArray() {} + MyMoneyFileBitArray(int size) : TQBitArray(size) {} bool testBit(uint index) const; bool operator[](int index) const { return testBit(index); } bool at(uint index) const { return testBit(index); } @@ -96,15 +96,15 @@ public: #define STD_ACC_ASSET "AStd::Asset" #define STD_ACC_EXPENSE "AStd::Expense" #define STD_ACC_INCOME "AStd::Income" -#define STD_ACC_EQUITY "AStd::Equity" +#define STD_ACC_ETQUITY "AStd::Equity" IMyMoneyStorage(); virtual ~IMyMoneyStorage(); // general get functions virtual const MyMoneyPayee user(void) const = 0; - virtual const QDate creationDate(void) const = 0; - virtual const QDate lastModificationDate(void) const = 0; + virtual const TQDate creationDate(void) const = 0; + virtual const TQDate lastModificationDate(void) const = 0; virtual unsigned int currentFixVersion(void) const = 0; virtual unsigned int fileFixVersion(void) const = 0; @@ -113,9 +113,9 @@ public: virtual void setFileFixVersion(const unsigned int v) = 0; // methods provided by MyMoneyKeyValueContainer - virtual void setValue(const QString& key, const QString& value) = 0; - virtual const QString value(const QString& key) const = 0; - virtual void deletePair(const QString& key) = 0; + virtual void setValue(const TQString& key, const TQString& value) = 0; + virtual const TQString value(const TQString& key) const = 0; + virtual void deletePair(const TQString& key) = 0; /** * This method is used to duplicate an IMyMoneyStorage object and return @@ -135,15 +135,15 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) = 0; + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) = 0; /** * This method is used to create a new payee @@ -158,22 +158,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payee(const QString& id) const = 0; + virtual const MyMoneyPayee payee(const TQString& id) const = 0; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payeeByName(const QString& payee) const = 0; + virtual const MyMoneyPayee payeeByName(const TQString& payee) const = 0; /** * This method is used to modify an existing payee @@ -197,9 +197,9 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - virtual const QValueList payeeList(void) const = 0; + virtual const TQValueList payeeList(void) const = 0; /** * Returns the account addressed by it's id. @@ -210,7 +210,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - virtual const MyMoneyAccount account(const QString& id) const = 0; + virtual const MyMoneyAccount account(const TQString& id) const = 0; /** * This method is used to check whether a given @@ -221,23 +221,23 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - virtual bool isStandardAccount(const QString& id) const = 0; + virtual bool isStandardAccount(const TQString& id) const = 0; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - virtual void setAccountName(const QString& id, const QString& name) = 0; + virtual void setAccountName(const TQString& id, const TQString& name) = 0; /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -249,7 +249,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * QString with the object. + * TQString with the object. * * An exception will be thrown upon error conditions. * @@ -269,7 +269,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - virtual bool hasActiveSplits(const QString& id) const = 0; + virtual bool hasActiveSplits(const TQString& id) const = 0; /** * This method is used to return the actual balance of an account @@ -282,7 +282,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney balance(const QString& id, const QDate& date) const= 0; + virtual const MyMoneyMoney balance(const TQString& id, const TQDate& date) const= 0; /** * This method is used to return the actual balance of an account @@ -295,7 +295,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney totalBalance(const QString& id, const QDate& date) const = 0; + virtual const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date) const = 0; /** * Returns the institution of a given ID @@ -304,7 +304,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - virtual const MyMoneyInstitution institution(const QString& id) const = 0; + virtual const MyMoneyInstitution institution(const TQString& id) const = 0; /** * This method returns an indicator if the storage object has been @@ -334,10 +334,10 @@ public: * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QValueList containing the + * @return TQValueList containing the * institution information */ - virtual const QValueList institutionList(void) const = 0; + virtual const TQValueList institutionList(void) const = 0; /** * Modifies an already existing account in the file global account pool. @@ -370,14 +370,14 @@ public: virtual void modifyTransaction(const MyMoneyTransaction& transaction) = 0; /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) = 0; + virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) = 0; /** * This method is used to remove a transaction from the transaction @@ -393,25 +393,25 @@ public: * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - virtual unsigned int transactionCount(const QString& account = QString()) const = 0; + virtual unsigned int transactionCount(const TQString& account = TQString()) const = 0; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - virtual const QMap transactionCountMap(void) const = 0; + virtual const TQMap transactionCountMap(void) const = 0; /** * This method is used to pull a list of transactions from the file @@ -424,13 +424,13 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - virtual const QValueList transactionList(MyMoneyTransactionFilter& filter) const = 0; + virtual const TQValueList transactionList(MyMoneyTransactionFilter& filter) const = 0; - virtual void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const = 0; - virtual void transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const = 0; /** * Deletes an existing account from the file global account pool @@ -459,20 +459,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - virtual const MyMoneyTransaction transaction(const QString& id) const = 0; + virtual const MyMoneyTransaction transaction(const TQString& id) const = 0; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - virtual const MyMoneyTransaction transaction(const QString& account, const int idx) const = 0; + virtual const MyMoneyTransaction transaction(const TQString& account, const int idx) const = 0; /** * This method returns the number of institutions currently known to file @@ -485,11 +485,11 @@ public: /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList& list) const = 0; + virtual void accountList(TQValueList& list) const = 0; /** * This method is used to return the standard liability account @@ -558,22 +558,22 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - virtual const MyMoneySecurity security(const QString& id) const = 0; + virtual const MyMoneySecurity security(const TQString& id) const = 0; /** * This method returns a list of the security objects * inside a MyMoneyStorage object * - * @return QValueList containing objects + * @return TQValueList containing objects */ - virtual const QValueList securityList(void) const = 0; + virtual const TQValueList securityList(void) const = 0; virtual void addPrice(const MyMoneyPrice& price) = 0; virtual void removePrice(const MyMoneyPrice& price) = 0; - virtual const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const = 0; + virtual const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const = 0; /** * This method returns a list of all prices. @@ -620,10 +620,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - virtual const MyMoneySchedule schedule(const QString& id) const = 0; + virtual const MyMoneySchedule schedule(const TQString& id) const = 0; /** * This method is used to extract a list of scheduled transactions @@ -631,7 +631,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -643,27 +643,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - virtual const QValueList scheduleList(const QString& accountId = QString(), + virtual const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const = 0; - virtual const QValueList scheduleListEx( int scheduleTypes, + virtual const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const = 0; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const = 0; /** * This method is used to add a new currency object to the engine. @@ -702,10 +702,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneyCurrency object */ - virtual const MyMoneySecurity currency(const QString& id) const = 0; + virtual const MyMoneySecurity currency(const TQString& id) const = 0; /** * This method is used to retrieve the list of all currencies @@ -713,9 +713,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList currencyList(void) const = 0; + virtual const TQValueList currencyList(void) const = 0; /** * This method is used to retrieve the list of all reports @@ -723,9 +723,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList reportList( void ) const = 0; + virtual const TQValueList reportList( void ) const = 0; /** * This method is used to add a new report to the engine. @@ -763,10 +763,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - virtual const MyMoneyReport report( const QString& id ) const = 0; + virtual const MyMoneyReport report( const TQString& id ) const = 0; /** * This method is used to remove an existing MyMoneyReport object @@ -784,9 +784,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList budgetList( void ) const = 0; + virtual const TQValueList budgetList( void ) const = 0; /** * This method is used to add a new budget to the engine. @@ -805,11 +805,11 @@ public: * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget object of budget */ - virtual const MyMoneyBudget budgetByName(const QString& budget) const = 0; + virtual const MyMoneyBudget budgetByName(const TQString& budget) const = 0; /** * This method is used to modify an existing MyMoneyBudget @@ -835,10 +835,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - virtual MyMoneyBudget budget( const QString& id ) const = 0; + virtual MyMoneyBudget budget( const TQString& id ) const = 0; /** * This method is used to remove an existing MyMoneyBudget object diff --git a/kmymoney2/mymoney/storage/imymoneystorageformat.h b/kmymoney2/mymoney/storage/imymoneystorageformat.h index b045898..6a7046f 100644 --- a/kmymoney2/mymoney/storage/imymoneystorageformat.h +++ b/kmymoney2/mymoney/storage/imymoneystorageformat.h @@ -31,9 +31,9 @@ // ---------------------------------------------------------------------------- // QT Includes -class QString; -class QIODevice; -class QProgressDialog; +class TQString; +class TQIODevice; +class TQProgressDialog; // ---------------------------------------------------------------------------- // Project Includes @@ -52,13 +52,13 @@ public: Writing = 1 /**< version to be used when writing a file */ }; - virtual void readFile(QIODevice* qf, IMyMoneySerialize* storage) = 0; - // virtual void readStream(QDataStream& s, IMyMoneySerialize* storage) = 0; + virtual void readFile(TQIODevice* qf, IMyMoneySerialize* storage) = 0; + // virtual void readStream(TQDataStream& s, IMyMoneySerialize* storage) = 0; - virtual void writeFile(QIODevice* qf, IMyMoneySerialize* storage) = 0; - //virtual void writeStream(QDataStream& s, IMyMoneySerialize* storage) = 0; + virtual void writeFile(TQIODevice* qf, IMyMoneySerialize* storage) = 0; + //virtual void writeStream(TQDataStream& s, IMyMoneySerialize* storage) = 0; - virtual void setProgressCallback(void(*callback)(int, int, const QString&)) = 0; + virtual void setProgressCallback(void(*callback)(int, int, const TQString&)) = 0; /** * This member is used to store the file version information * obtained while reading a file. diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp index e845094..e80feaf 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp @@ -26,8 +26,8 @@ #define PASS } catch (MyMoneyException *e) { throw; } MyMoneyDatabaseMgr::MyMoneyDatabaseMgr() : -m_creationDate (QDate::currentDate ()), -m_lastModificationDate (QDate::currentDate ()), +m_creationDate (TQDate::tqcurrentDate ()), +m_lastModificationDate (TQDate::tqcurrentDate ()), m_sql (0) { } @@ -38,10 +38,10 @@ MyMoneyDatabaseMgr::~MyMoneyDatabaseMgr() const MyMoneyPayee MyMoneyDatabaseMgr::user(void) const { return m_user; } -const QDate MyMoneyDatabaseMgr::creationDate(void) const +const TQDate MyMoneyDatabaseMgr::creationDate(void) const { return m_creationDate; } -const QDate MyMoneyDatabaseMgr::lastModificationDate(void) const +const TQDate MyMoneyDatabaseMgr::lastModificationDate(void) const { return m_lastModificationDate; } unsigned int MyMoneyDatabaseMgr::currentFixVersion(void) const @@ -61,27 +61,27 @@ void MyMoneyDatabaseMgr::setFileFixVersion(const unsigned int v) { m_fileFixVersion = v; } // methods provided by MyMoneyKeyValueContainer -const QString MyMoneyDatabaseMgr::value(const QString& key) const +const TQString MyMoneyDatabaseMgr::value(const TQString& key) const { return MyMoneyKeyValueContainer::value(key); } -void MyMoneyDatabaseMgr::setValue(const QString& key, const QString& val) +void MyMoneyDatabaseMgr::setValue(const TQString& key, const TQString& val) { MyMoneyKeyValueContainer::setValue(key, val); } -void MyMoneyDatabaseMgr::deletePair(const QString& key) +void MyMoneyDatabaseMgr::deletePair(const TQString& key) { MyMoneyKeyValueContainer::deletePair(key); } -const QMap MyMoneyDatabaseMgr::pairs(void) const +const TQMap MyMoneyDatabaseMgr::pairs(void) const { return MyMoneyKeyValueContainer::pairs(); } -void MyMoneyDatabaseMgr::setPairs(const QMap& list) +void MyMoneyDatabaseMgr::setPairs(const TQMap& list) { MyMoneyKeyValueContainer::setPairs(list); } @@ -104,43 +104,43 @@ void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& account) } } -void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) +void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) { - QMap accountList; - QStringList accountIdList; - QMap::ConstIterator theParent; - QMap::ConstIterator theChild; + TQMap accountList; + TQStringList accountIdList; + TQMap::ConstIterator theParent; + TQMap::ConstIterator theChild; - accountIdList << parent.id() << account.id(); + accountIdList << tqparent.id() << account.id(); startTransaction(); accountList = m_sql->fetchAccounts(accountIdList, true); - theParent = accountList.find(parent.id()); + theParent = accountList.tqfind(tqparent.id()); if(theParent == accountList.end()) { - QString msg = "Unknown parent account '"; - msg += parent.id() + "'"; + TQString msg = "Unknown tqparent account '"; + msg += tqparent.id() + "'"; throw new MYMONEYEXCEPTION(msg); } - theChild = accountList.find(account.id()); + theChild = accountList.tqfind(account.id()); if(theChild == accountList.end()) { - QString msg = "Unknown child account '"; + TQString msg = "Unknown child account '"; msg += account.id() + "'"; throw new MYMONEYEXCEPTION(msg); } MyMoneyAccount acc = *theParent; acc.addAccountId(account.id()); - parent = acc; + tqparent = acc; acc = *theChild; - acc.setParentAccountId(parent.id()); + acc.setParentAccountId(tqparent.id()); account = acc; //FIXME: MyMoneyBalanceCacheItem balance; //FIXME: m_balanceCache[account.id()] = balance; - m_sql->modifyAccount(parent); + m_sql->modifyAccount(tqparent); m_sql->modifyAccount(account); commitTransaction(); } @@ -156,29 +156,29 @@ void MyMoneyDatabaseMgr::addPayee(MyMoneyPayee& payee) } } -const MyMoneyPayee MyMoneyDatabaseMgr::payee(const QString& id) const +const MyMoneyPayee MyMoneyDatabaseMgr::payee(const TQString& id) const { - QMap::ConstIterator it; - QMap payeeList = m_sql->fetchPayees(QString(id)); - it = payeeList.find(id); + TQMap::ConstIterator it; + TQMap payeeList = m_sql->fetchPayees(TQString(id)); + it = payeeList.tqfind(id); if(it == payeeList.end()) throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'"); return *it; } -const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const QString& payee) const +const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const TQString& payee) const { if(payee.isEmpty()) return MyMoneyPayee::null; - QMap payeeList; + TQMap payeeList; TRY payeeList = m_sql->fetchPayees(); PASS - QMap::ConstIterator it_p; + TQMap::ConstIterator it_p; for(it_p = payeeList.begin(); it_p != payeeList.end(); ++it_p) { if((*it_p).name() == payee) { @@ -191,12 +191,12 @@ const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const QString& payee) const void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee) { - QMap payeeList = m_sql->fetchPayees(QString(payee.id()), true); - QMap::ConstIterator it; + TQMap payeeList = m_sql->fetchPayees(TQString(payee.id()), true); + TQMap::ConstIterator it; - it = payeeList.find(payee.id()); + it = payeeList.tqfind(payee.id()); if(it == payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -205,30 +205,30 @@ void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee) void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) { - QMap::ConstIterator it_t; - QMap::ConstIterator it_s; - QMap payeeList = m_sql->fetchPayees(QString(payee.id())); - QMap::ConstIterator it_p; + TQMap::ConstIterator it_t; + TQMap::ConstIterator it_s; + TQMap payeeList = m_sql->fetchPayees(TQString(payee.id())); + TQMap::ConstIterator it_p; - it_p = payeeList.find(payee.id()); + it_p = payeeList.tqfind(payee.id()); if(it_p == payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } // scan all transactions to check if the payee is still referenced - QMap transactionList = m_sql->fetchTransactions(); // make sure they're all here + TQMap transactionList = m_sql->fetchTransactions(); // make sure they're all here for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { if((*it_t).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); } } // check referential integrity in schedules - QMap scheduleList = m_sql->fetchSchedules(); // make sure they're all here + TQMap scheduleList = m_sql->fetchSchedules(); // make sure they're all here for(it_s = scheduleList.begin(); it_s != scheduleList.end(); ++it_s) { if((*it_s).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); } } // remove any reference to report and/or budget @@ -237,20 +237,20 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) m_sql->removePayee(payee); } -const QValueList MyMoneyDatabaseMgr::payeeList(void) const +const TQValueList MyMoneyDatabaseMgr::payeeList(void) const { if (m_sql) return m_sql->fetchPayees().values(); else - return QValueList (); + return TQValueList (); } -const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const +const MyMoneyAccount MyMoneyDatabaseMgr::account(const TQString& id) const { if (m_sql) { - QMap accountList = m_sql->fetchAccounts(QString(id)); - QMap ::ConstIterator pos = accountList.find(id); + TQMap accountList = m_sql->fetchAccounts(TQString(id)); + TQMap ::ConstIterator pos = accountList.tqfind(id); // locate the account and if present, return it's data if(pos != accountList.end()) @@ -258,27 +258,27 @@ const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const } // throw an exception, if it does not exist - QString msg = "Unknown account id '" + id + "'"; + TQString msg = "Unknown account id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -bool MyMoneyDatabaseMgr::isStandardAccount(const QString& id) const +bool MyMoneyDatabaseMgr::isStandardAccount(const TQString& id) const { return id == STD_ACC_LIABILITY || id == STD_ACC_ASSET || id == STD_ACC_EXPENSE || id == STD_ACC_INCOME - || id == STD_ACC_EQUITY; + || id == STD_ACC_ETQUITY; } -void MyMoneyDatabaseMgr::setAccountName(const QString& id, const QString& name) +void MyMoneyDatabaseMgr::setAccountName(const TQString& id, const TQString& name) { if(!isStandardAccount(id)) throw new MYMONEYEXCEPTION("Only standard accounts can be modified using setAccountName()"); if (m_sql) { startTransaction(); - MyMoneyAccount acc = m_sql->fetchAccounts(QString(id), true) [id]; + MyMoneyAccount acc = m_sql->fetchAccounts(TQString(id), true) [id]; acc.setName(name); m_sql->modifyAccount(acc); commitTransaction(); @@ -298,9 +298,9 @@ void MyMoneyDatabaseMgr::addInstitution(MyMoneyInstitution& institution) } } -const QString MyMoneyDatabaseMgr::nextPayeeID(void) +const TQString MyMoneyDatabaseMgr::nextPayeeID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementPayeeId())); id = "P" + id.rightJustify(PAYEE_ID_SIZE, '0'); @@ -308,9 +308,9 @@ const QString MyMoneyDatabaseMgr::nextPayeeID(void) return id; } -const QString MyMoneyDatabaseMgr::nextInstitutionID(void) +const TQString MyMoneyDatabaseMgr::nextInstitutionID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementInstitutionId())); id = "I" + id.rightJustify(INSTITUTION_ID_SIZE, '0'); @@ -318,9 +318,9 @@ const QString MyMoneyDatabaseMgr::nextInstitutionID(void) return id; } -const QString MyMoneyDatabaseMgr::nextAccountID(void) +const TQString MyMoneyDatabaseMgr::nextAccountID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementAccountId())); id = "A" + id.rightJustify(ACCOUNT_ID_SIZE, '0'); @@ -328,9 +328,9 @@ const QString MyMoneyDatabaseMgr::nextAccountID(void) return id; } -const QString MyMoneyDatabaseMgr::nextBudgetID(void) +const TQString MyMoneyDatabaseMgr::nextBudgetID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementBudgetId())); id = "B" + id.rightJustify(BUDGET_ID_SIZE, '0'); @@ -338,9 +338,9 @@ const QString MyMoneyDatabaseMgr::nextBudgetID(void) return id; } -const QString MyMoneyDatabaseMgr::nextReportID(void) +const TQString MyMoneyDatabaseMgr::nextReportID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementReportId())); id = "R" + id.rightJustify(REPORT_ID_SIZE, '0'); @@ -348,9 +348,9 @@ const QString MyMoneyDatabaseMgr::nextReportID(void) return id; } -const QString MyMoneyDatabaseMgr::nextTransactionID(void) +const TQString MyMoneyDatabaseMgr::nextTransactionID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementTransactionId())); id = "T" + id.rightJustify(TRANSACTION_ID_SIZE, '0'); @@ -358,9 +358,9 @@ const QString MyMoneyDatabaseMgr::nextTransactionID(void) return id; } -const QString MyMoneyDatabaseMgr::nextScheduleID(void) +const TQString MyMoneyDatabaseMgr::nextScheduleID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementScheduleId())); id = "SCH" + id.rightJustify(SCHEDULE_ID_SIZE, '0'); @@ -368,9 +368,9 @@ const QString MyMoneyDatabaseMgr::nextScheduleID(void) return id; } -const QString MyMoneyDatabaseMgr::nextSecurityID(void) +const TQString MyMoneyDatabaseMgr::nextSecurityID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementSecurityId())); id = "E" + id.rightJustify(SECURITY_ID_SIZE, '0'); @@ -393,7 +393,7 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b throw new MYMONEYEXCEPTION("invalid post date"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -403,7 +403,7 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b } MyMoneyTransaction newTransaction(nextTransactionID(), transaction); - QString key = newTransaction.uniqueSortKey(); + TQString key = newTransaction.uniqueSortKey(); m_sql->addTransaction(newTransaction); @@ -415,18 +415,18 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b acc.adjustBalance((*it_s)); if(!skipAccountUpdate) { acc.touch(); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); } m_sql->modifyAccount(acc); } } -bool MyMoneyDatabaseMgr::hasActiveSplits(const QString& id) const +bool MyMoneyDatabaseMgr::hasActiveSplits(const TQString& id) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; MyMoneyTransactionFilter f(id); - QMap transactionList = m_sql->fetchTransactions(f); + TQMap transactionList = m_sql->fetchTransactions(f); for(it = transactionList.begin(); it != transactionList.end(); ++it) { if((*it).accountReferenced(id)) { @@ -447,12 +447,12 @@ bool MyMoneyDatabaseMgr::hasActiveSplits(const QString& id) const * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ -//const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& date); +//const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& date); -const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const TQString& id, const TQDate& date) const { - QStringList accounts; - QStringList::ConstIterator it_a; + TQStringList accounts; + TQStringList::ConstIterator it_a; MyMoneyMoney result; //(balance(id, date)); @@ -460,26 +460,26 @@ const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const QString& id, const QDa for (it_a = accounts.begin(); it_a != accounts.end(); ++it_a) { accounts += MyMoneyFile::instance()->account(*it_a).accountList(); } - std::list tempList (accounts.begin(), accounts.end()); + std::list tempList (accounts.begin(), accounts.end()); tempList.sort();; tempList.unique(); - accounts = QStringList(tempList); + accounts = TQStringList(tempList); - QMap balanceMap = m_sql->fetchBalance(accounts, date); - for (QMap::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) { + TQMap balanceMap = m_sql->fetchBalance(accounts, date); + for (TQMap::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) { result += it_b.data(); } return result; } -const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const QString& id) const +const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const TQString& id) const { - QMap::ConstIterator pos; - QMap institutionList = m_sql->fetchInstitutions(QString(id)); + TQMap::ConstIterator pos; + TQMap institutionList = m_sql->fetchInstitutions(TQString(id)); - pos = institutionList.find(id); + pos = institutionList.tqfind(id); if(pos != institutionList.end()) return *pos; throw new MYMONEYEXCEPTION("unknown institution"); @@ -496,35 +496,35 @@ unsigned int MyMoneyDatabaseMgr::accountCount(void) const return m_sql->getRecCount("kmmAccounts"); } -const QValueList MyMoneyDatabaseMgr::institutionList(void) const +const TQValueList MyMoneyDatabaseMgr::institutionList(void) const { if (m_sql) { return m_sql->fetchInstitutions().values(); } else { - return QValueList (); + return TQValueList (); } } void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck) { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the account in the file global pool startTransaction(); - QMap accountList = m_sql->fetchAccounts (QString(account.id()), true); - pos = accountList.find(account.id()); + TQMap accountList = m_sql->fetchAccounts (TQString(account.id()), true); + pos = accountList.tqfind(account.id()); if(pos != accountList.end()) { // check if the new info is based on the old one. // this is the case, when the file and the id // as well as the type are equal. - if(((*pos).parentAccountId() == account.parentAccountId() + if(((*pos).tqparentAccountId() == account.tqparentAccountId() && (*pos).accountType() == account.accountType()) || skipCheck == true) { // make sure that all the referenced objects exist if(!account.institutionId().isEmpty()) institution(account.institutionId()); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) { this->account(*it_a); } @@ -532,8 +532,8 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool // update information in account list //m_accountList.modify(account.id(), account); - // invalidate cached balance -//FIXME: invalidateBalanceCache(account.id()); + // tqinvalidate cached balance +//FIXME: tqinvalidateBalanceCache(account.id()); // mark file as changed m_sql->modifyAccount(account); @@ -551,11 +551,11 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution) { - QMap institutionList = m_sql->fetchInstitutions(QString(institution.id())); - QMap::ConstIterator pos; + TQMap institutionList = m_sql->fetchInstitutions(TQString(institution.id())); + TQMap::ConstIterator pos; // locate the institution in the file global pool - pos = institutionList.find(institution.id()); + pos = institutionList.tqfind(institution.id()); if(pos != institutionList.end()) { m_sql->modifyInstitution(institution); } else @@ -572,7 +572,7 @@ void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution */ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction) { - QMap modifiedAccounts; + TQMap modifiedAccounts; // perform some checks to see that the transaction stuff is OK. For // now we assume that @@ -588,7 +588,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction throw new MYMONEYEXCEPTION("invalid transaction to be modified"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -599,29 +599,29 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction // new data seems to be ok. find old version of transaction // in our pool. Throw exception if unknown. -// if(!m_transactionKeys.contains(transaction.id())) +// if(!m_transactionKeys.tqcontains(transaction.id())) // throw new MYMONEYEXCEPTION("invalid transaction id"); -// QString oldKey = m_transactionKeys[transaction.id()]; - QMap transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')"); +// TQString oldKey = m_transactionKeys[transaction.id()]; + TQMap transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')"); // if(transactionList.size() != 1) // throw new MYMONEYEXCEPTION("invalid transaction key"); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; -// it_t = transactionList.find(oldKey); +// it_t = transactionList.tqfind(oldKey); it_t = transactionList.begin(); if(it_t == transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); // mark all accounts referenced in old and new transaction data // as modified - QMap accountList = m_sql->fetchAccounts(); + TQMap accountList = m_sql->fetchAccounts(); for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = accountList[(*it_s).accountId()]; acc.adjustBalance((*it_s), true); acc.touch(); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); //m_accountList.modify(acc.id(), acc); m_sql->modifyAccount(acc); //modifiedAccounts[(*it_s).accountId()] = true; @@ -630,7 +630,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction MyMoneyAccount acc = accountList[(*it_s).accountId()]; acc.adjustBalance((*it_s)); acc.touch(); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); //m_accountList.modify(acc.id(), acc); m_sql->modifyAccount(acc); //modifiedAccounts[(*it_s).accountId()] = true; @@ -640,7 +640,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction // m_sql->removeTransaction(oldKey); // add new transaction to lists - // QString newKey = transaction.uniqueSortKey(); + // TQString newKey = transaction.uniqueSortKey(); // m_sql->insertTransaction(newKey, transaction); //m_transactionKeys.modify(transaction.id(), newKey); @@ -648,88 +648,88 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction m_sql->modifyTransaction(transaction); } -void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) +void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) { - if(account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment) + if(account.accountType() == MyMoneyAccount::Stock && tqparent.accountType() != MyMoneyAccount::Investment) throw new MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); - QStringList accountIdList; - QMap::ConstIterator oldParent; - QMap::ConstIterator newParent; - QMap::ConstIterator childAccount; + TQStringList accountIdList; + TQMap::ConstIterator oldParent; + TQMap::ConstIterator newParent; + TQMap::ConstIterator childAccount; // verify that accounts exist. If one does not, // an exception is thrown - accountIdList << account.id() << parent.id(); + accountIdList << account.id() << tqparent.id(); MyMoneyDatabaseMgr::account(account.id()); - MyMoneyDatabaseMgr::account(parent.id()); + MyMoneyDatabaseMgr::account(tqparent.id()); - if(!account.parentAccountId().isEmpty()) { - accountIdList << account.parentAccountId(); + if(!account.tqparentAccountId().isEmpty()) { + accountIdList << account.tqparentAccountId(); } startTransaction(); - QMap accountList = m_sql->fetchAccounts(accountIdList, true); + TQMap accountList = m_sql->fetchAccounts(accountIdList, true); - if(!account.parentAccountId().isEmpty()) { - MyMoneyDatabaseMgr::account(account.parentAccountId()); - oldParent = accountList.find(account.parentAccountId()); + if(!account.tqparentAccountId().isEmpty()) { + MyMoneyDatabaseMgr::account(account.tqparentAccountId()); + oldParent = accountList.tqfind(account.tqparentAccountId()); } - newParent = accountList.find(parent.id()); - childAccount = accountList.find(account.id()); + newParent = accountList.tqfind(tqparent.id()); + childAccount = accountList.tqfind(account.id()); MyMoneyAccount acc; - if(!account.parentAccountId().isEmpty()) { + if(!account.tqparentAccountId().isEmpty()) { acc = (*oldParent); acc.removeAccountId(account.id()); m_sql->modifyAccount(acc); } - parent = (*newParent); - parent.addAccountId(account.id()); + tqparent = (*newParent); + tqparent.addAccountId(account.id()); account = (*childAccount); - account.setParentAccountId(parent.id()); + account.setParentAccountId(tqparent.id()); - m_sql->modifyAccount(parent); + m_sql->modifyAccount(tqparent); m_sql->modifyAccount(account); commitTransaction(); } void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction) { - QMap modifiedAccounts; + TQMap modifiedAccounts; // first perform all the checks if(transaction.id().isEmpty()) throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; -// it_k = m_transactionKeys.find(transaction.id()); +// it_k = m_transactionKeys.tqfind(transaction.id()); // if(it_k == m_transactionKeys.end()) // throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - QMap transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')"); -// it_t = transactionList.find(*it_k); + TQMap transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')"); +// it_t = transactionList.tqfind(*it_k); it_t = transactionList.begin(); if(it_t == transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; // scan the splits and collect all accounts that need // to be updated after the removal of this transaction - QMap accountList = m_sql->fetchAccounts(); + TQMap accountList = m_sql->fetchAccounts(); for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = accountList[(*it_s).accountId()]; // modifiedAccounts[(*it_s).accountId()] = true; acc.adjustBalance((*it_s), true); acc.touch(); m_sql->modifyAccount(acc); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); } // FIXME: check if any split is frozen and throw exception @@ -742,20 +742,20 @@ void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction m_sql->removeTransaction(transaction); } -unsigned int MyMoneyDatabaseMgr::transactionCount(const QString& account) const +unsigned int MyMoneyDatabaseMgr::transactionCount(const TQString& account) const { return (m_sql->transactionCount(account)); } -const QMap MyMoneyDatabaseMgr::transactionCountMap(void) const +const TQMap MyMoneyDatabaseMgr::transactionCountMap(void) const { return (m_sql->transactionCountMap()); } -const QValueList MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const +const TQValueList MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const { - QValueList list; + TQValueList list; transactionList(list, filter); return list; } -void MyMoneyDatabaseMgr::transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const +void MyMoneyDatabaseMgr::transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const { list.clear(); @@ -764,22 +764,22 @@ void MyMoneyDatabaseMgr::transactionList(QValueList& list, M PASS } -void MyMoneyDatabaseMgr::transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const +void MyMoneyDatabaseMgr::transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const { list.clear(); - MyMoneyMap transactionList; + MyMoneyMap transactionList; TRY if (m_sql) transactionList = m_sql->fetchTransactions(filter); PASS - QMap::ConstIterator it_t; - QMap::ConstIterator txEnd = transactionList.end(); + TQMap::ConstIterator it_t; + TQMap::ConstIterator txEnd = transactionList.end(); for(it_t = transactionList.begin(); it_t != txEnd; ++it_t) { if(filter.match(*it_t)) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = filter.matchingSplits().begin(); it_s != filter.matchingSplits().end(); ++it_s) { - list.append(qMakePair(*it_t, *it_s)); + list.append(tqMakePair(*it_t, *it_s)); } } } @@ -787,12 +787,12 @@ void MyMoneyDatabaseMgr::transactionList(QValueList accountList = m_sql->fetchAccounts(accountIdList, true); + TQMap accountList = m_sql->fetchAccounts(accountIdList, true); - QMap::ConstIterator it_a; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_a; + TQMap::ConstIterator it_p; // locate the account in the file global pool - it_a = accountList.find(account.id()); + it_a = accountList.tqfind(account.id()); if(it_a == accountList.end()) throw new MYMONEYEXCEPTION("Internal error: account not found in list"); - it_p = accountList.find(parent.id()); + it_p = accountList.tqfind(tqparent.id()); if(it_p == accountList.end()) - throw new MYMONEYEXCEPTION("Internal error: parent account not found in list"); + throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list"); if(!account.institutionId().isEmpty()) throw new MYMONEYEXCEPTION("Cannot remove account still attached to an institution"); @@ -842,25 +842,25 @@ void MyMoneyDatabaseMgr::removeAccount(const MyMoneyAccount& account) if((*it_a).id() == account.id() && (*it_a).accountType() == account.accountType()) { - // second round over sub-ordinate accounts: do re-parenting + // second round over sub-ordinate accounts: do re-tqparenting // but only if the list contains at least one entry // FIXME: move this logic to MyMoneyFile if((*it_a).accountList().count() > 0) { for(it = (*it_a).accountList().begin(); it != (*it_a).accountList().end(); ++it) { MyMoneyAccount acc(MyMoneyDatabaseMgr::account(*it)); - reparentAccount(acc, parent);//, false); + reparentAccount(acc, tqparent);//, false); } } - // remove account from parent's list - parent.removeAccountId(account.id()); - m_sql->modifyAccount(parent); + // remove account from tqparent's list + tqparent.removeAccountId(account.id()); + m_sql->modifyAccount(tqparent); // remove account from the global account pool //m_accountList.remove(account.id()); // remove from balance list //FIXME: m_balanceCache.remove(account.id()); -//FIXME: invalidateBalanceCache(parent.id()); +//FIXME: tqinvalidateBalanceCache(tqparent.id()); m_sql->removeAccount(account); } @@ -869,10 +869,10 @@ void MyMoneyDatabaseMgr::removeAccount(const MyMoneyAccount& account) void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution) { - QMap institutionList = m_sql->fetchInstitutions(QString(institution.id())); - QMap::ConstIterator it_i; + TQMap institutionList = m_sql->fetchInstitutions(TQString(institution.id())); + TQMap::ConstIterator it_i; - it_i = institutionList.find(institution.id()); + it_i = institutionList.tqfind(institution.id()); if(it_i != institutionList.end()) { // mark file as changed m_sql->removeInstitution(institution); @@ -880,31 +880,31 @@ void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution throw new MYMONEYEXCEPTION("invalid institution"); } -const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& id) const +const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& id) const { // get the full key of this transaction, throw exception // if it's invalid (unknown) - //if(!m_transactionKeys.contains(id)) + //if(!m_transactionKeys.tqcontains(id)) // throw new MYMONEYEXCEPTION("invalid transaction id"); // check if this key is in the list, throw exception if not - //QString key = m_transactionKeys[id]; - QMap transactionList = m_sql->fetchTransactions("('" + QString(id) + "')"); + //TQString key = m_transactionKeys[id]; + TQMap transactionList = m_sql->fetchTransactions("('" + TQString(id) + "')"); //there should only be one transaction in the map, if it was found, so check the size of the map //return the first element. - //if(!transactionList.contains(key)) + //if(!transactionList.tqcontains(key)) if(!transactionList.size()) throw new MYMONEYEXCEPTION("invalid transaction key"); return transactionList.begin().data(); } -const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& date) const { - QStringList idList; + TQStringList idList; idList.append(id); - QMap tempMap = m_sql->fetchBalance(idList, date); + TQMap tempMap = m_sql->fetchBalance(idList, date); MyMoneyMoney returnValue = tempMap[id]; if (returnValue != MyMoneyMoney()) { @@ -912,42 +912,42 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d } //DEBUG - QDate date_ (date); - //if (date_ == QDate()) date_ = QDate::currentDate(); + TQDate date_ (date); + //if (date_ == TQDate()) date_ = TQDate::tqcurrentDate(); // END DEBUG MyMoneyMoney result(0); MyMoneyAccount acc; - QMap accountList = m_sql->fetchAccounts(/*QString(id)*/); - //QMap::const_iterator accpos = accountList.find(id); - if (date_ != QDate()) qDebug ("request balance for %s at %s", id.data(), date_.toString(Qt::ISODate).latin1()); + TQMap accountList = m_sql->fetchAccounts(/*TQString(id)*/); + //TQMap::const_iterator accpos = accountList.tqfind(id); + if (date_ != TQDate()) qDebug ("request balance for %s at %s", id.data(), TQString(date_.toString(Qt::ISODate)).latin1()); // if(!date_.isValid() && MyMoneyFile::instance()->account(id).accountType() != MyMoneyAccount::Stock) { -// if(accountList.find(id) != accountList.end()) +// if(accountList.tqfind(id) != accountList.end()) // return accountList[id].balance(); // return MyMoneyMoney(0); // } if(/*m_balanceCache[id].valid == false || date != m_balanceCacheDate) || */ m_sql != 0) { - QMap balances; - QMap::ConstIterator it_b; + TQMap balances; + TQMap::ConstIterator it_b; //FIXME: if (date != m_balanceCacheDate) { //FIXME: m_balanceCache.clear(); //FIXME: m_balanceCacheDate = date; //FIXME: } - QValueList::ConstIterator it_t; - QValueList::ConstIterator txEnd; - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_t; + TQValueList::ConstIterator txEnd; + TQValueList::ConstIterator it_s; MyMoneyTransactionFilter filter; filter.addAccount(id); - filter.setDateFilter(QDate(), date_); + filter.setDateFilter(TQDate(), date_); filter.setReportAllSplits(false); - QValueList list = transactionList(filter); + TQValueList list = transactionList(filter); txEnd = list.end(); for(it_t = list.begin(); it_t != txEnd; ++it_t) { for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s){ - const QString aid = (*it_s).accountId(); + const TQString aid = (*it_s).accountId(); if((*it_s).action() == MyMoneySplit::ActionSplitShares) { balances[aid] = balances[aid] * (*it_s).shares(); } else { @@ -964,7 +964,7 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d // fill all accounts w/o transactions to zero // if (m_sql != 0) { -// QMap::ConstIterator it_a; +// TQMap::ConstIterator it_a; // for(it_a = m_accountList.begin(); it_a != m_accountList.end(); ++it_a) { //FIXME: if(m_balanceCache[(*it_a).id()].valid == false) { //FIXME: MyMoneyBalanceCacheItem balance(MyMoneyMoney(0,1)); @@ -985,13 +985,13 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d return result; } -const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& account, const int idx) const +const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& account, const int idx) const { /* removed with MyMoneyAccount::Transaction - QMap::ConstIterator acc; + TQMap::ConstIterator acc; // find account object in list, throw exception if unknown - acc = m_accountList.find(account); + acc = m_accountList.tqfind(account); if(acc == m_accountList.end()) throw new MYMONEYEXCEPTION("unknown account id"); @@ -1003,9 +1003,9 @@ const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& account, */ // new implementation if the above code does not work anymore - QValueList list; + TQValueList list; //MyMoneyAccount acc = m_accountList[account]; - MyMoneyAccount acc = m_sql->fetchAccounts(QString(account)) [account]; + MyMoneyAccount acc = m_sql->fetchAccounts(TQString(account)) [account]; MyMoneyTransactionFilter filter; if(acc.accountGroup() == MyMoneyAccount::Income @@ -1026,12 +1026,12 @@ unsigned int MyMoneyDatabaseMgr::institutionCount(void) const return m_sql->getRecCount("kmmInstitutions"); } -void MyMoneyDatabaseMgr::accountList(QValueList& list) const +void MyMoneyDatabaseMgr::accountList(TQValueList& list) const { - QMap accountList; + TQMap accountList; if (m_sql) accountList = m_sql->fetchAccounts(); - QMap::ConstIterator it; - QMap::ConstIterator accEnd = accountList.end(); + TQMap::ConstIterator it; + TQMap::ConstIterator accEnd = accountList.end(); for(it = accountList.begin(); it != accEnd; ++it) { if(!isStandardAccount((*it).id())) { list.append(*it); @@ -1052,7 +1052,7 @@ const MyMoneyAccount MyMoneyDatabaseMgr::income(void) const { return MyMoneyFile::instance()->account(STD_ACC_INCOME); } const MyMoneyAccount MyMoneyDatabaseMgr::equity(void) const -{ return MyMoneyFile::instance()->account(STD_ACC_EQUITY); } +{ return MyMoneyFile::instance()->account(STD_ACC_ETQUITY); } void MyMoneyDatabaseMgr::addSecurity(MyMoneySecurity& security) { @@ -1065,13 +1065,13 @@ void MyMoneyDatabaseMgr::addSecurity(MyMoneySecurity& security) void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security) { - QMap securitiesList = m_sql->fetchSecurities(QString(security.id()), true); - QMap::ConstIterator it; + TQMap securitiesList = m_sql->fetchSecurities(TQString(security.id()), true); + TQMap::ConstIterator it; - it = securitiesList.find(security.id()); + it = securitiesList.tqfind(security.id()); if(it == securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during modifySecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1081,15 +1081,15 @@ void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security) void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security) { - QMap securitiesList = m_sql->fetchSecurities(QString(security.id())); - QMap::ConstIterator it; + TQMap securitiesList = m_sql->fetchSecurities(TQString(security.id())); + TQMap::ConstIterator it; // FIXME: check referential integrity - it = securitiesList.find(security.id()); + it = securitiesList.tqfind(security.id()); if(it == securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during removeSecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1097,10 +1097,10 @@ void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security) m_sql->removeSecurity(security); } -const MyMoneySecurity MyMoneyDatabaseMgr::security(const QString& id) const +const MyMoneySecurity MyMoneyDatabaseMgr::security(const TQString& id) const { - QMap securitiesList = m_sql->fetchSecurities(QString(id)); - QMap::ConstIterator it = securitiesList.find(id); + TQMap securitiesList = m_sql->fetchSecurities(TQString(id)); + TQMap::ConstIterator it = securitiesList.tqfind(id); if(it != securitiesList.end()) { return it.data(); @@ -1109,15 +1109,15 @@ const MyMoneySecurity MyMoneyDatabaseMgr::security(const QString& id) const return MyMoneySecurity(); } -const QValueList MyMoneyDatabaseMgr::securityList(void) const +const TQValueList MyMoneyDatabaseMgr::securityList(void) const { return m_sql->fetchSecurities().values(); } void MyMoneyDatabaseMgr::addPrice(const MyMoneyPrice& price) { MyMoneyPriceEntries::ConstIterator it; MyMoneyPriceList priceList = m_sql->fetchPrices(); - it = priceList[MyMoneySecurityPair(price.from(), price.to())].find(price.date()); - // do not replace, if the information did not change. + it = priceList[MyMoneySecurityPair(price.from(), price.to())].tqfind(price.date()); + // do not tqreplace, if the information did not change. if(it != priceList[MyMoneySecurityPair(price.from(), price.to())].end()) { if((*it).rate((*it).to()) == price.rate(price.to()) && (*it).source() == price.source()) @@ -1132,7 +1132,7 @@ void MyMoneyDatabaseMgr::removePrice(const MyMoneyPrice& price) m_sql->removePrice(price); } -const MyMoneyPrice MyMoneyDatabaseMgr::price(const QString& fromId, const QString& toId, const QDate& _date, const bool exactDate) const +const MyMoneyPrice MyMoneyDatabaseMgr::price(const TQString& fromId, const TQString& toId, const TQDate& _date, const bool exactDate) const { return m_sql->fetchSinglePrice(fromId, toId, _date, exactDate); } @@ -1160,12 +1160,12 @@ void MyMoneyDatabaseMgr::addSchedule(MyMoneySchedule& sched) void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched) { - QMap scheduleList = m_sql->fetchSchedules(QString(sched.id())); - QMap::ConstIterator it; + TQMap scheduleList = m_sql->fetchSchedules(TQString(sched.id())); + TQMap::ConstIterator it; - it = scheduleList.find(sched.id()); + it = scheduleList.tqfind(sched.id()); if(it == scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1174,12 +1174,12 @@ void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched) void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched) { - QMap scheduleList = m_sql->fetchSchedules(QString(sched.id())); - QMap::ConstIterator it; + TQMap scheduleList = m_sql->fetchSchedules(TQString(sched.id())); + TQMap::ConstIterator it; - it = scheduleList.find(sched.id()); + it = scheduleList.tqfind(sched.id()); if(it == scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1188,33 +1188,33 @@ void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched) m_sql->removeSchedule(sched); } -const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const QString& id) const +const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const TQString& id) const { - QMap scheduleList = m_sql->fetchSchedules(QString(id)); - QMap::ConstIterator pos; + TQMap scheduleList = m_sql->fetchSchedules(TQString(id)); + TQMap::ConstIterator pos; // locate the schedule and if present, return it's data - pos = scheduleList.find(id); + pos = scheduleList.tqfind(id); if(pos != scheduleList.end()) return (*pos); // throw an exception, if it does not exist - QString msg = "Unknown schedule id '" + id + "'"; + TQString msg = "Unknown schedule id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -const QValueList MyMoneyDatabaseMgr::scheduleList(const QString& accountId, +const TQValueList MyMoneyDatabaseMgr::scheduleList(const TQString& accountId, const MyMoneySchedule::typeE type, const MyMoneySchedule::occurenceE occurence, const MyMoneySchedule::paymentTypeE paymentType, - const QDate& startDate, - const QDate& endDate, + const TQDate& startDate, + const TQDate& endDate, const bool overdue) const { - QMap scheduleList; + TQMap scheduleList; if (m_sql) scheduleList = m_sql->fetchSchedules(); - QMap::ConstIterator pos; - QValueList list; + TQMap::ConstIterator pos; + TQValueList list; // qDebug("scheduleList()"); @@ -1241,8 +1241,8 @@ const QValueList MyMoneyDatabaseMgr::scheduleList(const QString if(!accountId.isEmpty()) { MyMoneyTransaction t = (*pos).transaction(); - QValueList::ConstIterator it; - QValueList splits; + TQValueList::ConstIterator it; + TQValueList splits; splits = t.splits(); for(it = splits.begin(); it != splits.end(); ++it) { if((*it).accountId() == accountId) @@ -1275,10 +1275,10 @@ const QValueList MyMoneyDatabaseMgr::scheduleList(const QString if (!(*pos).isOverdue()) continue; /* - QDate nextPayment = (*pos).nextPayment((*pos).lastPayment()); + TQDate nextPayment = (*pos).nextPayment((*pos).lastPayment()); if(!nextPayment.isValid()) continue; - if(nextPayment >= QDate::currentDate()) + if(nextPayment >= TQDate::tqcurrentDate()) continue; */ } @@ -1289,16 +1289,16 @@ const QValueList MyMoneyDatabaseMgr::scheduleList(const QString return list; } -const QValueList MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes, +const TQValueList MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts) const + TQDate startDate, + const TQStringList& accounts) const { // qDebug("scheduleListEx"); - QMap scheduleList = m_sql->fetchSchedules(); - QMap::ConstIterator pos; - QValueList list; + TQMap scheduleList = m_sql->fetchSchedules(); + TQMap::ConstIterator pos; + TQValueList list; if (!startDate.isValid()) return list; @@ -1325,7 +1325,7 @@ const QValueList MyMoneyDatabaseMgr::scheduleListEx( int schedu if (accounts.count() > 0) { - if (accounts.contains((*pos).account().id())) + if (accounts.tqcontains((*pos).account().id())) continue; } @@ -1339,12 +1339,12 @@ const QValueList MyMoneyDatabaseMgr::scheduleListEx( int schedu void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency) { if (m_sql) { - QMap currencyList = m_sql->fetchCurrencies(QString(currency.id())); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(currency.id())); + TQMap::ConstIterator it; - it = currencyList.find(currency.id()); + it = currencyList.tqfind(currency.id()); if(it != currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot add currency with existing id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id())); } m_sql->addCurrency(currency); @@ -1353,12 +1353,12 @@ void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency) void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency) { - QMap currencyList = m_sql->fetchCurrencies(QString(currency.id())); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(currency.id())); + TQMap::ConstIterator it; - it = currencyList.find(currency.id()); + it = currencyList.tqfind(currency.id()); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot modify currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id())); } m_sql->modifyCurrency(currency); @@ -1366,50 +1366,50 @@ void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency) void MyMoneyDatabaseMgr::removeCurrency(const MyMoneySecurity& currency) { - QMap currencyList = m_sql->fetchCurrencies(QString(currency.id())); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(currency.id())); + TQMap::ConstIterator it; // FIXME: check referential integrity - it = currencyList.find(currency.id()); + it = currencyList.tqfind(currency.id()); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot remove currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id())); } m_sql->removeCurrency(currency); } -const MyMoneySecurity MyMoneyDatabaseMgr::currency(const QString& id) const +const MyMoneySecurity MyMoneyDatabaseMgr::currency(const TQString& id) const { if(id.isEmpty()) { } - QMap currencyList = m_sql->fetchCurrencies(QString(id)); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(id)); + TQMap::ConstIterator it; - it = currencyList.find(id); + it = currencyList.tqfind(id); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot retrieve currency with unknown id '%1'").arg(id.data())); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); } return *it; } -const QValueList MyMoneyDatabaseMgr::currencyList(void) const +const TQValueList MyMoneyDatabaseMgr::currencyList(void) const { if (m_sql) { return m_sql->fetchCurrencies().values(); } else { - return QValueList (); + return TQValueList (); } } -const QValueList MyMoneyDatabaseMgr::reportList( void ) const +const TQValueList MyMoneyDatabaseMgr::reportList( void ) const { if (m_sql) { return m_sql->fetchReports().values(); } else { - return QValueList (); + return TQValueList (); } } @@ -1426,12 +1426,12 @@ void MyMoneyDatabaseMgr::addReport( MyMoneyReport& report ) void MyMoneyDatabaseMgr::modifyReport( const MyMoneyReport& report ) { - QMap reportList = m_sql->fetchReports(QString(report.id())); - QMap::ConstIterator it; + TQMap reportList = m_sql->fetchReports(TQString(report.id())); + TQMap::ConstIterator it; - it = reportList.find(report.id()); + it = reportList.tqfind(report.id()); if(it == reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1443,26 +1443,26 @@ unsigned MyMoneyDatabaseMgr::countReports( void ) const return m_sql->getRecCount("kmmReports"); } -const MyMoneyReport MyMoneyDatabaseMgr::report( const QString& id ) const +const MyMoneyReport MyMoneyDatabaseMgr::report( const TQString& id ) const { - return m_sql->fetchReports(QString(id))[id]; + return m_sql->fetchReports(TQString(id))[id]; } void MyMoneyDatabaseMgr::removeReport(const MyMoneyReport& report) { - QMap reportList = m_sql->fetchReports(QString(report.id())); - QMap::ConstIterator it; + TQMap reportList = m_sql->fetchReports(TQString(report.id())); + TQMap::ConstIterator it; - it = reportList.find(report.id()); + it = reportList.tqfind(report.id()); if(it == reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_sql->removeReport(report); } -const QValueList MyMoneyDatabaseMgr::budgetList( void ) const +const TQValueList MyMoneyDatabaseMgr::budgetList( void ) const { return m_sql->fetchBudgets().values(); } @@ -1473,10 +1473,10 @@ void MyMoneyDatabaseMgr::addBudget( MyMoneyBudget& budget ) m_sql->addBudget(newBudget); } -const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const QString& budget) const +const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const TQString& budget) const { - QMap budgets = m_sql->fetchBudgets(); - QMap::ConstIterator it_p; + TQMap budgets = m_sql->fetchBudgets(); + TQMap::ConstIterator it_p; for(it_p = budgets.begin(); it_p != budgets.end(); ++it_p) { if((*it_p).name() == budget) { @@ -1489,18 +1489,18 @@ const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const QString& budget) cons void MyMoneyDatabaseMgr::modifyBudget( const MyMoneyBudget& budget ) { - //QMap::ConstIterator it; + //TQMap::ConstIterator it; - //it = m_budgetList.find(budget.id()); + //it = m_budgetList.tqfind(budget.id()); //if(it == m_budgetList.end()) { - // QString msg = "Unknown budget '" + budget.id() + "'"; + // TQString msg = "Unknown budget '" + budget.id() + "'"; // throw new MYMONEYEXCEPTION(msg); //} //m_budgetList.modify(budget.id(), budget); startTransaction(); - if (m_sql->fetchBudgets(QString(budget.id()), true).empty()) { - QString msg = "Unknown budget '" + budget.id() + "'"; + if (m_sql->fetchBudgets(TQString(budget.id()), true).empty()) { + TQString msg = "Unknown budget '" + budget.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_sql->modifyBudget(budget); @@ -1512,18 +1512,18 @@ unsigned MyMoneyDatabaseMgr::countBudgets( void ) const return m_sql->getRecCount("kmmBudgetConfig"); } -MyMoneyBudget MyMoneyDatabaseMgr::budget( const QString& id ) const +MyMoneyBudget MyMoneyDatabaseMgr::budget( const TQString& id ) const { - return m_sql->fetchBudgets(QString(id)) [id]; + return m_sql->fetchBudgets(TQString(id)) [id]; } void MyMoneyDatabaseMgr::removeBudget(const MyMoneyBudget& budget) { -// QMap::ConstIterator it; +// TQMap::ConstIterator it; // -// it = m_budgetList.find(budget.id()); +// it = m_budgetList.tqfind(budget.id()); // if(it == m_budgetList.end()) { -// QString msg = "Unknown budget '" + budget.id() + "'"; +// TQString msg = "Unknown budget '" + budget.id() + "'"; // throw new MYMONEYEXCEPTION(msg); // } // @@ -1537,7 +1537,7 @@ void MyMoneyDatabaseMgr::clearCache(void) class isReferencedHelper { public: - isReferencedHelper(const QString& id) + isReferencedHelper(const TQString& id) : m_id (id) {} @@ -1545,13 +1545,13 @@ class isReferencedHelper { { return obj.hasReferenceTo(m_id); } private: - QString m_id; + TQString m_id; }; bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFileBitArray& skipCheck) const { bool rc = false; - const QString& id = obj.id(); + const TQString& id = obj.id(); MyMoneyPriceList::const_iterator it_pr; @@ -1578,7 +1578,7 @@ bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFil skipTransactions = true; } if (! skipTransactions) { - //QMap transactionList = m_sql->fetchTransactions(f); + //TQMap transactionList = m_sql->fetchTransactions(f); //rc = (transactionList.end() != std::find_if(transactionList.begin(), transactionList.end(), isReferencedHelper(id))); //if (rc != m_sql->isReferencedByTransaction(obj.id())) // qDebug ("Transaction match inconsistency."); @@ -1587,40 +1587,40 @@ bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFil } if(!skipCheck[RefCheckAccount] && !rc) { - QValueList accountList; + TQValueList accountList; MyMoneyFile::instance()->accountList(accountList); rc = (accountList.end() != std::find_if(accountList.begin(), accountList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckInstitution] && !rc) { - QValueList institutionList; + TQValueList institutionList; MyMoneyFile::instance()->institutionList(institutionList); rc = (institutionList.end() != std::find_if(institutionList.begin(), institutionList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckPayee] && !rc) { - QValueList payeeList = MyMoneyFile::instance()->payeeList(); + TQValueList payeeList = MyMoneyFile::instance()->payeeList(); rc = (payeeList.end() != std::find_if(payeeList.begin(), payeeList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckReport] && !rc) { - QMap reportList = m_sql->fetchReports(); + TQMap reportList = m_sql->fetchReports(); rc = (reportList.end() != std::find_if(reportList.begin(), reportList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckBudget] && !rc) { - QMap budgets = m_sql->fetchBudgets(); + TQMap budgets = m_sql->fetchBudgets(); rc = (budgets.end() != std::find_if(budgets.begin(), budgets.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckSchedule] && !rc) { - QMap scheduleList = m_sql->fetchSchedules(); + TQMap scheduleList = m_sql->fetchSchedules(); rc = (scheduleList.end() != std::find_if(scheduleList.begin(), scheduleList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckSecurity] && !rc) { - QValueList securitiesList = MyMoneyFile::instance()->securityList(); + TQValueList securitiesList = MyMoneyFile::instance()->securityList(); rc = (securitiesList.end() != std::find_if(securitiesList.begin(), securitiesList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckCurrency] && !rc) { - QValueList currencyList = m_sql->fetchCurrencies().values(); + TQValueList currencyList = m_sql->fetchCurrencies().values(); rc = (currencyList.end() != std::find_if(currencyList.begin(), currencyList.end(), isReferencedHelper(id))); } - // within the pricelist we don't have to scan each entry. Checking the QPair + // within the pricelist we don't have to scan each entry. Checking the TQPair // members of the MyMoneySecurityPair is enough as they are identical to the // two security ids if(!skipCheck[RefCheckPrice] && !rc) { @@ -1653,7 +1653,7 @@ bool MyMoneyDatabaseMgr::commitTransaction(void) void MyMoneyDatabaseMgr::rollbackTransaction(void) { if (m_sql) m_sql->cancelCommitUnit ("databasetransaction"); } -void MyMoneyDatabaseMgr::setCreationDate(const QDate& val) +void MyMoneyDatabaseMgr::setCreationDate(const TQDate& val) { m_creationDate = val; } KSharedPtr MyMoneyDatabaseMgr::connectToDatabase(const KURL& url) { @@ -1664,17 +1664,17 @@ KSharedPtr MyMoneyDatabaseMgr::connectToDatabase(const KURL& void MyMoneyDatabaseMgr::fillStorage() { m_sql->fillStorage(); } -void MyMoneyDatabaseMgr::setLastModificationDate(const QDate& val) +void MyMoneyDatabaseMgr::setLastModificationDate(const TQDate& val) { m_lastModificationDate = val; } -bool MyMoneyDatabaseMgr::isDuplicateTransaction(const QString& /*id*/) const +bool MyMoneyDatabaseMgr::isDuplicateTransaction(const TQString& /*id*/) const { //FIXME: figure out the real id from the key and check the DB. -//return m_transactionKeys.contains(id); +//return m_transactionKeys.tqcontains(id); return false; } -void MyMoneyDatabaseMgr::loadAccounts(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadAccounts(const TQMap& /*map*/) { // m_accountList = map; //FIXME: update the database. @@ -1686,50 +1686,50 @@ void MyMoneyDatabaseMgr::loadAccounts(const QMap& /*map // on error, rollbackTransaction } -void MyMoneyDatabaseMgr::loadTransactions(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadTransactions(const TQMap& /*map*/) { // m_transactionList = map; //FIXME: update the database. // // now fill the key map -// QMap keys; -// QMap::ConstIterator it_t; +// TQMap keys; +// TQMap::ConstIterator it_t; // for(it_t = map.begin(); it_t != map.end(); ++it_t) { // keys[(*it_t).id()] = it_t.key(); // } // m_transactionKeys = keys; } -void MyMoneyDatabaseMgr::loadInstitutions(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadInstitutions(const TQMap& /*map*/) { // m_institutionList = map; //FIXME: update the database. // // now fill the key map -// QMap keys; -// QMap::ConstIterator it_t; +// TQMap keys; +// TQMap::ConstIterator it_t; // for(it_t = map.begin(); it_t != map.end(); ++it_t) { // keys[(*it_t).id()] = it_t.key(); // } // m_transactionKeys = keys; } -void MyMoneyDatabaseMgr::loadPayees(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadPayees(const TQMap& /*map*/) { // m_payeeList = map; } -void MyMoneyDatabaseMgr::loadSchedules(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadSchedules(const TQMap& /*map*/) { // m_scheduleList = map; } -void MyMoneyDatabaseMgr::loadSecurities(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadSecurities(const TQMap& /*map*/) { // m_securitiesList = map; } -void MyMoneyDatabaseMgr::loadCurrencies(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadCurrencies(const TQMap& /*map*/) { // m_currencyList = map; //FIXME: update the database. @@ -1741,7 +1741,7 @@ void MyMoneyDatabaseMgr::loadCurrencies(const QMap& /* // on error, rollbackTransaction } -void MyMoneyDatabaseMgr::loadReports( const QMap& /*reports*/ ) +void MyMoneyDatabaseMgr::loadReports( const TQMap& /*reports*/ ) { // m_reportList = reports; //FIXME: update the database. @@ -1753,7 +1753,7 @@ void MyMoneyDatabaseMgr::loadReports( const QMap& /*repo // on error, rollbackTransaction } -void MyMoneyDatabaseMgr::loadBudgets( const QMap& /*budgets*/ ) +void MyMoneyDatabaseMgr::loadBudgets( const TQMap& /*budgets*/ ) { // m_budgetList = budgets; //FIXME: update the database. @@ -1837,29 +1837,29 @@ void MyMoneyDatabaseMgr::loadBudgetId(const unsigned long id) void MyMoneyDatabaseMgr::rebuildAccountBalances(void) { startTransaction(); - QMap accountMap = m_sql->fetchAccounts(QStringList(), true); + TQMap accountMap = m_sql->fetchAccounts(TQStringList(), true); - QMap balanceMap = m_sql->fetchBalance(accountMap.keys(), QDate()); + TQMap balanceMap = m_sql->fetchBalance(accountMap.keys(), TQDate()); - for (QMap::const_iterator it_b = balanceMap.begin(); + for (TQMap::const_iterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) { accountMap[it_b.key()].setBalance(it_b.data()); } - for (QMap::const_iterator it_a = accountMap.begin(); + for (TQMap::const_iterator it_a = accountMap.begin(); it_a != accountMap.end(); ++it_a) { m_sql->modifyAccount(it_a.data()); } commitTransaction(); } -void MyMoneyDatabaseMgr::removeReferences(const QString& id) +void MyMoneyDatabaseMgr::removeReferences(const TQString& id) { - QMap::const_iterator it_r; - QMap::const_iterator it_b; + TQMap::const_iterator it_r; + TQMap::const_iterator it_b; // remove from reports - QMap reportList = m_sql->fetchReports(); + TQMap reportList = m_sql->fetchReports(); for(it_r = reportList.begin(); it_r != reportList.end(); ++it_r) { MyMoneyReport r = *it_r; r.removeReference(id); @@ -1867,7 +1867,7 @@ void MyMoneyDatabaseMgr::removeReferences(const QString& id) } // remove from budgets - QMap budgetList = m_sql->fetchBudgets(); + TQMap budgetList = m_sql->fetchBudgets(); for(it_b = budgetList.begin(); it_b != budgetList.end(); ++it_b) { MyMoneyBudget b = *it_b; b.removeReference(id); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.h b/kmymoney2/mymoney/storage/mymoneydatabasemgr.h index 21bf8d6..1511915 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.h +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.h @@ -50,8 +50,8 @@ public: // general get functions virtual const MyMoneyPayee user(void) const; - virtual const QDate creationDate(void) const; - virtual const QDate lastModificationDate(void) const; + virtual const TQDate creationDate(void) const; + virtual const TQDate lastModificationDate(void) const; virtual unsigned int currentFixVersion(void) const; virtual unsigned int fileFixVersion(void) const; @@ -60,9 +60,9 @@ public: virtual void setFileFixVersion(const unsigned int v); // methods provided by MyMoneyKeyValueContainer - virtual void setValue(const QString& key, const QString& value); - virtual const QString value(const QString& key) const; - virtual void deletePair(const QString& key); + virtual void setValue(const TQString& key, const TQString& value); + virtual const TQString value(const TQString& key) const; + virtual void deletePair(const TQString& key); /** * This method is used to duplicate an IMyMoneyStorage object and return @@ -82,15 +82,15 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account); + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account); /** * This method is used to create a new payee @@ -105,22 +105,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payee(const QString& id) const; + virtual const MyMoneyPayee payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payeeByName(const QString& payee) const; + virtual const MyMoneyPayee payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -144,9 +144,9 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - virtual const QValueList payeeList(void) const; + virtual const TQValueList payeeList(void) const; /** * Returns the account addressed by it's id. @@ -157,7 +157,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - virtual const MyMoneyAccount account(const QString& id) const; + virtual const MyMoneyAccount account(const TQString& id) const; /** * This method is used to check whether a given @@ -168,23 +168,23 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - virtual bool isStandardAccount(const QString& id) const; + virtual bool isStandardAccount(const TQString& id) const; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - virtual void setAccountName(const QString& id, const QString& name); + virtual void setAccountName(const TQString& id, const TQString& name); /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -196,7 +196,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * QString with the object. + * TQString with the object. * * An exception will be thrown upon error conditions. * @@ -216,7 +216,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - virtual bool hasActiveSplits(const QString& id) const; + virtual bool hasActiveSplits(const TQString& id) const; /** * This method is used to return the actual balance of an account @@ -229,7 +229,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney balance(const QString& id, const QDate& date) const; + virtual const MyMoneyMoney balance(const TQString& id, const TQDate& date) const; /** * This method is used to return the actual balance of an account @@ -242,7 +242,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney totalBalance(const QString& id, const QDate& date) const; + virtual const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date) const; /** * Returns the institution of a given ID @@ -251,7 +251,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - virtual const MyMoneyInstitution institution(const QString& id) const; + virtual const MyMoneyInstitution institution(const TQString& id) const; /** * This method returns an indicator if the storage object has been @@ -284,10 +284,10 @@ public: * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QValueList containing the + * @return TQValueList containing the * institution information */ - virtual const QValueList institutionList(void) const; + virtual const TQValueList institutionList(void) const; /** * Modifies an already existing account in the file global account pool. @@ -320,14 +320,14 @@ public: virtual void modifyTransaction(const MyMoneyTransaction& transaction); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * This method is used to remove a transaction from the transaction @@ -343,25 +343,25 @@ public: * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - virtual unsigned int transactionCount(const QString& account = QString()) const; + virtual unsigned int transactionCount(const TQString& account = TQString()) const; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - virtual const QMap transactionCountMap(void) const; + virtual const TQMap transactionCountMap(void) const; /** * This method is used to pull a list of transactions from the file @@ -374,9 +374,9 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - virtual const QValueList transactionList(MyMoneyTransactionFilter& filter) const; + virtual const TQValueList transactionList(MyMoneyTransactionFilter& filter) const; /** * This method is the same as above, but instead of a return value, a @@ -386,7 +386,7 @@ public: * be cleared before filling with results. * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const; + virtual void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const; /** * This method is the same as above, but the list contains pairs of @@ -396,7 +396,7 @@ public: * be cleared before filling with results. * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const; + virtual void transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const; /** * Deletes an existing account from the file global account pool @@ -425,20 +425,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return the requested transaction */ - virtual const MyMoneyTransaction transaction(const QString& id) const; + virtual const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return MyMoneyTransaction object */ - virtual const MyMoneyTransaction transaction(const QString& account, const int idx) const; + virtual const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method returns the number of institutions currently known to file @@ -451,11 +451,11 @@ public: /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList& list) const; + virtual void accountList(TQValueList& list) const; /** * This method is used to return the standard liability account @@ -524,22 +524,22 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - virtual const MyMoneySecurity security(const QString& id) const; + virtual const MyMoneySecurity security(const TQString& id) const; /** * This method returns a list of the security objects * inside a MyMoneyStorage object * - * @return QValueList containing objects + * @return TQValueList containing objects */ - virtual const QValueList securityList(void) const; + virtual const TQValueList securityList(void) const; virtual void addPrice(const MyMoneyPrice& price); virtual void removePrice(const MyMoneyPrice& price); - virtual const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const; + virtual const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; /** * This method returns a list of all prices. @@ -586,10 +586,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - virtual const MyMoneySchedule schedule(const QString& id) const; + virtual const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to extract a list of scheduled transactions @@ -597,7 +597,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -609,27 +609,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - virtual const QValueList scheduleList(const QString& accountId = QString(), + virtual const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - virtual const QValueList scheduleListEx( int scheduleTypes, + virtual const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to add a new currency object to the engine. @@ -668,10 +668,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneyCurrency object */ - virtual const MyMoneySecurity currency(const QString& id) const; + virtual const MyMoneySecurity currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -679,9 +679,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList currencyList(void) const; + virtual const TQValueList currencyList(void) const; /** * This method is used to retrieve the list of all reports @@ -689,9 +689,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList reportList( void ) const; + virtual const TQValueList reportList( void ) const; /** * This method is used to add a new report to the engine. @@ -729,10 +729,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - virtual const MyMoneyReport report( const QString& id ) const; + virtual const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -750,9 +750,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList budgetList( void ) const; + virtual const TQValueList budgetList( void ) const; /** * This method is used to add a new budget to the engine. @@ -771,11 +771,11 @@ public: * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget object of budget */ - virtual const MyMoneyBudget budgetByName(const QString& budget) const; + virtual const MyMoneyBudget budgetByName(const TQString& budget) const; /** * This method is used to modify an existing MyMoneyBudget @@ -801,10 +801,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - virtual MyMoneyBudget budget( const QString& id ) const; + virtual MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -849,7 +849,7 @@ public: virtual void rollbackTransaction(void); // general set functions - virtual void setCreationDate(const QDate& val); + virtual void setCreationDate(const TQDate& val); /** * This method is used to get a SQL reader for subsequent database access @@ -869,25 +869,25 @@ public: * therefor be called as last operation when loading from a * file. * - * @param val QDate of last modification + * @param val TQDate of last modification */ - virtual void setLastModificationDate(const QDate& val); + virtual void setLastModificationDate(const TQDate& val); /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - virtual bool isDuplicateTransaction(const QString&) const; - - virtual void loadAccounts(const QMap& map); - virtual void loadTransactions(const QMap& map); - virtual void loadInstitutions(const QMap& map); - virtual void loadPayees(const QMap& map); - virtual void loadSchedules(const QMap& map); - virtual void loadSecurities(const QMap& map); - virtual void loadCurrencies(const QMap& map); - virtual void loadReports( const QMap& reports ); - virtual void loadBudgets( const QMap& budgets ); + virtual bool isDuplicateTransaction(const TQString&) const; + + virtual void loadAccounts(const TQMap& map); + virtual void loadTransactions(const TQMap& map); + virtual void loadInstitutions(const TQMap& map); + virtual void loadPayees(const TQMap& map); + virtual void loadSchedules(const TQMap& map); + virtual void loadSecurities(const TQMap& map); + virtual void loadCurrencies(const TQMap& map); + virtual void loadReports( const TQMap& reports ); + virtual void loadBudgets( const TQMap& budgets ); virtual void loadPrices(const MyMoneyPriceList& list); virtual unsigned long accountId(void) const; @@ -913,10 +913,10 @@ public: * from the container. It is meant to be used for permanent storage * functionality. See MyMoneyKeyValueContainer::pairs() for details. * - * @return QMap containing all key/value pairs of + * @return TQMap containing all key/value pairs of * this container. */ - virtual const QMap pairs(void) const; + virtual const TQMap pairs(void) const; /** * This method is used to initially store a set of key/value pairs @@ -924,12 +924,12 @@ public: * from permanent storage. See MyMoneyKeyValueContainer::setPairs() * for details * - * @param list const QMap containing the set of + * @param list const TQMap containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - virtual void setPairs(const QMap& list); + virtual void setPairs(const TQMap& list); /** * This method recalculates the balances of all accounts @@ -943,7 +943,7 @@ private: * object. It is set during the constructor and can only be modified using * the stream read operator. */ - QDate m_creationDate; + TQDate m_creationDate; /** * This member variable contains the current fix level of application @@ -961,7 +961,7 @@ private: * This member variable keeps the date of the last modification of * the MyMoneySeqAccessMgr object. */ - QDate m_lastModificationDate; + TQDate m_lastModificationDate; /** * This contains the interface with SQL reader for database access @@ -978,47 +978,47 @@ private: * This method is used to get the next valid ID for a institution * @return id for a institution */ - const QString nextInstitutionID(void); + const TQString nextInstitutionID(void); /** * This method is used to get the next valid ID for an account * @return id for an account */ - const QString nextAccountID(void); + const TQString nextAccountID(void); /** * This method is used to get the next valid ID for a transaction * @return id for a transaction */ - const QString nextTransactionID(void); + const TQString nextTransactionID(void); /** * This method is used to get the next valid ID for a payee * @return id for a payee */ - const QString nextPayeeID(void); + const TQString nextPayeeID(void); /** * This method is used to get the next valid ID for a scheduled transaction * @return id for a scheduled transaction */ - const QString nextScheduleID(void); + const TQString nextScheduleID(void); /** * This method is used to get the next valid ID for an security object. * @return id for an security object */ - const QString nextSecurityID(void); + const TQString nextSecurityID(void); - const QString nextReportID(void); + const TQString nextReportID(void); /** * This method is used to get the next valid ID for a budget object. * @return id for an budget object */ - const QString nextBudgetID(void); + const TQString nextBudgetID(void); - void removeReferences(const QString& id); + void removeReferences(const TQString& id); static const int INSTITUTION_ID_SIZE = 6; static const int ACCOUNT_ID_SIZE = 6; diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp index f6a2bba..ae589cd 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp @@ -60,7 +60,7 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->nextReportID() == 0); CPPUNIT_ASSERT(m->institutionList().count() == 0); - QValueList accList; + TQValueList accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 0); @@ -70,31 +70,31 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->payeeList().count() == 0); CPPUNIT_ASSERT(m->scheduleList().count() == 0); - CPPUNIT_ASSERT(m->m_creationDate == QDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); } void MyMoneyDatabaseMgrTest::testCreateDb() { m->commitTransaction(); // Fetch the list of available drivers - QStringList list = QSqlDatabase::drivers(); - QStringList::Iterator it = list.begin(); + TQStringList list = TQSqlDatabase::drivers(); + TQStringList::Iterator it = list.begin(); if (it == list.end()) { m_canOpen = false; } else { struct passwd * pwd = getpwuid(geteuid()); - QString userName; + TQString userName; if (pwd != 0) { - userName = QString(pwd->pw_name); + userName = TQString(pwd->pw_name); } - //"QMYSQL3" - //"QPSQL7" - //"QSQLITE3" + //"TQMYSQL3" + //"TQPSQL7" + //"TQSQLITE3" m_url = "sql://" + userName + "@localhost/kmm_test_driver?driver=" - //"QPSQL7&mode=single"; - //"QSQLITE3&mode=single"; - //"QMYSQL3&mode=single"; + //"TQPSQL7&mode=single"; + //"TQSQLITE3&mode=single"; + //"TQMYSQL3&mode=single"; + *it + "&mode=single"; KSharedPtr sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(0 != sql); @@ -118,8 +118,8 @@ void MyMoneyDatabaseMgrTest::testAttachDb() { MyMoneyFile::instance()->detachStorage(); KSharedPtr sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(sql); - int openStatus = sql->open(m_url, IO_ReadWrite); - CPPUNIT_ASSERT(0 == openStatus); + int opentqStatus = sql->open(m_url, IO_ReadWrite); + CPPUNIT_ASSERT(0 == opentqStatus); MyMoneyFile::instance()->attachStorage(m); m->startTransaction(); m_dbAttached = true; @@ -202,7 +202,7 @@ void MyMoneyDatabaseMgrTest::testIsStandardAccount() CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_ASSET) == true); CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_EXPENSE) == true); CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_INCOME) == true); - CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_EQUITY) == true); + CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_ETQUITY) == true); CPPUNIT_ASSERT(m->isStandardAccount("A0002") == false); } @@ -221,7 +221,7 @@ void MyMoneyDatabaseMgrTest::testNewAccount() { m->addAccount(a); CPPUNIT_ASSERT(m->accountId() == 1); - QValueList accList; + TQValueList accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 1); CPPUNIT_ASSERT((*(accList.begin())).name() == "AccountName"); @@ -274,7 +274,7 @@ void MyMoneyDatabaseMgrTest::testAddNewAccount() { m->setDirty(); CPPUNIT_ASSERT(m->accountId() == 2); - QValueList accList; + TQValueList accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 2); @@ -421,7 +421,7 @@ void MyMoneyDatabaseMgrTest::testModifyAccount() { try { m->modifyAccount(a); MyMoneyAccount b = m->account("A000001"); - CPPUNIT_ASSERT(b.parentAccountId() == a.parentAccountId()); + CPPUNIT_ASSERT(b.tqparentAccountId() == a.tqparentAccountId()); CPPUNIT_ASSERT(b.name() == "New account name"); } catch (MyMoneyException *e) { delete e; @@ -449,7 +449,7 @@ void MyMoneyDatabaseMgrTest::testModifyAccount() { delete e; } - // use different parent + // use different tqparent a.setParentAccountId("A000002"); try { m->modifyAccount(c); @@ -490,7 +490,7 @@ void MyMoneyDatabaseMgrTest::testModifyInstitution() { } } -void MyMoneyDatabaseMgrTest::testReparentAccount() { +void MyMoneyDatabaseMgrTest::testRetqparentAccount() { testAttachDb(); if (!m_canOpen) { @@ -535,23 +535,23 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() { CPPUNIT_ASSERT(in.id() == "A000005"); CPPUNIT_ASSERT(ch.id() == "A000006"); - MyMoneyAccount parent = m->expense(); + MyMoneyAccount tqparent = m->expense(); - m->addAccount(parent, ex1); + m->addAccount(tqparent, ex1); m->addAccount(ex1, ex2); - m->addAccount(parent, ex3); - m->addAccount(parent, ex4); + m->addAccount(tqparent, ex3); + m->addAccount(tqparent, ex4); - parent = m->income(); - m->addAccount(parent, in); + tqparent = m->income(); + m->addAccount(tqparent, in); - parent = m->asset(); - m->addAccount(parent, ch); + tqparent = m->asset(); + m->addAccount(tqparent, ch); MyMoneyFile::instance()->preloadCache(); CPPUNIT_ASSERT(m->expense().accountCount() == 3); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 1); - CPPUNIT_ASSERT(ex3.parentAccountId() == STD_ACC_EXPENSE); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == STD_ACC_EXPENSE); //for (int i = 0; i < 100; ++i) { m->reparentAccount(ex3, ex1); @@ -559,7 +559,7 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() { MyMoneyFile::instance()->preloadCache(); CPPUNIT_ASSERT(m->expense().accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); - CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == ex1.id()); } catch (MyMoneyException *e) { std::cout << std::endl << e->what() << std::endl; delete e; @@ -575,7 +575,7 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { return; } - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount ch; MyMoneyTransaction t1, t2; @@ -589,14 +589,14 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000005"); // Salary s.setShares(-100000); s.setValue(-100000); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2002,5,10)); + t1.setPostDate(TQDate(2002,5,10)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -613,35 +613,35 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { try { // I spent some money, not so great - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000004"); // Grosseries s.setShares(10000); s.setValue(10000); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); // 16% sales tax s.setShares(1200); s.setValue(1200); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000003"); // 7% sales tax s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000006"); // Checkings account s.setShares(-11600); s.setValue(-11600); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - t2.setPostDate(QDate(2002,5,9)); + t2.setPostDate(TQDate(2002,5,9)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -652,10 +652,10 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { CPPUNIT_ASSERT(t2.splitCount() == 4); CPPUNIT_ASSERT(m->transactionCount() == 2); - //QMap::ConstIterator it_k; + //TQMap::ConstIterator it_k; MyMoneyTransactionFilter f; - QValueList transactionList (m->transactionList(f)); - QValueList::ConstIterator it_t (transactionList.begin()); + TQValueList transactionList (m->transactionList(f)); + TQValueList::ConstIterator it_t (transactionList.begin()); //CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); CPPUNIT_ASSERT((*it_t).id() == "T000000000000000002"); @@ -671,12 +671,12 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000002"); ++it; @@ -717,7 +717,7 @@ void MyMoneyDatabaseMgrTest::testAddBudget() { MyMoneyBudget budget; budget.setName("TestBudget"); - budget.setBudgetStart(QDate::currentDate(Qt::LocalTime)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime)); m->addBudget(budget); @@ -742,7 +742,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { MyMoneyBudget newBudget = oldBudget; newBudget.clearId(); - newBudget.setName(QString("Copy of %1").arg(oldBudget.name())); + newBudget.setName(TQString("Copy of %1").tqarg(oldBudget.name())); m->addBudget(newBudget); CPPUNIT_ASSERT(m->budgetList().count() == 2); @@ -757,7 +757,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { CPPUNIT_ASSERT(testBudget.budgetStart() == newBudget.budgetStart()); CPPUNIT_ASSERT(testBudget.name() == newBudget.name()); - } catch (QString& s) { + } catch (TQString& s) { std::cout << "Error in testCopyBudget(): " << s << std::endl; CPPUNIT_ASSERT(false); } @@ -773,7 +773,7 @@ void MyMoneyDatabaseMgrTest::testModifyBudget() { MyMoneyBudget budget = m->budgetByName("TestBudget"); - budget.setBudgetStart(QDate::currentDate(Qt::LocalTime).addDays(-1)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime).addDays(-1)); m->modifyBudget(budget); @@ -815,9 +815,9 @@ void MyMoneyDatabaseMgrTest::testBalance() { testAddTransactions(); - CPPUNIT_ASSERT(m->balance("A000001", QDate()).isZero()); - CPPUNIT_ASSERT(m->balance("A000002", QDate()) == MyMoneyMoney(1200)); - CPPUNIT_ASSERT(m->balance("A000003", QDate()) == MyMoneyMoney(400)); + CPPUNIT_ASSERT(m->balance("A000001", TQDate()).isZero()); + CPPUNIT_ASSERT(m->balance("A000002", TQDate()) == MyMoneyMoney(1200)); + CPPUNIT_ASSERT(m->balance("A000003", TQDate()) == MyMoneyMoney(400)); //Add a transaction to zero account A000003 MyMoneyTransaction t1; MyMoneySplit s; @@ -828,31 +828,31 @@ void MyMoneyDatabaseMgrTest::testBalance() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2007,5,10)); + t1.setPostDate(TQDate(2007,5,10)); m->addTransaction(t1); - //qDebug ("Balance of A000003 is 0 = %s", m->balance("A000003", QDate()).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000003", QDate()).isZero()); + //qDebug ("Balance of A000003 is 0 = %s", m->balance("A000003", TQDate()).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000003", TQDate()).isZero()); - //qDebug ("Balance of A000001 is 1600 = %s", m->balance("A000001", QDate()).toString().ascii()); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + //qDebug ("Balance of A000001 is 1600 = %s", m->balance("A000001", TQDate()).toString().ascii()); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); - //qDebug ("Balance of A000006 is -11600 = %s", m->balance("A000006", QDate(2002,5,9)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,9)) == MyMoneyMoney(-11600)); + //qDebug ("Balance of A000006 is -11600 = %s", m->balance("A000006", TQDate(2002,5,9)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,9)) == MyMoneyMoney(-11600)); - //qDebug ("Balance of A000005 is -100000 = %s", m->balance("A000005", QDate(2002,5,10)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000005", QDate(2002,5,10)) == MyMoneyMoney(-100000)); + //qDebug ("Balance of A000005 is -100000 = %s", m->balance("A000005", TQDate(2002,5,10)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000005", TQDate(2002,5,10)) == MyMoneyMoney(-100000)); - //qDebug ("Balance of A000006 is 88400 = %s", m->balance("A000006", QDate(2002,5,10)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,10)) == MyMoneyMoney(88400)); + //qDebug ("Balance of A000006 is 88400 = %s", m->balance("A000006", TQDate(2002,5,10)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,10)) == MyMoneyMoney(88400)); } void MyMoneyDatabaseMgrTest::testModifyTransaction() { @@ -884,30 +884,30 @@ void MyMoneyDatabaseMgrTest::testModifyTransaction() { t.modifySplit(s); try { - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(10000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-11600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(10000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-11600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); m->modifyTransaction(t); - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(11000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-12600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(11000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-12600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); } catch (MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); } // now modify the date - t.setPostDate(QDate(2002,5,11)); + t.setPostDate(TQDate(2002,5,11)); try { m->modifyTransaction(t); - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(11000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-12600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(11000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-12600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); - //QMap::ConstIterator it_k; + //TQMap::ConstIterator it_k; MyMoneyTransactionFilter f; - QValueList transactionList (m->transactionList(f)); - QValueList::ConstIterator it_t (transactionList.begin()); + TQValueList transactionList (m->transactionList(f)); + TQValueList::ConstIterator it_t (transactionList.begin()); //it_k = m->m_transactionKeys.begin(); //CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); CPPUNIT_ASSERT((*it_t).id() == "T000000000000000001"); @@ -923,12 +923,12 @@ void MyMoneyDatabaseMgrTest::testModifyTransaction() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000001"); ++it; @@ -1004,7 +1004,7 @@ void MyMoneyDatabaseMgrTest::testRemoveUnusedAccount() { CPPUNIT_ASSERT(i.accountCount() == 1); CPPUNIT_ASSERT(m->accountCount() == 7); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->removeAccount(a); CPPUNIT_ASSERT(m->accountCount() == 6); @@ -1045,7 +1045,7 @@ void MyMoneyDatabaseMgrTest::testRemoveInstitution() { } testModifyInstitution(); - testReparentAccount(); + testRetqparentAccount(); MyMoneyInstitution i; MyMoneyAccount a; @@ -1066,7 +1066,7 @@ void MyMoneyDatabaseMgrTest::testRemoveInstitution() { // now remove the institution and see if the account survived ;-) try { m->removeInstitution(i); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); a = m->account("A000006"); CPPUNIT_ASSERT(a.institutionId().isEmpty()); @@ -1109,7 +1109,7 @@ void MyMoneyDatabaseMgrTest::testTransactionList() { testAddTransactions(); - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 2); @@ -1117,7 +1117,7 @@ void MyMoneyDatabaseMgrTest::testTransactionList() { CPPUNIT_ASSERT((*(list.at(1))).id() == "T000000000000000001"); filter.clear(); - filter.addAccount(QString("A000003")); + filter.addAccount(TQString("A000003")); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT((*(list.at(0))).id() == "T000000000000000002"); @@ -1355,7 +1355,7 @@ void MyMoneyDatabaseMgrTest::testPayeeName() { testAddPayee(); MyMoneyPayee p; - QString name("THB"); + TQString name("THB"); // OK case try { @@ -1474,7 +1474,7 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { } // put some accounts in the db, so the tests don't break - testReparentAccount(); + testRetqparentAccount(); try { CPPUNIT_ASSERT(m->scheduleList().count() == 0); @@ -1488,11 +1488,11 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); - t1.setPostDate(QDate(2003,7,10)); + t1.setPostDate(TQDate(2003,7,10)); schedule.setTransaction(t1); m->addSchedule(schedule); @@ -1511,8 +1511,8 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); m->addSchedule(schedule); @@ -1534,11 +1534,11 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { // MyMoneySchedule::TYPE_DEPOSIT, // MyMoneySchedule::OCCUR_DAILY, 1, // MyMoneySchedule::STYPE_MANUALDEPOSIT, -// QDate(), -// QDate(), +// TQDate(), +// TQDate(), // true, // false); -// t1.setPostDate(QDate(2003,7,10)); +// t1.setPostDate(TQDate(2003,7,10)); // schedule.setTransaction(t1); // m->addSchedule(schedule); @@ -1648,11 +1648,11 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { } // put some accounts in the db, so the tests don't break - testReparentAccount(); + testRetqparentAccount(); - QDate testDate = QDate::currentDate(); - QDate notOverdue = testDate.addDays(2); - QDate overdue = testDate.addDays(-2); + TQDate testDate = TQDate::tqcurrentDate(); + TQDate notOverdue = testDate.addDays(2); + TQDate overdue = testDate.addDays(-2); MyMoneyTransaction t1; MyMoneySplit s1, s2; @@ -1664,8 +1664,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_ONCE, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t1.setPostDate(notOverdue); @@ -1682,8 +1682,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_DIRECTDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t2.setPostDate(notOverdue.addDays(1)); @@ -1700,8 +1700,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t3.setPostDate(notOverdue.addDays(2)); @@ -1717,8 +1717,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule schedule4("Schedule 4", MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(), notOverdue.addDays(31), false, false); @@ -1736,7 +1736,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { CPPUNIT_FAIL("Unexpected exception"); } - QValueList list; + TQValueList list; // no filter list = m->scheduleList(); @@ -1783,7 +1783,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), notOverdue.addDays(1)); CPPUNIT_ASSERT(list.count() == 3); CPPUNIT_ASSERT(list[0].name() == "Schedule 1"); @@ -1804,8 +1804,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), - QDate(), + TQDate(), + TQDate(), true); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT(list[0].name() == "Schedule 4"); @@ -1978,7 +1978,7 @@ void MyMoneyDatabaseMgrTest::testAccountList() return; } - QValueList accounts; + TQValueList accounts; m->accountList(accounts); CPPUNIT_ASSERT(accounts.count() == 0); testAddNewAccount(); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h index 8ab4b64..d883032 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h @@ -40,7 +40,7 @@ class MyMoneyDatabaseMgrTest : public CppUnit::TestFixture { CPPUNIT_TEST(testIsStandardAccount); CPPUNIT_TEST(testNewAccount); CPPUNIT_TEST(testAddNewAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testAddInstitution); CPPUNIT_TEST(testInstitution); CPPUNIT_TEST(testAccount2Institution); @@ -103,7 +103,7 @@ public: void testAccount2Institution(); void testModifyAccount(); void testModifyInstitution(); - void testReparentAccount(); + void testRetqparentAccount(); void testAddTransactions(); void testTransactionCount(); void testAddBudget(); diff --git a/kmymoney2/mymoney/storage/mymoneymap.h b/kmymoney2/mymoney/storage/mymoneymap.h index fa5cda8..7582112 100644 --- a/kmymoney2/mymoney/storage/mymoneymap.h +++ b/kmymoney2/mymoney/storage/mymoneymap.h @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #ifndef MYMONEYMAP_H @@ -11,7 +11,7 @@ /** * @author Thomas Baumgart * - * This template class adds transaction security to the QMap<> class. + * This template class adds transaction security to the TQMap<> class. * The interface is very simple. Before you perform any changes, * you have to call the startTransaction() method. Then you can use * the insert(), modify() and remove() methods to modify the map. @@ -25,12 +25,12 @@ * someone is interested. */ template -class MyMoneyMap : protected QMap +class MyMoneyMap : protected TQMap { public: - // typedef QMapConstIterator const_iterator; + // typedef TQMapConstIterator const_iterator; - MyMoneyMap() : QMap() {} + MyMoneyMap() : TQMap() {} virtual ~MyMoneyMap() {} void startTransaction(unsigned long* id = 0) @@ -78,7 +78,7 @@ public: throw new MYMONEYEXCEPTION("No transaction started to modify element in container"); #if 0 - // had to take this out, because we use QPair in one instance as key + // had to take this out, because we use TQPair in one instance as key if(key.isEmpty()) throw new MYMONEYEXCEPTION("No key to update object"); #endif @@ -92,7 +92,7 @@ public: throw new MYMONEYEXCEPTION("No transaction started to remove element from container"); #if 0 - // had to take this out, because we use QPair in one instance as key + // had to take this out, because we use TQPair in one instance as key if(key.isEmpty()) throw new MYMONEYEXCEPTION("No key to remove object"); #endif @@ -100,59 +100,59 @@ public: m_stack.push(new MyMoneyMapRemove(this, key)); } - MyMoneyMap& operator= (const QMap& m) + MyMoneyMap& operator= (const TQMap& m) { if(m_stack.count() != 0) { throw new MYMONEYEXCEPTION("Cannot assign whole container during transaction"); } - QMap::operator=(m); + TQMap::operator=(m); return *this; } - inline QValueList values(void) const + inline TQValueList values(void) const { - return QMap::values(); + return TQMap::values(); } - inline QValueList keys(void) const + inline TQValueList keys(void) const { - return QMap::keys(); + return TQMap::keys(); } const T& operator[] ( const Key& k ) const - { QT_CHECK_INVALID_MAP_ELEMENT; return QMap::operator[](k); } + { TQT_CHECK_INVALID_MAP_ELEMENT; return TQMap::operator[](k); } - inline Q_TYPENAME QMap::const_iterator find(const Key& k) const + inline TQ_TYPENAME TQMap::const_iterator tqfind(const Key& k) const { - return QMap::find(k); + return TQMap::tqfind(k); } - inline Q_TYPENAME QMap::const_iterator begin(void) const + inline TQ_TYPENAME TQMap::const_iterator begin(void) const { - return QMap::begin(); + return TQMap::begin(); } - inline Q_TYPENAME QMap::const_iterator end(void) const + inline TQ_TYPENAME TQMap::const_iterator end(void) const { - return QMap::end(); + return TQMap::end(); } - inline bool contains(const Key& k) const + inline bool tqcontains(const Key& k) const { - return find(k) != end(); + return tqfind(k) != end(); } - inline void map(QMap& that) const + inline void map(TQMap& that) const { - //QMap* ptr = dynamic_cast* >(this); + //TQMap* ptr = dynamic_cast* >(this); //that = *ptr; - that = *(dynamic_cast* >(const_cast* >(this))); + that = *(dynamic_cast* >(const_cast* >(this))); } inline size_t count(void) const { - return QMap::count(); + return TQMap::count(); } #if MY_OWN_DEBUG @@ -173,10 +173,10 @@ private: class MyMoneyMapAction { public: - MyMoneyMapAction(QMap* container) : + MyMoneyMapAction(TQMap* container) : m_container(container) {} - MyMoneyMapAction(QMap* container, const Key& key, const T& obj) : + MyMoneyMapAction(TQMap* container, const Key& key, const T& obj) : m_container(container), m_obj(obj), m_key(key) {} @@ -185,7 +185,7 @@ private: virtual void undo(void) = 0; protected: - QMap* m_container; + TQMap* m_container; T m_obj; Key m_key; }; @@ -193,7 +193,7 @@ private: class MyMoneyMapStart : public MyMoneyMapAction { public: - MyMoneyMapStart(QMap* container, unsigned long* id) : + MyMoneyMapStart(TQMap* container, unsigned long* id) : MyMoneyMapAction(container), m_idPtr(id) { @@ -215,7 +215,7 @@ private: class MyMoneyMapInsert : public MyMoneyMapAction { public: - MyMoneyMapInsert(QMap* container, const Key& key, const T& obj) : + MyMoneyMapInsert(TQMap* container, const Key& key, const T& obj) : MyMoneyMapAction(container, key, obj) { (*container)[key] = obj; @@ -233,7 +233,7 @@ private: class MyMoneyMapRemove : public MyMoneyMapAction { public: - MyMoneyMapRemove(QMap* container, const Key& key) : + MyMoneyMapRemove(TQMap* container, const Key& key) : MyMoneyMapAction(container, key, (*container)[key]) { container->remove(key); @@ -249,7 +249,7 @@ private: class MyMoneyMapModify : public MyMoneyMapAction { public: - MyMoneyMapModify(QMap* container, const Key& key, const T& obj) : + MyMoneyMapModify(TQMap* container, const Key& key, const T& obj) : MyMoneyMapAction(container, key, (*container)[key]) { (*container)[key] = obj; @@ -263,7 +263,7 @@ private: }; protected: - QPtrStack m_stack; + TQPtrStack m_stack; }; #if MY_OWN_DEBUG @@ -271,15 +271,15 @@ protected: #include main() { - MyMoneyMap container; - MyMoneyMap ct; + MyMoneyMap container; + MyMoneyMap ct; MyMoneyAccount acc; acc.setName("Test"); // this should not be possible // container["a"] = acc; - QValueList list; + TQValueList list; list = container.values(); MyMoneyAccount b; @@ -298,7 +298,7 @@ main() container.dump(); container.startTransaction(); - container.remove(QString("001")); + container.remove(TQString("001")); container.dump(); container.rollbackTransaction(); container.dump(); @@ -306,8 +306,8 @@ main() b = container["001"]; printf("b.name() = %s\n", b.name().data()); - QMap::ConstIterator it; - it = container.find("001"); + TQMap::ConstIterator it; + it = container.tqfind("001"); it = container.begin(); } catch(MyMoneyException *e) { @@ -315,7 +315,7 @@ main() delete e; } - QMap map; + TQMap map; map["005"] = b; container = map; diff --git a/kmymoney2/mymoney/storage/mymoneymaptest.cpp b/kmymoney2/mymoney/storage/mymoneymaptest.cpp index 5104fad..123fcc8 100644 --- a/kmymoney2/mymoney/storage/mymoneymaptest.cpp +++ b/kmymoney2/mymoney/storage/mymoneymaptest.cpp @@ -24,7 +24,7 @@ MyMoneyMapTest::MyMoneyMapTest() void MyMoneyMapTest::setUp() { - m = new MyMoneyMap; + m = new MyMoneyMap; } void MyMoneyMapTest::tearDown() diff --git a/kmymoney2/mymoney/storage/mymoneymaptest.h b/kmymoney2/mymoney/storage/mymoneymaptest.h index c089a3f..af2389c 100644 --- a/kmymoney2/mymoney/storage/mymoneymaptest.h +++ b/kmymoney2/mymoney/storage/mymoneymaptest.h @@ -34,7 +34,7 @@ class MyMoneyMapTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); protected: - MyMoneyMap *m; + MyMoneyMap *m; public: MyMoneyMapTest(); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp index 7341ec1..5c9abed 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp @@ -44,7 +44,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() m_nextBudgetID = 0; m_user = MyMoneyPayee(); m_dirty = false; - m_creationDate = QDate::currentDate(); + m_creationDate = TQDate::tqcurrentDate(); // setup standard accounts MyMoneyAccount acc_l; @@ -70,14 +70,14 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() MyMoneyAccount acc_q; acc_q.setAccountType(MyMoneyAccount::Equity); acc_q.setName("Equity"); - MyMoneyAccount equity(STD_ACC_EQUITY, acc_q); + MyMoneyAccount equity(STD_ACC_ETQUITY, acc_q); - QMap map; + TQMap map; map[STD_ACC_ASSET] = asset; map[STD_ACC_LIABILITY] = liability; map[STD_ACC_INCOME] = income; map[STD_ACC_EXPENSE] = expense; - map[STD_ACC_EQUITY] = equity; + map[STD_ACC_ETQUITY] = equity; // load account list with inital accounts m_accountList = map; @@ -89,7 +89,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() m_balanceCache[STD_ACC_ASSET] = balance; m_balanceCache[STD_ACC_EXPENSE] = balance; m_balanceCache[STD_ACC_INCOME] = balance; - m_balanceCache[STD_ACC_EQUITY] = balance; + m_balanceCache[STD_ACC_ETQUITY] = balance; // initialize for file fixes (see kmymoneyview.cpp) m_currentFixVersion = 2; @@ -115,16 +115,16 @@ KSharedPtr MyMoneySeqAccessMgr::connectToDatabase return 0; } -bool MyMoneySeqAccessMgr::isStandardAccount(const QString& id) const +bool MyMoneySeqAccessMgr::isStandardAccount(const TQString& id) const { return id == STD_ACC_LIABILITY || id == STD_ACC_ASSET || id == STD_ACC_EXPENSE || id == STD_ACC_INCOME - || id == STD_ACC_EQUITY; + || id == STD_ACC_ETQUITY; } -void MyMoneySeqAccessMgr::setAccountName(const QString& id, const QString& name) +void MyMoneySeqAccessMgr::setAccountName(const TQString& id, const TQString& name) { if(!isStandardAccount(id)) throw new MYMONEYEXCEPTION("Only standard accounts can be modified using setAccountName()"); @@ -134,20 +134,20 @@ void MyMoneySeqAccessMgr::setAccountName(const QString& id, const QString& name) m_accountList.modify(acc.id(), acc); } -const MyMoneyAccount MyMoneySeqAccessMgr::account(const QString& id) const +const MyMoneyAccount MyMoneySeqAccessMgr::account(const TQString& id) const { // locate the account and if present, return it's data - if(m_accountList.find(id) != m_accountList.end()) + if(m_accountList.tqfind(id) != m_accountList.end()) return m_accountList[id]; // throw an exception, if it does not exist - QString msg = "Unknown account id '" + id + "'"; + TQString msg = "Unknown account id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -void MyMoneySeqAccessMgr::accountList(QValueList& list) const +void MyMoneySeqAccessMgr::accountList(TQValueList& list) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = m_accountList.begin(); it != m_accountList.end(); ++it) { if(!isStandardAccount((*it).id())) { list.append(*it); @@ -172,22 +172,22 @@ void MyMoneySeqAccessMgr::addPayee(MyMoneyPayee& payee) payee = newPayee; } -const MyMoneyPayee MyMoneySeqAccessMgr::payee(const QString& id) const +const MyMoneyPayee MyMoneySeqAccessMgr::payee(const TQString& id) const { - QMap::ConstIterator it; - it = m_payeeList.find(id); + TQMap::ConstIterator it; + it = m_payeeList.tqfind(id); if(it == m_payeeList.end()) throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'"); return *it; } -const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const QString& payee) const +const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const TQString& payee) const { if(payee.isEmpty()) return MyMoneyPayee::null; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_p; for(it_p = m_payeeList.begin(); it_p != m_payeeList.end(); ++it_p) { if((*it_p).name() == payee) { @@ -200,11 +200,11 @@ const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const QString& payee) const void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_payeeList.find(payee.id()); + it = m_payeeList.tqfind(payee.id()); if(it == m_payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_payeeList.modify((*it).id(), payee); @@ -212,27 +212,27 @@ void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee) void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee) { - QMap::ConstIterator it_t; - QMap::ConstIterator it_s; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_t; + TQMap::ConstIterator it_s; + TQMap::ConstIterator it_p; - it_p = m_payeeList.find(payee.id()); + it_p = m_payeeList.tqfind(payee.id()); if(it_p == m_payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } // scan all transactions to check if the payee is still referenced for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { if((*it_t).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); } } // check referential integrity in schedules for(it_s = m_scheduleList.begin(); it_s != m_scheduleList.end(); ++it_s) { if((*it_s).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); } } @@ -242,27 +242,27 @@ void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee) m_payeeList.remove((*it_p).id()); } -const QValueList MyMoneySeqAccessMgr::payeeList(void) const +const TQValueList MyMoneySeqAccessMgr::payeeList(void) const { return m_payeeList.values(); } -void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) +void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) { - QMap::ConstIterator theParent; - QMap::ConstIterator theChild; + TQMap::ConstIterator theParent; + TQMap::ConstIterator theChild; - theParent = m_accountList.find(parent.id()); + theParent = m_accountList.tqfind(tqparent.id()); if(theParent == m_accountList.end()) { - QString msg = "Unknown parent account '"; - msg += parent.id() + "'"; + TQString msg = "Unknown tqparent account '"; + msg += tqparent.id() + "'"; throw new MYMONEYEXCEPTION(msg); } - theChild = m_accountList.find(account.id()); + theChild = m_accountList.tqfind(account.id()); if(theChild == m_accountList.end()) { - QString msg = "Unknown child account '"; + TQString msg = "Unknown child account '"; msg += account.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -270,10 +270,10 @@ void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& acc MyMoneyAccount acc = *theParent; acc.addAccountId(account.id()); m_accountList.modify(acc.id(), acc); - parent = acc; + tqparent = acc; acc = *theChild; - acc.setParentAccountId(parent.id()); + acc.setParentAccountId(tqparent.id()); m_accountList.modify(acc.id(), acc); account = acc; @@ -291,7 +291,7 @@ void MyMoneySeqAccessMgr::addInstitution(MyMoneyInstitution& institution) institution = newInstitution; } -unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const +unsigned int MyMoneySeqAccessMgr::transactionCount(const TQString& account) const { unsigned int cnt = 0; @@ -299,8 +299,8 @@ unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const cnt = m_transactionList.count(); } else { - QMap::ConstIterator it_t; - QValueList::ConstIterator it_s; + TQMap::ConstIterator it_t; + TQValueList::ConstIterator it_s; // scan all transactions for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { @@ -326,11 +326,11 @@ unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const return cnt; } -const QMap MyMoneySeqAccessMgr::transactionCountMap(void) const +const TQMap MyMoneySeqAccessMgr::transactionCountMap(void) const { - QMap map; - QMap::ConstIterator it_t; - QValueList::ConstIterator it_s; + TQMap map; + TQMap::ConstIterator it_t; + TQValueList::ConstIterator it_s; // scan all transactions for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { @@ -352,49 +352,49 @@ unsigned int MyMoneySeqAccessMgr::accountCount(void) const return m_accountList.count(); } -QString MyMoneySeqAccessMgr::nextPayeeID(void) +TQString MyMoneySeqAccessMgr::nextPayeeID(void) { - QString id; + TQString id; id.setNum(++m_nextPayeeID); id = "P" + id.rightJustify(PAYEE_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextInstitutionID(void) +TQString MyMoneySeqAccessMgr::nextInstitutionID(void) { - QString id; + TQString id; id.setNum(++m_nextInstitutionID); id = "I" + id.rightJustify(INSTITUTION_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextAccountID(void) +TQString MyMoneySeqAccessMgr::nextAccountID(void) { - QString id; + TQString id; id.setNum(++m_nextAccountID); id = "A" + id.rightJustify(ACCOUNT_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextTransactionID(void) +TQString MyMoneySeqAccessMgr::nextTransactionID(void) { - QString id; + TQString id; id.setNum(++m_nextTransactionID); id = "T" + id.rightJustify(TRANSACTION_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextScheduleID(void) +TQString MyMoneySeqAccessMgr::nextScheduleID(void) { - QString id; + TQString id; id.setNum(++m_nextScheduleID); id = "SCH" + id.rightJustify(SCHEDULE_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextSecurityID(void) +TQString MyMoneySeqAccessMgr::nextSecurityID(void) { - QString id; + TQString id; id.setNum(++m_nextSecurityID); id = "E" + id.rightJustify(SECURITY_ID_SIZE, '0'); return id; @@ -416,7 +416,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const throw new MYMONEYEXCEPTION("invalid post date"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -426,7 +426,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const } MyMoneyTransaction newTransaction(nextTransactionID(), transaction); - QString key = newTransaction.uniqueSortKey(); + TQString key = newTransaction.uniqueSortKey(); m_transactionList.insert(key, newTransaction); m_transactionKeys.insert(newTransaction.id(), key); @@ -439,7 +439,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const acc.adjustBalance(*it_s); if(!skipAccountUpdate) { acc.touch(); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); } m_accountList.modify(acc.id(), acc); } @@ -448,12 +448,12 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const void MyMoneySeqAccessMgr::touch(void) { m_dirty = true; - m_lastModificationDate = QDate::currentDate(); + m_lastModificationDate = TQDate::tqcurrentDate(); } -bool MyMoneySeqAccessMgr::hasActiveSplits(const QString& id) const +bool MyMoneySeqAccessMgr::hasActiveSplits(const TQString& id) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = m_transactionList.begin(); it != m_transactionList.end(); ++it) { if((*it).accountReferenced(id)) { @@ -463,39 +463,39 @@ bool MyMoneySeqAccessMgr::hasActiveSplits(const QString& id) const return false; } -const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const QString& id) const +const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const TQString& id) const { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; - pos = m_institutionList.find(id); + pos = m_institutionList.tqfind(id); if(pos != m_institutionList.end()) return *pos; throw new MYMONEYEXCEPTION("unknown institution"); } -const QValueList MyMoneySeqAccessMgr::institutionList(void) const +const TQValueList MyMoneySeqAccessMgr::institutionList(void) const { return m_institutionList.values(); } void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck) { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the account in the file global pool - pos = m_accountList.find(account.id()); + pos = m_accountList.tqfind(account.id()); if(pos != m_accountList.end()) { // check if the new info is based on the old one. // this is the case, when the file and the id // as well as the type are equal. - if((((*pos).parentAccountId() == account.parentAccountId()) + if((((*pos).tqparentAccountId() == account.tqparentAccountId()) && ((*pos).accountType() == account.accountType())) || (skipCheck == true)) { // make sure that all the referenced objects exist if(!account.institutionId().isEmpty()) institution(account.institutionId()); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) { this->account(*it_a); } @@ -503,8 +503,8 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo // update information in account list m_accountList.modify(account.id(), account); - // invalidate cached balance - invalidateBalanceCache(account.id()); + // tqinvalidate cached balance + tqinvalidateBalanceCache(account.id()); } else throw new MYMONEYEXCEPTION("Invalid information for update"); @@ -515,10 +515,10 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo void MyMoneySeqAccessMgr::modifyInstitution(const MyMoneyInstitution& institution) { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the institution in the file global pool - pos = m_institutionList.find(institution.id()); + pos = m_institutionList.tqfind(institution.id()); if(pos != m_institutionList.end()) { m_institutionList.modify(institution.id(), institution); @@ -542,7 +542,7 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio throw new MYMONEYEXCEPTION("invalid transaction to be modified"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -553,16 +553,16 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio // new data seems to be ok. find old version of transaction // in our pool. Throw exception if unknown. - if(!m_transactionKeys.contains(transaction.id())) + if(!m_transactionKeys.tqcontains(transaction.id())) throw new MYMONEYEXCEPTION("invalid transaction id"); - QString oldKey = m_transactionKeys[transaction.id()]; - if(!m_transactionList.contains(oldKey)) + TQString oldKey = m_transactionKeys[transaction.id()]; + if(!m_transactionList.tqcontains(oldKey)) throw new MYMONEYEXCEPTION("invalid transaction key"); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; - it_t = m_transactionList.find(oldKey); + it_t = m_transactionList.tqfind(oldKey); if(it_t == m_transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); @@ -571,14 +571,14 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio MyMoneyAccount acc = m_accountList[(*it_s).accountId()]; acc.adjustBalance(*it_s, true); // reverse the adjust operation (reverse = true) acc.touch(); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); m_accountList.modify(acc.id(), acc); } for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { MyMoneyAccount acc = m_accountList[(*it_s).accountId()]; acc.adjustBalance(*it_s); acc.touch(); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); m_accountList.modify(acc.id(), acc); } @@ -586,54 +586,54 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio m_transactionList.remove(oldKey); // add new transaction to lists - QString newKey = transaction.uniqueSortKey(); + TQString newKey = transaction.uniqueSortKey(); m_transactionList.insert(newKey, transaction); m_transactionKeys.modify(transaction.id(), newKey); } -void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) +void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) { - reparentAccount(account, parent, true); + reparentAccount(account, tqparent, true); } -void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent, const bool /* sendNotification */) +void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent, const bool /* sendNotification */) { - QMap::ConstIterator oldParent; - QMap::ConstIterator newParent; - QMap::ConstIterator childAccount; + TQMap::ConstIterator oldParent; + TQMap::ConstIterator newParent; + TQMap::ConstIterator childAccount; // verify that accounts exist. If one does not, // an exception is thrown MyMoneySeqAccessMgr::account(account.id()); - MyMoneySeqAccessMgr::account(parent.id()); - if(!account.parentAccountId().isEmpty()) { - MyMoneySeqAccessMgr::account(account.parentAccountId()); - oldParent = m_accountList.find(account.parentAccountId()); + MyMoneySeqAccessMgr::account(tqparent.id()); + if(!account.tqparentAccountId().isEmpty()) { + MyMoneySeqAccessMgr::account(account.tqparentAccountId()); + oldParent = m_accountList.tqfind(account.tqparentAccountId()); } - if(account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment) + if(account.accountType() == MyMoneyAccount::Stock && tqparent.accountType() != MyMoneyAccount::Investment) throw new MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); - newParent = m_accountList.find(parent.id()); - childAccount = m_accountList.find(account.id()); + newParent = m_accountList.tqfind(tqparent.id()); + childAccount = m_accountList.tqfind(account.id()); MyMoneyAccount acc; - if(!account.parentAccountId().isEmpty()) { + if(!account.tqparentAccountId().isEmpty()) { acc = (*oldParent); acc.removeAccountId(account.id()); m_accountList.modify(acc.id(), acc); } - parent = (*newParent); - parent.addAccountId(account.id()); - m_accountList.modify(parent.id(), parent); + tqparent = (*newParent); + tqparent.addAccountId(account.id()); + m_accountList.modify(tqparent.id(), tqparent); account = (*childAccount); - account.setParentAccountId(parent.id()); + account.setParentAccountId(tqparent.id()); m_accountList.modify(account.id(), account); #if 0 - // make sure the type is the same as the new parent. This does not work for stock and investment + // make sure the type is the same as the new tqparent. This does not work for stock and investment if(account.accountType() != MyMoneyAccount::Stock && account.accountType() != MyMoneyAccount::Investment) (*childAccount).setAccountType((*newParent).accountType()); #endif @@ -645,18 +645,18 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio if(transaction.id().isEmpty()) throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; - it_k = m_transactionKeys.find(transaction.id()); + it_k = m_transactionKeys.tqfind(transaction.id()); if(it_k == m_transactionKeys.end()) throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - it_t = m_transactionList.find(*it_k); + it_t = m_transactionList.tqfind(*it_k); if(it_t == m_transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; // scan the splits and collect all accounts that need // to be updated after the removal of this transaction @@ -665,7 +665,7 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio acc.adjustBalance(*it_s, true); // reverse = true acc.touch(); m_accountList.modify(acc.id(), acc); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); } // FIXME: check if any split is frozen and throw exception @@ -677,12 +677,12 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) { - MyMoneyAccount parent; + MyMoneyAccount tqparent; - // check that the account and it's parent exist + // check that the account and it's tqparent exist // this will throw an exception if the id is unknown MyMoneySeqAccessMgr::account(account.id()); - parent = MyMoneySeqAccessMgr::account(account.parentAccountId()); + tqparent = MyMoneySeqAccessMgr::account(account.tqparentAccountId()); // check that it's not one of the standard account groups if(isStandardAccount(account.id())) @@ -692,10 +692,10 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) throw new MYMONEYEXCEPTION("Unable to remove account with active splits"); } - // re-parent all sub-ordinate accounts to the parent of the account + // re-tqparent all sub-ordinate accounts to the tqparent of the account // to be deleted. First round check that all accounts exist, second - // round do the re-parenting. - QStringList::ConstIterator it; + // round do the re-tqparenting. + TQStringList::ConstIterator it; for(it = account.accountList().begin(); it != account.accountList().end(); ++it) { MyMoneySeqAccessMgr::account(*it); } @@ -703,18 +703,18 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) // if one of the accounts did not exist, an exception had been // thrown and we would not make it until here. - QMap::ConstIterator it_a; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_a; + TQMap::ConstIterator it_p; // locate the account in the file global pool - it_a = m_accountList.find(account.id()); + it_a = m_accountList.tqfind(account.id()); if(it_a == m_accountList.end()) throw new MYMONEYEXCEPTION("Internal error: account not found in list"); - it_p = m_accountList.find(parent.id()); + it_p = m_accountList.tqfind(tqparent.id()); if(it_p == m_accountList.end()) - throw new MYMONEYEXCEPTION("Internal error: parent account not found in list"); + throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list"); if(!account.institutionId().isEmpty()) throw new MYMONEYEXCEPTION("Cannot remove account still attached to an institution"); @@ -729,34 +729,34 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) if((*it_a).id() == account.id() && (*it_a).accountType() == account.accountType()) { - // second round over sub-ordinate accounts: do re-parenting + // second round over sub-ordinate accounts: do re-tqparenting // but only if the list contains at least one entry // FIXME: move this logic to MyMoneyFile if((*it_a).accountList().count() > 0) { while((*it_a).accountList().count() > 0) { it = (*it_a).accountList().begin(); MyMoneyAccount acc(MyMoneySeqAccessMgr::account(*it)); - reparentAccount(acc, parent, false); + reparentAccount(acc, tqparent, false); } } - // remove account from parent's list - parent.removeAccountId(account.id()); - m_accountList.modify(parent.id(), parent); + // remove account from tqparent's list + tqparent.removeAccountId(account.id()); + m_accountList.modify(tqparent.id(), tqparent); // remove account from the global account pool m_accountList.remove(account.id()); // remove from balance list m_balanceCache.remove(account.id()); - invalidateBalanceCache(parent.id()); + tqinvalidateBalanceCache(tqparent.id()); } } void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institution) { - QMap::ConstIterator it_i; + TQMap::ConstIterator it_i; - it_i = m_institutionList.find(institution.id()); + it_i = m_institutionList.tqfind(institution.id()); if(it_i != m_institutionList.end()) { m_institutionList.remove(institution.id()); @@ -764,11 +764,11 @@ void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institutio throw new MYMONEYEXCEPTION("invalid institution"); } -void MyMoneySeqAccessMgr::transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const +void MyMoneySeqAccessMgr::transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const { list.clear(); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { // This code is used now. It adds the transaction to the list for @@ -789,55 +789,55 @@ void MyMoneySeqAccessMgr::transactionList(QValueList& list, } } -void MyMoneySeqAccessMgr::transactionList(QValueList< QPair >& list, MyMoneyTransactionFilter& filter) const +void MyMoneySeqAccessMgr::transactionList(TQValueList< TQPair >& list, MyMoneyTransactionFilter& filter) const { list.clear(); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { if(filter.match(*it_t)) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = filter.matchingSplits().begin(); it_s != filter.matchingSplits().end(); ++it_s) { - list.append(qMakePair(*it_t, *it_s)); + list.append(tqMakePair(*it_t, *it_s)); } } } } -const QValueList MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const +const TQValueList MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const { - QValueList list; + TQValueList list; transactionList(list, filter); return list; } -const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& id) const +const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& id) const { // get the full key of this transaction, throw exception // if it's invalid (unknown) - if(!m_transactionKeys.contains(id)) { - QString msg = QString("Invalid transaction id '%1'").arg(id); + if(!m_transactionKeys.tqcontains(id)) { + TQString msg = TQString("Invalid transaction id '%1'").tqarg(id); throw new MYMONEYEXCEPTION(msg); } // check if this key is in the list, throw exception if not - QString key = m_transactionKeys[id]; - if(!m_transactionList.contains(key)) { - QString msg = QString("Invalid transaction key '%1'").arg(key); + TQString key = m_transactionKeys[id]; + if(!m_transactionList.tqcontains(key)) { + TQString msg = TQString("Invalid transaction key '%1'").tqarg(key); throw new MYMONEYEXCEPTION(msg); } return m_transactionList[key]; } -const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account, const int idx) const +const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& account, const int idx) const { /* removed with MyMoneyAccount::Transaction - QMap::ConstIterator acc; + TQMap::ConstIterator acc; // find account object in list, throw exception if unknown - acc = m_accountList.find(account); + acc = m_accountList.tqfind(account); if(acc == m_accountList.end()) throw new MYMONEYEXCEPTION("unknown account id"); @@ -849,7 +849,7 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account */ // new implementation if the above code does not work anymore - QValueList list; + TQValueList list; MyMoneyAccount acc = m_accountList[account]; MyMoneyTransactionFilter filter; @@ -866,36 +866,36 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account return transaction(list[idx].id()); } -const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneySeqAccessMgr::balance(const TQString& id, const TQDate& date) const { MyMoneyMoney result(0); MyMoneyAccount acc; - // if (date != QDate()) qDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1()); + // if (date != TQDate()) qDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1()); if(!date.isValid() && account(id).accountType() != MyMoneyAccount::Stock) { - if(m_accountList.find(id) != m_accountList.end()) + if(m_accountList.tqfind(id) != m_accountList.end()) return m_accountList[id].balance(); return MyMoneyMoney(0); } if(m_balanceCache[id].valid == false || date != m_balanceCacheDate) { - QMap balances; - QMap::ConstIterator it_b; + TQMap balances; + TQMap::ConstIterator it_b; if (date != m_balanceCacheDate) { m_balanceCache.clear(); m_balanceCacheDate = date; } - QValueList list; - QValueList::ConstIterator it_t; - QValueList::ConstIterator it_s; + TQValueList list; + TQValueList::ConstIterator it_t; + TQValueList::ConstIterator it_s; MyMoneyTransactionFilter filter; - filter.setDateFilter(QDate(), date); + filter.setDateFilter(TQDate(), date); filter.setReportAllSplits(false); transactionList(list, filter); for(it_t = list.begin(); it_t != list.end(); ++it_t) { for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s){ - const QString& aid = (*it_s).accountId(); + const TQString& aid = (*it_s).accountId(); if((*it_s).action() == MyMoneySplit::ActionSplitShares) { balances[aid] = balances[aid] * (*it_s).shares(); } else { @@ -911,7 +911,7 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& } // fill all accounts w/o transactions to zero - QMap::ConstIterator it_a; + TQMap::ConstIterator it_a; for(it_a = m_accountList.begin(); it_a != m_accountList.end(); ++it_a) { if(m_balanceCache[(*it_a).id()].valid == false) { MyMoneyBalanceCacheItem balance(MyMoneyMoney(0,1)); @@ -928,10 +928,10 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& return result; } -const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const TQString& id, const TQDate& date) const { - QStringList accounts; - QStringList::ConstIterator it_a; + TQStringList accounts; + TQStringList::ConstIterator it_a; MyMoneyMoney result(balance(id, date)); @@ -952,10 +952,10 @@ const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QD * the functionality, we can turn it back on. BTW: the stuff is untested ;-) */ /* -const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QString& newAccount) +const unsigned int MyMoneyFile::moveSplits(const TQString& oldAccount, const TQString& newAccount) { - QMap::Iterator it_t; - QValueList::ConstIterator it_s; + TQMap::Iterator it_t; + TQValueList::ConstIterator it_s; unsigned int cnt = 0; // scan all transactions @@ -974,13 +974,13 @@ const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QStr if(cnt != 0) { // now update all the accounts that were referenced - QMap::Iterator acc; - acc = m_accountList.find(oldAccount); + TQMap::Iterator acc; + acc = m_accountList.tqfind(oldAccount); if(acc != m_accountList.end()) { (*acc).touch(); refreshAccountTransactionList(acc); } - acc = m_accountList.find(newAccount); + acc = m_accountList.tqfind(newAccount); if(acc != m_accountList.end()) { (*acc).touch(); refreshAccountTransactionList(acc); @@ -993,13 +993,13 @@ const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QStr } */ -void MyMoneySeqAccessMgr::invalidateBalanceCache(const QString& id) +void MyMoneySeqAccessMgr::tqinvalidateBalanceCache(const TQString& id) { if(!id.isEmpty()) { try { m_balanceCache[id].valid = false; if(!isStandardAccount(id)) { - invalidateBalanceCache(account(id).parentAccountId()); + tqinvalidateBalanceCache(account(id).tqparentAccountId()); } } catch (MyMoneyException *e) { delete e; @@ -1007,33 +1007,33 @@ void MyMoneySeqAccessMgr::invalidateBalanceCache(const QString& id) } } -void MyMoneySeqAccessMgr::loadAccounts(const QMap& map) +void MyMoneySeqAccessMgr::loadAccounts(const TQMap& map) { m_accountList = map; // scan the map to identify the last used id - QMap::const_iterator it_a; - QString lastId(""); + TQMap::const_iterator it_a; + TQString lastId(""); for(it_a = map.begin(); it_a != map.end(); ++it_a) { if(!isStandardAccount((*it_a).id()) && ((*it_a).id() > lastId)) lastId = (*it_a).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextAccountID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadTransactions(const QMap& map) +void MyMoneySeqAccessMgr::loadTransactions(const TQMap& map) { m_transactionList = map; // now fill the key map and // identify the last used id - QString lastId(""); - QMap keys; - QMap::ConstIterator it_t; + TQString lastId(""); + TQMap keys; + TQMap::ConstIterator it_t; for(it_t = map.begin(); it_t != map.end(); ++it_t) { keys[(*it_t).id()] = it_t.key(); if((*it_t).id() > lastId) @@ -1042,37 +1042,37 @@ void MyMoneySeqAccessMgr::loadTransactions(const QMap& map) +void MyMoneySeqAccessMgr::loadInstitutions(const TQMap& map) { m_institutionList = map; // scan the map to identify the last used id - QMap::const_iterator it_i; - QString lastId(""); + TQMap::const_iterator it_i; + TQString lastId(""); for(it_i = map.begin(); it_i != map.end(); ++it_i) { if((*it_i).id() > lastId) lastId = (*it_i).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextInstitutionID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadPayees(const QMap& map) +void MyMoneySeqAccessMgr::loadPayees(const TQMap& map) { m_payeeList = map; // scan the map to identify the last used id - QMap::const_iterator it_p; - QString lastId(""); + TQMap::const_iterator it_p; + TQString lastId(""); for(it_p = map.begin(); it_p != map.end(); ++it_p) { if((*it_p).id().length() <= PAYEE_ID_SIZE+1) { if((*it_p).id() > lastId) @@ -1081,31 +1081,31 @@ void MyMoneySeqAccessMgr::loadPayees(const QMap& map) } } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextPayeeID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadSecurities(const QMap& map) +void MyMoneySeqAccessMgr::loadSecurities(const TQMap& map) { m_securitiesList = map; // scan the map to identify the last used id - QMap::const_iterator it_s; - QString lastId(""); + TQMap::const_iterator it_s; + TQString lastId(""); for(it_s = map.begin(); it_s != map.end(); ++it_s) { if((*it_s).id() > lastId) lastId = (*it_s).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextSecurityID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadCurrencies(const QMap& map) +void MyMoneySeqAccessMgr::loadCurrencies(const TQMap& map) { m_currencyList = map; } @@ -1150,29 +1150,29 @@ void MyMoneySeqAccessMgr::loadBudgetId(const unsigned long id) m_nextBudgetID = id; } -const QString MyMoneySeqAccessMgr::value(const QString& key) const +const TQString MyMoneySeqAccessMgr::value(const TQString& key) const { return MyMoneyKeyValueContainer::value(key); } -void MyMoneySeqAccessMgr::setValue(const QString& key, const QString& val) +void MyMoneySeqAccessMgr::setValue(const TQString& key, const TQString& val) { MyMoneyKeyValueContainer::setValue(key, val); touch(); } -void MyMoneySeqAccessMgr::deletePair(const QString& key) +void MyMoneySeqAccessMgr::deletePair(const TQString& key) { MyMoneyKeyValueContainer::deletePair(key); touch(); } -const QMap MyMoneySeqAccessMgr::pairs(void) const +const TQMap MyMoneySeqAccessMgr::pairs(void) const { return MyMoneyKeyValueContainer::pairs(); } -void MyMoneySeqAccessMgr::setPairs(const QMap& list) +void MyMoneySeqAccessMgr::setPairs(const TQMap& list) { MyMoneyKeyValueContainer::setPairs(list); touch(); @@ -1194,11 +1194,11 @@ void MyMoneySeqAccessMgr::addSchedule(MyMoneySchedule& sched) void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_scheduleList.find(sched.id()); + it = m_scheduleList.tqfind(sched.id()); if(it == m_scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1207,11 +1207,11 @@ void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched) void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_scheduleList.find(sched.id()); + it = m_scheduleList.tqfind(sched.id()); if(it == m_scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1219,31 +1219,31 @@ void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched) m_scheduleList.remove(sched.id()); } -const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const QString& id) const +const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const TQString& id) const { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the schedule and if present, return it's data - pos = m_scheduleList.find(id); + pos = m_scheduleList.tqfind(id); if(pos != m_scheduleList.end()) return (*pos); // throw an exception, if it does not exist - QString msg = "Unknown schedule id '" + id + "'"; + TQString msg = "Unknown schedule id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -const QValueList MyMoneySeqAccessMgr::scheduleList( - const QString& accountId, +const TQValueList MyMoneySeqAccessMgr::scheduleList( + const TQString& accountId, const MyMoneySchedule::typeE type, const MyMoneySchedule::occurenceE occurence, const MyMoneySchedule::paymentTypeE paymentType, - const QDate& startDate, - const QDate& endDate, + const TQDate& startDate, + const TQDate& endDate, const bool overdue) const { - QMap::ConstIterator pos; - QValueList list; + TQMap::ConstIterator pos; + TQValueList list; // qDebug("scheduleList()"); @@ -1270,8 +1270,8 @@ const QValueList MyMoneySeqAccessMgr::scheduleList( if(!accountId.isEmpty()) { MyMoneyTransaction t = (*pos).transaction(); - QValueList::ConstIterator it; - QValueList splits; + TQValueList::ConstIterator it; + TQValueList splits; splits = t.splits(); for(it = splits.begin(); it != splits.end(); ++it) { if((*it).accountId() == accountId) @@ -1311,19 +1311,19 @@ const QValueList MyMoneySeqAccessMgr::scheduleList( return list; } -void MyMoneySeqAccessMgr::loadSchedules(const QMap& map) +void MyMoneySeqAccessMgr::loadSchedules(const TQMap& map) { m_scheduleList = map; // scan the map to identify the last used id - QMap::const_iterator it_s; - QString lastId(""); + TQMap::const_iterator it_s; + TQString lastId(""); for(it_s = map.begin(); it_s != map.end(); ++it_s) { if((*it_s).id() > lastId) lastId = (*it_s).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextScheduleID = atol(lastId.mid(pos)); } @@ -1334,16 +1334,16 @@ void MyMoneySeqAccessMgr::loadScheduleId(const unsigned long id) m_nextScheduleID = id; } -const QValueList MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes, +const TQValueList MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate date, - const QStringList& accounts) const + TQDate date, + const TQStringList& accounts) const { // qDebug("scheduleListEx"); - QMap::ConstIterator pos; - QValueList list; + TQMap::ConstIterator pos; + TQValueList list; if (!date.isValid()) return list; @@ -1370,7 +1370,7 @@ const QValueList MyMoneySeqAccessMgr::scheduleListEx(int schedu if (accounts.count() > 0) { - if (accounts.contains((*pos).account().id())) + if (accounts.tqcontains((*pos).account().id())) continue; } @@ -1393,12 +1393,12 @@ void MyMoneySeqAccessMgr::addSecurity(MyMoneySecurity& security) void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_securitiesList.find(security.id()); + it = m_securitiesList.tqfind(security.id()); if(it == m_securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during modifySecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1408,14 +1408,14 @@ void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security) void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security) { - QMap::ConstIterator it; + TQMap::ConstIterator it; // FIXME: check referential integrity - it = m_securitiesList.find(security.id()); + it = m_securitiesList.tqfind(security.id()); if(it == m_securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during removeSecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1423,9 +1423,9 @@ void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security) m_securitiesList.remove(security.id()); } -const MyMoneySecurity MyMoneySeqAccessMgr::security(const QString& id) const +const MyMoneySecurity MyMoneySeqAccessMgr::security(const TQString& id) const { - QMap::ConstIterator it = m_securitiesList.find(id); + TQMap::ConstIterator it = m_securitiesList.tqfind(id); if(it != m_securitiesList.end()) { return it.data(); @@ -1434,7 +1434,7 @@ const MyMoneySecurity MyMoneySeqAccessMgr::security(const QString& id) const return MyMoneySecurity(); } -const QValueList MyMoneySeqAccessMgr::securityList(void) const +const TQValueList MyMoneySeqAccessMgr::securityList(void) const { //qDebug("securityList: Security list size is %d, this=%8p", m_equitiesList.size(), (void*)this); return m_securitiesList.values(); @@ -1442,11 +1442,11 @@ const QValueList MyMoneySeqAccessMgr::securityList(void) const void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_currencyList.find(currency.id()); + it = m_currencyList.tqfind(currency.id()); if(it != m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot add currency with existing id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id())); } m_currencyList.insert(currency.id(), currency); @@ -1454,11 +1454,11 @@ void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency) void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_currencyList.find(currency.id()); + it = m_currencyList.tqfind(currency.id()); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot modify currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id())); } m_currencyList.modify(currency.id(), currency); @@ -1466,39 +1466,39 @@ void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency) void MyMoneySeqAccessMgr::removeCurrency(const MyMoneySecurity& currency) { - QMap::ConstIterator it; + TQMap::ConstIterator it; // FIXME: check referential integrity - it = m_currencyList.find(currency.id()); + it = m_currencyList.tqfind(currency.id()); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot remove currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id())); } m_currencyList.remove(currency.id()); } -const MyMoneySecurity MyMoneySeqAccessMgr::currency(const QString& id) const +const MyMoneySecurity MyMoneySeqAccessMgr::currency(const TQString& id) const { if(id.isEmpty()) { } - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_currencyList.find(id); + it = m_currencyList.tqfind(id); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot retrieve currency with unknown id '%1'").arg(id.data())); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); } return *it; } -const QValueList MyMoneySeqAccessMgr::currencyList(void) const +const TQValueList MyMoneySeqAccessMgr::currencyList(void) const { return m_currencyList.values(); } -const QValueList MyMoneySeqAccessMgr::reportList(void) const +const TQValueList MyMoneySeqAccessMgr::reportList(void) const { return m_reportList.values(); } @@ -1513,19 +1513,19 @@ void MyMoneySeqAccessMgr::addReport( MyMoneyReport& report ) report = newReport; } -void MyMoneySeqAccessMgr::loadReports(const QMap& map) +void MyMoneySeqAccessMgr::loadReports(const TQMap& map) { m_reportList = map; // scan the map to identify the last used id - QMap::const_iterator it_r; - QString lastId(""); + TQMap::const_iterator it_r; + TQString lastId(""); for(it_r = map.begin(); it_r != map.end(); ++it_r) { if((*it_r).id() > lastId) lastId = (*it_r).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextReportID = atol(lastId.mid(pos)); } @@ -1533,19 +1533,19 @@ void MyMoneySeqAccessMgr::loadReports(const QMap& map) void MyMoneySeqAccessMgr::modifyReport( const MyMoneyReport& report ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_reportList.find(report.id()); + it = m_reportList.tqfind(report.id()); if(it == m_reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_reportList.modify(report.id(), report); } -QString MyMoneySeqAccessMgr::nextReportID(void) +TQString MyMoneySeqAccessMgr::nextReportID(void) { - QString id; + TQString id; id.setNum(++m_nextReportID); id = "R" + id.rightJustify(REPORT_ID_SIZE, '0'); return id; @@ -1556,25 +1556,25 @@ unsigned MyMoneySeqAccessMgr::countReports(void) const return m_reportList.count(); } -const MyMoneyReport MyMoneySeqAccessMgr::report( const QString& _id ) const +const MyMoneyReport MyMoneySeqAccessMgr::report( const TQString& _id ) const { return m_reportList[_id]; } void MyMoneySeqAccessMgr::removeReport( const MyMoneyReport& report ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_reportList.find(report.id()); + it = m_reportList.tqfind(report.id()); if(it == m_reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_reportList.remove(report.id()); } -const QValueList MyMoneySeqAccessMgr::budgetList(void) const +const TQValueList MyMoneySeqAccessMgr::budgetList(void) const { return m_budgetList.values(); } @@ -1587,27 +1587,27 @@ void MyMoneySeqAccessMgr::addBudget( MyMoneyBudget& budget ) budget = newBudget; } -void MyMoneySeqAccessMgr::loadBudgets(const QMap& map) +void MyMoneySeqAccessMgr::loadBudgets(const TQMap& map) { m_budgetList = map; // scan the map to identify the last used id - QMap::const_iterator it_b; - QString lastId(""); + TQMap::const_iterator it_b; + TQString lastId(""); for(it_b = map.begin(); it_b != map.end(); ++it_b) { if((*it_b).id() > lastId) lastId = (*it_b).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextBudgetID = atol(lastId.mid(pos)); } } -const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const QString& budget) const +const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const TQString& budget) const { - QMap::ConstIterator it_p; + TQMap::ConstIterator it_p; for(it_p = m_budgetList.begin(); it_p != m_budgetList.end(); ++it_p) { if((*it_p).name() == budget) { @@ -1620,19 +1620,19 @@ const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const QString& budget) con void MyMoneySeqAccessMgr::modifyBudget( const MyMoneyBudget& budget ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_budgetList.find(budget.id()); + it = m_budgetList.tqfind(budget.id()); if(it == m_budgetList.end()) { - QString msg = "Unknown budget '" + budget.id() + "'"; + TQString msg = "Unknown budget '" + budget.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_budgetList.modify(budget.id(), budget); } -QString MyMoneySeqAccessMgr::nextBudgetID(void) +TQString MyMoneySeqAccessMgr::nextBudgetID(void) { - QString id; + TQString id; id.setNum(++m_nextBudgetID); id = "B" + id.rightJustify(BUDGET_ID_SIZE, '0'); return id; @@ -1643,18 +1643,18 @@ unsigned MyMoneySeqAccessMgr::countBudgets(void) const return m_budgetList.count(); } -MyMoneyBudget MyMoneySeqAccessMgr::budget( const QString& _id ) const +MyMoneyBudget MyMoneySeqAccessMgr::budget( const TQString& _id ) const { return m_budgetList[_id]; } void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_budgetList.find(budget.id()); + it = m_budgetList.tqfind(budget.id()); if(it == m_budgetList.end()) { - QString msg = "Unknown budget '" + budget.id() + "'"; + TQString msg = "Unknown budget '" + budget.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1664,8 +1664,8 @@ void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget ) void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price) { MyMoneySecurityPair pricePair(price.from(), price.to()); - QMap::ConstIterator it_m; - it_m = m_priceList.find(pricePair); + TQMap::ConstIterator it_m; + it_m = m_priceList.tqfind(pricePair); MyMoneyPriceEntries entries; if(it_m != m_priceList.end()) { @@ -1677,9 +1677,9 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price) // an existing one. MyMoneyPriceEntries::ConstIterator it; - it = entries.find(price.date()); + it = entries.tqfind(price.date()); if(it != entries.end()) { - if((*it).rate(QString()) == price.rate(QString()) + if((*it).rate(TQString()) == price.rate(TQString()) && (*it).source() == price.source()) // in case the information did not change, we don't do anything return; @@ -1698,8 +1698,8 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price) void MyMoneySeqAccessMgr::removePrice(const MyMoneyPrice& price) { MyMoneySecurityPair pricePair(price.from(), price.to()); - QMap::ConstIterator it_m; - it_m = m_priceList.find(pricePair); + TQMap::ConstIterator it_m; + it_m = m_priceList.tqfind(pricePair); MyMoneyPriceEntries entries; if(it_m != m_priceList.end()) { @@ -1723,20 +1723,20 @@ const MyMoneyPriceList MyMoneySeqAccessMgr::priceList(void) const return list; } -const MyMoneyPrice MyMoneySeqAccessMgr::price(const QString& fromId, const QString& toId, const QDate& _date, const bool exactDate) const +const MyMoneyPrice MyMoneySeqAccessMgr::price(const TQString& fromId, const TQString& toId, const TQDate& _date, const bool exactDate) const { MyMoneyPrice rc; MyMoneyPriceEntries::ConstIterator it; - QDate date(_date); + TQDate date(_date); // If no valid date is passed, we use today's date. if(!date.isValid()) - date = QDate::currentDate(); + date = TQDate::tqcurrentDate(); // If the caller selected an exact entry, we can search for // it using the date as the key if(exactDate) { - it = m_priceList[MyMoneySecurityPair(fromId, toId)].find(date); + it = m_priceList[MyMoneySecurityPair(fromId, toId)].tqfind(date); if(it != m_priceList[MyMoneySecurityPair(fromId, toId)].end()) rc = *it; @@ -1761,24 +1761,24 @@ void MyMoneySeqAccessMgr::clearCache(void) void MyMoneySeqAccessMgr::rebuildAccountBalances(void) { // reset the balance of all accounts to 0 - QMap map; + TQMap map; m_accountList.map(map); - QMap::iterator it_a; + TQMap::iterator it_a; for(it_a = map.begin(); it_a != map.end(); ++it_a) { (*it_a).setBalance(MyMoneyMoney(0)); } // now scan over all transactions and all splits and setup the balances - QMap::const_iterator it_t; + TQMap::const_iterator it_t; for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s = splits.begin(); + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s = splits.begin(); for(; it_s != splits.end(); ++it_s ) { if(!(*it_s).shares().isZero()) { - const QString& id = (*it_s).accountId(); + const TQString& id = (*it_s).accountId(); // locate the account and if present, update data - if(map.find(id) != map.end()) { + if(map.tqfind(id) != map.end()) { map[id].adjustBalance(*it_s); } } @@ -1796,14 +1796,14 @@ bool MyMoneySeqAccessMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFi // you miss the report checks in the following lines ;) bool rc = false; - const QString& id = obj.id(); - QMap::const_iterator it_t; - QMap::const_iterator it_a; - QMap::const_iterator it_i; - QMap::const_iterator it_p; - QMap::const_iterator it_b; - QMap::const_iterator it_sch; - QMap::const_iterator it_sec; + const TQString& id = obj.id(); + TQMap::const_iterator it_t; + TQMap::const_iterator it_a; + TQMap::const_iterator it_i; + TQMap::const_iterator it_p; + TQMap::const_iterator it_b; + TQMap::const_iterator it_sch; + TQMap::const_iterator it_sec; MyMoneyPriceList::const_iterator it_pr; // FIXME optimize the list of objects we have to checks @@ -1853,7 +1853,7 @@ bool MyMoneySeqAccessMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFi rc = (*it_sec).hasReferenceTo(id); } } - // within the pricelist we don't have to scan each entry. Checking the QPair + // within the pricelist we don't have to scan each entry. Checking the TQPair // members of the MyMoneySecurityPair is enough as they are identical to the // two security ids if(!skipCheck[RefCheckPrice]) { @@ -1917,10 +1917,10 @@ void MyMoneySeqAccessMgr::rollbackTransaction(void) m_priceList.rollbackTransaction(); } -void MyMoneySeqAccessMgr::removeReferences(const QString& id) +void MyMoneySeqAccessMgr::removeReferences(const TQString& id) { - QMap::const_iterator it_r; - QMap::const_iterator it_b; + TQMap::const_iterator it_r; + TQMap::const_iterator it_b; // remove from reports for(it_r = m_reportList.begin(); it_r != m_reportList.end(); ++it_r) { diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h index f200bef..ddc2030 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h @@ -20,8 +20,8 @@ * * ***************************************************************************/ -#ifndef MYMONEYSEQACCESSMGR_H -#define MYMONEYSEQACCESSMGR_H +#ifndef MYMONEYSETQACCESSMGR_H +#define MYMONEYSETQACCESSMGR_H // ---------------------------------------------------------------------------- // QT Includes @@ -50,7 +50,7 @@ * will be created containing the new balance value. * * @see MyMoneySeqAccessMgr::balance() and - * MyMoneySeqAccessMgr::invalidateBalanceCache() for a usage example + * MyMoneySeqAccessMgr::tqinvalidateBalanceCache() for a usage example */ class MyMoneyBalanceCacheItem { public: @@ -85,8 +85,8 @@ public: // general get functions const MyMoneyPayee user(void) const { return m_user; }; - const QDate creationDate(void) const { return m_creationDate; }; - const QDate lastModificationDate(void) const { return m_lastModificationDate; }; + const TQDate creationDate(void) const { return m_creationDate; }; + const TQDate lastModificationDate(void) const { return m_lastModificationDate; }; unsigned int currentFixVersion(void) const { return m_currentFixVersion; }; unsigned int fileFixVersion(void) const { return m_fileFixVersion; }; @@ -94,8 +94,8 @@ public: // general set functions void setUser(const MyMoneyPayee& user) { m_user = user; touch(); }; - void setCreationDate(const QDate& val) { m_creationDate = val; touch(); }; - void setLastModificationDate(const QDate& val) { m_lastModificationDate = val; m_dirty = false; }; + void setCreationDate(const TQDate& val) { m_creationDate = val; touch(); }; + void setLastModificationDate(const TQDate& val) { m_lastModificationDate = val; m_dirty = false; }; void setFileFixVersion(const unsigned int v) { m_fileFixVersion = v; }; /** * This method is used to get a SQL reader for subsequent database access @@ -122,7 +122,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - const MyMoneyAccount account(const QString& id) const; + const MyMoneyAccount account(const TQString& id) const; /** * This method is used to check whether a given @@ -131,26 +131,26 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - bool isStandardAccount(const QString& id) const; + bool isStandardAccount(const TQString& id) const; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. Possible + * @param id TQString reference to one of the standard accounts. Possible * values are: * * @li STD_ACC_LIABILITY * @li STD_ACC_ASSET * @li STD_ACC_EXPENSE * @li STD_ACC_INCOME - * @li STD_ACC_EQUITY + * @li STD_ACC_ETQUITY * - * @param name QString reference to the name to be set + * @param name TQString reference to the name to be set * */ - void setAccountName(const QString& id, const QString& name); + void setAccountName(const TQString& id, const TQString& name); /** * This method is used to create a new account @@ -174,22 +174,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - const MyMoneyPayee payee(const QString& id) const; + const MyMoneyPayee payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee reference to object of payee */ - const MyMoneyPayee payeeByName(const QString& payee) const; + const MyMoneyPayee payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -213,24 +213,24 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - const QValueList payeeList(void) const; + const TQValueList payeeList(void) const; /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects passed as arguments will be modified + * (tqparent) account. The objects passed as arguments will be modified * accordingly. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account); + void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account); /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * An exception will be thrown upon error conditions. * * @param institution The complete institution information in a @@ -241,7 +241,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * as QString in the transaction object. The accounts of the referenced splits + * as TQString in the transaction object. The accounts of the referenced splits * will be updated to have a reference to the transaction just added. * * @param transaction reference to the transaction @@ -286,14 +286,14 @@ public: void modifyTransaction(const MyMoneyTransaction& transaction); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * This method is used to remove a transaction from the transaction @@ -328,20 +328,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - const MyMoneyTransaction transaction(const QString& id) const; + const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - const MyMoneyTransaction transaction(const QString& account, const int idx) const; + const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method is used to determince, if the account with the @@ -350,7 +350,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - bool hasActiveSplits(const QString& id) const; + bool hasActiveSplits(const TQString& id) const; /** * This method is used to return the actual balance of an account @@ -363,7 +363,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney balance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney balance(const TQString& id, const TQDate& date = TQDate()) const; /** * This method is used to return the actual balance of an account @@ -376,7 +376,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney totalBalance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date = TQDate()) const; /** * Returns the institution of a given ID @@ -385,7 +385,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - const MyMoneyInstitution institution(const QString& id) const; + const MyMoneyInstitution institution(const TQString& id) const; /** * This method returns an indicator if the storage object has been @@ -407,18 +407,18 @@ public: * This method returns a list of the institutions * inside a MyMoneyFile object * - * @return QMap containing the institution information + * @return TQMap containing the institution information */ - const QValueList institutionList(void) const; + const TQValueList institutionList(void) const; /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - void accountList(QValueList& list) const; + void accountList(TQValueList& list) const; /** * This method is used to pull a list of transactions from the file @@ -434,9 +434,9 @@ public: * @param list reference to list * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const; /** * This method is used to pull a list of transactions from the file @@ -452,35 +452,35 @@ public: * @param list reference to list * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList > + * @return set of transactions in form of a TQValueList > */ - void transactionList(QValueList< QPair >& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList< TQPair >& list, MyMoneyTransactionFilter& filter) const; /** * Compatibility interface for the previous method. */ - const QValueList transactionList(MyMoneyTransactionFilter& filter) const; + const TQValueList transactionList(MyMoneyTransactionFilter& filter) const; /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - bool isDuplicateTransaction(const QString& id) const { return m_transactionKeys.contains(id); } + bool isDuplicateTransaction(const TQString& id) const { return m_transactionKeys.tqcontains(id); } /** * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - unsigned int transactionCount(const QString& account = QString()) const; + unsigned int transactionCount(const TQString& account = TQString()) const; - const QMap transactionCountMap(void) const; + const TQMap transactionCountMap(void) const; /** * This method returns the number of institutions currently known to file @@ -526,15 +526,15 @@ public: * This method is used to return the standard equity account * @return MyMoneyAccount equity account(group) */ - const MyMoneyAccount equity(void) const { return account(STD_ACC_EQUITY); }; + const MyMoneyAccount equity(void) const { return account(STD_ACC_ETQUITY); }; - virtual void loadAccounts(const QMap& acc); - virtual void loadTransactions(const QMap& map); - virtual void loadInstitutions(const QMap& map); - virtual void loadPayees(const QMap& map); - virtual void loadSchedules(const QMap& map); - virtual void loadSecurities(const QMap& map); - virtual void loadCurrencies(const QMap& map); + virtual void loadAccounts(const TQMap& acc); + virtual void loadTransactions(const TQMap& map); + virtual void loadInstitutions(const TQMap& map); + virtual void loadPayees(const TQMap& map); + virtual void loadSchedules(const TQMap& map); + virtual void loadSecurities(const TQMap& map); + virtual void loadCurrencies(const TQMap& map); virtual void loadPrices(const MyMoneyPriceList& list); virtual void loadAccountId(const unsigned long id); @@ -560,34 +560,34 @@ public: * This method is used to extract a value from * KeyValueContainer. For details see MyMoneyKeyValueContainer::value(). * - * @param key const reference to QString containing the key - * @return QString containing the value + * @param key const reference to TQString containing the key + * @return TQString containing the value */ - const QString value(const QString& key) const; + const TQString value(const TQString& key) const; /** * This method is used to set a value in the * KeyValueContainer. For details see MyMoneyKeyValueContainer::setValue(). * - * @param key const reference to QString containing the key - * @param val const reference to QString containing the value + * @param key const reference to TQString containing the key + * @param val const reference to TQString containing the value */ - void setValue(const QString& key, const QString& val); + void setValue(const TQString& key, const TQString& val); /** * This method is used to delete a key-value-pair from the * KeyValueContainer identified by the parameter * @p key. For details see MyMoneyKeyValueContainer::deletePair(). * - * @param key const reference to QString containing the key + * @param key const reference to TQString containing the key */ - void deletePair(const QString& key); + void deletePair(const TQString& key); // documented in IMyMoneySerialize base class - const QMap pairs(void) const; + const TQMap pairs(void) const; // documented in IMyMoneySerialize base class - void setPairs(const QMap& list); + void setPairs(const TQMap& list); /** * This method is used to add a scheduled transaction to the engine. @@ -627,10 +627,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySchedule schedule(const QString& id) const; + const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to create a new security object. The ID will be created @@ -669,17 +669,17 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity security(const QString& id) const; + const MyMoneySecurity security(const TQString& id) const; /** * This method returns a list of security objects that the engine has * knowledge of. */ - const QValueList securityList(void) const; + const TQValueList securityList(void) const; /** * This method is used to add a new currency object to the engine. @@ -718,10 +718,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity currency(const QString& id) const; + const MyMoneySecurity currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -729,9 +729,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyCurrency objects. + * @return TQValueList of all MyMoneyCurrency objects. */ - const QValueList currencyList(void) const; + const TQValueList currencyList(void) const; /** * This method is used to extract a list of scheduled transactions @@ -739,7 +739,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -751,27 +751,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - const QValueList scheduleList(const QString& accountId = QString(), + const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - const QValueList scheduleListEx( int scheduleTypes, + const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to retrieve the list of all reports @@ -779,9 +779,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - const QValueList reportList( void ) const; + const TQValueList reportList( void ) const; /** * This method is used to add a new report to the engine. @@ -803,7 +803,7 @@ public: * * @param reports reference to the map of MyMoneyReport objects */ - void loadReports( const QMap& reports ); + void loadReports( const TQMap& reports ); /** * This method is used to modify an existing MyMoneyReport @@ -829,10 +829,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - const MyMoneyReport report( const QString& id ) const; + const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -850,9 +850,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - const QValueList budgetList( void ) const; + const TQValueList budgetList( void ) const; /** * This method is used to add a new budget to the engine. @@ -874,18 +874,18 @@ public: * * @param budgets reference to the map of MyMoneyBudget object */ - void loadBudgets(const QMap& budgets); + void loadBudgets(const TQMap& budgets); /** * This method is used to retrieve the id to a corresponding * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget reference to object of budget */ - const MyMoneyBudget budgetByName(const QString& budget) const; + const MyMoneyBudget budgetByName(const TQString& budget) const; /** * This method is used to modify an existing MyMoneyBudget @@ -911,10 +911,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - MyMoneyBudget budget( const QString& id ) const; + MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -939,9 +939,9 @@ public: /** * This method retrieves a price from the price list. - * If @p date is inValid, QDate::currentDate() is assumed. + * If @p date is inValid, TQDate::tqcurrentDate() is assumed. */ - const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const; + const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; /** * This method returns a list of all price entries. @@ -958,7 +958,7 @@ public: * by another engine object. * * @param obj const reference to object to be checked - * @param skipCheck QBitArray with ReferenceCheckBits set for which + * @param skipCheck TQBitArray with ReferenceCheckBits set for which * the check should be skipped * * @retval false @p object is not referenced @@ -977,7 +977,7 @@ public: virtual void rollbackTransaction(void); protected: - void removeReferences(const QString& id); + void removeReferences(const TQString& id); private: @@ -997,12 +997,12 @@ private: void touch(void); /** - * This method is used to invalidate the cached balance for - * the selected account and all it's parents. + * This method is used to tqinvalidate the cached balance for + * the selected account and all it's tqparents. * * @param id id of the account in question */ - void invalidateBalanceCache(const QString& id); + void tqinvalidateBalanceCache(const TQString& id); /** * This member variable keeps the User information. @@ -1065,50 +1065,50 @@ private: * The member variable m_institutionList is the container for the * institutions known within this file. */ - MyMoneyMap m_institutionList; + MyMoneyMap m_institutionList; /** * The member variable m_accountList is the container for the accounts * known within this file. */ - MyMoneyMap m_accountList; + MyMoneyMap m_accountList; /** * The member variable m_balanceCache is the container for the * accounts actual balance */ - mutable QMap m_balanceCache; + mutable TQMap m_balanceCache; /** * This member keeps the date for which the m_balanceCache member * is valid. In case the whole cache is invalid it is set to - * QDate(). + * TQDate(). */ - mutable QDate m_balanceCacheDate; + mutable TQDate m_balanceCacheDate; /** * The member variable m_transactionList is the container for all * transactions within this file. * @see m_transactionKeys */ - MyMoneyMap m_transactionList; + MyMoneyMap m_transactionList; /** * The member variable m_transactionKeys is used to convert * transaction id's into the corresponding key used in m_transactionList. * @see m_transactionList; */ - MyMoneyMap m_transactionKeys; + MyMoneyMap m_transactionKeys; /** * A list containing all the payees that have been used */ - MyMoneyMap m_payeeList; + MyMoneyMap m_payeeList; /** * A list containing all the scheduled transactions */ - MyMoneyMap m_scheduleList; + MyMoneyMap m_scheduleList; /** * A list containing all the security information objects. Each object @@ -1117,19 +1117,19 @@ private: * to determine the cost basis for sales, as well as the source of * information for reports in a security account. */ - MyMoneyMap m_securitiesList; + MyMoneyMap m_securitiesList; /** * A list containing all the currency information objects. */ - MyMoneyMap m_currencyList; + MyMoneyMap m_currencyList; - MyMoneyMap m_reportList; + MyMoneyMap m_reportList; /** * A list containing all the budget information objects. */ - MyMoneyMap m_budgetList; + MyMoneyMap m_budgetList; MyMoneyMap m_priceList; @@ -1143,13 +1143,13 @@ private: * object. It is set during the constructor and can only be modified using * the stream read operator. */ - QDate m_creationDate; + TQDate m_creationDate; /** * This member variable keeps the date of the last modification of * the MyMoneySeqAccessMgr object. */ - QDate m_lastModificationDate; + TQDate m_lastModificationDate; /** * This member variable contains the current fix level of application @@ -1165,58 +1165,58 @@ private: * This method is used to get the next valid ID for a institution * @return id for a institution */ - QString nextInstitutionID(void); + TQString nextInstitutionID(void); /** * This method is used to get the next valid ID for an account * @return id for an account */ - QString nextAccountID(void); + TQString nextAccountID(void); /** * This method is used to get the next valid ID for a transaction * @return id for a transaction */ - QString nextTransactionID(void); + TQString nextTransactionID(void); /** * This method is used to get the next valid ID for a payee * @return id for a payee */ - QString nextPayeeID(void); + TQString nextPayeeID(void); /** * This method is used to get the next valid ID for a scheduled transaction * @return id for a scheduled transaction */ - QString nextScheduleID(void); + TQString nextScheduleID(void); /** * This method is used to get the next valid ID for an security object. * @return id for an security object */ - QString nextSecurityID(void); + TQString nextSecurityID(void); - QString nextReportID(void); + TQString nextReportID(void); /** * This method is used to get the next valid ID for a budget object. * @return id for an budget object */ - QString nextBudgetID(void); + TQString nextBudgetID(void); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account * @param sendNotification if true, notifications with the ids * of all modified objects are send */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent, const bool sendNotification); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent, const bool sendNotification); /** * This method will close a database and log the use roff */ diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp index 09bf791..9decdce 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp @@ -63,7 +63,7 @@ void MyMoneySeqAccessMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->m_scheduleList.count() == 0); CPPUNIT_ASSERT(m->m_dirty == false); - CPPUNIT_ASSERT(m->m_creationDate == QDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(m->liability().name() == "Liability"); CPPUNIT_ASSERT(m->asset().name() == "Asset"); @@ -354,7 +354,7 @@ void MyMoneySeqAccessMgrTest::testModifyAccount() { m->commitTransaction(); m->startTransaction(); MyMoneyAccount b = m->account("A000001"); - CPPUNIT_ASSERT(b.parentAccountId() == a.parentAccountId()); + CPPUNIT_ASSERT(b.tqparentAccountId() == a.tqparentAccountId()); CPPUNIT_ASSERT(b.name() == "New account name"); CPPUNIT_ASSERT(m->dirty() == true); } catch (MyMoneyException *e) { @@ -383,7 +383,7 @@ void MyMoneySeqAccessMgrTest::testModifyAccount() { delete e; } - // use different parent + // use different tqparent a.setParentAccountId("A000002"); try { m->modifyAccount(c); @@ -422,7 +422,7 @@ void MyMoneySeqAccessMgrTest::testModifyInstitution() { } } -void MyMoneySeqAccessMgrTest::testReparentAccount() { +void MyMoneySeqAccessMgrTest::testRetqparentAccount() { // this one adds some accounts to the database MyMoneyAccount ex1; ex1.setAccountType(MyMoneyAccount::Expense); @@ -460,27 +460,27 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() { CPPUNIT_ASSERT(in.id() == "A000005"); CPPUNIT_ASSERT(ch.id() == "A000006"); - MyMoneyAccount parent = m->expense(); + MyMoneyAccount tqparent = m->expense(); - m->addAccount(parent, ex1); + m->addAccount(tqparent, ex1); m->addAccount(ex1, ex2); - m->addAccount(parent, ex3); - m->addAccount(parent, ex4); + m->addAccount(tqparent, ex3); + m->addAccount(tqparent, ex4); - parent = m->income(); - m->addAccount(parent, in); + tqparent = m->income(); + m->addAccount(tqparent, in); - parent = m->asset(); - m->addAccount(parent, ch); + tqparent = m->asset(); + m->addAccount(tqparent, ch); CPPUNIT_ASSERT(m->expense().accountCount() == 3); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 1); - CPPUNIT_ASSERT(ex3.parentAccountId() == STD_ACC_EXPENSE); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == STD_ACC_EXPENSE); m->reparentAccount(ex3, ex1); CPPUNIT_ASSERT(m->expense().accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); - CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == ex1.id()); } catch (MyMoneyException *e) { std::cout << std::endl << e->what() << std::endl; delete e; @@ -489,7 +489,7 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() { } void MyMoneySeqAccessMgrTest::testAddTransactions() { - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount ch; MyMoneyTransaction t1, t2; @@ -503,14 +503,14 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000005"); // Salary s.setShares(-100000); s.setValue(-100000); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2002,5,10)); + t1.setPostDate(TQDate(2002,5,10)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -530,35 +530,35 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { try { // I spent some money, not so great - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000004"); // Grosseries s.setShares(10000); s.setValue(10000); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); // 16% sales tax s.setShares(1200); s.setValue(1200); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000003"); // 7% sales tax s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000006"); // Checkings account s.setShares(-11600); s.setValue(-11600); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - t2.setPostDate(QDate(2002,5,9)); + t2.setPostDate(TQDate(2002,5,9)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -572,8 +572,8 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { CPPUNIT_ASSERT(t2.splitCount() == 4); CPPUNIT_ASSERT(m->transactionCount() == 2); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; it_k = m->m_transactionKeys.begin(); it_t = m->m_transactionList.begin(); @@ -591,12 +591,12 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000002"); ++it; @@ -607,7 +607,7 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { /* removed with MyMoneyAccount::Transaction CPPUNIT_ASSERT(ch.transactionCount() == 2); - QValueList::ConstIterator it_l; + TQValueList::ConstIterator it_l; it_l = ch.transactionList().begin(); CPPUNIT_ASSERT((*it_l).transactionID() == "T000000000000000002"); CPPUNIT_ASSERT((*it_l).balance() == -11600); @@ -642,9 +642,9 @@ void MyMoneySeqAccessMgrTest::testBalance() { CPPUNIT_ASSERT(m->balance("A000002") == MyMoneyMoney(1200)); CPPUNIT_ASSERT(m->balance("A000003") == MyMoneyMoney(400)); CPPUNIT_ASSERT(m->totalBalance("A000001") == MyMoneyMoney(1600)); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,9)) == MyMoneyMoney(-11600)); - CPPUNIT_ASSERT(m->balance("A000005", QDate(2002,5,10)) == MyMoneyMoney(-100000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,10)) == MyMoneyMoney(88400)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,9)) == MyMoneyMoney(-11600)); + CPPUNIT_ASSERT(m->balance("A000005", TQDate(2002,5,10)) == MyMoneyMoney(-100000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,10)) == MyMoneyMoney(88400)); } void MyMoneySeqAccessMgrTest::testModifyTransaction() { @@ -682,15 +682,15 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { } // now modify the date - t.setPostDate(QDate(2002,5,11)); + t.setPostDate(TQDate(2002,5,11)); try { m->modifyTransaction(t); CPPUNIT_ASSERT(m->balance("A000004") == MyMoneyMoney(11000)); CPPUNIT_ASSERT(m->balance("A000006") == MyMoneyMoney(100000-12600)); CPPUNIT_ASSERT(m->totalBalance("A000001") == MyMoneyMoney(1600)); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; it_k = m->m_transactionKeys.begin(); it_t = m->m_transactionList.begin(); CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); @@ -707,12 +707,12 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000001"); ++it; @@ -723,7 +723,7 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { /* removed with MyMoneyAccount::Transaction // CPPUNIT_ASSERT(ch.transactionCount() == 2); - QValueList::ConstIterator it_l; + TQValueList::ConstIterator it_l; it_l = ch.transactionList().begin(); CPPUNIT_ASSERT((*it_l).transactionID() == "T000000000000000001"); CPPUNIT_ASSERT((*it_l).balance() == 100000); @@ -792,7 +792,7 @@ void MyMoneySeqAccessMgrTest::testRemoveUnusedAccount() { CPPUNIT_ASSERT(i.accountCount() == 0); CPPUNIT_ASSERT(m->accountCount() == 7); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->removeAccount(a); m->commitTransaction(); @@ -822,7 +822,7 @@ void MyMoneySeqAccessMgrTest::testRemoveUsedAccount() { void MyMoneySeqAccessMgrTest::testRemoveInstitution() { testModifyInstitution(); - testReparentAccount(); + testRetqparentAccount(); MyMoneyInstitution i; MyMoneyAccount a; @@ -843,7 +843,7 @@ void MyMoneySeqAccessMgrTest::testRemoveInstitution() { // now remove the institution and see if the account survived ;-) try { m->removeInstitution(i); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->commitTransaction(); m->startTransaction(); @@ -881,7 +881,7 @@ void MyMoneySeqAccessMgrTest::testRemoveTransaction() { void MyMoneySeqAccessMgrTest::testTransactionList() { testAddTransactions(); - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 2); @@ -889,7 +889,7 @@ void MyMoneySeqAccessMgrTest::testTransactionList() { CPPUNIT_ASSERT((*(list.at(1))).id() == "T000000000000000001"); filter.clear(); - filter.addAccount(QString("A000003")); + filter.addAccount(TQString("A000003")); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT((*(list.at(0))).id() == "T000000000000000002"); @@ -1091,7 +1091,7 @@ void MyMoneySeqAccessMgrTest::testPayeeName() { testAddPayee(); MyMoneyPayee p; - QString name("THB"); + TQString name("THB"); // OK case try { @@ -1193,11 +1193,11 @@ void MyMoneySeqAccessMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); - t1.setPostDate(QDate(2003,7,10)); + t1.setPostDate(TQDate(2003,7,10)); schedule.setTransaction(t1); m->addSchedule(schedule); @@ -1215,8 +1215,8 @@ void MyMoneySeqAccessMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); m->addSchedule(schedule); @@ -1302,9 +1302,9 @@ void MyMoneySeqAccessMgrTest::testRemoveSchedule() { } void MyMoneySeqAccessMgrTest::testScheduleList() { - QDate testDate = QDate::currentDate(); - QDate notOverdue = testDate.addDays(2); - QDate overdue = testDate.addDays(-2); + TQDate testDate = TQDate::tqcurrentDate(); + TQDate notOverdue = testDate.addDays(2); + TQDate overdue = testDate.addDays(-2); MyMoneyTransaction t1; @@ -1317,8 +1317,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_ONCE, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t1.setPostDate(notOverdue); @@ -1335,8 +1335,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_DIRECTDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t2.setPostDate(notOverdue.addDays(1)); @@ -1353,8 +1353,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t3.setPostDate(notOverdue.addDays(2)); @@ -1370,8 +1370,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule schedule4("Schedule 4", MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(), notOverdue.addDays(31), false, false); @@ -1389,7 +1389,7 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { CPPUNIT_FAIL("Unexpected exception"); } - QValueList list; + TQValueList list; // no filter list = m->scheduleList(); @@ -1436,7 +1436,7 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), notOverdue.addDays(1)); CPPUNIT_ASSERT(list.count() == 3); CPPUNIT_ASSERT(list[0].name() == "Schedule 1"); @@ -1457,8 +1457,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), - QDate(), + TQDate(), + TQDate(), true); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT(list[0].name() == "Schedule 4"); @@ -1606,7 +1606,7 @@ void MyMoneySeqAccessMgrTest::testCurrencyList() void MyMoneySeqAccessMgrTest::testAccountList() { - QValueList accounts; + TQValueList accounts; m->accountList(accounts); CPPUNIT_ASSERT(accounts.count() == 0); testAddNewAccount(); @@ -1628,7 +1628,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() m->rollbackTransaction(); // account loader - QMap amap; + TQMap amap; MyMoneyAccount acc("A0000176", MyMoneyAccount()); amap[acc.id()] = acc; m->loadAccounts(amap); @@ -1637,7 +1637,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextAccountID == 176); // transaction loader - QMap tmap; + TQMap tmap; MyMoneyTransaction t("T000000108", MyMoneyTransaction()); tmap[t.id()] = t; m->loadTransactions(tmap); @@ -1646,7 +1646,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextTransactionID == 108); // institution loader - QMap imap; + TQMap imap; MyMoneyInstitution inst("I000028", MyMoneyInstitution()); imap[inst.id()] = inst; m->loadInstitutions(imap); @@ -1655,7 +1655,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextInstitutionID == 28); // payee loader - QMap pmap; + TQMap pmap; MyMoneyPayee p("P1234", MyMoneyPayee()); pmap[p.id()] = p; m->loadPayees(pmap); @@ -1664,7 +1664,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextPayeeID == 1234); // security loader - QMap smap; + TQMap smap; MyMoneySecurity s("S54321", MyMoneySecurity()); smap[s.id()] = s; m->loadSecurities(smap); @@ -1673,7 +1673,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextSecurityID == 54321); // schedule loader - QMap schmap; + TQMap schmap; MyMoneySchedule sch("SCH6789", MyMoneySchedule()); schmap[sch.id()] = sch; m->loadSchedules(schmap); @@ -1682,7 +1682,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextScheduleID == 6789); // report loader - QMap rmap; + TQMap rmap; MyMoneyReport r("R1298", MyMoneyReport()); rmap[r.id()] = r; m->loadReports(rmap); @@ -1691,7 +1691,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextReportID == 1298); // budget loader - QMap bmap; + TQMap bmap; MyMoneyBudget b("B89765", MyMoneyBudget()); bmap[b.id()] = b; m->loadBudgets(bmap); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h index b9fa763..57f1cd6 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#ifndef __MYMONEYSEQACCESSMGRTEST_H__ -#define __MYMONEYSEQACCESSMGRTEST_H__ +#ifndef __MYMONEYSETQACCESSMGRTEST_H__ +#define __MYMONEYSETQACCESSMGRTEST_H__ #include #include @@ -38,7 +38,7 @@ class MyMoneySeqAccessMgrTest : public CppUnit::TestFixture { CPPUNIT_TEST(testIsStandardAccount); CPPUNIT_TEST(testNewAccount); CPPUNIT_TEST(testAddNewAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testAddInstitution); CPPUNIT_TEST(testInstitution); CPPUNIT_TEST(testAccount2Institution); @@ -94,7 +94,7 @@ public: void testAccount2Institution(); void testModifyAccount(); void testModifyInstitution(); - void testReparentAccount(); + void testRetqparentAccount(); void testAddTransactions(); void testTransactionCount(); void testBalance(); diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp index 31f051e..bb0ab60 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -42,8 +42,8 @@ #include "../mymoneyreport.h" #include "../mymoneyinstitution.h" -QStringList MyMoneyStorageANON::zKvpNoModify = QStringList::split(",","kmm-baseCurrency,PreferredAccount,Tax,fixed-interest,interest-calculation,payee,schedule,term,kmm-online-source,kmm-brokerage-account,lastStatementDate,kmm-sort-reconcile,kmm-sort-std,kmm-iconpos,mm-closed,payee,schedule,term,lastImportedTransactionDate,VatAccount,VatRate,kmm-matched-tx,Imported"); -QStringList MyMoneyStorageANON::zKvpXNumber = QStringList::split(",","final-payment,loan-amount,periodic-payment,lastStatementBalance"); +TQStringList MyMoneyStorageANON::zKvpNoModify = TQStringList::split(",","kmm-baseCurrency,PreferredAccount,Tax,fixed-interest,interest-calculation,payee,schedule,term,kmm-online-source,kmm-brokerage-account,lastStatementDate,kmm-sort-reconcile,kmm-sort-std,kmm-iconpos,mm-closed,payee,schedule,term,lastImportedTransactionDate,VatAccount,VatRate,kmm-matched-tx,Imported"); +TQStringList MyMoneyStorageANON::zKvpXNumber = TQStringList::split(",","final-payment,loan-amount,periodic-payment,lastStatementBalance"); MyMoneyStorageANON::MyMoneyStorageANON() : @@ -54,7 +54,7 @@ MyMoneyStorageANON::MyMoneyStorageANON() : int msec; do { - msec = QTime::currentTime().msec(); + msec = TQTime::currentTime().msec(); } while(msec == 0); m_factor = MyMoneyMoney(msec, 10).reduce(); } @@ -63,29 +63,29 @@ MyMoneyStorageANON::~MyMoneyStorageANON() { } -void MyMoneyStorageANON::readFile(QIODevice* , IMyMoneySerialize* ) +void MyMoneyStorageANON::readFile(TQIODevice* , IMyMoneySerialize* ) { throw new MYMONEYEXCEPTION("Cannot read a file through MyMoneyStorageANON!!"); } -void MyMoneyStorageANON::writeUserInformation(QDomElement& userInfo) +void MyMoneyStorageANON::writeUserInformation(TQDomElement& userInfo) { MyMoneyPayee user = m_storage->user(); - userInfo.setAttribute(QString("name"), hideString(user.name())); - userInfo.setAttribute(QString("email"), hideString(user.email())); + userInfo.setAttribute(TQString("name"), hideString(user.name())); + userInfo.setAttribute(TQString("email"), hideString(user.email())); - QDomElement address = m_doc->createElement("ADDRESS"); - address.setAttribute(QString("street"), hideString(user.address())); - address.setAttribute(QString("city"), hideString(user.city())); - address.setAttribute(QString("county"), hideString(user.state())); - address.setAttribute(QString("zipcode"), hideString(user.postcode())); - address.setAttribute(QString("telephone"), hideString(user.telephone())); + TQDomElement address = m_doc->createElement("ADDRESS"); + address.setAttribute(TQString("street"), hideString(user.address())); + address.setAttribute(TQString("city"), hideString(user.city())); + address.setAttribute(TQString("county"), hideString(user.state())); + address.setAttribute(TQString("zipcode"), hideString(user.postcode())); + address.setAttribute(TQString("telephone"), hideString(user.telephone())); userInfo.appendChild(address); } -void MyMoneyStorageANON::writeInstitution(QDomElement& institution, const MyMoneyInstitution& _i) +void MyMoneyStorageANON::writeInstitution(TQDomElement& institution, const MyMoneyInstitution& _i) { MyMoneyInstitution i(_i); @@ -103,7 +103,7 @@ void MyMoneyStorageANON::writeInstitution(QDomElement& institution, const MyMone } -void MyMoneyStorageANON::writePayee(QDomElement& payee, const MyMoneyPayee& _p) +void MyMoneyStorageANON::writePayee(TQDomElement& payee, const MyMoneyPayee& _p) { MyMoneyPayee p(_p); @@ -117,15 +117,15 @@ void MyMoneyStorageANON::writePayee(QDomElement& payee, const MyMoneyPayee& _p) p.setTelephone(hideString(p.telephone())); p.setNotes(hideString(p.notes())); bool ignoreCase; - QStringList keys; + TQStringList keys; MyMoneyPayee::payeeMatchType matchType = p.matchData(ignoreCase, keys); - QRegExp exp("[A-Za-z]"); - p.setMatchData(matchType, ignoreCase, QStringList::split(";", keys.join(";").replace(exp, "x"))); + TQRegExp exp("[A-Za-z]"); + p.setMatchData(matchType, ignoreCase, TQStringList::split(";", keys.join(";").tqreplace(exp, "x"))); MyMoneyStorageXML::writePayee(payee, p); } -void MyMoneyStorageANON::writeAccount(QDomElement& account, const MyMoneyAccount& _p) +void MyMoneyStorageANON::writeAccount(TQDomElement& account, const MyMoneyAccount& _p) { MyMoneyAccount p(_p); @@ -149,10 +149,10 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) tn.setBankID(hideString(tx.bankID())); // hide split data - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneySplit s = (*it_s); - s.setMemo(QString("%1/%2").arg(tn.id()).arg(s.id())); + s.setMemo(TQString("%1/%2").tqarg(tn.id()).tqarg(s.id())); if(s.value() != MyMoneyMoney::autoCalc) { s.setValue((s.value() * m_factor)); @@ -175,14 +175,14 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp) { - QMap pairs; - QMap::const_iterator it; + TQMap pairs; + TQMap::const_iterator it; for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it) { - if ( zKvpXNumber.contains( it.key() ) || it.key().left(3)=="ir-" ) + if ( zKvpXNumber.tqcontains( it.key() ) || it.key().left(3)=="ir-" ) pairs[it.key()] = hideNumber(MyMoneyMoney(it.data())).toString(); - else if ( zKvpNoModify.contains( it.key() ) ) + else if ( zKvpNoModify.tqcontains( it.key() ) ) pairs[it.key()] = it.data(); else pairs[it.key()] = hideString(it.data()); @@ -190,7 +190,7 @@ void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp) kvp.setPairs(pairs); } -void MyMoneyStorageANON::writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx) +void MyMoneyStorageANON::writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx) { MyMoneyTransaction tn = tx; @@ -199,7 +199,7 @@ void MyMoneyStorageANON::writeTransaction(QDomElement& transactions, const MyMon MyMoneyStorageXML::writeTransaction(transactions, tn); } -void MyMoneyStorageANON::writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& sx) +void MyMoneyStorageANON::writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& sx) { MyMoneySchedule sn = sx; MyMoneyTransaction tn = sn.transaction(); @@ -212,7 +212,7 @@ void MyMoneyStorageANON::writeSchedule(QDomElement& scheduledTx, const MyMoneySc MyMoneyStorageXML::writeSchedule(scheduledTx, sn); } -void MyMoneyStorageANON::writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security) +void MyMoneyStorageANON::writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security) { MyMoneySecurity s = security; s.setName(security.id()); @@ -221,9 +221,9 @@ void MyMoneyStorageANON::writeSecurity(QDomElement& securityElement, const MyMon MyMoneyStorageXML::writeSecurity(securityElement, s); } -QString MyMoneyStorageANON::hideString(const QString& _in) const +TQString MyMoneyStorageANON::hideString(const TQString& _in) const { - return QString(_in).fill('x'); + return TQString(_in).fill('x'); } MyMoneyMoney MyMoneyStorageANON::hideNumber(const MyMoneyMoney& _in) const @@ -257,8 +257,8 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) bn.setBudgetStart(bx.budgetStart()); bn = MyMoneyBudget(bx.id(), bn); - QValueList list = bx.getaccounts(); - QValueList::iterator it; + TQValueList list = bx.getaccounts(); + TQValueList::iterator it; for(it = list.begin(); it != list.end(); ++it) { // only add the account if there is a budget entered if(!(*it).balance().isZero()) { @@ -266,8 +266,8 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) account.setId((*it).id()); account.setBudgetLevel((*it).budgetLevel()); account.setBudgetSubaccounts((*it).budgetSubaccounts()); - QMap plist = (*it).getPeriods(); - QMap::const_iterator it_p; + TQMap plist = (*it).getPeriods(); + TQMap::const_iterator it_p; for(it_p = plist.begin(); it_p != plist.end(); ++it_p) { MyMoneyBudget::PeriodGroup pGroup; pGroup.setAmount((*it_p).amount() * m_factor ); @@ -281,7 +281,7 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) bx = bn; } -void MyMoneyStorageANON::writeBudget(QDomElement& budgets, const MyMoneyBudget& b) +void MyMoneyStorageANON::writeBudget(TQDomElement& budgets, const MyMoneyBudget& b) { MyMoneyBudget bn = b; diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.h b/kmymoney2/mymoney/storage/mymoneystorageanon.h index 4b7ab95..5919220 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.h +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.h @@ -27,9 +27,9 @@ // ---------------------------------------------------------------------------- // QT Includes -// #include -// #include -// class QIODevice; +// #include +// #include +// class TQIODevice; // ---------------------------------------------------------------------------- // Project Includes @@ -70,38 +70,38 @@ public: virtual ~MyMoneyStorageANON(); protected: - void writeUserInformation(QDomElement& userInfo); + void writeUserInformation(TQDomElement& userInfo); - void writeInstitution(QDomElement& institutions, const MyMoneyInstitution& i); + void writeInstitution(TQDomElement& institutions, const MyMoneyInstitution& i); - void writePayee(QDomElement& payees, const MyMoneyPayee& p); + void writePayee(TQDomElement& payees, const MyMoneyPayee& p); - void writeAccount(QDomElement& accounts, const MyMoneyAccount& p); + void writeAccount(TQDomElement& accounts, const MyMoneyAccount& p); - void writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx); + void writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx); - void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx); + void writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx); - void writeBudget(QDomElement& budgets, const MyMoneyBudget& b); + void writeBudget(TQDomElement& budgets, const MyMoneyBudget& b); - void readFile(QIODevice* s, IMyMoneySerialize* storage); + void readFile(TQIODevice* s, IMyMoneySerialize* storage); - void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security); + void writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security); - QDomElement findChildElement(const QString& name, const QDomElement& root); + TQDomElement findChildElement(const TQString& name, const TQDomElement& root); private: /** * The list of key-value pairs to not modify */ - static QStringList zKvpNoModify; + static TQStringList zKvpNoModify; /** * The list of key-value pairs which are numbers to be hidden */ - static QStringList zKvpXNumber; + static TQStringList zKvpXNumber; - QString hideString(const QString&) const; + TQString hideString(const TQString&) const; MyMoneyMoney hideNumber(const MyMoneyMoney&) const; void fakeTransaction(MyMoneyTransaction& tn); void fakeBudget(MyMoneyBudget& bn); diff --git a/kmymoney2/mymoney/storage/mymoneystoragedump.cpp b/kmymoney2/mymoney/storage/mymoneystoragedump.cpp index e0d0083..77fa395 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragedump.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragedump.cpp @@ -23,10 +23,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -45,14 +45,14 @@ MyMoneyStorageDump::~MyMoneyStorageDump() { } -void MyMoneyStorageDump::readStream(QDataStream& /* s */, IMyMoneySerialize* /* storage */) +void MyMoneyStorageDump::readStream(TQDataStream& /* s */, IMyMoneySerialize* /* storage */) { qDebug("Reading not supported by MyMoneyStorageDump!!"); } -void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storage) +void MyMoneyStorageDump::writeStream(TQDataStream& _s, IMyMoneySerialize* _storage) { - QTextStream s(_s.device()); + TQTextStream s(_s.device()); IMyMoneyStorage* storage = dynamic_cast (_storage); MyMoneyPayee user = storage->user(); @@ -72,18 +72,18 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Internal-Info\n"; s << "-------------\n"; - QValueList list_a; + TQValueList list_a; storage->accountList(list_a); s << "accounts = " << list_a.count() <<", next id = " << _storage->accountId() << "\n"; MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList list_t; + TQValueList list_t; storage->transactionList(list_t, filter); - QValueList::ConstIterator it_t; + TQValueList::ConstIterator it_t; s << "transactions = " << list_t.count() << ", next id = " << _storage->transactionId() << "\n"; - QMap xferCount; + TQMap xferCount; for(it_t = list_t.begin(); it_t != list_t.end(); ++it_t) { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; int accountCount = 0; for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = storage->account((*it_s).accountId()); @@ -94,7 +94,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag if(accountCount > 1) xferCount[accountCount] = xferCount[accountCount] + 1; } - QMap::ConstIterator it_cnt; + TQMap::ConstIterator it_cnt; for(it_cnt = xferCount.begin(); it_cnt != xferCount.end(); ++it_cnt) { s << " " << *it_cnt << " of them references " << it_cnt.key() << " accounts\n"; } @@ -107,8 +107,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Institutions\n"; s << "------------\n"; - QValueList list_i = storage->institutionList(); - QValueList::ConstIterator it_i; + TQValueList list_i = storage->institutionList(); + TQValueList::ConstIterator it_i; for(it_i = list_i.begin(); it_i != list_i.end(); ++it_i) { s << " ID = " << (*it_i).id() << "\n"; s << " Name = " << (*it_i).name() << "\n"; @@ -119,8 +119,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Payees" << "\n"; s << "------" << "\n"; - QValueList list_p = storage->payeeList(); - QValueList::ConstIterator it_p; + TQValueList list_p = storage->payeeList(); + TQValueList::ConstIterator it_p; for(it_p = list_p.begin(); it_p != list_p.end(); ++it_p) { s << " ID = " << (*it_p).id() << "\n"; s << " Name = " << (*it_p).name() << "\n"; @@ -144,7 +144,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag list_a.push_front(storage->income()); list_a.push_front(storage->liability()); list_a.push_front(storage->asset()); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; for(it_a = list_a.begin(); it_a != list_a.end(); ++it_a) { s << " ID = " << (*it_a).id() << "\n"; s << " Name = " << (*it_a).name() << "\n"; @@ -160,10 +160,10 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " Currency = " << storage->currency((*it_a).currencyId()).name() << "\n"; } } - s << " Parent = " << (*it_a).parentAccountId(); - if(!(*it_a).parentAccountId().isEmpty()) { - MyMoneyAccount parent = storage->account((*it_a).parentAccountId()); - s << " (" << parent.name() << ")"; + s << " Parent = " << (*it_a).tqparentAccountId(); + if(!(*it_a).tqparentAccountId().isEmpty()) { + MyMoneyAccount tqparent = storage->account((*it_a).tqparentAccountId()); + s << " (" << tqparent.name() << ")"; } else { s << "n/a"; } @@ -186,8 +186,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag dumpKVP(" KVP: ", s, *it_a); dumpKVP(" OnlineBankingSettings: ", s, (*it_a).onlineBankingSettings()); - QStringList list_s = (*it_a).accountList(); - QStringList::ConstIterator it_s; + TQStringList list_s = (*it_a).accountList(); + TQStringList::ConstIterator it_s; if(list_s.count() > 0) { s << " Children =" << "\n"; } @@ -203,8 +203,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Currencies" << "\n"; s << "----------" << "\n"; - QValueList list_c = storage->currencyList(); - QValueList::ConstIterator it_c; + TQValueList list_c = storage->currencyList(); + TQValueList::ConstIterator it_c; for(it_c = list_c.begin(); it_c != list_c.end(); ++it_c) { s << " Name = " << (*it_c).name() << "\n"; s << " ID = " << (*it_c).id() << "\n"; @@ -221,8 +221,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Securities" << "\n"; s << "----------" << "\n"; - QValueList list_e = storage->securityList(); - QValueList::ConstIterator it_e; + TQValueList list_e = storage->securityList(); + TQValueList::ConstIterator it_e; for(it_e = list_e.begin(); it_e != list_e.end(); ++it_e) { s << " Name = " << (*it_e).name() << "\n"; s << " ID = " << (*it_e).id() << "\n"; @@ -244,8 +244,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " smallest account fraction = " << (*it_e).smallestAccountFraction() << "\n"; s << " KVP: " << "\n"; - QMapkvp = (*it_e).pairs(); - QMap::Iterator it; + TQMapkvp = (*it_e).pairs(); + TQMap::Iterator it; for(it = kvp.begin(); it != kvp.end(); ++it) { s << " '" << it.key() << "' = '" << it.data() << "'\n"; } @@ -264,7 +264,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag MyMoneyPriceEntries::ConstIterator it_pre; for(it_pre = (*it_pr).begin(); it_pre != (*it_pr).end(); ++it_pre) { s << " Date = " << (*it_pre).date().toString() << "\n"; - s << " Price = " << (*it_pre).rate(QString()).formatMoney("", 8) << "\n"; + s << " Price = " << (*it_pre).rate(TQString()).formatMoney("", 8) << "\n"; s << " Source = " << (*it_pre).source() << "\n"; s << " From = " << (*it_pre).from() << "\n"; s << " To = " << (*it_pre).to() << "\n"; @@ -285,8 +285,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Schedules" << "\n"; s << "---------" << "\n"; - QValueList list_s = storage->scheduleList(); - QValueList::ConstIterator it_s; + TQValueList list_s = storage->scheduleList(); + TQValueList::ConstIterator it_s; for(it_s = list_s.begin(); it_s != list_s.end(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Name = " << (*it_s).name() << "\n"; @@ -314,8 +314,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " = overdue!" << "\n"; } - QValueList list_d; - QValueList::ConstIterator it_d; + TQValueList list_d; + TQValueList::ConstIterator it_d; list_d = (*it_s).recordedPayments(); if(list_d.count() > 0) { @@ -332,26 +332,26 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Reports" << "\n"; s << "-------" << "\n"; - QValueList list_r = storage->reportList(); - QValueList::ConstIterator it_r; + TQValueList list_r = storage->reportList(); + TQValueList::ConstIterator it_r; for(it_r = list_r.begin(); it_r != list_r.end(); ++it_r) { s << " ID = " << (*it_r).id() << "\n"; s << " Name = " << (*it_r).name() << "\n"; } } -void MyMoneyStorageDump::dumpKVP(const QString& headline, QTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent) +void MyMoneyStorageDump::dumpKVP(const TQString& headline, TQTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent) { - QString ind; + TQString ind; ind.fill(' ', indent); s << ind << headline << "\n"; - QMap::const_iterator it; + TQMap::const_iterator it; for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it) { s << ind << " '" << it.key() << "' = '" << it.data() << "'\n"; } } -void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) +void MyMoneyStorageDump::dumpTransaction(TQTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) { s << " ID = " << it_t.id() << "\n"; s << " Postdate = " << it_t.postDate().toString(Qt::ISODate) << "\n"; @@ -363,7 +363,7 @@ void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storag s << " Splits\n"; s << " ------\n"; - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = it_t.splits().begin(); it_s != it_t.splits().end(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Transaction = " << (*it_s).transactionId() << "\n"; @@ -403,11 +403,11 @@ void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storag s << "\n"; } -#define i18n QString +#define i18n TQString -const QString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE flag) const +const TQString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE flag) const { - QString rc; + TQString rc; switch(flag) { case MyMoneySplit::NotReconciled: @@ -430,7 +430,7 @@ const QString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE } #if 0 -void MyMoneyStorageDump::dumpPriceHistory(QTextStream& s, const equity_price_history history) +void MyMoneyStorageDump::dumpPriceHistory(TQTextStream& s, const equity_price_history history) { if(history.count() != 0) { s << " Price History:\n"; diff --git a/kmymoney2/mymoney/storage/mymoneystoragedump.h b/kmymoney2/mymoney/storage/mymoneystoragedump.h index e399cde..3f7f33a 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragedump.h +++ b/kmymoney2/mymoney/storage/mymoneystoragedump.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -44,13 +44,13 @@ public: MyMoneyStorageDump(); ~MyMoneyStorageDump(); - void readStream(QDataStream& s, IMyMoneySerialize* storage); - void writeStream(QDataStream& s, IMyMoneySerialize* storage); + void readStream(TQDataStream& s, IMyMoneySerialize* storage); + void writeStream(TQDataStream& s, IMyMoneySerialize* storage); private: - void dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t); - void dumpKVP(const QString& headline, QTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent = 0); - const QString reconcileToString(MyMoneySplit::reconcileFlagE flag) const; + void dumpTransaction(TQTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t); + void dumpKVP(const TQString& headline, TQTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent = 0); + const TQString reconcileToString(MyMoneySplit::reconcileFlagE flag) const; }; #endif diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp index 97b4c55..34c9573 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp @@ -22,12 +22,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -52,60 +52,52 @@ //***************** THE CURRENT VERSION OF THE DATABASE LAYOUT **************** unsigned int MyMoneyDbDef::m_currentVersion = 6; -// subclass QSqlQuery for performance tracing +// subclass TQSqlQuery for performance tracing MyMoneySqlQuery::MyMoneySqlQuery (MyMoneyStorageSql* db) - : QSqlQuery (static_cast(db)) { + : TQSqlQuery (static_cast(db)) { m_db = db; } bool MyMoneySqlQuery::exec () { - TRACE(QString("start sql - %1").arg(lastQuery())); - bool rc = QSqlQuery::exec(); - QString msg("end sql\n%1\n***Query returned %2, row count %3"); - TRACE (msg.arg(QSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected())); - //DBG (QString("%1\n***Query returned %2, row count %3").arg(QSqlQuery::executedQuery()).arg(rc).arg(size())); + TRACE(TQString("start sql - %1").tqarg(lastQuery())); + bool rc = TQSqlQuery::exec(); + TQString msg("end sql\n%1\n***Query returned %2, row count %3"); + TRACE (msg.tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(numRowsAffected())); + //DBG (TQString("%1\n***Query returned %2, row count %3").tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(size())); return (rc); } -bool MyMoneySqlQuery::prepare ( const QString & query ) { +bool MyMoneySqlQuery::prepare ( const TQString & query ) { if (m_db->isSqlite3()) { - QString newQuery = query; - return (QSqlQuery::prepare (newQuery.replace("FOR UPDATE", ""))); + TQString newQuery = query; + return (TQSqlQuery::prepare (newQuery.tqreplace("FOR UPDATE", ""))); } - return (QSqlQuery::prepare (query)); + return (TQSqlQuery::prepare (query)); } //***************************************************************************** MyMoneyDbDrivers::MyMoneyDbDrivers () { - m_driverMap["QDB2"] = QString("IBM DB2"); - m_driverMap["QIBASE"] = QString("Borland Interbase"); - m_driverMap["QMYSQL3"] = QString("MySQL"); - m_driverMap["QOCI8"] = QString("Oracle Call Interface, version 8 and 9"); - m_driverMap["QODBC3"] = QString("Open Database Connectivity"); - m_driverMap["QPSQL7"] = QString("PostgreSQL v6.x and v7.x"); - m_driverMap["QTDS7"] = QString("Sybase Adaptive Server and Microsoft SQL Server"); -#if QT_VERSION < 0x040000 - m_driverMap["QSQLITE3"] = QString("SQLite Version 3"); -#else - m_driverMap["QSQLITE"] = QString("SQLite Version 3"); -#endif -} - -databaseTypeE MyMoneyDbDrivers::driverToType (const QString& driver) const { - if (driver == "QDB2") return(Db2); - else if (driver == "QIBASE") return(Interbase); - else if (driver == "QMYSQL3") return(Mysql); - else if (driver == "QOCI8") return(Oracle8); - else if (driver == "QODBC3") return(ODBC3); - else if (driver == "QPSQL7") return(Postgresql); - else if (driver == "QTDS7") return(Sybase); -#if QT_VERSION < 0x040000 - else if (driver == "QSQLITE3") return(Sqlite3); -#else - else if (driver == "QSQLITE") return(Sqlite3); -#endif - else throw new MYMONEYEXCEPTION (QString("Unknown database driver type").arg(driver)); + m_driverMap["TQDB2"] = TQString("IBM DB2"); + m_driverMap["TQIBASE"] = TQString("Borland Interbase"); + m_driverMap["TQMYSQL3"] = TQString("MySQL"); + m_driverMap["TQOCI8"] = TQString("Oracle Call Interface, version 8 and 9"); + m_driverMap["TQODBC3"] = TQString("Open Database Connectivity"); + m_driverMap["TQPSQL7"] = TQString("PostgreSQL v6.x and v7.x"); + m_driverMap["TQTDS7"] = TQString("Sybase Adaptive Server and Microsoft SQL Server"); + m_driverMap["TQSQLITE3"] = TQString("SQLite Version 3"); +} + +databaseTypeE MyMoneyDbDrivers::driverToType (const TQString& driver) const { + if (driver == "TQDB2") return(Db2); + else if (driver == "TQIBASE") return(Interbase); + else if (driver == "TQMYSQL3") return(Mysql); + else if (driver == "TQOCI8") return(Oracle8); + else if (driver == "TQODBC3") return(ODBC3); + else if (driver == "TQPSQL7") return(Postgresql); + else if (driver == "TQTDS7") return(Sybase); + else if (driver == "TQSQLITE3") return(Sqlite3); + else throw new MYMONEYEXCEPTION (TQString("Unknown database driver type").tqarg(driver)); } bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { @@ -122,11 +114,11 @@ bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { //************************ Constructor/Destructor ***************************** MyMoneyStorageSql::MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& url) - : QSqlDatabase (url.queryItem("driver"), QString("kmmdatabase")) { + : TQSqlDatabase (url.queryItem("driver"), TQString("kmmdatabase")) { DBG("*** Entering MyMoneyStorageSql::MyMoneyStorageSql"); m_dbVersion = 0; m_progressCallback = 0; - m_displayStatus = false; + m_displaytqStatus = false; m_storage = storage; m_storagePtr = dynamic_cast(storage); m_newDatabase = false; @@ -140,15 +132,15 @@ int MyMoneyStorageSql::open(const KURL& url, int openMode, bool clear) { DBG("*** Entering MyMoneyStorageSql::open"); try { int rc = 0; - QString driverName = url.queryItem("driver"); + TQString driverName = url.queryItem("driver"); m_dbType = m_drivers.driverToType(driverName); //get the input options - QStringList options = QStringList::split(',', url.queryItem("options")); - m_loadAll = options.contains("loadAll")/*|| m_mode == 0*/; - m_override = options.contains("override"); + TQStringList options = TQStringList::split(',', url.queryItem("options")); + m_loadAll = options.tqcontains("loadAll")/*|| m_mode == 0*/; + m_override = options.tqcontains("override"); // create the database connection - QString dbName = url.path().right(url.path().length() - 1); // remove separator slash + TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash setDatabaseName(dbName); setHostName(url.host()); setUserName(url.user()); @@ -156,7 +148,7 @@ try { switch (openMode) { case IO_ReadOnly: // OpenDatabase menu entry (or open last file) case IO_ReadWrite: // Save menu entry with database open - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { buildError(MyMoneySqlQuery(), __func__, "opening database"); rc = 1; } else { @@ -167,11 +159,11 @@ try { // Try to open the database. // If that fails, try to create the database, then try to open it again. m_newDatabase = true; - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { if (createDatabase(url) != 0) { rc = 1; } else { - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { buildError(MyMoneySqlQuery(), __func__, "opening new database"); rc = 1; } else { @@ -190,7 +182,7 @@ try { } break; default: - qFatal("%s", QString("%1 - unknown open mode %2").arg(__func__).arg(openMode).data()); + qFatal("%s", TQString("%1 - unknown open mode %2").tqarg(__func__).tqarg(openMode).data()); } if (rc != 0) return (rc); // bypass logon check if we are creating a database @@ -198,21 +190,21 @@ try { // check if the database is locked, if not lock it readFileInfo(); if (!m_logonUser.isEmpty() && (!m_override)) { - m_error = QString - (i18n("Database apparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) - .arg(m_logonUser) - .arg(m_logonAt.date().toString(Qt::ISODate)) - .arg(m_logonAt.time().toString("hh.mm.ss")); + m_error = TQString + (i18n("Database aptqparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) + .tqarg(m_logonUser) + .tqarg(m_logonAt.date().toString(Qt::ISODate)) + .tqarg(m_logonAt.time().toString("hh.mm.ss")); qDebug("%s", m_error.data()); close(false); rc = -1; } else { m_logonUser = url.user() + "@" + url.host(); - m_logonAt = QDateTime::currentDateTime(); + m_logonAt = TQDateTime::tqcurrentDateTime(); writeFileInfo(); } return(rc); -} catch (QString& s) { +} catch (TQString& s) { qDebug("%s",s.data()); return (1); } @@ -220,15 +212,15 @@ try { void MyMoneyStorageSql::close(bool logoff) { DBG("*** Entering MyMoneyStorageSql::close"); - if (QSqlDatabase::open()) { + if (TQSqlDatabase::open()) { if (logoff) { startCommitUnit(__func__); - m_logonUser = QString(); + m_logonUser = TQString(); writeFileInfo(); endCommitUnit(__func__); } - QSqlDatabase::close(); - QSqlDatabase::removeDatabase(this); + TQSqlDatabase::close(); + TQSqlDatabase::removeDatabase(this); } } @@ -237,32 +229,32 @@ int MyMoneyStorageSql::createDatabase (const KURL& url) { if (m_dbType == Sqlite3) return(0); // not needed for sqlite if (!m_dbType == Mysql) { m_error = - QString(i18n("Cannot currently create database for driver %1; please create manually")).arg(driverName()); + TQString(i18n("Cannot currently create database for driver %1; please create manually")).tqarg(driverName()); return (1); } // create the database (only works for mysql at present) - QString dbName = url.path().right(url.path().length() - 1); // remove separator slash - QSqlDatabase *maindb = QSqlDatabase::addDatabase(driverName()); + TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash + TQSqlDatabase *maindb = TQSqlDatabase::addDatabase(driverName()); maindb->setDatabaseName ("mysql"); maindb->setHostName (url.host()); maindb->setUserName (url.user()); maindb->setPassword (url.pass()); maindb->open(); - QSqlQuery qm(maindb); - QString qs = QString("CREATE DATABASE %1;").arg(dbName); + TQSqlQuery qm(maindb); + TQString qs = TQString("CREATE DATABASE %1;").tqarg(dbName); qm.prepare (qs); if (!qm.exec()) { - buildError (qm, __func__, QString(i18n("Error in create database %1; do you have create permissions?")).arg(dbName)); + buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).tqarg(dbName)); return (1); } - QSqlDatabase::removeDatabase (maindb); + TQSqlDatabase::removeDatabase (maindb); return (0); } int MyMoneyStorageSql::upgradeDb() { DBG("*** Entering MyMoneyStorageSql::upgradeDb"); - //signalProgress(0, 1, QObject::tr("Upgrading database...")); + //signalProgress(0, 1, TQObject::tr("Upgrading database...")); MyMoneySqlQuery q(this); q.prepare ("SELECT version FROM kmmFileInfo;"); if (!q.exec() || !q.next()) { @@ -272,7 +264,7 @@ int MyMoneyStorageSql::upgradeDb() { } else { m_dbVersion = m_db.currentVersion(); m_storage->setFileFixVersion(m_storage->currentFixVersion()); - QSqlQuery q(this); + TQSqlQuery q(this); q.prepare("UPDATE kmmFileInfo SET version = :version, \ fixLevel = :fixLevel;"); q.bindValue(":version", m_dbVersion); @@ -286,8 +278,8 @@ int MyMoneyStorageSql::upgradeDb() { } // prior to dbv6, 'version' format was 'dbversion.fixLevel+1' // as of dbv6, these are separate fields - QString version = q.value(0).toString(); - if (version.contains('.')) { + TQString version = q.value(0).toString(); + if (version.tqcontains('.')) { m_dbVersion = q.value(0).toString().section('.', 0, 0).toUInt(); m_storage->setFileFixVersion(q.value(0).toString().section('.', 1, 1).toUInt() - 1); } else { @@ -333,8 +325,8 @@ int MyMoneyStorageSql::upgradeDb() { } } // write updated version to DB - //setVersion(QString("%1.%2").arg(m_dbVersion).arg(m_minorVersion)); - q.prepare (QString("UPDATE kmmFileInfo SET version = :version;")); + //setVersion(TQString("%1.%2").tqarg(m_dbVersion).tqarg(m_minorVersion)); + q.prepare (TQString("UPDATE kmmFileInfo SET version = :version;")); q.bindValue(":version", m_dbVersion); if (!q.exec()) { buildError (q, __func__, "Error updating db version"); @@ -346,8 +338,8 @@ int MyMoneyStorageSql::upgradeDb() { // SF bug 2779291 // check whether a column appears in a table already; if not, add it bool MyMoneyStorageSql::addColumn - (const QString& table, const QString& col, - const QString& after) + (const TQString& table, const TQString& col, + const TQString& after) { MyMoneyDbTable t = m_db.m_tables[table]; MyMoneyDbTable::field_iterator ft; @@ -363,20 +355,20 @@ bool MyMoneyStorageSql::addColumn bool MyMoneyStorageSql::addColumn (const MyMoneyDbTable& t, const MyMoneyDbColumn& c, - const QString& after){ + const TQString& after){ if ((m_dbType == Sqlite3) && (!after.isEmpty())) qFatal("sqlite doesn't support 'AFTER'; use sqliteAlterTable"); - if (record(t.name()).contains(c.name())) + if (record(t.name()).tqcontains(c.name())) return (true); - QSqlQuery q(this); - QString afterString = ";"; + TQSqlQuery q(this); + TQString afterString = ";"; if (!after.isEmpty()) - afterString = QString("AFTER %1;").arg(after); + afterString = TQString("AFTER %1;").tqarg(after); q.prepare("ALTER TABLE " + t.name() + " ADD COLUMN " + c.generateDDL(m_dbType) + afterString); if (!q.exec()) { buildError (q, __func__, - QString("Error adding column %1 to table %2").arg(c.name()).arg(t.name())); + TQString("Error adding column %1 to table %2").tqarg(c.name()).tqarg(t.name())); return (false); } return (true); @@ -384,23 +376,23 @@ bool MyMoneyStorageSql::addColumn // analogous to above bool MyMoneyStorageSql::dropColumn - (const QString& table, const QString& col) + (const TQString& table, const TQString& col) { return (dropColumn(m_db.m_tables[table], col)); } bool MyMoneyStorageSql::dropColumn - (const MyMoneyDbTable& t, const QString& col){ + (const MyMoneyDbTable& t, const TQString& col){ if (m_dbType == Sqlite3) qFatal("sqlite doesn't support 'DROP COLUMN'; use sqliteAlterTable"); - if (!record(t.name()).contains(col)) + if (!record(t.name()).tqcontains(col)) return (true); - QSqlQuery q(this); + TQSqlQuery q(this); q.prepare("ALTER TABLE " + t.name() + " DROP COLUMN " + col + ";"); if (!q.exec()) { buildError (q, __func__, - QString("Error dropping column %1 from table %2").arg(col).arg(t.name())); + TQString("Error dropping column %1 from table %2").tqarg(col).tqarg(t.name())); return (false); } return (true); @@ -434,9 +426,9 @@ int MyMoneyStorageSql::upgradeToV1() { buildError (q, __func__, "Error priming kmmSplits.postDate"); return (1); } - QMap tids; + TQMap tids; while (q.next()) tids[q.value(0).toString()] = q.value(1).toDateTime(); - QMap::ConstIterator it; + TQMap::ConstIterator it; for (it = tids.begin(); it != tids.end(); ++it) { q.prepare ("UPDATE kmmSplits SET postDate=:postDate WHERE transactionId = :id;"); q.bindValue(":postDate", it.data().toString(Qt::ISODate)); @@ -447,7 +439,7 @@ int MyMoneyStorageSql::upgradeToV1() { } } // add index to kmmKeyValuePairs to (kvpType,kvpId) - QStringList list; + TQStringList list; list << "kvpType" << "kvpId"; q.prepare (MyMoneyDbIndex("kmmKeyValuePairs", "kmmKVPtype_id", list, false).generateDDL(m_dbType) + ";"); if (!q.exec()) { @@ -519,18 +511,18 @@ int MyMoneyStorageSql::upgradeToV1() { buildError (q, __func__, "Error retrieving splits for transaction counting"); return(1); } - QString lastAcc, lastTx; + TQString lastAcc, lastTx; while (q.next()) { - QString thisAcc = q.value(0).toCString(); - QString thisTx = q.value(1).toCString(); + TQString thisAcc = q.value(0).toCString(); + TQString thisTx = q.value(1).toCString(); if ((thisAcc != lastAcc) || (thisTx != lastTx)) ++m_transactionCountMap[thisAcc]; lastAcc = thisAcc; lastTx = thisTx; } - QMap::ConstIterator itm; + TQMap::ConstIterator itm; q.prepare("UPDATE kmmAccounts SET transactionCount = :txCount WHERE id = :id;"); for (itm = m_transactionCountMap.begin(); itm != m_transactionCountMap.end(); ++itm) { - q.bindValue (":txCount", QString::number(itm.data())); + q.bindValue (":txCount", TQString::number(itm.data())); q.bindValue (":id", itm.key()); if (!q.exec()) { buildError(q, __func__, "Error updating transaction count"); @@ -606,7 +598,7 @@ int MyMoneyStorageSql::upgradeToV4() { DBG("*** Entering MyMoneyStorageSql::upgradeToV4"); startCommitUnit(__func__); MyMoneySqlQuery q(this); - QStringList list; + TQStringList list; list << "transactionId" << "splitId"; q.prepare (MyMoneyDbIndex("kmmSplits", "kmmTx_Split", list, false).generateDDL(m_dbType) + ";"); if (!q.exec()) { @@ -664,8 +656,8 @@ int MyMoneyStorageSql::upgradeToV6() { return (1); // upgrade Mysql to InnoDB transaction-safe engine if (m_dbType == Mysql) { - for (QMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { - q.prepare(QString("ALTER TABLE %1 ENGINE = InnoDB;").arg(tt.data().name())); + for (TQMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { + q.prepare(TQString("ALTER TABLE %1 ENGINE = InnoDB;").tqarg(tt.data().name())); if (!q.exec()) { buildError (q, __func__, "Error updating to InnoDB"); return (1); @@ -678,7 +670,7 @@ int MyMoneyStorageSql::upgradeToV6() { return(1); // read and write reports to get ids inserted readFileInfo(); - QMap reportList = + TQMap reportList = fetchReports(); // the V5 database allowed lots of duplicate reports with no // way to distinguish between them. The fetchReports call @@ -690,7 +682,7 @@ int MyMoneyStorageSql::upgradeToV6() { return (1); } unsigned long long hiReportId = 0; - QMap::const_iterator it_r; + TQMap::const_iterator it_r; for(it_r = reportList.begin(); it_r != reportList.end(); ++it_r) { MyMoneyReport r = *it_r; hiReportId = calcHighId(hiReportId, r.id()); @@ -719,22 +711,22 @@ int MyMoneyStorageSql::upgradeToV6() { statement. It should enable us to drop a primary key, and drop columns */ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) { DBG("*** Entering MyMoneyStorageSql::sqliteAlterTable"); - QString tempTableName = t.name(); - tempTableName.replace("kmm", "tmp"); - QSqlQuery q(this); - q.prepare (QString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";")); + TQString tempTableName = t.name(); + tempTableName.tqreplace("kmm", "tmp"); + TQSqlQuery q(this); + q.prepare (TQString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error renaming table"); return false; } createTable(t); - q.prepare (QString("INSERT INTO " + t.name() + " (" + t.columnList() + + q.prepare (TQString("INSERT INTO " + t.name() + " (" + t.columnList() + ") SELECT " + t.columnList() + " FROM " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error inserting into new table"); return false; } - q.prepare (QString("DROP TABLE " + tempTableName + ";")); + q.prepare (TQString("DROP TABLE " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error dropping old table"); return false; @@ -742,10 +734,10 @@ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) { return true; } -long unsigned MyMoneyStorageSql::getRecCount (const QString& table) const { +long unsigned MyMoneyStorageSql::getRecCount (const TQString& table) const { DBG("*** Entering MyMoneyStorageSql::getRecCount"); MyMoneySqlQuery q(const_cast (this)); - q.prepare(QString("SELECT COUNT(*) FROM %1;").arg(table)); + q.prepare(TQString("SELECT COUNT(*) FROM %1;").tqarg(table)); if ((!q.exec()) || (!q.next())) { buildError (q, __func__, "error retrieving record count"); qFatal("Error retrieving record count"); // definitely shouldn't happen @@ -758,20 +750,20 @@ int MyMoneyStorageSql::createTables () { // check tables, create if required // convert everything to lower case, since SQL standard is case insensitive // table and column names (when not delimited), but some DBMSs disagree. - QStringList lowerTables = tables(QSql::AllTables); - for (QStringList::iterator i = lowerTables.begin(); i != lowerTables.end(); ++i) { + TQStringList lowerTables = tables(TQSql::AllTables); + for (TQStringList::iterator i = lowerTables.begin(); i != lowerTables.end(); ++i) { (*i) = (*i).lower(); } - for (QMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { - if (!lowerTables.contains(tt.key().lower())) createTable (tt.data()); + for (TQMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { + if (!lowerTables.tqcontains(tt.key().lower())) createTable (tt.data()); } MyMoneySqlQuery q(this); - for (QMapConstIterator tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) { - if (!lowerTables.contains(tt.key().lower())) { + for (TQMapConstIterator tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) { + if (!lowerTables.tqcontains(tt.key().lower())) { q.prepare (tt.data().createString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("creating view %1").arg(tt.key()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").tqarg(tt.key()))); } } @@ -784,22 +776,22 @@ int MyMoneyStorageSql::createTables () { void MyMoneyStorageSql::createTable (const MyMoneyDbTable& t) { DBG("*** Entering MyMoneyStorageSql::createTable"); // create the tables - QStringList ql = QStringList::split('\n', t.generateCreateSQL(m_dbType)); + TQStringList ql = TQStringList::split('\n', t.generateCreateSQL(m_dbType)); MyMoneySqlQuery q(this); for (unsigned int i = 0; i < ql.count(); ++i) { q.prepare (ql[i]); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("creating table/index %1").arg(t.name()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating table/index %1").tqarg(t.name()))); } } int MyMoneyStorageSql::isEmpty () { DBG("*** Entering MyMoneyStorageSql::isEmpty"); // check all tables are empty - QMapConstIterator tt = m_db.tableBegin(); + TQMapConstIterator tt = m_db.tableBegin(); int recordCount = 0; MyMoneySqlQuery q(this); while ((tt != m_db.tableEnd()) && (recordCount == 0)) { - q.prepare (QString("select count(*) from %1;").arg((*tt).name())); + q.prepare (TQString("select count(*) from %1;").tqarg((*tt).name())); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "getting record count")); if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving record count")); recordCount += q.value(0).toInt(); @@ -816,11 +808,11 @@ int MyMoneyStorageSql::isEmpty () { void MyMoneyStorageSql::clean() { DBG("*** Entering MyMoneyStorageSql::clean"); // delete all existing records - QMapConstIterator it = m_db.tableBegin(); + TQMapConstIterator it = m_db.tableBegin(); MyMoneySqlQuery q(this); while (it != m_db.tableEnd()) { - q.prepare(QString("DELETE from %1;").arg(it.key())); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("cleaning database"))); + q.prepare(TQString("DELETE from %1;").tqarg(it.key())); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("cleaning database"))); ++it; } } @@ -829,15 +821,15 @@ void MyMoneyStorageSql::clean() { bool MyMoneyStorageSql::readFile(void) { DBG("*** Entering MyMoneyStorageSql::readFile"); - m_displayStatus = true; + m_displaytqStatus = true; try { readFileInfo(); readInstitutions(); if (m_loadAll) { readPayees(); } else { - QValueList user; - user.append(QString("USER")); + TQValueList user; + user.append(TQString("USER")); readPayees(user); } //TRACE("done payees"); @@ -868,10 +860,10 @@ bool MyMoneyStorageSql::readFile(void) { // FIXME?? if (m_mode == 0) m_storage = NULL; // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displayStatus = false; + m_displaytqStatus = false; //MyMoneySqlQuery::traceOn(); return true; - } catch (QString& s) { + } catch (TQString& s) { return false; } } @@ -884,7 +876,7 @@ bool MyMoneyStorageSql::writeFile(void) { = m_securities = m_prices = m_currencies = m_schedules = m_reports = m_kvps = m_budgets = 0; m_hiIdInstitutions = m_hiIdPayees = m_hiIdAccounts = m_hiIdTransactions = m_hiIdSchedules = m_hiIdSecurities = m_hiIdReports = m_hiIdBudgets = 0; - m_displayStatus = true; + m_displaytqStatus = true; try{ startCommitUnit(__func__); writeInstitutions (); @@ -905,14 +897,14 @@ bool MyMoneyStorageSql::writeFile(void) { endCommitUnit(__func__); // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displayStatus = false; + m_displaytqStatus = false; return true; -} catch (QString& s) { +} catch (TQString& s) { return false; } } // --------------- SQL Transaction (commit unit) handling ----------------------------------- -void MyMoneyStorageSql::startCommitUnit (const QString& callingFunction) { +void MyMoneyStorageSql::startCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::startCommitUnit"); if (m_commitUnitStack.isEmpty()) { if (!transaction()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "starting commit unit")); @@ -920,16 +912,16 @@ void MyMoneyStorageSql::startCommitUnit (const QString& callingFunction) { m_commitUnitStack.push(callingFunction); } -bool MyMoneyStorageSql::endCommitUnit (const QString& callingFunction) { +bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::endCommitUnit"); // for now, we don't know if there were any changes made to the data so // we expect the data to have changed. This assumption causes some unnecessary - // repaints of the UI here and there, but for now it's ok. If we can determine + // tqrepaints of the UI here and there, but for now it's ok. If we can determine // that the commit() really changes the data, we can return that information // as value of this method. bool rc = true; if (callingFunction != m_commitUnitStack.top()) - qDebug("%s", QString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); m_commitUnitStack.pop(); if (m_commitUnitStack.isEmpty()) { if (!commit()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "ending commit unit")); @@ -937,10 +929,10 @@ bool MyMoneyStorageSql::endCommitUnit (const QString& callingFunction) { return rc; } -void MyMoneyStorageSql::cancelCommitUnit (const QString& callingFunction) { +void MyMoneyStorageSql::cancelCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::cancelCommitUnit"); if (callingFunction != m_commitUnitStack.top()) - qDebug("%s", QString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); if (m_commitUnitStack.isEmpty()) return; m_commitUnitStack.clear(); if (!rollback()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "cancelling commit unit")); @@ -967,20 +959,20 @@ void MyMoneyStorageSql::writeInstitutions() { // one way would be to build the lists when reading the db // unfortunately this object does not persist between read and write // it would also be nice if we could tell which objects had been updated since we read them in - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmInstitutions;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Institution list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList list = m_storage->institutionList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->institutionList(); + TQValueList::ConstIterator it; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmInstitutions"].updateString()); q2.prepare (m_db.m_tables["kmmInstitutions"].insertString()); signalProgress(0, list.count(), "Writing Institutions..."); for(it = list.begin(); it != list.end(); ++it) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeInstitution(*it, q); } else { @@ -990,7 +982,7 @@ void MyMoneyStorageSql::writeInstitutions() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); q.prepare("DELETE FROM kmmInstitutions WHERE id = :id"); while (it != dbList.end()) { q.bindValue(":id", (*it)); @@ -1030,7 +1022,7 @@ void MyMoneyStorageSql::removeInstitution(const MyMoneyInstitution& inst) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmInstitutions"].deleteString()); q.bindValue(":id", inst.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Institution"))); --m_institutions; writeFileInfo(); endCommitUnit(__func__); @@ -1046,7 +1038,7 @@ void MyMoneyStorageSql::writeInstitution(const MyMoneyInstitution& i, MyMoneySql q.bindValue(":addressCity", i.city()); q.bindValue(":addressZipcode", i.postcode()); q.bindValue(":telephone", i.telephone()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Institution"))); writeKeyValuePairs("OFXSETTINGS", i.id(), i.pairs()); m_hiIdInstitutions = calcHighId(m_hiIdInstitutions, i.id()); } @@ -1055,22 +1047,22 @@ void MyMoneyStorageSql::writeInstitution(const MyMoneyInstitution& i, MyMoneySql void MyMoneyStorageSql::writePayees() { DBG("*** Entering MyMoneyStorageSql::writePayees"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmPayees;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Payee list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list = m_storage->payeeList(); - MyMoneyPayee user(QString("USER"), m_storage->user()); + TQValueList list = m_storage->payeeList(); + MyMoneyPayee user(TQString("USER"), m_storage->user()); list.prepend(user); signalProgress(0, list.count(), "Writing Payees..."); MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmPayees"].updateString()); q2.prepare (m_db.m_tables["kmmPayees"].insertString()); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = list.begin(); it != list.end(); ++it) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writePayee(*it, q); } else { @@ -1080,7 +1072,7 @@ void MyMoneyStorageSql::writePayees() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); q.prepare(m_db.m_tables["kmmPayees"].deleteString()); while (it != dbList.end()) { q.bindValue(":id", (*it)); @@ -1128,7 +1120,7 @@ void MyMoneyStorageSql::removePayee(const MyMoneyPayee& payee) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmPayees"].deleteString()); q.bindValue(":id", payee.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Payee"))); --m_payees; writeFileInfo(); endCommitUnit(__func__); @@ -1152,13 +1144,13 @@ void MyMoneyStorageSql::writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bo q.bindValue(":notes", p.notes()); q.bindValue(":defaultAccountId", p.defaultAccountId()); bool ignoreCase; - QString matchKeys; + TQString matchKeys; MyMoneyPayee::payeeMatchType type = p.matchData(ignoreCase, matchKeys); q.bindValue(":matchData", static_cast(type)); if (ignoreCase) q.bindValue(":matchIgnoreCase", "Y"); else q.bindValue(":matchIgnoreCase", "N"); q.bindValue(":matchKeys", matchKeys); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("writing Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("writing Payee"))); if (!isUserInfo) m_hiIdPayees = calcHighId(m_hiIdPayees, p.id()); } @@ -1166,15 +1158,15 @@ void MyMoneyStorageSql::writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bo void MyMoneyStorageSql::writeAccounts() { DBG("*** Entering MyMoneyStorageSql::writeAccounts"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmAccounts;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Account list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list; + TQValueList list; m_storage->accountList(list); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; signalProgress(0, list.count(), "Writing Accounts..."); if (dbList.isEmpty()) { // new table, insert standard accounts q.prepare (m_db.m_tables["kmmAccounts"].insertString()); @@ -1216,7 +1208,7 @@ void MyMoneyStorageSql::writeAccounts() { MyMoneyAccount acc_q; acc_q.setAccountType(MyMoneyAccount::Equity); acc_q.setName("Equity"); - MyMoneyAccount equity(STD_ACC_EQUITY, acc_q); + MyMoneyAccount equity(STD_ACC_ETQUITY, acc_q); writeAccount(asset, q); ++m_accounts; writeAccount(expense, q); ++m_accounts; @@ -1232,7 +1224,7 @@ void MyMoneyStorageSql::writeAccounts() { // Update the accounts that exist; insert the ones that do not. for(it = list.begin(); it != list.end(); ++it, ++i) { m_transactionCountMap[(*it).id()] = m_storagePtr->transactionCount((*it).id()); - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeAccount(*it, q); } else { @@ -1243,7 +1235,7 @@ void MyMoneyStorageSql::writeAccounts() { // Delete the accounts that are in the db but no longer in memory. if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); q.prepare("DELETE FROM kmmAccounts WHERE id = :id"); while (it != dbList.end()) { if (!m_storagePtr->isStandardAccount(*it)) { @@ -1288,7 +1280,7 @@ void MyMoneyStorageSql::removeAccount(const MyMoneyAccount& acc) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmAccounts"].deleteString()); q.bindValue(":id", acc.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Account"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Account"))); --m_accounts; writeFileInfo(); endCommitUnit(__func__); @@ -1296,20 +1288,20 @@ void MyMoneyStorageSql::removeAccount(const MyMoneyAccount& acc) { void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeAccount"); - //MyMoneyMoney balance = m_storagePtr->balance(acc.id(), QDate()); + //MyMoneyMoney balance = m_storagePtr->balance(acc.id(), TQDate()); q.bindValue(":id", acc.id()); q.bindValue(":institutionId", acc.institutionId()); - q.bindValue(":parentId", acc.parentAccountId()); - if (acc.lastReconciliationDate() == QDate()) + q.bindValue(":tqparentId", acc.tqparentAccountId()); + if (acc.lastReconciliationDate() == TQDate()) q.bindValue(":lastReconciled", acc.lastReconciliationDate()); else - q.bindValue(":lastReconciled", acc.lastReconciliationDate().toString(Qt::ISODate)); + q.bindValue(":lastReconciled", TQString(acc.lastReconciliationDate().toString(Qt::ISODate))); q.bindValue(":lastModified", acc.lastModified()); - if (acc.openingDate() == QDate()) + if (acc.openingDate() == TQDate()) q.bindValue(":openingDate", acc.openingDate()); else - q.bindValue(":openingDate", acc.openingDate().toString(Qt::ISODate)); + q.bindValue(":openingDate", TQString(acc.openingDate().toString(Qt::ISODate))); q.bindValue(":accountNumber", acc.number()); q.bindValue(":accountType", acc.accountType()); @@ -1330,7 +1322,7 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& //FIXME: Using exceptions for branching always feels like a kludge. // Look for a better way. TRY - MyMoneyMoney bal = m_storagePtr->balance(acc.id(), QDate()); + MyMoneyMoney bal = m_storagePtr->balance(acc.id(), TQDate()); q.bindValue(":balance", bal.toString()); q.bindValue(":balanceFormatted", bal.formatMoney("", -1, false)); @@ -1341,8 +1333,8 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& acc.balance().formatMoney("", -1, false)); ECATCH - q.bindValue(":transactionCount", Q_ULLONG(m_transactionCountMap[acc.id()])); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Account"))); + q.bindValue(":transactionCount", TQ_ULLONG(m_transactionCountMap[acc.id()])); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Account"))); //Add in Key-Value Pairs for accounts. //MMAccount inherits from KVPContainer AND has a KVPContainer member @@ -1356,7 +1348,7 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& void MyMoneyStorageSql::writeTransactions() { DBG("*** Entering MyMoneyStorageSql::writeTransactions"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmTransactions WHERE txType = 'N';"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Transaction list")); @@ -1364,16 +1356,16 @@ void MyMoneyStorageSql::writeTransactions() { MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList list; + TQValueList list; m_storage->transactionList(list, filter); signalProgress(0, list.count(), "Writing Transactions..."); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; int i = 0; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmTransactions"].updateString()); q2.prepare (m_db.m_tables["kmmTransactions"].insertString()); for(it = list.begin(); it != list.end(); ++it, ++i) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeTransaction((*it).id(), *it, q, "N"); } else { @@ -1383,7 +1375,7 @@ void MyMoneyStorageSql::writeTransactions() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { deleteTransaction(*it); ++it; @@ -1400,7 +1392,7 @@ void MyMoneyStorageSql::addTransaction (const MyMoneyTransaction& tx) { writeTransaction(tx.id(), tx, q, "N"); ++m_transactions; // for each split account, update lastMod date, balance, txCount - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { //MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); @@ -1421,14 +1413,14 @@ void MyMoneyStorageSql::modifyTransaction (const MyMoneyTransaction& tx) { q.bindValue(":txId", tx.id()); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving old splits")); while (q.next()) { - QString id = q.value(0).toCString(); + TQString id = q.value(0).toCString(); --m_transactionCountMap[id]; } // add the transaction and splits q.prepare (m_db.m_tables["kmmTransactions"].updateString()); writeTransaction(tx.id(), tx, q, "N"); // for each split account, update lastMod date, balance, txCount - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { //MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); @@ -1448,7 +1440,7 @@ void MyMoneyStorageSql::removeTransaction(const MyMoneyTransaction& tx) { --m_transactions; // for each split account, update lastMod date, balance, txCount - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); --m_transactionCountMap[acc.id()]; @@ -1459,7 +1451,7 @@ void MyMoneyStorageSql::removeTransaction(const MyMoneyTransaction& tx) { endCommitUnit(__func__); } -void MyMoneyStorageSql::deleteTransaction(const QString& id) { +void MyMoneyStorageSql::deleteTransaction(const TQString& id) { DBG("*** Entering MyMoneyStorageSql::deleteTransaction"); MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmSplits WHERE transactionId = :transactionId;"); @@ -1477,19 +1469,19 @@ void MyMoneyStorageSql::deleteTransaction(const QString& id) { if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Transaction")); } -void MyMoneyStorageSql::writeTransaction(const QString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const QString& type) { +void MyMoneyStorageSql::writeTransaction(const TQString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const TQString& type) { DBG("*** Entering MyMoneyStorageSql::writeTransaction"); q.bindValue(":id", txId); q.bindValue(":txType", type); - q.bindValue(":postDate", tx.postDate().toString(Qt::ISODate)); + q.bindValue(":postDate", TQString(tx.postDate().toString(Qt::ISODate))); q.bindValue(":memo", tx.memo()); - q.bindValue(":entryDate", tx.entryDate().toString(Qt::ISODate)); + q.bindValue(":entryDate", TQString(tx.entryDate().toString(Qt::ISODate))); q.bindValue(":currencyId", tx.commodity()); q.bindValue(":bankId", tx.bankID()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Transaction"))); m_txPostDate = tx.postDate(); // FIXME: TEMP till Tom puts date in split object - QValueList splitList = tx.splits(); + TQValueList splitList = tx.splits(); writeSplits(txId, type, splitList); //Add in Key-Value Pairs for transactions. @@ -1498,23 +1490,23 @@ void MyMoneyStorageSql::writeTransaction(const QString& txId, const MyMoneyTrans m_hiIdTransactions = calcHighId(m_hiIdTransactions, tx.id()); } -void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, const QValueList& splitList) { +void MyMoneyStorageSql::writeSplits(const TQString& txId, const TQString& type, const TQValueList& splitList) { DBG("*** Entering MyMoneyStorageSql::writeSplits"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT splitId FROM kmmSplits where transactionId = :id;"); q.bindValue(":id", txId); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Split list")); while (q.next()) dbList.append(q.value(0).toUInt()); - QValueList::const_iterator it; + TQValueList::const_iterator it; unsigned int i; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmSplits"].updateString()); q2.prepare (m_db.m_tables["kmmSplits"].insertString()); for(it = splitList.begin(), i = 0; it != splitList.end(); ++it, ++i) { - if (dbList.contains(i)) { + if (dbList.tqcontains(i)) { dbList.remove (i); writeSplit(txId, (*it), type, i, q); } else { @@ -1525,7 +1517,7 @@ void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, co if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmSplits WHERE transactionId = :txId AND splitId = :splitId"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":txId", txId); q.bindValue(":splitId", *it); @@ -1535,62 +1527,62 @@ void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, co } } -void MyMoneyStorageSql::writeSplit(const QString& txId, const MyMoneySplit& split, - const QString& type, const int splitId, MyMoneySqlQuery& q) { +void MyMoneyStorageSql::writeSplit(const TQString& txId, const MyMoneySplit& split, + const TQString& type, const int splitId, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeSplit"); q.bindValue(":transactionId", txId); q.bindValue(":txType", type); q.bindValue(":splitId", splitId); q.bindValue(":payeeId", split.payeeId()); - if (split.reconcileDate() == QDate()) + if (split.reconcileDate() == TQDate()) q.bindValue(":reconcileDate", split.reconcileDate()); else - q.bindValue(":reconcileDate", split.reconcileDate().toString(Qt::ISODate)); + q.bindValue(":reconcileDate", TQString(split.reconcileDate().toString(Qt::ISODate))); q.bindValue(":action", split.action()); q.bindValue(":reconcileFlag", split.reconcileFlag()); q.bindValue(":value", split.value().toString()); q.bindValue(":valueFormatted", split.value() .formatMoney("", -1, false) - .replace(QChar(','), QChar('.'))); + .tqreplace(TQChar(','), TQChar('.'))); q.bindValue(":shares", split.shares().toString()); MyMoneyAccount acc = m_storagePtr->account(split.accountId()); MyMoneySecurity sec = m_storagePtr->security(acc.currencyId()); q.bindValue(":sharesFormatted", split.shares(). formatMoney("", MyMoneyMoney::denomToPrec(sec.smallestAccountFraction()), false). - replace(QChar(','), QChar('.'))); + tqreplace(TQChar(','), TQChar('.'))); MyMoneyMoney price = split.actualPrice(); if (!price.isZero()) { q.bindValue(":price", price.toString()); q.bindValue(":priceFormatted", price.formatMoney ("", KMyMoneySettings::pricePrecision(), false) - .replace(QChar(','), QChar('.'))); + .tqreplace(TQChar(','), TQChar('.'))); } else { - q.bindValue(":price", QString()); - q.bindValue(":priceFormatted", QString()); + q.bindValue(":price", TQString()); + q.bindValue(":priceFormatted", TQString()); } q.bindValue(":memo", split.memo()); q.bindValue(":accountId", split.accountId()); q.bindValue(":checkNumber", split.number()); q.bindValue(":postDate", m_txPostDate.toString(Qt::ISODate)); // FIXME: when Tom puts date into split object q.bindValue(":bankId", split.bankID()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Split"))); - deleteKeyValuePairs("SPLIT", txId + QString::number(splitId)); - writeKeyValuePairs("SPLIT", txId + QString::number(splitId), split.pairs()); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Split"))); + deleteKeyValuePairs("SPLIT", txId + TQString::number(splitId)); + writeKeyValuePairs("SPLIT", txId + TQString::number(splitId), split.pairs()); } // **** Schedules **** void MyMoneyStorageSql::writeSchedules() { DBG("*** Entering MyMoneyStorageSql::writeSchedules"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmSchedules;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Schedule list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList list = m_storage->scheduleList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->scheduleList(); + TQValueList::ConstIterator it; MyMoneySqlQuery q2(this); //TODO: find a way to prepare the queries outside of the loop. writeSchedule() // modifies the query passed to it, so they have to be re-prepared every pass. @@ -1599,7 +1591,7 @@ void MyMoneyStorageSql::writeSchedules() { q.prepare (m_db.m_tables["kmmSchedules"].updateString()); q2.prepare (m_db.m_tables["kmmSchedules"].insertString()); bool insert = true; - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); insert = false; writeSchedule(*it, q, insert); @@ -1610,7 +1602,7 @@ void MyMoneyStorageSql::writeSchedules() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { deleteSchedule(*it); ++it; @@ -1648,7 +1640,7 @@ void MyMoneyStorageSql::removeSchedule(const MyMoneySchedule& sched) { endCommitUnit(__func__); } -void MyMoneyStorageSql::deleteSchedule (const QString& id) { +void MyMoneyStorageSql::deleteSchedule (const TQString& id) { DBG("*** Entering MyMoneyStorageSql::deleteSchedule"); deleteTransaction(id); MyMoneySqlQuery q(this); @@ -1673,8 +1665,8 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer q.bindValue(":occurenceString", sch.occurenceToString()); q.bindValue(":paymentType", sch.paymentType()); q.bindValue(":paymentTypeString", MyMoneySchedule::paymentMethodToString(sch.paymentType())); - q.bindValue(":startDate", sch.startDate().toString(Qt::ISODate)); - q.bindValue(":endDate", sch.endDate().toString(Qt::ISODate)); + q.bindValue(":startDate", TQString(sch.startDate().toString(Qt::ISODate))); + q.bindValue(":endDate", TQString(sch.endDate().toString(Qt::ISODate))); if (sch.isFixed()) { q.bindValue(":fixed", "Y"); } else { @@ -1686,24 +1678,24 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer q.bindValue(":autoEnter", "N"); } q.bindValue(":lastPayment", sch.lastPayment()); - q.bindValue(":nextPaymentDue", sch.nextDueDate().toString(Qt::ISODate)); + q.bindValue(":nextPaymentDue", TQString(sch.nextDueDate().toString(Qt::ISODate))); q.bindValue(":weekendOption", sch.weekendOption()); q.bindValue(":weekendOptionString", MyMoneySchedule::weekendOptionToString(sch.weekendOption())); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Schedules"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Schedules"))); //store the payment history for this scheduled task. //easiest way is to delete all and re-insert; it's not a high use table q.prepare("DELETE FROM kmmSchedulePaymentHistory WHERE schedId = :id;"); q.bindValue(":id", sch.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Schedule Payment History"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Schedule Payment History"))); q.prepare (m_db.m_tables["kmmSchedulePaymentHistory"].insertString()); - QValueList payments = sch.recordedPayments(); - QValueList::ConstIterator it; + TQValueList payments = sch.recordedPayments(); + TQValueList::ConstIterator it; for (it=payments.begin(); it!=payments.end(); ++it) { q.bindValue(":schedId", sch.id()); - q.bindValue(":payDate", (*it).toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Schedule Payment History"))); + q.bindValue(":payDate", TQString((*it).toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Schedule Payment History"))); } //store the transaction data for this task. @@ -1726,19 +1718,19 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer void MyMoneyStorageSql::writeSecurities() { DBG("*** Entering MyMoneyStorageSql::writeSecurities"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT id FROM kmmSecurities;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building security list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList securityList = m_storage->securityList(); + const TQValueList securityList = m_storage->securityList(); signalProgress(0, securityList.count(), "Writing Securities..."); q.prepare (m_db.m_tables["kmmSecurities"].updateString()); q2.prepare (m_db.m_tables["kmmSecurities"].insertString()); - for(QValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { - if (dbList.contains((*it).id())) { + for(TQValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeSecurity((*it), q); } else { @@ -1750,7 +1742,7 @@ void MyMoneyStorageSql::writeSecurities() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmSecurities WHERE id = :id"); q2.prepare("DELETE FROM kmmPrices WHERE fromId = :id OR toId = :id"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":id", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Security")); @@ -1792,7 +1784,7 @@ void MyMoneyStorageSql::removeSecurity(const MyMoneySecurity& sec) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmSecurities"].deleteString()); q.bindValue(":id", sec.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Security"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Security"))); --m_securities; writeFileInfo(); endCommitUnit(__func__); @@ -1808,7 +1800,7 @@ void MyMoneyStorageSql::writeSecurity(const MyMoneySecurity& security, MyMoneySq q.bindValue(":smallestAccountFraction", security.smallestAccountFraction()); q.bindValue(":tradingCurrency", security.tradingCurrency()); q.bindValue(":tradingMarket", security.tradingMarket()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("writing Securities"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("writing Securities"))); //Add in Key-Value Pairs for security writeKeyValuePairs("SECURITY", security.id(), security.pairs()); @@ -1822,7 +1814,7 @@ void MyMoneyStorageSql::writePrices() { // easiest way is to delete all and re-insert MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmPrices"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Prices"))); m_prices = 0; const MyMoneyPriceList list = m_storage->priceList(); @@ -1849,13 +1841,13 @@ void MyMoneyStorageSql::addPrice(const MyMoneyPrice& p) { startCommitUnit(__func__); bool newRecord = false; MyMoneySqlQuery q(this); - QString s = m_db.m_tables["kmmPrices"].selectAllString(false); + TQString s = m_db.m_tables["kmmPrices"].selectAllString(false); s += " WHERE fromId = :fromId AND toId = :toId AND priceDate = :priceDate;"; q.prepare (s); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("finding Price"))); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("finding Price"))); if (q.next()) { q.prepare(m_db.m_tables["kmmPrices"].updateString()); } else { @@ -1865,12 +1857,12 @@ void MyMoneyStorageSql::addPrice(const MyMoneyPrice& p) { } q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - q.bindValue(":price", p.rate(QString()).toString()); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + q.bindValue(":price", p.rate(TQString()).toString()); q.bindValue(":priceFormatted", - p.rate(QString()).formatMoney("", KMyMoneySettings::pricePrecision())); + p.rate(TQString()).formatMoney("", KMyMoneySettings::pricePrecision())); q.bindValue(":priceSource", p.source()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Price"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Price"))); if (newRecord) writeFileInfo(); endCommitUnit(__func__); @@ -1883,8 +1875,8 @@ void MyMoneyStorageSql::removePrice(const MyMoneyPrice& p) { q.prepare (m_db.m_tables["kmmPrices"].deleteString()); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Price"))); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Price"))); --m_prices; writeFileInfo(); endCommitUnit(__func__); @@ -1896,30 +1888,30 @@ void MyMoneyStorageSql::writePrice(const MyMoneyPrice& p) { q.prepare (m_db.m_tables["kmmPrices"].insertString()); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - q.bindValue(":price", p.rate(QString()).toString()); - q.bindValue(":priceFormatted", p.rate(QString()).formatMoney("", 2)); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + q.bindValue(":price", p.rate(TQString()).toString()); + q.bindValue(":priceFormatted", p.rate(TQString()).formatMoney("", 2)); q.bindValue(":priceSource", p.source()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Prices"))); } // **** Currencies **** void MyMoneyStorageSql::writeCurrencies() { DBG("*** Entering MyMoneyStorageSql::writeCurrencies"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT ISOCode FROM kmmCurrencies;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Currency list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList currencyList = m_storage->currencyList(); + const TQValueList currencyList = m_storage->currencyList(); signalProgress(0, currencyList.count(), "Writing Currencies..."); q.prepare (m_db.m_tables["kmmCurrencies"].updateString()); q2.prepare (m_db.m_tables["kmmCurrencies"].insertString()); - for(QValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { - if (dbList.contains((*it).id())) { + for(TQValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeCurrency((*it), q); } else { @@ -1930,7 +1922,7 @@ void MyMoneyStorageSql::writeCurrencies() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmCurrencies WHERE ISOCode = :ISOCode"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":ISOCode", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Currency")); @@ -1966,7 +1958,7 @@ void MyMoneyStorageSql::removeCurrency(const MyMoneySecurity& sec) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmCurrencies"].deleteString()); q.bindValue(":ISOcode", sec.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Currency"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Currency"))); --m_currencies; writeFileInfo(); endCommitUnit(__func__); @@ -1980,35 +1972,35 @@ void MyMoneyStorageSql::writeCurrency(const MyMoneySecurity& currency, MyMoneySq q.bindValue(":typeString", MyMoneySecurity::securityTypeToString(currency.securityType())); // writing the symbol as three short ints is a PITA, but the // problem is that database drivers have incompatible ways of declaring UTF8 - QString symbol = currency.tradingSymbol() + " "; - q.bindValue(":symbol1", symbol.mid(0,1).unicode()->unicode()); - q.bindValue(":symbol2", symbol.mid(1,1).unicode()->unicode()); - q.bindValue(":symbol3", symbol.mid(2,1).unicode()->unicode()); + TQString symbol = currency.tradingSymbol() + " "; + q.bindValue(":symbol1", symbol.mid(0,1).tqunicode()->tqunicode()); + q.bindValue(":symbol2", symbol.mid(1,1).tqunicode()->tqunicode()); + q.bindValue(":symbol3", symbol.mid(2,1).tqunicode()->tqunicode()); q.bindValue(":symbolString", symbol); q.bindValue(":partsPerUnit", currency.partsPerUnit()); q.bindValue(":smallestCashFraction", currency.smallestCashFraction()); q.bindValue(":smallestAccountFraction", currency.smallestAccountFraction()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Currencies"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Currencies"))); } void MyMoneyStorageSql::writeReports() { DBG("*** Entering MyMoneyStorageSql::writeReports"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT id FROM kmmReportConfig;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Report list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list = m_storage->reportList(); + TQValueList list = m_storage->reportList(); signalProgress(0, list.count(), "Writing Reports..."); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; q.prepare (m_db.m_tables["kmmReportConfig"].updateString()); q2.prepare (m_db.m_tables["kmmReportConfig"].insertString()); for(it = list.begin(); it != list.end(); ++it){ - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeReport(*it, q); } else { @@ -2019,7 +2011,7 @@ void MyMoneyStorageSql::writeReports() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmReportConfig WHERE id = :id"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":id", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Report")); @@ -2055,7 +2047,7 @@ void MyMoneyStorageSql::removeReport(const MyMoneyReport& rep) { MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmReportConfig WHERE id = :id"); q.bindValue(":id", rep.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Report"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Report"))); --m_reports; writeFileInfo(); endCommitUnit(__func__); @@ -2063,34 +2055,34 @@ void MyMoneyStorageSql::removeReport(const MyMoneyReport& rep) { void MyMoneyStorageSql::writeReport (const MyMoneyReport& rep, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeReport"); - QDomDocument d; // create a dummy XML document - QDomElement e = d.createElement("REPORTS"); + TQDomDocument d; // create a dummy XML document + TQDomElement e = d.createElement("REPORTS"); d.appendChild (e); rep.writeXML(d, e); // write the XML to document q.bindValue(":id", rep.id()); q.bindValue(":name", rep.name()); q.bindValue(":XML", d.toString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Reports"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Reports"))); //m_hiIdReports = calcHighId(m_hiIdReports, rep.id()); } void MyMoneyStorageSql::writeBudgets() { DBG("*** Entering MyMoneyStorageSql::writeBudgets"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT name FROM kmmBudgetConfig;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Budget list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list = m_storage->budgetList(); + TQValueList list = m_storage->budgetList(); signalProgress(0, list.count(), "Writing Budgets..."); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; q.prepare (m_db.m_tables["kmmBudgetConfig"].updateString()); q2.prepare (m_db.m_tables["kmmBudgetConfig"].insertString()); for(it = list.begin(); it != list.end(); ++it){ - if (dbList.contains((*it).name())) { + if (dbList.tqcontains((*it).name())) { dbList.remove ((*it).name()); writeBudget(*it, q); } else { @@ -2101,7 +2093,7 @@ void MyMoneyStorageSql::writeBudgets() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmBudgetConfig WHERE id = :id"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":name", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Budget")); @@ -2137,7 +2129,7 @@ void MyMoneyStorageSql::removeBudget(const MyMoneyBudget& bud) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmBudgetConfig"].deleteString()); q.bindValue(":id", bud.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Budget"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Budget"))); --m_budgets; writeFileInfo(); endCommitUnit(__func__); @@ -2145,15 +2137,15 @@ void MyMoneyStorageSql::removeBudget(const MyMoneyBudget& bud) { void MyMoneyStorageSql::writeBudget (const MyMoneyBudget& bud, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeBudget"); - QDomDocument d; // create a dummy XML document - QDomElement e = d.createElement("BUDGETS"); + TQDomDocument d; // create a dummy XML document + TQDomElement e = d.createElement("BUDGETS"); d.appendChild (e); bud.writeXML(d, e); // write the XML to document q.bindValue(":id", bud.id()); q.bindValue(":name", bud.name()); q.bindValue(":start", bud.budgetStart()); q.bindValue(":XML", d.toString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Budgets"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Budgets"))); } void MyMoneyStorageSql::writeFileInfo() { @@ -2165,7 +2157,7 @@ void MyMoneyStorageSql::writeFileInfo() { MyMoneySqlQuery q(this); q.prepare ("SELECT * FROM kmmFileInfo;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "checking fileinfo")); - QString qs; + TQString qs; if (q.next()) qs = m_db.m_tables["kmmFileInfo"].updateString(); else @@ -2173,9 +2165,9 @@ void MyMoneyStorageSql::writeFileInfo() { q.prepare(qs); q.bindValue(":version", m_dbVersion); q.bindValue(":fixLevel", m_storage->fileFixVersion()); - q.bindValue(":created", m_storage->creationDate().toString(Qt::ISODate)); + q.bindValue(":created", TQString(m_storage->creationDate().toString(Qt::ISODate))); //q.bindValue(":lastModified", m_storage->lastModificationDate().toString(Qt::ISODate)); - q.bindValue(":lastModified", QDate::currentDate().toString(Qt::ISODate)); + q.bindValue(":lastModified", TQString(TQDate::tqcurrentDate().toString(Qt::ISODate))); q.bindValue(":baseCurrency", m_storage->pairs()["kmm-baseCurrency"]); q.bindValue(":institutions", (unsigned long long) m_institutions); q.bindValue(":accounts", (unsigned long long) m_accounts); @@ -2189,8 +2181,8 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":reports", (unsigned long long) m_reports); q.bindValue(":kvps", (unsigned long long) m_kvps); q.bindValue(":budgets", (unsigned long long) m_budgets); - q.bindValue(":dateRangeStart", QDate()); - q.bindValue(":dateRangeEnd", QDate()); + q.bindValue(":dateRangeStart", TQDate()); + q.bindValue(":dateRangeEnd", TQDate()); //FIXME: This modifies all m_ used in this function. // Sometimes the memory has been updated. @@ -2217,19 +2209,19 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":updateInProgress", "N"); q.bindValue(":logonUser", m_logonUser); q.bindValue(":logonAt", m_logonAt.toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing FileInfo"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing FileInfo"))); } // **** Key/value pairs **** -void MyMoneyStorageSql::writeKeyValuePairs(const QString& kvpType, const QString& kvpId, const QMap& pairs) { +void MyMoneyStorageSql::writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap& pairs) { DBG("*** Entering MyMoneyStorageSql::writeKeyValuePairs"); - QMap::const_iterator it; + TQMap::const_iterator it; for(it = pairs.begin(); it != pairs.end(); ++it) { writeKeyValuePair (kvpType, kvpId, it.key(), it.data()); } } -void MyMoneyStorageSql::writeKeyValuePair (const QString& kvpType, const QString& kvpId, const QString& kvpKey, const QString& kvpData) { +void MyMoneyStorageSql::writeKeyValuePair (const TQString& kvpType, const TQString& kvpId, const TQString& kvpKey, const TQString& kvpData) { DBG("*** Entering MyMoneyStorageSql::writeKeyValuePair"); MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmKeyValuePairs"].insertString()); @@ -2237,17 +2229,17 @@ void MyMoneyStorageSql::writeKeyValuePair (const QString& kvpType, const QString q.bindValue(":kvpId", kvpId); q.bindValue(":kvpKey", kvpKey); q.bindValue(":kvpData", kvpData); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing KVP"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing KVP"))); ++m_kvps; } -void MyMoneyStorageSql::deleteKeyValuePairs (const QString& kvpType, const QString& kvpId) { +void MyMoneyStorageSql::deleteKeyValuePairs (const TQString& kvpType, const TQString& kvpId) { DBG("*** Entering MyMoneyStorageSql::deleteKeyValuePairs"); MyMoneySqlQuery q(this); q.prepare ("DELETE FROM kmmKeyValuePairs WHERE kvpType = :kvpType AND kvpId = :kvpId;"); q.bindValue(":kvpType", kvpType); q.bindValue(":kvpId", kvpId); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting kvp for %1 %2").arg(kvpType).arg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting kvp for %1 %2").tqarg(kvpType).tqarg(kvpId))); m_kvps -= q.numRowsAffected(); } @@ -2262,12 +2254,12 @@ void MyMoneyStorageSql::deleteKeyValuePairs (const QString& kvpType, const QStri void MyMoneyStorageSql::readFileInfo(void) { DBG("*** Entering MyMoneyStorageSql::readFileInfo"); - signalProgress(0, 18, QObject::tr("Loading file information...")); + signalProgress(0, 18, TQObject::tr("Loading file information...")); MyMoneyDbTable& t = m_db.m_tables["kmmFileInfo"]; MyMoneySqlQuery q(this); q.prepare (t.selectAllString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading FileInfo"))); - if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("retrieving FileInfo"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading FileInfo"))); + if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("retrieving FileInfo"))); MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; while (ft != t.end()) { @@ -2302,10 +2294,10 @@ void MyMoneyStorageSql::readFileInfo(void) { ++ft; ++i; signalProgress(i,0); } - m_storage->setPairs(readKeyValuePairs("STORAGE", QString("")).pairs()); + m_storage->setPairs(readKeyValuePairs("STORAGE", TQString("")).pairs()); } -/*void MyMoneyStorageSql::setVersion (const QString& version) { +/*void MyMoneyStorageSql::setVersion (const TQString& version) { DBG("*** Entering MyMoneyStorageSql::setVersion"); m_dbVersion = version.section('.', 0, 0).toUInt(); m_minorVersion = version.section('.', 1, 1).toUInt(); @@ -2318,31 +2310,31 @@ void MyMoneyStorageSql::readFileInfo(void) { void MyMoneyStorageSql::readInstitutions(void) { TRY - QMap iList = fetchInstitutions(); + TQMap iList = fetchInstitutions(); m_storage->loadInstitutions(iList); readFileInfo(); m_storage->loadInstitutionId(m_hiIdInstitutions); PASS } -const QMap MyMoneyStorageSql::fetchInstitutions (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchInstitutions (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readInstitutions"); - signalProgress(0, m_institutions, QObject::tr("Loading institutions...")); + signalProgress(0, m_institutions, TQObject::tr("Loading institutions...")); int progress = 0; - QMap iList; + TQMap iList; unsigned long lastId = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmInstitutions"]; MyMoneySqlQuery sq(const_cast (this)); sq.prepare ("SELECT id from kmmAccounts where institutionId = :id"); MyMoneySqlQuery q(const_cast (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " id = :id" + QString::number(i) + " OR"; + queryString += " id = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } if (forUpdate) @@ -2353,17 +2345,17 @@ const QMap MyMoneyStorageSql::fetchInstitutions (co q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Institution"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString iid; + TQString iid; MyMoneyInstitution inst; while (ft != t.end()) { CASE(id) iid = GETSTRING; @@ -2378,10 +2370,10 @@ const QMap MyMoneyStorageSql::fetchInstitutions (co } // get list of subaccounts sq.bindValue(":id", iid); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Institution AccountList"))); - QStringList aList; + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Institution AccountList"))); + TQStringList aList; while (sq.next()) aList.append(sq.value(0).toString()); - for (QStringList::ConstIterator it = aList.begin(); it != aList.end(); ++it) + for (TQStringList::ConstIterator it = aList.begin(); it != aList.end(); ++it) inst.addAccountId(*it); iList[iid] = MyMoneyInstitution(iid, inst); @@ -2394,18 +2386,18 @@ const QMap MyMoneyStorageSql::fetchInstitutions (co return iList; } -void MyMoneyStorageSql::readPayees (const QString& id) { +void MyMoneyStorageSql::readPayees (const TQString& id) { DBG("*** Entering MyMoneyStorageSql::readPayees"); - QValueList list; + TQValueList list; list.append(id); readPayees(list); } -void MyMoneyStorageSql::readPayees(const QValueList pid) { +void MyMoneyStorageSql::readPayees(const TQValueList pid) { DBG("*** Entering MyMoneyStorageSql::readPayees"); TRY - QStringList pidList; - qCopy(pid.begin(), pid.end(), qBackInserter(pidList)); + TQStringList pidList; + tqCopy(pid.begin(), pid.end(), qBackInserter(pidList)); m_storage->loadPayees(fetchPayees(pidList)); readFileInfo(); @@ -2416,15 +2408,15 @@ void MyMoneyStorageSql::readPayees(const QValueList pid) { // if (pid.isEmpty()) m_payeeListRead = true; } -const QMap MyMoneyStorageSql::fetchPayees (const QStringList& idList, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchPayees (const TQStringList& idList, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readPayees"); - if (m_displayStatus) { - signalProgress(0, m_payees, QObject::tr("Loading payees...")); + if (m_displaytqStatus) { + signalProgress(0, m_payees, TQObject::tr("Loading payees...")); } else { // if (m_payeeListRead) return; } int progress = 0; - QMap pList; + TQMap pList; //unsigned long lastId; const MyMoneyDbTable& t = m_db.m_tables["kmmPayees"]; MyMoneyDbTable::field_iterator payeeEnd = t.end(); @@ -2432,26 +2424,26 @@ const QMap MyMoneyStorageSql::fetchPayees (const QStringL if (idList.isEmpty()) { q.prepare (t.selectAllString()); } else { - QString whereClause = " where ("; - QString itemConnector = ""; - QStringList::ConstIterator it; + TQString whereClause = " where ("; + TQString itemConnector = ""; + TQStringList::ConstIterator it; for (it = idList.begin(); it != idList.end(); ++it) { - whereClause.append(QString("%1id = '%2'").arg(itemConnector).arg(*it)); + whereClause.append(TQString("%1id = '%2'").tqarg(itemConnector).tqarg(*it)); itemConnector = " or "; } whereClause += ")"; q.prepare (t.selectAllString(false) + whereClause); } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Payee"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString pid; - QString boolChar; + TQString pid; + TQString boolChar; MyMoneyPayee payee; unsigned int type; bool ignoreCase; - QString matchKeys; + TQString matchKeys; while (ft != payeeEnd) { CASE(id) pid = GETCSTRING; else CASE(name) payee.setName(GETSTRING); @@ -2476,48 +2468,48 @@ const QMap MyMoneyStorageSql::fetchPayees (const QStringL PASS } else { pList[pid] = MyMoneyPayee(pid, payee); - //unsigned long id = extractId(QString(pid)); + //unsigned long id = extractId(TQString(pid)); //if(id > lastId) // lastId = id; } - if (m_displayStatus) signalProgress(++progress, 0); + if (m_displaytqStatus) signalProgress(++progress, 0); } return pList; } -const QMap MyMoneyStorageSql::fetchAccounts (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchAccounts (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::fetchAccounts"); - signalProgress(0, m_accounts, QObject::tr("Loading accounts...")); + signalProgress(0, m_accounts, TQObject::tr("Loading accounts...")); int progress = 0; - QMap accList; - QStringList kvpAccountList; + TQMap accList; + TQStringList kvpAccountList; const MyMoneyDbTable& t = m_db.m_tables["kmmAccounts"]; MyMoneyDbTable::field_iterator accEnd = t.end(); MyMoneySqlQuery q(const_cast (this)); MyMoneySqlQuery sq(const_cast (this)); - QString childQueryString = "SELECT id, parentId FROM kmmAccounts WHERE "; - QString queryString (t.selectAllString(false)); + TQString childQueryString = "SELECT id, tqparentId FROM kmmAccounts WHERE "; + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { kvpAccountList = idList; queryString += " WHERE id IN ("; - childQueryString += " parentId IN ("; + childQueryString += " tqparentId IN ("; for (unsigned i = 0; i < idList.count(); ++i) { - queryString += " :id" + QString::number(i) + ", "; - childQueryString += ":id" + QString::number(i) + ", "; + queryString += " :id" + TQString::number(i) + ", "; + childQueryString += ":id" + TQString::number(i) + ", "; } queryString = queryString.left(queryString.length() - 2) + ")"; childQueryString = childQueryString.left(childQueryString.length() - 2) + ")"; } else { - childQueryString += " NOT parentId IS NULL"; + childQueryString += " NOT tqparentId IS NULL"; } queryString += " ORDER BY id"; - childQueryString += " ORDER BY parentid, id"; + childQueryString += " ORDER BY tqparentid, id"; if (forUpdate) { queryString += " FOR UPDATE"; @@ -2528,26 +2520,26 @@ const QMap MyMoneyStorageSql::fetchAccounts (const QStr sq.prepare (childQueryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); - sq.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); + sq.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Account"))); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading subAccountList"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Account"))); + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading subAccountList"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString aid; - QString balance; + TQString aid; + TQString balance; MyMoneyAccount acc; while (ft != accEnd) { CASE(id) aid = GETCSTRING; else CASE(institutionId) acc.setInstitutionId(GETCSTRING); - else CASE(parentId) acc.setParentAccountId(GETCSTRING); + else CASE(tqparentId) acc.setParentAccountId(GETCSTRING); else CASE(lastReconciled) acc.setLastReconciliationDate(GETDATE); else CASE(lastModified) acc.setLastModified(GETDATE); else CASE(openingDate) acc.setOpeningDate(GETDATE); @@ -2575,10 +2567,10 @@ const QMap MyMoneyStorageSql::fetchAccounts (const QStr signalProgress(++progress, 0); } - QMapIterator it_acc; - QMapIterator accListEnd = accList.end(); + TQMapIterator it_acc; + TQMapIterator accListEnd = accList.end(); while (sq.next()) { - it_acc = accList.find(sq.value(1).toString()); + it_acc = accList.tqfind(sq.value(1).toString()); if (it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) { while (sq.isValid() && it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) { @@ -2593,16 +2585,16 @@ const QMap MyMoneyStorageSql::fetchAccounts (const QStr // where it may be able to be done in O(n), if things are just right. // The operator[] call in the loop is the most expensive call in this function, according // to several profile runs. - QMap kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList); - QMap ::const_iterator kvp_end = kvpResult.end(); - for (QMap ::const_iterator it_kvp = kvpResult.begin(); + TQMap kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList); + TQMap ::const_iterator kvp_end = kvpResult.end(); + for (TQMap ::const_iterator it_kvp = kvpResult.begin(); it_kvp != kvp_end; ++it_kvp) { accList[it_kvp.key()].setPairs(it_kvp.data().pairs()); } kvpResult = readKeyValuePairs("ONLINEBANKING", kvpAccountList); kvp_end = kvpResult.end(); - for (QMap ::const_iterator it_kvp = kvpResult.begin(); + for (TQMap ::const_iterator it_kvp = kvpResult.begin(); it_kvp != kvp_end; ++it_kvp) { accList[it_kvp.key()].setOnlineBankingSettings(it_kvp.data()); } @@ -2615,15 +2607,15 @@ void MyMoneyStorageSql::readAccounts(void) { m_storage->loadAccountId(m_hiIdAccounts); } -const QMap MyMoneyStorageSql::fetchBalance(const QStringList& idList, const QDate& date) const { +const TQMap MyMoneyStorageSql::fetchBalance(const TQStringList& idList, const TQDate& date) const { - QMap returnValue; + TQMap returnValue; MyMoneySqlQuery q(const_cast (this)); - QString queryString = "SELECT action, shares, accountId, postDate " + TQString queryString = "SELECT action, shares, accountId, postDate " "FROM kmmSplits WHERE txType = 'N' AND accountId in ("; for (unsigned i = 0; i < idList.count(); ++i) { - queryString += " :id" + QString::number(i) + ", "; + queryString += " :id" + TQString::number(i) + ", "; } queryString = queryString.left(queryString.length() - 2) + " )"; @@ -2631,20 +2623,20 @@ const QMap MyMoneyStorageSql::fetchBalance(const QStringL // the <= operator misbehave when the date matches. To avoid this, add a day to the // requested date and use the < operator. if (date.isValid() && !date.isNull()) - queryString += QString(" AND postDate < '%1'").arg(date.addDays(1).toString(Qt::ISODate)); + queryString += TQString(" AND postDate < '%1'").tqarg(date.addDays(1).toString(Qt::ISODate)); DBG (queryString); q.prepare(queryString); - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); returnValue[*bindVal] = MyMoneyMoney(0); } if (!q.exec()) - throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("fetching balance"))); - QString id; - QString shares; - QString action; + throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("fetching balance"))); + TQString id; + TQString shares; + TQString action; while (q.next()) { id = q.value(2).toString(); shares = q.value(1).toString(); @@ -2657,7 +2649,7 @@ const QMap MyMoneyStorageSql::fetchBalance(const QStringL return returnValue; } -void MyMoneyStorageSql::readTransactions(const QString& tidList, const QString& dateClause) { +void MyMoneyStorageSql::readTransactions(const TQString& tidList, const TQString& dateClause) { TRY m_storage->loadTransactions(fetchTransactions(tidList, dateClause)); m_storage->loadTransactionId(m_hiIdTransactions); @@ -2671,13 +2663,13 @@ void MyMoneyStorageSql::readTransactions(const MyMoneyTransactionFilter& filter) PASS } -const QMap MyMoneyStorageSql::fetchTransactions (const QString& tidList, const QString& dateClause, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchTransactions (const TQString& tidList, const TQString& dateClause, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // if (m_transactionListRead) return; // all list already in memory - if (m_displayStatus) signalProgress(0, m_transactions, QObject::tr("Loading transactions...")); + if (m_displaytqStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions...")); int progress = 0; // m_payeeList.clear(); - QString whereClause; + TQString whereClause; whereClause = " WHERE txType = 'N' "; if (! tidList.isEmpty()) { whereClause += " AND id IN " + tidList; @@ -2686,7 +2678,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co const MyMoneyDbTable& t = m_db.m_tables["kmmTransactions"]; MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(false) + whereClause + " ORDER BY id;"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Transaction"))); const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"]; whereClause = " WHERE txType = 'N' "; if (! tidList.isEmpty()) { @@ -2694,11 +2686,11 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } if (!dateClause.isEmpty()) whereClause += " and " + dateClause; MyMoneySqlQuery qs(const_cast (this)); - QString splitQuery = ts.selectAllString(false) + whereClause + TQString splitQuery = ts.selectAllString(false) + whereClause + " ORDER BY transactionId, splitId;"; qs.prepare (splitQuery); if (!qs.exec()) throw new MYMONEYEXCEPTION(buildError (qs, __func__, "reading Splits")); - QString splitTxId = "ZZZ"; + TQString splitTxId = "ZZZ"; MyMoneySplit s; if (qs.next()) { splitTxId = qs.value(0).toString(); @@ -2706,12 +2698,12 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } else { splitTxId = "ZZZ"; } - QMap txMap; - QStringList txList; + TQMap txMap; + TQStringList txList; MyMoneyDbTable::field_iterator txEnd = t.end(); while (q.next()) { MyMoneyTransaction tx; - QString txId; + TQString txId; MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; while (ft != txEnd) { @@ -2749,14 +2741,14 @@ const QMap MyMoneyStorageSql::fetchTransactions (co txMap.insert(tx.uniqueSortKey(), tx); } } - QMap kvpMap = readKeyValuePairs("TRANSACTION", txList); - QMap tList; - QMapIterator txMapEnd = txMap.end(); - for (QMapIterator i = txMap.begin(); + TQMap kvpMap = readKeyValuePairs("TRANSACTION", txList); + TQMap tList; + TQMapIterator txMapEnd = txMap.end(); + for (TQMapIterator i = txMap.begin(); i != txMapEnd; ++i) { i.data().setPairs(kvpMap[i.data().id()].pairs()); - if (m_displayStatus) signalProgress(++progress, 0); + if (m_displaytqStatus) signalProgress(++progress, 0); } if ((tidList.isEmpty()) && (dateClause.isEmpty())) { @@ -2789,20 +2781,20 @@ int MyMoneyStorageSql::splitState(const MyMoneyTransactionFilter::stateOptionE& return rc; } -const QMap MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const { +const TQMap MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // analyze the filter // if (m_transactionListRead) return; // all list already in memory // if the filter is restricted to certain accounts/categories // check if we already have them all in memory - QStringList accounts; - QString inQuery; + TQStringList accounts; + TQString inQuery; filter.accounts(accounts); filter.categories(accounts); -// QStringList::iterator it; +// TQStringList::iterator it; // bool allAccountsLoaded = true; // for (it = accounts.begin(); it != accounts.end(); ++it) { -// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) { +// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) { // allAccountsLoaded = false; // break; // } @@ -2817,7 +2809,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co alert ("Amount Filter Set"); canImplementFilter = false; } - QString n1, n2; + TQString n1, n2; if (filter.numberFilter(n1, n2)) { alert("Number filter set"); canImplementFilter = false; @@ -2832,7 +2824,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co // alert("State filter set"); // canImplementFilter = false; // } - QRegExp t2; + TQRegExp t2; if (filter.textFilter(t2)) { alert("text filter set"); canImplementFilter = false; @@ -2843,9 +2835,9 @@ const QMap MyMoneyStorageSql::fetchTransactions (co canImplementFilter = false; } if (!canImplementFilter) { - QMap transactionList = fetchTransactions(); - QMap::ConstIterator it_t; - QMap::ConstIterator txListEnd = transactionList.end(); + TQMap transactionList = fetchTransactions(); + TQMap::ConstIterator it_t; + TQMap::ConstIterator txListEnd = transactionList.end(); std::remove_if(transactionList.begin(), transactionList.end(), FilterFail(filter, m_storagePtr)); return transactionList; @@ -2854,27 +2846,27 @@ const QMap MyMoneyStorageSql::fetchTransactions (co bool accountsOnlyFilter = true; bool splitFilterActive = false; // the split filter is active if we are selecting on fields in the split table // get start and end dates - QDate start = filter.fromDate(); - QDate end = filter.toDate(); + TQDate start = filter.fromDate(); + TQDate end = filter.toDate(); // not entirely sure if the following is correct, but at best, saves a lot of reads, at worst // it only causes us to read a few more transactions that strictly necessary (I think...) - if (start == KMyMoneySettings::startDate().date()) start = QDate(); - bool txFilterActive = ((start != QDate()) || (end != QDate())); // and this for fields in the transaction table + if (start == KMyMoneySettings::startDate().date()) start = TQDate(); + bool txFilterActive = ((start != TQDate()) || (end != TQDate())); // and this for fields in the transaction table if (txFilterActive) accountsOnlyFilter = false; - QString whereClause = ""; - QString subClauseconnector = " where txType = 'N' and "; + TQString whereClause = ""; + TQString subClauseconnector = " where txType = 'N' and "; // payees - QStringList payees; + TQStringList payees; //filter.payees(payees); if (filter.payees(payees)) { accountsOnlyFilter = false; - QString itemConnector = "payeeId in ("; - QString payeesClause = ""; - QStringList::const_iterator it; + TQString itemConnector = "payeeId in ("; + TQString payeesClause = ""; + TQStringList::const_iterator it; for (it = payees.begin(); it != payees.end(); ++it) { - payeesClause.append(QString("%1'%2'") - .arg(itemConnector).arg(*it)); + payeesClause.append(TQString("%1'%2'") + .tqarg(itemConnector).tqarg(*it)); itemConnector = ", "; } if (!payeesClause.isEmpty()) { @@ -2887,13 +2879,13 @@ const QMap MyMoneyStorageSql::fetchTransactions (co // accounts and categories if (!accounts.isEmpty()) { splitFilterActive = true; - QString itemConnector = "accountId in ("; - QString accountsClause = ""; - QStringList::const_iterator it; + TQString itemConnector = "accountId in ("; + TQString accountsClause = ""; + TQStringList::const_iterator it; for (it = accounts.begin(); it != accounts.end(); ++it) { -// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) { - accountsClause.append(QString("%1 '%2'") - .arg(itemConnector).arg(*it)); +// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) { + accountsClause.append(TQString("%1 '%2'") + .tqarg(itemConnector).tqarg(*it)); itemConnector = ", "; //if (accountsOnlyFilter) m_accountsLoaded.append(*it); // a bit premature... // } @@ -2905,15 +2897,15 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } // split states - QValueList splitStates; + TQValueList splitStates; if (filter.states(splitStates)) { splitFilterActive = true; - QString itemConnector = " reconcileFlag IN ("; - QString statesClause = ""; - for (QValueList::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) { - statesClause.append(QString(" %1 '%2'") - .arg(itemConnector) - .arg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); + TQString itemConnector = " reconcileFlag IN ("; + TQString statesClause = ""; + for (TQValueList::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) { + statesClause.append(TQString(" %1 '%2'") + .tqarg(itemConnector) + .tqarg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); itemConnector = ","; } if (!statesClause.isEmpty()) { @@ -2922,8 +2914,8 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } } // I've given up trying to work out the logic. we keep getting the wrong number of close brackets - int obc = whereClause.contains('('); - int cbc = whereClause.contains(')'); + int obc = whereClause.tqcontains('('); + int cbc = whereClause.tqcontains(')'); if (cbc > obc) { qFatal("invalid where clause - %s", whereClause.latin1()); } @@ -2946,22 +2938,22 @@ const QMap MyMoneyStorageSql::fetchTransactions (co return fetchTransactions(); } // build a date clause for the transaction table - QString dateClause; - QString connector = ""; - if (end != QDate()) { - dateClause = QString("(postDate < '%1')").arg(end.addDays(1).toString(Qt::ISODate)); + TQString dateClause; + TQString connector = ""; + if (end != TQDate()) { + dateClause = TQString("(postDate < '%1')").tqarg(end.addDays(1).toString(Qt::ISODate)); connector = " and "; } - if (start != QDate()) { - dateClause += QString("%1 (postDate >= '%2')").arg(connector).arg(start.toString(Qt::ISODate)); + if (start != TQDate()) { + dateClause += TQString("%1 (postDate >= '%2')").tqarg(connector).tqarg(start.toString(Qt::ISODate)); } // now get a list of transaction ids // if we have only a date filter, we need to build the list from the tx table // otherwise we need to build from the split table if (splitFilterActive) { - inQuery = QString("(select distinct transactionId from kmmSplits %1)").arg(whereClause); + inQuery = TQString("(select distinct transactionId from kmmSplits %1)").tqarg(whereClause); } else { - inQuery = QString("(select distinct id from kmmTransactions where %1)").arg(dateClause); + inQuery = TQString("(select distinct id from kmmTransactions where %1)").tqarg(dateClause); txFilterActive = false; // kill off the date filter now } @@ -2969,7 +2961,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co //FIXME: if we have an accounts-only filter, recalc balances on loaded accounts } -unsigned long MyMoneyStorageSql::transactionCount (const QString& aid) const { +unsigned long MyMoneyStorageSql::transactionCount (const TQString& aid) const { DBG("*** Entering MyMoneyStorageSql::transactionCount"); if (aid.length() == 0) return m_transactions; @@ -2984,17 +2976,17 @@ void MyMoneyStorageSql::readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, co MyMoneyDbTable::field_iterator splitEnd = t.end(); int i = 0; - // Use the QString here instead of CASE, since this is called so often. - QString fieldName; + // Use the TQString here instead of CASE, since this is called so often. + TQString fieldName; while (ft != splitEnd) { fieldName = (*ft)->name(); if (fieldName == "payeeId") s.setPayeeId(GETCSTRING); else if (fieldName == "reconcileDate") s.setReconcileDate(GETDATE); else if (fieldName == "action") s.setAction(GETCSTRING); else if (fieldName == "reconcileFlag") s.setReconcileFlag(static_cast(GETINT)); - else if (fieldName == "value") s.setValue(MyMoneyMoney(QStringEmpty(GETSTRING))); - else if (fieldName == "shares") s.setShares(MyMoneyMoney(QStringEmpty(GETSTRING))); - else if (fieldName == "price") s.setPrice(MyMoneyMoney(QStringEmpty(GETSTRING))); + else if (fieldName == "value") s.setValue(MyMoneyMoney(TQStringEmpty(GETSTRING))); + else if (fieldName == "shares") s.setShares(MyMoneyMoney(TQStringEmpty(GETSTRING))); + else if (fieldName == "price") s.setPrice(MyMoneyMoney(TQStringEmpty(GETSTRING))); else if (fieldName == "memo") s.setMemo(GETSTRING); else if (fieldName == "accountId") s.setAccountId(GETCSTRING); else if (fieldName == "checkNumber") s.setNumber(GETSTRING); @@ -3006,7 +2998,7 @@ void MyMoneyStorageSql::readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, co return; } -bool MyMoneyStorageSql::isReferencedByTransaction(const QString& id) const { +bool MyMoneyStorageSql::isReferencedByTransaction(const TQString& id) const { DBG("*** Entering MyMoneyStorageSql::isReferencedByTransaction"); MyMoneySqlQuery q(const_cast (this)); q.prepare("SELECT COUNT(*) FROM kmmTransactions " @@ -3030,13 +3022,13 @@ void MyMoneyStorageSql::readSchedules(void) { PASS } -const QMap MyMoneyStorageSql::fetchSchedules (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchSchedules (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readSchedules"); - signalProgress(0, m_schedules, QObject::tr("Loading schedules...")); + signalProgress(0, m_schedules, TQObject::tr("Loading schedules...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmSchedules"]; MyMoneySqlQuery q(const_cast (this)); - QMap sList; + TQMap sList; //unsigned long lastId = 0; const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"]; MyMoneySqlQuery qs(const_cast (this)); @@ -3044,14 +3036,14 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS MyMoneySqlQuery sq(const_cast (this)); sq.prepare ("SELECT payDate from kmmSchedulePaymentHistory where schedId = :id"); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " id = :id" + QString::number(i) + " OR"; + queryString += " id = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } queryString += " ORDER BY id;"; @@ -3064,20 +3056,20 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Schedules"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Schedules"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; MyMoneySchedule s; - QString sId; - QString boolChar; - QDate nextPaymentDue; + TQString sId; + TQString boolChar; + TQDate nextPaymentDue; while (ft != t.end()) { CASE(id) sId = GETCSTRING; else CASE(name) s.setName (GETSTRING); @@ -3110,8 +3102,8 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(false) + " WHERE id = :id;"); q.bindValue(":id", s.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Scheduled Transaction"))); - if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("retrieving scheduled transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Scheduled Transaction"))); + if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("retrieving scheduled transaction"))); MyMoneyTransaction tx(s.id(), MyMoneyTransaction()); ft = t.begin(); i = 0; @@ -3138,7 +3130,7 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS // If the transaction doesn't have a post date, setTransaction will reject it. // The old way of handling things was to store the next post date in the schedule object - // and set the transaction post date to QDate(). + // and set the transaction post date to TQDate(). // For compatibility, if this is the case, copy the next post date from the schedule object // to the transaction object post date. if (!tx.postDate().isValid()) { @@ -3149,7 +3141,7 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS // read in the recorded payments sq.bindValue(":id", s.id()); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading schedule payment history"))); + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading schedule payment history"))); while (sq.next()) s.recordPayment (sq.value(0).toDate()); sList[s.id()] = s; @@ -3174,21 +3166,21 @@ void MyMoneyStorageSql::readSecurities(void) { PASS } -const QMap MyMoneyStorageSql::fetchSecurities (const QStringList& /*idList*/, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchSecurities (const TQStringList& /*idList*/, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readSecurities"); - signalProgress(0, m_securities, QObject::tr("Loading securities...")); + signalProgress(0, m_securities, TQObject::tr("Loading securities...")); int progress = 0; - QMap sList; + TQMap sList; unsigned long lastId = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmSecurities"]; MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(false) + " ORDER BY id;"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Securities"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Securities"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; MyMoneySecurity e; - QString eid; + TQString eid; int saf = 0; while (ft != t.end()) { CASE(id) eid = GETSTRING; @@ -3232,12 +3224,12 @@ void MyMoneyStorageSql::readPrices(void) { } -const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdList, const QString& toIdList, const QDate& date_, bool exactDate, bool /*forUpdate*/) const { +const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const TQString& fromIdList, const TQString& toIdList, const TQDate& date_, bool exactDate, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::fetchSinglePrice"); const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"]; MyMoneyDbTable::field_iterator tableEnd = t.end(); MyMoneySqlQuery q(const_cast (this)); - QString queryString = t.selectAllString(false); + TQString queryString = t.selectAllString(false); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. @@ -3250,28 +3242,28 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdLi q.prepare(queryString); - QDate date (date_); + TQDate date (date_); if(!date.isValid()) - date = QDate::currentDate(); + date = TQDate::tqcurrentDate(); q.bindValue(":fromId", fromIdList); q.bindValue(":toId", toIdList); - q.bindValue(":priceDate", date.addDays(1).toString(Qt::ISODate)); + q.bindValue(":priceDate", TQString(date.addDays(1).toString(Qt::ISODate))); if (exactDate) - q.bindValue(":exactDate", date.toString(Qt::ISODate)); + q.bindValue(":exactDate", TQString(date.toString(Qt::ISODate))); if (! q.exec()) {} if (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString from; - QString to; - QDate date; + TQString from; + TQString to; + TQDate date; MyMoneyMoney rate; - QString source; + TQString source; bool foundFromId = false; bool foundToId = false; bool foundPriceDate = false; @@ -3303,30 +3295,30 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdLi return MyMoneyPrice(); } -const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const QStringList& fromIdList, const QStringList& toIdList, bool forUpdate) const { +const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const TQStringList& fromIdList, const TQStringList& toIdList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readPrices"); - signalProgress(0, m_prices, QObject::tr("Loading prices...")); + signalProgress(0, m_prices, TQObject::tr("Loading prices...")); int progress = 0; const_cast (this)->m_readingPrices = true; MyMoneyPriceList pList; const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"]; MyMoneyDbTable::field_iterator tableEnd = t.end(); MyMoneySqlQuery q(const_cast (this)); - QString queryString = t.selectAllString(false); + TQString queryString = t.selectAllString(false); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! fromIdList.empty()) { queryString += " WHERE ("; for (unsigned i = 0; i < fromIdList.count(); ++i) { - queryString += " fromId = :fromId" + QString::number(i) + " OR"; + queryString += " fromId = :fromId" + TQString::number(i) + " OR"; } queryString = queryString.left(queryString.length() - 2) + ")"; } if (! toIdList.empty()) { queryString += " AND ("; for (unsigned i = 0; i < toIdList.count(); ++i) { - queryString += " toId = :toId" + QString::number(i) + " OR"; + queryString += " toId = :toId" + TQString::number(i) + " OR"; } queryString = queryString.left(queryString.length() - 2) + ")"; } @@ -3340,27 +3332,27 @@ const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const QStringList& fromI q.prepare (queryString); if (! fromIdList.empty()) { - QStringList::const_iterator bindVal = fromIdList.begin(); + TQStringList::const_iterator bindVal = fromIdList.begin(); for (int i = 0; bindVal != fromIdList.end(); ++i, ++bindVal) { - q.bindValue (":fromId" + QString::number(i), *bindVal); + q.bindValue (":fromId" + TQString::number(i), *bindVal); } } if (! toIdList.empty()) { - QStringList::const_iterator bindVal = toIdList.begin(); + TQStringList::const_iterator bindVal = toIdList.begin(); for (int i = 0; bindVal != toIdList.end(); ++i, ++bindVal) { - q.bindValue (":toId" + QString::number(i), *bindVal); + q.bindValue (":toId" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Prices"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString from; - QString to; - QDate date; + TQString from; + TQString to; + TQDate date; MyMoneyMoney rate; - QString source; + TQString source; while (ft != tableEnd) { CASE(fromId) from = GETCSTRING; @@ -3384,22 +3376,22 @@ void MyMoneyStorageSql::readCurrencies(void) { PASS } -const QMap MyMoneyStorageSql::fetchCurrencies (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchCurrencies (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readCurrencies"); - signalProgress(0, m_currencies, QObject::tr("Loading currencies...")); + signalProgress(0, m_currencies, TQObject::tr("Loading currencies...")); int progress = 0; - QMap cList; + TQMap cList; const MyMoneyDbTable& t = m_db.m_tables["kmmCurrencies"]; MyMoneySqlQuery q(const_cast (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " isocode = :id" + QString::number(i) + " OR"; + queryString += " isocode = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } @@ -3413,32 +3405,32 @@ const QMap MyMoneyStorageSql::fetchCurrencies (const Q q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Currencies"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Currencies"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString id; + TQString id; MyMoneySecurity c; - QChar symbol[3]; + TQChar symbol[3]; while (ft != t.end()) { CASE(ISOcode) id = GETCSTRING; else CASE(name) c.setName(GETSTRING); else CASE(type) c.setSecurityType(static_cast(GETINT)); - else CASE(symbol1) symbol[0] = QChar(GETINT); - else CASE(symbol2) symbol[1] = QChar(GETINT); - else CASE(symbol3) symbol[2] = QChar(GETINT); + else CASE(symbol1) symbol[0] = TQChar(GETINT); + else CASE(symbol2) symbol[1] = TQChar(GETINT); + else CASE(symbol3) symbol[2] = TQChar(GETINT); else CASE(partsPerUnit) c.setPartsPerUnit(GETINT); else CASE(smallestCashFraction) c.setSmallestCashFraction(GETINT); else CASE(smallestAccountFraction) c.setSmallestAccountFraction(GETINT); ++ft; ++i; } - c.setTradingSymbol(QString(symbol, 3).stripWhiteSpace()); + c.setTradingSymbol(TQString(symbol, 3).stripWhiteSpace()); cList[id] = MyMoneySecurity(id, c); @@ -3455,24 +3447,24 @@ void MyMoneyStorageSql::readReports(void) { PASS } -const QMap MyMoneyStorageSql::fetchReports (const QStringList& /*idList*/, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchReports (const TQStringList& /*idList*/, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readReports"); - signalProgress(0, m_reports, QObject::tr("Loading reports...")); + signalProgress(0, m_reports, TQObject::tr("Loading reports...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmReportConfig"]; MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(true)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading reports"))); - QMap rList; + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading reports"))); + TQMap rList; while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QDomDocument d; + TQDomDocument d; while (ft != t.end()) { CASE(XML) d.setContent(GETSTRING, false); ++ft; ++i; } - QDomNode child = d.firstChild(); + TQDomNode child = d.firstChild(); child = child.firstChild(); MyMoneyReport report; @@ -3484,13 +3476,13 @@ const QMap MyMoneyStorageSql::fetchReports (const QStrin return rList; } -const QMap MyMoneyStorageSql::fetchBudgets (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchBudgets (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readBudgets"); - signalProgress(0, m_budgets, QObject::tr("Loading budgets...")); + signalProgress(0, m_budgets, TQObject::tr("Loading budgets...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmBudgetConfig"]; MyMoneySqlQuery q(const_cast (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); if (! idList.empty()) { queryString += " WHERE id = '" + idList.join("' OR id = '") + "'"; } @@ -3500,17 +3492,17 @@ const QMap MyMoneyStorageSql::fetchBudgets (const QStrin queryString += ";"; q.prepare (queryString); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading budgets"))); - QMap budgets; + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading budgets"))); + TQMap budgets; while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QDomDocument d; + TQDomDocument d; while (ft != t.end()) { CASE(XML) d.setContent(GETSTRING, false); ++ft; ++i; } - QDomNode child = d.firstChild(); + TQDomNode child = d.firstChild(); child = child.firstChild(); MyMoneyBudget budget (child.toElement()); budgets.insert(budget.id(), budget); @@ -3523,25 +3515,25 @@ void MyMoneyStorageSql::readBudgets(void) { m_storage->loadBudgets(fetchBudgets()); } -const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QString& kvpId) const { +const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const { DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs"); MyMoneyKeyValueContainer list; MyMoneySqlQuery q(const_cast (this)); q.prepare ("SELECT kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type and kvpId = :id;"); q.bindValue(":type", kvpType); q.bindValue(":id", kvpId); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Kvp for %1 %2").arg(kvpType) - .arg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp for %1 %2").tqarg(kvpType) + .tqarg(kvpId))); while (q.next()) list.setValue(q.value(0).toString(), q.value(1).toString()); return (list); } -const QMap MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const { +const TQMap MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const { DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs"); - QMap retval; + TQMap retval; MyMoneySqlQuery q(const_cast (this)); - QString query ("SELECT kvpId, kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type"); + TQString query ("SELECT kvpId, kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type"); if (!kvpIdList.empty()) { query += " and kvpId IN ('" + kvpIdList.join("', '") + "')"; @@ -3550,7 +3542,7 @@ const QMap MyMoneyStorageSql::readKeyValuePai query += " order by kvpId;"; q.prepare (query); q.bindValue(":type", kvpType); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Kvp List for %1").arg(kvpType))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp List for %1").tqarg(kvpType))); while (q.next()) { retval [q.value(0).toString()].setValue(q.value(1).toString(), q.value(2).toString()); } @@ -3607,7 +3599,7 @@ long unsigned MyMoneyStorageSql::incrementBudgetId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiBudgetId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiBudgetId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdBudgets = returnValue; @@ -3623,7 +3615,7 @@ long unsigned MyMoneyStorageSql::incrementAccountId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiAccountId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiAccountId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdAccounts = returnValue; @@ -3639,7 +3631,7 @@ long unsigned MyMoneyStorageSql::incrementInstitutionId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiInstitutionId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiInstitutionId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdInstitutions = returnValue; @@ -3655,7 +3647,7 @@ long unsigned MyMoneyStorageSql::incrementPayeeId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiPayeeId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiPayeeId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdPayees = returnValue; @@ -3671,7 +3663,7 @@ long unsigned MyMoneyStorageSql::incrementReportId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiReportId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiReportId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdReports = returnValue; @@ -3687,7 +3679,7 @@ long unsigned MyMoneyStorageSql::incrementScheduleId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiScheduleId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiScheduleId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdSchedules = returnValue; @@ -3703,7 +3695,7 @@ long unsigned MyMoneyStorageSql::incrementSecurityId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiSecurityId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiSecurityId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdSecurities = returnValue; @@ -3719,7 +3711,7 @@ long unsigned MyMoneyStorageSql::incrementTransactionId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiTransactionId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiTransactionId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdTransactions = returnValue; @@ -3776,33 +3768,33 @@ void MyMoneyStorageSql::loadBudgetId(const unsigned long& id) //**************************************************** long unsigned MyMoneyStorageSql::calcHighId - (const long unsigned& i, const QString& id) { + (const long unsigned& i, const TQString& id) { DBG("*** Entering MyMoneyStorageSql::calcHighId"); - QString nid = id; - long unsigned high = (unsigned long) nid.replace(QRegExp("[A-Z]*"), "").toULongLong(); + TQString nid = id; + long unsigned high = (unsigned long) nid.tqreplace(TQRegExp("[A-Z]*"), "").toULongLong(); return std::max(high, i); } -void MyMoneyStorageSql::setProgressCallback(void(*callback)(int, int, const QString&)) { +void MyMoneyStorageSql::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStorageSql::signalProgress(int current, int total, const QString& msg) const { +void MyMoneyStorageSql::signalProgress(int current, int total, const TQString& msg) const { if (m_progressCallback != 0) (*m_progressCallback)(current, total, msg); } // **************************** Error display routine ******************************* -QString& MyMoneyStorageSql::buildError (const QSqlQuery& q, const QString& function, const QString& message) const { - QString s = QString("Error in function %1 : %2").arg(function).arg(message); - QSqlError e = lastError(); - s += QString ("\nDriver = %1, Host = %2, User = %3, Database = %4") - .arg(driverName()).arg(hostName()).arg(userName()).arg(databaseName()); - s += QString ("\nDriver Error: %1").arg(e.driverText()); - s += QString ("\nDatabase Error No %1: %2").arg(e.number()).arg(e.databaseText()); +TQString& MyMoneyStorageSql::buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const { + TQString s = TQString("Error in function %1 : %2").tqarg(function).tqarg(message); + TQSqlError e = lastError(); + s += TQString ("\nDriver = %1, Host = %2, User = %3, Database = %4") + .tqarg(driverName()).tqarg(hostName()).tqarg(userName()).tqarg(databaseName()); + s += TQString ("\nDriver Error: %1").tqarg(e.driverText()); + s += TQString ("\nDatabase Error No %1: %2").tqarg(e.number()).tqarg(e.databaseText()); e = q.lastError(); - s += QString ("\nExecuted: %1").arg(q.executedQuery()); - s += QString ("\nQuery error No %1: %2").arg(e.number()).arg(e.text()); + s += TQString ("\nExecuted: %1").tqarg(q.executedQuery()); + s += TQString ("\nQuery error No %1: %2").tqarg(e.number()).tqarg(e.text()); const_cast (this)->m_error = s; qDebug("%s", s.ascii()); @@ -3841,7 +3833,7 @@ MyMoneyDbDef::MyMoneyDbDef () { //#define ISKEY true void MyMoneyDbDef::FileInfo(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("version", "varchar(16)")); fields.append(new MyMoneyDbColumn("created", "date")); fields.append(new MyMoneyDbColumn("lastModified", "date")); @@ -3880,7 +3872,7 @@ void MyMoneyDbDef::FileInfo(void){ } void MyMoneyDbDef::Institutions(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("manager")); @@ -3895,7 +3887,7 @@ void MyMoneyDbDef::Institutions(void){ } void MyMoneyDbDef::Payees(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name")); fields.append(new MyMoneyDbTextColumn("reference")); @@ -3916,10 +3908,10 @@ void MyMoneyDbDef::Payees(void){ } void MyMoneyDbDef::Accounts(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("institutionId", "varchar(32)")); - fields.append(new MyMoneyDbColumn("parentId", "varchar(32)")); + fields.append(new MyMoneyDbColumn("tqparentId", "varchar(32)")); fields.append(new MyMoneyDbDatetimeColumn("lastReconciled")); fields.append(new MyMoneyDbDatetimeColumn("lastModified")); fields.append(new MyMoneyDbColumn("openingDate", "date")); @@ -3939,7 +3931,7 @@ void MyMoneyDbDef::Accounts(void){ } void MyMoneyDbDef::Transactions(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("txType", "char(1)")); fields.append(new MyMoneyDbDatetimeColumn("postDate")); @@ -3953,7 +3945,7 @@ void MyMoneyDbDef::Transactions(void){ } void MyMoneyDbDef::Splits(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("transactionId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("txType", "char(1)")); fields.append(new MyMoneyDbIntColumn("splitId", MyMoneyDbIntColumn::SMALL, UNSIGNED, PRIMARYKEY, NOTNULL)); @@ -3973,7 +3965,7 @@ void MyMoneyDbDef::Splits(void){ fields.append(new MyMoneyDbDatetimeColumn("postDate")); fields.append(new MyMoneyDbTextColumn("bankId")); MyMoneyDbTable t("kmmSplits", fields); - QStringList list; + TQStringList list; list << "accountId" << "txType"; t.addIndex("kmmSplitsaccount_type", list, false); t.buildSQLStrings(); @@ -3981,13 +3973,13 @@ void MyMoneyDbDef::Splits(void){ } void MyMoneyDbDef::KeyValuePairs(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("kvpType", "varchar(16)", false, NOTNULL)); fields.append(new MyMoneyDbColumn("kvpId", "varchar(32)")); fields.append(new MyMoneyDbColumn("kvpKey", "varchar(255)", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("kvpData")); MyMoneyDbTable t("kmmKeyValuePairs", fields); - QStringList list; + TQStringList list; list << "kvpType" << "kvpId"; t.addIndex("type_id", list, false); t.buildSQLStrings(); @@ -3995,7 +3987,7 @@ void MyMoneyDbDef::KeyValuePairs(void){ } void MyMoneyDbDef::Schedules(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbIntColumn("type", MyMoneyDbIntColumn::TINY, UNSIGNED, false, NOTNULL)); @@ -4022,7 +4014,7 @@ void MyMoneyDbDef::Schedules(void){ } void MyMoneyDbDef::SchedulePaymentHistory(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("schedId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("payDate", "date", PRIMARYKEY, NOTNULL)); MyMoneyDbTable t("kmmSchedulePaymentHistory", fields); @@ -4031,7 +4023,7 @@ void MyMoneyDbDef::SchedulePaymentHistory(void){ } void MyMoneyDbDef::Securities(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("name", "text", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("symbol")); @@ -4046,7 +4038,7 @@ void MyMoneyDbDef::Securities(void){ } void MyMoneyDbDef::Prices(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("fromId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("toId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("priceDate", "date", PRIMARYKEY, NOTNULL)); @@ -4059,7 +4051,7 @@ void MyMoneyDbDef::Prices(void){ } void MyMoneyDbDef::Currencies(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("ISOcode", "char(3)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbIntColumn("type", MyMoneyDbIntColumn::SMALL, UNSIGNED)); @@ -4077,7 +4069,7 @@ void MyMoneyDbDef::Currencies(void){ } void MyMoneyDbDef::Reports(void) { - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("name", "varchar(255)", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("XML", MyMoneyDbTextColumn::LONG)); fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); @@ -4087,7 +4079,7 @@ void MyMoneyDbDef::Reports(void) { } void MyMoneyDbDef::Budgets(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("name", "text", false, NOTNULL)); fields.append(new MyMoneyDbColumn("start", "date", false, NOTNULL)); @@ -4111,8 +4103,8 @@ void MyMoneyDbDef::Balances(void){ } // function to write create SQL to a stream -const QString MyMoneyDbDef::generateSQL (const QString& driver) const { - QString retval; +const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const { + TQString retval; databaseTypeE dbType = m_drivers.driverToType(driver); table_iterator tt = tableBegin(); while (tt != tableEnd()) { @@ -4127,31 +4119,31 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { retval += '\n'; MyMoneyDbTable fi = m_tables["kmmFileInfo"]; - QString qs = fi.insertString(); + TQString qs = fi.insertString(); MyMoneyDbTable::field_iterator fit; for (fit = fi.begin(); fit != fi.end(); ++fit) { - QString toReplace = (*fit)->name(); + TQString toReplace = (*fit)->name(); toReplace.prepend(':'); - QString replace = "NULL"; + TQString tqreplace = "NULL"; if ((*fit)->name() == "version") - replace = QString::number(m_currentVersion); + tqreplace = TQString::number(m_currentVersion); if ((*fit)->name() == "fixLevel") - replace = QString::number + tqreplace = TQString::number (MyMoneyFile::instance()->storage()->currentFixVersion()); if ((*fit)->name() == "created") - replace = QDate::currentDate().toString(Qt::ISODate); + tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate); if ((*fit)->name() == "lastModified") - replace = QDate::currentDate().toString(Qt::ISODate); + tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate); if ((*fit)->name() == "updateInProgress") - replace = enclose("N"); - qs.replace(toReplace, replace); + tqreplace = enclose("N"); + qs.tqreplace(toReplace, tqreplace); } qs += "\n\n"; retval += qs; - qs = QString(); + qs = TQString(); unsigned int i; - QValueList stdList; + TQValueList stdList; stdList.append (MyMoneyFile::instance()->asset()); stdList.append (MyMoneyFile::instance()->equity()); stdList.append (MyMoneyFile::instance()->expense()); @@ -4164,23 +4156,23 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { MyMoneyDbTable::field_iterator act; // do the following in reverse so the 'formatted' fields are // correctly handled. - // Hmm, how does one use a QValueListIterator in reverse - // It'll be okay in Qt4 with QListIterator + // Hmm, how does one use a TQValueListIterator in reverse + // It'll be okay in TQt4 with TQListIterator for (act = ac.end(), --act; act != ac.begin(); --act) { - QString toReplace = (*act)->name(); + TQString toReplace = (*act)->name(); toReplace.prepend(':'); - QString replace = "NULL"; + TQString tqreplace = "NULL"; if ((*act)->name() == "accountType") - replace = QString::number(pac->accountType()); + tqreplace = TQString::number(pac->accountType()); if ((*act)->name() == "accountTypeString") - replace = enclose(pac->name()); + tqreplace = enclose(pac->name()); if ((*act)->name() == "isStockAccount") - replace = enclose("N"); + tqreplace = enclose("N"); if ((*act)->name() == "accountName") - replace = enclose(pac->name()); - qs.replace(toReplace, replace); + tqreplace = enclose(pac->name()); + qs.tqreplace(toReplace, tqreplace); } - qs.replace (":id", enclose(pac->id())); // a real kludge + qs.tqreplace (":id", enclose(pac->id())); // a real kludge qs += "\n\n"; retval += qs; } @@ -4189,19 +4181,19 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { //***************************************************************************** -void MyMoneyDbTable::addIndex(const QString& name, const QStringList& columns, bool unique) { +void MyMoneyDbTable::addIndex(const TQString& name, const TQStringList& columns, bool unique) { m_indices.push_back (MyMoneyDbIndex (m_name, name, columns, unique)); } void MyMoneyDbTable::buildSQLStrings (void) { // build fixed SQL strings for this table // build the insert string with placeholders for each field - QString qs = QString("INSERT INTO %1 (").arg(name()); - QString ws = ") VALUES ("; + TQString qs = TQString("INSERT INTO %1 (").tqarg(name()); + TQString ws = ") VALUES ("; field_iterator ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += QString("%1, ").arg((*ft)->name()); - ws += QString(":%1, ").arg((*ft)->name()); + qs += TQString("%1, ").tqarg((*ft)->name()); + ws += TQString(":%1, ").tqarg((*ft)->name()); ++ft; } qs = qs.left(qs.length() - 2); @@ -4213,14 +4205,14 @@ void MyMoneyDbTable::buildSQLStrings (void) { // build an update string; key fields go in the where clause qs = "UPDATE " + name() + " SET "; - ws = QString(); + ws = TQString(); ft = m_fields.begin(); while (ft != m_fields.end()) { if ((*ft)->isPrimaryKey()) { if (!ws.isEmpty()) ws += " AND "; - ws += QString("%1 = :%2").arg((*ft)->name()).arg((*ft)->name()); + ws += TQString("%1 = :%2").tqarg((*ft)->name()).tqarg((*ft)->name()); } else { - qs += QString("%1 = :%2, ").arg((*ft)->name()).arg((*ft)->name()); + qs += TQString("%1 = :%2, ").tqarg((*ft)->name()).tqarg((*ft)->name()); } ++ft; } @@ -4233,20 +4225,20 @@ void MyMoneyDbTable::buildSQLStrings (void) { m_deleteString = qs + ";"; } -const QString MyMoneyDbTable::columnList() const { +const TQString MyMoneyDbTable::columnList() const { field_iterator ft = m_fields.begin(); - QString qs; + TQString qs; ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += QString("%1, ").arg((*ft)->name()); + qs += TQString("%1, ").tqarg((*ft)->name()); ++ft; } return (qs.left(qs.length() - 2)); } -const QString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { - QString qs = QString("CREATE TABLE %1 (").arg(name()); - QString pkey; +const TQString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { + TQString qs = TQString("CREATE TABLE %1 (").tqarg(name()); + TQString pkey; for (field_iterator it = m_fields.begin(); it != m_fields.end(); ++it) { qs += (*it)->generateDDL (dbType) + ", "; if ((*it)->isPrimaryKey ()) @@ -4271,7 +4263,7 @@ const QString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { return qs; } -const QString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const +const TQString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const { if (dbType == Mysql || dbType == Oracle8) return "ALTER TABLE " + m_name + " DROP PRIMARY KEY;"; @@ -4283,8 +4275,8 @@ const QString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const return ""; } -const QString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const QString& columnName, const MyMoneyDbColumn& newDef) const { - QString qs = "ALTER TABLE " + m_name + " "; +const TQString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const TQString& columnName, const MyMoneyDbColumn& newDef) const { + TQString qs = "ALTER TABLE " + m_name + " "; if (dbType == Mysql) qs += "CHANGE " + columnName + " " + newDef.generateDDL(dbType); else if (dbType == Postgresql) @@ -4298,14 +4290,14 @@ const QString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const QSt } //***************************************************************************** -const QString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const { Q_UNUSED(dbType); - QString qs = "CREATE "; + TQString qs = "CREATE "; if (m_unique) - qs += "UNIQUE "; + qs += "UNITQUE "; qs += "INDEX " + m_table + "_" + m_name + "_idx ON " + m_table + " ("; @@ -4315,7 +4307,7 @@ const QString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const // the result of an SQL function, but not a partial column. There should be // a way to merge these, and support other DBMSs like SQLite at the same time. // For now, if we just use plain columns, this will work fine. - for (QStringList::const_iterator it = m_columns.begin(); it != m_columns.end(); ++it) { + for (TQStringList::const_iterator it = m_columns.begin(); it != m_columns.end(); ++it) { qs += *it + ","; } @@ -4341,18 +4333,18 @@ MyMoneyDbDatetimeColumn* MyMoneyDbDatetimeColumn::clone () const MyMoneyDbTextColumn* MyMoneyDbTextColumn::clone () const { return (new MyMoneyDbTextColumn (*this)); } -const QString MyMoneyDbColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbColumn::generateDDL (databaseTypeE dbType) const { Q_UNUSED(dbType); - QString qs = name() + " " + type(); + TQString qs = name() + " " + type(); if (isNotNull()) qs += " NOT NULL"; return qs; } -const QString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; switch (m_type) { case MyMoneyDbIntColumn::TINY: @@ -4423,9 +4415,9 @@ const QString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const return qs; } -const QString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; switch (m_type) { case MyMoneyDbTextColumn::TINY: @@ -4496,9 +4488,9 @@ const QString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const return qs; } -const QString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; if (dbType == Mysql || dbType == ODBC3) { qs += "datetime "; } else if (dbType == Postgresql || dbType == Db2 || dbType == Oracle8 || dbType == Sqlite3 ) { diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.h b/kmymoney2/mymoney/storage/mymoneystoragesql.h index 1abe70b..4250256 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.h +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.h @@ -13,12 +13,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include -class QIODevice; +class TQIODevice; // ---------------------------------------------------------------------------- // KDE Includes @@ -56,7 +56,7 @@ class FilterFail { m_storage (storage) {} - inline bool operator() (const QPair& transactionPair) + inline bool operator() (const TQPair& transactionPair) { return (*this) (transactionPair.second); } inline bool operator() (const MyMoneyTransaction& transaction) @@ -87,16 +87,16 @@ typedef enum databaseTypeE { // database (driver) type class MyMoneyStorageSql; /** - * The MyMoneySqlQuery class is derived from QSqlQuery to provide + * The MyMoneySqlQuery class is derived from TQSqlQuery to provide * a way to adjust some queries based on databaseTypeE and make * debugging easier by providing a place to put debug statements. */ -class MyMoneySqlQuery : public QSqlQuery { +class MyMoneySqlQuery : public TQSqlQuery { public: MyMoneySqlQuery (MyMoneyStorageSql* db = 0); virtual ~MyMoneySqlQuery() {} bool exec (); - bool prepare ( const QString & query ); + bool prepare ( const TQString & query ); private: const MyMoneyStorageSql* m_db; }; @@ -108,13 +108,13 @@ class MyMoneyDbDrivers { public: MyMoneyDbDrivers (); /** - * @return a list ofsupported Qt database driver types, their qt names and useful names + * @return a list ofsupported TQt database driver types, their qt names and useful names **/ - const QMap driverMap() const {return (m_driverMap);}; - databaseTypeE driverToType (const QString& driver) const; + const TQMap driverMap() const {return (m_driverMap);}; + databaseTypeE driverToType (const TQString& driver) const; bool isTested (databaseTypeE dbType) const; private: - QMap m_driverMap; + TQMap m_driverMap; }; /** @@ -123,11 +123,11 @@ class MyMoneyDbDrivers { */ class MyMoneyDbColumn : public KShared { public: - MyMoneyDbColumn (const QString& iname, - const QString& itype = QString::null, + MyMoneyDbColumn (const TQString& iname, + const TQString& itype = TQString(), const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): m_name(iname), m_type(itype), m_isPrimary(iprimary), @@ -147,20 +147,20 @@ class MyMoneyDbColumn : public KShared { * * @param dbType Database driver type * - * @return QString of the DDL for the column, tailored for what the driver supports. + * @return TQString of the DDL for the column, tailored for what the driver supports. */ - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; - const QString& name(void) const {return (m_name);} - const QString& type(void) const {return (m_type);} + const TQString& name(void) const {return (m_name);} + const TQString& type(void) const {return (m_type);} bool isPrimaryKey(void) const {return (m_isPrimary);} bool isNotNull(void) const {return (m_isNotNull);} private: - QString m_name; - QString m_type; + TQString m_name; + TQString m_type; bool m_isPrimary; bool m_isNotNull; - QString m_initVersion; + TQString m_initVersion; }; /** @@ -168,17 +168,17 @@ class MyMoneyDbColumn : public KShared { */ class MyMoneyDbDatetimeColumn : public MyMoneyDbColumn { public: - MyMoneyDbDatetimeColumn (const QString& iname, + MyMoneyDbDatetimeColumn (const TQString& iname, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion) {} virtual ~MyMoneyDbDatetimeColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbDatetimeColumn* clone () const; private: - static const QString calcType(void); + static const TQString calcType(void); }; /** @@ -187,17 +187,17 @@ class MyMoneyDbDatetimeColumn : public MyMoneyDbColumn { class MyMoneyDbIntColumn : public MyMoneyDbColumn { public: enum size {TINY, SMALL, MEDIUM, BIG}; - MyMoneyDbIntColumn (const QString& iname, + MyMoneyDbIntColumn (const TQString& iname, const size type = MEDIUM, const bool isigned = true, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion), m_type (type), m_isSigned (isigned) {} virtual ~MyMoneyDbIntColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbIntColumn* clone () const; private: size m_type; @@ -212,15 +212,15 @@ class MyMoneyDbIntColumn : public MyMoneyDbColumn { class MyMoneyDbTextColumn : public MyMoneyDbColumn { public: enum size {TINY, NORMAL, MEDIUM, LONG}; - MyMoneyDbTextColumn (const QString& iname, + MyMoneyDbTextColumn (const TQString& iname, const size type = MEDIUM, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion), m_type (type) {} virtual ~MyMoneyDbTextColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbTextColumn* clone () const; private: size m_type; @@ -237,9 +237,9 @@ class MyMoneyDbTextColumn : public MyMoneyDbColumn { */ class MyMoneyDbIndex { public: - MyMoneyDbIndex (const QString& table, - const QString& name, - const QStringList& columns, + MyMoneyDbIndex (const TQString& table, + const TQString& name, + const TQStringList& columns, bool unique = false): m_table(table), m_unique(unique), @@ -247,16 +247,16 @@ class MyMoneyDbIndex { m_columns(columns) {} MyMoneyDbIndex () {} - inline const QString table () const {return m_table;} + inline const TQString table () const {return m_table;} inline bool isUnique () const {return m_unique;} - inline const QString name () const {return m_name;} - inline const QStringList columns () const {return m_columns;} - const QString generateDDL (databaseTypeE dbType) const; + inline const TQString name () const {return m_name;} + inline const TQStringList columns () const {return m_columns;} + const TQString generateDDL (databaseTypeE dbType) const; private: - QString m_table; + TQString m_table; bool m_unique; - QString m_name; - QStringList m_columns; + TQString m_name; + TQStringList m_columns; }; /** @@ -270,20 +270,20 @@ class MyMoneyDbIndex { */ class MyMoneyDbTable { public: - MyMoneyDbTable (const QString& iname, - const QValueList >& ifields, - const QString& initVersion = "1.0"): + MyMoneyDbTable (const TQString& iname, + const TQValueList >& ifields, + const TQString& initVersion = "1.0"): m_name(iname), m_fields(ifields), m_initVersion(initVersion) {} MyMoneyDbTable (void) {} - inline const QString& name(void) const {return (m_name);} - inline const QString& insertString(void) const {return (m_insertString);}; - inline const QString selectAllString(bool terminate = true) const - {return (terminate ? QString(m_selectAllString + ";") : m_selectAllString);}; - inline const QString& updateString(void) const {return (m_updateString);}; - inline const QString& deleteString(void) const {return (m_deleteString);}; + inline const TQString& name(void) const {return (m_name);} + inline const TQString& insertString(void) const {return (m_insertString);}; + inline const TQString selectAllString(bool terminate = true) const + {return (terminate ? TQString(m_selectAllString + ";") : m_selectAllString);}; + inline const TQString& updateString(void) const {return (m_updateString);}; + inline const TQString& deleteString(void) const {return (m_deleteString);}; /** * This method determines the string required to drop the primary key for the table @@ -291,15 +291,15 @@ class MyMoneyDbTable { * * @param dbType The driver type of the database. * - * @return QString for the syntax to drop the primary key. + * @return TQString for the syntax to drop the primary key. */ - const QString dropPrimaryKeyString(databaseTypeE dbType) const; + const TQString dropPrimaryKeyString(databaseTypeE dbType) const; /** * This method returns a comma-separated list of all column names in the table * - * @return QString column list. + * @return TQString column list. */ - const QString columnList() const; + const TQString columnList() const; /** * This method returns the string for changing a column's definition. It covers statements * like ALTER TABLE..CHANGE COLUMN, MODIFY COLUMN, etc. @@ -308,9 +308,9 @@ class MyMoneyDbTable { * @param columnName The name of the column to be modified. * @param newDef The MyMoneyColumn object of the new column definition. * - * @return QString containing DDL to change the column. + * @return TQString containing DDL to change the column. */ - const QString modifyColumnString(databaseTypeE dbType, const QString& columnName, const MyMoneyDbColumn& newDef) const; + const TQString modifyColumnString(databaseTypeE dbType, const TQString& columnName, const MyMoneyDbColumn& newDef) const; /** * This method builds all of the SQL strings for common operations. @@ -322,9 +322,9 @@ class MyMoneyDbTable { * * @param dbType The driver type of the database. * - * @return QString of the DDL. + * @return TQString of the DDL. */ - const QString generateCreateSQL (databaseTypeE dbType) const; + const TQString generateCreateSQL (databaseTypeE dbType) const; /** * This method creates a MyMoneyDbIndex object and adds it to the list of indices for the table. @@ -333,22 +333,22 @@ class MyMoneyDbTable { * @param columns The list of the columns affected. * @param unique Whether or not this should be a unique index. */ - void addIndex(const QString& name, const QStringList& columns, bool unique = false); + void addIndex(const TQString& name, const TQStringList& columns, bool unique = false); - typedef QValueList >::const_iterator field_iterator; + typedef TQValueList >::const_iterator field_iterator; inline field_iterator begin(void) const {return m_fields.constBegin();} inline field_iterator end(void) const {return m_fields.constEnd(); } private: - QString m_name; - QValueList > m_fields; - - typedef QValueList::const_iterator index_iterator; - QValueList m_indices; - QString m_initVersion; - QString m_insertString; // string to insert a record - QString m_selectAllString; // to select all fields - QString m_updateString; // normal string for record update - QString m_deleteString; // string to delete 1 record + TQString m_name; + TQValueList > m_fields; + + typedef TQValueList::const_iterator index_iterator; + TQValueList m_indices; + TQString m_initVersion; + TQString m_insertString; // string to insert a record + TQString m_selectAllString; // to select all fields + TQString m_updateString; // normal string for record update + TQString m_deleteString; // string to delete 1 record }; /** @@ -360,21 +360,21 @@ class MyMoneyDbTable { */ class MyMoneyDbView { public: - MyMoneyDbView (const QString& name, - const QString& createString, - const QString& initVersion = "0.1") + MyMoneyDbView (const TQString& name, + const TQString& createString, + const TQString& initVersion = "0.1") : m_name (name), m_createString (createString), m_initVersion (initVersion) {} MyMoneyDbView (void) {} - inline const QString& name(void) const {return (m_name);} - inline const QString createString(void) const {return (m_createString);}; + inline const TQString& name(void) const {return (m_name);} + inline const TQString createString(void) const {return (m_createString);}; private: - QString m_name; - QString m_createString; - QString m_initVersion; + TQString m_name; + TQString m_createString; + TQString m_initVersion; }; /** @@ -387,22 +387,22 @@ public: MyMoneyDbDef(); ~MyMoneyDbDef() {} - const QString generateSQL (const QString& driver) const; + const TQString generateSQL (const TQString& driver) const; - typedef QMap::const_iterator table_iterator; + typedef TQMap::const_iterator table_iterator; inline table_iterator tableBegin(void) const {return m_tables.constBegin();} inline table_iterator tableEnd(void) const {return m_tables.constEnd();} - typedef QMap::const_iterator view_iterator; + typedef TQMap::const_iterator view_iterator; inline view_iterator viewBegin(void) const {return m_views.constBegin();} inline view_iterator viewEnd(void) const {return m_views.constEnd();} inline unsigned int currentVersion() const {return (m_currentVersion);}; private: - const QString enclose(const QString& text) const - {return (QString("'" + text + "'"));}; - static unsigned int m_currentVersion; // The current version of the database layout + const TQString enclose(const TQString& text) const + {return (TQString("'" + text + "'"));}; + static unsigned int m_currentVersion; // The current version of the database tqlayout MyMoneyDbDrivers m_drivers; #define TABLE(name) void name(); #define VIEW(name) void name(); @@ -422,8 +422,8 @@ private: TABLE(Budgets); VIEW(Balances); protected: - QMap m_tables; - QMap m_views; + TQMap m_tables; + TQMap m_views; }; class IMyMoneySerialize; @@ -432,7 +432,7 @@ class IMyMoneySerialize; * The MyMoneyDbColumn class is a base type for generic db columns. * Derived types exist for several common column types. */ -class MyMoneyStorageSql : public IMyMoneyStorageFormat, public QSqlDatabase, public KShared { +class MyMoneyStorageSql : public IMyMoneyStorageFormat, public TQSqlDatabase, public KShared { public: MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& = KURL()); @@ -444,7 +444,7 @@ public: * MyMoneyStorageSql - open database file * * @param url pseudo-URL of database to be opened - * @param openMode open mode, same as for QFile::open + * @param openMode open mode, same as for TQFile::open * @param clear whether existing data can be deleted * @return 0 - database successfully opened @@ -491,7 +491,7 @@ public: * @return : error message to be displayed * */ - const QString& lastError() const {return (m_error);}; + const TQString& lastError() const {return (m_error);}; /** * This method is used when a database file is open, and the data is to * be saved in a different file or format. It will ensure that all data @@ -533,40 +533,40 @@ public: void modifyBudget(const MyMoneyBudget& bud); void removeBudget(const MyMoneyBudget& bud); - unsigned long transactionCount (const QString& aid = QString()) const; - inline const QMap transactionCountMap () const + unsigned long transactionCount (const TQString& aid = TQString()) const; + inline const TQMap transactionCountMap () const {return (m_transactionCountMap);}; /** * the storage manager also needs the following read entry points */ - const QMap fetchAccounts (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchBalance(const QStringList& id, const QDate& date) const; - const QMap fetchBudgets (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchCurrencies (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchInstitutions (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchPayees (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const MyMoneyPriceList fetchPrices (const QStringList& fromIdList = QStringList (), const QStringList& toIdList = QStringList(), bool forUpdate = false) const; - const MyMoneyPrice fetchSinglePrice (const QString& fromIdList, const QString& toIdList, const QDate& date, bool exactDate, bool forUpdate = false) const; - const QMap fetchReports (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchSchedules (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchSecurities (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchTransactions (const QString& tidList = QString (), const QString& dateClause = QString(), bool forUpdate = false) const; - const QMap fetchTransactions (const MyMoneyTransactionFilter& filter) const; - bool isReferencedByTransaction(const QString& id) const; - - void readPayees(const QString&); - void readPayees(const QValueList payeeList = QValueList()); + const TQMap fetchAccounts (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchBalance(const TQStringList& id, const TQDate& date) const; + const TQMap fetchBudgets (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchCurrencies (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchInstitutions (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchPayees (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const MyMoneyPriceList fetchPrices (const TQStringList& fromIdList = TQStringList (), const TQStringList& toIdList = TQStringList(), bool forUpdate = false) const; + const MyMoneyPrice fetchSinglePrice (const TQString& fromIdList, const TQString& toIdList, const TQDate& date, bool exactDate, bool forUpdate = false) const; + const TQMap fetchReports (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchSchedules (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchSecurities (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchTransactions (const TQString& tidList = TQString (), const TQString& dateClause = TQString(), bool forUpdate = false) const; + const TQMap fetchTransactions (const MyMoneyTransactionFilter& filter) const; + bool isReferencedByTransaction(const TQString& id) const; + + void readPayees(const TQString&); + void readPayees(const TQValueList payeeList = TQValueList()); void readTransactions(const MyMoneyTransactionFilter& filter); - void setProgressCallback(void(*callback)(int, int, const QString&)); + void setProgressCallback(void(*callback)(int, int, const TQString&)); - virtual void readFile(QIODevice* s, IMyMoneySerialize* storage) { Q_UNUSED(s); Q_UNUSED(storage) }; - virtual void writeFile(QIODevice* s, IMyMoneySerialize* storage){ Q_UNUSED(s); Q_UNUSED(storage) }; + virtual void readFile(TQIODevice* s, IMyMoneySerialize* storage) { Q_UNUSED(s); Q_UNUSED(storage) }; + virtual void writeFile(TQIODevice* s, IMyMoneySerialize* storage){ Q_UNUSED(s); Q_UNUSED(storage) }; - void startCommitUnit (const QString& callingFunction); - bool endCommitUnit (const QString& callingFunction); - void cancelCommitUnit (const QString& callingFunction); + void startCommitUnit (const TQString& callingFunction); + bool endCommitUnit (const TQString& callingFunction); + void cancelCommitUnit (const TQString& callingFunction); - long unsigned getRecCount(const QString& table) const; + long unsigned getRecCount(const TQString& table) const; long unsigned getNextBudgetId() const; long unsigned getNextAccountId() const; long unsigned getNextInstitutionId() const; @@ -596,7 +596,7 @@ public: private: // a function to build a comprehensive error message - QString& buildError (const QSqlQuery& q, const QString& function, const QString& message) const; + TQString& buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const; // write routines void writeUserInformation(void); void writeInstitutions(void); @@ -614,9 +614,9 @@ private: void writeInstitution(const MyMoneyInstitution& i, MyMoneySqlQuery& q); void writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bool isUserInfo = false); void writeAccount (const MyMoneyAccount& a, MyMoneySqlQuery& q); - void writeTransaction(const QString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const QString& type); - void writeSplits(const QString& txId, const QString& type, const QValueList& splitList); - void writeSplit(const QString& txId, const MyMoneySplit& split, const QString& type, const int splitId, MyMoneySqlQuery& q); + void writeTransaction(const TQString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const TQString& type); + void writeSplits(const TQString& txId, const TQString& type, const TQValueList& splitList); + void writeSplit(const TQString& txId, const MyMoneySplit& split, const TQString& type, const int splitId, MyMoneySqlQuery& q); void writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuery& q, bool insert); void writeSecurity(const MyMoneySecurity& security, MyMoneySqlQuery& q); void writePricePair ( const MyMoneyPriceEntries& p); @@ -624,21 +624,21 @@ private: void writeCurrency(const MyMoneySecurity& currency, MyMoneySqlQuery& q); void writeReport (const MyMoneyReport& rep, MyMoneySqlQuery& q); void writeBudget (const MyMoneyBudget& bud, MyMoneySqlQuery& q); - void writeKeyValuePairs(const QString& kvpType, const QString& kvpId, const QMap& pairs); - void writeKeyValuePair(const QString& kvpType, const QString& kvpId, - const QString& kvpKey, const QString& kvpData); + void writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap& pairs); + void writeKeyValuePair(const TQString& kvpType, const TQString& kvpId, + const TQString& kvpKey, const TQString& kvpData); // read routines void readFileInfo(void); void readLogonData(void); void readUserInformation(void); void readInstitutions(void); void readAccounts(void); - void readTransaction(const QString id); - void readTransactions(const QString& tidList = QString(), const QString& dateClause = QString()); - void readTransaction(MyMoneyTransaction &tx, const QString& tid); + void readTransaction(const TQString id); + void readTransactions(const TQString& tidList = TQString(), const TQString& dateClause = TQString()); + void readTransaction(MyMoneyTransaction &tx, const TQString& tid); void readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, const MyMoneyDbTable& t) const; - const MyMoneyKeyValueContainer readKeyValuePairs (const QString& kvpType, const QString& kvpId) const; - const QMap readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const; + const MyMoneyKeyValueContainer readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const; + const TQMap readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const; void readSchedules(void); void readSecurities(void); void readPrices(void); @@ -646,27 +646,27 @@ private: void readReports(void); void readBudgets(void); - void deleteTransaction(const QString& id); - void deleteSchedule(const QString& id); - void deleteKeyValuePairs(const QString& kvpType, const QString& kvpId); - long unsigned calcHighId (const long unsigned&, const QString&); + void deleteTransaction(const TQString& id); + void deleteSchedule(const TQString& id); + void deleteKeyValuePairs(const TQString& kvpType, const TQString& kvpId); + long unsigned calcHighId (const long unsigned&, const TQString&); - void setVersion (const QString& version); + void setVersion (const TQString& version); - void signalProgress(int current, int total, const QString& = "") const; - void (*m_progressCallback)(int, int, const QString&); + void signalProgress(int current, int total, const TQString& = "") const; + void (*m_progressCallback)(int, int, const TQString&); - //void startCommitUnit (const QString& callingFunction); - //void endCommitUnit (const QString& callingFunction); - //void cancelCommitUnit (const QString& callingFunction); + //void startCommitUnit (const TQString& callingFunction); + //void endCommitUnit (const TQString& callingFunction); + //void cancelCommitUnit (const TQString& callingFunction); int splitState(const MyMoneyTransactionFilter::stateOptionE& state) const; - inline const QDate getDate (const QString& date) const { - return (date.isNull() ? QDate() : QDate::fromString(date, Qt::ISODate)); + inline const TQDate getDate (const TQString& date) const { + return (date.isNull() ? TQDate() : TQDate::fromString(date, Qt::ISODate)); } - inline const QDateTime getDateTime (const QString& date) const { - return (date.isNull() ? QDateTime() : QDateTime::fromString(date, Qt::ISODate)); + inline const TQDateTime getDateTime (const TQString& date) const { + return (date.isNull() ? TQDateTime() : TQDateTime::fromString(date, Qt::ISODate)); } // open routines @@ -690,16 +690,16 @@ private: bool sqliteAlterTable(const MyMoneyDbTable& t); bool addColumn(const MyMoneyDbTable& t, const MyMoneyDbColumn& c, - const QString& after = QString()); - bool addColumn(const QString& table, - const QString& column, - const QString& after = QString()); + const TQString& after = TQString()); + bool addColumn(const TQString& table, + const TQString& column, + const TQString& after = TQString()); bool dropColumn(const MyMoneyDbTable& t, - const QString& c); - bool dropColumn(const QString& table, - const QString& column); + const TQString& c); + bool dropColumn(const TQString& table, + const TQString& column); -// long long unsigned getRecCount(const QString& table); +// long long unsigned getRecCount(const TQString& table); int createTables(); void createTable(const MyMoneyDbTable& t); void clean (); @@ -716,7 +716,7 @@ private: bool m_loadAll; // preload all data bool m_override; // override open if already in use // error message - QString m_error; + TQString m_error; // record counts long unsigned m_institutions; long unsigned m_accounts; @@ -740,14 +740,14 @@ private: long unsigned m_hiIdReports; long unsigned m_hiIdBudgets; // encrypt option - usage TBD - QString m_encryptData; + TQString m_encryptData; /** * This variable is used to suppress status messages except during * initial data load and final write */ - bool m_displayStatus; + bool m_displaytqStatus; /** * On occasions, e.g. after a complex transaction search, or for populating a * payee popup list, it becomes necessary to load all data into memory. The @@ -760,19 +760,19 @@ private: * This member variable holds a list of those accounts for which all * transactions are in memory, thus saving reading them again */ -// QValueList m_accountsLoaded; +// TQValueList m_accountsLoaded; /** * This member variable is used when loading transactions to list all * referenced payees, which can then be read into memory (if not already there) */ -// QValueList m_payeeList; +// TQValueList m_payeeList; - void alert(QString s) const {qDebug("%s", s.ascii());}; // FIXME: remove... + void alert(TQString s) const {qDebug("%s", s.ascii());}; // FIXME: remove... /** The following keeps track of commitment units (known as transactions in SQL * though it would be confusing to use that term within KMM). It is implemented * as a stack for debug purposes. Long term, probably a count would suffice */ - QValueStack m_commitUnitStack; + TQValueStack m_commitUnitStack; /** * This member variable is used to preload transactions for preferred accounts */ @@ -790,13 +790,13 @@ private: * probably be moved into the MyMoneyAccount object; maybe we will do that once * the database code has been properly checked out */ - QMap m_transactionCountMap; + TQMap m_transactionCountMap; /** * These member variables hold the user name and date/time of logon */ - QString m_logonUser; - QDateTime m_logonAt; - QDateTime m_txPostDate; // FIXME: remove when Tom puts date into split object + TQString m_logonUser; + TQDateTime m_logonAt; + TQDateTime m_txPostDate; // FIXME: remove when Tom puts date into split object //Disable copying MyMoneyStorageSql (const MyMoneyStorageSql& rhs); diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp index e8027d1..49e0739 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp @@ -22,10 +22,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -52,49 +52,49 @@ class MyMoneyStorageXML::Private public: Private() {} - QMap iList; - QMap aList; - QMap tList; - QMap pList; - QMap sList; - QMap secList; - QMap rList; - QMap bList; - QMap prList; + TQMap iList; + TQMap aList; + TQMap tList; + TQMap pList; + TQMap sList; + TQMap secList; + TQMap rList; + TQMap bList; + TQMap prList; - QString m_fromSecurity; - QString m_toSecurity; + TQString m_fromSecurity; + TQString m_toSecurity; }; -class MyMoneyXmlContentHandler : public QXmlContentHandler +class MyMoneyXmlContentHandler : public TQXmlContentHandler { public: MyMoneyXmlContentHandler(MyMoneyStorageXML* reader); virtual ~MyMoneyXmlContentHandler() {} - virtual void setDocumentLocator (QXmlLocator * locator) { m_loc = locator; } + virtual void setDocumentLocator (TQXmlLocator * locator) { m_loc = locator; } virtual bool startDocument (void); virtual bool endDocument (void); - virtual bool startPrefixMapping(const QString & prefix, const QString & uri); - virtual bool endPrefixMapping(const QString & prefix); - virtual bool startElement(const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts); - virtual bool endElement(const QString & namespaceURI, const QString & localName, const QString & qName); - virtual bool characters(const QString & ch); - virtual bool ignorableWhitespace(const QString & ch); - virtual bool processingInstruction(const QString & target, const QString & data); - virtual bool skippedEntity(const QString & name); - virtual QString errorString(void); + virtual bool startPrefixMapping(const TQString & prefix, const TQString & uri); + virtual bool endPrefixMapping(const TQString & prefix); + virtual bool startElement(const TQString & namespaceURI, const TQString & localName, const TQString & qName, const TQXmlAttributes & atts); + virtual bool endElement(const TQString & namespaceURI, const TQString & localName, const TQString & qName); + virtual bool characters(const TQString & ch); + virtual bool ignorableWhitespace(const TQString & ch); + virtual bool processingInstruction(const TQString & target, const TQString & data); + virtual bool skippedEntity(const TQString & name); + virtual TQString errorString(void); private: MyMoneyStorageXML* m_reader; - QXmlLocator* m_loc; + TQXmlLocator* m_loc; int m_level; int m_elementCount; - QDomDocument m_doc; - QDomElement m_baseNode; - QDomElement m_currNode; - QString m_errMsg; + TQDomDocument m_doc; + TQDomElement m_baseNode; + TQDomElement m_currNode; + TQString m_errMsg; }; MyMoneyXmlContentHandler::MyMoneyXmlContentHandler(MyMoneyStorageXML* reader) : @@ -117,28 +117,28 @@ bool MyMoneyXmlContentHandler::endDocument(void) return true; } -bool MyMoneyXmlContentHandler::skippedEntity (const QString & /* name */) +bool MyMoneyXmlContentHandler::skippedEntity (const TQString & /* name */) { - // qDebug(QString("Skipped entity '%1'").arg(name)); + // qDebug(TQString("Skipped entity '%1'").tqarg(name)); return true; } -bool MyMoneyXmlContentHandler::startPrefixMapping (const QString& /*prefix */, const QString & /* uri */) +bool MyMoneyXmlContentHandler::startPrefixMapping (const TQString& /*prefix */, const TQString & /* uri */) { - // qDebug(QString("start prefix '%1', '%2'").arg(prefix).arg(uri)); + // qDebug(TQString("start prefix '%1', '%2'").tqarg(prefix).tqarg(uri)); return true; } -bool MyMoneyXmlContentHandler::endPrefixMapping (const QString& /* prefix */) +bool MyMoneyXmlContentHandler::endPrefixMapping (const TQString& /* prefix */) { - // qDebug(QString("end prefix '%1'").arg(prefix)); + // qDebug(TQString("end prefix '%1'").tqarg(prefix)); return true; } -bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, const QString& /* localName */, const QString& qName, const QXmlAttributes & atts) +bool MyMoneyXmlContentHandler::startElement (const TQString& /* namespaceURI */, const TQString& /* localName */, const TQString& qName, const TQXmlAttributes & atts) { if(m_level == 0) { - QString s = qName.lower(); + TQString s = qName.lower(); if(s == "transaction" || s == "account" || s == "price" @@ -162,28 +162,28 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, } else if(s == "transactions") { qDebug("reading transactions"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading transactions...")); m_elementCount = 0; } } else if(s == "accounts") { qDebug("reading accounts"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading accounts...")); m_elementCount = 0; } } else if(s == "securities") { qDebug("reading securities"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading securities...")); m_elementCount = 0; } } else if(s == "reports") { qDebug("reading reports"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading reports...")); m_elementCount = 0; } @@ -192,14 +192,14 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, m_elementCount = 0; } else if(s == "pricepair") { if(atts.count()) { - m_reader->d->m_fromSecurity = atts.value(QString("from")); - m_reader->d->m_toSecurity = atts.value(QString("to")); + m_reader->d->m_fromSecurity = atts.value(TQString("from")); + m_reader->d->m_toSecurity = atts.value(TQString("to")); } } } else { m_level++; - QDomElement node = m_doc.createElement(qName); + TQDomElement node = m_doc.createElement(qName); for(int i=0; i < atts.count(); ++i) { node.setAttribute(atts.qName(i), atts.value(i)); } @@ -209,12 +209,12 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, return true; } -bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, const QString& /* localName */, const QString& qName) +bool MyMoneyXmlContentHandler::endElement(const TQString& /* namespaceURI */, const TQString& /* localName */, const TQString& qName) { bool rc = true; - QString s = qName.lower(); + TQString s = qName.lower(); if(m_level) { - m_currNode = m_currNode.parentNode().toElement(); + m_currNode = m_currNode.tqparentNode().toElement(); m_level--; if(!m_level) { try { @@ -265,18 +265,18 @@ bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, con MyMoneyPrice p(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity, m_baseNode); m_reader->d->prList[MyMoneySecurityPair(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity)][p.date()] = p; } else { - m_errMsg = i18n("Unknown XML tag %1 found in line %2").arg(qName).arg(m_loc->lineNumber()); + m_errMsg = i18n("Unknown XML tag %1 found in line %2").tqarg(qName).tqarg(m_loc->lineNumber()); kdWarning() << m_errMsg << endl; rc = false; } m_reader->signalProgress(++m_elementCount, 0); } catch(MyMoneyException* e) { - m_errMsg = i18n("Exception while creating a %1 element: %2").arg(s).arg(e->what()); + m_errMsg = i18n("Exception while creating a %1 element: %2").tqarg(s).tqarg(e->what()); kdWarning() << m_errMsg << endl; delete e; rc = false; } - m_doc = QDomDocument(); + m_doc = TQDomDocument(); } } else { if(s == "institutions") { @@ -334,22 +334,22 @@ bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, con return rc; } -bool MyMoneyXmlContentHandler::characters(const QString& /* ch */) +bool MyMoneyXmlContentHandler::characters(const TQString& /* ch */) { return true; } -bool MyMoneyXmlContentHandler::ignorableWhitespace(const QString& /* ch */) +bool MyMoneyXmlContentHandler::ignorableWhitespace(const TQString& /* ch */) { return true; } -bool MyMoneyXmlContentHandler::processingInstruction(const QString& /* target */, const QString& /* data */) +bool MyMoneyXmlContentHandler::processingInstruction(const TQString& /* target */, const TQString& /* data */) { return true; } -QString MyMoneyXmlContentHandler::errorString(void) +TQString MyMoneyXmlContentHandler::errorString(void) { return m_errMsg; } @@ -373,7 +373,7 @@ MyMoneyStorageXML::~MyMoneyStorageXML() } // Function to read in the file, send to XML parser. -void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) +void MyMoneyStorageXML::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage) { Q_CHECK_PTR(storage); Q_CHECK_PTR(pDevice); @@ -382,20 +382,20 @@ void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) m_storage = storage; - m_doc = new QDomDocument; + m_doc = new TQDomDocument; Q_CHECK_PTR(m_doc); qDebug("reading file"); - // creating the QXmlInputSource object based on a QIODevice object + // creating the TQXmlInputSource object based on a TQIODevice object // reads all data of the underlying object into memory. I have not // found an object that reads on the fly. I tried to derive one myself, // but there could be a severe problem with decoding when reading // blocks of data and not a stream. So I left it the way it is. (ipwizard) - QXmlInputSource xml(pDevice); + TQXmlInputSource xml(pDevice); qDebug("start parsing file"); MyMoneyXmlContentHandler mmxml(this); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler(&mmxml); if(!reader.parse(&xml, false)) { @@ -421,7 +421,7 @@ void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) signalProgress(-1, -1); } -void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) +void MyMoneyStorageXML::writeFile(TQIODevice* qf, IMyMoneySerialize* storage) { Q_CHECK_PTR(qf); Q_CHECK_PTR(storage); @@ -432,67 +432,67 @@ void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) m_storage = storage; // qDebug("XMLWRITER: Starting file write"); - m_doc = new QDomDocument("KMYMONEY-FILE"); + m_doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(m_doc); - QDomProcessingInstruction instruct = m_doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\""); + TQDomProcessingInstruction instruct = m_doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\""); m_doc->appendChild(instruct); - QDomElement mainElement = m_doc->createElement("KMYMONEY-FILE"); + TQDomElement mainElement = m_doc->createElement("KMYMONEY-FILE"); m_doc->appendChild(mainElement); - QDomElement fileInfo = m_doc->createElement("FILEINFO"); + TQDomElement fileInfo = m_doc->createElement("FILEINFO"); writeFileInformation(fileInfo); mainElement.appendChild(fileInfo); - QDomElement userInfo = m_doc->createElement("USER"); + TQDomElement userInfo = m_doc->createElement("USER"); writeUserInformation(userInfo); mainElement.appendChild(userInfo); - QDomElement institutions = m_doc->createElement("INSTITUTIONS"); + TQDomElement institutions = m_doc->createElement("INSTITUTIONS"); writeInstitutions(institutions); mainElement.appendChild(institutions); - QDomElement payees = m_doc->createElement("PAYEES"); + TQDomElement payees = m_doc->createElement("PAYEES"); writePayees(payees); mainElement.appendChild(payees); - QDomElement accounts = m_doc->createElement("ACCOUNTS"); + TQDomElement accounts = m_doc->createElement("ACCOUNTS"); writeAccounts(accounts); mainElement.appendChild(accounts); - QDomElement transactions = m_doc->createElement("TRANSACTIONS"); + TQDomElement transactions = m_doc->createElement("TRANSACTIONS"); writeTransactions(transactions); mainElement.appendChild(transactions); - QDomElement keyvalpairs = writeKeyValuePairs(m_storage->pairs()); + TQDomElement keyvalpairs = writeKeyValuePairs(m_storage->pairs()); mainElement.appendChild(keyvalpairs); - QDomElement schedules = m_doc->createElement("SCHEDULES"); + TQDomElement schedules = m_doc->createElement("SCHEDULES"); writeSchedules(schedules); mainElement.appendChild(schedules); - QDomElement equities = m_doc->createElement("SECURITIES"); + TQDomElement equities = m_doc->createElement("SECURITIES"); writeSecurities(equities); mainElement.appendChild(equities); - QDomElement currencies = m_doc->createElement("CURRENCIES"); + TQDomElement currencies = m_doc->createElement("CURRENCIES"); writeCurrencies(currencies); mainElement.appendChild(currencies); - QDomElement prices = m_doc->createElement("PRICES"); + TQDomElement prices = m_doc->createElement("PRICES"); writePrices(prices); mainElement.appendChild(prices); - QDomElement reports = m_doc->createElement("REPORTS"); + TQDomElement reports = m_doc->createElement("REPORTS"); writeReports(reports); mainElement.appendChild(reports); - QDomElement budgets = m_doc->createElement("BUDGETS"); + TQDomElement budgets = m_doc->createElement("BUDGETS"); writeBudgets(budgets); mainElement.appendChild(budgets); - QTextStream stream(qf); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(qf); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << m_doc->toString(); delete m_doc; @@ -508,36 +508,36 @@ void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) m_storage = NULL; } -bool MyMoneyStorageXML::readFileInformation(const QDomElement& fileInfo) +bool MyMoneyStorageXML::readFileInformation(const TQDomElement& fileInfo) { signalProgress(0, 3, i18n("Loading file information...")); bool rc = true; - QDomElement temp = findChildElement("CREATION_DATE", fileInfo); - if (temp == QDomElement()) { + TQDomElement temp = findChildElement("CREATION_DATE", fileInfo); + if (temp == TQDomElement()) { rc = false; } - QString strDate = QStringEmpty(temp.attribute("date")); + TQString strDate = TQStringEmpty(temp.attribute("date")); m_storage->setCreationDate(stringToDate(strDate)); signalProgress(1, 0); temp = findChildElement("LAST_MODIFIED_DATE", fileInfo); - if (temp == QDomElement()) { + if (temp == TQDomElement()) { rc = false; } - strDate = QStringEmpty(temp.attribute("date")); + strDate = TQStringEmpty(temp.attribute("date")); m_storage->setLastModificationDate(stringToDate(strDate)); signalProgress(2, 0); temp = findChildElement("VERSION", fileInfo); - if (temp == QDomElement()) { + if (temp == TQDomElement()) { rc = false; } - QString strVersion = QStringEmpty(temp.attribute("id")); + TQString strVersion = TQStringEmpty(temp.attribute("id")); fileVersionRead = strVersion.toUInt(NULL, 16); temp = findChildElement("FIXVERSION", fileInfo); - if (temp != QDomElement()) { - QString strFixVersion = QStringEmpty(temp.attribute("id")); + if (temp != TQDomElement()) { + TQString strFixVersion = TQStringEmpty(temp.attribute("id")); m_storage->setFileFixVersion (strFixVersion.toUInt()); } // FIXME The old version stuff used this rather odd number @@ -549,33 +549,33 @@ bool MyMoneyStorageXML::readFileInformation(const QDomElement& fileInfo) return rc; } -void MyMoneyStorageXML::writeFileInformation(QDomElement& fileInfo) +void MyMoneyStorageXML::writeFileInformation(TQDomElement& fileInfo) { - QDomElement creationDate = m_doc->createElement("CREATION_DATE"); + TQDomElement creationDate = m_doc->createElement("CREATION_DATE"); creationDate.setAttribute("date", dateToString(m_storage->creationDate())); fileInfo.appendChild(creationDate); - QDomElement lastModifiedDate = m_doc->createElement("LAST_MODIFIED_DATE"); + TQDomElement lastModifiedDate = m_doc->createElement("LAST_MODIFIED_DATE"); lastModifiedDate.setAttribute("date", dateToString(m_storage->lastModificationDate())); fileInfo.appendChild(lastModifiedDate); - QDomElement version = m_doc->createElement("VERSION"); + TQDomElement version = m_doc->createElement("VERSION"); version.setAttribute("id", "1"); fileInfo.appendChild(version); - QDomElement fixVersion = m_doc->createElement("FIXVERSION"); + TQDomElement fixVersion = m_doc->createElement("FIXVERSION"); fixVersion.setAttribute("id", m_storage->fileFixVersion()); fileInfo.appendChild(fixVersion); } -void MyMoneyStorageXML::writeUserInformation(QDomElement& userInfo) +void MyMoneyStorageXML::writeUserInformation(TQDomElement& userInfo) { MyMoneyPayee user = m_storage->user(); userInfo.setAttribute("name", user.name()); userInfo.setAttribute("email", user.email()); - QDomElement address = m_doc->createElement("ADDRESS"); + TQDomElement address = m_doc->createElement("ADDRESS"); address.setAttribute("street", user.address()); address.setAttribute("city", user.city()); address.setAttribute("county", user.state()); @@ -585,22 +585,22 @@ void MyMoneyStorageXML::writeUserInformation(QDomElement& userInfo) userInfo.appendChild(address); } -bool MyMoneyStorageXML::readUserInformation(const QDomElement& userElement) +bool MyMoneyStorageXML::readUserInformation(const TQDomElement& userElement) { bool rc = true; signalProgress(0, 1, i18n("Loading user information...")); MyMoneyPayee user; - user.setName(QStringEmpty(userElement.attribute("name"))); - user.setEmail(QStringEmpty(userElement.attribute("email"))); + user.setName(TQStringEmpty(userElement.attribute("name"))); + user.setEmail(TQStringEmpty(userElement.attribute("email"))); - QDomElement addressNode = findChildElement("ADDRESS", userElement); + TQDomElement addressNode = findChildElement("ADDRESS", userElement); if(!addressNode.isNull()) { - user.setAddress(QStringEmpty(addressNode.attribute("street"))); - user.setCity(QStringEmpty(addressNode.attribute("city"))); - user.setState(QStringEmpty(addressNode.attribute("county"))); - user.setPostcode(QStringEmpty(addressNode.attribute("zipcode"))); - user.setTelephone(QStringEmpty(addressNode.attribute("telephone"))); + user.setAddress(TQStringEmpty(addressNode.attribute("street"))); + user.setCity(TQStringEmpty(addressNode.attribute("city"))); + user.setState(TQStringEmpty(addressNode.attribute("county"))); + user.setPostcode(TQStringEmpty(addressNode.attribute("zipcode"))); + user.setTelephone(TQStringEmpty(addressNode.attribute("telephone"))); } m_storage->setUser(user); @@ -609,41 +609,41 @@ bool MyMoneyStorageXML::readUserInformation(const QDomElement& userElement) return rc; } -void MyMoneyStorageXML::writeInstitutions(QDomElement& institutions) +void MyMoneyStorageXML::writeInstitutions(TQDomElement& institutions) { - const QValueList list = m_storage->institutionList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->institutionList(); + TQValueList::ConstIterator it; institutions.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) writeInstitution(institutions, *it); } -void MyMoneyStorageXML::writeInstitution(QDomElement& institution, const MyMoneyInstitution& i) +void MyMoneyStorageXML::writeInstitution(TQDomElement& institution, const MyMoneyInstitution& i) { i.writeXML(*m_doc, institution); } -void MyMoneyStorageXML::writePayees(QDomElement& payees) +void MyMoneyStorageXML::writePayees(TQDomElement& payees) { - const QValueList list = m_storage->payeeList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->payeeList(); + TQValueList::ConstIterator it; payees.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) writePayee(payees, *it); } -void MyMoneyStorageXML::writePayee(QDomElement& payee, const MyMoneyPayee& p) +void MyMoneyStorageXML::writePayee(TQDomElement& payee, const MyMoneyPayee& p) { p.writeXML(*m_doc, payee); } -void MyMoneyStorageXML::writeAccounts(QDomElement& accounts) +void MyMoneyStorageXML::writeAccounts(TQDomElement& accounts) { - QValueList list; + TQValueList list; m_storage->accountList(list); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; accounts.setAttribute("count", list.count()+5); writeAccount(accounts, m_storage->asset()); @@ -660,20 +660,20 @@ void MyMoneyStorageXML::writeAccounts(QDomElement& accounts) } } -void MyMoneyStorageXML::writeAccount(QDomElement& account, const MyMoneyAccount& p) +void MyMoneyStorageXML::writeAccount(TQDomElement& account, const MyMoneyAccount& p) { p.writeXML(*m_doc, account); } -void MyMoneyStorageXML::writeTransactions(QDomElement& transactions) +void MyMoneyStorageXML::writeTransactions(TQDomElement& transactions) { MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList list; + TQValueList list; m_storage->transactionList(list, filter); transactions.setAttribute("count", list.count()); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; signalProgress(0, list.count(), i18n("Saving transactions...")); @@ -685,15 +685,15 @@ void MyMoneyStorageXML::writeTransactions(QDomElement& transactions) } } -void MyMoneyStorageXML::writeTransaction(QDomElement& transaction, const MyMoneyTransaction& tx) +void MyMoneyStorageXML::writeTransaction(TQDomElement& transaction, const MyMoneyTransaction& tx) { tx.writeXML(*m_doc, transaction); } -void MyMoneyStorageXML::writeSchedules(QDomElement& scheduled) +void MyMoneyStorageXML::writeSchedules(TQDomElement& scheduled) { - const QValueList list = m_storage->scheduleList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->scheduleList(); + TQValueList::ConstIterator it; scheduled.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) @@ -702,86 +702,86 @@ void MyMoneyStorageXML::writeSchedules(QDomElement& scheduled) } } -void MyMoneyStorageXML::writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx) +void MyMoneyStorageXML::writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx) { tx.writeXML(*m_doc, scheduledTx); } -void MyMoneyStorageXML::writeSecurities(QDomElement& equities) +void MyMoneyStorageXML::writeSecurities(TQDomElement& equities) { - const QValueList securityList = m_storage->securityList(); + const TQValueList securityList = m_storage->securityList(); equities.setAttribute("count", securityList.count()); if(securityList.size()) { - for(QValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) + for(TQValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { writeSecurity(equities, (*it)); } } } -void MyMoneyStorageXML::writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security) +void MyMoneyStorageXML::writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security) { security.writeXML(*m_doc, securityElement); } -void MyMoneyStorageXML::writeCurrencies(QDomElement& currencies) +void MyMoneyStorageXML::writeCurrencies(TQDomElement& currencies) { - const QValueList currencyList = m_storage->currencyList(); + const TQValueList currencyList = m_storage->currencyList(); currencies.setAttribute("count", currencyList.count()); if(currencyList.size()) { - for(QValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) + for(TQValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { writeSecurity(currencies, (*it)); } } } -void MyMoneyStorageXML::writeReports(QDomElement& parent) +void MyMoneyStorageXML::writeReports(TQDomElement& tqparent) { - const QValueList list = m_storage->reportList(); - QValueList::ConstIterator it; - parent.setAttribute("count", list.count()); + const TQValueList list = m_storage->reportList(); + TQValueList::ConstIterator it; + tqparent.setAttribute("count", list.count()); signalProgress(0, list.count(), i18n("Saving reports...")); unsigned i = 0; for(it = list.begin(); it != list.end(); ++it) { - (*it).writeXML(*m_doc, parent); + (*it).writeXML(*m_doc, tqparent); signalProgress(++i, 0); } } -void MyMoneyStorageXML::writeBudgets(QDomElement& parent) +void MyMoneyStorageXML::writeBudgets(TQDomElement& tqparent) { - const QValueList list = m_storage->budgetList(); - QValueList::ConstIterator it; - parent.setAttribute("count", list.count()); + const TQValueList list = m_storage->budgetList(); + TQValueList::ConstIterator it; + tqparent.setAttribute("count", list.count()); signalProgress(0, list.count(), i18n("Saving budgets...")); unsigned i = 0; for(it = list.begin(); it != list.end(); ++it) { - writeBudget(parent, (*it)); + writeBudget(tqparent, (*it)); signalProgress(++i, 0); } } -void MyMoneyStorageXML::writeBudget(QDomElement& budget, const MyMoneyBudget& b) +void MyMoneyStorageXML::writeBudget(TQDomElement& budget, const MyMoneyBudget& b) { b.writeXML(*m_doc, budget); } -QDomElement MyMoneyStorageXML::findChildElement(const QString& name, const QDomElement& root) +TQDomElement MyMoneyStorageXML::findChildElement(const TQString& name, const TQDomElement& root) { - QDomNode child = root.firstChild(); + TQDomNode child = root.firstChild(); while(!child.isNull()) { if(child.isElement()) { - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); if(name == childElement.tagName()) { return childElement; @@ -790,29 +790,29 @@ QDomElement MyMoneyStorageXML::findChildElement(const QString& name, const QDomE child = child.nextSibling(); } - return QDomElement(); + return TQDomElement(); } -QDomElement MyMoneyStorageXML::writeKeyValuePairs(const QMap pairs) +TQDomElement MyMoneyStorageXML::writeKeyValuePairs(const TQMap pairs) { if(m_doc) { - QDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS"); + TQDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS"); - QMap::const_iterator it; + TQMap::const_iterator it; for(it = pairs.begin(); it != pairs.end(); ++it) { - QDomElement pair = m_doc->createElement("PAIR"); + TQDomElement pair = m_doc->createElement("PAIR"); pair.setAttribute("key", it.key()); pair.setAttribute("value", it.data()); keyValPairs.appendChild(pair); } return keyValPairs; } - return QDomElement(); + return TQDomElement(); } -void MyMoneyStorageXML::writePrices(QDomElement& prices) +void MyMoneyStorageXML::writePrices(TQDomElement& prices) { const MyMoneyPriceList list = m_storage->priceList(); MyMoneyPriceList::ConstIterator it; @@ -820,7 +820,7 @@ void MyMoneyStorageXML::writePrices(QDomElement& prices) for(it = list.begin(); it != list.end(); ++it) { - QDomElement price = m_doc->createElement("PRICEPAIR"); + TQDomElement price = m_doc->createElement("PRICEPAIR"); price.setAttribute("from", it.key().first); price.setAttribute("to", it.key().second); writePricePair(price, *it); @@ -828,29 +828,29 @@ void MyMoneyStorageXML::writePrices(QDomElement& prices) } } -void MyMoneyStorageXML::writePricePair(QDomElement& price, const MyMoneyPriceEntries& p) +void MyMoneyStorageXML::writePricePair(TQDomElement& price, const MyMoneyPriceEntries& p) { MyMoneyPriceEntries::ConstIterator it; for(it = p.begin(); it != p.end(); ++it) { - QDomElement entry = m_doc->createElement("PRICE"); + TQDomElement entry = m_doc->createElement("PRICE"); writePrice(entry, *it); price.appendChild(entry); } } -void MyMoneyStorageXML::writePrice(QDomElement& price, const MyMoneyPrice& p) +void MyMoneyStorageXML::writePrice(TQDomElement& price, const MyMoneyPrice& p) { price.setAttribute("date", p.date().toString(Qt::ISODate)); - price.setAttribute("price", p.rate(QString()).toString()); + price.setAttribute("price", p.rate(TQString()).toString()); price.setAttribute("source", p.source()); } -void MyMoneyStorageXML::setProgressCallback(void(*callback)(int, int, const QString&)) +void MyMoneyStorageXML::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStorageXML::signalProgress(int current, int total, const QString& msg) +void MyMoneyStorageXML::signalProgress(int current, int total, const TQString& msg) { if(m_progressCallback != 0) (*m_progressCallback)(current, total, msg); @@ -860,23 +860,23 @@ void MyMoneyStorageXML::signalProgress(int current, int total, const QString& ms This convenience function returns all of the remaining data in the device. - @note It's copied from the original Qt sources and modified to + @note It's copied from the original TQt sources and modified to fix a problem with KFilterDev that does not correctly return atEnd() status in certain circumstances which caused our application to lock at startup. */ -QByteArray QIODevice::readAll() +TQByteArray TQIODevice::readAll() { if ( isDirectAccess() ) { // we know the size int n = size()-at(); // ### fix for 64-bit or large files? int totalRead = 0; - QByteArray ba( n ); + TQByteArray ba( n ); char* c = ba.data(); while ( n ) { int r = readBlock( c, n ); if ( r < 0 ) - return QByteArray(); + return TQByteArray(); n -= r; c += r; totalRead += r; @@ -892,13 +892,13 @@ QByteArray QIODevice::readAll() // read until we reach the end const int blocksize = 512; int nread = 0; - QByteArray ba; + TQByteArray ba; int r = 1; while ( !atEnd() && r != 0) { ba.resize( nread + blocksize ); r = readBlock( ba.data()+nread, blocksize ); if ( r < 0 ) - return QByteArray(); + return TQByteArray(); nread += r; } ba.resize( nread ); diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.h b/kmymoney2/mymoney/storage/mymoneystoragexml.h index 8485978..b74626d 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.h +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.h @@ -23,9 +23,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -class QIODevice; +#include +#include +class TQIODevice; // ---------------------------------------------------------------------------- // Project Includes @@ -54,78 +54,78 @@ public: }; protected: - void setProgressCallback(void(*callback)(int, int, const QString&)); - void signalProgress(int current, int total, const QString& = ""); + void setProgressCallback(void(*callback)(int, int, const TQString&)); + void signalProgress(int current, int total, const TQString& = ""); /** * This method returns the version of the underlying file. It * is used by the MyMoney objects contained in a MyMoneyStorageBin object (e.g. * MyMoneyAccount, MyMoneyInstitution, MyMoneyTransaction, etc.) to - * determine the layout used when reading/writing a persistant file. + * determine the tqlayout used when reading/writing a persistant file. * A parameter is used to determine the direction. * * @param dir information about the direction (reading/writing). The * default is reading. * - * @return version QString of file's version + * @return version TQString of file's version * * @see m_fileVersionRead, m_fileVersionWrite */ static unsigned int fileVersion(fileVersionDirectionType dir = Reading); - QValueList readElements(QString groupTag, QString itemTag = QString()); + TQValueList readElements(TQString groupTag, TQString itemTag = TQString()); - bool readFileInformation(const QDomElement& fileInfo); - virtual void writeFileInformation(QDomElement& fileInfo); + bool readFileInformation(const TQDomElement& fileInfo); + virtual void writeFileInformation(TQDomElement& fileInfo); - virtual void writeUserInformation(QDomElement& userInfo); + virtual void writeUserInformation(TQDomElement& userInfo); - virtual void writeInstitution(QDomElement& institutions, const MyMoneyInstitution& i); - virtual void writeInstitutions(QDomElement& institutions); + virtual void writeInstitution(TQDomElement& institutions, const MyMoneyInstitution& i); + virtual void writeInstitutions(TQDomElement& institutions); - virtual void writePrices(QDomElement& prices); - virtual void writePricePair(QDomElement& price, const MyMoneyPriceEntries& p); - virtual void writePrice(QDomElement& prices, const MyMoneyPrice& p); + virtual void writePrices(TQDomElement& prices); + virtual void writePricePair(TQDomElement& price, const MyMoneyPriceEntries& p); + virtual void writePrice(TQDomElement& prices, const MyMoneyPrice& p); - virtual void writePayees(QDomElement& payees); - virtual void writePayee(QDomElement& payees, const MyMoneyPayee& p); + virtual void writePayees(TQDomElement& payees); + virtual void writePayee(TQDomElement& payees, const MyMoneyPayee& p); - virtual void writeAccounts(QDomElement& accounts); - virtual void writeAccount(QDomElement& accounts, const MyMoneyAccount& p); + virtual void writeAccounts(TQDomElement& accounts); + virtual void writeAccount(TQDomElement& accounts, const MyMoneyAccount& p); - virtual void writeTransactions(QDomElement& transactions); - virtual void writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx); + virtual void writeTransactions(TQDomElement& transactions); + virtual void writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx); - virtual void writeSchedules(QDomElement& scheduled); - virtual void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx); + virtual void writeSchedules(TQDomElement& scheduled); + virtual void writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx); - virtual void writeReports(QDomElement& e); - virtual void writeBudgets(QDomElement& e); - virtual void writeBudget(QDomElement& budget, const MyMoneyBudget& b); + virtual void writeReports(TQDomElement& e); + virtual void writeBudgets(TQDomElement& e); + virtual void writeBudget(TQDomElement& budget, const MyMoneyBudget& b); - virtual void writeSecurities(QDomElement& securities); - virtual void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security); + virtual void writeSecurities(TQDomElement& securities); + virtual void writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security); - virtual void writeCurrencies(QDomElement& currencies); + virtual void writeCurrencies(TQDomElement& currencies); - virtual QDomElement writeKeyValuePairs(const QMap pairs); + virtual TQDomElement writeKeyValuePairs(const TQMap pairs); - virtual void readFile(QIODevice* s, IMyMoneySerialize* storage); - virtual void writeFile(QIODevice* s, IMyMoneySerialize* storage); + virtual void readFile(TQIODevice* s, IMyMoneySerialize* storage); + virtual void writeFile(TQIODevice* s, IMyMoneySerialize* storage); - bool readUserInformation(const QDomElement& userElement); + bool readUserInformation(const TQDomElement& userElement); - void readPricePair(const QDomElement& pricePair); - const MyMoneyPrice readPrice(const QString& from, const QString& to, const QDomElement& price); + void readPricePair(const TQDomElement& pricePair); + const MyMoneyPrice readPrice(const TQString& from, const TQString& to, const TQDomElement& price); - QDomElement findChildElement(const QString& name, const QDomElement& root); + TQDomElement findChildElement(const TQString& name, const TQDomElement& root); private: - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); protected: IMyMoneySerialize *m_storage; - QDomDocument *m_doc; + TQDomDocument *m_doc; private: /// \internal d-pointer class. @@ -149,7 +149,7 @@ private: * temporarily to convert the price history from the old to the * new format. This should go at some time beyond 0.8 (ipwizard) */ - QString m_baseCurrencyId; + TQString m_baseCurrencyId; }; -- cgit v1.2.1