summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/storage
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/mymoney/storage
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/mymoney/storage')
-rw-r--r--kmymoney2/mymoney/storage/imymoneyserialize.h94
-rw-r--r--kmymoney2/mymoney/storage/imymoneystorage.cpp2
-rw-r--r--kmymoney2/mymoney/storage/imymoneystorage.h170
-rw-r--r--kmymoney2/mymoney/storage/imymoneystorageformat.h16
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp674
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgr.h214
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp218
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h4
-rw-r--r--kmymoney2/mymoney/storage/mymoneymap.h84
-rw-r--r--kmymoney2/mymoney/storage/mymoneymaptest.cpp2
-rw-r--r--kmymoney2/mymoney/storage/mymoneymaptest.h2
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp612
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h264
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp142
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h8
-rw-r--r--kmymoney2/mymoney/storage/mymoneystorageanon.cpp76
-rw-r--r--kmymoney2/mymoney/storage/mymoneystorageanon.h32
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragedump.cpp92
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragedump.h12
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.cpp1178
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.h324
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragexml.cpp334
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragexml.h80
23 files changed, 2313 insertions, 2321 deletions
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 <qstring.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
// ----------------------------------------------------------------------------
// 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<MyMoneyAccount>& list) const = 0;
+ virtual void accountList(TQValueList<MyMoneyAccount>& 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<MyMoneyInstitution> institutionList(void) const = 0;
+ virtual const TQValueList<MyMoneyInstitution> 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<MyMoneyTransaction> receiving
+ * @param list reference to TQValueList<MyMoneyTransaction> receiving
* the set of transactions
* @param filter MyMoneyTransactionFilter object with the match criteria
*/
- virtual void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0;
+ virtual void transactionList(TQValueList<MyMoneyTransaction>& 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<MyMoneyPayee> containing the payee information
+ * @return TQValueList<MyMoneyPayee> containing the payee information
*/
- virtual const QValueList<MyMoneyPayee> payeeList(void) const = 0;
+ virtual const TQValueList<MyMoneyPayee> 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<MyMoneySchedule> scheduleList(const QString& = QString(),
+ virtual const TQValueList<MyMoneySchedule> 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<MyMoneySecurity> securityList(void) const = 0;
+ virtual const TQValueList<MyMoneySecurity> 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<QString, MyMoneyAccount>& map) = 0;
- virtual void loadTransactions(const QMap<QString, MyMoneyTransaction>& map) = 0;
- virtual void loadInstitutions(const QMap<QString, MyMoneyInstitution>& map) = 0;
- virtual void loadPayees(const QMap<QString, MyMoneyPayee>& map) = 0;
- virtual void loadSchedules(const QMap<QString, MyMoneySchedule>& map) = 0;
- virtual void loadSecurities(const QMap<QString, MyMoneySecurity>& map) = 0;
- virtual void loadCurrencies(const QMap<QString, MyMoneySecurity>& map) = 0;
- virtual void loadReports( const QMap<QString, MyMoneyReport>& reports ) = 0;
- virtual void loadBudgets( const QMap<QString, MyMoneyBudget>& budgets ) = 0;
+ virtual void loadAccounts(const TQMap<TQString, MyMoneyAccount>& map) = 0;
+ virtual void loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map) = 0;
+ virtual void loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map) = 0;
+ virtual void loadPayees(const TQMap<TQString, MyMoneyPayee>& map) = 0;
+ virtual void loadSchedules(const TQMap<TQString, MyMoneySchedule>& map) = 0;
+ virtual void loadSecurities(const TQMap<TQString, MyMoneySecurity>& map) = 0;
+ virtual void loadCurrencies(const TQMap<TQString, MyMoneySecurity>& map) = 0;
+ virtual void loadReports( const TQMap<TQString, MyMoneyReport>& reports ) = 0;
+ virtual void loadBudgets( const TQMap<TQString, MyMoneyBudget>& 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<QString, QString> containing all key/value pairs of
+ * @return TQMap<TQString, TQString> containing all key/value pairs of
* this container.
*/
- virtual const QMap<QString, QString> pairs(void) const = 0;
+ virtual const TQMap<TQString, TQString> 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<QString, QString> containing the set of
+ * @param list const TQMap<TQString, TQString> 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<QString, QString>& list) = 0;
+ virtual void setPairs(const TQMap<TQString, TQString>& list) = 0;
- virtual const QValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes,
+ virtual const TQValueList<MyMoneySchedule> 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<MyMoneySecurity> currencyList(void) const = 0;
+ virtual const TQValueList<MyMoneySecurity> 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<MyMoneyReport> reportList( void ) const = 0;
+ virtual const TQValueList<MyMoneyReport> 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<MyMoneyBudget> budgetList( void ) const = 0;
+ virtual const TQValueList<MyMoneyBudget> 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 <qstring.h>
-#include <qbitarray.h>
+#include <tqstring.h>
+#include <tqbitarray.h>
// ----------------------------------------------------------------------------
// 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<MyMoneyPayee> containing the payee information
+ * @return TQValueList<MyMoneyPayee> containing the payee information
*/
- virtual const QValueList<MyMoneyPayee> payeeList(void) const = 0;
+ virtual const TQValueList<MyMoneyPayee> 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<MyMoneyInstitution> containing the
+ * @return TQValueList<MyMoneyInstitution> containing the
* institution information
*/
- virtual const QValueList<MyMoneyInstitution> institutionList(void) const = 0;
+ virtual const TQValueList<MyMoneyInstitution> 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<QString, unsigned long> transactionCountMap(void) const = 0;
+ virtual const TQMap<TQString, unsigned long> 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<MyMoneyTransaction>
+ * @return set of transactions in form of a TQValueList<MyMoneyTransaction>
*/
- virtual const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const = 0;
+ virtual const TQValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const = 0;
- virtual void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0;
+ virtual void transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0;
- virtual void transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const = 0;
+ virtual void transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& 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<MyMoneyAccount>& list) const = 0;
+ virtual void accountList(TQValueList<MyMoneyAccount>& 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<MyMoneySecurity> containing objects
+ * @return TQValueList<MyMoneySecurity> containing objects
*/
- virtual const QValueList<MyMoneySecurity> securityList(void) const = 0;
+ virtual const TQValueList<MyMoneySecurity> 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<MyMoneySchedule> list of schedule objects.
+ * @return const TQValueList<MyMoneySchedule> list of schedule objects.
*/
- virtual const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(),
+ virtual const TQValueList<MyMoneySchedule> 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<MyMoneySchedule> scheduleListEx( int scheduleTypes,
+ virtual const TQValueList<MyMoneySchedule> 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<MyMoneySecurity> currencyList(void) const = 0;
+ virtual const TQValueList<MyMoneySecurity> 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<MyMoneyReport> reportList( void ) const = 0;
+ virtual const TQValueList<MyMoneyReport> 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<MyMoneyBudget> budgetList( void ) const = 0;
+ virtual const TQValueList<MyMoneyBudget> 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<QString, QString> MyMoneyDatabaseMgr::pairs(void) const
+const TQMap<TQString, TQString> MyMoneyDatabaseMgr::pairs(void) const
{
return MyMoneyKeyValueContainer::pairs();
}
-void MyMoneyDatabaseMgr::setPairs(const QMap<QString, QString>& list)
+void MyMoneyDatabaseMgr::setPairs(const TQMap<TQString, TQString>& 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<QString, MyMoneyAccount> accountList;
- QStringList accountIdList;
- QMap<QString, MyMoneyAccount>::ConstIterator theParent;
- QMap<QString, MyMoneyAccount>::ConstIterator theChild;
+ TQMap<TQString, MyMoneyAccount> accountList;
+ TQStringList accountIdList;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator theParent;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyPayee>::ConstIterator it;
- QMap<QString, MyMoneyPayee> payeeList = m_sql->fetchPayees(QString(id));
- it = payeeList.find(id);
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it;
+ TQMap<TQString, MyMoneyPayee> 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<QString, MyMoneyPayee> payeeList;
+ TQMap<TQString, MyMoneyPayee> payeeList;
TRY
payeeList = m_sql->fetchPayees();
PASS
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyPayee> payeeList = m_sql->fetchPayees(QString(payee.id()), true);
- QMap<QString, MyMoneyPayee>::ConstIterator it;
+ TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(payee.id()), true);
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneySchedule>::ConstIterator it_s;
- QMap<QString, MyMoneyPayee> payeeList = m_sql->fetchPayees(QString(payee.id()));
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(payee.id()));
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(); // make sure they're all here
+ TQMap<TQString, MyMoneyTransaction> 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<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(); // make sure they're all here
+ TQMap<TQString, MyMoneySchedule> 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<MyMoneyPayee> MyMoneyDatabaseMgr::payeeList(void) const
+const TQValueList<MyMoneyPayee> MyMoneyDatabaseMgr::payeeList(void) const
{
if (m_sql)
return m_sql->fetchPayees().values();
else
- return QValueList<MyMoneyPayee> ();
+ return TQValueList<MyMoneyPayee> ();
}
-const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const
+const MyMoneyAccount MyMoneyDatabaseMgr::account(const TQString& id) const
{
if (m_sql)
{
- QMap <QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(QString(id));
- QMap <QString, MyMoneyAccount>::ConstIterator pos = accountList.find(id);
+ TQMap <TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(TQString(id));
+ TQMap <TQString, MyMoneyAccount>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyTransaction>::ConstIterator it;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it;
MyMoneyTransactionFilter f(id);
- QMap<QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(f);
+ TQMap<TQString, MyMoneyTransaction> 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 <QString> tempList (accounts.begin(), accounts.end());
+ std::list <TQString> tempList (accounts.begin(), accounts.end());
tempList.sort();;
tempList.unique();
- accounts = QStringList(tempList);
+ accounts = TQStringList(tempList);
- QMap<QString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accounts, date);
- for (QMap<QString, MyMoneyMoney>::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) {
+ TQMap<TQString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accounts, date);
+ for (TQMap<TQString, MyMoneyMoney>::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<QString, MyMoneyInstitution>::ConstIterator pos;
- QMap<QString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(QString(id));
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution> 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<MyMoneyInstitution> MyMoneyDatabaseMgr::institutionList(void) const
+const TQValueList<MyMoneyInstitution> MyMoneyDatabaseMgr::institutionList(void) const
{
if (m_sql) {
return m_sql->fetchInstitutions().values();
} else {
- return QValueList<MyMoneyInstitution> ();
+ return TQValueList<MyMoneyInstitution> ();
}
}
void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck)
{
- QMap<QString, MyMoneyAccount>::ConstIterator pos;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator pos;
// locate the account in the file global pool
startTransaction();
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts (QString(account.id()), true);
- pos = accountList.find(account.id());
+ TQMap<TQString, MyMoneyAccount> 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<QString>::ConstIterator it_a;
+ TQValueList<TQString>::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<QString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(QString(institution.id()));
- QMap<QString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(institution.id()));
+ TQMap<TQString, MyMoneyInstitution>::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<QString, bool> modifiedAccounts;
+ TQMap<TQString, bool> 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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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 <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')");
+// TQString oldKey = m_transactionKeys[transaction.id()];
+ TQMap <TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')");
// if(transactionList.size() != 1)
// throw new MYMONEYEXCEPTION("invalid transaction key");
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::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<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts();
+ TQMap<TQString, MyMoneyAccount> 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<QString, MyMoneyAccount>::ConstIterator oldParent;
- QMap<QString, MyMoneyAccount>::ConstIterator newParent;
- QMap<QString, MyMoneyAccount>::ConstIterator childAccount;
+ TQStringList accountIdList;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator oldParent;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator newParent;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
+ TQMap<TQString, MyMoneyAccount> 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<QString, bool> modifiedAccounts;
+ TQMap<TQString, bool> modifiedAccounts;
// first perform all the checks
if(transaction.id().isEmpty())
throw new MYMONEYEXCEPTION("invalid transaction to be deleted");
- QMap<QString, QString>::ConstIterator it_k;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, TQString>::ConstIterator it_k;
+ TQMap<TQString, MyMoneyTransaction>::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 <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')");
-// it_t = transactionList.find(*it_k);
+ TQMap <TQString, MyMoneyTransaction> 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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
// scan the splits and collect all accounts that need
// to be updated after the removal of this transaction
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts();
+ TQMap<TQString, MyMoneyAccount> 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<QString, unsigned long> MyMoneyDatabaseMgr::transactionCountMap(void) const
+const TQMap<TQString, unsigned long> MyMoneyDatabaseMgr::transactionCountMap(void) const
{ return (m_sql->transactionCountMap()); }
-const QValueList<MyMoneyTransaction> MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const
+const TQValueList<MyMoneyTransaction> MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const
{
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
transactionList(list, filter);
return list;
}
-void MyMoneyDatabaseMgr::transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
+void MyMoneyDatabaseMgr::transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
@@ -764,22 +764,22 @@ void MyMoneyDatabaseMgr::transactionList(QValueList<MyMoneyTransaction>& list, M
PASS
}
-void MyMoneyDatabaseMgr::transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
+void MyMoneyDatabaseMgr::transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
- MyMoneyMap<QString, MyMoneyTransaction> transactionList;
+ MyMoneyMap<TQString, MyMoneyTransaction> transactionList;
TRY
if (m_sql) transactionList = m_sql->fetchTransactions(filter);
PASS
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneyTransaction>::ConstIterator txEnd = transactionList.end();
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator txEnd = transactionList.end();
for(it_t = transactionList.begin(); it_t != txEnd; ++it_t) {
if(filter.match(*it_t)) {
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::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<QPair<MyMoneyTransaction, My
void MyMoneyDatabaseMgr::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
MyMoneyDatabaseMgr::account(account.id());
- parent = MyMoneyDatabaseMgr::account(account.parentAccountId());
+ tqparent = MyMoneyDatabaseMgr::account(account.tqparentAccountId());
// check that it's not one of the standard account groups
if(isStandardAccount(account.id()))
@@ -802,10 +802,10 @@ void MyMoneyDatabaseMgr::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) {
MyMoneyDatabaseMgr::account(*it);
}
@@ -813,23 +813,23 @@ void MyMoneyDatabaseMgr::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.
- QStringList accountIdList;
- accountIdList << parent.id() << account.id();
+ TQStringList accountIdList;
+ accountIdList << tqparent.id() << account.id();
startTransaction();
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
- QMap<QString, MyMoneyAccount>::ConstIterator it_a;
- QMap<QString, MyMoneyAccount>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it_a;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(QString(institution.id()));
- QMap<QString, MyMoneyInstitution>::ConstIterator it_i;
+ TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(institution.id()));
+ TQMap<TQString, MyMoneyInstitution>::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 <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + QString(id) + "')");
+ //TQString key = m_transactionKeys[id];
+ TQMap <TQString, MyMoneyTransaction> 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<QString,MyMoneyMoney> tempMap = m_sql->fetchBalance(idList, date);
+ TQMap<TQString,MyMoneyMoney> 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<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*QString(id)*/);
- //QMap<QString, MyMoneyAccount>::const_iterator accpos = accountList.find(id);
- if (date_ != QDate()) qDebug ("request balance for %s at %s", id.data(), date_.toString(Qt::ISODate).latin1());
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*TQString(id)*/);
+ //TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyMoney> balances;
- QMap<QString, MyMoneyMoney>::ConstIterator it_b;
+ TQMap<TQString, MyMoneyMoney> balances;
+ TQMap<TQString, MyMoneyMoney>::ConstIterator it_b;
//FIXME: if (date != m_balanceCacheDate) {
//FIXME: m_balanceCache.clear();
//FIXME: m_balanceCacheDate = date;
//FIXME: }
- QValueList<MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneyTransaction>::ConstIterator txEnd;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneyTransaction>::ConstIterator txEnd;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
MyMoneyTransactionFilter filter;
filter.addAccount(id);
- filter.setDateFilter(QDate(), date_);
+ filter.setDateFilter(TQDate(), date_);
filter.setReportAllSplits(false);
- QValueList<MyMoneyTransaction> list = transactionList(filter);
+ TQValueList<MyMoneyTransaction> 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<QString, MyMoneyAccount>::ConstIterator it_a;
+// TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyAccount>::ConstIterator acc;
+ TQMap<TQString, MyMoneyAccount>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> 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<MyMoneyAccount>& list) const
+void MyMoneyDatabaseMgr::accountList(TQValueList<MyMoneyAccount>& list) const
{
- QMap <QString, MyMoneyAccount> accountList;
+ TQMap <TQString, MyMoneyAccount> accountList;
if (m_sql) accountList = m_sql->fetchAccounts();
- QMap<QString, MyMoneyAccount>::ConstIterator it;
- QMap<QString, MyMoneyAccount>::ConstIterator accEnd = accountList.end();
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(QString(security.id()), true);
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(security.id()), true);
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(QString(security.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(security.id()));
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(QString(id));
- QMap<QString, MyMoneySecurity>::ConstIterator it = securitiesList.find(id);
+ TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(id));
+ TQMap<TQString, MyMoneySecurity>::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<MyMoneySecurity> MyMoneyDatabaseMgr::securityList(void) const
+const TQValueList<MyMoneySecurity> 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<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(QString(sched.id()));
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(sched.id()));
+ TQMap<TQString, MyMoneySchedule>::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<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(QString(sched.id()));
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(sched.id()));
+ TQMap<TQString, MyMoneySchedule>::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<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(QString(id));
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(id));
+ TQMap<TQString, MyMoneySchedule>::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<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString& accountId,
+const TQValueList<MyMoneySchedule> 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<QString, MyMoneySchedule> scheduleList;
+ TQMap<TQString, MyMoneySchedule> scheduleList;
if (m_sql) scheduleList = m_sql->fetchSchedules();
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
// qDebug("scheduleList()");
@@ -1241,8 +1241,8 @@ const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString
if(!accountId.isEmpty()) {
MyMoneyTransaction t = (*pos).transaction();
- QValueList<MyMoneySplit>::ConstIterator it;
- QValueList<MyMoneySplit> splits;
+ TQValueList<MyMoneySplit>::ConstIterator it;
+ TQValueList<MyMoneySplit> splits;
splits = t.splits();
for(it = splits.begin(); it != splits.end(); ++it) {
if((*it).accountId() == accountId)
@@ -1275,10 +1275,10 @@ const QValueList<MyMoneySchedule> 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<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString
return list;
}
-const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes,
+const TQValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes,
int scheduleOcurrences,
int schedulePaymentTypes,
- QDate startDate,
- const QStringList& accounts) const
+ TQDate startDate,
+ const TQStringList& accounts) const
{
// qDebug("scheduleListEx");
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
if (!startDate.isValid())
return list;
@@ -1325,7 +1325,7 @@ const QValueList<MyMoneySchedule> 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<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int schedu
void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency)
{
if (m_sql) {
- QMap<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(currency.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(currency.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(currency.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(id));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(id));
+ TQMap<TQString, MyMoneySecurity>::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<MyMoneySecurity> MyMoneyDatabaseMgr::currencyList(void) const
+const TQValueList<MyMoneySecurity> MyMoneyDatabaseMgr::currencyList(void) const
{
if (m_sql) {
return m_sql->fetchCurrencies().values();
} else {
- return QValueList<MyMoneySecurity> ();
+ return TQValueList<MyMoneySecurity> ();
}
}
-const QValueList<MyMoneyReport> MyMoneyDatabaseMgr::reportList( void ) const
+const TQValueList<MyMoneyReport> MyMoneyDatabaseMgr::reportList( void ) const
{
if (m_sql) {
return m_sql->fetchReports().values();
} else {
- return QValueList<MyMoneyReport> ();
+ return TQValueList<MyMoneyReport> ();
}
}
@@ -1426,12 +1426,12 @@ void MyMoneyDatabaseMgr::addReport( MyMoneyReport& report )
void MyMoneyDatabaseMgr::modifyReport( const MyMoneyReport& report )
{
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports(QString(report.id()));
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports(TQString(report.id()));
+ TQMap<TQString, MyMoneyReport>::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<QString, MyMoneyReport> reportList = m_sql->fetchReports(QString(report.id()));
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports(TQString(report.id()));
+ TQMap<TQString, MyMoneyReport>::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<MyMoneyBudget> MyMoneyDatabaseMgr::budgetList( void ) const
+const TQValueList<MyMoneyBudget> 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<QString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
- QMap<QString, MyMoneyBudget>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
+ TQMap<TQString, MyMoneyBudget>::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<QString, MyMoneyBudget>::ConstIterator it;
+ //TQMap<TQString, MyMoneyBudget>::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<QString, MyMoneyBudget>::ConstIterator it;
+// TQMap<TQString, MyMoneyBudget>::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 <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(f);
+ //TQMap <TQString, MyMoneyTransaction> 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<MyMoneyAccount> accountList;
+ TQValueList<MyMoneyAccount> accountList;
MyMoneyFile::instance()->accountList(accountList);
rc = (accountList.end() != std::find_if(accountList.begin(), accountList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckInstitution] && !rc) {
- QValueList<MyMoneyInstitution> institutionList;
+ TQValueList<MyMoneyInstitution> institutionList;
MyMoneyFile::instance()->institutionList(institutionList);
rc = (institutionList.end() != std::find_if(institutionList.begin(), institutionList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckPayee] && !rc) {
- QValueList<MyMoneyPayee> payeeList = MyMoneyFile::instance()->payeeList();
+ TQValueList<MyMoneyPayee> payeeList = MyMoneyFile::instance()->payeeList();
rc = (payeeList.end() != std::find_if(payeeList.begin(), payeeList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckReport] && !rc) {
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports();
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports();
rc = (reportList.end() != std::find_if(reportList.begin(), reportList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckBudget] && !rc) {
- QMap<QString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
+ TQMap<TQString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
rc = (budgets.end() != std::find_if(budgets.begin(), budgets.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckSchedule] && !rc) {
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
rc = (scheduleList.end() != std::find_if(scheduleList.begin(), scheduleList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckSecurity] && !rc) {
- QValueList<MyMoneySecurity> securitiesList = MyMoneyFile::instance()->securityList();
+ TQValueList<MyMoneySecurity> securitiesList = MyMoneyFile::instance()->securityList();
rc = (securitiesList.end() != std::find_if(securitiesList.begin(), securitiesList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckCurrency] && !rc) {
- QValueList<MyMoneySecurity> currencyList = m_sql->fetchCurrencies().values();
+ TQValueList<MyMoneySecurity> 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 <MyMoneyStorageSql> MyMoneyDatabaseMgr::connectToDatabase(const KURL& url) {
@@ -1664,17 +1664,17 @@ KSharedPtr <MyMoneyStorageSql> 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<QString, MyMoneyAccount>& /*map*/)
+void MyMoneyDatabaseMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& /*map*/)
{
// m_accountList = map;
//FIXME: update the database.
@@ -1686,50 +1686,50 @@ void MyMoneyDatabaseMgr::loadAccounts(const QMap<QString, MyMoneyAccount>& /*map
// on error, rollbackTransaction
}
-void MyMoneyDatabaseMgr::loadTransactions(const QMap<QString, MyMoneyTransaction>& /*map*/)
+void MyMoneyDatabaseMgr::loadTransactions(const TQMap<TQString, MyMoneyTransaction>& /*map*/)
{
// m_transactionList = map;
//FIXME: update the database.
// // now fill the key map
-// QMap<QString, QString> keys;
-// QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+// TQMap<TQString, TQString> keys;
+// TQMap<TQString, MyMoneyTransaction>::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<QString, MyMoneyInstitution>& /*map*/)
+void MyMoneyDatabaseMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& /*map*/)
{
// m_institutionList = map;
//FIXME: update the database.
// // now fill the key map
-// QMap<QString, QString> keys;
-// QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+// TQMap<TQString, TQString> keys;
+// TQMap<TQString, MyMoneyTransaction>::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<QString, MyMoneyPayee>& /*map*/)
+void MyMoneyDatabaseMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& /*map*/)
{
// m_payeeList = map;
}
-void MyMoneyDatabaseMgr::loadSchedules(const QMap<QString, MyMoneySchedule>& /*map*/)
+void MyMoneyDatabaseMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>& /*map*/)
{
// m_scheduleList = map;
}
-void MyMoneyDatabaseMgr::loadSecurities(const QMap<QString, MyMoneySecurity>& /*map*/)
+void MyMoneyDatabaseMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>& /*map*/)
{
// m_securitiesList = map;
}
-void MyMoneyDatabaseMgr::loadCurrencies(const QMap<QString, MyMoneySecurity>& /*map*/)
+void MyMoneyDatabaseMgr::loadCurrencies(const TQMap<TQString, MyMoneySecurity>& /*map*/)
{
// m_currencyList = map;
//FIXME: update the database.
@@ -1741,7 +1741,7 @@ void MyMoneyDatabaseMgr::loadCurrencies(const QMap<QString, MyMoneySecurity>& /*
// on error, rollbackTransaction
}
-void MyMoneyDatabaseMgr::loadReports( const QMap<QString, MyMoneyReport>& /*reports*/ )
+void MyMoneyDatabaseMgr::loadReports( const TQMap<TQString, MyMoneyReport>& /*reports*/ )
{
// m_reportList = reports;
//FIXME: update the database.
@@ -1753,7 +1753,7 @@ void MyMoneyDatabaseMgr::loadReports( const QMap<QString, MyMoneyReport>& /*repo
// on error, rollbackTransaction
}
-void MyMoneyDatabaseMgr::loadBudgets( const QMap<QString, MyMoneyBudget>& /*budgets*/ )
+void MyMoneyDatabaseMgr::loadBudgets( const TQMap<TQString, MyMoneyBudget>& /*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<QString, MyMoneyAccount> accountMap = m_sql->fetchAccounts(QStringList(), true);
+ TQMap<TQString, MyMoneyAccount> accountMap = m_sql->fetchAccounts(TQStringList(), true);
- QMap<QString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accountMap.keys(), QDate());
+ TQMap<TQString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accountMap.keys(), TQDate());
- for (QMap<QString, MyMoneyMoney>::const_iterator it_b = balanceMap.begin();
+ for (TQMap<TQString, MyMoneyMoney>::const_iterator it_b = balanceMap.begin();
it_b != balanceMap.end(); ++it_b) {
accountMap[it_b.key()].setBalance(it_b.data());
}
- for (QMap<QString, MyMoneyAccount>::const_iterator it_a = accountMap.begin();
+ for (TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyReport>::const_iterator it_r;
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
+ TQMap<TQString, MyMoneyReport>::const_iterator it_r;
+ TQMap<TQString, MyMoneyBudget>::const_iterator it_b;
// remove from reports
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports();
+ TQMap<TQString, MyMoneyReport> 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<QString, MyMoneyBudget> budgetList = m_sql->fetchBudgets();
+ TQMap<TQString, MyMoneyBudget> 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<MyMoneyPayee> containing the payee information
+ * @return TQValueList<MyMoneyPayee> containing the payee information
*/
- virtual const QValueList<MyMoneyPayee> payeeList(void) const;
+ virtual const TQValueList<MyMoneyPayee> 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<MyMoneyInstitution> containing the
+ * @return TQValueList<MyMoneyInstitution> containing the
* institution information
*/
- virtual const QValueList<MyMoneyInstitution> institutionList(void) const;
+ virtual const TQValueList<MyMoneyInstitution> 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<QString, unsigned long> transactionCountMap(void) const;
+ virtual const TQMap<TQString, unsigned long> 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<MyMoneyTransaction>
+ * @return set of transactions in form of a TQValueList<MyMoneyTransaction>
*/
- virtual const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const;
+ virtual const TQValueList<MyMoneyTransaction> 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<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const;
+ virtual void transactionList(TQValueList<MyMoneyTransaction>& 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<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const;
+ virtual void transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& 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<MyMoneyAccount>& list) const;
+ virtual void accountList(TQValueList<MyMoneyAccount>& 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<MyMoneySecurity> containing objects
+ * @return TQValueList<MyMoneySecurity> containing objects
*/
- virtual const QValueList<MyMoneySecurity> securityList(void) const;
+ virtual const TQValueList<MyMoneySecurity> 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<MyMoneySchedule> list of schedule objects.
+ * @return const TQValueList<MyMoneySchedule> list of schedule objects.
*/
- virtual const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(),
+ virtual const TQValueList<MyMoneySchedule> 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<MyMoneySchedule> scheduleListEx( int scheduleTypes,
+ virtual const TQValueList<MyMoneySchedule> 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<MyMoneySecurity> currencyList(void) const;
+ virtual const TQValueList<MyMoneySecurity> 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<MyMoneyReport> reportList( void ) const;
+ virtual const TQValueList<MyMoneyReport> 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<MyMoneyBudget> budgetList( void ) const;
+ virtual const TQValueList<MyMoneyBudget> 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<QString, MyMoneyAccount>& map);
- virtual void loadTransactions(const QMap<QString, MyMoneyTransaction>& map);
- virtual void loadInstitutions(const QMap<QString, MyMoneyInstitution>& map);
- virtual void loadPayees(const QMap<QString, MyMoneyPayee>& map);
- virtual void loadSchedules(const QMap<QString, MyMoneySchedule>& map);
- virtual void loadSecurities(const QMap<QString, MyMoneySecurity>& map);
- virtual void loadCurrencies(const QMap<QString, MyMoneySecurity>& map);
- virtual void loadReports( const QMap<QString, MyMoneyReport>& reports );
- virtual void loadBudgets( const QMap<QString, MyMoneyBudget>& budgets );
+ virtual bool isDuplicateTransaction(const TQString&) const;
+
+ virtual void loadAccounts(const TQMap<TQString, MyMoneyAccount>& map);
+ virtual void loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map);
+ virtual void loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map);
+ virtual void loadPayees(const TQMap<TQString, MyMoneyPayee>& map);
+ virtual void loadSchedules(const TQMap<TQString, MyMoneySchedule>& map);
+ virtual void loadSecurities(const TQMap<TQString, MyMoneySecurity>& map);
+ virtual void loadCurrencies(const TQMap<TQString, MyMoneySecurity>& map);
+ virtual void loadReports( const TQMap<TQString, MyMoneyReport>& reports );
+ virtual void loadBudgets( const TQMap<TQString, MyMoneyBudget>& 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<QString, QString> containing all key/value pairs of
+ * @return TQMap<TQString, TQString> containing all key/value pairs of
* this container.
*/
- virtual const QMap<QString, QString> pairs(void) const;
+ virtual const TQMap<TQString, TQString> 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<QString, QString> containing the set of
+ * @param list const TQMap<TQString, TQString> 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<QString, QString>& list);
+ virtual void setPairs(const TQMap<TQString, TQString>& 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<MyMoneyAccount> accList;
+ TQValueList<MyMoneyAccount> 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 <MyMoneyStorageSql> sql = m->connectToDatabase(m_url);
CPPUNIT_ASSERT(0 != sql);
@@ -118,8 +118,8 @@ void MyMoneyDatabaseMgrTest::testAttachDb() {
MyMoneyFile::instance()->detachStorage();
KSharedPtr <MyMoneyStorageSql> 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<MyMoneyAccount> accList;
+ TQValueList<MyMoneyAccount> 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<MyMoneyAccount> accList;
+ TQValueList<MyMoneyAccount> 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<QString, QString>::ConstIterator it_k;
+ //TQMap<TQString, TQString>::ConstIterator it_k;
MyMoneyTransactionFilter f;
- QValueList<MyMoneyTransaction> transactionList (m->transactionList(f));
- QValueList<MyMoneyTransaction>::ConstIterator it_t (transactionList.begin());
+ TQValueList<MyMoneyTransaction> transactionList (m->transactionList(f));
+ TQValueList<MyMoneyTransaction>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
MyMoneyTransactionFilter filter("A000006");
list = m->transactionList(filter);
CPPUNIT_ASSERT(list.size() == 2);
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::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<QString, QString>::ConstIterator it_k;
+ //TQMap<TQString, TQString>::ConstIterator it_k;
MyMoneyTransactionFilter f;
- QValueList<MyMoneyTransaction> transactionList (m->transactionList(f));
- QValueList<MyMoneyTransaction>::ConstIterator it_t (transactionList.begin());
+ TQValueList<MyMoneyTransaction> transactionList (m->transactionList(f));
+ TQValueList<MyMoneyTransaction>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
MyMoneyTransactionFilter filter("A000006");
list = m->transactionList(filter);
CPPUNIT_ASSERT(list.size() == 2);
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> 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<MyMoneySchedule> list;
+ TQValueList<MyMoneySchedule> 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<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> 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 <stdint.h>
-#include <qmap.h>
-#include <qptrstack.h>
+#include <tqmap.h>
+#include <tqptrstack.h>
#include <kmymoney/mymoneyexception.h>
#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 Key, class T>
-class MyMoneyMap : protected QMap<Key, T>
+class MyMoneyMap : protected TQMap<Key, T>
{
public:
- // typedef QMapConstIterator<Key, T> const_iterator;
+ // typedef TQMapConstIterator<Key, T> const_iterator;
- MyMoneyMap() : QMap<Key, T>() {}
+ MyMoneyMap() : TQMap<Key, T>() {}
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<Key, T>& operator= (const QMap<Key, T>& m)
+ MyMoneyMap<Key, T>& operator= (const TQMap<Key, T>& m)
{
if(m_stack.count() != 0) {
throw new MYMONEYEXCEPTION("Cannot assign whole container during transaction");
}
- QMap<Key, T>::operator=(m);
+ TQMap<Key, T>::operator=(m);
return *this;
}
- inline QValueList<T> values(void) const
+ inline TQValueList<T> values(void) const
{
- return QMap<Key,T>::values();
+ return TQMap<Key,T>::values();
}
- inline QValueList<Key> keys(void) const
+ inline TQValueList<Key> keys(void) const
{
- return QMap<Key,T>::keys();
+ return TQMap<Key,T>::keys();
}
const T& operator[] ( const Key& k ) const
- { QT_CHECK_INVALID_MAP_ELEMENT; return QMap<Key,T>::operator[](k); }
+ { TQT_CHECK_INVALID_MAP_ELEMENT; return TQMap<Key,T>::operator[](k); }
- inline Q_TYPENAME QMap<Key, T>::const_iterator find(const Key& k) const
+ inline TQ_TYPENAME TQMap<Key, T>::const_iterator tqfind(const Key& k) const
{
- return QMap<Key,T>::find(k);
+ return TQMap<Key,T>::tqfind(k);
}
- inline Q_TYPENAME QMap<Key, T>::const_iterator begin(void) const
+ inline TQ_TYPENAME TQMap<Key, T>::const_iterator begin(void) const
{
- return QMap<Key,T>::begin();
+ return TQMap<Key,T>::begin();
}
- inline Q_TYPENAME QMap<Key, T>::const_iterator end(void) const
+ inline TQ_TYPENAME TQMap<Key, T>::const_iterator end(void) const
{
- return QMap<Key,T>::end();
+ return TQMap<Key,T>::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<Key, T>& that) const
+ inline void map(TQMap<Key, T>& that) const
{
- //QMap<Key, T>* ptr = dynamic_cast<QMap<Key, T>* >(this);
+ //TQMap<Key, T>* ptr = dynamic_cast<TQMap<Key, T>* >(this);
//that = *ptr;
- that = *(dynamic_cast<QMap<Key, T>* >(const_cast<MyMoneyMap<Key, T>* >(this)));
+ that = *(dynamic_cast<TQMap<Key, T>* >(const_cast<MyMoneyMap<Key, T>* >(this)));
}
inline size_t count(void) const
{
- return QMap<Key, T>::count();
+ return TQMap<Key, T>::count();
}
#if MY_OWN_DEBUG
@@ -173,10 +173,10 @@ private:
class MyMoneyMapAction
{
public:
- MyMoneyMapAction(QMap<Key, T>* container) :
+ MyMoneyMapAction(TQMap<Key, T>* container) :
m_container(container) {}
- MyMoneyMapAction(QMap<Key, T>* container, const Key& key, const T& obj) :
+ MyMoneyMapAction(TQMap<Key, T>* 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<Key, T>* m_container;
+ TQMap<Key, T>* m_container;
T m_obj;
Key m_key;
};
@@ -193,7 +193,7 @@ private:
class MyMoneyMapStart : public MyMoneyMapAction
{
public:
- MyMoneyMapStart(QMap<Key, T>* container, unsigned long* id) :
+ MyMoneyMapStart(TQMap<Key, T>* container, unsigned long* id) :
MyMoneyMapAction(container),
m_idPtr(id)
{
@@ -215,7 +215,7 @@ private:
class MyMoneyMapInsert : public MyMoneyMapAction
{
public:
- MyMoneyMapInsert(QMap<Key, T>* container, const Key& key, const T& obj) :
+ MyMoneyMapInsert(TQMap<Key, T>* 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<Key, T>* container, const Key& key) :
+ MyMoneyMapRemove(TQMap<Key, T>* container, const Key& key) :
MyMoneyMapAction(container, key, (*container)[key])
{
container->remove(key);
@@ -249,7 +249,7 @@ private:
class MyMoneyMapModify : public MyMoneyMapAction
{
public:
- MyMoneyMapModify(QMap<Key, T>* container, const Key& key, const T& obj) :
+ MyMoneyMapModify(TQMap<Key, T>* container, const Key& key, const T& obj) :
MyMoneyMapAction(container, key, (*container)[key])
{
(*container)[key] = obj;
@@ -263,7 +263,7 @@ private:
};
protected:
- QPtrStack<MyMoneyMapAction> m_stack;
+ TQPtrStack<MyMoneyMapAction> m_stack;
};
#if MY_OWN_DEBUG
@@ -271,15 +271,15 @@ protected:
#include <kmymoney/mymoneytransaction.h>
main()
{
- MyMoneyMap<QString, MyMoneyAccount> container;
- MyMoneyMap<QString, MyMoneyTransaction> ct;
+ MyMoneyMap<TQString, MyMoneyAccount> container;
+ MyMoneyMap<TQString, MyMoneyTransaction> ct;
MyMoneyAccount acc;
acc.setName("Test");
// this should not be possible
// container["a"] = acc;
- QValueList<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount> 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<QString, MyMoneyAccount>::ConstIterator it;
- it = container.find("001");
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it;
+ it = container.tqfind("001");
it = container.begin();
} catch(MyMoneyException *e) {
@@ -315,7 +315,7 @@ main()
delete e;
}
- QMap<QString, MyMoneyAccount> map;
+ TQMap<TQString, MyMoneyAccount> 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<QString, QString>;
+ m = new MyMoneyMap<TQString, TQString>;
}
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<QString, QString> *m;
+ MyMoneyMap<TQString, TQString> *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<QString, MyMoneyAccount> map;
+ TQMap<TQString, MyMoneyAccount> 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 <MyMoneyStorageSql> 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<MyMoneyAccount>& list) const
+void MyMoneySeqAccessMgr::accountList(TQValueList<MyMoneyAccount>& list) const
{
- QMap<QString, MyMoneyAccount>::ConstIterator it;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyPayee>::ConstIterator it;
- it = m_payeeList.find(id);
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyPayee>::ConstIterator it;
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneySchedule>::ConstIterator it_s;
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyPayee>::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<MyMoneyPayee> MyMoneySeqAccessMgr::payeeList(void) const
+const TQValueList<MyMoneyPayee> MyMoneySeqAccessMgr::payeeList(void) const
{
return m_payeeList.values();
}
-void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account)
+void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account)
{
- QMap<QString, MyMoneyAccount>::ConstIterator theParent;
- QMap<QString, MyMoneyAccount>::ConstIterator theChild;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator theParent;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneySplit>::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<QString, unsigned long> MyMoneySeqAccessMgr::transactionCountMap(void) const
+const TQMap<TQString, unsigned long> MyMoneySeqAccessMgr::transactionCountMap(void) const
{
- QMap<QString, unsigned long> map;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQMap<TQString, unsigned long> map;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneySplit>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyTransaction>::ConstIterator it;
+ TQMap<TQString, MyMoneyTransaction>::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<QString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution>::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<MyMoneyInstitution> MyMoneySeqAccessMgr::institutionList(void) const
+const TQValueList<MyMoneyInstitution> MyMoneySeqAccessMgr::institutionList(void) const
{
return m_institutionList.values();
}
void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck)
{
- QMap<QString, MyMoneyAccount>::ConstIterator pos;
+ TQMap<TQString, MyMoneyAccount>::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<QString>::ConstIterator it_a;
+ TQValueList<TQString>::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<QString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::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<QString, MyMoneyAccount>::ConstIterator oldParent;
- QMap<QString, MyMoneyAccount>::ConstIterator newParent;
- QMap<QString, MyMoneyAccount>::ConstIterator childAccount;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator oldParent;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator newParent;
+ TQMap<TQString, MyMoneyAccount>::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<QString, QString>::ConstIterator it_k;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, TQString>::ConstIterator it_k;
+ TQMap<TQString, MyMoneyTransaction>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyAccount>::ConstIterator it_a;
- QMap<QString, MyMoneyAccount>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it_a;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyInstitution>::ConstIterator it_i;
+ TQMap<TQString, MyMoneyInstitution>::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<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
+void MyMoneySeqAccessMgr::transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::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<MyMoneyTransaction>& list,
}
}
-void MyMoneySeqAccessMgr::transactionList(QValueList< QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
+void MyMoneySeqAccessMgr::transactionList(TQValueList< TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
if(filter.match(*it_t)) {
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::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<MyMoneyTransaction> MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const
+const TQValueList<MyMoneyTransaction> MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const
{
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> 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<QString, MyMoneyAccount>::ConstIterator acc;
+ TQMap<TQString, MyMoneyAccount>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> 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<QString, MyMoneyMoney> balances;
- QMap<QString, MyMoneyMoney>::ConstIterator it_b;
+ TQMap<TQString, MyMoneyMoney> balances;
+ TQMap<TQString, MyMoneyMoney>::ConstIterator it_b;
if (date != m_balanceCacheDate) {
m_balanceCache.clear();
m_balanceCacheDate = date;
}
- QValueList<MyMoneyTransaction> list;
- QValueList<MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyAccount>::ConstIterator it_a;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyTransaction>::Iterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyTransaction>::Iterator it_t;
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyAccount>::Iterator acc;
- acc = m_accountList.find(oldAccount);
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyAccount>& map)
+void MyMoneySeqAccessMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& map)
{
m_accountList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyAccount>::const_iterator it_a;
- QString lastId("");
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyTransaction>& map)
+void MyMoneySeqAccessMgr::loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map)
{
m_transactionList = map;
// now fill the key map and
// identify the last used id
- QString lastId("");
- QMap<QString, QString> keys;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQString lastId("");
+ TQMap<TQString, TQString> keys;
+ TQMap<TQString, MyMoneyTransaction>::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<QString, MyMoneyTransactio
m_transactionKeys = keys;
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextTransactionID = atol(lastId.mid(pos));
}
}
-void MyMoneySeqAccessMgr::loadInstitutions(const QMap<QString, MyMoneyInstitution>& map)
+void MyMoneySeqAccessMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map)
{
m_institutionList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyInstitution>::const_iterator it_i;
- QString lastId("");
+ TQMap<TQString, MyMoneyInstitution>::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<QString, MyMoneyPayee>& map)
+void MyMoneySeqAccessMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& map)
{
m_payeeList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyPayee>::const_iterator it_p;
- QString lastId("");
+ TQMap<TQString, MyMoneyPayee>::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<QString, MyMoneyPayee>& 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<QString, MyMoneySecurity>& map)
+void MyMoneySeqAccessMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>& map)
{
m_securitiesList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneySecurity>::const_iterator it_s;
- QString lastId("");
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity>& map)
+void MyMoneySeqAccessMgr::loadCurrencies(const TQMap<TQString, MyMoneySecurity>& 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<QString, QString> MyMoneySeqAccessMgr::pairs(void) const
+const TQMap<TQString, TQString> MyMoneySeqAccessMgr::pairs(void) const
{
return MyMoneyKeyValueContainer::pairs();
}
-void MyMoneySeqAccessMgr::setPairs(const QMap<QString, QString>& list)
+void MyMoneySeqAccessMgr::setPairs(const TQMap<TQString, TQString>& list)
{
MyMoneyKeyValueContainer::setPairs(list);
touch();
@@ -1194,11 +1194,11 @@ void MyMoneySeqAccessMgr::addSchedule(MyMoneySchedule& sched)
void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched)
{
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule>::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<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule>::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<QString, MyMoneySchedule>::ConstIterator pos;
+ TQMap<TQString, MyMoneySchedule>::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<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList(
- const QString& accountId,
+const TQValueList<MyMoneySchedule> 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<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
// qDebug("scheduleList()");
@@ -1270,8 +1270,8 @@ const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList(
if(!accountId.isEmpty()) {
MyMoneyTransaction t = (*pos).transaction();
- QValueList<MyMoneySplit>::ConstIterator it;
- QValueList<MyMoneySplit> splits;
+ TQValueList<MyMoneySplit>::ConstIterator it;
+ TQValueList<MyMoneySplit> splits;
splits = t.splits();
for(it = splits.begin(); it != splits.end(); ++it) {
if((*it).accountId() == accountId)
@@ -1311,19 +1311,19 @@ const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList(
return list;
}
-void MyMoneySeqAccessMgr::loadSchedules(const QMap<QString, MyMoneySchedule>& map)
+void MyMoneySeqAccessMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>& map)
{
m_scheduleList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneySchedule>::const_iterator it_s;
- QString lastId("");
+ TQMap<TQString, MyMoneySchedule>::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<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes,
+const TQValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes,
int scheduleOcurrences,
int schedulePaymentTypes,
- QDate date,
- const QStringList& accounts) const
+ TQDate date,
+ const TQStringList& accounts) const
{
// qDebug("scheduleListEx");
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
if (!date.isValid())
return list;
@@ -1370,7 +1370,7 @@ const QValueList<MyMoneySchedule> 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<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity>::ConstIterator it = m_securitiesList.find(id);
+ TQMap<TQString, MyMoneySecurity>::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<MyMoneySecurity> MyMoneySeqAccessMgr::securityList(void) const
+const TQValueList<MyMoneySecurity> 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<MyMoneySecurity> MyMoneySeqAccessMgr::securityList(void) const
void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency)
{
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::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<MyMoneySecurity> MyMoneySeqAccessMgr::currencyList(void) const
+const TQValueList<MyMoneySecurity> MyMoneySeqAccessMgr::currencyList(void) const
{
return m_currencyList.values();
}
-const QValueList<MyMoneyReport> MyMoneySeqAccessMgr::reportList(void) const
+const TQValueList<MyMoneyReport> MyMoneySeqAccessMgr::reportList(void) const
{
return m_reportList.values();
}
@@ -1513,19 +1513,19 @@ void MyMoneySeqAccessMgr::addReport( MyMoneyReport& report )
report = newReport;
}
-void MyMoneySeqAccessMgr::loadReports(const QMap<QString, MyMoneyReport>& map)
+void MyMoneySeqAccessMgr::loadReports(const TQMap<TQString, MyMoneyReport>& map)
{
m_reportList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyReport>::const_iterator it_r;
- QString lastId("");
+ TQMap<TQString, MyMoneyReport>::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<QString, MyMoneyReport>& map)
void MyMoneySeqAccessMgr::modifyReport( const MyMoneyReport& report )
{
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport>::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<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport>::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<MyMoneyBudget> MyMoneySeqAccessMgr::budgetList(void) const
+const TQValueList<MyMoneyBudget> MyMoneySeqAccessMgr::budgetList(void) const
{
return m_budgetList.values();
}
@@ -1587,27 +1587,27 @@ void MyMoneySeqAccessMgr::addBudget( MyMoneyBudget& budget )
budget = newBudget;
}
-void MyMoneySeqAccessMgr::loadBudgets(const QMap<QString, MyMoneyBudget>& map)
+void MyMoneySeqAccessMgr::loadBudgets(const TQMap<TQString, MyMoneyBudget>& map)
{
m_budgetList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
- QString lastId("");
+ TQMap<TQString, MyMoneyBudget>::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<QString, MyMoneyBudget>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyBudget>::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<QString, MyMoneyBudget>::ConstIterator it;
+ TQMap<TQString, MyMoneyBudget>::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<QString, MyMoneyBudget>::ConstIterator it;
+ TQMap<TQString, MyMoneyBudget>::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<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
- it_m = m_priceList.find(pricePair);
+ TQMap<MyMoneySecurityPair, MyMoneyPriceEntries>::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<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
- it_m = m_priceList.find(pricePair);
+ TQMap<MyMoneySecurityPair, MyMoneyPriceEntries>::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<QString, MyMoneyAccount> map;
+ TQMap<TQString, MyMoneyAccount> map;
m_accountList.map(map);
- QMap<QString, MyMoneyAccount>::iterator it_a;
+ TQMap<TQString, MyMoneyAccount>::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<QString, MyMoneyTransaction>::const_iterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::const_iterator it_t;
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
- const QValueList<MyMoneySplit>& splits = (*it_t).splits();
- QValueList<MyMoneySplit>::const_iterator it_s = splits.begin();
+ const TQValueList<MyMoneySplit>& splits = (*it_t).splits();
+ TQValueList<MyMoneySplit>::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<QString, MyMoneyTransaction>::const_iterator it_t;
- QMap<QString, MyMoneyAccount>::const_iterator it_a;
- QMap<QString, MyMoneyInstitution>::const_iterator it_i;
- QMap<QString, MyMoneyPayee>::const_iterator it_p;
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
- QMap<QString, MyMoneySchedule>::const_iterator it_sch;
- QMap<QString, MyMoneySecurity>::const_iterator it_sec;
+ const TQString& id = obj.id();
+ TQMap<TQString, MyMoneyTransaction>::const_iterator it_t;
+ TQMap<TQString, MyMoneyAccount>::const_iterator it_a;
+ TQMap<TQString, MyMoneyInstitution>::const_iterator it_i;
+ TQMap<TQString, MyMoneyPayee>::const_iterator it_p;
+ TQMap<TQString, MyMoneyBudget>::const_iterator it_b;
+ TQMap<TQString, MyMoneySchedule>::const_iterator it_sch;
+ TQMap<TQString, MyMoneySecurity>::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<QString, MyMoneyReport>::const_iterator it_r;
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
+ TQMap<TQString, MyMoneyReport>::const_iterator it_r;
+ TQMap<TQString, MyMoneyBudget>::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<MyMoneyPayee> containing the payee information
+ * @return TQValueList<MyMoneyPayee> containing the payee information
*/
- const QValueList<MyMoneyPayee> payeeList(void) const;
+ const TQValueList<MyMoneyPayee> 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<MyMoneyInstitution> institutionList(void) const;
+ const TQValueList<MyMoneyInstitution> 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<MyMoneyAccount>& list) const;
+ void accountList(TQValueList<MyMoneyAccount>& 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<MyMoneyTransaction>
+ * @return set of transactions in form of a TQValueList<MyMoneyTransaction>
*/
- void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const;
+ void transactionList(TQValueList<MyMoneyTransaction>& 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<QPair<MyMoneyTransaction,MyMoneySplit> >
+ * @return set of transactions in form of a TQValueList<TQPair<MyMoneyTransaction,MyMoneySplit> >
*/
- void transactionList(QValueList< QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const;
+ void transactionList(TQValueList< TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const;
/**
* Compatibility interface for the previous method.
*/
- const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const;
+ const TQValueList<MyMoneyTransaction> 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<QString, unsigned long> transactionCountMap(void) const;
+ const TQMap<TQString, unsigned long> 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<QString, MyMoneyAccount>& acc);
- virtual void loadTransactions(const QMap<QString, MyMoneyTransaction>& map);
- virtual void loadInstitutions(const QMap<QString, MyMoneyInstitution>& map);
- virtual void loadPayees(const QMap<QString, MyMoneyPayee>& map);
- virtual void loadSchedules(const QMap<QString, MyMoneySchedule>& map);
- virtual void loadSecurities(const QMap<QString, MyMoneySecurity>& map);
- virtual void loadCurrencies(const QMap<QString, MyMoneySecurity>& map);
+ virtual void loadAccounts(const TQMap<TQString, MyMoneyAccount>& acc);
+ virtual void loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map);
+ virtual void loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map);
+ virtual void loadPayees(const TQMap<TQString, MyMoneyPayee>& map);
+ virtual void loadSchedules(const TQMap<TQString, MyMoneySchedule>& map);
+ virtual void loadSecurities(const TQMap<TQString, MyMoneySecurity>& map);
+ virtual void loadCurrencies(const TQMap<TQString, MyMoneySecurity>& 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<QString, QString> pairs(void) const;
+ const TQMap<TQString, TQString> pairs(void) const;
// documented in IMyMoneySerialize base class
- void setPairs(const QMap<QString, QString>& list);
+ void setPairs(const TQMap<TQString, TQString>& 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<MyMoneySecurity> securityList(void) const;
+ const TQValueList<MyMoneySecurity> 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<MyMoneySecurity> currencyList(void) const;
+ const TQValueList<MyMoneySecurity> 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<MyMoneySchedule> list of schedule objects.
+ * @return const TQValueList<MyMoneySchedule> list of schedule objects.
*/
- const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(),
+ const TQValueList<MyMoneySchedule> 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<MyMoneySchedule> scheduleListEx( int scheduleTypes,
+ const TQValueList<MyMoneySchedule> 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<MyMoneyReport> reportList( void ) const;
+ const TQValueList<MyMoneyReport> 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<QString, MyMoneyReport>& reports );
+ void loadReports( const TQMap<TQString, MyMoneyReport>& 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<MyMoneyBudget> budgetList( void ) const;
+ const TQValueList<MyMoneyBudget> 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<QString, MyMoneyBudget>& budgets);
+ void loadBudgets(const TQMap<TQString, MyMoneyBudget>& 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<QString, MyMoneyInstitution> m_institutionList;
+ MyMoneyMap<TQString, MyMoneyInstitution> m_institutionList;
/**
* The member variable m_accountList is the container for the accounts
* known within this file.
*/
- MyMoneyMap<QString, MyMoneyAccount> m_accountList;
+ MyMoneyMap<TQString, MyMoneyAccount> m_accountList;
/**
* The member variable m_balanceCache is the container for the
* accounts actual balance
*/
- mutable QMap<QString, MyMoneyBalanceCacheItem> m_balanceCache;
+ mutable TQMap<TQString, MyMoneyBalanceCacheItem> 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<QString, MyMoneyTransaction> m_transactionList;
+ MyMoneyMap<TQString, MyMoneyTransaction> 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<QString, QString> m_transactionKeys;
+ MyMoneyMap<TQString, TQString> m_transactionKeys;
/**
* A list containing all the payees that have been used
*/
- MyMoneyMap<QString, MyMoneyPayee> m_payeeList;
+ MyMoneyMap<TQString, MyMoneyPayee> m_payeeList;
/**
* A list containing all the scheduled transactions
*/
- MyMoneyMap<QString, MyMoneySchedule> m_scheduleList;
+ MyMoneyMap<TQString, MyMoneySchedule> 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<QString, MyMoneySecurity> m_securitiesList;
+ MyMoneyMap<TQString, MyMoneySecurity> m_securitiesList;
/**
* A list containing all the currency information objects.
*/
- MyMoneyMap<QString, MyMoneySecurity> m_currencyList;
+ MyMoneyMap<TQString, MyMoneySecurity> m_currencyList;
- MyMoneyMap<QString, MyMoneyReport> m_reportList;
+ MyMoneyMap<TQString, MyMoneyReport> m_reportList;
/**
* A list containing all the budget information objects.
*/
- MyMoneyMap<QString, MyMoneyBudget> m_budgetList;
+ MyMoneyMap<TQString, MyMoneyBudget> m_budgetList;
MyMoneyMap<MyMoneySecurityPair, MyMoneyPriceEntries> 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<QString, QString>::ConstIterator it_k;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, TQString>::ConstIterator it_k;
+ TQMap<TQString, MyMoneyTransaction>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
MyMoneyTransactionFilter filter("A000006");
list = m->transactionList(filter);
CPPUNIT_ASSERT(list.size() == 2);
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::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<MyMoneyAccount::Transaction>::ConstIterator it_l;
+ TQValueList<MyMoneyAccount::Transaction>::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<QString, QString>::ConstIterator it_k;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, TQString>::ConstIterator it_k;
+ TQMap<TQString, MyMoneyTransaction>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
MyMoneyTransactionFilter filter("A000006");
list = m->transactionList(filter);
CPPUNIT_ASSERT(list.size() == 2);
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::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<MyMoneyAccount::Transaction>::ConstIterator it_l;
+ TQValueList<MyMoneyAccount::Transaction>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> 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<MyMoneySchedule> list;
+ TQValueList<MyMoneySchedule> 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<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> accounts;
m->accountList(accounts);
CPPUNIT_ASSERT(accounts.count() == 0);
testAddNewAccount();
@@ -1628,7 +1628,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions()
m->rollbackTransaction();
// account loader
- QMap<QString, MyMoneyAccount> amap;
+ TQMap<TQString, MyMoneyAccount> 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<QString, MyMoneyTransaction> tmap;
+ TQMap<TQString, MyMoneyTransaction> 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<QString, MyMoneyInstitution> imap;
+ TQMap<TQString, MyMoneyInstitution> 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<QString, MyMoneyPayee> pmap;
+ TQMap<TQString, MyMoneyPayee> 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<QString, MyMoneySecurity> smap;
+ TQMap<TQString, MyMoneySecurity> 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<QString, MyMoneySchedule> schmap;
+ TQMap<TQString, MyMoneySchedule> 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<QString, MyMoneyReport> rmap;
+ TQMap<TQString, MyMoneyReport> 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<QString, MyMoneyBudget> bmap;
+ TQMap<TQString, MyMoneyBudget> 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 <cppunit/TestCaller.h>
#include <cppunit/TestCase.h>
@@ -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 <qfile.h>
-#include <qdom.h>
-#include <qmap.h>
+#include <tqfile.h>
+#include <tqdom.h>
+#include <tqmap.h>
// ----------------------------------------------------------------------------
// 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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<QString, QString> pairs;
- QMap<QString, QString>::const_iterator it;
+ TQMap<TQString, TQString> pairs;
+ TQMap<TQString, TQString>::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<MyMoneyBudget::AccountGroup> list = bx.getaccounts();
- QValueList<MyMoneyBudget::AccountGroup>::iterator it;
+ TQValueList<MyMoneyBudget::AccountGroup> list = bx.getaccounts();
+ TQValueList<MyMoneyBudget::AccountGroup>::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<QDate, MyMoneyBudget::PeriodGroup> plist = (*it).getPeriods();
- QMap<QDate, MyMoneyBudget::PeriodGroup>::const_iterator it_p;
+ TQMap<TQDate, MyMoneyBudget::PeriodGroup> plist = (*it).getPeriods();
+ TQMap<TQDate, MyMoneyBudget::PeriodGroup>::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 <qdom.h>
-// #include <qdatastream.h>
-// class QIODevice;
+// #include <tqdom.h>
+// #include <tqdatastream.h>
+// 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 <qstring.h>
-#include <qdatetime.h>
-#include <qvaluelist.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
+#include <tqvaluelist.h>
+#include <tqstringlist.h>
// ----------------------------------------------------------------------------
// 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<IMyMoneyStorage *> (_storage);
MyMoneyPayee user = storage->user();
@@ -72,18 +72,18 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag
s << "Internal-Info\n";
s << "-------------\n";
- QValueList<MyMoneyAccount> list_a;
+ TQValueList<MyMoneyAccount> list_a;
storage->accountList(list_a);
s << "accounts = " << list_a.count() <<", next id = " << _storage->accountId() << "\n";
MyMoneyTransactionFilter filter;
filter.setReportAllSplits(false);
- QValueList<MyMoneyTransaction> list_t;
+ TQValueList<MyMoneyTransaction> list_t;
storage->transactionList(list_t, filter);
- QValueList<MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneyTransaction>::ConstIterator it_t;
s << "transactions = " << list_t.count() << ", next id = " << _storage->transactionId() << "\n";
- QMap<int,int> xferCount;
+ TQMap<int,int> xferCount;
for(it_t = list_t.begin(); it_t != list_t.end(); ++it_t) {
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<int,int>::ConstIterator it_cnt;
+ TQMap<int,int>::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<MyMoneyInstitution> list_i = storage->institutionList();
- QValueList<MyMoneyInstitution>::ConstIterator it_i;
+ TQValueList<MyMoneyInstitution> list_i = storage->institutionList();
+ TQValueList<MyMoneyInstitution>::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<MyMoneyPayee> list_p = storage->payeeList();
- QValueList<MyMoneyPayee>::ConstIterator it_p;
+ TQValueList<MyMoneyPayee> list_p = storage->payeeList();
+ TQValueList<MyMoneyPayee>::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<MyMoneyAccount>::ConstIterator it_a;
+ TQValueList<MyMoneyAccount>::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<MyMoneyCurrency> list_c = storage->currencyList();
- QValueList<MyMoneyCurrency>::ConstIterator it_c;
+ TQValueList<MyMoneyCurrency> list_c = storage->currencyList();
+ TQValueList<MyMoneyCurrency>::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<MyMoneySecurity> list_e = storage->securityList();
- QValueList<MyMoneySecurity>::ConstIterator it_e;
+ TQValueList<MyMoneySecurity> list_e = storage->securityList();
+ TQValueList<MyMoneySecurity>::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";
- QMap<QString, QString>kvp = (*it_e).pairs();
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString>kvp = (*it_e).pairs();
+ TQMap<TQString, TQString>::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<MyMoneySchedule> list_s = storage->scheduleList();
- QValueList<MyMoneySchedule>::ConstIterator it_s;
+ TQValueList<MyMoneySchedule> list_s = storage->scheduleList();
+ TQValueList<MyMoneySchedule>::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<QDate> list_d;
- QValueList<QDate>::ConstIterator it_d;
+ TQValueList<TQDate> list_d;
+ TQValueList<TQDate>::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<MyMoneyReport> list_r = storage->reportList();
- QValueList<MyMoneyReport>::ConstIterator it_r;
+ TQValueList<MyMoneyReport> list_r = storage->reportList();
+ TQValueList<MyMoneyReport>::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<QString, QString>::const_iterator it;
+ TQMap<TQString, TQString>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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 <qdatastream.h>
+#include <tqdatastream.h>
// ----------------------------------------------------------------------------
// 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 <qstring.h>
-#include <qdatetime.h>
-#include <qvaluelist.h>
-#include <qstringlist.h>
-#include <qiodevice.h>
-#include <qsqldriver.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
+#include <tqvaluelist.h>
+#include <tqstringlist.h>
+#include <tqiodevice.h>
+#include <tqsqldriver.h>
// ----------------------------------------------------------------------------
// 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<QSqlDatabase*>(db)) {
+ : TQSqlQuery (static_cast<TQSqlDatabase*>(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<IMyMoneyStorage*>(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<QString, QDateTime> tids;
+ TQMap<TQString, TQDateTime> tids;
while (q.next()) tids[q.value(0).toString()] = q.value(1).toDateTime();
- QMap<QString, QDateTime>::ConstIterator it;
+ TQMap<TQString, TQDateTime>::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<QString, unsigned long>::ConstIterator itm;
+ TQMap<TQString, unsigned long>::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<QString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) {
- q.prepare(QString("ALTER TABLE %1 ENGINE = InnoDB;").arg(tt.data().name()));
+ for (TQMapConstIterator<TQString, MyMoneyDbTable> 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<QString, MyMoneyReport> reportList =
+ TQMap<TQString, MyMoneyReport> 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<QString, MyMoneyReport>::const_iterator it_r;
+ TQMap<TQString, MyMoneyReport>::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 <MyMoneyStorageSql*> (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<QString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) {
- if (!lowerTables.contains(tt.key().lower())) createTable (tt.data());
+ for (TQMapConstIterator<TQString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) {
+ if (!lowerTables.tqcontains(tt.key().lower())) createTable (tt.data());
}
MyMoneySqlQuery q(this);
- for (QMapConstIterator<QString, MyMoneyDbView> tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) {
- if (!lowerTables.contains(tt.key().lower())) {
+ for (TQMapConstIterator<TQString, MyMoneyDbView> 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<QString, MyMoneyDbTable> tt = m_db.tableBegin();
+ TQMapConstIterator<TQString, MyMoneyDbTable> 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<QString, MyMoneyDbTable> it = m_db.tableBegin();
+ TQMapConstIterator<TQString, MyMoneyDbTable> 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<QString> user;
- user.append(QString("USER"));
+ TQValueList<TQString> 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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneyInstitution> list = m_storage->institutionList();
- QValueList<MyMoneyInstitution>::ConstIterator it;
+ const TQValueList<MyMoneyInstitution> list = m_storage->institutionList();
+ TQValueList<MyMoneyInstitution>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneyPayee> list = m_storage->payeeList();
- MyMoneyPayee user(QString("USER"), m_storage->user());
+ TQValueList<MyMoneyPayee> 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<MyMoneyPayee>::ConstIterator it;
+ TQValueList<MyMoneyPayee>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<unsigned int>(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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount> list;
m_storage->accountList(list);
- QValueList<MyMoneyAccount>::ConstIterator it;
+ TQValueList<MyMoneyAccount>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
m_storage->transactionList(list, filter);
signalProgress(0, list.count(), "Writing Transactions...");
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::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<MyMoneySplit> splitList = tx.splits();
+ TQValueList<MyMoneySplit> 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<MyMoneySplit>& splitList) {
+void MyMoneyStorageSql::writeSplits(const TQString& txId, const TQString& type, const TQValueList<MyMoneySplit>& splitList) {
DBG("*** Entering MyMoneyStorageSql::writeSplits");
// first, get a list of what's on the database (see writeInstitutions)
- QValueList<unsigned int> dbList;
+ TQValueList<unsigned int> 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<MyMoneySplit>::const_iterator it;
+ TQValueList<MyMoneySplit>::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<unsigned int>::const_iterator it = dbList.begin();
+ TQValueList<unsigned int>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneySchedule> list = m_storage->scheduleList();
- QValueList<MyMoneySchedule>::ConstIterator it;
+ const TQValueList<MyMoneySchedule> list = m_storage->scheduleList();
+ TQValueList<MyMoneySchedule>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<QDate> payments = sch.recordedPayments();
- QValueList<QDate>::ConstIterator it;
+ TQValueList<TQDate> payments = sch.recordedPayments();
+ TQValueList<TQDate>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneySecurity> securityList = m_storage->securityList();
+ const TQValueList<MyMoneySecurity> 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<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) {
- if (dbList.contains((*it).id())) {
+ for(TQValueList<MyMoneySecurity>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneySecurity> currencyList = m_storage->currencyList();
+ const TQValueList<MyMoneySecurity> 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<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) {
- if (dbList.contains((*it).id())) {
+ for(TQValueList<MyMoneySecurity>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneyReport> list = m_storage->reportList();
+ TQValueList<MyMoneyReport> list = m_storage->reportList();
signalProgress(0, list.count(), "Writing Reports...");
- QValueList<MyMoneyReport>::ConstIterator it;
+ TQValueList<MyMoneyReport>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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<QString> dbList;
+ TQValueList<TQString> 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<MyMoneyBudget> list = m_storage->budgetList();
+ TQValueList<MyMoneyBudget> list = m_storage->budgetList();
signalProgress(0, list.count(), "Writing Budgets...");
- QValueList<MyMoneyBudget>::ConstIterator it;
+ TQValueList<MyMoneyBudget>::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<QString>::const_iterator it = dbList.begin();
+ TQValueList<TQString>::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_<variable> 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<QString, QString>& pairs) {
+void MyMoneyStorageSql::writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap<TQString, TQString>& pairs) {
DBG("*** Entering MyMoneyStorageSql::writeKeyValuePairs");
- QMap<QString, QString>::const_iterator it;
+ TQMap<TQString, TQString>::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<QString, MyMoneyInstitution> iList = fetchInstitutions();
+ TQMap<TQString, MyMoneyInstitution> iList = fetchInstitutions();
m_storage->loadInstitutions(iList);
readFileInfo();
m_storage->loadInstitutionId(m_hiIdInstitutions);
PASS
}
-const QMap<QString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (const QStringList& idList, bool forUpdate) const {
+const TQMap<TQString, MyMoneyInstitution> 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<QString, MyMoneyInstitution> iList;
+ TQMap<TQString, MyMoneyInstitution> iList;
unsigned long lastId = 0;
const MyMoneyDbTable& t = m_db.m_tables["kmmInstitutions"];
MyMoneySqlQuery sq(const_cast <MyMoneyStorageSql*> (this));
sq.prepare ("SELECT id from kmmAccounts where institutionId = :id");
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneyInstitution> 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<QString, MyMoneyInstitution> 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<QString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (co
return iList;
}
-void MyMoneyStorageSql::readPayees (const QString& id) {
+void MyMoneyStorageSql::readPayees (const TQString& id) {
DBG("*** Entering MyMoneyStorageSql::readPayees");
- QValueList<QString> list;
+ TQValueList<TQString> list;
list.append(id);
readPayees(list);
}
-void MyMoneyStorageSql::readPayees(const QValueList<QString> pid) {
+void MyMoneyStorageSql::readPayees(const TQValueList<TQString> 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<QString> pid) {
// if (pid.isEmpty()) m_payeeListRead = true;
}
-const QMap<QString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const QStringList& idList, bool /*forUpdate*/) const {
+const TQMap<TQString, MyMoneyPayee> 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<QString, MyMoneyPayee> pList;
+ TQMap<TQString, MyMoneyPayee> pList;
//unsigned long lastId;
const MyMoneyDbTable& t = m_db.m_tables["kmmPayees"];
MyMoneyDbTable::field_iterator payeeEnd = t.end();
@@ -2432,26 +2424,26 @@ const QMap<QString, MyMoneyPayee> 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<QString, MyMoneyPayee> 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<QString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const QStringList& idList, bool forUpdate) const {
+const TQMap<TQString, MyMoneyAccount> 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<QString, MyMoneyAccount> accList;
- QStringList kvpAccountList;
+ TQMap<TQString, MyMoneyAccount> accList;
+ TQStringList kvpAccountList;
const MyMoneyDbTable& t = m_db.m_tables["kmmAccounts"];
MyMoneyDbTable::field_iterator accEnd = t.end();
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this));
MyMoneySqlQuery sq(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneyAccount> 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<QString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const QStr
signalProgress(++progress, 0);
}
- QMapIterator<QString, MyMoneyAccount> it_acc;
- QMapIterator<QString, MyMoneyAccount> accListEnd = accList.end();
+ TQMapIterator<TQString, MyMoneyAccount> it_acc;
+ TQMapIterator<TQString, MyMoneyAccount> 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<QString, MyMoneyAccount> 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 <QString, MyMoneyKeyValueContainer> kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList);
- QMap <QString, MyMoneyKeyValueContainer>::const_iterator kvp_end = kvpResult.end();
- for (QMap <QString, MyMoneyKeyValueContainer>::const_iterator it_kvp = kvpResult.begin();
+ TQMap <TQString, MyMoneyKeyValueContainer> kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList);
+ TQMap <TQString, MyMoneyKeyValueContainer>::const_iterator kvp_end = kvpResult.end();
+ for (TQMap <TQString, MyMoneyKeyValueContainer>::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 <QString, MyMoneyKeyValueContainer>::const_iterator it_kvp = kvpResult.begin();
+ for (TQMap <TQString, MyMoneyKeyValueContainer>::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<QString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const QStringList& idList, const QDate& date) const {
+const TQMap<TQString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const TQStringList& idList, const TQDate& date) const {
- QMap<QString, MyMoneyMoney> returnValue;
+ TQMap<TQString, MyMoneyMoney> returnValue;
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneyMoney> 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<QString, MyMoneyMoney> 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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const QString& tidList, const QString& dateClause, bool /*forUpdate*/) const {
+const TQMap<TQString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co
const MyMoneyDbTable& t = m_db.m_tables["kmmTransactions"];
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co
}
if (!dateClause.isEmpty()) whereClause += " and " + dateClause;
MyMoneySqlQuery qs(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co
} else {
splitTxId = "ZZZ";
}
- QMap <QString, MyMoneyTransaction> txMap;
- QStringList txList;
+ TQMap <TQString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co
txMap.insert(tx.uniqueSortKey(), tx);
}
}
- QMap <QString, MyMoneyKeyValueContainer> kvpMap = readKeyValuePairs("TRANSACTION", txList);
- QMap<QString, MyMoneyTransaction> tList;
- QMapIterator<QString, MyMoneyTransaction> txMapEnd = txMap.end();
- for (QMapIterator<QString, MyMoneyTransaction> i = txMap.begin();
+ TQMap <TQString, MyMoneyKeyValueContainer> kvpMap = readKeyValuePairs("TRANSACTION", txList);
+ TQMap<TQString, MyMoneyTransaction> tList;
+ TQMapIterator<TQString, MyMoneyTransaction> txMapEnd = txMap.end();
+ for (TQMapIterator<TQString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const {
+const TQMap<TQString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co
canImplementFilter = false;
}
if (!canImplementFilter) {
- QMap<QString, MyMoneyTransaction> transactionList = fetchTransactions();
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneyTransaction>::ConstIterator txListEnd = transactionList.end();
+ TQMap<TQString, MyMoneyTransaction> transactionList = fetchTransactions();
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator txListEnd = transactionList.end();
std::remove_if(transactionList.begin(), transactionList.end(), FilterFail(filter, m_storagePtr));
return transactionList;
@@ -2854,27 +2846,27 @@ const QMap<QString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co
}
// split states
- QValueList <int> splitStates;
+ TQValueList <int> splitStates;
if (filter.states(splitStates)) {
splitFilterActive = true;
- QString itemConnector = " reconcileFlag IN (";
- QString statesClause = "";
- for (QValueList<int>::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<int>::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<QString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> 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<QString, MyMoneyTransaction> 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<MyMoneySplit::reconcileFlagE>(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 <MyMoneyStorageSql*> (this));
q.prepare("SELECT COUNT(*) FROM kmmTransactions "
@@ -3030,13 +3022,13 @@ void MyMoneyStorageSql::readSchedules(void) {
PASS
}
-const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QStringList& idList, bool forUpdate) const {
+const TQMap<TQString, MyMoneySchedule> 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 <MyMoneyStorageSql*> (this));
- QMap<QString, MyMoneySchedule> sList;
+ TQMap<TQString, MyMoneySchedule> sList;
//unsigned long lastId = 0;
const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"];
MyMoneySqlQuery qs(const_cast <MyMoneyStorageSql*> (this));
@@ -3044,14 +3036,14 @@ const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS
MyMoneySqlQuery sq(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneySchedule> 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<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneySchedule> 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<QString, MyMoneySchedule> 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<QString, MyMoneySecurity> MyMoneyStorageSql::fetchSecurities (const QStringList& /*idList*/, bool /*forUpdate*/) const {
+const TQMap<TQString, MyMoneySecurity> 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<QString, MyMoneySecurity> sList;
+ TQMap<TQString, MyMoneySecurity> sList;
unsigned long lastId = 0;
const MyMoneyDbTable& t = m_db.m_tables["kmmSecurities"];
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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 <MyMoneyStorageSql*> (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 <MyMoneyStorageSql*> (this)->m_readingPrices = true;
MyMoneyPriceList pList;
const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"];
MyMoneyDbTable::field_iterator tableEnd = t.end();
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneySecurity> MyMoneyStorageSql::fetchCurrencies (const QStringList& idList, bool forUpdate) const {
+const TQMap<TQString, MyMoneySecurity> 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<QString, MyMoneySecurity> cList;
+ TQMap<TQString, MyMoneySecurity> cList;
const MyMoneyDbTable& t = m_db.m_tables["kmmCurrencies"];
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneySecurity> 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<MyMoneySecurity::eSECURITYTYPE>(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<QString, MyMoneyReport> MyMoneyStorageSql::fetchReports (const QStringList& /*idList*/, bool /*forUpdate*/) const {
+const TQMap<TQString, MyMoneyReport> 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 <MyMoneyStorageSql*> (this));
q.prepare (t.selectAllString(true));
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading reports")));
- QMap<QString, MyMoneyReport> rList;
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading reports")));
+ TQMap<TQString, MyMoneyReport> 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<QString, MyMoneyReport> MyMoneyStorageSql::fetchReports (const QStrin
return rList;
}
-const QMap<QString, MyMoneyBudget> MyMoneyStorageSql::fetchBudgets (const QStringList& idList, bool forUpdate) const {
+const TQMap<TQString, MyMoneyBudget> 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 <MyMoneyStorageSql*> (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<QString, MyMoneyBudget> MyMoneyStorageSql::fetchBudgets (const QStrin
queryString += ";";
q.prepare (queryString);
- if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading budgets")));
- QMap<QString, MyMoneyBudget> budgets;
+ if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading budgets")));
+ TQMap<TQString, MyMoneyBudget> 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 <MyMoneyStorageSql*> (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<QString, MyMoneyKeyValueContainer> MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const {
+const TQMap<TQString, MyMoneyKeyValueContainer> MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const {
DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs");
- QMap<QString, MyMoneyKeyValueContainer> retval;
+ TQMap<TQString, MyMoneyKeyValueContainer> retval;
MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (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<QString, MyMoneyKeyValueContainer> 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 <MyMoneyStorageSql*> (this)->m_error = s;
qDebug("%s", s.ascii());
@@ -3841,7 +3833,7 @@ MyMoneyDbDef::MyMoneyDbDef () {
//#define ISKEY true
void MyMoneyDbDef::FileInfo(void){
- QValueList<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<KSharedPtr <MyMoneyDbColumn> > fields;
+ TQValueList<KSharedPtr <MyMoneyDbColumn> > 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<MyMoneyAccount> stdList;
+ TQValueList<MyMoneyAccount> 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 <qsqldatabase.h>
-#include <qsqlquery.h>
-#include <qsqlerror.h>
-#include <qvaluestack.h>
+#include <tqsqldatabase.h>
+#include <tqsqlquery.h>
+#include <tqsqlerror.h>
+#include <tqvaluestack.h>
-class QIODevice;
+class TQIODevice;
// ----------------------------------------------------------------------------
// KDE Includes
@@ -56,7 +56,7 @@ class FilterFail {
m_storage (storage)
{}
- inline bool operator() (const QPair<QString, MyMoneyTransaction>& transactionPair)
+ inline bool operator() (const TQPair<TQString, MyMoneyTransaction>& 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<QString, QString> driverMap() const {return (m_driverMap);};
- databaseTypeE driverToType (const QString& driver) const;
+ const TQMap<TQString, TQString> driverMap() const {return (m_driverMap);};
+ databaseTypeE driverToType (const TQString& driver) const;
bool isTested (databaseTypeE dbType) const;
private:
- QMap<QString, QString> m_driverMap;
+ TQMap<TQString, TQString> 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<KSharedPtr <MyMoneyDbColumn> >& ifields,
- const QString& initVersion = "1.0"):
+ MyMoneyDbTable (const TQString& iname,
+ const TQValueList<KSharedPtr <MyMoneyDbColumn> >& 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<KSharedPtr <MyMoneyDbColumn> >::const_iterator field_iterator;
+ typedef TQValueList<KSharedPtr <MyMoneyDbColumn> >::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<KSharedPtr <MyMoneyDbColumn> > m_fields;
-
- typedef QValueList<MyMoneyDbIndex>::const_iterator index_iterator;
- QValueList<MyMoneyDbIndex> 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<KSharedPtr <MyMoneyDbColumn> > m_fields;
+
+ typedef TQValueList<MyMoneyDbIndex>::const_iterator index_iterator;
+ TQValueList<MyMoneyDbIndex> 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<QString, MyMoneyDbTable>::const_iterator table_iterator;
+ typedef TQMap<TQString, MyMoneyDbTable>::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<QString, MyMoneyDbView>::const_iterator view_iterator;
+ typedef TQMap<TQString, MyMoneyDbView>::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<QString, MyMoneyDbTable> m_tables;
- QMap<QString, MyMoneyDbView> m_views;
+ TQMap<TQString, MyMoneyDbTable> m_tables;
+ TQMap<TQString, MyMoneyDbView> 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<QString, unsigned long> transactionCountMap () const
+ unsigned long transactionCount (const TQString& aid = TQString()) const;
+ inline const TQMap<TQString, unsigned long> transactionCountMap () const
{return (m_transactionCountMap);};
/**
* the storage manager also needs the following read entry points
*/
- const QMap<QString, MyMoneyAccount> fetchAccounts (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneyMoney> fetchBalance(const QStringList& id, const QDate& date) const;
- const QMap<QString, MyMoneyBudget> fetchBudgets (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneySecurity> fetchCurrencies (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneyInstitution> fetchInstitutions (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneyPayee> 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<QString, MyMoneyReport> fetchReports (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneySchedule> fetchSchedules (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneySecurity> fetchSecurities (const QStringList& idList = QStringList (), bool forUpdate = false) const;
- const QMap<QString, MyMoneyTransaction> fetchTransactions (const QString& tidList = QString (), const QString& dateClause = QString(), bool forUpdate = false) const;
- const QMap<QString, MyMoneyTransaction> fetchTransactions (const MyMoneyTransactionFilter& filter) const;
- bool isReferencedByTransaction(const QString& id) const;
-
- void readPayees(const QString&);
- void readPayees(const QValueList<QString> payeeList = QValueList<QString>());
+ const TQMap<TQString, MyMoneyAccount> fetchAccounts (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneyMoney> fetchBalance(const TQStringList& id, const TQDate& date) const;
+ const TQMap<TQString, MyMoneyBudget> fetchBudgets (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneySecurity> fetchCurrencies (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneyInstitution> fetchInstitutions (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneyPayee> 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<TQString, MyMoneyReport> fetchReports (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneySchedule> fetchSchedules (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneySecurity> fetchSecurities (const TQStringList& idList = TQStringList (), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneyTransaction> fetchTransactions (const TQString& tidList = TQString (), const TQString& dateClause = TQString(), bool forUpdate = false) const;
+ const TQMap<TQString, MyMoneyTransaction> fetchTransactions (const MyMoneyTransactionFilter& filter) const;
+ bool isReferencedByTransaction(const TQString& id) const;
+
+ void readPayees(const TQString&);
+ void readPayees(const TQValueList<TQString> payeeList = TQValueList<TQString>());
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<MyMoneySplit>& 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<MyMoneySplit>& 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<QString, QString>& 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<TQString, TQString>& 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<QString, MyMoneyKeyValueContainer> readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const;
+ const MyMoneyKeyValueContainer readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const;
+ const TQMap<TQString, MyMoneyKeyValueContainer> 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<QString> m_accountsLoaded;
+// TQValueList<TQString> 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<QString> m_payeeList;
+// TQValueList<TQString> 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<QString> m_commitUnitStack;
+ TQValueStack<TQString> 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<QString, unsigned long> m_transactionCountMap;
+ TQMap<TQString, unsigned long> 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 <qfile.h>
-#include <qdom.h>
-#include <qmap.h>
-#include <qxml.h>
+#include <tqfile.h>
+#include <tqdom.h>
+#include <tqmap.h>
+#include <tqxml.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -52,49 +52,49 @@ class MyMoneyStorageXML::Private
public:
Private() {}
- QMap<QString, MyMoneyInstitution> iList;
- QMap<QString, MyMoneyAccount> aList;
- QMap<QString, MyMoneyTransaction> tList;
- QMap<QString, MyMoneyPayee> pList;
- QMap<QString, MyMoneySchedule> sList;
- QMap<QString, MyMoneySecurity> secList;
- QMap<QString, MyMoneyReport> rList;
- QMap<QString, MyMoneyBudget> bList;
- QMap<MyMoneySecurityPair, MyMoneyPriceEntries> prList;
+ TQMap<TQString, MyMoneyInstitution> iList;
+ TQMap<TQString, MyMoneyAccount> aList;
+ TQMap<TQString, MyMoneyTransaction> tList;
+ TQMap<TQString, MyMoneyPayee> pList;
+ TQMap<TQString, MyMoneySchedule> sList;
+ TQMap<TQString, MyMoneySecurity> secList;
+ TQMap<TQString, MyMoneyReport> rList;
+ TQMap<TQString, MyMoneyBudget> bList;
+ TQMap<MyMoneySecurityPair, MyMoneyPriceEntries> 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<MyMoneyInstitution> list = m_storage->institutionList();
- QValueList<MyMoneyInstitution>::ConstIterator it;
+ const TQValueList<MyMoneyInstitution> list = m_storage->institutionList();
+ TQValueList<MyMoneyInstitution>::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<MyMoneyPayee> list = m_storage->payeeList();
- QValueList<MyMoneyPayee>::ConstIterator it;
+ const TQValueList<MyMoneyPayee> list = m_storage->payeeList();
+ TQValueList<MyMoneyPayee>::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<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount> list;
m_storage->accountList(list);
- QValueList<MyMoneyAccount>::ConstIterator it;
+ TQValueList<MyMoneyAccount>::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<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
m_storage->transactionList(list, filter);
transactions.setAttribute("count", list.count());
- QValueList<MyMoneyTransaction>::ConstIterator it;
+ TQValueList<MyMoneyTransaction>::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<MyMoneySchedule> list = m_storage->scheduleList();
- QValueList<MyMoneySchedule>::ConstIterator it;
+ const TQValueList<MyMoneySchedule> list = m_storage->scheduleList();
+ TQValueList<MyMoneySchedule>::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<MyMoneySecurity> securityList = m_storage->securityList();
+ const TQValueList<MyMoneySecurity> securityList = m_storage->securityList();
equities.setAttribute("count", securityList.count());
if(securityList.size())
{
- for(QValueList<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it)
+ for(TQValueList<MyMoneySecurity>::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<MyMoneySecurity> currencyList = m_storage->currencyList();
+ const TQValueList<MyMoneySecurity> currencyList = m_storage->currencyList();
currencies.setAttribute("count", currencyList.count());
if(currencyList.size())
{
- for(QValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it)
+ for(TQValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it)
{
writeSecurity(currencies, (*it));
}
}
}
-void MyMoneyStorageXML::writeReports(QDomElement& parent)
+void MyMoneyStorageXML::writeReports(TQDomElement& tqparent)
{
- const QValueList<MyMoneyReport> list = m_storage->reportList();
- QValueList<MyMoneyReport>::ConstIterator it;
- parent.setAttribute("count", list.count());
+ const TQValueList<MyMoneyReport> list = m_storage->reportList();
+ TQValueList<MyMoneyReport>::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<MyMoneyBudget> list = m_storage->budgetList();
- QValueList<MyMoneyBudget>::ConstIterator it;
- parent.setAttribute("count", list.count());
+ const TQValueList<MyMoneyBudget> list = m_storage->budgetList();
+ TQValueList<MyMoneyBudget>::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<QString, QString> pairs)
+TQDomElement MyMoneyStorageXML::writeKeyValuePairs(const TQMap<TQString, TQString> pairs)
{
if(m_doc)
{
- QDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS");
+ TQDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS");
- QMap<QString, QString>::const_iterator it;
+ TQMap<TQString, TQString>::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 <qdom.h>
-#include <qdatastream.h>
-class QIODevice;
+#include <tqdom.h>
+#include <tqdatastream.h>
+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<QDomElement> readElements(QString groupTag, QString itemTag = QString());
+ TQValueList<TQDomElement> 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<QString, QString> pairs);
+ virtual TQDomElement writeKeyValuePairs(const TQMap<TQString, TQString> 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;
};