From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: TQt4 port kmymoney This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmymoney2/converter/convertertest.cpp | 78 +- kmymoney2/converter/imymoneyreader.h | 23 +- kmymoney2/converter/mymoneygncreader.cpp | 550 ++++---- kmymoney2/converter/mymoneygncreader.h | 326 ++--- kmymoney2/converter/mymoneyqifprofile.cpp | 266 ++-- kmymoney2/converter/mymoneyqifprofile.h | 123 +- kmymoney2/converter/mymoneyqifreader.cpp | 472 +++---- kmymoney2/converter/mymoneyqifreader.h | 89 +- kmymoney2/converter/mymoneyqifwriter.cpp | 58 +- kmymoney2/converter/mymoneyqifwriter.h | 29 +- kmymoney2/converter/mymoneystatementreader.cpp | 254 ++-- kmymoney2/converter/mymoneystatementreader.h | 21 +- kmymoney2/converter/mymoneytemplate.cpp | 142 +- kmymoney2/converter/mymoneytemplate.h | 42 +- kmymoney2/converter/webpricequote.cpp | 316 ++--- kmymoney2/converter/webpricequote.h | 132 +- kmymoney2/dialogs/investactivities.cpp | 90 +- kmymoney2/dialogs/investactivities.h | 44 +- kmymoney2/dialogs/investtransactioneditor.cpp | 254 ++-- kmymoney2/dialogs/investtransactioneditor.h | 35 +- kmymoney2/dialogs/kaccountselectdlg.cpp | 32 +- kmymoney2/dialogs/kaccountselectdlg.h | 25 +- kmymoney2/dialogs/kaccountselectdlgdecl.ui | 33 +- kmymoney2/dialogs/kbackupdlg.cpp | 24 +- kmymoney2/dialogs/kbackupdlg.h | 5 +- kmymoney2/dialogs/kbackupdlgdecl.ui | 26 +- kmymoney2/dialogs/kbalancechartdlg.cpp | 42 +- kmymoney2/dialogs/kbalancechartdlg.h | 3 +- kmymoney2/dialogs/kbalancewarning.cpp | 18 +- kmymoney2/dialogs/kbalancewarning.h | 13 +- kmymoney2/dialogs/kcategoryreassigndlg.cpp | 22 +- kmymoney2/dialogs/kcategoryreassigndlg.h | 11 +- kmymoney2/dialogs/kcategoryreassigndlgdecl.ui | 25 +- kmymoney2/dialogs/kchooseimportexportdlg.cpp | 34 +- kmymoney2/dialogs/kchooseimportexportdlg.h | 11 +- kmymoney2/dialogs/kchooseimportexportdlgdecl.ui | 30 +- kmymoney2/dialogs/kconfirmmanualenterdlg.cpp | 42 +- kmymoney2/dialogs/kconfirmmanualenterdlg.h | 3 +- kmymoney2/dialogs/kconfirmmanualenterdlgdecl.ui | 20 +- kmymoney2/dialogs/kcsvprogressdlg.cpp | 78 +- kmymoney2/dialogs/kcsvprogressdlg.h | 7 +- kmymoney2/dialogs/kcsvprogressdlgdecl.ui | 64 +- kmymoney2/dialogs/kcurrencycalculator.cpp | 74 +- kmymoney2/dialogs/kcurrencycalculator.h | 15 +- kmymoney2/dialogs/kcurrencycalculatordecl.ui | 72 +- kmymoney2/dialogs/kcurrencyeditdlg.cpp | 82 +- kmymoney2/dialogs/kcurrencyeditdlg.h | 17 +- kmymoney2/dialogs/kcurrencyeditdlgdecl.ui | 44 +- kmymoney2/dialogs/keditequityentrydecl.ui | 40 +- kmymoney2/dialogs/keditequityentrydlg.cpp | 34 +- kmymoney2/dialogs/keditequityentrydlg.h | 11 +- kmymoney2/dialogs/keditloanwizard.cpp | 66 +- kmymoney2/dialogs/keditloanwizard.h | 5 +- kmymoney2/dialogs/keditscheduledlg.cpp | 118 +- kmymoney2/dialogs/keditscheduledlg.h | 13 +- kmymoney2/dialogs/keditscheduledlgdecl.ui | 69 +- kmymoney2/dialogs/kendingbalancedlg.cpp | 108 +- kmymoney2/dialogs/kendingbalancedlg.h | 44 +- kmymoney2/dialogs/kendingbalancedlgdecl.ui | 143 +- kmymoney2/dialogs/kenterscheduledlg.cpp | 94 +- kmymoney2/dialogs/kenterscheduledlg.h | 7 +- kmymoney2/dialogs/kenterscheduledlgdecl.ui | 26 +- kmymoney2/dialogs/kequitypriceupdatedlg.cpp | 188 +-- kmymoney2/dialogs/kequitypriceupdatedlg.h | 25 +- kmymoney2/dialogs/kequitypriceupdatedlgdecl.ui | 24 +- kmymoney2/dialogs/kexportdlg.cpp | 92 +- kmymoney2/dialogs/kexportdlg.h | 41 +- kmymoney2/dialogs/kexportdlgdecl.ui | 64 +- kmymoney2/dialogs/kfindtransactiondlg.cpp | 236 ++-- kmymoney2/dialogs/kfindtransactiondlg.h | 47 +- kmymoney2/dialogs/kfindtransactiondlgdecl.ui | 155 +-- kmymoney2/dialogs/kgncimportoptionsdlg.cpp | 30 +- kmymoney2/dialogs/kgncimportoptionsdlg.h | 21 +- kmymoney2/dialogs/kgncimportoptionsdlgdecl.ui | 70 +- kmymoney2/dialogs/kgncpricesourcedlg.cpp | 30 +- kmymoney2/dialogs/kgncpricesourcedlg.h | 9 +- kmymoney2/dialogs/kgncpricesourcedlgdecl.ui | 46 +- kmymoney2/dialogs/kgpgkeyselectiondlg.cpp | 38 +- kmymoney2/dialogs/kgpgkeyselectiondlg.h | 7 +- kmymoney2/dialogs/kimportdlg.cpp | 62 +- kmymoney2/dialogs/kimportdlg.h | 25 +- kmymoney2/dialogs/kimportdlgdecl.ui | 24 +- kmymoney2/dialogs/kloadtemplatedlg.cpp | 8 +- kmymoney2/dialogs/kloadtemplatedlg.h | 5 +- kmymoney2/dialogs/kloadtemplatedlgdecl.ui | 13 +- kmymoney2/dialogs/kmergetransactionsdlg.cpp | 6 +- kmymoney2/dialogs/kmergetransactionsdlg.h | 7 +- kmymoney2/dialogs/kmymoneyfileinfodlg.cpp | 32 +- kmymoney2/dialogs/kmymoneyfileinfodlg.h | 3 +- kmymoney2/dialogs/kmymoneyfileinfodlgdecl.ui | 58 +- kmymoney2/dialogs/kmymoneypricedlg.cpp | 52 +- kmymoney2/dialogs/kmymoneypricedlg.h | 9 +- kmymoney2/dialogs/kmymoneypricedlgdecl.ui | 30 +- kmymoney2/dialogs/kmymoneysplittable.cpp | 262 ++-- kmymoney2/dialogs/kmymoneysplittable.h | 65 +- kmymoney2/dialogs/knewaccountdlg.cpp | 288 ++-- kmymoney2/dialogs/knewaccountdlg.h | 49 +- kmymoney2/dialogs/knewaccountdlgdecl.ui | 181 +-- kmymoney2/dialogs/knewbankdlg.cpp | 18 +- kmymoney2/dialogs/knewbankdlg.h | 7 +- kmymoney2/dialogs/knewbankdlgdecl.ui | 38 +- kmymoney2/dialogs/knewbudgetdlg.cpp | 14 +- kmymoney2/dialogs/knewbudgetdlg.h | 19 +- kmymoney2/dialogs/knewbudgetdlgdecl.ui | 36 +- kmymoney2/dialogs/knewequityentrydecl.ui | 32 +- kmymoney2/dialogs/knewequityentrydlg.cpp | 18 +- kmymoney2/dialogs/knewequityentrydlg.h | 21 +- kmymoney2/dialogs/knewfiledlg.cpp | 26 +- kmymoney2/dialogs/knewfiledlg.h | 27 +- kmymoney2/dialogs/knewfiledlgdecl.ui | 66 +- kmymoney2/dialogs/knewinvestmentwizard.cpp | 66 +- kmymoney2/dialogs/knewinvestmentwizard.h | 17 +- kmymoney2/dialogs/knewinvestmentwizarddecl.ui | 109 +- kmymoney2/dialogs/knewloanwizard.cpp | 232 ++-- kmymoney2/dialogs/knewloanwizard.h | 23 +- kmymoney2/dialogs/knewloanwizarddecl.ui | 945 ++++++------- kmymoney2/dialogs/konlinequoteconfigurationdecl.ui | 18 +- kmymoney2/dialogs/konlinequoteconfigurationdlg.cpp | 8 +- kmymoney2/dialogs/konlinequoteconfigurationdlg.h | 9 +- kmymoney2/dialogs/kpayeereassigndlg.cpp | 14 +- kmymoney2/dialogs/kpayeereassigndlg.h | 15 +- kmymoney2/dialogs/kpayeereassigndlgdecl.ui | 24 +- kmymoney2/dialogs/kplugindlg.ui | 8 +- kmymoney2/dialogs/krecentfileitem.cpp | 26 +- kmymoney2/dialogs/krecentfileitem.h | 14 +- kmymoney2/dialogs/kreconciledlg.cpp | 100 +- kmymoney2/dialogs/kreconciledlg.h | 23 +- kmymoney2/dialogs/kreconciledlgdecl.ui | 110 +- .../dialogs/kreportconfigurationfilterdlg.cpp | 142 +- kmymoney2/dialogs/kreportconfigurationfilterdlg.h | 7 +- kmymoney2/dialogs/ksecuritylisteditor.cpp | 64 +- kmymoney2/dialogs/ksecuritylisteditor.h | 7 +- kmymoney2/dialogs/ksecuritylisteditordecl.ui | 24 +- kmymoney2/dialogs/kselectdatabasedlg.cpp | 98 +- kmymoney2/dialogs/kselectdatabasedlg.h | 13 +- kmymoney2/dialogs/kselectdatabasedlgdecl.ui | 44 +- kmymoney2/dialogs/kselecttransactionsdlg.cpp | 38 +- kmymoney2/dialogs/kselecttransactionsdlg.h | 9 +- kmymoney2/dialogs/kselecttransactionsdlgdecl.ui | 10 +- kmymoney2/dialogs/ksortoptiondlg.ui | 23 +- kmymoney2/dialogs/ksortoptiondlg.ui.h | 8 +- kmymoney2/dialogs/ksplitcorrectiondlg.ui | 34 +- kmymoney2/dialogs/ksplittransactiondlg.cpp | 136 +- kmymoney2/dialogs/ksplittransactiondlg.h | 13 +- kmymoney2/dialogs/ksplittransactiondlgdecl.ui | 58 +- kmymoney2/dialogs/kstartdlg.cpp | 62 +- kmymoney2/dialogs/kstartdlg.h | 35 +- kmymoney2/dialogs/kupdatestockpricedlg.cpp | 22 +- kmymoney2/dialogs/kupdatestockpricedlg.h | 7 +- kmymoney2/dialogs/kupdatestockpricedlgdecl.ui | 43 +- kmymoney2/dialogs/mymoneyqifprofileeditor.cpp | 160 +-- kmymoney2/dialogs/mymoneyqifprofileeditor.h | 38 +- kmymoney2/dialogs/mymoneyqifprofileeditordecl.ui | 114 +- kmymoney2/dialogs/settings/ksettingscolors.cpp | 4 +- kmymoney2/dialogs/settings/ksettingscolors.h | 3 +- kmymoney2/dialogs/settings/ksettingscolorsdecl.ui | 42 +- kmymoney2/dialogs/settings/ksettingsfonts.cpp | 4 +- kmymoney2/dialogs/settings/ksettingsfonts.h | 3 +- kmymoney2/dialogs/settings/ksettingsfontsdecl.ui | 18 +- kmymoney2/dialogs/settings/ksettingsforecast.cpp | 4 +- kmymoney2/dialogs/settings/ksettingsforecast.h | 3 +- .../dialogs/settings/ksettingsforecastdecl.ui | 52 +- kmymoney2/dialogs/settings/ksettingsgeneral.cpp | 14 +- kmymoney2/dialogs/settings/ksettingsgeneral.h | 5 +- kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui | 99 +- kmymoney2/dialogs/settings/ksettingsgpg.cpp | 50 +- kmymoney2/dialogs/settings/ksettingsgpg.h | 3 +- kmymoney2/dialogs/settings/ksettingsgpgdecl.ui | 34 +- kmymoney2/dialogs/settings/ksettingshome.cpp | 54 +- kmymoney2/dialogs/settings/ksettingshome.h | 7 +- kmymoney2/dialogs/settings/ksettingshomedecl.ui | 36 +- .../dialogs/settings/ksettingsonlinequotes.cpp | 74 +- kmymoney2/dialogs/settings/ksettingsonlinequotes.h | 13 +- .../dialogs/settings/ksettingsonlinequotesdecl.ui | 26 +- kmymoney2/dialogs/settings/ksettingsplugins.cpp | 18 +- kmymoney2/dialogs/settings/ksettingsplugins.h | 7 +- kmymoney2/dialogs/settings/ksettingsregister.cpp | 22 +- kmymoney2/dialogs/settings/ksettingsregister.h | 3 +- .../dialogs/settings/ksettingsregisterdecl.ui | 85 +- kmymoney2/dialogs/settings/ksettingsschedules.cpp | 4 +- kmymoney2/dialogs/settings/ksettingsschedules.h | 3 +- .../dialogs/settings/ksettingsschedulesdecl.ui | 24 +- kmymoney2/dialogs/transactioneditor.cpp | 400 +++--- kmymoney2/dialogs/transactioneditor.h | 94 +- kmymoney2/dialogs/transactionmatcher.cpp | 60 +- kmymoney2/dialogs/transactionmatcher.h | 2 +- kmymoney2/kmymoney2.cpp | 1408 ++++++++++---------- kmymoney2/kmymoney2.h | 157 +-- kmymoney2/kmymoneyglobalsettings.cpp | 24 +- kmymoney2/kmymoneyglobalsettings.h | 10 +- kmymoney2/kmymoneytest.cpp | 16 +- kmymoney2/kmymoneyutils.cpp | 120 +- kmymoney2/kmymoneyutils.h | 78 +- kmymoney2/kstartuplogo.cpp | 36 +- kmymoney2/kstartuplogo.h | 16 +- kmymoney2/main.cpp | 32 +- kmymoney2/mymoney/mymoneyaccount.cpp | 166 +-- kmymoney2/mymoney/mymoneyaccount.h | 150 +-- kmymoney2/mymoney/mymoneyaccounttest.cpp | 116 +- kmymoney2/mymoney/mymoneybudget.cpp | 84 +- kmymoney2/mymoney/mymoneybudget.h | 84 +- kmymoney2/mymoney/mymoneycategory.cpp | 44 +- kmymoney2/mymoney/mymoneycategory.h | 34 +- kmymoney2/mymoney/mymoneyexception.cpp | 2 +- kmymoney2/mymoney/mymoneyexception.h | 20 +- kmymoney2/mymoney/mymoneyfile.cpp | 526 ++++---- kmymoney2/mymoney/mymoneyfile.h | 257 ++-- kmymoney2/mymoney/mymoneyfiletest.cpp | 140 +- kmymoney2/mymoney/mymoneyfiletest.h | 10 +- kmymoney2/mymoney/mymoneyfinancialcalculator.cpp | 40 +- kmymoney2/mymoney/mymoneyfinancialcalculator.h | 2 +- .../mymoney/mymoneyfinancialcalculatortest.cpp | 14 +- kmymoney2/mymoney/mymoneyforecast.cpp | 306 ++--- kmymoney2/mymoney/mymoneyforecast.h | 74 +- kmymoney2/mymoney/mymoneyforecasttest.cpp | 366 ++--- kmymoney2/mymoney/mymoneyinstitution.cpp | 56 +- kmymoney2/mymoney/mymoneyinstitution.h | 92 +- kmymoney2/mymoney/mymoneyinstitutiontest.cpp | 34 +- kmymoney2/mymoney/mymoneyinvesttransaction.cpp | 8 +- kmymoney2/mymoney/mymoneyinvesttransaction.h | 6 +- kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp | 36 +- kmymoney2/mymoney/mymoneykeyvaluecontainer.h | 46 +- kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp | 18 +- kmymoney2/mymoney/mymoneymoney.cpp | 78 +- kmymoney2/mymoney/mymoneymoney.h | 40 +- kmymoney2/mymoney/mymoneymoneytest.cpp | 114 +- kmymoney2/mymoney/mymoneyobject.cpp | 16 +- kmymoney2/mymoney/mymoneyobject.h | 38 +- kmymoney2/mymoney/mymoneyobjectcontainer.cpp | 42 +- kmymoney2/mymoney/mymoneyobjectcontainer.h | 41 +- kmymoney2/mymoney/mymoneyobjecttest.cpp | 16 +- kmymoney2/mymoney/mymoneyobserver.h | 4 +- kmymoney2/mymoney/mymoneyobservertest.h | 6 +- kmymoney2/mymoney/mymoneypayee.cpp | 44 +- kmymoney2/mymoney/mymoneypayee.h | 106 +- kmymoney2/mymoney/mymoneypayeetest.cpp | 22 +- kmymoney2/mymoney/mymoneyprice.cpp | 14 +- kmymoney2/mymoney/mymoneyprice.h | 42 +- kmymoney2/mymoney/mymoneypricetest.cpp | 26 +- kmymoney2/mymoney/mymoneyreport.cpp | 172 +-- kmymoney2/mymoney/mymoneyreport.h | 92 +- kmymoney2/mymoney/mymoneyscheduled.cpp | 200 +-- kmymoney2/mymoney/mymoneyscheduled.h | 138 +- kmymoney2/mymoney/mymoneyscheduletest.cpp | 522 ++++---- kmymoney2/mymoney/mymoneysecurity.cpp | 28 +- kmymoney2/mymoney/mymoneysecurity.h | 38 +- kmymoney2/mymoney/mymoneysecuritytest.cpp | 20 +- kmymoney2/mymoney/mymoneysplit.cpp | 64 +- kmymoney2/mymoney/mymoneysplit.h | 70 +- kmymoney2/mymoney/mymoneysplittest.cpp | 30 +- kmymoney2/mymoney/mymoneystatement.cpp | 94 +- kmymoney2/mymoney/mymoneystatement.h | 76 +- kmymoney2/mymoney/mymoneysubject.cpp | 8 +- kmymoney2/mymoney/mymoneysubject.h | 8 +- kmymoney2/mymoney/mymoneytransaction.cpp | 150 +-- kmymoney2/mymoney/mymoneytransaction.h | 84 +- kmymoney2/mymoney/mymoneytransactionfilter.cpp | 260 ++-- kmymoney2/mymoney/mymoneytransactionfilter.h | 100 +- kmymoney2/mymoney/mymoneytransactiontest.cpp | 62 +- kmymoney2/mymoney/mymoneyutils.cpp | 48 +- kmymoney2/mymoney/mymoneyutils.h | 40 +- kmymoney2/mymoney/storage/imymoneyserialize.h | 94 +- kmymoney2/mymoney/storage/imymoneystorage.cpp | 2 +- kmymoney2/mymoney/storage/imymoneystorage.h | 170 +-- kmymoney2/mymoney/storage/imymoneystorageformat.h | 16 +- kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp | 674 +++++----- kmymoney2/mymoney/storage/mymoneydatabasemgr.h | 214 +-- .../mymoney/storage/mymoneydatabasemgrtest.cpp | 218 +-- kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h | 4 +- kmymoney2/mymoney/storage/mymoneymap.h | 84 +- kmymoney2/mymoney/storage/mymoneymaptest.cpp | 2 +- kmymoney2/mymoney/storage/mymoneymaptest.h | 2 +- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp | 612 ++++----- kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h | 264 ++-- .../mymoney/storage/mymoneyseqaccessmgrtest.cpp | 142 +- .../mymoney/storage/mymoneyseqaccessmgrtest.h | 8 +- kmymoney2/mymoney/storage/mymoneystorageanon.cpp | 76 +- kmymoney2/mymoney/storage/mymoneystorageanon.h | 32 +- kmymoney2/mymoney/storage/mymoneystoragedump.cpp | 92 +- kmymoney2/mymoney/storage/mymoneystoragedump.h | 12 +- kmymoney2/mymoney/storage/mymoneystoragesql.cpp | 1178 ++++++++-------- kmymoney2/mymoney/storage/mymoneystoragesql.h | 324 ++--- kmymoney2/mymoney/storage/mymoneystoragexml.cpp | 334 ++--- kmymoney2/mymoney/storage/mymoneystoragexml.h | 80 +- kmymoney2/plugins/importinterface.cpp | 4 +- kmymoney2/plugins/importinterface.h | 11 +- .../plugins/interfaces/kmmimportinterface.cpp | 8 +- kmymoney2/plugins/interfaces/kmmimportinterface.h | 5 +- .../plugins/interfaces/kmmstatementinterface.cpp | 8 +- .../plugins/interfaces/kmmstatementinterface.h | 5 +- kmymoney2/plugins/interfaces/kmmviewinterface.cpp | 22 +- kmymoney2/plugins/interfaces/kmmviewinterface.h | 7 +- kmymoney2/plugins/kmymoneyplugin.cpp | 18 +- kmymoney2/plugins/kmymoneyplugin.h | 33 +- kmymoney2/plugins/ofximport/Makefile.am | 2 +- .../ofximport/dialogs/kofxdirectconnectdlg.cpp | 62 +- .../ofximport/dialogs/kofxdirectconnectdlg.h | 11 +- .../ofximport/dialogs/kofxdirectconnectdlgdecl.ui | 16 +- .../ofximport/dialogs/konlinebankingsetupdecl.ui | 84 +- .../dialogs/konlinebankingsetupwizard.cpp | 94 +- .../ofximport/dialogs/konlinebankingsetupwizard.h | 17 +- .../ofximport/dialogs/konlinebankingstatus.cpp | 48 +- .../ofximport/dialogs/konlinebankingstatus.h | 13 +- .../ofximport/dialogs/konlinebankingstatusdecl.ui | 92 +- .../ofximport/dialogs/mymoneyofxconnector.cpp | 220 +-- .../ofximport/dialogs/mymoneyofxconnector.h | 34 +- kmymoney2/plugins/ofximport/ofximporterplugin.cpp | 110 +- kmymoney2/plugins/ofximport/ofximporterplugin.h | 61 +- kmymoney2/plugins/ofximport/ofxpartner.cpp | 224 ++-- kmymoney2/plugins/ofximport/ofxpartner.h | 36 +- kmymoney2/plugins/pluginloader.cpp | 26 +- kmymoney2/plugins/pluginloader.h | 11 +- kmymoney2/plugins/statementinterface.cpp | 4 +- kmymoney2/plugins/statementinterface.h | 9 +- kmymoney2/plugins/viewinterface.cpp | 4 +- kmymoney2/plugins/viewinterface.h | 25 +- kmymoney2/reports/kreportchartview.cpp | 36 +- kmymoney2/reports/kreportchartview.h | 16 +- kmymoney2/reports/listtable.cpp | 172 +-- kmymoney2/reports/listtable.h | 34 +- kmymoney2/reports/objectinfotable.cpp | 36 +- kmymoney2/reports/objectinfotable.h | 4 +- kmymoney2/reports/pivotgrid.cpp | 26 +- kmymoney2/reports/pivotgrid.h | 24 +- kmymoney2/reports/pivotgridtest.cpp | 30 +- kmymoney2/reports/pivottable.cpp | 536 ++++---- kmymoney2/reports/pivottable.h | 42 +- kmymoney2/reports/pivottabletest.cpp | 322 ++--- kmymoney2/reports/querytable.cpp | 192 +-- kmymoney2/reports/querytable.h | 22 +- kmymoney2/reports/querytabletest.cpp | 212 +-- kmymoney2/reports/querytabletest.h | 4 +- kmymoney2/reports/reportaccount.cpp | 94 +- kmymoney2/reports/reportaccount.h | 54 +- kmymoney2/reports/reportdebug.h | 14 +- kmymoney2/reports/reportstestcommon.cpp | 186 +-- kmymoney2/reports/reportstestcommon.h | 102 +- kmymoney2/reports/reporttable.h | 6 +- kmymoney2/views/kaccountsview.cpp | 146 +- kmymoney2/views/kaccountsview.h | 37 +- kmymoney2/views/kaccountsviewdecl.ui | 33 +- kmymoney2/views/kbudgetview.cpp | 222 +-- kmymoney2/views/kbudgetview.h | 37 +- kmymoney2/views/kbudgetviewdecl.ui | 44 +- kmymoney2/views/kcategoriesview.cpp | 84 +- kmymoney2/views/kcategoriesview.h | 23 +- kmymoney2/views/kcategoriesviewdecl.ui | 27 +- kmymoney2/views/kforecastview.cpp | 160 +-- kmymoney2/views/kforecastview.h | 11 +- kmymoney2/views/kforecastviewdecl.ui | 74 +- kmymoney2/views/kgloballedgerview.cpp | 336 ++--- kmymoney2/views/kgloballedgerview.h | 104 +- kmymoney2/views/khomeview.cpp | 558 ++++---- kmymoney2/views/khomeview.h | 33 +- kmymoney2/views/kinstitutionsview.cpp | 94 +- kmymoney2/views/kinstitutionsview.h | 23 +- kmymoney2/views/kinstitutionsviewdecl.ui | 19 +- kmymoney2/views/kinvestmentlistitem.cpp | 66 +- kmymoney2/views/kinvestmentlistitem.h | 18 +- kmymoney2/views/kinvestmentview.cpp | 50 +- kmymoney2/views/kinvestmentview.h | 11 +- kmymoney2/views/kinvestmentviewdecl.ui | 15 +- kmymoney2/views/kmymoneyfile.cpp | 2 +- kmymoney2/views/kmymoneyfile.h | 2 +- kmymoney2/views/kmymoneytransaction.cpp | 2 +- kmymoney2/views/kmymoneytransaction.h | 6 +- kmymoney2/views/kmymoneyview.cpp | 564 ++++---- kmymoney2/views/kmymoneyview.h | 98 +- kmymoney2/views/kpayeesview.cpp | 288 ++-- kmymoney2/views/kpayeesview.h | 65 +- kmymoney2/views/kpayeesviewdecl.ui | 94 +- kmymoney2/views/kreportsview.cpp | 288 ++-- kmymoney2/views/kreportsview.h | 69 +- kmymoney2/views/kscheduledlistitem.cpp | 40 +- kmymoney2/views/kscheduledlistitem.h | 20 +- kmymoney2/views/kscheduledview.cpp | 118 +- kmymoney2/views/kscheduledview.h | 31 +- kmymoney2/views/kscheduledviewdecl.ui | 16 +- kmymoney2/widgets/Makefile.am | 5 +- kmymoney2/widgets/kaccounttemplateselector.cpp | 124 +- kmymoney2/widgets/kaccounttemplateselector.h | 5 +- kmymoney2/widgets/kaccounttemplateselectordecl.cpp | 72 +- kmymoney2/widgets/kaccounttemplateselectordecl.ui | 16 +- kmymoney2/widgets/kbudgetvalues.cpp | 74 +- kmymoney2/widgets/kbudgetvalues.h | 15 +- kmymoney2/widgets/kbudgetvaluesdecl.cpp | 130 +- kmymoney2/widgets/kbudgetvaluesdecl.ui | 52 +- kmymoney2/widgets/kguiutils.cpp | 100 +- kmymoney2/widgets/kguiutils.h | 23 +- kmymoney2/widgets/klistviewsearchline.cpp | 142 +- kmymoney2/widgets/klistviewsearchline.h | 52 +- kmymoney2/widgets/kmymoney.widgets | 8 +- kmymoney2/widgets/kmymoneyaccountcombo.cpp | 60 +- kmymoney2/widgets/kmymoneyaccountcombo.h | 31 +- kmymoney2/widgets/kmymoneyaccountcompletion.cpp | 28 +- kmymoney2/widgets/kmymoneyaccountcompletion.h | 11 +- kmymoney2/widgets/kmymoneyaccountselector.cpp | 204 +-- kmymoney2/widgets/kmymoneyaccountselector.h | 39 +- kmymoney2/widgets/kmymoneyaccounttree.cpp | 46 +- kmymoney2/widgets/kmymoneyaccounttree.h | 15 +- kmymoney2/widgets/kmymoneyaccounttreebase.cpp | 212 +-- kmymoney2/widgets/kmymoneyaccounttreebase.h | 95 +- kmymoney2/widgets/kmymoneyaccounttreebudget.cpp | 14 +- kmymoney2/widgets/kmymoneyaccounttreebudget.h | 17 +- kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp | 84 +- kmymoney2/widgets/kmymoneyaccounttreeforecast.h | 23 +- kmymoney2/widgets/kmymoneybriefschedule.cpp | 64 +- kmymoney2/widgets/kmymoneybriefschedule.h | 17 +- kmymoney2/widgets/kmymoneycalculator.cpp | 176 +-- kmymoney2/widgets/kmymoneycalculator.h | 59 +- kmymoney2/widgets/kmymoneycalendar.cpp | 250 ++-- kmymoney2/widgets/kmymoneycalendar.h | 67 +- kmymoney2/widgets/kmymoneycategory.cpp | 64 +- kmymoney2/widgets/kmymoneycategory.h | 46 +- kmymoney2/widgets/kmymoneychecklistitem.cpp | 40 +- kmymoney2/widgets/kmymoneychecklistitem.h | 27 +- kmymoney2/widgets/kmymoneycombo.cpp | 278 ++-- kmymoney2/widgets/kmymoneycombo.h | 119 +- kmymoney2/widgets/kmymoneycompletion.cpp | 72 +- kmymoney2/widgets/kmymoneycompletion.h | 33 +- kmymoney2/widgets/kmymoneycurrencyselector.cpp | 46 +- kmymoney2/widgets/kmymoneycurrencyselector.h | 13 +- kmymoney2/widgets/kmymoneydateinput.cpp | 148 +- kmymoney2/widgets/kmymoneydateinput.h | 64 +- kmymoney2/widgets/kmymoneydatetbl.cpp | 212 ++- kmymoney2/widgets/kmymoneydatetbl.h | 52 +- kmymoney2/widgets/kmymoneyedit.cpp | 190 +-- kmymoney2/widgets/kmymoneyedit.h | 70 +- kmymoney2/widgets/kmymoneyforecastlistviewitem.cpp | 26 +- kmymoney2/widgets/kmymoneyforecastlistviewitem.h | 10 +- kmymoney2/widgets/kmymoneygpgconfig.cpp | 14 +- kmymoney2/widgets/kmymoneygpgconfig.h | 7 +- kmymoney2/widgets/kmymoneygpgconfigdecl.ui | 34 +- kmymoney2/widgets/kmymoneylineedit.cpp | 58 +- kmymoney2/widgets/kmymoneylineedit.h | 37 +- kmymoney2/widgets/kmymoneylistviewitem.cpp | 32 +- kmymoney2/widgets/kmymoneylistviewitem.h | 23 +- kmymoney2/widgets/kmymoneyonlinequoteconfig.cpp | 70 +- kmymoney2/widgets/kmymoneyonlinequoteconfig.h | 13 +- kmymoney2/widgets/kmymoneyonlinequoteconfigdecl.ui | 30 +- kmymoney2/widgets/kmymoneypriceview.cpp | 58 +- kmymoney2/widgets/kmymoneypriceview.h | 13 +- kmymoney2/widgets/kmymoneyreportconfigtab1decl.ui | 26 +- kmymoney2/widgets/kmymoneyreportconfigtab2decl.ui | 44 +- kmymoney2/widgets/kmymoneyreportconfigtab3decl.ui | 64 +- .../widgets/kmymoneyreportconfigtabchartdecl.ui | 32 +- kmymoney2/widgets/kmymoneyreportcontroldecl.ui | 32 +- kmymoney2/widgets/kmymoneyscheduledcalendar.cpp | 26 +- kmymoney2/widgets/kmymoneyscheduledcalendar.h | 9 +- kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp | 120 +- kmymoney2/widgets/kmymoneyscheduleddatetbl.h | 19 +- kmymoney2/widgets/kmymoneyselector.cpp | 294 ++-- kmymoney2/widgets/kmymoneyselector.h | 109 +- kmymoney2/widgets/kmymoneytitlelabel.cpp | 38 +- kmymoney2/widgets/kmymoneytitlelabel.h | 55 +- kmymoney2/widgets/kmymoneywizard.cpp | 134 +- kmymoney2/widgets/kmymoneywizard.h | 107 +- kmymoney2/widgets/kmymoneywizard_p.h | 11 +- kmymoney2/widgets/kschedulebriefwidget.ui | 56 +- kmymoney2/widgets/register.cpp | 472 +++---- kmymoney2/widgets/register.h | 183 +-- kmymoney2/widgets/registeritem.cpp | 14 +- kmymoney2/widgets/registeritem.h | 50 +- kmymoney2/widgets/registersearchline.cpp | 66 +- kmymoney2/widgets/registersearchline.h | 22 +- kmymoney2/widgets/scheduledtransaction.cpp | 12 +- kmymoney2/widgets/scheduledtransaction.h | 18 +- kmymoney2/widgets/selectedtransaction.cpp | 2 +- kmymoney2/widgets/selectedtransaction.h | 8 +- kmymoney2/widgets/sortoptionlistitem.h | 10 +- kmymoney2/widgets/stdtransactiondownloaded.cpp | 20 +- kmymoney2/widgets/stdtransactiondownloaded.h | 42 +- kmymoney2/widgets/stdtransactionmatched.cpp | 56 +- kmymoney2/widgets/stdtransactionmatched.h | 32 +- kmymoney2/widgets/transaction.cpp | 580 ++++---- kmymoney2/widgets/transaction.h | 162 +-- kmymoney2/widgets/transactioneditorcontainer.h | 22 +- kmymoney2/widgets/transactionform.cpp | 170 +-- kmymoney2/widgets/transactionform.h | 68 +- kmymoney2/widgets/transactionsortoption.ui | 66 +- kmymoney2/widgets/transactionsortoption.ui.h | 72 +- .../newaccountwizard/kaccountsummarypagedecl.ui | 4 +- .../newaccountwizard/kaccounttypepagedecl.ui | 36 +- .../wizards/newaccountwizard/kbrokeragepagedecl.ui | 25 +- .../newaccountwizard/kgeneralloaninfopagedecl.ui | 47 +- .../wizards/newaccountwizard/khierarchypagedecl.ui | 10 +- .../newaccountwizard/kinstitutionpagedecl.ui | 22 +- .../newaccountwizard/kloandetailspagedecl.ui | 47 +- .../newaccountwizard/kloanpaymentpagedecl.ui | 41 +- .../newaccountwizard/kloanpayoutpagedecl.ui | 25 +- .../newaccountwizard/kloanschedulepagedecl.ui | 33 +- .../wizards/newaccountwizard/knewaccountwizard.cpp | 258 ++-- .../wizards/newaccountwizard/knewaccountwizard.h | 11 +- .../wizards/newaccountwizard/knewaccountwizard_p.h | 77 +- .../wizards/newaccountwizard/kschedulepagedecl.ui | 33 +- .../wizards/newuserwizard/kaccountpagedecl.ui | 40 +- .../wizards/newuserwizard/kcurrencypagedecl.ui | 12 +- kmymoney2/wizards/newuserwizard/kfilepagedecl.ui | 6 +- .../wizards/newuserwizard/kgeneralpagedecl.ui | 70 +- kmymoney2/wizards/newuserwizard/kintropagedecl.ui | 10 +- kmymoney2/wizards/newuserwizard/knewuserwizard.cpp | 62 +- kmymoney2/wizards/newuserwizard/knewuserwizard.h | 9 +- kmymoney2/wizards/newuserwizard/knewuserwizard_p.h | 23 +- .../wizards/newuserwizard/kpasswordpagedecl.ui | 4 +- .../wizards/newuserwizard/kpreferencepagedecl.ui | 12 +- kmymoney2/wizards/wizardpages/accounts.cpp | 6 +- kmymoney2/wizards/wizardpages/accounts.h | 3 +- kmymoney2/wizards/wizardpages/accountsdecl.ui | 9 +- kmymoney2/wizards/wizardpages/currency.cpp | 18 +- kmymoney2/wizards/wizardpages/currency.h | 7 +- kmymoney2/wizards/wizardpages/currencydecl.ui | 6 +- kmymoney2/wizards/wizardpages/userinfo.cpp | 4 +- kmymoney2/wizards/wizardpages/userinfo.h | 3 +- kmymoney2/wizards/wizardpages/userinfodecl.ui | 38 +- libkdchart/KDChart.cpp | 154 +-- libkdchart/KDChart.h | 40 +- libkdchart/KDChartAreaPainter.cpp | 6 +- libkdchart/KDChartAreaPainter.h | 2 +- libkdchart/KDChartAxesPainter.cpp | 788 +++++------ libkdchart/KDChartAxesPainter.h | 66 +- libkdchart/KDChartAxisParams.cpp | 240 ++-- libkdchart/KDChartAxisParams.h | 203 +-- libkdchart/KDChartAxisParamsWrapper.cpp | 34 +- libkdchart/KDChartAxisParamsWrapper.h | 31 +- libkdchart/KDChartBWPainter.cpp | 102 +- libkdchart/KDChartBWPainter.h | 10 +- libkdchart/KDChartBarPainter.cpp | 142 +- libkdchart/KDChartBarPainter.h | 14 +- libkdchart/KDChartCustomBox.cpp | 150 +-- libkdchart/KDChartCustomBox.h | 165 +-- libkdchart/KDChartCustomBoxWrapper.cpp | 2 +- libkdchart/KDChartCustomBoxWrapper.h | 5 +- libkdchart/KDChartDataIntern.cpp | 34 +- libkdchart/KDChartDataIntern.h | 160 +-- libkdchart/KDChartDataRegion.h | 66 +- libkdchart/KDChartEnums.cpp | 8 +- libkdchart/KDChartEnums.h | 57 +- libkdchart/KDChartGlobal.h | 135 +- libkdchart/KDChartHiLoPainter.cpp | 52 +- libkdchart/KDChartHiLoPainter.h | 10 +- libkdchart/KDChartLinesPainter.cpp | 127 +- libkdchart/KDChartLinesPainter.h | 12 +- libkdchart/KDChartListTable.h | 58 +- libkdchart/KDChartNotEnoughSpaceException.h | 2 +- libkdchart/KDChartObjectFactory.cpp | 196 +-- libkdchart/KDChartObjectFactory.h | 50 +- libkdchart/KDChartPainter.cpp | 614 ++++----- libkdchart/KDChartPainter.h | 118 +- libkdchart/KDChartParams.cpp | 789 ++++++----- libkdchart/KDChartParams.h | 576 ++++---- libkdchart/KDChartParamsWrapper.cpp | 40 +- libkdchart/KDChartParamsWrapper.h | 43 +- libkdchart/KDChartParams_frame.cpp | 20 +- libkdchart/KDChartParams_io.cpp | 594 ++++----- libkdchart/KDChartPiePainter.cpp | 124 +- libkdchart/KDChartPiePainter.h | 24 +- libkdchart/KDChartPolarPainter.cpp | 178 +-- libkdchart/KDChartPolarPainter.h | 26 +- libkdchart/KDChartPropertySet.cpp | 60 +- libkdchart/KDChartPropertySet.h | 97 +- libkdchart/KDChartRingPainter.cpp | 62 +- libkdchart/KDChartRingPainter.h | 8 +- libkdchart/KDChartSeriesCollection.cpp | 26 +- libkdchart/KDChartSeriesCollection.h | 18 +- libkdchart/KDChartTable.h | 4 +- libkdchart/KDChartTableBase.cpp | 178 +-- libkdchart/KDChartTableBase.h | 77 +- libkdchart/KDChartTableDataWrapper.cpp | 6 +- libkdchart/KDChartTableDataWrapper.h | 15 +- libkdchart/KDChartTextPiece.cpp | 100 +- libkdchart/KDChartTextPiece.h | 51 +- libkdchart/KDChartUnknownTypeException.h | 8 +- libkdchart/KDChartVectorSeries.cpp | 8 +- libkdchart/KDChartVectorSeries.h | 14 +- libkdchart/KDChartVectorTable.h | 45 +- libkdchart/KDChartWidget.cpp | 72 +- libkdchart/KDChartWidget.h | 53 +- libkdchart/KDChartWrapperFactory.cpp | 12 +- libkdchart/KDChartWrapperFactory.h | 6 +- libkdchart/KDDrawText.cpp | 232 ++-- libkdchart/KDDrawText.h | 44 +- libkdchart/KDFrame.cpp | 124 +- libkdchart/KDFrame.h | 149 ++- libkdchart/KDFrameProfileSection.cpp | 24 +- libkdchart/KDFrameProfileSection.h | 38 +- libkdchart/KDXMLTools.cpp | 330 ++--- libkdchart/KDXMLTools.h | 128 +- libkdchart/kdchart_export.h | 2 +- libkgpgfile/kgpgfile.cpp | 180 ++- libkgpgfile/kgpgfile.h | 79 +- 590 files changed, 24351 insertions(+), 24218 deletions(-) diff --git a/kmymoney2/converter/convertertest.cpp b/kmymoney2/converter/convertertest.cpp index aef63d9..70124ad 100644 --- a/kmymoney2/converter/convertertest.cpp +++ b/kmymoney2/converter/convertertest.cpp @@ -19,10 +19,10 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -64,7 +64,7 @@ void ConverterTest::setUp () { file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -77,12 +77,12 @@ void ConverterTest::setUp () { acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount("Checking Account",MyMoneyAccount::Checkings,moConverterCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount("Credit Card",MyMoneyAccount::CreditCard,moConverterCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount("Solo",MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount("Parent",MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount("Child",MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount("Foreign",MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); + acChecking = makeAccount("Checking Account",MyMoneyAccount::Checkings,moConverterCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount("Credit Card",MyMoneyAccount::CreditCard,moConverterCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount("Solo",MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount("Parent",MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount("Child",MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount("Foreign",MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); @@ -112,8 +112,8 @@ void ConverterTest::testWebQuotes() CPPUNIT_ASSERT(qr.m_errors.count() == 0); // Quote date should be within the last week, or something bad is going on. - CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate()); - CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7)); + CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7)); // Quote value should at least be positive CPPUNIT_ASSERT(qr.m_price.isPositive()); @@ -123,8 +123,8 @@ void ConverterTest::testWebQuotes() // kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl; CPPUNIT_ASSERT(qr.m_errors.count() == 0); - CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1)); - CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7)); + CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1)); + CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7)); CPPUNIT_ASSERT(qr.m_price.isPositive()); q.launch("EUR > USD","Yahoo Currency"); @@ -132,8 +132,8 @@ void ConverterTest::testWebQuotes() // kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl; CPPUNIT_ASSERT(qr.m_errors.count() == 0); - CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1)); - CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7)); + CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1)); + CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7)); CPPUNIT_ASSERT(qr.m_price.isPositive()); q.launch("50492","Globe & Mail"); @@ -141,8 +141,8 @@ void ConverterTest::testWebQuotes() // kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl; CPPUNIT_ASSERT(qr.m_errors.count() == 0); - CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1)); - CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7)); + CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1)); + CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7)); CPPUNIT_ASSERT(qr.m_price.isPositive()); q.launch("TDB647","MSN.CA"); @@ -150,8 +150,8 @@ void ConverterTest::testWebQuotes() // kdDebug(2) << "ConverterTest::testWebQuotes(): quote for " << q.m_symbol << " on " << qr.m_date.toString() << " is " << qr.m_price.toString() << " errors(" << qr.m_errors.count() << "): " << qr.m_errors.join(" /// ") << endl; CPPUNIT_ASSERT(qr.m_errors.count() == 0); - CPPUNIT_ASSERT(qr.m_date <= QDate::currentDate().addDays(1)); - CPPUNIT_ASSERT(qr.m_date >= QDate::currentDate().addDays(-7)); + CPPUNIT_ASSERT(qr.m_date <= TQDate::tqcurrentDate().addDays(1)); + CPPUNIT_ASSERT(qr.m_date >= TQDate::tqcurrentDate().addDays(-7)); CPPUNIT_ASSERT(qr.m_price.isPositive()); } @@ -168,39 +168,39 @@ void ConverterTest::testDateFormat() { MyMoneyDateFormat format("%mm-%dd-%yyyy"); - CPPUNIT_ASSERT(format.convertString("1-5-2005") == QDate(2005,1,5)); - CPPUNIT_ASSERT(format.convertString("jan-15-2005") == QDate(2005,1,15)); - CPPUNIT_ASSERT(format.convertString("august-25-2005") == QDate(2005,8,25)); + CPPUNIT_ASSERT(format.convertString("1-5-2005") == TQDate(2005,1,5)); + CPPUNIT_ASSERT(format.convertString("jan-15-2005") == TQDate(2005,1,15)); + CPPUNIT_ASSERT(format.convertString("august-25-2005") == TQDate(2005,8,25)); format = MyMoneyDateFormat("%mm/%dd/%yy"); - CPPUNIT_ASSERT(format.convertString("1/5/05") == QDate(2005,1,5)); - CPPUNIT_ASSERT(format.convertString("jan/15/05") == QDate(2005,1,15)); - CPPUNIT_ASSERT(format.convertString("august/25/05") == QDate(2005,8,25)); + CPPUNIT_ASSERT(format.convertString("1/5/05") == TQDate(2005,1,5)); + CPPUNIT_ASSERT(format.convertString("jan/15/05") == TQDate(2005,1,15)); + CPPUNIT_ASSERT(format.convertString("august/25/05") == TQDate(2005,8,25)); format = MyMoneyDateFormat("%d\\.%m\\.%yy"); - CPPUNIT_ASSERT(format.convertString("1.5.05") == QDate(2005,5,1)); - CPPUNIT_ASSERT(format.convertString("15.jan.05") == QDate(2005,1,15)); - CPPUNIT_ASSERT(format.convertString("25.august.05") == QDate(2005,8,25)); + CPPUNIT_ASSERT(format.convertString("1.5.05") == TQDate(2005,5,1)); + CPPUNIT_ASSERT(format.convertString("15.jan.05") == TQDate(2005,1,15)); + CPPUNIT_ASSERT(format.convertString("25.august.05") == TQDate(2005,8,25)); format = MyMoneyDateFormat("%yyyy\\\\%dddd\\\\%mmmmmmmmmmm"); - CPPUNIT_ASSERT(format.convertString("2005\\31\\12") == QDate(2005,12,31)); - CPPUNIT_ASSERT(format.convertString("2005\\15\\jan") == QDate(2005,1,15)); - CPPUNIT_ASSERT(format.convertString("2005\\25\\august") == QDate(2005,8,25)); + CPPUNIT_ASSERT(format.convertString("2005\\31\\12") == TQDate(2005,12,31)); + CPPUNIT_ASSERT(format.convertString("2005\\15\\jan") == TQDate(2005,1,15)); + CPPUNIT_ASSERT(format.convertString("2005\\25\\august") == TQDate(2005,8,25)); format = MyMoneyDateFormat("%m %dd, %yyyy"); - CPPUNIT_ASSERT(format.convertString("jan 15, 2005") == QDate(2005,1,15)); - CPPUNIT_ASSERT(format.convertString("august 25, 2005") == QDate(2005,8,25)); - CPPUNIT_ASSERT(format.convertString("january 1st, 2005") == QDate(2005,1,1)); + CPPUNIT_ASSERT(format.convertString("jan 15, 2005") == TQDate(2005,1,15)); + CPPUNIT_ASSERT(format.convertString("august 25, 2005") == TQDate(2005,8,25)); + CPPUNIT_ASSERT(format.convertString("january 1st, 2005") == TQDate(2005,1,1)); format = MyMoneyDateFormat("%m %d %y"); - CPPUNIT_ASSERT(format.convertString("12/31/50",false,2000) == QDate(1950,12,31)); - CPPUNIT_ASSERT(format.convertString("1/1/90",false,2000) == QDate(1990,1,1)); - CPPUNIT_ASSERT(format.convertString("december 31st, 5",false) == QDate(2005,12,31)); + CPPUNIT_ASSERT(format.convertString("12/31/50",false,2000) == TQDate(1950,12,31)); + CPPUNIT_ASSERT(format.convertString("1/1/90",false,2000) == TQDate(1990,1,1)); + CPPUNIT_ASSERT(format.convertString("december 31st, 5",false) == TQDate(2005,12,31)); } catch (MyMoneyException* e) { diff --git a/kmymoney2/converter/imymoneyreader.h b/kmymoney2/converter/imymoneyreader.h index 6222af5..6fa530d 100644 --- a/kmymoney2/converter/imymoneyreader.h +++ b/kmymoney2/converter/imymoneyreader.h @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -45,13 +45,14 @@ * @author Kevin Tambascio */ -class IMyMoneyReader : public QObject +class IMyMoneyReader : public TQObject { public: IMyMoneyReader() {} virtual ~IMyMoneyReader() {} Q_OBJECT + TQ_OBJECT /** * This method is used to store the filename into the object. @@ -62,7 +63,7 @@ public: * * @param name path and name of the file to be imported */ - virtual void setFilename(const QString& name)=0; + virtual void setFilename(const TQString& name)=0; /** * This method is used to store the name of the profile into the object. @@ -71,16 +72,16 @@ public: * the file is send through this filter and the result * is stored in the m_tempFile file. * - * @param name QString reference to the name of the profile + * @param name TQString reference to the name of the profile */ - virtual void setProfile(const QString& name)=0; + virtual void setProfile(const TQString& name)=0; /** * This method actually starts the import of data from the selected file * into the MyMoney engine. * * This method also starts the user defined import filter program - * defined in the QIF profile(when a QIF file is selected). If none is + * defined in the TQIF profile(when a TQIF file is selected). If none is * defined, the file is read as is (actually the UNIX command * 'cat -' is used as the filter). * @@ -123,12 +124,12 @@ public: virtual void setAskPayeeCategory(const bool ask)=0; virtual const MyMoneyAccount& account() const { return m_account; }; - virtual void setProgressCallback(void(*callback)(int, int, const QString&)) { m_progressCallback = callback; } + virtual void setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } private: MyMoneyAccount m_account; - void (*m_progressCallback)(int, int, const QString&); - QString m_filename; + void (*m_progressCallback)(int, int, const TQString&); + TQString m_filename; }; diff --git a/kmymoney2/converter/mymoneygncreader.cpp b/kmymoney2/converter/mymoneygncreader.cpp index 40933e3..79f6e89 100644 --- a/kmymoney2/converter/mymoneygncreader.cpp +++ b/kmymoney2/converter/mymoneygncreader.cpp @@ -22,12 +22,12 @@ email : mte@users.sourceforge.net // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -58,13 +58,13 @@ email : mte@users.sourceforge.net #define PASS } catch (MyMoneyException *e) { throw e; } #else #include "mymoneymoney.h" - #include - #define i18n QObject::tr + #include + #define i18n TQObject::tr #define TRY #define CATCH #define PASS - #define MYMONEYEXCEPTION QString - #define MyMoneyException QString + #define MYMONEYEXCEPTION TQString + #define MyMoneyException TQString #define PACKAGE "KMyMoney" #endif // _GNCFILEANON @@ -112,12 +112,12 @@ GncObject::GncObject () { } // Check that the current element is of a version we are coded for -void GncObject::checkVersion (const QString& elName, const QXmlAttributes& elAttrs, const map_elementVersions& map) { +void GncObject::checkVersion (const TQString& elName, const TQXmlAttributes& elAttrs, const map_elementVersions& map) { TRY - if (map.contains(elName)) { // if it's not in the map, there's nothing to check - if (!map[elName].contains(elAttrs.value("version"))) { - QString em = i18n("%1: Sorry. This importer cannot handle version %2 of element %3") - .arg(__func__).arg(elAttrs.value("version")).arg(elName); + if (map.tqcontains(elName)) { // if it's not in the map, there's nothing to check + if (!map[elName].tqcontains(elAttrs.value("version"))) { + TQString em = i18n("%1: Sorry. This importer cannot handle version %2 of element %3") + .tqarg(__func__).tqarg(elAttrs.value("version")).tqarg(elName); throw new MYMONEYEXCEPTION (em); } } @@ -126,7 +126,7 @@ void GncObject::checkVersion (const QString& elName, const QXmlAttributes& elAtt } // Check if this element is in the current object's sub element list -GncObject *GncObject::isSubElement (const QString& elName, const QXmlAttributes& elAttrs) { +GncObject *GncObject::isSubElement (const TQString& elName, const TQXmlAttributes& elAttrs) { TRY uint i; GncObject *next = 0; @@ -146,7 +146,7 @@ GncObject *GncObject::isSubElement (const QString& elName, const QXmlAttributes& } // Check if this element is in the current object's data element list -bool GncObject::isDataElement (const QString &elName, const QXmlAttributes& elAttrs) { +bool GncObject::isDataElement (const TQString &elName, const TQXmlAttributes& elAttrs) { TRY uint i; for (i = 0; i < m_dataElementListCount; i++) { @@ -162,7 +162,7 @@ bool GncObject::isDataElement (const QString &elName, const QXmlAttributes& elAt } // return the variable string, decoded if required -QString GncObject::var (int i) const { +TQString GncObject::var (int i) const { return (pMain->m_decoder == 0 ? *(m_v.at(i)) : pMain->m_decoder->toUnicode (*(m_v.at(i)))); @@ -173,7 +173,7 @@ void GncObject::adjustHideFactor () { } // data anonymizer -QString GncObject::hide (QString data, unsigned int anonClass) { +TQString GncObject::hide (TQString data, unsigned int anonClass) { TRY if (!pMain->bAnonymize) return (data); // no anonymizing required // counters used to generate names for anonymizer @@ -181,35 +181,35 @@ QString GncObject::hide (QString data, unsigned int anonClass) { static int nextEquity; static int nextPayee; static int nextSched; - static QMap anonPayees; // to check for duplicate payee names - static QMap anonStocks; // for reference to equities + static TQMap anonPayees; // to check for duplicate payee names + static TQMap anonStocks; // for reference to equities - QString result (data); - QMap::Iterator it; + TQString result (data); + TQMap::Iterator it; MyMoneyMoney in, mresult; switch (anonClass) { case ASIS: break; // this is not personal data case SUPPRESS: result = ""; break; // this is personal and is not essential - case NXTACC: result = i18n("Account%1").arg(++nextAccount, -6); break; // generate account name + case NXTACC: result = i18n("Account%1").tqarg(++nextAccount, -6); break; // generate account name case NXTEQU: // generate/return an equity name - it = anonStocks.find (data); + it = anonStocks.tqfind (data); if (it == anonStocks.end()) { - result = i18n("Stock%1").arg(++nextEquity, -6); + result = i18n("Stock%1").tqarg(++nextEquity, -6); anonStocks.insert (data, result); } else { - result = (*it).data(); + result = (*it); } break; case NXTPAY: // genearet/return a payee name - it = anonPayees.find (data); + it = anonPayees.tqfind (data); if (it == anonPayees.end()) { - result = i18n("Payee%1").arg(++nextPayee, -6); + result = i18n("Payee%1").tqarg(++nextPayee, -6); anonPayees.insert (data, result); } else { - result = (*it).data(); + result = (*it); } break; - case NXTSCHD: result = i18n("Schedule%1").arg(++nextSched, -6); break; // generate a schedule name + case NXTSCHD: result = i18n("Schedule%1").tqarg(++nextSched, -6); break; // generate a schedule name case MONEY1: in = MyMoneyMoney(data); if (data == "-1/0") in = MyMoneyMoney (0); // spurious gnucash data - causes a crash sometimes @@ -240,7 +240,7 @@ void GncObject::debugDump () { } //***************************************************************** GncFile::GncFile () { - static const QString subEls[] = {"gnc:book", "gnc:count-data", "gnc:commodity", "price", + static const TQString subEls[] = {"gnc:book", "gnc:count-data", "gnc:commodity", "price", "gnc:account", "gnc:transaction", "gnc:template-transactions", "gnc:schedxaction" }; @@ -287,29 +287,29 @@ void GncFile::endSubEl(GncObject *subObj) { //****************************************** GncDate ********************************************* GncDate::GncDate () { m_subElementListCount = 0; - static const QString dEls[] = {"ts:date", "gdate"}; + static const TQString dEls[] = {"ts:date", "gdate"}; m_dataElementList = dEls; m_dataElementListCount = END_Date_DELS; static const unsigned int anonClasses[] = {ASIS, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); } GncDate::~GncDate() {} //*************************************GncCmdtySpec*************************************** GncCmdtySpec::GncCmdtySpec () { m_subElementListCount = 0; - static const QString dEls[] = {"cmdty:space", "cmdty:id"}; + static const TQString dEls[] = {"cmdty:space", "cmdty:id"}; m_dataElementList = dEls; m_dataElementListCount = END_CmdtySpec_DELS; static const unsigned int anonClasses[] = {ASIS, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); } GncCmdtySpec::~GncCmdtySpec () {} -QString GncCmdtySpec::hide(QString data, unsigned int) { +TQString GncCmdtySpec::hide(TQString data, unsigned int) { // hide equity names, but not currency names unsigned int newClass = ASIS; switch (m_state) { @@ -321,26 +321,26 @@ QString GncCmdtySpec::hide(QString data, unsigned int) { //************* GncKvp******************************************** GncKvp::GncKvp () { m_subElementListCount = END_Kvp_SELS; - static const QString subEls[] = {"slot"}; // kvp's may be nested + static const TQString subEls[] = {"slot"}; // kvp's may be nested m_subElementList = subEls; m_dataElementListCount = END_Kvp_DELS; - static const QString dataEls[] = {"slot:key", "slot:value"}; + static const TQString dataEls[] = {"slot:key", "slot:value"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_kvpList.setAutoDelete (true); } GncKvp::~GncKvp () {} -void GncKvp::dataEl (const QXmlAttributes& elAttrs) { +void GncKvp::dataEl (const TQXmlAttributes& elAttrs) { switch (m_state) { case VALUE: m_kvpType = elAttrs.value("type"); } m_dataPtr = m_v.at(m_state); - if (key().contains ("formula")) { + if (key().tqcontains ("formula")) { m_anonClass = MONEY2; } else { m_anonClass = ASIS; @@ -378,12 +378,12 @@ GncLot::~GncLot() {} GncCountData::GncCountData() { m_subElementListCount = 0; m_dataElementListCount = 0; - m_v.append (new QString ("")); // only 1 data item + m_v.append (new TQString ("")); // only 1 data item } GncCountData::~GncCountData () {} -void GncCountData::initiate (const QString&, const QXmlAttributes& elAttrs) { +void GncCountData::initiate (const TQString&, const TQXmlAttributes& elAttrs) { m_countType = elAttrs.value ("cd:type"); m_dataPtr = m_v.at(0); return ; @@ -413,12 +413,12 @@ void GncCountData::terminate () { //*********************************GncCommodity*************************************** GncCommodity::GncCommodity () { m_subElementListCount = 0; - static const QString dEls[] = {"cmdty:space", "cmdty:id", "cmdty:name", "cmdty:fraction"}; + static const TQString dEls[] = {"cmdty:space", "cmdty:id", "cmdty:name", "cmdty:fraction"}; m_dataElementList = dEls; m_dataElementListCount = END_Commodity_DELS; static const unsigned int anonClasses[] = {ASIS, NXTEQU, SUPPRESS, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); } GncCommodity::~GncCommodity () {} @@ -431,15 +431,15 @@ void GncCommodity::terminate() { } //************* GncPrice******************************************** GncPrice::GncPrice () { - static const QString subEls[] = {"price:commodity", "price:currency", "price:time"}; + static const TQString subEls[] = {"price:commodity", "price:currency", "price:time"}; m_subElementList = subEls; m_subElementListCount = END_Price_SELS; m_dataElementListCount = END_Price_DELS; - static const QString dataEls[] = {"price:value"}; + static const TQString dataEls[] = {"price:value"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_vpCommodity = NULL; m_vpCurrency = NULL; m_vpPriceDate = NULL; @@ -483,16 +483,16 @@ void GncPrice::terminate() { //************* GncAccount******************************************** GncAccount::GncAccount () { m_subElementListCount = END_Account_SELS; - static const QString subEls[] = {"act:commodity", "slot", "act:lots"}; + static const TQString subEls[] = {"act:commodity", "slot", "act:lots"}; m_subElementList = subEls; m_dataElementListCount = END_Account_DELS; - static const QString dataEls[] = {"act:id", "act:name", "act:description", - "act:type", "act:parent"}; + static const TQString dataEls[] = {"act:id", "act:name", "act:description", + "act:type", "act:tqparent"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, NXTACC, SUPPRESS, ASIS, ASIS}; m_anonClassList = anonClasses; m_kvpList.setAutoDelete (true); - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_vpCommodity = NULL; } @@ -534,18 +534,18 @@ void GncAccount::terminate() { //************* GncTransaction******************************************** GncTransaction::GncTransaction (bool processingTemplates) { m_subElementListCount = END_Transaction_SELS; - static const QString subEls[] = {"trn:currency", "trn:date-posted", "trn:date-entered", + static const TQString subEls[] = {"trn:currency", "trn:date-posted", "trn:date-entered", "trn:split", "slot"}; m_subElementList = subEls; m_dataElementListCount = END_Transaction_DELS; - static const QString dataEls[] = {"trn:id", "trn:num", "trn:description"}; + static const TQString dataEls[] = {"trn:id", "trn:num", "trn:description"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, SUPPRESS, NXTPAY}; m_anonClassList = anonClasses; adjustHideFactor(); m_template = processingTemplates; m_splitList.setAutoDelete (true); - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_vpCurrency = NULL; m_vpDateEntered = m_vpDatePosted = NULL; } @@ -602,15 +602,15 @@ void GncTransaction::terminate() { //************* GncSplit******************************************** GncSplit::GncSplit () { m_subElementListCount = END_Split_SELS; - static const QString subEls[] = {"split:reconcile-date"}; + static const TQString subEls[] = {"split:reconcile-date"}; m_subElementList = subEls; m_dataElementListCount = END_Split_DELS; - static const QString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value", + static const TQString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value", "split:quantity", "split:account"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, SUPPRESS, ASIS, MONEY1, MONEY1, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_vpDateReconciled = NULL; } @@ -639,15 +639,15 @@ void GncSplit::endSubEl(GncObject *subObj) { //************* GncTemplateSplit******************************************** GncTemplateSplit::GncTemplateSplit () { m_subElementListCount = END_TemplateSplit_SELS; - static const QString subEls[] = {"slot"}; + static const TQString subEls[] = {"slot"}; m_subElementList = subEls; m_dataElementListCount = END_TemplateSplit_DELS; - static const QString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value", + static const TQString dataEls[] = {"split:id", "split:memo", "split:reconciled-state", "split:value", "split:quantity", "split:account"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, SUPPRESS, ASIS, MONEY1, MONEY1, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_kvpList.setAutoDelete (true); } @@ -674,17 +674,17 @@ void GncTemplateSplit::endSubEl(GncObject *subObj) { //************* GncSchedule******************************************** GncSchedule::GncSchedule () { m_subElementListCount = END_Schedule_SELS; - static const QString subEls[] = {"sx:start", "sx:last", "sx:end", "gnc:freqspec", "gnc:recurrence","sx:deferredInstance"}; + static const TQString subEls[] = {"sx:start", "sx:last", "sx:end", "gnc:freqspec", "gnc:recurrence","sx:deferredInstance"}; m_subElementList = subEls; m_dataElementListCount = END_Schedule_DELS; - static const QString dataEls[] = {"sx:name", "sx:enabled", "sx:autoCreate", "sx:autoCreateNotify", + static const TQString dataEls[] = {"sx:name", "sx:enabled", "sx:autoCreate", "sx:autoCreateNotify", "sx:autoCreateDays", "sx:advanceCreateDays", "sx:advanceRemindDays", "sx:instanceCount", "sx:num-occur", "sx:rem-occur", "sx:templ-acct"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {NXTSCHD, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_vpStartDate = m_vpLastDate = m_vpEndDate = NULL; m_vpFreqSpec = NULL; m_vpRecurrence.clear(); @@ -735,15 +735,15 @@ void GncSchedule::terminate() { //************* GncFreqSpec******************************************** GncFreqSpec::GncFreqSpec () { m_subElementListCount = END_FreqSpec_SELS; - static const QString subEls[] = {"gnc:freqspec"}; + static const TQString subEls[] = {"gnc:freqspec"}; m_subElementList = subEls; m_dataElementListCount = END_FreqSpec_DELS; - static const QString dataEls[] = {"fs:ui_type", "fs:monthly", "fs:daily", "fs:weekly", "fs:interval", + static const TQString dataEls[] = {"fs:ui_type", "fs:monthly", "fs:daily", "fs:weekly", "fs:interval", "fs:offset", "fs:day"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, ASIS, ASIS, ASIS, ASIS, ASIS, ASIS }; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); m_fsList.setAutoDelete (true); } @@ -778,14 +778,14 @@ void GncFreqSpec::terminate() { //************* GncRecurrence******************************************** GncRecurrence::GncRecurrence () { m_subElementListCount = END_Recurrence_SELS; - static const QString subEls[] = {"recurrence:start"}; + static const TQString subEls[] = {"recurrence:start"}; m_subElementList = subEls; m_dataElementListCount = END_Recurrence_DELS; - static const QString dataEls[] = {"recurrence:mult", "recurrence:period_type"}; + static const TQString dataEls[] = {"recurrence:mult", "recurrence:period_type"}; m_dataElementList = dataEls; static const unsigned int anonClasses[] = {ASIS, ASIS}; m_anonClassList = anonClasses; - for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new QString ("")); + for (uint i = 0; i < m_dataElementListCount; i++) m_v.append (new TQString ("")); } GncRecurrence::~GncRecurrence () { @@ -819,7 +819,7 @@ void GncRecurrence::terminate() { return ; } -QString GncRecurrence::getFrequency() const { +TQString GncRecurrence::getFrequency() const { // This function converts a gnucash 2.2 recurrence specification into it's previous equivalent // This will all need re-writing when MTE finishes the schedule re-write if (periodType() == "once") return("once"); @@ -853,9 +853,9 @@ GncSchedDef::~GncSchedDef () {} /************************************************************************************************ XML Reader ************************************************************************************************/ -void XmlReader::processFile (QIODevice* pDevice) { - m_source = new QXmlInputSource (pDevice); // set up the Qt XML reader - m_reader = new QXmlSimpleReader; +void XmlReader::processFile (TQIODevice* pDevice) { + m_source = new TQXmlInputSource (pDevice); // set up the TQt XML reader + m_reader = new TQXmlSimpleReader; m_reader->setContentHandler (this); // go read the file if (!m_reader->parse (m_source)) { @@ -881,13 +881,13 @@ bool XmlReader::startDocument() { return (true); } -bool XmlReader::startElement (const QString&, const QString&, const QString& elName , - const QXmlAttributes& elAttrs) { +bool XmlReader::startElement (const TQString&, const TQString&, const TQString& elName , + const TQXmlAttributes& elAttrs) { try { if (pMain->gncdebug) qDebug ("XML start - %s", elName.latin1()); #ifdef _GNCFILEANON int i; - QString spaces; + TQString spaces; // anonymizer - write data if (elName == "gnc:book" || elName == "gnc:count-data" || elName == "book:id") lastType = -1; pMain->oStream << endl; @@ -934,7 +934,7 @@ bool XmlReader::startElement (const QString&, const QString&, const QString& elN } catch (MyMoneyException *e) { #ifndef _GNCFILEANON // we can't pass on exceptions here coz the XML reader won't catch them and we just abort - KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE); + KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE); qFatal ("%s", e->what().latin1()); #else qFatal ("%s", e->latin1()); @@ -943,11 +943,11 @@ bool XmlReader::startElement (const QString&, const QString&, const QString& elN return true; // to keep compiler happy } -bool XmlReader::endElement( const QString&, const QString&, const QString&elName ) { +bool XmlReader::endElement( const TQString&, const TQString&, const TQString&elName ) { try { if (pMain->xmldebug) qDebug ("XML end - %s", elName.latin1()); #ifdef _GNCFILEANON - QString spaces; + TQString spaces; switch (lastType) { case 2: indentCount -= 2; spaces.fill (' ', indentCount); pMain->oStream << endl << spaces.latin1(); break; @@ -958,7 +958,7 @@ bool XmlReader::endElement( const QString&, const QString&, const QString&elName m_co->resetDataPtr(); // so we don't get extraneous data loaded into the variables if (elName == m_co->getElName()) { // check if this is the end of the current object if (pMain->gncdebug) m_co->debugDump(); // dump the object data (temp) - // call the terminate routine, pop the stack, and advise the parent that it's done + // call the terminate routine, pop the stack, and advise the tqparent that it's done m_co->terminate(); GncObject *temp = m_co; m_os.pop(); @@ -969,7 +969,7 @@ bool XmlReader::endElement( const QString&, const QString&, const QString&elName } catch (MyMoneyException *e) { #ifndef _GNCFILEANON // we can't pass on exceptions here coz the XML reader won't catch them and we just abort - KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE); + KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE); qFatal ("%s", e->what().latin1()); #else qFatal ("%s", e->latin1()); @@ -978,19 +978,19 @@ bool XmlReader::endElement( const QString&, const QString&, const QString&elName return (true); // to keep compiler happy } -bool XmlReader::characters (const QString &data) { +bool XmlReader::characters (const TQString &data) { if (pMain->xmldebug) qDebug ("XML Data received - %d bytes", data.length()); - QString pData = data.stripWhiteSpace(); // data may contain line feeds and indentation spaces + TQString pData = data.stripWhiteSpace(); // data may contain line feeds and indentation spaces if (!pData.isEmpty()) { if (pMain->developerDebug) qDebug ("XML Data - %s", pData.latin1()); m_co->storeData (pData); //go store it #ifdef _GNCFILEANON - QString anonData = m_co->getData (); + TQString anonData = m_co->getData (); if (anonData.isEmpty()) anonData = pData; - // there must be a Qt standard way of doing the following but I can't ... find it - anonData.replace ('<', "<"); - anonData.replace ('>', ">"); - anonData.replace ('&', "&"); + // there must be a TQt standard way of doing the following but I can't ... find it + anonData.tqreplace ('<', "<"); + anonData.tqreplace ('>', ">"); + anonData.tqreplace ('&', "&"); pMain->oStream << anonData; // write original data lastType = 1; #endif // _GNCFILEANON @@ -1025,7 +1025,7 @@ MyMoneyGncReader::MyMoneyGncReader() { m_commodityCount = m_priceCount = m_accountCount = m_transactionCount = m_templateCount = m_scheduleCount = 0; m_decoder = 0; // build a list of valid versions - static const QString versionList[] = {"gnc:book 2.0.0", "gnc:commodity 2.0.0", "gnc:pricedb 1", + static const TQString versionList[] = {"gnc:book 2.0.0", "gnc:commodity 2.0.0", "gnc:pricedb 1", "gnc:account 2.0.0", "gnc:transaction 2.0.0", "gnc:schedxaction 1.0.0", "gnc:schedxaction 2.0.0", // for gnucash 2.2 onward "gnc:freqspec 1.0.0", "zzz" // zzz = stopper @@ -1040,7 +1040,7 @@ MyMoneyGncReader::~MyMoneyGncReader() {} //**************************** Main Entry Point ************************************ #ifndef _GNCFILEANON -void MyMoneyGncReader::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) { +void MyMoneyGncReader::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage) { Q_CHECK_PTR (pDevice); Q_CHECK_PTR (storage); @@ -1059,7 +1059,7 @@ void MyMoneyGncReader::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) terminate (); // do all the wind-up things ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::error(0, i18n("Import failed:\n\n%1").arg(e->what()), PACKAGE); + KMessageBox::error(0, i18n("Import failed:\n\n%1").tqarg(e->what()), PACKAGE); qFatal ("%s", e->what().latin1()); } // end catch signalProgress (0, 1, i18n("Import complete")); // switch off progress bar @@ -1069,10 +1069,10 @@ void MyMoneyGncReader::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) } #else // Control code for the file anonymizer -void MyMoneyGncReader::readFile(QString in, QString out) { - QFile pDevice (in); +void MyMoneyGncReader::readFile(TQString in, TQString out) { + TQFile pDevice (in); if (!pDevice.open (IO_ReadOnly)) qFatal ("Can't open input file"); - QFile outFile (out); + TQFile outFile (out); if (!outFile.open (IO_WriteOnly)) qFatal ("Can't open output file"); oStream.setDevice (&outFile); bAnonymize = true; @@ -1090,16 +1090,16 @@ void MyMoneyGncReader::readFile(QString in, QString out) { return ; } -#include +#include int main (int argc, char ** argv) { - QApplication a (argc, argv); + TQApplication a (argc, argv); MyMoneyGncReader m; - QString inFile, outFile; + TQString inFile, outFile; if (argc > 0) inFile = a.argv()[1]; if (argc > 1) outFile = a.argv()[2]; if (inFile.isEmpty()) { - inFile = QFileDialog::getOpenFileName("", + inFile = TQFileDialog::getOpenFileName("", "Gnucash files(*.nc *)", 0); } @@ -1113,15 +1113,15 @@ int main (int argc, char ** argv) { void MyMoneyGncReader::setFileHideFactor () { #define MINFILEHIDEF 0.01 #define MAXFILEHIDEF 99.99 - srand (QTime::currentTime().second()); // seed randomizer for anonymize + srand (TQTime::currentTime().second()); // seed randomizer for anonymize m_fileHideFactor = 0.0; while (m_fileHideFactor == 0.0) { - m_fileHideFactor = QInputDialog::getDouble ( + m_fileHideFactor = TQInputDialog::getDouble ( i18n ("Disguise your wealth"), i18n ("Each monetary value on your file will be multiplied by a random number between 0.01 and 1.99\n" "with a different value used for each transaction. In addition, to further disguise the true\n" "values, you may enter a number between %1 and %2 which will be applied to all values.\n" - "These numbers will not be stored in the file.").arg(MINFILEHIDEF).arg(MAXFILEHIDEF), + "These numbers will not be stored in the file.").tqarg(MINFILEHIDEF).tqarg(MAXFILEHIDEF), (1.0 + (int)(1000.0 * rand() / (RAND_MAX + 1.0))) / 100.0, MINFILEHIDEF, MAXFILEHIDEF, 2); } @@ -1192,22 +1192,22 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) { acc.setDescription(gac->desc()); - QDate currentDate = QDate::currentDate(); - acc.setOpeningDate(currentDate); - acc.setLastModified(currentDate); - acc.setLastReconciliationDate(currentDate); + TQDate tqcurrentDate = TQDate::tqcurrentDate(); + acc.setOpeningDate(tqcurrentDate); + acc.setLastModified(tqcurrentDate); + acc.setLastReconciliationDate(tqcurrentDate); if (gac->commodity()->isCurrency()) { acc.setCurrencyId (gac->commodity()->id().utf8()); m_currencyCount[gac->commodity()->id()]++; } - acc.setParentAccountId (gac->parent().utf8()); - // now determine the account type and its parent id + acc.setParentAccountId (gac->tqparent().utf8()); + // now determine the account type and its tqparent id /* This list taken from # Feb 2006: A RELAX NG Compact schema for gnucash "v2" XML files. # Copyright (C) 2006 Joshua Sled "NO_TYPE" "BANK" "CASH" "CREDIT" "ASSET" "LIABILITY" "STOCK" "MUTUAL" "CURRENCY" -"INCOME" "EXPENSE" "EQUITY" "RECEIVABLE" "PAYABLE" "CHECKING" "SAVINGS" "MONEYMRKT" "CREDITLINE" +"INCOME" "EXPENSE" "ETQUITY" "RECEIVABLE" "PAYABLE" "CHECKING" "SAVINGS" "MONEYMRKT" "CREDITLINE" Some don't seem to be used in practice. Not sure what CREDITLINE s/be converted as. */ if ("BANK" == gac->type() || "CHECKING" == gac->type()) { @@ -1230,7 +1230,7 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) { } else { acc.setAccountType(MyMoneyAccount::Stock); } - } else if ("EQUITY" == gac->type()) { + } else if ("ETQUITY" == gac->type()) { acc.setAccountType(MyMoneyAccount::Equity); } else if ("LIABILITY" == gac->type()) { acc.setAccountType(MyMoneyAccount::Liability); @@ -1247,12 +1247,12 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) { } else if ("MONEYMRKT" == gac->type()) { acc.setAccountType(MyMoneyAccount::MoneyMarket); } else { // we have here an account type we can't currently handle - QString em = - i18n("Current importer does not recognize GnuCash account type %1").arg(gac->type()); + TQString em = + i18n("Current importer does not recognize GnuCash account type %1").tqarg(gac->type()); throw new MYMONEYEXCEPTION (em); } - // if no parent account is present, assign to one of our standard accounts - if ((acc.parentAccountId().isEmpty()) || (acc.parentAccountId() == m_rootId)) { + // if no tqparent account is present, assign to one of our standard accounts + if ((acc.tqparentAccountId().isEmpty()) || (acc.tqparentAccountId() == m_rootId)) { switch (acc.accountGroup()) { case MyMoneyAccount::Asset: acc.setParentAccountId (m_storage->asset().id()); break; case MyMoneyAccount::Liability: acc.setParentAccountId (m_storage->liability().id()); break; @@ -1281,10 +1281,10 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) { // NB: In gnc, this selection is per account, in KMM, per security // This is unlikely to cause problems in practice. If it does, // we probably need to introduce a 'pricing basis' in the account class - QPtrListIterator kvpi (gac->m_kvpList); + TQPtrListIterator kvpi (gac->m_kvpList); GncKvp *k; while ((k = static_cast(kvpi.current())) != 0) { - if (k->key().contains("price-source") && k->type() == "string") { + if (k->key().tqcontains("price-source") && k->type() == "string") { getPriceSource (e, k->value()); break; } else { @@ -1294,10 +1294,10 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) { } // check for tax-related status - QPtrListIterator kvpi (gac->m_kvpList); + TQPtrListIterator kvpi (gac->m_kvpList); GncKvp *k; while ((k = static_cast(kvpi.current())) != 0) { - if (k->key().contains("tax-related") && k->type() == "integer" && k->value() == "1") { + if (k->key().tqcontains("tax-related") && k->type() == "integer" && k->value() == "1") { acc.setValue ("Tax", "Yes"); break; } else { @@ -1310,9 +1310,9 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) { m_storage->addAccount(acc); m_mapIds[gac->id().utf8()] = acc.id(); // to link gnucash id to ours for tx posting - if (gncdebug) qDebug("Gnucash account %s has id of %s, type of %s, parent is %s", + if (gncdebug) qDebug("Gnucash account %s has id of %s, type of %s, tqparent is %s", gac->id().latin1(), acc.id().data(), - KMyMoneyUtils::accountTypeToString(acc.accountType()).latin1(), acc.parentAccountId().data()); + KMyMoneyUtils::accountTypeToString(acc.accountType()).latin1(), acc.tqparentAccountId().data()); signalProgress (++m_accountCount, 0); return ; @@ -1365,7 +1365,7 @@ void MyMoneyGncReader::convertTransaction (const GncTransaction *gtx) { const GncKvp *slot = gtx->getKvp(i); if (slot->key() == "notes") tx.setMemo(slot->value()); } - QValueList::iterator it = m_splitList.begin(); + TQValueList::iterator it = m_splitList.begin(); while (!m_splitList.isEmpty()) { split = *it; // at this point, if m_potentialTransfer is still true, it is actually one! @@ -1389,8 +1389,8 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) { MyMoneySplit split; MyMoneyAccount splitAccount; // find the kmm account id coresponding to the gnc id - QString kmmAccountId; - map_accountIds::Iterator id = m_mapIds.find(gsp->acct().utf8()); + TQString kmmAccountId; + map_accountIds::Iterator id = m_mapIds.tqfind(gsp->acct().utf8()); if (id != m_mapIds.end()) { kmmAccountId = id.data(); } else { // for the case where the acs not found (which shouldn't happen?), create an account with gnc name @@ -1406,7 +1406,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) { // payee id split.setPayeeId (m_txPayeeId.utf8()); // reconciled state and date - switch (gsp->recon().at(0).latin1()) { + switch (gsp->recon().tqat(0).latin1()) { case 'n': split.setReconcileFlag(MyMoneySplit::NotReconciled); break; case 'c': @@ -1425,7 +1425,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) { MyMoneyMoney splitValue (convBadValue (gsp->value())); if (gsp->value() == "-1/0") { // treat gnc invalid value as zero // it's not quite a consistency check, but easier to treat it as such - postMessage ("CC", 4, splitAccount.name().latin1(), m_txDatePosted.toString(Qt::ISODate).latin1()); + postMessage ("CC", 4, splitAccount.name().latin1(), TQString(m_txDatePosted.toString(Qt::ISODate)).latin1()); } MyMoneyMoney splitQuantity(convBadValue(gsp->qty())); split.setValue (splitValue); @@ -1466,7 +1466,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) { e.setTradingCurrency (m_txCommodity); if (gncdebug) qDebug ("added price for %s, %s date %s", e.name().latin1(), newPrice.toString().latin1(), - m_txDatePosted.toString(Qt::ISODate).latin1()); + TQString(m_txDatePosted.toString(Qt::ISODate)).latin1()); m_storage->modifySecurity(e); MyMoneyPrice dealPrice (e.id(), m_txCommodity, m_txDatePosted, newPrice, i18n("Imported Transaction")); m_storage->addPrice (dealPrice); @@ -1479,7 +1479,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) { if (split.value().isNegative()) { bool isNumeric = false; if (!split.number().isEmpty()) { - split.number().toLong(&isNumeric); // No QString.isNumeric()?? + split.number().toLong(&isNumeric); // No TQString.isNumeric()?? } if (isNumeric) { split.setAction (MyMoneySplit::ActionCheck); @@ -1510,7 +1510,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) { return ; } //********************************* convertTemplateTransaction ********************************************** -MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString& schedName, const GncTransaction *gtx) { +MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const TQString& schedName, const GncTransaction *gtx) { Q_CHECK_PTR (gtx); MyMoneyTransaction tx; @@ -1540,7 +1540,7 @@ MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString& convertTemplateSplit (schedName, static_cast(gtx->getSplit (i))); } // determine the action type for the splits and link them to the template tx - /*QString negativeActionType, positiveActionType; + /*TQString negativeActionType, positiveActionType; if (!m_splitList.isEmpty()) { // if there are asset splits positiveActionType = MyMoneySplit::ActionDeposit; negativeActionType = MyMoneySplit::ActionWithdrawal; @@ -1554,8 +1554,8 @@ MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString& // also, determine the action type. first off, is it a transfer (can only have 2 splits?) if (m_splitList.count() != 2) m_potentialTransfer = false; // at this point, if m_potentialTransfer is still true, it is actually one! - QString txMemo = ""; - QValueList::iterator it = m_splitList.begin(); + TQString txMemo = ""; + TQValueList::iterator it = m_splitList.begin(); while (!m_splitList.isEmpty()) { split = *it; if (m_potentialTransfer) { @@ -1583,7 +1583,7 @@ MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction (const QString& return (tx); } //********************************* convertTemplateSplit **************************************************** -void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const GncTemplateSplit *gsp) { +void MyMoneyGncReader::convertTemplateSplit (const TQString& schedName, const GncTemplateSplit *gsp) { Q_CHECK_PTR (gsp); // convertTemplateSplit MyMoneySplit split; @@ -1601,14 +1601,14 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc // read split slots (KVPs) int xactionCount = 0; int validSlotCount = 0; - QString gncAccountId; + TQString gncAccountId; for (i = 0; i < gsp->kvpCount(); i++ ) { const GncKvp *slot = gsp->getKvp(i); if ((slot->key() == "sched-xaction") && (slot->type() == "frame")) { bool bFoundStringCreditFormula = false; bool bFoundStringDebitFormula = false; bool bFoundGuidAccountId = false; - QString gncCreditFormula, gncDebitFormula; + TQString gncCreditFormula, gncDebitFormula; for (j = 0; j < slot->kvpCount(); j++) { const GncKvp *subSlot = slot->getKvp (j); // again, see comments above. when we have a full specification @@ -1635,7 +1635,7 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc // validate numeric, work out sign MyMoneyMoney exFormula (0); exFormula.setNegativeMonetarySignPosition (MyMoneyMoney::BeforeQuantityMoney); - QString numericTest; + TQString numericTest; char crdr=0 ; if (!gncCreditFormula.isEmpty()) { crdr = 'C'; @@ -1646,10 +1646,10 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc } kMyMoneyMoneyValidator v (0); int pos; // useless, but required for validator - if (v.validate (numericTest, pos) == QValidator::Acceptable) { + if (v.validate (numericTest, pos) == TQValidator::Acceptable) { switch (crdr) { case 'C': - exFormula = QString ("-" + numericTest); break; + exFormula = TQString ("-" + numericTest); break; case 'D': exFormula = numericTest; } @@ -1678,8 +1678,8 @@ void MyMoneyGncReader::convertTemplateSplit (const QString& schedName, const Gnc m_suspectSchedule = true; } // find the kmm account id coresponding to the gnc id - QString kmmAccountId; - map_accountIds::Iterator id = m_mapIds.find(gncAccountId.utf8()); + TQString kmmAccountId; + map_accountIds::Iterator id = m_mapIds.tqfind(gncAccountId.utf8()); if (id != m_mapIds.end()) { kmmAccountId = id.data(); } else { // for the case where the acs not found (which shouldn't happen?), create an account with gnc name @@ -1716,15 +1716,15 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { MyMoneySchedule sc; MyMoneyTransaction tx; m_suspectSchedule = false; - QDate startDate, nextDate, lastDate, endDate; // for date calculations - QDate today = QDate::currentDate(); + TQDate startDate, nextDate, lastDate, endDate; // for date calculations + TQDate today = TQDate::tqcurrentDate(); int numOccurs, remOccurs; if (m_scheduleCount == 0) signalProgress (0, m_gncScheduleCount, i18n("Loading schedules...")); // schedule name sc.setName(gsc->name()); // find the transaction template as stored earlier - QPtrListIterator itt (m_templateList); + TQPtrListIterator itt (m_templateList); GncTransaction *ttx; while ((ttx = itt.current()) != 0) { // the id to match against is the split:account value in the splits @@ -1732,7 +1732,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { ++itt; } if (itt == 0) { - throw new MYMONEYEXCEPTION (i18n("Can't find template transaction for schedule %1").arg(sc.name())); + throw new MYMONEYEXCEPTION (i18n("Can't find template transaction for schedule %1").tqarg(sc.name())); } else { tx = convertTemplateTransaction (sc.name(), *itt); } @@ -1740,7 +1740,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { // define the conversion table for intervals struct convIntvl { - QString gncType; // the gnucash name + TQString gncType; // the gnucash name unsigned char interval; // for date calculation unsigned int intervalCount; MyMoneySchedule::occurenceE occ; // equivalent occurence code @@ -1765,7 +1765,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { {"monthly", 'm', 1, MyMoneySchedule::OCCUR_MONTHLY, MyMoneySchedule::MoveNothing }, {"two-monthly", 'm', 2, MyMoneySchedule::OCCUR_EVERYOTHERMONTH, MyMoneySchedule::MoveNothing }, - {"quarterly", 'm', 3, MyMoneySchedule::OCCUR_QUARTERLY, MyMoneySchedule::MoveNothing }, + {"quarterly", 'm', 3, MyMoneySchedule::OCCUR_TQUARTERLY, MyMoneySchedule::MoveNothing }, {"tri_annually", 'm', 4, MyMoneySchedule::OCCUR_EVERYFOURMONTHS, MyMoneySchedule::MoveNothing }, {"semi_yearly", 'm', 6, MyMoneySchedule::OCCUR_TWICEYEARLY, MyMoneySchedule::MoveNothing }, {"yearly", 'y', 1, MyMoneySchedule::OCCUR_YEARLY, MyMoneySchedule::MoveNothing }, @@ -1775,16 +1775,16 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { // zzz = stopper, may cause problems. what else can we do? }; - QString frequency = "unknown"; // set default to unknown frequency + TQString frequency = "unknown"; // set default to unknown frequency bool unknownOccurs = false; // may have zero, or more than one frequency/recurrence spec - QString schedEnabled; + TQString schedEnabled; if (gsc->version() == "2.0.0") { if (gsc->m_vpRecurrence.count() != 1) { unknownOccurs = true; } else { const GncRecurrence *gre = gsc->m_vpRecurrence.first(); - //qDebug (QString("Sched %1, pt %2, mu %3, sd %4").arg(gsc->name()).arg(gre->periodType()) - // .arg(gre->mult()).arg(gre->startDate().toString(Qt::ISODate))); + //qDebug (TQString("Sched %1, pt %2, mu %3, sd %4").tqarg(gsc->name()).tqarg(gre->periodType()) + // .tqarg(gre->mult()).tqarg(gre->startDate().toString(Qt::ISODate))); frequency = gre->getFrequency(); schedEnabled = gsc->enabled(); } @@ -1821,7 +1821,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { // if a last date was specified, use it, otherwise try to work out the last date sc.setLastPayment(gsc->lastDate()); numOccurs = gsc->numOccurs().toInt(); - if (sc.lastPayment() == QDate()) { + if (sc.lastPayment() == TQDate()) { nextDate = lastDate = gsc->startDate(); while ((nextDate < today) && (numOccurs-- != 0)) { lastDate = nextDate; @@ -1837,7 +1837,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { sc.setEndDate(gsc->endDate()); numOccurs = gsc->numOccurs().toInt(); remOccurs = gsc->remOccurs().toInt(); - if ((sc.endDate() == QDate()) && (remOccurs > 0)) { + if ((sc.endDate() == TQDate()) && (remOccurs > 0)) { endDate = sc.lastPayment(); while (remOccurs-- > 0) { endDate = incrDate (endDate, vi[i].interval, vi[i].intervalCount); @@ -1853,11 +1853,11 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) { sc.setPaymentType((MyMoneySchedule::paymentTypeE)MyMoneySchedule::STYPE_OTHER); sc.setFixed (!m_suspectSchedule); // if any probs were found, set it as variable so user will always be prompted // we don't currently have a 'disable' option, but just make sure auto-enter is off if not enabled - //qDebug(QString("%1 and %2").arg(gsc->autoCreate()).arg(schedEnabled)); + //qDebug(TQString("%1 and %2").tqarg(gsc->autoCreate()).tqarg(schedEnabled)); sc.setAutoEnter ((gsc->autoCreate() == "y") && (schedEnabled == "y")); - //qDebug(QString("autoEnter set to %1").arg(sc.autoEnter())); + //qDebug(TQString("autoEnter set to %1").tqarg(sc.autoEnter())); // type - QString actionType = tx.splits().first().action(); + TQString actionType = tx.splits().first().action(); if (actionType == MyMoneySplit::ActionDeposit) { sc.setType((MyMoneySchedule::typeE)MyMoneySchedule::TYPE_DEPOSIT); } else if (actionType == MyMoneySplit::ActionTransfer) { @@ -1902,51 +1902,51 @@ void MyMoneyGncReader::terminate () { } // first step is to implement the users investment option, now we // have all the accounts available - QValueList::iterator stocks; + TQValueList::iterator stocks; for (stocks = m_stockList.begin(); stocks != m_stockList.end(); ++stocks) { checkInvestmentOption (*stocks); } - // Next step is to walk the list and assign the parent/child relationship between the objects. + // Next step is to walk the list and assign the tqparent/child relationship between the objects. unsigned int i = 0; signalProgress (0, m_accountCount, i18n ("Reorganizing accounts...")); - QValueList list; - QValueList::Iterator acc; + TQValueList list; + TQValueList::Iterator acc; m_storage->accountList(list); for (acc = list.begin(); acc != list.end(); ++acc) { - if ((*acc).parentAccountId() == m_storage->asset().id()) { + if ((*acc).tqparentAccountId() == m_storage->asset().id()) { MyMoneyAccount assets = m_storage->asset(); m_storage->addAccount(assets, (*acc)); if (gncdebug) qDebug("Account id %s is a child of the main asset account", (*acc).id().data()); - } else if ((*acc).parentAccountId() == m_storage->liability().id()) { + } else if ((*acc).tqparentAccountId() == m_storage->liability().id()) { MyMoneyAccount liabilities = m_storage->liability(); m_storage->addAccount(liabilities, (*acc)); if (gncdebug) qDebug("Account id %s is a child of the main liability account", (*acc).id().data()); - } else if ((*acc).parentAccountId() == m_storage->income().id()) { + } else if ((*acc).tqparentAccountId() == m_storage->income().id()) { MyMoneyAccount incomes = m_storage->income(); m_storage->addAccount(incomes, (*acc)); if (gncdebug) qDebug("Account id %s is a child of the main income account", (*acc).id().data()); - } else if ((*acc).parentAccountId() == m_storage->expense().id()) { + } else if ((*acc).tqparentAccountId() == m_storage->expense().id()) { MyMoneyAccount expenses = m_storage->expense(); m_storage->addAccount(expenses, (*acc)); if (gncdebug) qDebug("Account id %s is a child of the main expense account", (*acc).id().data()); - } else if ((*acc).parentAccountId() == m_storage->equity().id()) { + } else if ((*acc).tqparentAccountId() == m_storage->equity().id()) { MyMoneyAccount equity = m_storage->equity(); m_storage->addAccount(equity, (*acc)); if (gncdebug) qDebug("Account id %s is a child of the main equity account", (*acc).id().data()); - } else if ((*acc).parentAccountId() == m_rootId) { + } else if ((*acc).tqparentAccountId() == m_rootId) { if (gncdebug) qDebug("Account id %s is a child of root", (*acc).id().data()); } else { - // it is not under one of the main accounts, so find gnucash parent - QString parentKey = (*acc).parentAccountId(); - if (gncdebug) qDebug ("acc %s, parent %s", (*acc).id().data(), - (*acc).parentAccountId().data()); - map_accountIds::Iterator id = m_mapIds.find(parentKey); + // it is not under one of the main accounts, so find gnucash tqparent + TQString tqparentKey = (*acc).tqparentAccountId(); + if (gncdebug) qDebug ("acc %s, tqparent %s", (*acc).id().data(), + (*acc).tqparentAccountId().data()); + map_accountIds::Iterator id = m_mapIds.tqfind(tqparentKey); if (id != m_mapIds.end()) { - if (gncdebug) qDebug("Setting account id %s's parent account id to %s", + if (gncdebug) qDebug("Setting account id %s's tqparent account id to %s", (*acc).id().data(), id.data().data()); - MyMoneyAccount parent = m_storage->account(id.data()); - parent = checkConsistency (parent, (*acc)); - m_storage->addAccount (parent, (*acc)); + MyMoneyAccount tqparent = m_storage->account(id.data()); + tqparent = checkConsistency (tqparent, (*acc)); + m_storage->addAccount (tqparent, (*acc)); } else { throw new MYMONEYEXCEPTION ("terminate() could not find account id"); } @@ -1955,9 +1955,9 @@ void MyMoneyGncReader::terminate () { } // end for account signalProgress (0, 1, (".")); // debug - get rid of reorg message // offer the most common account currency as a default - QString mainCurrency = ""; + TQString mainCurrency = ""; unsigned int maxCount = 0; - QMap::ConstIterator it; + TQMap::ConstIterator it; for (it = m_currencyCount.begin(); it != m_currencyCount.end(); ++it) { if (it.data() > maxCount) { maxCount = it.data(); @@ -1966,12 +1966,12 @@ void MyMoneyGncReader::terminate () { } if (mainCurrency != "") { - /* fix for qt3.3.4?. According to Qt docs, this should return the enum id of the button pressed, and + /* fix for qt3.3.4?. According to TQt docs, this should return the enum id of the button pressed, and indeed it used to do so. However now it seems to return the index of the button. In this case it doesn't matter, since for Yes, the id is 3 and the index is 0, whereas the No button will return 4 or 1. So we test for either Yes case */ /* and now it seems to have changed again, returning 259 for a Yes??? so use KMessagebox */ - QString question = i18n("Your main currency seems to be %1 (%2); do you want to set this as your base currency?") - .arg(mainCurrency).arg(m_storage->currency(mainCurrency.utf8()).name()); + TQString question = i18n("Your main currency seems to be %1 (%2); do you want to set this as your base currency?") + .tqarg(mainCurrency).tqarg(m_storage->currency(mainCurrency.utf8()).name()); if(KMessageBox::questionYesNo(0, question, PACKAGE) == KMessageBox::Yes) { m_storage->setValue ("kmm-baseCurrency", mainCurrency); } @@ -1983,7 +1983,7 @@ void MyMoneyGncReader::terminate () { if ((*m_messageList.at(i)).source == "OR") m_orCount++; if ((*m_messageList.at(i)).source == "SC") m_scCount++; } - QValueList sectionsToReport; // list of sections needing report + TQValueList sectionsToReport; // list of sections needing report sectionsToReport.append ("MN"); // always build the main section if (m_ccCount > 0) sectionsToReport.append ("CC"); if (m_orCount > 0) sectionsToReport.append ("OR"); @@ -1991,11 +1991,11 @@ void MyMoneyGncReader::terminate () { // produce the sections in message boxes bool exit = false; for (i = 0; (i < sectionsToReport.count()) && !exit; i++) { - QString button0Text = i18n("More"); + TQString button0Text = i18n("More"); if (i + 1 == sectionsToReport.count()) button0Text = i18n("Done"); // last section - KGuiItem yesItem(button0Text, QIconSet(), "", ""); - KGuiItem noItem(i18n("Save Report"), QIconSet(), "", ""); + KGuiItem yesItem(button0Text, TQIconSet(), "", ""); + KGuiItem noItem(i18n("Save Report"), TQIconSet(), "", ""); switch(KMessageBox::questionYesNoCancel(0, buildReportSection (*sectionsToReport.at(i)), @@ -2015,7 +2015,7 @@ void MyMoneyGncReader::terminate () { for (i = 0; i < m_suspectList.count(); i++) { MyMoneySchedule sc = m_storage->schedule(m_suspectList[i]); KEditScheduleDlg *s; - switch(KMessageBox::warningYesNo(0, i18n("Problems were encountered in converting schedule '%1'.\nDo you want to review or edit it now?").arg(sc.name()), PACKAGE)) { + switch(KMessageBox::warningYesNo(0, i18n("Problems were encountered in converting schedule '%1'.\nDo you want to review or edit it now?").tqarg(sc.name()), PACKAGE)) { case KMessageBox::Yes: s = new KEditScheduleDlg (sc); // FIXME: connect newCategory to something useful, so that we @@ -2032,36 +2032,36 @@ void MyMoneyGncReader::terminate () { PASS } //************************************ buildReportSection************************************ -QString MyMoneyGncReader::buildReportSection (const QString& source) { +TQString MyMoneyGncReader::buildReportSection (const TQString& source) { TRY - QString s = ""; + TQString s = ""; bool more = false; if (source == "MN") { s.append (i18n("Found:\n\n")); - s.append (QString::number(m_commodityCount) + i18n(" commodities (equities)\n")); - s.append (QString::number(m_priceCount) + i18n(" prices\n")); - s.append (QString::number(m_accountCount) + i18n(" accounts\n")); - s.append (QString::number(m_transactionCount) + i18n(" transactions\n")); - s.append (QString::number(m_scheduleCount) + i18n(" schedules\n")); + s.append (TQString::number(m_commodityCount) + i18n(" commodities (equities)\n")); + s.append (TQString::number(m_priceCount) + i18n(" prices\n")); + s.append (TQString::number(m_accountCount) + i18n(" accounts\n")); + s.append (TQString::number(m_transactionCount) + i18n(" transactions\n")); + s.append (TQString::number(m_scheduleCount) + i18n(" schedules\n")); s.append ("\n\n"); if (m_ccCount == 0) { s.append (i18n("No inconsistencies were detected")); } else { - s.append (QString::number(m_ccCount) + i18n(" inconsistencies were detected and corrected\n")); + s.append (TQString::number(m_ccCount) + i18n(" inconsistencies were detected and corrected\n")); more = true; } if (m_orCount > 0) { s.append ("\n\n"); - s.append (QString::number(m_orCount) + i18n(" orphan accounts were created\n")); + s.append (TQString::number(m_orCount) + i18n(" orphan accounts were created\n")); more = true; } if (m_scCount > 0) { s.append ("\n\n"); - s.append (QString::number(m_scCount) + i18n(" possible schedule problems were noted\n")); + s.append (TQString::number(m_scCount) + i18n(" possible schedule problems were noted\n")); more = true; } - QString unsupported (""); - QString lineSep ("\n - "); + TQString unsupported (""); + TQString lineSep ("\n - "); if (m_smallBusinessFound) unsupported.append(lineSep + i18n("Small Business Features (Customers, Invoices, etc.)")); if (m_budgetsFound) unsupported.append(lineSep + i18n("Budgets")); if (m_lotsFound) unsupported.append(lineSep + i18n("Lots")); @@ -2076,9 +2076,9 @@ QString MyMoneyGncReader::buildReportSection (const QString& source) { for (i = 0; i < m_messageList.count(); i++) { GncMessageArgs *m = m_messageList.at(i); if (m->source == source) { - if (gncdebug) qDebug("%s", QString("build text source %1, code %2, argcount %3") - .arg(m->source).arg(m->code).arg(m->args.count()).data()); - QString ss = GncMessages::text (m->source, m->code); + if (gncdebug) qDebug("%s", TQString("build text source %1, code %2, argcount %3") + .tqarg(m->source).tqarg(m->code).tqarg(m->args.count()).data()); + TQString ss = GncMessages::text (m->source, m->code); // add variable args. the .arg function seems always to replace the // lowest numbered placeholder it finds, so translating messages // with variables in a different order should still work okay (I think...) @@ -2088,26 +2088,26 @@ QString MyMoneyGncReader::buildReportSection (const QString& source) { } } if (gncdebug) qDebug ("%s", s.latin1()); - return (static_cast(s)); + return (static_cast(s)); PASS } //************************ writeReportToFile********************************* -bool MyMoneyGncReader::writeReportToFile (const QValueList& sectionsToReport) { +bool MyMoneyGncReader::writeReportToFile (const TQValueList& sectionsToReport) { TRY unsigned int i; - QFileDialog* fd = new QFileDialog (0, "Save report as", TRUE); - fd->setMode (QFileDialog::AnyFile); - if (fd->exec() != QDialog::Accepted) { + TQFileDialog* fd = new TQFileDialog (0, "Save report as", TRUE); + fd->setMode (TQFileDialog::AnyFile); + if (fd->exec() != TQDialog::Accepted) { delete fd; return (false); } - QFile reportFile(fd->selectedFile()); - QFileInfo fi (reportFile); + TQFile reportFile(fd->selectedFile()); + TQFileInfo fi (reportFile); if (!reportFile.open (IO_WriteOnly)) { delete fd; return (false); } - QTextStream stream (&reportFile); + TQTextStream stream (&reportFile); for (i = 0; i < sectionsToReport.count(); i++) { stream << buildReportSection (*sectionsToReport.at(i)).latin1() << endl; } @@ -2121,7 +2121,7 @@ bool MyMoneyGncReader::writeReportToFile (const QValueList& sectionsToR *****************************************************************************/ //************************ createPayee *************************** -QString MyMoneyGncReader::createPayee (const QString& gncDescription) { +TQString MyMoneyGncReader::createPayee (const TQString& gncDescription) { MyMoneyPayee payee; try { payee = m_storage->payeeByName (gncDescription); @@ -2133,13 +2133,13 @@ QString MyMoneyGncReader::createPayee (const QString& gncDescription) { return (payee.id()); } //************************************** createOrphanAccount ******************************* -QString MyMoneyGncReader::createOrphanAccount (const QString& gncName) { +TQString MyMoneyGncReader::createOrphanAccount (const TQString& gncName) { MyMoneyAccount acc; acc.setName ("orphan_" + gncName); acc.setDescription (i18n("Orphan created from unknown gnucash account")); - QDate today = QDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); acc.setOpeningDate (today); acc.setLastModified (today); @@ -2150,11 +2150,11 @@ QString MyMoneyGncReader::createOrphanAccount (const QString& gncName) { m_storage->addAccount (acc); // assign the gnucash id as the key into the map to find our id m_mapIds[gncName.utf8()] = acc.id(); - postMessage ("OR", 1, acc.name().data()); + postMessage (TQString("OR"), 1, acc.name().ascii()); return (acc.id()); } //****************************** incrDate ********************************************* -QDate MyMoneyGncReader::incrDate (QDate lastDate, unsigned char interval, unsigned int intervalCount) { +TQDate MyMoneyGncReader::incrDate (TQDate lastDate, unsigned char interval, unsigned int intervalCount) { TRY switch (interval) { case 'd': @@ -2169,79 +2169,79 @@ QDate MyMoneyGncReader::incrDate (QDate lastDate, unsigned char interval, unsign return (lastDate); } throw new MYMONEYEXCEPTION (i18n("Internal error - invalid interval char in incrDate")); - QDate r = QDate(); return (r); // to keep compiler happy + TQDate r = TQDate(); return (r); // to keep compiler happy PASS } //********************************* checkConsistency ********************************** -MyMoneyAccount MyMoneyGncReader::checkConsistency (MyMoneyAccount& parent, MyMoneyAccount& child) { +MyMoneyAccount MyMoneyGncReader::checkConsistency (MyMoneyAccount& tqparent, MyMoneyAccount& child) { TRY // gnucash is flexible/weird enough to allow various inconsistencies // these are a couple I found in my file, no doubt more will be discovered if ((child.accountType() == MyMoneyAccount::Investment) && - (parent.accountType() != MyMoneyAccount::Asset)) { + (tqparent.accountType() != MyMoneyAccount::Asset)) { postMessage ("CC", 1, child.name().latin1()); return m_storage->asset(); } if ((child.accountType() == MyMoneyAccount::Income) && - (parent.accountType() != MyMoneyAccount::Income)) { + (tqparent.accountType() != MyMoneyAccount::Income)) { postMessage ("CC", 2, child.name().latin1()); return m_storage->income(); } if ((child.accountType() == MyMoneyAccount::Expense) && - (parent.accountType() != MyMoneyAccount::Expense)) { + (tqparent.accountType() != MyMoneyAccount::Expense)) { postMessage ("CC", 3, child.name().latin1()); return m_storage->expense(); } - return (parent); + return (tqparent); PASS } //*********************************** checkInvestmentOption ************************* -void MyMoneyGncReader::checkInvestmentOption (QString stockId) { +void MyMoneyGncReader::checkInvestmentOption (TQString stockId) { // implement the investment option for stock accounts - // first check whether the parent account (gnucash id) is actually an + // first check whether the tqparent account (gnucash id) is actually an // investment account. if it is, no further action is needed MyMoneyAccount stockAcc = m_storage->account (m_mapIds[stockId.utf8()]); - MyMoneyAccount parent; - QString parentKey = stockAcc.parentAccountId(); - map_accountIds::Iterator id = m_mapIds.find (parentKey); + MyMoneyAccount tqparent; + TQString tqparentKey = stockAcc.tqparentAccountId(); + map_accountIds::Iterator id = m_mapIds.tqfind (tqparentKey); if (id != m_mapIds.end()) { - parent = m_storage->account (id.data()); - if (parent.accountType() == MyMoneyAccount::Investment) return ; + tqparent = m_storage->account (id.data()); + if (tqparent.accountType() == MyMoneyAccount::Investment) return ; } // so now, check the investment option requested by the user // option 0 creates a separate investment account for each stock account if (m_investmentOption == 0) { MyMoneyAccount invAcc (stockAcc); invAcc.setAccountType (MyMoneyAccount::Investment); - invAcc.setCurrencyId (QString("")); // we don't know what currency it is!! - invAcc.setParentAccountId (parentKey); // intersperse it between old parent and child stock acct + invAcc.setCurrencyId (TQString("")); // we don't know what currency it is!! + invAcc.setParentAccountId (tqparentKey); // intersperse it between old tqparent and child stock acct m_storage->addAccount (invAcc); - m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets parented (again) to investment account later - if (gncdebug) qDebug ("Created investment account %s as id %s, parent %s", invAcc.name().data(), invAcc.id().data(), - invAcc.parentAccountId().data()); + m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets tqparented (again) to investment account later + if (gncdebug) qDebug ("Created investment account %s as id %s, tqparent %s", invAcc.name().data(), invAcc.id().data(), + invAcc.tqparentAccountId().data()); if (gncdebug) qDebug ("Setting stock %s, id %s, as child of %s", stockAcc.name().data(), stockAcc.id().data(), invAcc.id().data()); stockAcc.setParentAccountId (invAcc.id()); m_storage->addAccount(invAcc, stockAcc); // investment option 1 creates a single investment account for all stocks } else if (m_investmentOption == 1) { - static QString singleInvAccId = ""; + static TQString singleInvAccId = ""; MyMoneyAccount singleInvAcc; bool ok = false; if (singleInvAccId.isEmpty()) { // if the account has not yet been created - QString invAccName; + TQString invAccName; while (!ok) { - invAccName = QInputDialog::getText (PACKAGE, - i18n("Enter the investment account name "), QLineEdit::Normal, + invAccName = TQInputDialog::getText (PACKAGE, + i18n("Enter the investment account name "), TQLineEdit::Normal, i18n("My Investments"), &ok); } singleInvAcc.setName (invAccName); singleInvAcc.setAccountType (MyMoneyAccount::Investment); - singleInvAcc.setCurrencyId (QString("")); + singleInvAcc.setCurrencyId (TQString("")); singleInvAcc.setParentAccountId (m_storage->asset().id()); m_storage->addAccount (singleInvAcc); - m_mapIds [singleInvAcc.id()] = singleInvAcc.id(); // so stock account gets parented (again) to investment account later - if (gncdebug) qDebug ("Created investment account %s as id %s, parent %s, reparenting stock", - singleInvAcc.name().data(), singleInvAcc.id().data(), singleInvAcc.parentAccountId().data()); + m_mapIds [singleInvAcc.id()] = singleInvAcc.id(); // so stock account gets tqparented (again) to investment account later + if (gncdebug) qDebug ("Created investment account %s as id %s, tqparent %s, reparenting stock", + singleInvAcc.name().data(), singleInvAcc.id().data(), singleInvAcc.tqparentAccountId().data()); singleInvAccId = singleInvAcc.id(); } else { // the account has already been created singleInvAcc = m_storage->account (singleInvAccId); @@ -2254,9 +2254,9 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { } else if (m_investmentOption == 2) { static int lastSelected = 0; MyMoneyAccount invAcc (stockAcc); - QStringList accList; - QValueList list; - QValueList::Iterator acc; + TQStringList accList; + TQValueList list; + TQValueList::Iterator acc; m_storage->accountList(list); // build a list of candidates for the input box for (acc = list.begin(); acc != list.end(); ++acc) { @@ -2265,12 +2265,12 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { } //if (accList.isEmpty()) qFatal ("No available accounts"); bool ok = false; - while (!ok) { // keep going till we have a valid investment parent - QString invAccName = QInputDialog::getItem ( - PACKAGE, i18n("Select parent investment account or enter new name. Stock %1").arg(stockAcc.name ()), + while (!ok) { // keep going till we have a valid investment tqparent + TQString invAccName = TQInputDialog::getItem ( + PACKAGE, i18n("Select tqparent investment account or enter new name. Stock %1").tqarg(stockAcc.name ()), accList, lastSelected, true, &ok); if (ok) { - lastSelected = accList.findIndex (invAccName); // preserve selection for next time + lastSelected = accList.tqfindIndex (invAccName); // preserve selection for next time for (acc = list.begin(); acc != list.end(); ++acc) { if ((*acc).name() == invAccName) break; } @@ -2279,7 +2279,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { } else { // a new account name was entered invAcc.setAccountType (MyMoneyAccount::Investment); invAcc.setName (invAccName); - invAcc.setCurrencyId (QString("")); + invAcc.setCurrencyId (TQString("")); invAcc.setParentAccountId (m_storage->asset().id()); m_storage->addAccount (invAcc); ok = true; @@ -2289,14 +2289,14 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { } else { // this code is probably not going to be implemented coz we can't change account types (??) #if 0 - QMessageBox mb (PACKAGE, - i18n ("%1 is not an Investment Account. Do you wish to make it one?").arg(invAcc.name()), - QMessageBox::Question, - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No | QMessageBox::Escape, - QMessageBox::NoButton); + TQMessageBox mb (PACKAGE, + i18n ("%1 is not an Investment Account. Do you wish to make it one?").tqarg(invAcc.name()), + TQMessageBox::Question, + TQMessageBox::Yes | TQMessageBox::Default, + TQMessageBox::No | TQMessageBox::Escape, + TQMessageBox::NoButton); switch (mb.exec()) { - case QMessageBox::No : + case TQMessageBox::No : ok = false; break; default: // convert it - but what if it has splits??? @@ -2305,7 +2305,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { break; } #endif - switch(KMessageBox::questionYesNo(0, i18n ("%1 is not an Investment Account. Do you wish to make it one?").arg(invAcc.name(), PACKAGE))) { + switch(KMessageBox::questionYesNo(0, i18n ("%1 is not an Investment Account. Do you wish to make it one?").tqarg(invAcc.name(), PACKAGE))) { case KMessageBox::Yes: // convert it - but what if it has splits??? qFatal ("Not yet implemented"); @@ -2318,7 +2318,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { } } // end if ok - user pressed Cancel } // end while !ok - m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets parented (again) to investment account later + m_mapIds [invAcc.id()] = invAcc.id(); // so stock account gets tqparented (again) to investment account later m_storage->addAccount(invAcc, stockAcc); } else { // investment option != 0, 1, 2 qFatal ("Invalid investment option %d", m_investmentOption); @@ -2326,7 +2326,7 @@ void MyMoneyGncReader::checkInvestmentOption (QString stockId) { } // get the price source for a stock (gnc account) where online quotes are requested -void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource) { +void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, TQString gncSource) { // if he wants to use Finance::Quote, no conversion of source name is needed if (m_useFinanceQuote) { stock.setValue ("kmm-online-quote-system", "Finance::Quote"); @@ -2337,7 +2337,7 @@ void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource) // first check if we have already asked about this source // (mapSources is initialy empty. We may be able to pre-fill it with some equivalent // sources, if such things do exist. User feedback may help here.) - QMap::Iterator it; + TQMap::Iterator it; for (it = m_mapSources.begin(); it != m_mapSources.end(); it++) { if (it.key() == gncSource) { stock.setValue("kmm-online-source", it.data()); @@ -2348,7 +2348,7 @@ void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource) // not found in map, so ask the user KGncPriceSourceDlg *dlg = new KGncPriceSourceDlg (stock.name(), gncSource); dlg->exec(); - QString s = dlg->selectedSource(); + TQString s = dlg->selectedSource(); if (!s.isEmpty()) { stock.setValue("kmm-online-source", s); m_storage->modifySecurity(stock); @@ -2360,32 +2360,32 @@ void MyMoneyGncReader::getPriceSource (MyMoneySecurity stock, QString gncSource) // functions to control the progress bar //*********************** setProgressCallback ***************************** -void MyMoneyGncReader::setProgressCallback(void(*callback)(int, int, const QString&)) { +void MyMoneyGncReader::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; return ; } //************************** signalProgress ******************************* -void MyMoneyGncReader::signalProgress(int current, int total, const QString& msg) { +void MyMoneyGncReader::signalProgress(int current, int total, const TQString& msg) { if (m_progressCallback != 0) (*m_progressCallback)(current, total, msg); return ; } // error and information reporting //***************************** Information and error messages ********************* -void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const char* arg1) { - postMessage (source, code, QStringList(arg1)); +void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const char* arg1) { + postMessage (source, code, TQStringList(arg1)); } -void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const char* arg1, const char* arg2) { - QStringList argList(arg1); +void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const char* arg1, const char* arg2) { + TQStringList argList(arg1); argList.append(arg2); postMessage(source, code, argList); } -void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const char* arg1, const char* arg2, const char* arg3) { - QStringList argList(arg1); +void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const char* arg1, const char* arg2, const char* arg3) { + TQStringList argList(arg1); argList.append(arg2); argList.append(arg3); postMessage(source, code, argList); } -void MyMoneyGncReader::postMessage (const QString& source, const unsigned int code, const QStringList& argList) { +void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int code, const TQStringList& argList) { unsigned int i; GncMessageArgs *m = new GncMessageArgs; @@ -2394,11 +2394,11 @@ void MyMoneyGncReader::postMessage (const QString& source, const unsigned int co // get the number of args this message requires const unsigned int argCount = GncMessages::argCount (source, code); if ((gncdebug) && (argCount != argList.count())) - qDebug("%s", QString("MyMoneyGncReader::postMessage debug: Message %1, code %2, requires %3 arguments, got %4") - .arg(source).arg(code).arg(argCount).arg(argList.count()).data()); + qDebug("%s", TQString("MyMoneyGncReader::postMessage debug: Message %1, code %2, requires %3 arguments, got %4") + .tqarg(source).tqarg(code).tqarg(argCount).tqarg(argList.count()).data()); // store the arguments for (i = 0; i < argCount; i++) { - if (i > argList.count()) m->args.append(QString()); + if (i > argList.count()) m->args.append(TQString()); else m->args.append (argList[i]); //Adds the next argument to the list } m_messageList.append (m); @@ -2426,31 +2426,31 @@ GncMessages::messText GncMessages::texts [] = { {"ZZ", 0, ""} // stopper }; // -QString GncMessages::text (const QString source, const unsigned int code) { +TQString GncMessages::text (const TQString source, const unsigned int code) { TRY unsigned int i; for (i = 0; texts[i].source != "ZZ"; i++) { if ((source == texts[i].source) && (code == texts[i].code)) break; } if (texts[i].source == "ZZ") { - QString mess = QString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code); + TQString mess = TQString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code); throw new MYMONEYEXCEPTION (mess); } return (texts[i].text); PASS } // -unsigned int GncMessages::argCount (const QString source, const unsigned int code) { +unsigned int GncMessages::argCount (const TQString source, const unsigned int code) { TRY unsigned int i; for (i = 0; texts[i].source != "ZZ"; i++) { if ((source == texts[i].source) && (code == texts[i].code)) break; } if (texts[i].source == "ZZ") { - QString mess = QString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code); + TQString mess = TQString().sprintf("Internal error - unknown message - source %s, code %d", source.latin1(), code); throw new MYMONEYEXCEPTION (mess); } - QRegExp argConst ("%\\d"); + TQRegExp argConst ("%\\d"); int offset = 0; unsigned int argCount = 0; while ((offset = argConst.search (texts[i].text, offset)) != -1) { diff --git a/kmymoney2/converter/mymoneygncreader.h b/kmymoney2/converter/mymoneygncreader.h index df08913..fcda8ea 100644 --- a/kmymoney2/converter/mymoneygncreader.h +++ b/kmymoney2/converter/mymoneygncreader.h @@ -24,7 +24,7 @@ The main class of this module, MyMoneyGncReader, contains only a readFile() function, which controls the import of data from an XML file created by the current GnuCash version (1.8.8). -The XML is processed in class XmlReader, which is an implementation of the Qt +The XML is processed in class XmlReader, which is an implementation of the TQt SAX2 reader class. Data in the input file is processed as a set of objects which fortunately, @@ -48,7 +48,7 @@ the 'container' elements are ignored. XmlReader -This is an implementation of the Qt QXmlDefaultHandler class, which provides +This is an implementation of the TQt TQXmlDefaultHandler class, which provides three main function calls in addition to start and end of document. The startElement() and endElement() calls are self-explanatory, the characters() function provides data strings. Thus in the above example, the sequence of calls @@ -96,14 +96,14 @@ element name which started the current object. If so, the object's terminate() function is called. If the object represents a similar KMM object, this will normally result in a call to a conversion routine in the main (MyMoneyGncReader) class to convert the data to native format and place it in -storage. The stack is then popped, and the parent (now current) object notified +storage. The stack is then popped, and the tqparent (now current) object notified by a call to its endSubEl() function. Again depending on the type of object, this will either delete the instance, or save it in its own storage for later processing. For example, a GncSplit object makes little sense outside the context of its transaction, so will be saved by the transaction. A GncTransaction object on the other hand will be converted, along with its attendant splits, and then deleted -by its parent. +by its tqparent. Since at any one time an object will only be processing either a subobject or a data element, a single object variable, m_state, is used to determine the actual @@ -149,15 +149,15 @@ allow us to test the structure, if not the data content, of the file. // ---------------------------------------------------------------------------- // QT Includes -#include -class QIODevice; -#include -#include -#include -#include -#include -#include -#include +#include +class TQIODevice; +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -175,11 +175,11 @@ class QIODevice; #define VERSION_0_61_XML 0x10000011 // use 8 bytes for MyMoneyMoney objects #define GNUCASH_ID_KEY "GNUCASH_ID" -typedef QMap map_accountIds; +typedef TQMap map_accountIds; typedef map_accountIds::iterator map_accountIds_iter; typedef map_accountIds::const_iterator map_accountIds_citer; -typedef QMap map_elementVersions; +typedef TQMap map_elementVersions; class MyMoneyGncReader; @@ -199,29 +199,29 @@ protected: friend class MyMoneyGncReader; // check for sub object element; if it is, create the object - GncObject *isSubElement (const QString &elName, const QXmlAttributes& elAttrs); + GncObject *isSubElement (const TQString &elName, const TQXmlAttributes& elAttrs); // check for data element; if so, set data pointer - bool isDataElement (const QString &elName, const QXmlAttributes& elAttrs); + bool isDataElement (const TQString &elName, const TQXmlAttributes& elAttrs); // process start element for 'this'; normally for attribute checking; other initialization done in constructor - virtual void initiate (const QString&, const QXmlAttributes&) { return ;}; + virtual void initiate (const TQString&, const TQXmlAttributes&) { return ;}; // a sub object has completed; process the data it gathered virtual void endSubEl(GncObject *) {m_dataPtr = 0; return ;}; // store data for data element - void storeData (const QString& pData) // NB - data MAY come in chunks, and may need to be anonymized + void storeData (const TQString& pData) // NB - data MAY come in chunks, and may need to be anonymized {if (m_dataPtr != 0) m_dataPtr->append (hide (pData, m_anonClass)); return ;} // following is provided only for a future file anonymizer - QString getData () const { return ((m_dataPtr != 0) ? *m_dataPtr : "");}; + TQString getData () const { return ((m_dataPtr != 0) ? *m_dataPtr : "");}; void resetDataPtr() {m_dataPtr = 0;}; // process end element for 'this'; usually to convert to KMM format virtual void terminate() { return ;}; - void setVersion (const QString& v) {m_version = v; return; }; - QString version() const {return (m_version);}; + void setVersion (const TQString& v) {m_version = v; return; }; + TQString version() const {return (m_version);}; // some gnucash elements have version attribute; check it - void checkVersion (const QString&, const QXmlAttributes&, const map_elementVersions&); + void checkVersion (const TQString&, const TQXmlAttributes&, const map_elementVersions&); // get name of element processed by 'this' - QString getElName () const { return (m_elementName);}; + TQString getElName () const { return (m_elementName);}; // pass 'main' pointer to object void setPm (MyMoneyGncReader *pM) {pMain = pM;}; // debug only @@ -230,24 +230,24 @@ protected: // called by isSubElement to create appropriate sub object virtual GncObject *startSubEl() { return (0);}; // called by isDataElement to set variable pointer - virtual void dataEl(const QXmlAttributes&) {m_dataPtr = m_v.at(m_state); m_anonClass = m_anonClassList[m_state];}; + virtual void dataEl(const TQXmlAttributes&) {m_dataPtr = m_v.at(m_state); m_anonClass = m_anonClassList[m_state];}; // return gnucash data string variable pointer - virtual QString var (int i) const; + virtual TQString var (int i) const; // anonymize data - virtual QString hide (QString, unsigned int); + virtual TQString hide (TQString, unsigned int); MyMoneyGncReader *pMain; // pointer to 'main' class // used at start of each transaction so same money hide factor is applied to all splits void adjustHideFactor(); - QString m_elementName; // save 'this' element's name - QString m_version; // and it's gnucash version - const QString *m_subElementList; // list of sub object element names for 'this' + TQString m_elementName; // save 'this' element's name + TQString m_version; // and it's gnucash version + const TQString *m_subElementList; // list of sub object element names for 'this' unsigned int m_subElementListCount; // count of above - const QString *m_dataElementList; // ditto for data elements + const TQString *m_dataElementList; // ditto for data elements unsigned int m_dataElementListCount; - QString *m_dataPtr; // pointer to m_v variable for current data item - mutable QPtrList m_v; // storage for variable pointers + TQString *m_dataPtr; // pointer to m_v variable for current data item + mutable TQPtrList m_v; // storage for variable pointers unsigned int m_state; // effectively, the index to subElementList or dataElementList, whichever is currently in use @@ -283,13 +283,13 @@ public: protected: friend class MyMoneyGncReader; friend class GncTransaction; - bool isCurrency() const { return (*m_v.at(CMDTYSPC) == QString("ISO4217"));}; - QString id() const { return (*m_v.at(CMDTYID));}; - QString space() const { return (*m_v.at(CMDTYSPC));}; + bool isCurrency() const { return (*m_v.at(CMDTYSPC) == TQString("ISO4217"));}; + TQString id() const { return (*m_v.at(CMDTYID));}; + TQString space() const { return (*m_v.at(CMDTYSPC));}; private: // data elements enum CmdtySpecDataEls {CMDTYSPC, CMDTYID, END_CmdtySpec_DELS}; - virtual QString hide (QString, unsigned int); + virtual TQString hide (TQString, unsigned int); }; // ********************************************************************* // date; maybe one of two types, ts:date which is date/time, gdate which is date only @@ -305,11 +305,11 @@ protected: friend class GncSplit; friend class GncSchedule; friend class GncRecurrence; - const QDate date() const { return (QDate::fromString(m_v.at(TSDATE)->section(' ', 0, 0), Qt::ISODate));}; + const TQDate date() const { return (TQDate::fromString(m_v.at(TSDATE)->section(' ', 0, 0), Qt::ISODate));}; private: // data elements enum DateDataEls {TSDATE, GDATE, END_Date_DELS}; - virtual void dataEl(const QXmlAttributes&) {m_dataPtr = m_v.at(TSDATE); m_anonClass = GncObject::ASIS;} + virtual void dataEl(const TQXmlAttributes&) {m_dataPtr = m_v.at(TSDATE); m_anonClass = GncObject::ASIS;} ; // treat both date types the same }; // ************* GncKvp******************************************** @@ -324,9 +324,9 @@ public: protected: friend class MyMoneyGncReader; - QString key() const { return (var(KEY));}; - QString value() const { return (var(VALUE));}; - QString type() const { return (m_kvpType);}; + TQString key() const { return (var(KEY));}; + TQString value() const { return (var(VALUE));}; + TQString type() const { return (m_kvpType);}; unsigned int kvpCount() const { return (m_kvpList.count());}; const GncKvp *getKvp(unsigned int i) const { return (static_cast(m_kvpList.at(i)));}; private: @@ -336,9 +336,9 @@ private: virtual void endSubEl(GncObject *); // data elements enum KvpDataEls {KEY, VALUE, END_Kvp_DELS }; - virtual void dataEl (const QXmlAttributes&); - mutable QPtrList m_kvpList; - QString m_kvpType; // type is an XML attribute + virtual void dataEl (const TQXmlAttributes&); + mutable TQPtrList m_kvpList; + TQString m_kvpType; // type is an XML attribute }; // ************* GncLot******************************************** // KMM doesn't have support for lots as yet @@ -361,9 +361,9 @@ public: GncCountData (); ~GncCountData (); private: - virtual void initiate (const QString&, const QXmlAttributes&); + virtual void initiate (const TQString&, const TQXmlAttributes&); virtual void terminate(); - QString m_countType; // type of element being counted + TQString m_countType; // type of element being counted }; //******************************************************************** class GncCommodity : public GncObject { @@ -373,11 +373,11 @@ public: protected: friend class MyMoneyGncReader; // access data values - bool isCurrency() const { return (var(SPACE) == QString("ISO4217"));}; - QString space() const { return (var(SPACE));}; - QString id() const { return (var(ID));}; - QString name() const { return (var(NAME));}; - QString fraction() const { return (var(FRACTION));}; + bool isCurrency() const { return (var(SPACE) == TQString("ISO4217"));}; + TQString space() const { return (var(SPACE));}; + TQString id() const { return (var(ID));}; + TQString name() const { return (var(NAME));}; + TQString fraction() const { return (var(FRACTION));}; private: virtual void terminate(); // data elements @@ -393,8 +393,8 @@ protected: // access data values const GncCmdtySpec *commodity() const { return (m_vpCommodity);}; const GncCmdtySpec *currency() const { return (m_vpCurrency);}; - QString value() const { return (var(VALUE));}; - QDate priceDate () const { return (m_vpPriceDate->date());}; + TQString value() const { return (var(VALUE));}; + TQDate priceDate () const { return (m_vpPriceDate->date());}; private: virtual void terminate(); // sub object elements @@ -415,11 +415,11 @@ protected: friend class MyMoneyGncReader; // access data values GncCmdtySpec *commodity() const { return (m_vpCommodity);}; - QString id () const { return (var(ID));}; - QString name () const { return (var(NAME));}; - QString desc () const { return (var(DESC));}; - QString type () const { return (var(TYPE));}; - QString parent () const { return (var(PARENT));}; + TQString id () const { return (var(ID));}; + TQString name () const { return (var(NAME));}; + TQString desc () const { return (var(DESC));}; + TQString type () const { return (var(TYPE));}; + TQString tqparent () const { return (var(PARENT));}; private: // subsidiary objects/elements enum AccountSubEls {CMDTY, KVP, LOTS, END_Account_SELS }; @@ -429,7 +429,7 @@ private: // data elements enum AccountDataEls {ID, NAME, DESC, TYPE, PARENT, END_Account_DELS }; GncCmdtySpec *m_vpCommodity; - QPtrList m_kvpList; + TQPtrList m_kvpList; }; // ************* GncSplit******************************************** class GncSplit : public GncObject { @@ -439,20 +439,20 @@ public: protected: friend class MyMoneyGncReader; // access data values - QString id() const { return (var(ID));}; - QString memo() const { return (var(MEMO));}; - QString recon() const { return (var(RECON));}; - QString value() const { return (var(VALUE));}; - QString qty() const { return (var(QTY));}; - QString acct() const { return (var(ACCT));}; -const QDate reconDate() const {QDate x = QDate(); return (m_vpDateReconciled == NULL ? x : m_vpDateReconciled->date());}; + TQString id() const { return (var(ID));}; + TQString memo() const { return (var(MEMO));}; + TQString recon() const { return (var(RECON));}; + TQString value() const { return (var(VALUE));}; + TQString qty() const { return (var(TQTY));}; + TQString acct() const { return (var(ACCT));}; +const TQDate reconDate() const {TQDate x = TQDate(); return (m_vpDateReconciled == NULL ? x : m_vpDateReconciled->date());}; private: // subsidiary objects/elements enum TransactionSubEls {RECDATE, END_Split_SELS }; virtual GncObject *startSubEl(); virtual void endSubEl(GncObject *); // data elements - enum SplitDataEls {ID, MEMO, RECON, VALUE, QTY, ACCT, END_Split_DELS }; + enum SplitDataEls {ID, MEMO, RECON, VALUE, TQTY, ACCT, END_Split_DELS }; GncDate *m_vpDateReconciled; }; // ************* GncTransaction******************************************** @@ -463,12 +463,12 @@ public: protected: friend class MyMoneyGncReader; // access data values - QString id() const { return (var(ID));}; - QString no() const { return (var(NO));}; - QString desc() const { return (var(DESC));}; - QString currency() const { return (m_vpCurrency == NULL ? QString () : m_vpCurrency->id());}; - QDate dateEntered() const { return (m_vpDateEntered->date());}; - QDate datePosted() const { return (m_vpDatePosted->date());}; + TQString id() const { return (var(ID));}; + TQString no() const { return (var(NO));}; + TQString desc() const { return (var(DESC));}; + TQString currency() const { return (m_vpCurrency == NULL ? TQString () : m_vpCurrency->id());}; + TQDate dateEntered() const { return (m_vpDateEntered->date());}; + TQDate datePosted() const { return (m_vpDatePosted->date());}; bool isTemplate() const { return (m_template);}; unsigned int splitCount() const { return (m_splitList.count());}; unsigned int kvpCount() const { return (m_kvpList.count());}; @@ -484,9 +484,9 @@ private: enum TransactionDataEls {ID, NO, DESC, END_Transaction_DELS }; GncCmdtySpec *m_vpCurrency; GncDate *m_vpDateEntered, *m_vpDatePosted; - mutable QPtrList m_splitList; + mutable TQPtrList m_splitList; bool m_template; // true if this is a template for scheduled transaction - mutable QPtrList m_kvpList; + mutable TQPtrList m_kvpList; }; // ************* GncTemplateSplit******************************************** @@ -497,12 +497,12 @@ public: protected: friend class MyMoneyGncReader; // access data values - QString id() const { return (var(ID));}; - QString memo() const { return (var(MEMO));}; - QString recon() const { return (var(RECON));}; - QString value() const { return (var(VALUE));}; - QString qty() const { return (var(QTY));}; - QString acct() const { return (var(ACCT));}; + TQString id() const { return (var(ID));}; + TQString memo() const { return (var(MEMO));}; + TQString recon() const { return (var(RECON));}; + TQString value() const { return (var(VALUE));}; + TQString qty() const { return (var(TQTY));}; + TQString acct() const { return (var(ACCT));}; unsigned int kvpCount() const { return (m_kvpList.count());}; const GncKvp *getKvp(unsigned int i) const { return (static_cast(m_kvpList.at(i)));}; private: @@ -511,8 +511,8 @@ private: virtual GncObject *startSubEl(); virtual void endSubEl(GncObject *); // data elements - enum TemplateSplitDataEls {ID, MEMO, RECON, VALUE, QTY, ACCT, END_TemplateSplit_DELS }; - mutable QPtrList m_kvpList; + enum TemplateSplitDataEls {ID, MEMO, RECON, VALUE, TQTY, ACCT, END_TemplateSplit_DELS }; + mutable TQPtrList m_kvpList; }; // ************* GncSchedule******************************************** class GncFreqSpec; @@ -525,23 +525,23 @@ public: protected: friend class MyMoneyGncReader; // access data values - QString name() const { return (var(NAME));}; - QString enabled() const {return var(ENABLED);}; - QString autoCreate() const { return (var(AUTOC));}; - QString autoCrNotify() const { return (var(AUTOCN));}; - QString autoCrDays() const { return (var(AUTOCD));}; - QString advCrDays() const { return (var(ADVCD));}; - QString advCrRemindDays() const { return (var(ADVRD));}; - QString instanceCount() const { return (var(INSTC));}; - QString numOccurs() const { return (var(NUMOCC));}; - QString remOccurs() const { return (var(REMOCC));}; - QString templId() const { return (var(TEMPLID));}; - QDate startDate () const - {QDate x = QDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());}; - QDate lastDate () const - {QDate x = QDate(); return (m_vpLastDate == NULL ? x : m_vpLastDate->date());}; - QDate endDate() const - {QDate x = QDate(); return (m_vpEndDate == NULL ? x : m_vpEndDate->date());}; + TQString name() const { return (var(NAME));}; + TQString enabled() const {return var(ENABLED);}; + TQString autoCreate() const { return (var(AUTOC));}; + TQString autoCrNotify() const { return (var(AUTOCN));}; + TQString autoCrDays() const { return (var(AUTOCD));}; + TQString advCrDays() const { return (var(ADVCD));}; + TQString advCrRemindDays() const { return (var(ADVRD));}; + TQString instanceCount() const { return (var(INSTC));}; + TQString numOccurs() const { return (var(NUTQMOCC));}; + TQString remOccurs() const { return (var(RETQMOCC));}; + TQString templId() const { return (var(TEMPLID));}; + TQDate startDate () const + {TQDate x = TQDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());}; + TQDate lastDate () const + {TQDate x = TQDate(); return (m_vpLastDate == NULL ? x : m_vpLastDate->date());}; + TQDate endDate() const + {TQDate x = TQDate(); return (m_vpEndDate == NULL ? x : m_vpEndDate->date());}; const GncFreqSpec *getFreqSpec() const { return (m_vpFreqSpec);}; const GncSchedDef *getSchedDef() const { return (m_vpSchedDef);}; private: @@ -552,10 +552,10 @@ private: virtual void terminate(); // data elements enum ScheduleDataEls {NAME, ENABLED, AUTOC, AUTOCN, AUTOCD, ADVCD, ADVRD, INSTC, - NUMOCC, REMOCC, TEMPLID, END_Schedule_DELS }; + NUTQMOCC, RETQMOCC, TEMPLID, END_Schedule_DELS }; GncDate *m_vpStartDate, *m_vpLastDate, *m_vpEndDate; GncFreqSpec *m_vpFreqSpec; - mutable QPtrList m_vpRecurrence; // gnc handles multiple occurrences + mutable TQPtrList m_vpRecurrence; // gnc handles multiple occurrences GncSchedDef *m_vpSchedDef; }; // ************* GncFreqSpec******************************************** @@ -566,7 +566,7 @@ public: protected: friend class MyMoneyGncReader; // access data values (only interval type used at present) - QString intervalType() const { return (var(INTVT));}; + TQString intervalType() const { return (var(INTVT));}; private: // subsidiary objects/elements enum FreqSpecSubEls {COMPO, END_FreqSpec_SELS }; @@ -575,7 +575,7 @@ private: // data elements enum FreqSpecDataEls {INTVT, MONTHLY, DAILY, WEEKLY, INTVI, INTVO, INTVD, END_FreqSpec_DELS}; virtual void terminate(); - mutable QPtrList m_fsList; + mutable TQPtrList m_fsList; }; // ************* GncRecurrence******************************************** @@ -587,11 +587,11 @@ public: protected: friend class MyMoneyGncReader; // access data values - QDate startDate () const - {QDate x = QDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());}; - QString mult() const {return (var(MULT));}; - QString periodType() const {return (var(PERIODTYPE));}; - QString getFrequency() const; + TQDate startDate () const + {TQDate x = TQDate(); return (m_vpStartDate == NULL ? x : m_vpStartDate->date());}; + TQString mult() const {return (var(MULT));}; + TQString periodType() const {return (var(PERIODTYPE));}; + TQString getFrequency() const; private: // subsidiary objects/elements enum RecurrenceSubEls {STARTDATE, END_Recurrence_SELS }; @@ -618,25 +618,25 @@ class GncSchedDef : public GncObject { // **************************************************************************************** /** XML Reader - The XML reader is an implementation of the Qt SAX2 XML parser. It determines the type + The XML reader is an implementation of the TQt SAX2 XML parser. It determines the type of object represented by the XMl, and calls the appropriate object functions */ // ***************************************************************************************** -class XmlReader : public QXmlDefaultHandler { +class XmlReader : public TQXmlDefaultHandler { protected: friend class MyMoneyGncReader; XmlReader (MyMoneyGncReader *pM) : pMain(pM) {} // keep pointer to 'main' - void processFile (QIODevice*); // main entry point of reader + void processFile (TQIODevice*); // main entry point of reader // define xml content handler functions bool startDocument (); - bool startElement (const QString&, const QString&, const QString&, const QXmlAttributes&); - bool endElement (const QString&, const QString&, const QString&); - bool characters (const QString &); + bool startElement (const TQString&, const TQString&, const TQString&, const TQXmlAttributes&); + bool endElement (const TQString&, const TQString&, const TQString&); + bool characters (const TQString &); bool endDocument(); private: - QXmlInputSource *m_source; - QXmlSimpleReader *m_reader; - QPtrStack m_os; // stack of sub objects + TQXmlInputSource *m_source; + TQXmlSimpleReader *m_reader; + TQPtrStack m_os; // stack of sub objects GncObject *m_co; // current object, for ease of coding (=== m_os.top) MyMoneyGncReader *pMain; // the 'main' pointer, to pass on to objects bool m_headerFound; // check for gnc-v2 header @@ -652,21 +652,21 @@ private: class GncMessageArgs { protected: friend class MyMoneyGncReader; - QString source; // 'type of message + TQString source; // 'type of message unsigned int code; // to identify actual message - QValueList args; // variable arguments + TQValueList args; // variable arguments }; class GncMessages { protected: friend class MyMoneyGncReader; - static QString text (const QString, const unsigned int); // returns text of identified message - static unsigned int argCount (const QString, const unsigned int); // returns no. of args required + static TQString text (const TQString, const unsigned int); // returns text of identified message + static unsigned int argCount (const TQString, const unsigned int); // returns no. of args required private: typedef struct { - const QString source; + const TQString source; const unsigned int code; - QString text; + TQString text; } messText; static messText texts []; @@ -695,12 +695,12 @@ public: * */ #ifndef _GNCFILEANON - void readFile (QIODevice* pDevice, IMyMoneySerialize* storage); // main entry point, IODevice is gnucash file - void writeFile (QIODevice*, IMyMoneySerialize*) { return ;}; // dummy entry needed by kmymoneywiew. we will not be writing + void readFile (TQIODevice* pDevice, IMyMoneySerialize* storage); // main entry point, IODevice is gnucash file + void writeFile (TQIODevice*, IMyMoneySerialize*) { return ;}; // dummy entry needed by kmymoneywiew. we will not be writing #else - void readFile (QString, QString); + void readFile (TQString, TQString); #endif // _GNCFILEANON - QTextCodec *m_decoder; + TQTextCodec *m_decoder; protected: friend class GncObject; // pity we can't just say GncObject. And compiler doesn't like multiple friends on one line... friend class GncFile; // there must be a better way... @@ -743,12 +743,12 @@ protected: void convertFreqSpec (const GncFreqSpec *) {return;}; #endif // _GNCFILEANON /** to post messages for final report */ - void postMessage (const QString&, const unsigned int, const char *); - void postMessage (const QString&, const unsigned int, const char *, const char *); - void postMessage (const QString&, const unsigned int, const char *, const char *, const char *); - void postMessage (const QString&, const unsigned int, const QStringList&); - void setProgressCallback (void(*callback)(int, int, const QString&)); - void signalProgress (int current, int total, const QString& = ""); + void postMessage (const TQString&, const unsigned int, const char *); + void postMessage (const TQString&, const unsigned int, const char *, const char *); + void postMessage (const TQString&, const unsigned int, const char *, const char *, const char *); + void postMessage (const TQString&, const unsigned int, const TQStringList&); + void setProgressCallback (void(*callback)(int, int, const TQString&)); + void signalProgress (int current, int total, const TQString& = ""); /** user options */ /** Scheduled Transactions @@ -809,24 +809,24 @@ private: void setOptions (); // to set user options from dialog void setFileHideFactor (); // the following handles the gnucash indicator for a bad value (-1/0) which causes us probs - QString convBadValue (QString gncValue) const {return (gncValue == "-1/0" ? "0/1" : gncValue); }; + TQString convBadValue (TQString gncValue) const {return (gncValue == "-1/0" ? "0/1" : gncValue); }; #ifndef _GNCFILEANON - MyMoneyTransaction convertTemplateTransaction (const QString&, const GncTransaction *); - void convertTemplateSplit (const QString&, const GncTemplateSplit *); + MyMoneyTransaction convertTemplateTransaction (const TQString&, const GncTransaction *); + void convertTemplateSplit (const TQString&, const GncTemplateSplit *); #endif // _GNCFILEANON // wind up when all done void terminate(); - QString buildReportSection (const QString&); - bool writeReportToFile (const QValueList&); + TQString buildReportSection (const TQString&); + bool writeReportToFile (const TQValueList&); // main storage #ifndef _GNCFILEANON IMyMoneyStorage *m_storage; #else - QTextStream oStream; + TQTextStream oStream; #endif // _GNCFILEANON XmlReader *m_xr; /** to hold the callback pointer for the progress bar */ - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); // a map of which versions of the various elements (objects) we can import map_elementVersions m_versionList; // counters holding count data from the Gnc 'count-data' section @@ -851,53 +851,53 @@ private: // counters for error reporting int m_ccCount, m_orCount, m_scCount; // currency counter - QMap m_currencyCount; + TQMap m_currencyCount; /** * Map gnucash vs. Kmm ids for accounts, equities, schedules, price sources */ - QMap m_mapIds; - QString m_rootId; // save the root id for terminate() - QMap m_mapEquities; - QMap m_mapSchedules; - QMap m_mapSources; + TQMap m_mapIds; + TQString m_rootId; // save the root id for terminate() + TQMap m_mapEquities; + TQMap m_mapSchedules; + TQMap m_mapSources; /** * A list of stock accounts (gnc ids) which will be held till the end so we can implement the user's investment option */ - QValueList m_stockList; + TQValueList m_stockList; /** * Temporary storage areas for transaction processing */ - QString m_txCommodity; // save commodity for current transaction - QString m_txPayeeId; // gnc has payee at tx level, we need it at split level - QDate m_txDatePosted; // ditto for post date - QString m_txChequeNo; // ditto for cheque number + TQString m_txCommodity; // save commodity for current transaction + TQString m_txPayeeId; // gnc has payee at tx level, we need it at split level + TQDate m_txDatePosted; // ditto for post date + TQString m_txChequeNo; // ditto for cheque number /** In kmm, the order of splits is critical to some operations. These * areas will hold the splits until we've read them all */ - QValueList m_splitList, m_liabilitySplitList, m_otherSplitList; + TQValueList m_splitList, m_liabilitySplitList, m_otherSplitList; bool m_potentialTransfer; // to determine whether this might be a transfer /** Schedules are processed through 3 different functions, any of which may set this flag */ bool m_suspectSchedule; /** * A holding area for template txs while we're waiting for the schedules */ - QPtrList m_templateList; + TQPtrList m_templateList; /** Hold a list of suspect schedule ids for later processing? */ - QValueList m_suspectList; + TQValueList m_suspectList; /** * To hold message data till final report */ - QPtrList m_messageList; + TQPtrList m_messageList; GncMessages *m_messageTexts; /** * Internal utility functions */ - QString createPayee (const QString&); // create a payee and return it's id - QString createOrphanAccount (const QString&); // create unknown account and return the id - QDate incrDate (QDate lastDate, unsigned char interval, unsigned int intervalCount); // for date calculations - MyMoneyAccount checkConsistency (MyMoneyAccount& parent, MyMoneyAccount& child); // gnucash is sometimes TOO flexible - void checkInvestmentOption (QString stockId); // implement user investment option - void getPriceSource (MyMoneySecurity stock, QString gncSource); + TQString createPayee (const TQString&); // create a payee and return it's id + TQString createOrphanAccount (const TQString&); // create unknown account and return the id + TQDate incrDate (TQDate lastDate, unsigned char interval, unsigned int intervalCount); // for date calculations + MyMoneyAccount checkConsistency (MyMoneyAccount& tqparent, MyMoneyAccount& child); // gnucash is sometimes TOO flexible + void checkInvestmentOption (TQString stockId); // implement user investment option + void getPriceSource (MyMoneySecurity stock, TQString gncSource); #endif // _GNCFILEANON }; diff --git a/kmymoney2/converter/mymoneyqifprofile.cpp b/kmymoney2/converter/mymoneyqifprofile.cpp index b8fe97c..3093941 100644 --- a/kmymoney2/converter/mymoneyqifprofile.cpp +++ b/kmymoney2/converter/mymoneyqifprofile.cpp @@ -18,8 +18,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -58,17 +58,17 @@ class MyMoneyQifProfile::Private { } void getThirdPosition(void); - void dissectDate(QValueVector& parts, const QString& txt) const; + void dissectDate(TQValueVector& parts, const TQString& txt) const; - QValueVector m_changeCount; - QValueVector m_lastValue; - QValueVector m_largestValue; - QMap m_partPos; + TQValueVector m_changeCount; + TQValueVector m_lastValue; + TQValueVector m_largestValue; + TQMap m_partPos; }; -void MyMoneyQifProfile::Private::dissectDate(QValueVector& parts, const QString& txt) const +void MyMoneyQifProfile::Private::dissectDate(TQValueVector& parts, const TQString& txt) const { - QRegExp nonDelimChars("[ 0-9a-zA-Z]"); + TQRegExp nonDelimChars("[ 0-9a-zA-Z]"); int part = 0; // the current part we scan unsigned int pos; // the current scan position unsigned int maxPartSize = txt.length() > 6 ? 4 : 2; @@ -114,12 +114,12 @@ void MyMoneyQifProfile::Private::getThirdPosition(void) { // if we have detected two parts we can calculate the third and its position if(m_partPos.count() == 2) { - QValueList partsPresent = m_partPos.keys(); - QStringList partsAvail = QStringList::split(",", "d,m,y"); + TQValueList partsPresent = m_partPos.keys(); + TQStringList partsAvail = TQStringList::split(",", "d,m,y"); int missingIndex = -1; int value = 0; for(int i = 0; i < 3; ++i) { - if(!partsPresent.contains(partsAvail[i][0])) { + if(!partsPresent.tqcontains(partsAvail[i][0])) { missingIndex = i; } else { value += m_partPos[partsAvail[i][0]]; @@ -138,7 +138,7 @@ MyMoneyQifProfile::MyMoneyQifProfile() : clear(); } -MyMoneyQifProfile::MyMoneyQifProfile(const QString& name) : +MyMoneyQifProfile::MyMoneyQifProfile(const TQString& name) : d(new Private), m_isDirty(false) { @@ -184,7 +184,7 @@ void MyMoneyQifProfile::clear(void) m_attemptMatchDuplicates = true; } -void MyMoneyQifProfile::loadProfile(const QString& name) +void MyMoneyQifProfile::loadProfile(const TQString& name) { KConfig* config = KGlobal::config(); config->setGroup(name); @@ -208,7 +208,7 @@ void MyMoneyQifProfile::loadProfile(const QString& name) // make sure, we remove any old stuff for now config->deleteEntry("FilterScript"); - QString tmp = QString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] + + TQString tmp = TQString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] + m_decimal['$'] + m_decimal['O']; tmp = config->readEntry("Decimal", tmp); m_decimal['Q'] = tmp[0]; @@ -217,7 +217,7 @@ void MyMoneyQifProfile::loadProfile(const QString& name) m_decimal['$'] = tmp[3]; m_decimal['O'] = tmp[4]; - tmp = QString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] + + tmp = TQString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] + m_thousands['$'] + m_thousands['O']; tmp = config->readEntry("Thousand", tmp); m_thousands['Q'] = tmp[0]; @@ -247,19 +247,19 @@ void MyMoneyQifProfile::saveProfile(void) config->writeEntry("FilterFileType", m_filterFileType); config->writeEntry("AttemptMatchDuplicates", m_attemptMatchDuplicates); - QString tmp; + TQString tmp; - tmp = QString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] + + tmp = TQString(m_decimal['Q']) + m_decimal['T'] + m_decimal['I'] + m_decimal['$'] + m_decimal['O']; config->writeEntry("Decimal", tmp); - tmp = QString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] + + tmp = TQString(m_thousands['Q']) + m_thousands['T'] + m_thousands['I'] + m_thousands['$'] + m_thousands['O']; config->writeEntry("Thousand", tmp); } m_isDirty = false; } -void MyMoneyQifProfile::setProfileName(const QString& name) +void MyMoneyQifProfile::setProfileName(const TQString& name) { if(m_profileName != name) m_isDirty = true; @@ -267,7 +267,7 @@ void MyMoneyQifProfile::setProfileName(const QString& name) m_profileName = name; } -void MyMoneyQifProfile::setProfileDescription(const QString& desc) +void MyMoneyQifProfile::setProfileDescription(const TQString& desc) { if(m_profileDescription != desc) m_isDirty = true; @@ -275,14 +275,14 @@ void MyMoneyQifProfile::setProfileDescription(const QString& desc) m_profileDescription = desc; } -void MyMoneyQifProfile::setProfileType(const QString& type) +void MyMoneyQifProfile::setProfileType(const TQString& type) { if(m_profileType != type) m_isDirty = true; m_profileType = type; } -void MyMoneyQifProfile::setOutputDateFormat(const QString& dateFormat) +void MyMoneyQifProfile::setOutputDateFormat(const TQString& dateFormat) { if(m_dateFormat != dateFormat) m_isDirty = true; @@ -290,7 +290,7 @@ void MyMoneyQifProfile::setOutputDateFormat(const QString& dateFormat) m_dateFormat = dateFormat; } -void MyMoneyQifProfile::setInputDateFormat(const QString& dateFormat) +void MyMoneyQifProfile::setInputDateFormat(const TQString& dateFormat) { int j = -1; if(dateFormat.length() > 0) { @@ -302,7 +302,7 @@ void MyMoneyQifProfile::setInputDateFormat(const QString& dateFormat) } } -void MyMoneyQifProfile::setApostropheFormat(const QString& apostropheFormat) +void MyMoneyQifProfile::setApostropheFormat(const TQString& apostropheFormat) { if(m_apostropheFormat != apostropheFormat) m_isDirty = true; @@ -310,10 +310,10 @@ void MyMoneyQifProfile::setApostropheFormat(const QString& apostropheFormat) m_apostropheFormat = apostropheFormat; } -void MyMoneyQifProfile::setAmountDecimal(const QChar& def, const QChar& chr) +void MyMoneyQifProfile::setAmountDecimal(const TQChar& def, const TQChar& chr) { - QChar ch(chr); - if(ch == QChar()) + TQChar ch(chr); + if(ch == TQChar()) ch = ' '; if(m_decimal[def] != ch) @@ -322,10 +322,10 @@ void MyMoneyQifProfile::setAmountDecimal(const QChar& def, const QChar& chr) m_decimal[def] = ch; } -void MyMoneyQifProfile::setAmountThousands(const QChar& def, const QChar& chr) +void MyMoneyQifProfile::setAmountThousands(const TQChar& def, const TQChar& chr) { - QChar ch(chr); - if(ch == QChar()) + TQChar ch(chr); + if(ch == TQChar()) ch = ' '; if(m_thousands[def] != ch) @@ -334,21 +334,21 @@ void MyMoneyQifProfile::setAmountThousands(const QChar& def, const QChar& chr) m_thousands[def] = ch; } -QChar MyMoneyQifProfile::amountDecimal(const QChar& def) const +TQChar MyMoneyQifProfile::amountDecimal(const TQChar& def) const { - QChar chr = m_decimal[def]; + TQChar chr = m_decimal[def]; return chr; } -QChar MyMoneyQifProfile::amountThousands(const QChar& def) const +TQChar MyMoneyQifProfile::amountThousands(const TQChar& def) const { - QChar chr = m_thousands[def]; + TQChar chr = m_thousands[def]; return chr; } -void MyMoneyQifProfile::setAccountDelimiter(const QString& delim) +void MyMoneyQifProfile::setAccountDelimiter(const TQString& delim) { - QString txt(delim); + TQString txt(delim); if(txt.isEmpty()) txt = " "; @@ -360,23 +360,23 @@ void MyMoneyQifProfile::setAccountDelimiter(const QString& delim) m_accountDelimiter = txt[0]; } -void MyMoneyQifProfile::setOpeningBalanceText(const QString& txt) +void MyMoneyQifProfile::setOpeningBalanceText(const TQString& txt) { if(m_openingBalanceText != txt) m_isDirty = true; m_openingBalanceText = txt; } -void MyMoneyQifProfile::setVoidMark(const QString& txt) +void MyMoneyQifProfile::setVoidMark(const TQString& txt) { if(m_voidMark != txt) m_isDirty = true; m_voidMark = txt; } -QString MyMoneyQifProfile::accountDelimiter(void) const +TQString MyMoneyQifProfile::accountDelimiter(void) const { - QString rc; + TQString rc; switch(m_accountDelimiter[0]) { case ' ': @@ -389,47 +389,47 @@ QString MyMoneyQifProfile::accountDelimiter(void) const return rc; } -QString MyMoneyQifProfile::date(const QDate& datein) const +TQString MyMoneyQifProfile::date(const TQDate& datein) const { const char* format = m_dateFormat.latin1(); - QString buffer; - QChar delim; - int maskLen; - char maskChar; + TQString buffer; + TQChar delim; + int tqmaskLen; + char tqmaskChar; while(*format) { switch(*format) { case '%': - maskLen = 0; - maskChar = *++format; - while(*format && *format == maskChar) { - ++maskLen; + tqmaskLen = 0; + tqmaskChar = *++format; + while(*format && *format == tqmaskChar) { + ++tqmaskLen; ++format; } - switch(maskChar) { + switch(tqmaskChar) { case 'd': if(delim) buffer += delim; - buffer += QString::number(datein.day()).rightJustify(2, '0'); + buffer += TQString::number(datein.day()).rightJustify(2, '0'); break; case 'm': if(delim) buffer += delim; - if(maskLen == 3) + if(tqmaskLen == 3) buffer += KGlobal::locale()->calendar()->monthName(datein.month(), datein.year(), true); else - buffer += QString::number(datein.month()).rightJustify(2, '0'); + buffer += TQString::number(datein.month()).rightJustify(2, '0'); break; case 'y': - if(maskLen == 2) { + if(tqmaskLen == 2) { buffer += twoDigitYear(delim, datein.year()); } else { if(delim) buffer += delim; - buffer += QString::number(datein.year()); + buffer += TQString::number(datein.year()); } break; default: @@ -449,13 +449,13 @@ QString MyMoneyQifProfile::date(const QDate& datein) const return buffer; } -const QDate MyMoneyQifProfile::date(const QString& datein) const +const TQDate MyMoneyQifProfile::date(const TQString& datein) const { // in case we don't know the format, we return an invalid date if(d->m_partPos.count() != 3) - return QDate(); + return TQDate(); - QValueVector scannedParts(3); + TQValueVector scannedParts(3); d->dissectDate(scannedParts, datein); int yr, mon, day; @@ -463,7 +463,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const yr = scannedParts[d->m_partPos['y']].toInt(); mon = scannedParts[d->m_partPos['m']].toInt(&ok); if(!ok) { - QStringList monthNames = QStringList::split(",", "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec"); + TQStringList monthNames = TQStringList::split(",", "jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec"); int j; for(j = 1; j <= 12; ++j) { if((KGlobal::locale()->calendar()->monthName(j, 2000, true).lower() == scannedParts[d->m_partPos['m']].lower()) @@ -474,7 +474,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const } if(j == 13) { qWarning("Unknown month '%s'", scannedParts[d->m_partPos['m']].data()); - return QDate(); + return TQDate(); } } @@ -485,12 +485,12 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const else yr += 1900; } - return QDate(yr, mon, day); + return TQDate(yr, mon, day); #if 0 - QString scannedDelim[2]; - QString formatParts[3]; - QString formatDelim[2]; + TQString scannedDelim[2]; + TQString formatParts[3]; + TQString formatDelim[2]; int part; int delim; unsigned int i,j; @@ -501,8 +501,8 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const if(m_dateFormat[i] == '%') { ++part; if(part == 3) { - qWarning("MyMoneyQifProfile::date(const QString& datein) Too many parts in date format"); - return QDate(); + qWarning("MyMoneyQifProfile::date(const TQString& datein) Too many parts in date format"); + return TQDate(); } ++i; } @@ -517,15 +517,15 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const case '.': case '\'': if(delim == 2) { - qWarning("MyMoneyQifProfile::date(const QString& datein) Too many delimiters in date format"); - return QDate(); + qWarning("MyMoneyQifProfile::date(const TQString& datein) Too many delimiters in date format"); + return TQDate(); } formatDelim[delim] = m_dateFormat[i]; ++delim; break; default: - qWarning("MyMoneyQifProfile::date(const QString& datein) Invalid char in date format"); - return QDate(); + qWarning("MyMoneyQifProfile::date(const TQString& datein) Invalid char in date format"); + return TQDate(); } } @@ -540,8 +540,8 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const case '-': case '\'': if(delim == 2) { - qWarning("MyMoneyQifProfile::date(const QString& datein) Too many delimiters in date field"); - return QDate(); + qWarning("MyMoneyQifProfile::date(const TQString& datein) Too many delimiters in date field"); + return TQDate(); } scannedDelim[delim] = datein[i]; ++delim; @@ -557,7 +557,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const if(datein[i].isLetter()) prevWasChar = true; // replace blank with 0 - scannedParts[part] += (datein[i] == ' ') ? QChar('0') : datein[i]; + scannedParts[part] += (datein[i] == ' ') ? TQChar('0') : datein[i]; break; } } @@ -568,14 +568,14 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const bool ok = false; for(i = 0; i < 2; ++i) { if(scannedDelim[i] != formatDelim[i] - && scannedDelim[i] != QChar('\'')) { - qWarning("MyMoneyQifProfile::date(const QString& datein) Invalid delimiter '%s' when '%s' was expected", + && scannedDelim[i] != TQChar('\'')) { + qWarning("MyMoneyQifProfile::date(const TQString& datein) Invalid delimiter '%s' when '%s' was expected", scannedDelim[i].latin1(), formatDelim[i].latin1()); - return QDate(); + return TQDate(); } } - QString msg; + TQString msg; for(i = 0; i < 3; ++i) { switch(formatParts[i][0].latin1()) { case 'd': @@ -610,7 +610,7 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const if(yr < 100) { // two digit year info if(i > 1) { ok = true; - if(scannedDelim[i-1] == QChar('\'')) { + if(scannedDelim[i-1] == TQChar('\'')) { if(m_apostropheFormat == "1900-1949") { if(yr < 50) yr += 1900; @@ -648,24 +648,24 @@ const QDate MyMoneyQifProfile::date(const QString& datein) const ok = true; } } else { - msg = QString("Length of year (%1) does not match expected length (%2).") - .arg(scannedParts[i].length()).arg(formatParts[i].length()); + msg = TQString("Length of year (%1) does not match expected length (%2).") + .tqarg(scannedParts[i].length()).tqarg(formatParts[i].length()); } break; } if(!msg.isEmpty()) { - qWarning("MyMoneyQifProfile::date(const QString& datein) %s",msg.latin1()); - return QDate(); + qWarning("MyMoneyQifProfile::date(const TQString& datein) %s",msg.latin1()); + return TQDate(); } } - return QDate(yr, mon, day); + return TQDate(yr, mon, day); #endif } -QString MyMoneyQifProfile::twoDigitYear(const QChar delim, int yr) const +TQString MyMoneyQifProfile::twoDigitYear(const TQChar delim, int yr) const { - QChar realDelim = delim; - QString buffer; + TQChar realDelim = delim; + TQString buffer; if(delim) { if((m_apostropheFormat == "1900-1949" && yr <= 1949) @@ -681,15 +681,15 @@ QString MyMoneyQifProfile::twoDigitYear(const QChar delim, int yr) const if(yr < 10) buffer += "0"; - buffer += QString::number(yr); + buffer += TQString::number(yr); return buffer; } -QString MyMoneyQifProfile::value(const QChar& def, const MyMoneyMoney& valuein) const +TQString MyMoneyQifProfile::value(const TQChar& def, const MyMoneyMoney& valuein) const { unsigned char _decimalSeparator; unsigned char _thousandsSeparator; - QString res; + TQString res; _decimalSeparator = MyMoneyMoney::decimalSeparator(); _thousandsSeparator = MyMoneyMoney::thousandSeparator(); @@ -708,7 +708,7 @@ QString MyMoneyQifProfile::value(const QChar& def, const MyMoneyMoney& valuein) return res; } -MyMoneyMoney MyMoneyQifProfile::value(const QChar& def, const QString& valuein) const +MyMoneyMoney MyMoneyQifProfile::value(const TQChar& def, const TQString& valuein) const { unsigned char _decimalSeparator; unsigned char _thousandsSeparator; @@ -731,7 +731,7 @@ MyMoneyMoney MyMoneyQifProfile::value(const QChar& def, const QString& valuein) return res; } -void MyMoneyQifProfile::setFilterScriptImport(const QString& script) +void MyMoneyQifProfile::setFilterScriptImport(const TQString& script) { if(m_filterScriptImport != script) m_isDirty = true; @@ -739,7 +739,7 @@ void MyMoneyQifProfile::setFilterScriptImport(const QString& script) m_filterScriptImport = script; } -void MyMoneyQifProfile::setFilterScriptExport(const QString& script) +void MyMoneyQifProfile::setFilterScriptExport(const TQString& script) { if(m_filterScriptExport != script) m_isDirty = true; @@ -747,7 +747,7 @@ void MyMoneyQifProfile::setFilterScriptExport(const QString& script) m_filterScriptExport = script; } -void MyMoneyQifProfile::setFilterFileType(const QString& txt) +void MyMoneyQifProfile::setFilterFileType(const TQString& txt) { if(m_filterFileType != txt) m_isDirty = true; @@ -763,25 +763,25 @@ void MyMoneyQifProfile::setAttemptMatchDuplicates(bool f) m_attemptMatchDuplicates = f; } -QString MyMoneyQifProfile::inputDateFormat(void) const +TQString MyMoneyQifProfile::inputDateFormat(void) const { - QStringList list; + TQStringList list; possibleDateFormats(list); if(list.count() == 1) return list.first(); - return QString(); + return TQString(); } -void MyMoneyQifProfile::possibleDateFormats(QStringList& list) const +void MyMoneyQifProfile::possibleDateFormats(TQStringList& list) const { - QStringList defaultList = QStringList::split(":", "y,m,d:y,d,m:m,d,y:m,y,d:d,m,y:d,y,m"); + TQStringList defaultList = TQStringList::split(":", "y,m,d:y,d,m:m,d,y:m,y,d:d,m,y:d,y,m"); list.clear(); - QStringList::const_iterator it_d; + TQStringList::const_iterator it_d; for(it_d = defaultList.begin(); it_d != defaultList.end(); ++it_d) { - QStringList parts = QStringList::split(",", *it_d); + TQStringList parts = TQStringList::split(",", *it_d); int i; for(i = 0; i < 3; ++i) { - if(d->m_partPos.contains(parts[i][0])) { + if(d->m_partPos.tqcontains(parts[i][0])) { if(d->m_partPos[parts[i][0]] != i) break; } @@ -794,11 +794,11 @@ void MyMoneyQifProfile::possibleDateFormats(QStringList& list) const } // matches all tests if(i == 3) { - QString format = *it_d; - format.replace('y', "%y"); - format.replace('m', "%m"); - format.replace('d', "%d"); - format.replace(',', " "); + TQString format = *it_d; + format.tqreplace('y', "%y"); + format.tqreplace('m', "%m"); + format.tqreplace('d', "%d"); + format.tqreplace(',', " "); list << format; } } @@ -806,26 +806,26 @@ void MyMoneyQifProfile::possibleDateFormats(QStringList& list) const // in this case, we present the full list and let the user decide if(list.count() == 0) { for(it_d = defaultList.begin(); it_d != defaultList.end(); ++it_d) { - QString format = *it_d; - format.replace('y', "%y"); - format.replace('m', "%m"); - format.replace('d', "%d"); - format.replace(',', " "); + TQString format = *it_d; + format.tqreplace('y', "%y"); + format.tqreplace('m', "%m"); + format.tqreplace('d', "%d"); + format.tqreplace(',', " "); list << format; } } } -void MyMoneyQifProfile::autoDetect(const QStringList& lines) +void MyMoneyQifProfile::autoDetect(const TQStringList& lines) { - m_dateFormat = QString(); + m_dateFormat = TQString(); m_decimal.clear(); m_thousands.clear(); - QString numericRecords = "BT$OIQ"; - QStringList::const_iterator it; + TQString numericRecords = "BT$OIQ"; + TQStringList::const_iterator it; int datesScanned = 0; - // section: used to switch between different QIF sections, + // section: used to switch between different TQIF sections, // because the Record identifiers are ambigous between sections // eg. in transaction records, T identifies a total amount, in // account sections it's the type. @@ -835,11 +835,11 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines) // 2 - transactions // 3 - prices int section = 0; - QRegExp price("\"(.*)\",(.*),\"(.*)\""); + TQRegExp price("\"(.*)\",(.*),\"(.*)\""); for(it = lines.begin(); it != lines.end(); ++it) { - QChar c((*it)[0]); + TQChar c((*it)[0]); if(c == '!') { - QString sname = (*it).lower(); + TQString sname = (*it).lower(); section = 0; if(sname.startsWith("!account")) section = 1; @@ -863,7 +863,7 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines) } break; case 2: - if(numericRecords.contains(c)) { + if(numericRecords.tqcontains(c)) { scanNumeric((*it).mid(1), m_decimal[c], m_thousands[c]); } else if((c == 'D') && (m_dateFormat.isEmpty())) { if(d->m_partPos.count() != 3) { @@ -891,9 +891,9 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines) // results are inaccurate which leads to a reduced number of // date formats presented to choose from. if(d->m_partPos.count() != 3 && datesScanned > 20) { - QMap sortedPos; + TQMap sortedPos; // make sure to reset the known parts for the following algorithm - if(d->m_partPos.contains('y')) { + if(d->m_partPos.tqcontains('y')) { d->m_changeCount[d->m_partPos['y']] = -1; for(int i = 0; i < 3; ++i) { if(d->m_partPos['y'] == i) @@ -904,9 +904,9 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines) } } } - if(d->m_partPos.contains('d')) + if(d->m_partPos.tqcontains('d')) d->m_changeCount[d->m_partPos['d']] = -1; - if(d->m_partPos.contains('m')) + if(d->m_partPos.tqcontains('m')) d->m_changeCount[d->m_partPos['m']] = -1; for(int i = 0; i < 3; ++i) { @@ -915,8 +915,8 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines) } } - QMap::const_iterator it_a; - QMap::const_iterator it_b; + TQMap::const_iterator it_a; + TQMap::const_iterator it_b; switch(sortedPos.count()) { case 1: // all the same // let the user decide, we can't figure it out @@ -962,10 +962,10 @@ void MyMoneyQifProfile::autoDetect(const QStringList& lines) } } -void MyMoneyQifProfile::scanNumeric(const QString& txt, QChar& decimal, QChar& thousands) const +void MyMoneyQifProfile::scanNumeric(const TQString& txt, TQChar& decimal, TQChar& thousands) const { - QChar first, second; - QRegExp numericChars("[0-9-()]"); + TQChar first, second; + TQRegExp numericChars("[0-9-()]"); for(unsigned int i = 0; i < txt.length(); ++i) { if(numericChars.search(txt[i]) == -1) { first = second; @@ -978,10 +978,10 @@ void MyMoneyQifProfile::scanNumeric(const QString& txt, QChar& decimal, QChar& t thousands = first; } -void MyMoneyQifProfile::scanDate(const QString& txt) const +void MyMoneyQifProfile::scanDate(const TQString& txt) const { // extract the parts from the txt - QValueVector parts(3); // the various parts of the date + TQValueVector parts(3); // the various parts of the date d->dissectDate(parts, txt); // now analyse the parts @@ -1003,7 +1003,7 @@ void MyMoneyQifProfile::scanDate(const QString& txt) const } // and if it's in between 12 and 32 and we already identified the // position for the year it must be days - if((value > 12) && (value < 32) && d->m_partPos.contains('y')) { + if((value > 12) && (value < 32) && d->m_partPos.tqcontains('y')) { d->m_partPos['d'] = i; } } diff --git a/kmymoney2/converter/mymoneyqifprofile.h b/kmymoney2/converter/mymoneyqifprofile.h index bd6b328..5df8c41 100644 --- a/kmymoney2/converter/mymoneyqifprofile.h +++ b/kmymoney2/converter/mymoneyqifprofile.h @@ -15,15 +15,15 @@ * * ***************************************************************************/ -#ifndef MYMONEYQIFPROFILE_H -#define MYMONEYQIFPROFILE_H +#ifndef MYMONEYTQIFPROFILE_H +#define MYMONEYTQIFPROFILE_H // ---------------------------------------------------------------------------- // QT Includes -#include -#include -class QDate; +#include +#include +class TQDate; // ---------------------------------------------------------------------------- // KDE Includes @@ -37,47 +37,48 @@ class MyMoneyMoney; * @author Thomas Baumgart */ -class MyMoneyQifProfile : public QObject +class MyMoneyQifProfile : public TQObject { Q_OBJECT + TQ_OBJECT public: MyMoneyQifProfile(); - MyMoneyQifProfile(const QString& name); + MyMoneyQifProfile(const TQString& name); ~MyMoneyQifProfile(); - const QString& profileName(void) const { return m_profileName; } - void setProfileName(const QString& name); + const TQString& profileName(void) const { return m_profileName; } + void setProfileName(const TQString& name); - void loadProfile(const QString& name); + void loadProfile(const TQString& name); void saveProfile(void); - const QDate date(const QString& datein) const; - QString date(const QDate& datein) const; - - MyMoneyMoney value(const QChar& def, const QString& valuein) const; - QString value(const QChar& def, const MyMoneyMoney& valuein) const; - - const QString& outputDateFormat(void) const { return m_dateFormat; } - QString inputDateFormat(void) const; - const QString& apostropheFormat(void) const { return m_apostropheFormat; } - QChar amountDecimal(const QChar& def) const; - QChar amountThousands(const QChar& def) const; - const QString& profileDescription(void) const { return m_profileDescription; } - const QString& profileType(void) const { return m_profileType; } - const QString& openingBalanceText(void) const { return m_openingBalanceText; } - QString accountDelimiter(void) const; - const QString& voidMark(void) const { return m_voidMark; } - const QString& filterScriptImport(void) const { return m_filterScriptImport; } - const QString& filterScriptExport(void) const { return m_filterScriptExport; } - const QString& filterFileType(void) const { return m_filterFileType; } + const TQDate date(const TQString& datein) const; + TQString date(const TQDate& datein) const; + + MyMoneyMoney value(const TQChar& def, const TQString& valuein) const; + TQString value(const TQChar& def, const MyMoneyMoney& valuein) const; + + const TQString& outputDateFormat(void) const { return m_dateFormat; } + TQString inputDateFormat(void) const; + const TQString& apostropheFormat(void) const { return m_apostropheFormat; } + TQChar amountDecimal(const TQChar& def) const; + TQChar amountThousands(const TQChar& def) const; + const TQString& profileDescription(void) const { return m_profileDescription; } + const TQString& profileType(void) const { return m_profileType; } + const TQString& openingBalanceText(void) const { return m_openingBalanceText; } + TQString accountDelimiter(void) const; + const TQString& voidMark(void) const { return m_voidMark; } + const TQString& filterScriptImport(void) const { return m_filterScriptImport; } + const TQString& filterScriptExport(void) const { return m_filterScriptExport; } + const TQString& filterFileType(void) const { return m_filterFileType; } bool attemptMatchDuplicates(void) const { return m_attemptMatchDuplicates; } /** * This method scans all strings contained in @a lines and tries to figure * out the settings for m_decimal, m_thousands and m_dateFormat */ - void autoDetect(const QStringList& lines); + void autoDetect(const TQStringList& lines); /** * This method returns a list of possible date formats the user @@ -85,7 +86,7 @@ public: * contains all possible date formats, in the other case, the @a list * is adjusted to those that will match the data scanned. */ - void possibleDateFormats(QStringList& list) const; + void possibleDateFormats(TQStringList& list) const; /** * This method presets the member variables with the default values. @@ -98,25 +99,25 @@ public: bool isDirty(void) const { return m_isDirty; }; public slots: - void setProfileDescription(const QString& desc); - void setProfileType(const QString& type); - void setOutputDateFormat(const QString& dateFormat); - void setInputDateFormat(const QString& dateFormat); - void setApostropheFormat(const QString& apostropheFormat); - void setAmountDecimal(const QChar& def, const QChar& chr); - void setAmountThousands(const QChar& def, const QChar& chr); - void setAccountDelimiter(const QString& delim); - void setOpeningBalanceText(const QString& text); - void setVoidMark(const QString& txt); - void setFilterScriptImport(const QString& txt); - void setFilterScriptExport(const QString& txt); - void setFilterFileType(const QString& txt); + void setProfileDescription(const TQString& desc); + void setProfileType(const TQString& type); + void setOutputDateFormat(const TQString& dateFormat); + void setInputDateFormat(const TQString& dateFormat); + void setApostropheFormat(const TQString& apostropheFormat); + void setAmountDecimal(const TQChar& def, const TQChar& chr); + void setAmountThousands(const TQChar& def, const TQChar& chr); + void setAccountDelimiter(const TQString& delim); + void setOpeningBalanceText(const TQString& text); + void setVoidMark(const TQString& txt); + void setFilterScriptImport(const TQString& txt); + void setFilterScriptExport(const TQString& txt); + void setFilterFileType(const TQString& txt); void setAttemptMatchDuplicates(bool); private: - QString twoDigitYear(const QChar delim, int yr) const; - void scanNumeric(const QString& txt, QChar& decimal, QChar& thousands) const; - void scanDate(const QString& txt) const; + TQString twoDigitYear(const TQChar delim, int yr) const; + void scanNumeric(const TQString& txt, TQChar& decimal, TQChar& thousands) const; + void scanDate(const TQString& txt) const; private: /// \internal d-pointer class. @@ -124,20 +125,20 @@ private: /// \internal d-pointer instance. Private* const d; bool m_isDirty; - QString m_profileName; - QString m_profileDescription; - QString m_dateFormat; - QString m_apostropheFormat; - QString m_valueMode; - QString m_profileType; - QString m_openingBalanceText; - QString m_voidMark; - QString m_accountDelimiter; - QString m_filterScriptImport; - QString m_filterScriptExport; - QString m_filterFileType; /*< The kind of input files the filter will expect, e.g. "*.qif" */ - QMap m_decimal; - QMap m_thousands; + TQString m_profileName; + TQString m_profileDescription; + TQString m_dateFormat; + TQString m_apostropheFormat; + TQString m_valueMode; + TQString m_profileType; + TQString m_openingBalanceText; + TQString m_voidMark; + TQString m_accountDelimiter; + TQString m_filterScriptImport; + TQString m_filterScriptExport; + TQString m_filterFileType; /*< The kind of input files the filter will expect, e.g. "*.qif" */ + TQMap m_decimal; + TQMap m_thousands; bool m_attemptMatchDuplicates; }; diff --git a/kmymoney2/converter/mymoneyqifreader.cpp b/kmymoney2/converter/mymoneyqifreader.cpp index 60b0604..fde43a4 100644 --- a/kmymoney2/converter/mymoneyqifreader.cpp +++ b/kmymoney2/converter/mymoneyqifreader.cpp @@ -26,12 +26,12 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -72,29 +72,29 @@ class MyMoneyQifReader::Private { mapCategories(true) {} - QString accountTypeToQif(MyMoneyAccount::accountTypeE type) const; + TQString accountTypeToQif(MyMoneyAccount::accountTypeE type) const; /** * finalize the current statement and add it to the statement list */ void finishStatement(void); - bool isTransfer(QString& name, const QString& leftDelim, const QString& rightDelim); + bool isTransfer(TQString& name, const TQString& leftDelim, const TQString& rightDelim); /** - * Converts the QIF specific N-record of investment transactions into + * Converts the TQIF specific N-record of investment transactions into * a category name */ - QString typeToAccountName(const QString& type) const; + TQString typeToAccountName(const TQString& type) const; /** - * Converts the QIF reconcile state to the KMyMoney reconcile state + * Converts the TQIF reconcile state to the KMyMoney reconcile state */ - MyMoneySplit::reconcileFlagE reconcileState(const QString& state) const; + MyMoneySplit::reconcileFlagE reconcileState(const TQString& state) const; /** */ - void fixMultiLineMemo(QString& memo) const; + void fixMultiLineMemo(TQString& memo) const; public: /** @@ -104,24 +104,24 @@ class MyMoneyQifReader::Private { /** * the list of all statements to be sent to MyMoneyStatementReader */ - QValueList statements; + TQValueList statements; /** * a list of already used hashes in this file */ - QMap m_hashMap; + TQMap m_hashMap; - QString st_AccountName; - QString st_AccountId; + TQString st_AccountName; + TQString st_AccountId; MyMoneyAccount::accountTypeE accountType; bool firstTransaction; bool mapCategories; MyMoneyQifReader::QifEntryTypeE transactionType; }; -void MyMoneyQifReader::Private::fixMultiLineMemo(QString& memo) const +void MyMoneyQifReader::Private::fixMultiLineMemo(TQString& memo) const { - memo.replace("\\n", "\n"); + memo.tqreplace("\\n", "\n"); } void MyMoneyQifReader::Private::finishStatement(void) @@ -138,9 +138,9 @@ void MyMoneyQifReader::Private::finishStatement(void) st.m_eType = (transactionType == MyMoneyQifReader::EntryTransaction) ? MyMoneyStatement::etCheckings : MyMoneyStatement::etInvestment; } -QString MyMoneyQifReader::Private::accountTypeToQif(MyMoneyAccount::accountTypeE type) const +TQString MyMoneyQifReader::Private::accountTypeToQif(MyMoneyAccount::accountTypeE type) const { - QString rc = "Bank"; + TQString rc = "Bank"; switch(type) { default: @@ -164,7 +164,7 @@ QString MyMoneyQifReader::Private::accountTypeToQif(MyMoneyAccount::accountTypeE return rc; } -QString MyMoneyQifReader::Private::typeToAccountName(const QString& type) const +TQString MyMoneyQifReader::Private::typeToAccountName(const TQString& type) const { if(type == "reinvdiv") return i18n("Category name", "Reinvested dividend"); @@ -202,10 +202,10 @@ QString MyMoneyQifReader::Private::typeToAccountName(const QString& type) const if(type == "sell" || type == "buy") return i18n("Category name", "Investment fees"); - return i18n("Unknown QIF type %1").arg(type); + return i18n("Unknown TQIF type %1").tqarg(type); } -bool MyMoneyQifReader::Private::isTransfer(QString& tmp, const QString& leftDelim, const QString& rightDelim) +bool MyMoneyQifReader::Private::isTransfer(TQString& tmp, const TQString& leftDelim, const TQString& rightDelim) { // it's a transfer, extract the account name // I've seen entries like this @@ -213,7 +213,7 @@ bool MyMoneyQifReader::Private::isTransfer(QString& tmp, const QString& leftDeli // S[Mehrwertsteuer]/_VATCode_N_I // // so extracting is a bit more complex and we use a regexp for it - QRegExp exp(QString("\\%1(.*)\\%2(.*)").arg(leftDelim, rightDelim)); + TQRegExp exp(TQString("\\%1(.*)\\%2(.*)").tqarg(leftDelim, rightDelim)); bool rc; if((rc = (exp.search(tmp) != -1)) == true) { @@ -223,7 +223,7 @@ bool MyMoneyQifReader::Private::isTransfer(QString& tmp, const QString& leftDeli return rc; } -MyMoneySplit::reconcileFlagE MyMoneyQifReader::Private::reconcileState(const QString& state) const +MyMoneySplit::reconcileFlagE MyMoneyQifReader::Private::reconcileState(const TQString& state) const { if(state == "X" || state == "R") // Reconciled return MyMoneySplit::Reconciled; @@ -250,10 +250,10 @@ MyMoneyQifReader::MyMoneyQifReader() : m_warnedSecurity = false; m_warnedPrice = false; - connect(&m_filter, SIGNAL(wroteStdin(KProcess*)), this, SLOT(slotSendDataToFilter())); - connect(&m_filter, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(slotReceivedDataFromFilter(KProcess*, char*, int))); - connect(&m_filter, SIGNAL(processExited(KProcess*)), this, SLOT(slotImportFinished())); - connect(&m_filter, SIGNAL(receivedStderr(KProcess*, char*, int)), this, SLOT(slotReceivedErrorFromFilter(KProcess*, char*, int))); + connect(&m_filter, TQT_SIGNAL(wroteStdin(KProcess*)), this, TQT_SLOT(slotSendDataToFilter())); + connect(&m_filter, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedDataFromFilter(KProcess*, char*, int))); + connect(&m_filter, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotImportFinished())); + connect(&m_filter, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedErrorFromFilter(KProcess*, char*, int))); } MyMoneyQifReader::~MyMoneyQifReader() @@ -273,14 +273,14 @@ void MyMoneyQifReader::setURL(const KURL& url) m_url = url; } -void MyMoneyQifReader::setProfile(const QString& profile) +void MyMoneyQifReader::setProfile(const TQString& profile) { m_qifProfile.loadProfile("Profile-" + profile); } void MyMoneyQifReader::slotSendDataToFilter(void) { - Q_LONG len; + TQ_LONG len; if(m_file->atEnd()) { // m_filter.flushStdin(); @@ -288,7 +288,7 @@ void MyMoneyQifReader::slotSendDataToFilter(void) } else { len = m_file->readBlock(m_buffer, sizeof(m_buffer)); if(len == -1) { - qWarning("Failed to read block from QIF import file"); + qWarning("Failed to read block from TQIF import file"); m_filter.closeStdin(); m_filter.kill(); } else { @@ -299,7 +299,7 @@ void MyMoneyQifReader::slotSendDataToFilter(void) void MyMoneyQifReader::slotReceivedErrorFromFilter(KProcess* /* proc */, char *buff, int len) { - QByteArray data; + TQByteArray data; data.duplicate(buff, len); qWarning("%s",static_cast(data)); } @@ -314,9 +314,9 @@ void MyMoneyQifReader::slotReceivedDataFromFilter(KProcess* /* proc */, char *bu if(*buff == '\n' || *buff == '\r') { // found EOL if(!m_lineBuffer.isEmpty()) { - m_qifLines << QString::fromUtf8(m_lineBuffer.stripWhiteSpace()); + m_qifLines << TQString::fromUtf8(m_lineBuffer.stripWhiteSpace()); } - m_lineBuffer = QCString(); + m_lineBuffer = TQCString(); } else { // collect all others m_lineBuffer += (*buff); @@ -330,10 +330,10 @@ void MyMoneyQifReader::slotImportFinished(void) { // check if the last EOL char was missing and add the trailing line if(!m_lineBuffer.isEmpty()) { - m_qifLines << QString::fromUtf8(m_lineBuffer.stripWhiteSpace()); + m_qifLines << TQString::fromUtf8(m_lineBuffer.stripWhiteSpace()); } qDebug("Read %d bytes", m_pos); - QTimer::singleShot(0, this, SLOT(slotProcessData())); + TQTimer::singleShot(0, this, TQT_SLOT(slotProcessData())); } void MyMoneyQifReader::slotProcessData(void) @@ -346,9 +346,9 @@ void MyMoneyQifReader::slotProcessData(void) // the detection is accurate for numeric values, but it could be // that the dates were too ambiguous so that we have to let the user // decide which one to pick. - QStringList dateFormats; + TQStringList dateFormats; m_qifProfile.possibleDateFormats(dateFormats); - QStringList list; + TQStringList list; if(dateFormats.count() > 1) { list << dateFormats.first(); bool ok; @@ -363,8 +363,8 @@ void MyMoneyQifReader::slotProcessData(void) qDebug("Selected date format: '%s'", list.first().data()); - signalProgress(0, m_qifLines.count(), i18n("Importing QIF ...")); - QStringList::iterator it; + signalProgress(0, m_qifLines.count(), i18n("Importing TQIF ...")); + TQStringList::iterator it; for(it = m_qifLines.begin(); m_userAbort == false && it != m_qifLines.end(); ++it) { ++m_linenumber; // qDebug("Proc: '%s'", (*it).data()); @@ -399,27 +399,27 @@ bool MyMoneyQifReader::startImport(void) m_userAbort = false; m_pos = 0; m_linenumber = 0; - m_filename = QString::null; + m_filename = TQString(); m_data.clear(); if(!KIO::NetAccess::download(m_url, m_filename, NULL)) { KMessageBox::detailedError(0, - i18n("Error while loading file '%1'!").arg(m_url.prettyURL()), + i18n("Error while loading file '%1'!").tqarg(m_url.prettyURL()), KIO::NetAccess::lastErrorString(), i18n("File access error")); return false; } - m_file = new QFile(m_filename); + m_file = new TQFile(m_filename); if(m_file->open(IO_ReadOnly)) { #ifdef DEBUG_IMPORT - Q_LONG len; + TQ_LONG len; while(!m_file->atEnd()) { len = m_file->readBlock(m_buffer, sizeof(m_buffer)); if(len == -1) { - qWarning("Failed to read block from QIF import file"); + qWarning("Failed to read block from TQIF import file"); } else { slotReceivedDataFromFilter(0, m_buffer, len); } @@ -433,13 +433,13 @@ bool MyMoneyQifReader::startImport(void) m_filter << "cat"; m_filter << "-"; } else { - m_filter << QStringList::split(" ", m_qifProfile.filterScriptImport(), true); + m_filter << TQStringList::split(" ", m_qifProfile.filterScriptImport(), true); } m_entryType = EntryUnknown; if(m_filter.start(KProcess::NotifyOnExit, KProcess::All)) { m_filter.resume(); - signalProgress(0, m_file->size(), i18n("Reading QIF ...")); + signalProgress(0, m_file->size(), i18n("Reading TQIF ...")); slotSendDataToFilter(); rc = true; } else { @@ -460,8 +460,8 @@ bool MyMoneyQifReader::finishImport(void) // remove the Don't ask again entries KConfig* config = KGlobal::config(); - config->setGroup(QString::fromLatin1("Notification Messages")); - QStringList::ConstIterator it; + config->setGroup(TQString::tqfromLatin1("Notification Messages")); + TQStringList::ConstIterator it; for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) { config->deleteEntry(*it); @@ -480,8 +480,8 @@ bool MyMoneyQifReader::finishImport(void) // remove the Don't ask again entries KConfig* config = KGlobal::config(); - config->setGroup(QString::fromLatin1("Notification Messages")); - QStringList::ConstIterator it; + config->setGroup(TQString::tqfromLatin1("Notification Messages")); + TQStringList::ConstIterator it; for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) { config->deleteEntry(*it); @@ -511,7 +511,7 @@ bool MyMoneyQifReader::finishImport(void) dlg.show(); kapp->processEvents(); MyMoneyFile* file = MyMoneyFile::instance(); - QValueList::iterator it = m_transactionCache.begin(); + TQValueList::iterator it = m_transactionCache.begin(); MyMoneyFileTransaction ft; try { @@ -531,55 +531,55 @@ bool MyMoneyQifReader::finishImport(void) ft.commit(); } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to add transactions"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; rc = false; } #endif // Now to import the statements - QValueList::const_iterator it_st; + TQValueList::const_iterator it_st; for(it_st = d->statements.begin(); it_st != d->statements.end(); ++it_st) kmymoney2->slotStatementImport(*it_st); return rc; } -void MyMoneyQifReader::processQifSpecial(const QString& _line) +void MyMoneyQifReader::processQifSpecial(const TQString& _line) { - QString line = _line.mid(1); // get rid of exclamation mark - // QString test = line.left(5).lower(); - if(line.left(5).lower() == QString("type:")) { + TQString line = _line.mid(1); // get rid of exclamation mark + // TQString test = line.left(5).lower(); + if(line.left(5).lower() == TQString("type:")) { line = line.mid(5); // exportable accounts - if(line.lower() == "ccard" || KMyMoneyGlobalSettings::qifCreditCard().lower().contains(line.lower())) { + if(line.lower() == "ccard" || KMyMoneyGlobalSettings::qifCreditCard().lower().tqcontains(line.lower())) { d->accountType = MyMoneyAccount::CreditCard; d->firstTransaction = true; d->transactionType = m_entryType = EntryTransaction; - } else if(line.lower() == "bank" || KMyMoneyGlobalSettings::qifBank().lower().contains(line.lower())) { + } else if(line.lower() == "bank" || KMyMoneyGlobalSettings::qifBank().lower().tqcontains(line.lower())) { d->accountType = MyMoneyAccount::Checkings; d->firstTransaction = true; d->transactionType = m_entryType = EntryTransaction; - } else if(line.lower() == "cash" || KMyMoneyGlobalSettings::qifCash().lower().contains(line.lower())) { + } else if(line.lower() == "cash" || KMyMoneyGlobalSettings::qifCash().lower().tqcontains(line.lower())) { d->accountType = MyMoneyAccount::Cash; d->firstTransaction = true; d->transactionType = m_entryType = EntryTransaction; - } else if(line.lower() == "oth a" || KMyMoneyGlobalSettings::qifAsset().lower().contains(line.lower())) { + } else if(line.lower() == "oth a" || KMyMoneyGlobalSettings::qifAsset().lower().tqcontains(line.lower())) { d->accountType = MyMoneyAccount::Asset; d->firstTransaction = true; d->transactionType = m_entryType = EntryTransaction; - } else if(line.lower() == "oth l" || line.lower() == i18n("QIF tag for liability account", "Oth L").lower()) { + } else if(line.lower() == "oth l" || line.lower() == i18n("TQIF tag for liability account", "Oth L").lower()) { d->accountType = MyMoneyAccount::Liability; d->firstTransaction = true; d->transactionType = m_entryType = EntryTransaction; - } else if(line.lower() == "invst" || line.lower() == i18n("QIF tag for investment account", "Invst").lower()) { + } else if(line.lower() == "invst" || line.lower() == i18n("TQIF tag for investment account", "Invst").lower()) { d->transactionType = m_entryType = EntryInvestmentTransaction; - } else if(line.lower() == "invoice" || KMyMoneyGlobalSettings::qifInvoice().lower().contains(line.lower())) { + } else if(line.lower() == "invoice" || KMyMoneyGlobalSettings::qifInvoice().lower().tqcontains(line.lower())) { m_entryType = EntrySkip; } else if(line.lower() == "tax") { @@ -589,19 +589,19 @@ void MyMoneyQifReader::processQifSpecial(const QString& _line) m_entryType = EntrySkip; // exportable lists - } else if(line.lower() == "cat" || line.lower() == i18n("QIF tag for category", "Cat").lower()) { + } else if(line.lower() == "cat" || line.lower() == i18n("TQIF tag for category", "Cat").lower()) { m_entryType = EntryCategory; - } else if(line.lower() == "security" || line.lower() == i18n("QIF tag for security", "Security").lower()) { + } else if(line.lower() == "security" || line.lower() == i18n("TQIF tag for security", "Security").lower()) { m_entryType = EntrySecurity; - } else if(line.lower() == "prices" || line.lower() == i18n("QIF tag for prices", "Prices").lower()) { + } else if(line.lower() == "prices" || line.lower() == i18n("TQIF tag for prices", "Prices").lower()) { m_entryType = EntryPrice; } else if(line.lower() == "payee") { m_entryType = EntryPayee; - } else if(line.lower() == "class" || line.lower() == i18n("QIF tag for a class", "Class").lower()) { + } else if(line.lower() == "class" || line.lower() == i18n("TQIF tag for a class", "Class").lower()) { m_entryType = EntryClass; } else if(line.lower() == "memorized") { @@ -617,7 +617,7 @@ void MyMoneyQifReader::processQifSpecial(const QString& _line) m_entryType = EntrySkip; } else { - qWarning("Unknown export header '!Type:%s' in QIF file on line %d: Skipping section.", line.data(), m_linenumber); + qWarning("Unknown export header '!Type:%s' in TQIF file on line %d: Skipping section.", line.data(), m_linenumber); m_entryType = EntrySkip; } @@ -635,7 +635,7 @@ void MyMoneyQifReader::processQifSpecial(const QString& _line) void MyMoneyQifReader::processQifEntry(void) { - // This method processes a 'QIF Entry' which is everything between two caret + // This method processes a 'TQIF Entry' which is everything between two caret // signs // try { @@ -698,9 +698,9 @@ void MyMoneyQifReader::processQifEntry(void) } } -const QString MyMoneyQifReader::extractLine(const QChar id, int cnt) +const TQString MyMoneyQifReader::extractLine(const TQChar id, int cnt) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; m_extractedLine = -1; for(it = m_qifEntry.begin(); it != m_qifEntry.end(); ++it) { @@ -708,20 +708,20 @@ const QString MyMoneyQifReader::extractLine(const QChar id, int cnt) if((*it)[0] == id) { if(cnt-- == 1) { if((*it).mid(1).isEmpty()) - return QString(" "); + return TQString(" "); return (*it).mid(1); } } } m_extractedLine = -1; - return QString(); + return TQString(); } -void MyMoneyQifReader::extractSplits(QValueList& listqSplits) const +void MyMoneyQifReader::extractSplits(TQValueList& listqSplits) const { -// *** With apologies to QString MyMoneyQifReader::extractLine *** +// *** With apologies to TQString MyMoneyQifReader::extractLine *** - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it = m_qifEntry.begin(); it != m_qifEntry.end(); ++it) { if((*it)[0] == "S") { @@ -744,13 +744,13 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE if(extractLine('P').lower() == m_qifProfile.openingBalanceText().lower()) { m_account = MyMoneyAccount(); m_account.setAccountType(accountType); - QString txt = extractLine('T'); + TQString txt = extractLine('T'); MyMoneyMoney balance = m_qifProfile.value('T', txt); - QDate date = m_qifProfile.date(extractLine('D')); + TQDate date = m_qifProfile.date(extractLine('D')); m_account.setOpeningDate(date); - QString name = extractLine('L'); + TQString name = extractLine('L'); if(name.left(1) == m_qifProfile.accountDelimiter().left(1)) { name = name.mid(1, name.length()-2); } @@ -761,7 +761,7 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE if ( ! balance.isZero() ) { MyMoneyFile* file = MyMoneyFile::instance(); - QString openingtxid = file->openingBalanceTransaction(m_account); + TQString openingtxid = file->openingBalanceTransaction(m_account); MyMoneyFileTransaction ft; if ( ! openingtxid.isEmpty() ) { @@ -772,8 +772,8 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE { const MyMoneySecurity& sec = file->security(m_account.currencyId()); if ( KMessageBox::questionYesNo( - qApp->mainWidget(), - i18n("The %1 account currently has an opening balance of %2. This QIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the QIF file?").arg(m_account.name(), split.shares().formatMoney(m_account, sec),balance.formatMoney(m_account, sec)), + tqApp->mainWidget(), + i18n("The %1 account currently has an opening balance of %2. This TQIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the TQIF file?").tqarg(m_account.name(), split.shares().formatMoney(m_account, sec),balance.formatMoney(m_account, sec)), i18n("Overwrite opening balance"), KStdGuiItem::yes(), KStdGuiItem::no(), @@ -817,7 +817,7 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE // Lines 1-5 are processed via processQifEntry() and processAccountEntry() // Then Quicken issues line 6 but since the account does not carry any // transaction does not write an end delimiter. Arrrgh! So we end up with - // a QIF entry comprising of lines 6-11 and end up in this routine. Actually, + // a TQIF entry comprising of lines 6-11 and end up in this routine. Actually, // lines 7-11 are the leadin for the next account. So we check here if // the !Type:xxx record also contains an !Account line and process the // entry as required. @@ -832,7 +832,7 @@ void MyMoneyQifReader::processMSAccountEntry(const MyMoneyAccount::accountTypeE // Line 12 would set the mode to "cc transaction entries" // Lines 13+ would be interpreted as cc transaction entries, and life is good int exclamationCnt = 1; - QString category; + TQString category; do { category = extractLine('!', exclamationCnt++); } while(!category.isEmpty() && category != "Account"); @@ -870,13 +870,13 @@ void MyMoneyQifReader::processCategoryEntry(void) account.setName(extractLine('N')); account.setDescription(extractLine('D')); - MyMoneyAccount parentAccount; + MyMoneyAccount tqparentAccount; if(!extractLine('I').isEmpty()) { account.setAccountType(MyMoneyAccount::Income); - parentAccount = file->income(); + tqparentAccount = file->income(); } else if(!extractLine('E').isEmpty()) { account.setAccountType(MyMoneyAccount::Expense); - parentAccount = file->expense(); + tqparentAccount = file->expense(); } // check if we can find the account already in the file @@ -886,20 +886,20 @@ void MyMoneyQifReader::processCategoryEntry(void) if(acc.id().isEmpty()) { MyMoneyAccount brokerage; MyMoneyMoney balance; - kmymoney2->createAccount(account, parentAccount, brokerage, balance); + kmymoney2->createAccount(account, tqparentAccount, brokerage, balance); } } -QString MyMoneyQifReader::transferAccount(QString name, bool useBrokerage) +TQString MyMoneyQifReader::transferAccount(TQString name, bool useBrokerage) { - QString accountId; - QStringList tmpEntry = m_qifEntry; // keep temp copies + TQString accountId; + TQStringList tmpEntry = m_qifEntry; // keep temp copies MyMoneyAccount tmpAccount = m_account; m_qifEntry.clear(); // and construct a temp entry to create/search the account - m_qifEntry << QString("N%1").arg(name); - m_qifEntry << QString("Tunknown"); - m_qifEntry << QString("D%1").arg(i18n("Autogenerated by QIF importer")); + m_qifEntry << TQString("N%1").tqarg(name); + m_qifEntry << TQString("Tunknown"); + m_qifEntry << TQString("D%1").tqarg(i18n("Autogenerated by TQIF importer")); accountId = processAccountEntry(false); // in case we found a reference to an investment account, we need @@ -908,9 +908,9 @@ QString MyMoneyQifReader::transferAccount(QString name, bool useBrokerage) if(useBrokerage && (acc.accountType() == MyMoneyAccount::Investment)) { name = acc.brokerageName(); m_qifEntry.clear(); // and construct a temp entry to create/search the account - m_qifEntry << QString("N%1").arg(name); - m_qifEntry << QString("Tunknown"); - m_qifEntry << QString("D%1").arg(i18n("Autogenerated by QIF importer")); + m_qifEntry << TQString("N%1").tqarg(name); + m_qifEntry << TQString("Tunknown"); + m_qifEntry << TQString("D%1").tqarg(i18n("Autogenerated by TQIF importer")); accountId = processAccountEntry(false); } m_qifEntry = tmpEntry; // restore local copies @@ -925,16 +925,16 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp // if we don't have a name for the current account we need to extract the name from the L-record if(m_account.name().isEmpty()) { - QString name = extractLine('L'); + TQString name = extractLine('L'); if(name.isEmpty()) { - name = i18n("QIF imported, no account name supplied"); + name = i18n("TQIF imported, no account name supplied"); } d->isTransfer(name, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1,1)); - QStringList entry = m_qifEntry; // keep a temp copy + TQStringList entry = m_qifEntry; // keep a temp copy m_qifEntry.clear(); // and construct a temp entry to create/search the account - m_qifEntry << QString("N%1").arg(name); - m_qifEntry << QString("T%1").arg(d->accountTypeToQif(accType)); - m_qifEntry << QString("D%1").arg(i18n("Autogenerated by QIF importer")); + m_qifEntry << TQString("N%1").tqarg(name); + m_qifEntry << TQString("T%1").tqarg(d->accountTypeToQif(accType)); + m_qifEntry << TQString("D%1").tqarg(i18n("Autogenerated by TQIF importer")); processAccountEntry(); m_qifEntry = entry; // restore local copy } @@ -949,7 +949,7 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp acc = file->accountByName(m_account.brokerageName()); // check if we already have an opening balance transaction - QString tid = file->openingBalanceTransaction(acc); + TQString tid = file->openingBalanceTransaction(acc); MyMoneyTransaction ot; if(!tid.isEmpty()) { ot = file->transaction(tid); @@ -960,7 +960,7 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp } if(needCreate) { // in case we create it anyway, we issue a warning to the user to check it manually - KMessageBox::sorry(0, QString("%1").arg(i18n("KMyMoney has imported a second opening balance transaction into account %1 which differs from the one found already on file. Please correct this manually once the import is done.").arg(acc.name())), i18n("Opening balance problem")); + KMessageBox::sorry(0, TQString("%1").tqarg(i18n("KMyMoney has imported a second opening balance transaction into account %1 which differs from the one found already on file. Please correct this manually once the import is done.").tqarg(acc.name())), i18n("Opening balance problem")); } } @@ -984,7 +984,7 @@ void MyMoneyQifReader::createOpeningBalance(MyMoneyAccount::_accountTypeE accTyp } catch(MyMoneyException* e) { KMessageBox::detailedError(0, i18n("Error while creating opening balance transaction"), - QString("%1(%2):%3").arg(e->file()).arg(e->line()).arg(e->what()), + TQString("%1(%2):%3").tqarg(e->file()).tqarg(e->line()).tqarg(e->what()), i18n("File access error")); delete e; } @@ -1004,22 +1004,22 @@ void MyMoneyQifReader::processTransactionEntry(void) MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyStatement::Split s1; MyMoneyStatement::Transaction tr; - QString tmp; - QString accountId; + TQString tmp; + TQString accountId; int pos; - QString payee = extractLine('P'); + TQString payee = extractLine('P'); unsigned long h; h = MyMoneyTransaction::hash(m_qifEntry.join(";")); - QString hashBase; + TQString hashBase; hashBase.sprintf("%s-%07lx", m_qifProfile.date(extractLine('D')).toString(Qt::ISODate).data(), h); int idx = 1; - QString hash; + TQString hash; for(;;) { - hash = QString("%1-%2").arg(hashBase).arg(idx); - QMap::const_iterator it; - it = d->m_hashMap.find(hash); + hash = TQString("%1-%2").tqarg(hashBase).tqarg(idx); + TQMap::const_iterator it; + it = d->m_hashMap.tqfind(hash); if(it == d->m_hashMap.end()) { d->m_hashMap[hash] = true; break; @@ -1030,7 +1030,7 @@ void MyMoneyQifReader::processTransactionEntry(void) if(d->firstTransaction) { // check if this is an opening balance transaction and process it out of the statement - if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().contains(payee.lower()))) { + if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().tqcontains(payee.lower()))) { createOpeningBalance(); d->firstTransaction = false; return; @@ -1053,12 +1053,12 @@ void MyMoneyQifReader::processTransactionEntry(void) "date profile setting of \"%2\".\n\nPressing \"Continue\" will " "assign todays date to the transaction. Pressing \"Cancel\" will abort " "the import operation. You can then restart the import and select a different " - "QIF profile or create a new one.") - .arg(extractLine('D')).arg(m_qifProfile.inputDateFormat()), + "TQIF profile or create a new one.") + .tqarg(extractLine('D')).tqarg(m_qifProfile.inputDateFormat()), i18n("Invalid date format")); switch(rc) { case KMessageBox::Continue: - tr.m_datePosted = (QDate::currentDate()); + tr.m_datePosted = (TQDate::tqcurrentDate()); break; case KMessageBox::Cancel: @@ -1068,7 +1068,7 @@ void MyMoneyQifReader::processTransactionEntry(void) } tmp = extractLine('L'); - pos = tmp.findRev("--"); + pos = tmp.tqfindRev("--"); if(tmp.left(1) == m_qifProfile.accountDelimiter().left(1)) { // it's a transfer, so we wipe the memo // tmp = ""; why?? @@ -1081,18 +1081,18 @@ void MyMoneyQifReader::processTransactionEntry(void) // t.setMemo(tmp); // Assign the "#" field to the transaction's bank id - // This is the custom KMM extension to QIF for a unique ID + // This is the custom KMM extension to TQIF for a unique ID tmp = extractLine('#'); if(!tmp.isEmpty()) { - tr.m_strBankID = QString("ID %1").arg(tmp); + tr.m_strBankID = TQString("ID %1").tqarg(tmp); } #if 0 // Collect data for the account's split s1.m_accountId = m_account.id(); tmp = extractLine('S'); - pos = tmp.findRev("--"); + pos = tmp.tqfindRev("--"); if(pos != -1) { tmp = tmp.left(pos); } @@ -1101,7 +1101,7 @@ void MyMoneyQifReader::processTransactionEntry(void) tmp = tmp.mid(1, tmp.length()-2); s1.m_strCategoryName = tmp; #endif - // TODO (Ace) Deal with currencies more gracefully. QIF cannot deal with multiple + // TODO (Ace) Deal with currencies more gracefully. TQIF cannot deal with multiple // currencies, so we should assume that transactions imported into a given // account are in THAT ACCOUNT's currency. If one of those involves a transfer // to an account with a different currency, value and shares should be @@ -1140,7 +1140,7 @@ void MyMoneyQifReader::processTransactionEntry(void) accountId = transferAccount(tmp, false); } else { -/* pos = tmp.findRev("--"); +/* pos = tmp.tqfindRev("--"); if(pos != -1) { t.setValue("Dialog", tmp.mid(pos+2)); tmp = tmp.left(pos); @@ -1164,12 +1164,12 @@ void MyMoneyQifReader::processTransactionEntry(void) if ( account.id() == m_account.id() ) { kdDebug(0) << "Line " << m_linenumber << ": Cannot transfer to the same account. Transfer ignored." << endl; - accountId = QString(); + accountId = TQString(); } } catch (MyMoneyException *e) { kdDebug(0) << "Line " << m_linenumber << ": Account with id " << accountId.data() << " not found" << endl; - accountId = QString(); + accountId = TQString(); delete e; } } @@ -1182,7 +1182,7 @@ void MyMoneyQifReader::processTransactionEntry(void) } else { // split transaction - QValueList listqSplits; + TQValueList listqSplits; extractSplits(listqSplits); // ****** ensure each field is ****** // * attached to correct split * @@ -1200,7 +1200,7 @@ void MyMoneyQifReader::processTransactionEntry(void) accountId = transferAccount(tmp, false); } else { - pos = tmp.findRev("--"); + pos = tmp.tqfindRev("--"); if(pos != -1) { /// t.setValue("Dialog", tmp.mid(pos+2)); tmp = tmp.left(pos); @@ -1223,12 +1223,12 @@ void MyMoneyQifReader::processTransactionEntry(void) if ( account.id() == m_account.id() ) { kdDebug(0) << "Line " << m_linenumber << ": Cannot transfer to the same account. Transfer ignored." << endl; - accountId = QString(); + accountId = TQString(); } } catch (MyMoneyException *e) { kdDebug(0) << "Line " << m_linenumber << ": Account with id " << accountId.data() << " not found" << endl; - accountId = QString(); + accountId = TQString(); delete e; } } @@ -1290,7 +1290,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) // t.setCommodity(m_account.currencyId()); // 'D' field: Date - QDate date = m_qifProfile.date(extractLine('D')); + TQDate date = m_qifProfile.date(extractLine('D')); if(date.isValid()) tr.m_datePosted = date; else @@ -1300,12 +1300,12 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) "date profile setting of \"%2\".\n\nPressing \"Continue\" will " "assign todays date to the transaction. Pressing \"Cancel\" will abort " "the import operation. You can then restart the import and select a different " - "QIF profile or create a new one.") - .arg(extractLine('D')).arg(m_qifProfile.inputDateFormat()), + "TQIF profile or create a new one.") + .tqarg(extractLine('D')).tqarg(m_qifProfile.inputDateFormat()), i18n("Invalid date format")); switch(rc) { case KMessageBox::Continue: - tr.m_datePosted = QDate::currentDate(); + tr.m_datePosted = TQDate::tqcurrentDate(); break; case KMessageBox::Cancel: @@ -1315,21 +1315,21 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) } // 'M' field: Memo - QString memo = extractLine('M'); + TQString memo = extractLine('M'); d->fixMultiLineMemo(memo); tr.m_strMemo = memo; unsigned long h; h = MyMoneyTransaction::hash(m_qifEntry.join(";")); - QString hashBase; + TQString hashBase; hashBase.sprintf("%s-%07lx", m_qifProfile.date(extractLine('D')).toString(Qt::ISODate).data(), h); int idx = 1; - QString hash; + TQString hash; for(;;) { - hash = QString("%1-%2").arg(hashBase).arg(idx); - QMap::const_iterator it; - it = d->m_hashMap.find(hash); + hash = TQString("%1-%2").tqarg(hashBase).tqarg(idx); + TQMap::const_iterator it; + it = d->m_hashMap.tqfind(hash); if(it == d->m_hashMap.end()) { d->m_hashMap[hash] = true; break; @@ -1339,9 +1339,9 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) tr.m_strBankID = hash; // '#' field: BankID - QString tmp = extractLine('#'); + TQString tmp = extractLine('#'); if ( ! tmp.isEmpty() ) - tr.m_strBankID = QString("ID %1").arg(tmp); + tr.m_strBankID = TQString("ID %1").tqarg(tmp); // Reconciliation flag tr.m_reconcile = d->reconcileState(extractLine('C')); @@ -1361,7 +1361,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) #if 0 // we must check for that later, because certain activities don't need a security // 'Y' field: Security name - QString securityname = extractLine('Y').lower(); + TQString securityname = extractLine('Y').lower(); if ( securityname.isEmpty() ) { kdDebug(2) << "Line " << m_linenumber << ": Investment transaction without a security is not supported." << endl; @@ -1379,13 +1379,13 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) // abbreviations or ordered words differently, etc. // // If there is a perfect name match with a subordinate stock account, great. - // More likely, we have to rely on the QIF file containing !Type:Security + // More likely, we have to rely on the TQIF file containing !Type:Security // records, which tell us the mapping from name to symbol. // - // Therefore, generally it is not recommended to import a QIF file containing + // Therefore, generally it is not recommended to import a TQIF file containing // investment transactions but NOT containing security records. - QString securitysymbol = m_investmentMap[securityname]; + TQString securitysymbol = m_investmentMap[securityname]; // the correct account is the stock account which matches two criteria: // (1) it is a sub-account of the selected investment account, and either @@ -1395,14 +1395,14 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) // search through each subordinate account bool found = false; MyMoneyAccount thisaccount = m_account; - QStringList accounts = thisaccount.accountList(); - QStringList::const_iterator it_account = accounts.begin(); + TQStringList accounts = thisaccount.accountList(); + TQStringList::const_iterator it_account = accounts.begin(); while( !found && it_account != accounts.end() ) { - QString currencyid = file->account(*it_account).currencyId(); + TQString currencyid = file->account(*it_account).currencyId(); MyMoneySecurity security = file->security( currencyid ); - QString symbol = security.tradingSymbol().lower(); - QString name = security.name().lower(); + TQString symbol = security.tradingSymbol().lower(); + TQString name = security.name().lower(); if ( securityname == name || securitysymbol == symbol ) { @@ -1414,7 +1414,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) #if 0 // update the price, while we're here. in the future, this should be // an option - QString basecurrencyid = file->baseCurrency().id(); + TQString basecurrencyid = file->baseCurrency().id(); MyMoneyPrice price = file->price( currencyid, basecurrencyid, t_in.m_datePosted, true ); if ( !price.isValid() ) { @@ -1434,9 +1434,9 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) // If the security is not known, notify the user // TODO (Ace) A "SelectOrCreateAccount" interface for investments KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. " - "Transactions involving this security will be ignored.").arg(securityname), + "Transactions involving this security will be ignored.").tqarg(securityname), i18n("Security not found"), - QString("MissingSecurity%1").arg(securityname.stripWhiteSpace())); + TQString("MissingSecurity%1").tqarg(securityname.stripWhiteSpace())); return; } #endif @@ -1448,7 +1448,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) MyMoneyMoney quantity = m_qifProfile.value('T', extractLine('Q')); // 'N' field: Action - QString action = extractLine('N').lower(); + TQString action = extractLine('N').lower(); // remove trailing X, which seems to have no purpose (?!) bool xAction = false; @@ -1458,7 +1458,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) } // Whether to create a cash split for the other side of the value - QString accountname ;//= extractLine('L'); + TQString accountname ;//= extractLine('L'); if ( action == "reinvdiv" || action == "reinvlg" || action == "reinvsh" ) { d->st.m_listPrices += price; @@ -1475,7 +1475,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) { tr.m_eAction = (MyMoneyStatement::Transaction::eaCashDividend); - QString tmp = extractLine('L'); + TQString tmp = extractLine('L'); // if the action ends in an X, the L-Record contains the asset account // to which the dividend should be transferred. In the other cases, it // may contain a category that identifies the income category for the @@ -1512,7 +1512,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) if(action == "miscexp") tr.m_eAction = (MyMoneyStatement::Transaction::eaFees); - QString tmp = extractLine('L'); + TQString tmp = extractLine('L'); // if the action ends in an X, the L-Record contains the asset account // to which the dividend should be transferred. In the other cases, it // may contain a category that identifies the income category for the @@ -1538,19 +1538,19 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) tr.m_amount = -(amount - tr.m_fees); if(tr.m_strMemo.isEmpty()) - tr.m_strMemo = (QString("%1 %2").arg(extractLine('Y')).arg(d->typeToAccountName(action))).stripWhiteSpace(); + tr.m_strMemo = (TQString("%1 %2").tqarg(extractLine('Y')).tqarg(d->typeToAccountName(action))).stripWhiteSpace(); } else if (action == "xin" || action == "xout") { - QString payee = extractLine('P'); - if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().contains(payee.lower()))) { + TQString payee = extractLine('P'); + if(!payee.isEmpty() && ((payee.lower() == "opening balance") || KMyMoneyGlobalSettings::qifOpeningBalance().lower().tqcontains(payee.lower()))) { createOpeningBalance(MyMoneyAccount::Investment); return; } tr.m_eAction = (MyMoneyStatement::Transaction::eaNone); MyMoneyStatement::Split s2; - QString tmp = extractLine('L'); + TQString tmp = extractLine('L'); if(d->isTransfer(tmp, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1, 1))) { s2.m_accountId = transferAccount(tmp); s2.m_strCategoryName = tmp; @@ -1569,7 +1569,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) } else if (action == "buy") { - QString tmp = extractLine('L'); + TQString tmp = extractLine('L'); if(d->isTransfer(tmp, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1, 1)) == true) { tr.m_strBrokerageAccount = tmp; transferAccount(tmp); // make sure the account exists @@ -1581,7 +1581,7 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) } else if (action == "sell") { - QString tmp = extractLine('L'); + TQString tmp = extractLine('L'); if(d->isTransfer(tmp, m_qifProfile.accountDelimiter().left(1), m_qifProfile.accountDelimiter().mid(1, 1)) == true) { tr.m_strBrokerageAccount = tmp; transferAccount(tmp); // make sure the account exists @@ -1844,16 +1844,16 @@ void MyMoneyQifReader::processInvestmentTransactionEntry(void) */ } -const QString MyMoneyQifReader::findOrCreateIncomeAccount(const QString& searchname) +const TQString MyMoneyQifReader::findOrCreateIncomeAccount(const TQString& searchname) { - QString result; + TQString result; MyMoneyFile *file = MyMoneyFile::instance(); // First, try to find this account as an income account MyMoneyAccount acc = file->income(); - QStringList list = acc.accountList(); - QStringList::ConstIterator it_accid = list.begin(); + TQStringList list = acc.accountList(); + TQStringList::ConstIterator it_accid = list.begin(); while ( it_accid != list.end() ) { acc = file->account(*it_accid); @@ -1883,16 +1883,16 @@ const QString MyMoneyQifReader::findOrCreateIncomeAccount(const QString& searchn // TODO (Ace) Combine this and the previous function -const QString MyMoneyQifReader::findOrCreateExpenseAccount(const QString& searchname) +const TQString MyMoneyQifReader::findOrCreateExpenseAccount(const TQString& searchname) { - QString result; + TQString result; MyMoneyFile *file = MyMoneyFile::instance(); // First, try to find this account as an income account MyMoneyAccount acc = file->expense(); - QStringList list = acc.accountList(); - QStringList::ConstIterator it_accid = list.begin(); + TQStringList list = acc.accountList(); + TQStringList::ConstIterator it_accid = list.begin(); while ( it_accid != list.end() ) { acc = file->account(*it_accid); @@ -1920,16 +1920,16 @@ const QString MyMoneyQifReader::findOrCreateExpenseAccount(const QString& search return result; } -QString MyMoneyQifReader::checkCategory(const QString& name, const MyMoneyMoney value, const MyMoneyMoney value2) +TQString MyMoneyQifReader::checkCategory(const TQString& name, const MyMoneyMoney value, const MyMoneyMoney value2) { - QString accountId; + TQString accountId; MyMoneyFile *file = MyMoneyFile::instance(); MyMoneyAccount account; bool found = true; if(!name.isEmpty()) { // The category might be constructed with an arbitraty depth (number of - // colon delimited fields). We try to find a parent account within this + // colon delimited fields). We try to find a tqparent account within this // hierarchy by searching the following sequence: // // aaaa:bbbb:cccc:ddddd @@ -1941,40 +1941,40 @@ QString MyMoneyQifReader::checkCategory(const QString& name, const MyMoneyMoney // 5. don't search , create aaaa:bbbb:cccc:dddd account.setName(name); - QString accName; // part to be created (right side in above list) - QString parent(name); // a possible parent part (left side in above list) + TQString accName; // part to be created (right side in above list) + TQString tqparent(name); // a possible tqparent part (left side in above list) do { - accountId = file->categoryToAccount(parent); + accountId = file->categoryToAccount(tqparent); if(accountId.isEmpty()) { found = false; // prepare next step if(!accName.isEmpty()) accName.prepend(':'); - accName.prepend(parent.section(':', -1)); + accName.prepend(tqparent.section(':', -1)); account.setName(accName); - parent = parent.section(':', 0, -2); + tqparent = tqparent.section(':', 0, -2); } else if(!accName.isEmpty()) { account.setParentAccountId(accountId); } } - while(!parent.isEmpty() && accountId.isEmpty()); + while(!tqparent.isEmpty() && accountId.isEmpty()); // if we did not find the category, we create it if(!found) { - MyMoneyAccount parent; - if(account.parentAccountId().isEmpty()) { + MyMoneyAccount tqparent; + if(account.tqparentAccountId().isEmpty()) { if(!value.isNegative() && value2.isNegative()) - parent = file->income(); + tqparent = file->income(); else - parent = file->expense(); + tqparent = file->expense(); } else { - parent = file->account(account.parentAccountId()); + tqparent = file->account(account.tqparentAccountId()); } account.setAccountType((!value.isNegative() && value2.isNegative()) ? MyMoneyAccount::Income : MyMoneyAccount::Expense); MyMoneyAccount brokerage; - // clear out the parent id, because createAccount() does not like that - account.setParentAccountId(QString()); - kmymoney2->createAccount(account, parent, brokerage, MyMoneyMoney()); + // clear out the tqparent id, because createAccount() does not like that + account.setParentAccountId(TQString()); + kmymoney2->createAccount(account, tqparent, brokerage, MyMoneyMoney()); accountId = account.id(); } } @@ -1982,12 +1982,12 @@ QString MyMoneyQifReader::checkCategory(const QString& name, const MyMoneyMoney return accountId; } -QString MyMoneyQifReader::processAccountEntry(bool resetAccountId) +TQString MyMoneyQifReader::processAccountEntry(bool resetAccountId) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount account; - QString tmp; + TQString tmp; account.setName(extractLine('N')); // qDebug("Process account '%s'", account.name().data()); @@ -2003,8 +2003,8 @@ QString MyMoneyQifReader::processAccountEntry(bool resetAccountId) account.setValue("lastStatementDate", m_qifProfile.date(tmp).toString("yyyy-MM-dd")); QifEntryTypeE transactionType = EntryTransaction; - QString type = extractLine('T').lower().remove(QRegExp("\\s+")); - if(type == m_qifProfile.profileType().lower().remove(QRegExp("\\s+"))) { + TQString type = extractLine('T').lower().remove(TQRegExp("\\s+")); + if(type == m_qifProfile.profileType().lower().remove(TQRegExp("\\s+"))) { account.setAccountType(MyMoneyAccount::Checkings); } else if(type == "ccard" || type == "creditcard") { account.setAccountType(MyMoneyAccount::CreditCard); @@ -2036,30 +2036,30 @@ QString MyMoneyQifReader::processAccountEntry(bool resetAccountId) if(account.accountType() == MyMoneyAccount::UnknownAccountType) account.setAccountType(MyMoneyAccount::Checkings); - MyMoneyAccount parentAccount; + MyMoneyAccount tqparentAccount; MyMoneyAccount brokerage; MyMoneyMoney balance; // in case it's a stock account, we need to setup a fix investment account if(account.isInvest()) { - acc.setName(i18n("%1 (Investment)").arg(account.name())); // use the same name for the investment account - acc.setDescription(i18n("Autogenerated by QIF importer from type Mutual account entry")); + acc.setName(i18n("%1 (Investment)").tqarg(account.name())); // use the same name for the investment account + acc.setDescription(i18n("Autogenerated by TQIF importer from type Mutual account entry")); acc.setAccountType(MyMoneyAccount::Investment); - parentAccount = file->asset(); - kmymoney2->createAccount(acc, parentAccount, brokerage, MyMoneyMoney()); - parentAccount = acc; + tqparentAccount = file->asset(); + kmymoney2->createAccount(acc, tqparentAccount, brokerage, MyMoneyMoney()); + tqparentAccount = acc; qDebug("We still need to create the stock account in MyMoneyQifReader::processAccountEntry()"); } else { - // setup parent according the type of the account + // setup tqparent according the type of the account switch(account.accountGroup()) { case MyMoneyAccount::Asset: default: - parentAccount = file->asset(); + tqparentAccount = file->asset(); break; case MyMoneyAccount::Liability: - parentAccount = file->liability(); + tqparentAccount = file->liability(); break; case MyMoneyAccount::Equity: - parentAccount = file->equity(); + tqparentAccount = file->equity(); break; } } @@ -2071,7 +2071,7 @@ QString MyMoneyQifReader::processAccountEntry(bool resetAccountId) brokerage.setAccountType(MyMoneyAccount::Checkings); brokerage.setCurrencyId(MyMoneyFile::instance()->baseCurrency().id()); } - kmymoney2->createAccount(account, parentAccount, brokerage, balance); + kmymoney2->createAccount(account, tqparentAccount, brokerage, balance); acc = account; // qDebug("Account created"); } else { @@ -2092,13 +2092,13 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone { MyMoneyFile* file = MyMoneyFile::instance(); - QString accountId; - QString msg; - QString typeStr; - QString leadIn; + TQString accountId; + TQString msg; + TQString typeStr; + TQString leadIn; KMyMoneyUtils::categoryTypeE type; - QMap::ConstIterator it; + TQMap::ConstIterator it; type = KMyMoneyUtils::none; switch(account.accountGroup()) { @@ -2123,14 +2123,14 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone if(!msg.isEmpty()) accountSelect.setCaption(msg); - it = m_accountTranslation.find((leadIn + MyMoneyFile::AccountSeperator + account.name()).lower()); + it = m_accountTranslation.tqfind((leadIn + MyMoneyFile::AccountSeperator + account.name()).lower()); if(it != m_accountTranslation.end()) { try { account = file->account(*it); return; } catch (MyMoneyException *e) { - QString message(i18n("Account \"%1\" disappeared: ").arg(account.name())); + TQString message(i18n("Account \"%1\" disappeared: ").tqarg(account.name())); message += e->what(); KMessageBox::error(0, message); delete e; @@ -2152,7 +2152,7 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone } else { switch(KMessageBox::questionYesNo(0, i18n("The %1 '%2' does not exist. Do you " - "want to create it?").arg(typeStr).arg(account.name()))) { + "want to create it?").tqarg(typeStr).tqarg(account.name()))) { case KMessageBox::Yes: break; case KMessageBox::No: @@ -2160,25 +2160,25 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone } } } else { - accountSelect.setHeader(i18n("Select %1").arg(typeStr)); + accountSelect.setHeader(i18n("Select %1").tqarg(typeStr)); if(!accountId.isEmpty()) { msg = i18n("The %1 %2 currently exists. Do you want " "to import transactions to this account?") - .arg(typeStr).arg(account.name()); + .tqarg(typeStr).tqarg(account.name()); } else { msg = i18n("The %1 %2 currently does not exist. You can " "create a new %3 by pressing the Create button " "or select another %4 manually from the selection box.") - .arg(typeStr).arg(account.name()).arg(typeStr).arg(typeStr); + .tqarg(typeStr).tqarg(account.name()).tqarg(typeStr).tqarg(typeStr); } } } else { - accountSelect.setHeader(i18n("Import transactions to %1").arg(typeStr)); - msg = i18n("No %1 information has been found in the selected QIF file. " + accountSelect.setHeader(i18n("Import transactions to %1").tqarg(typeStr)); + msg = i18n("No %1 information has been found in the selected TQIF file. " "Please select an account using the selection box in the dialog or " "create a new %2 by pressing the Create button.") - .arg(typeStr).arg(typeStr); + .tqarg(typeStr).tqarg(typeStr); } accountSelect.setDescription(msg); @@ -2187,18 +2187,18 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone accountSelect.showAbortButton(true); // display current entry in widget, the offending line (if any) will be shown in red - QStringList::Iterator it_e; + TQStringList::Iterator it_e; int i = 0; for(it_e = m_qifEntry.begin(); it_e != m_qifEntry.end(); ++it_e) { if(m_extractedLine == i) - accountSelect.m_qifEntry->setColor(QColor("red")); + accountSelect.m_qifEntry->setColor(TQColor("red")); accountSelect.m_qifEntry->append(*it_e); - accountSelect.m_qifEntry->setColor(QColor("black")); + accountSelect.m_qifEntry->setColor(TQColor("black")); ++i; } for(;;) { - if(accountSelect.exec() == QDialog::Accepted) { + if(accountSelect.exec() == TQDialog::Accepted) { if(!accountSelect.selectedAccount().isEmpty()) { accountId = accountSelect.selectedAccount(); @@ -2211,7 +2211,7 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone account = file->account(accountId); if ( ! balance.isZero() ) { - QString openingtxid = file->openingBalanceTransaction(account); + TQString openingtxid = file->openingBalanceTransaction(account); MyMoneyFileTransaction ft; if ( ! openingtxid.isEmpty() ) { @@ -2222,8 +2222,8 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone { const MyMoneySecurity& sec = file->security(account.currencyId()); if ( KMessageBox::questionYesNo( - qApp->mainWidget(), - i18n("The %1 account currently has an opening balance of %2. This QIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the QIF file?").arg(account.name(), split.shares().formatMoney(account, sec), balance.formatMoney(account, sec)), + tqApp->mainWidget(), + i18n("The %1 account currently has an opening balance of %2. This TQIF file reports an opening balance of %3. Would you like to overwrite the current balance with the one from the TQIF file?").tqarg(account.name(), split.shares().formatMoney(account, sec), balance.formatMoney(account, sec)), i18n("Overwrite opening balance"), KStdGuiItem::yes(), KStdGuiItem::no(), @@ -2256,12 +2256,12 @@ void MyMoneyQifReader::selectOrCreateAccount(const SelectCreateMode mode, MyMone } } -void MyMoneyQifReader::setProgressCallback(void(*callback)(int, int, const QString&)) +void MyMoneyQifReader::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyQifReader::signalProgress(int current, int total, const QString& msg) +void MyMoneyQifReader::signalProgress(int current, int total, const TQString& msg) { if(m_progressCallback != 0) (*m_progressCallback)(current, total, msg); @@ -2287,23 +2287,23 @@ void MyMoneyQifReader::processPriceEntry(void) */ - QStringList::const_iterator it_line = m_qifEntry.begin(); + TQStringList::const_iterator it_line = m_qifEntry.begin(); // Make a price for each line - QRegExp priceExp("\"(.*)\",(.*),\"(.*)\""); + TQRegExp priceExp("\"(.*)\",(.*),\"(.*)\""); while ( it_line != m_qifEntry.end() ) { if(priceExp.search(*it_line) != -1) { MyMoneyStatement::Price price; price.m_strSecurity = priceExp.cap(1); - QString pricestr = priceExp.cap(2); - QString datestr = priceExp.cap(3); + TQString pricestr = priceExp.cap(2); + TQString datestr = priceExp.cap(3); kdDebug(0) << "Price:" << price.m_strSecurity << " / " << pricestr << " / " << datestr << endl; // Only add the price if the date is valid. If invalid, fail silently. See note above. // Also require the price value to not have any slashes. Old prices will be something like // "25 9/16", which we do not support. So we'll skip the price for now. - QDate date = m_qifProfile.date(datestr); + TQDate date = m_qifProfile.date(datestr); MyMoneyMoney rate(m_qifProfile.value('P', pricestr)); if(date.isValid() && !rate.isZero()) { diff --git a/kmymoney2/converter/mymoneyqifreader.h b/kmymoney2/converter/mymoneyqifreader.h index 77bf5ad..385b1ff 100644 --- a/kmymoney2/converter/mymoneyqifreader.h +++ b/kmymoney2/converter/mymoneyqifreader.h @@ -20,15 +20,15 @@ * * ***************************************************************************/ -#ifndef MYMONEYQIFREADER_H -#define MYMONEYQIFREADER_H +#ifndef MYMONEYTQIFREADER_H +#define MYMONEYTQIFREADER_H // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -49,9 +49,10 @@ class MyMoneyFileTransaction; /** * @author Thomas Baumgart */ -class MyMoneyQifReader : public QObject +class MyMoneyQifReader : public TQObject { Q_OBJECT + TQ_OBJECT friend class Private; private: @@ -71,9 +72,9 @@ private: struct qSplit { - QString m_strCategoryName; - QString m_strMemo; - QString m_amount; + TQString m_strCategoryName; + TQString m_strMemo; + TQString m_amount; }; @@ -99,16 +100,16 @@ public: * the file is send through this filter and the result * is stored in the m_tempFile file. * - * @param name QString reference to the name of the profile + * @param name TQString reference to the name of the profile */ - void setProfile(const QString& name); + void setProfile(const TQString& name); /** * This method actually starts the import of data from the selected file * into the MyMoney engine. * * This method also starts the user defined import filter program - * defined in the QIF profile. If none is defined, the file is read + * defined in the TQIF profile. If none is defined, the file is read * as is (actually the UNIX command 'cat -' is used as the filter). * * If data from the filter program is available, the slot @@ -138,7 +139,7 @@ public: const MyMoneyAccount& account() const { return m_account; }; - void setProgressCallback(void(*callback)(int, int, const QString&)); + void setProgressCallback(void(*callback)(int, int, const TQString&)); private: /** @@ -147,11 +148,11 @@ private: * * For a parameter description see KMyMoneyView::progressCallback(). */ - void signalProgress(int current, int total, const QString& = ""); + void signalProgress(int current, int total, const TQString& = ""); /** * This method scans a transaction contained in - * a QIF file formatted as an account record. This + * a TQIF file formatted as an account record. This * format is used by MS-Money. If the specific data * is not found, then the data in the entry is treated * as a transaction. In this case, the user will be asked to @@ -174,7 +175,7 @@ private: * * The id of the account will be returned. */ - QString processAccountEntry(bool resetAccountId = true); + TQString processAccountEntry(bool resetAccountId = true); /** * This method scans the m_qifEntry object as a category record specified @@ -217,15 +218,15 @@ private: /** * This method process a line starting with an exclamation mark */ - void processQifSpecial(const QString& _line); + void processQifSpecial(const TQString& _line); /** * This method is used to get the account id of the split for - * a transaction from the text found in the QIF $ or L record. + * a transaction from the text found in the TQIF $ or L record. * If an account with the name is not found, the user is asked * if it should be created. * - * @param name name of account as found in the QIF file + * @param name name of account as found in the TQIF file * @param value value found in the T record * @param value2 value found in the $ record for splitted transactions * @@ -233,27 +234,27 @@ private: * or the account was not found and not created the * return value will be "". */ - QString checkCategory(const QString& name, const MyMoneyMoney value, const MyMoneyMoney value2); + TQString checkCategory(const TQString& name, const MyMoneyMoney value, const MyMoneyMoney value2); /** * This method extracts the line beginning with the letter @p id - * from the lines contained in the QStringList object @p m_qifEntry. - * An empty QString is returned, if the line is not found. + * from the lines contained in the TQStringList object @p m_qifEntry. + * An empty TQString is returned, if the line is not found. * - * @param id QChar containing the letter to be found + * @param id TQChar containing the letter to be found * @param cnt return cnt'th of occurance of id in lines. cnt defaults to 1. * - * @return QString with the remainder of the line or empty if + * @return TQString with the remainder of the line or empty if * @p id is not found in @p lines */ - const QString extractLine(const QChar id, int cnt = 1); + const TQString extractLine(const TQChar id, int cnt = 1); /** - * This method examines each line in the QStringList object @p m_qifEntry, + * This method examines each line in the TQStringList object @p m_qifEntry, * searching for split entries, which it extracts into a struct qSplit and * stores all splits found in @p listqSplits . */ - void extractSplits(QValueList& listqSplits) const; + void extractSplits(TQValueList& listqSplits) const; enum SelectCreateMode { Create = 0, @@ -303,9 +304,9 @@ private: * @p searchname as a name, and returns the id if the newly created account * * @param searchname The name of the account to find or create - * @return QString id of the found or created account + * @return TQString id of the found or created account */ - static const QString findOrCreateIncomeAccount(const QString& searchname); + static const TQString findOrCreateIncomeAccount(const TQString& searchname); /** * This method looks up the @p searchname account by name and returns its id @@ -313,9 +314,9 @@ private: * @p searchname as a name, and returns the id if the newly created account * * @param searchname The name of the account to find or create - * @return QString id of the found or created account + * @return TQString id of the found or created account */ - static const QString findOrCreateExpenseAccount(const QString& searchname); + static const TQString findOrCreateExpenseAccount(const TQString& searchname); /** * This method returns the account id for a given account @a name. In @@ -323,7 +324,7 @@ private: * (the default), the id of the corresponding brokerage account will be * returned. In case an account is not existant, it will be created. */ - QString transferAccount(QString name, bool useBrokerage = true); + TQString transferAccount(TQString name, bool useBrokerage = true); // void processQifLine(void); void createOpeningBalance(MyMoneyAccount::_accountTypeE accType = MyMoneyAccount::Checkings); @@ -356,22 +357,22 @@ private: Private* const d; KProcess m_filter; - QString m_filename; + TQString m_filename; KURL m_url; MyMoneyQifProfile m_qifProfile; MyMoneyAccount m_account; unsigned long m_transactionsSkipped; unsigned long m_transactionsProcessed; - QStringList m_dontAskAgain; - QMap m_accountTranslation; - QMap m_investmentMap; - QFile *m_file; + TQStringList m_dontAskAgain; + TQMap m_accountTranslation; + TQMap m_investmentMap; + TQFile *m_file; char m_buffer[1024]; - QCString m_lineBuffer; - QStringList m_qifEntry; + TQCString m_lineBuffer; + TQStringList m_qifEntry; int m_extractedLine; - QString m_qifLine; - QStringList m_qifLines; + TQString m_qifLine; + TQStringList m_qifLines; QifEntryTypeE m_entryType; bool m_skipAccount; bool m_processingData; @@ -382,11 +383,11 @@ private: bool m_warnedInvestment; bool m_warnedSecurity; bool m_warnedPrice; - QValueList m_transactionCache; + TQValueList m_transactionCache; - QValueList m_data; + TQValueList m_data; - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); MyMoneyFileTransaction* m_ft; }; diff --git a/kmymoney2/converter/mymoneyqifwriter.cpp b/kmymoney2/converter/mymoneyqifwriter.cpp index 9526acd..8ab5c0f 100644 --- a/kmymoney2/converter/mymoneyqifwriter.cpp +++ b/kmymoney2/converter/mymoneyqifwriter.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -45,16 +45,16 @@ MyMoneyQifWriter::~MyMoneyQifWriter() { } -void MyMoneyQifWriter::write(const QString& filename, const QString& profile, - const QString& accountId, const bool accountData, +void MyMoneyQifWriter::write(const TQString& filename, const TQString& profile, + const TQString& accountId, const bool accountData, const bool categoryData, - const QDate& startDate, const QDate& endDate) + const TQDate& startDate, const TQDate& endDate) { m_qifProfile.loadProfile("Profile-" + profile); - QFile qifFile(filename); + TQFile qifFile(filename); if(qifFile.open(IO_WriteOnly)) { - QTextStream s(&qifFile); + TQTextStream s(&qifFile); try { if(categoryData) { @@ -67,9 +67,9 @@ void MyMoneyQifWriter::write(const QString& filename, const QString& profile, emit signalProgress(-1, -1); } catch(MyMoneyException *e) { - QString errMsg = i18n("Unexpected exception '%1' thrown in %2, line %3 " + TQString errMsg = i18n("Unexpected exception '%1' thrown in %2, line %3 " "caught in MyMoneyQifWriter::write()") - .arg(e->what()).arg(e->file()).arg(e->line()); + .tqarg(e->what()).tqarg(e->file()).tqarg(e->line()); KMessageBox::error(0, errMsg); delete e; @@ -77,11 +77,11 @@ void MyMoneyQifWriter::write(const QString& filename, const QString& profile, qifFile.close(); } else { - KMessageBox::error(0, i18n("Unable to open file '%1' for writing").arg(filename)); + KMessageBox::error(0, i18n("Unable to open file '%1' for writing").tqarg(filename)); } } -void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountId, const QDate& startDate, const QDate& endDate) +void MyMoneyQifWriter::writeAccountEntry(TQTextStream &s, const TQString& accountId, const TQDate& startDate, const TQDate& endDate) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount account; @@ -89,8 +89,8 @@ void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountI account = file->account(accountId); MyMoneyTransactionFilter filter(accountId); filter.setDateFilter(startDate, endDate); - QValueList list = file->transactionList(filter); - QString openingBalanceTransactionId; + TQValueList list = file->transactionList(filter); + TQString openingBalanceTransactionId; s << "!Type:" << m_qifProfile.profileType() << endl; if(!startDate.isValid() || startDate <= account.openingDate()) { @@ -117,7 +117,7 @@ void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountI s << endl; s << "^" << endl; - QValueList::ConstIterator it; + TQValueList::ConstIterator it; signalProgress(0, list.count()); int count = 0; for(it = list.begin(); it != list.end(); ++it) { @@ -128,7 +128,7 @@ void MyMoneyQifWriter::writeAccountEntry(QTextStream &s, const QString& accountI } } -void MyMoneyQifWriter::writeCategoryEntries(QTextStream &s) +void MyMoneyQifWriter::writeCategoryEntries(TQTextStream &s) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount income; @@ -138,9 +138,9 @@ void MyMoneyQifWriter::writeCategoryEntries(QTextStream &s) expense = file->expense(); s << "!Type:Cat" << endl; - QStringList list = income.accountList() + expense.accountList(); + TQStringList list = income.accountList() + expense.accountList(); emit signalProgress(0, list.count()); - QStringList::Iterator it; + TQStringList::Iterator it; int count = 0; for(it = list.begin(); it != list.end(); ++it) { writeCategoryEntry(s, *it, ""); @@ -148,24 +148,24 @@ void MyMoneyQifWriter::writeCategoryEntries(QTextStream &s) } } -void MyMoneyQifWriter::writeCategoryEntry(QTextStream &s, const QString& accountId, const QString& leadIn) +void MyMoneyQifWriter::writeCategoryEntry(TQTextStream &s, const TQString& accountId, const TQString& leadIn) { MyMoneyAccount acc = MyMoneyFile::instance()->account(accountId); - QString name = acc.name(); + TQString name = acc.name(); s << "N" << leadIn << name << endl; s << (MyMoneyAccount::accountGroup(acc.accountType()) == MyMoneyAccount::Expense ? "E" : "I") << endl; s << "^" << endl; - QStringList list = acc.accountList(); - QStringList::Iterator it; + TQStringList list = acc.accountList(); + TQStringList::Iterator it; name += ":"; for(it = list.begin(); it != list.end(); ++it) { writeCategoryEntry(s, *it, name); } } -void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransaction& t, const QString& accountId) +void MyMoneyQifWriter::writeTransactionEntry(TQTextStream &s, const MyMoneyTransaction& t, const TQString& accountId) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneySplit split = t.splitByAccount(accountId); @@ -187,8 +187,8 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa } if(split.memo().length() > 0) { - QString m = split.memo(); - m.replace('\n', "\\n"); + TQString m = split.memo(); + m.tqreplace('\n', "\\n"); s << "M" << m << endl; } @@ -202,7 +202,7 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa s << "P" << payee.name() << endl; } - QValueList list = t.splits(); + TQValueList list = t.splits(); if(list.count() > 1) { MyMoneySplit sp = t.splitByAccount(accountId, false); MyMoneyAccount acc = file->account(sp.accountId()); @@ -215,7 +215,7 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa s << "L" << file->accountToCategory(sp.accountId()) << endl; } if(list.count() > 2) { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = list.begin(); it != list.end(); ++it) { if(!((*it) == split)) { writeSplitEntry(s, *it); @@ -226,7 +226,7 @@ void MyMoneyQifWriter::writeTransactionEntry(QTextStream &s, const MyMoneyTransa s << "^" << endl; } -void MyMoneyQifWriter::writeSplitEntry(QTextStream& s, const MyMoneySplit& split) +void MyMoneyQifWriter::writeSplitEntry(TQTextStream& s, const MyMoneySplit& split) { MyMoneyFile* file = MyMoneyFile::instance(); @@ -243,8 +243,8 @@ void MyMoneyQifWriter::writeSplitEntry(QTextStream& s, const MyMoneySplit& split s << endl; if(split.memo().length() > 0) { - QString m = split.memo(); - m.replace('\n', "\\n"); + TQString m = split.memo(); + m.tqreplace('\n', "\\n"); s << "E" << m << endl; } diff --git a/kmymoney2/converter/mymoneyqifwriter.h b/kmymoney2/converter/mymoneyqifwriter.h index f77e612..1398161 100644 --- a/kmymoney2/converter/mymoneyqifwriter.h +++ b/kmymoney2/converter/mymoneyqifwriter.h @@ -20,14 +20,14 @@ * * ***************************************************************************/ -#ifndef MYMONEYQIFWRITER_H -#define MYMONEYQIFWRITER_H +#ifndef MYMONEYTQIFWRITER_H +#define MYMONEYTQIFWRITER_H // ---------------------------------------------------------------------------- // QT Headers -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -44,14 +44,15 @@ class MyMoneySplit; */ /** - * This class represents the QIF writer. All conversion between the + * This class represents the TQIF writer. All conversion between the * internal representation of accounts, transactions is handled in this * object. The conversion is controlled using a MyMoneyQifProfile to allow * the user to control the conversion. */ -class MyMoneyQifWriter : public QObject +class MyMoneyQifWriter : public TQObject { Q_OBJECT + TQ_OBJECT public: MyMoneyQifWriter(); @@ -70,10 +71,10 @@ public: * @param startDate Transations before this date will not be exported * @param endDate Transactions after this date will not be exported */ - void write(const QString& filename, const QString& profile, - const QString& accountId, const bool accountData, + void write(const TQString& filename, const TQString& profile, + const TQString& accountId, const bool accountData, const bool categoryData, - const QDate& startDate, const QDate& endDate); + const TQDate& startDate, const TQDate& endDate); private: /** @@ -87,7 +88,7 @@ private: * @param startDate date from which entries are written * @param endDate date until which entries are written */ - void writeAccountEntry(QTextStream& s, const QString& accountId, const QDate& startDate, const QDate& endDate); + void writeAccountEntry(TQTextStream& s, const TQString& accountId, const TQDate& startDate, const TQDate& endDate); /** * This method writes the category entries to the stream @@ -96,7 +97,7 @@ private: * * @param s reference to textstream */ - void writeCategoryEntries(QTextStream& s); + void writeCategoryEntries(TQTextStream& s); /** * This method writes the category entry for account with @@ -107,10 +108,10 @@ private: * @param accountId id of the account to be written * @param leadIn constant text that will be prepended to the account's name */ - void writeCategoryEntry(QTextStream& s, const QString& accountId, const QString& leadIn); + void writeCategoryEntry(TQTextStream& s, const TQString& accountId, const TQString& leadIn); - void writeTransactionEntry(QTextStream &s, const MyMoneyTransaction& t, const QString& accountId); - void writeSplitEntry(QTextStream &s, const MyMoneySplit& t); + void writeTransactionEntry(TQTextStream &s, const MyMoneyTransaction& t, const TQString& accountId); + void writeSplitEntry(TQTextStream &s, const MyMoneySplit& t); signals: /** diff --git a/kmymoney2/converter/mymoneystatementreader.cpp b/kmymoney2/converter/mymoneystatementreader.cpp index b804a59..8268d89 100644 --- a/kmymoney2/converter/mymoneystatementreader.cpp +++ b/kmymoney2/converter/mymoneystatementreader.cpp @@ -26,10 +26,10 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -39,8 +39,8 @@ #include #include #include -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Headers @@ -68,73 +68,73 @@ class MyMoneyStatementReader::Private scannedCategories(false) {} - const QString& feeId(const MyMoneyAccount& invAcc); - const QString& interestId(const MyMoneyAccount& invAcc); - QString interestId(const QString& name); - QString feeId(const QString& name); + const TQString& feeId(const MyMoneyAccount& invAcc); + const TQString& interestId(const MyMoneyAccount& invAcc); + TQString interestId(const TQString& name); + TQString feeId(const TQString& name); void assignUniqueBankID(MyMoneySplit& s, const MyMoneyStatement::Transaction& t_in); MyMoneyAccount lastAccount; - QValueList transactions; - QValueList payees; + TQValueList transactions; + TQValueList payees; int transactionsCount; int transactionsAdded; int transactionsMatched; int transactionsDuplicate; - QMap uniqIds; - QMap securitiesBySymbol; - QMap securitiesByName; + TQMap uniqIds; + TQMap securitiesBySymbol; + TQMap securitiesByName; bool m_skipCategoryMatching; private: - void scanCategories(QString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& parentAccount, const QString& defaultName); - QString nameToId(const QString&name, MyMoneyAccount& parent); + void scanCategories(TQString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& tqparentAccount, const TQString& defaultName); + TQString nameToId(const TQString&name, MyMoneyAccount& tqparent); private: - QString m_feeId; - QString m_interestId; + TQString m_feeId; + TQString m_interestId; bool scannedCategories; }; -const QString& MyMoneyStatementReader::Private::feeId(const MyMoneyAccount& invAcc) +const TQString& MyMoneyStatementReader::Private::feeId(const MyMoneyAccount& invAcc) { scanCategories(m_feeId, invAcc, MyMoneyFile::instance()->expense(), i18n("_Fees")); return m_feeId; } -const QString& MyMoneyStatementReader::Private::interestId(const MyMoneyAccount& invAcc) +const TQString& MyMoneyStatementReader::Private::interestId(const MyMoneyAccount& invAcc) { scanCategories(m_interestId, invAcc, MyMoneyFile::instance()->income(), i18n("_Dividend")); return m_interestId; } -QString MyMoneyStatementReader::Private::nameToId(const QString&name, MyMoneyAccount& parent) +TQString MyMoneyStatementReader::Private::nameToId(const TQString&name, MyMoneyAccount& tqparent) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount acc = file->accountByName(name); // if it does not exist, we have to create it if(acc.id().isEmpty()) { acc.setName( name ); - acc.setAccountType( parent.accountType() ); - acc.setCurrencyId(parent.currencyId()); - file->addAccount(acc, parent); + acc.setAccountType( tqparent.accountType() ); + acc.setCurrencyId(tqparent.currencyId()); + file->addAccount(acc, tqparent); } return acc.id(); } -QString MyMoneyStatementReader::Private::interestId(const QString& name) +TQString MyMoneyStatementReader::Private::interestId(const TQString& name) { - MyMoneyAccount parent = MyMoneyFile::instance()->income(); - return nameToId(name, parent); + MyMoneyAccount tqparent = MyMoneyFile::instance()->income(); + return nameToId(name, tqparent); } -QString MyMoneyStatementReader::Private::feeId(const QString& name) +TQString MyMoneyStatementReader::Private::feeId(const TQString& name) { - MyMoneyAccount parent = MyMoneyFile::instance()->expense(); - return nameToId(name, parent); + MyMoneyAccount tqparent = MyMoneyFile::instance()->expense(); + return nameToId(name, tqparent); } -void MyMoneyStatementReader::Private::scanCategories(QString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& parentAccount, const QString& defaultName) +void MyMoneyStatementReader::Private::scanCategories(TQString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& tqparentAccount, const TQString& defaultName) { if(!scannedCategories) { KMyMoneyUtils::previouslyUsedCategories(invAcc.id(), m_feeId, m_interestId); @@ -146,11 +146,11 @@ void MyMoneyStatementReader::Private::scanCategories(QString& id, const MyMoneyA MyMoneyAccount acc = file->accountByName(defaultName); // if it does not exist, we have to create it if(acc.id().isEmpty()) { - MyMoneyAccount parent = parentAccount; + MyMoneyAccount tqparent = tqparentAccount; acc.setName( defaultName ); - acc.setAccountType( parent.accountType() ); - acc.setCurrencyId(parent.currencyId()); - file->addAccount(acc, parent); + acc.setAccountType( tqparent.accountType() ); + acc.setCurrencyId(tqparent.currencyId()); + file->addAccount(acc, tqparent); } id = acc.id(); } @@ -161,17 +161,17 @@ void MyMoneyStatementReader::Private::assignUniqueBankID(MyMoneySplit& s, const if( ! t_in.m_strBankID.isEmpty() ) { // make sure that id's are unique from this point on by appending a -# // postfix if needed - QString base(t_in.m_strBankID); - QString hash(base); + TQString base(t_in.m_strBankID); + TQString hash(base); int idx = 1; for(;;) { - QMap::const_iterator it; - it = uniqIds.find(hash); + TQMap::const_iterator it; + it = uniqIds.tqfind(hash); if(it == uniqIds.end()) { uniqIds[hash] = true; break; } - hash = QString("%1-%2").arg(base).arg(idx); + hash = TQString("%1-%2").tqarg(base).tqarg(idx); ++idx; } @@ -210,7 +210,7 @@ void MyMoneyStatementReader::setAskPayeeCategory(bool ask) m_askPayeeCategory = ask; } -bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& messages) +bool MyMoneyStatementReader::import(const MyMoneyStatement& s, TQStringList& messages) { // // For testing, save the statement to an XML file @@ -291,7 +291,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess if(!m_account.name().isEmpty()) - messages += i18n("Importing statement for account %1").arg(m_account.name()); + messages += i18n("Importing statement for account %1").tqarg(m_account.name()); else if(s.m_listTransactions.count() == 0) messages += i18n("Importing statement without transactions"); @@ -302,7 +302,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess // signalProgress(0, s.m_listSecurities.count(), "Importing Statement ..."); int progress = 0; - QValueList::const_iterator it_s = s.m_listSecurities.begin(); + TQValueList::const_iterator it_s = s.m_listSecurities.begin(); while ( it_s != s.m_listSecurities.end() ) { processSecurityEntry(*it_s); @@ -321,7 +321,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess qDebug("Processing transactions (%s)", m_account.name().data()); signalProgress(0, s.m_listTransactions.count(), "Importing Statement ..."); int progress = 0; - QValueList::const_iterator it_t = s.m_listTransactions.begin(); + TQValueList::const_iterator it_t = s.m_listTransactions.begin(); while ( it_t != s.m_listTransactions.end() ) { processTransactionEntry(*it_t); @@ -347,15 +347,15 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess { try { signalProgress(0, s.m_listPrices.count(), "Importing Statement ..."); - QValueList slist = MyMoneyFile::instance()->securityList(); - QValueList::const_iterator it_s; + TQValueList slist = MyMoneyFile::instance()->securityList(); + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { d->securitiesBySymbol[(*it_s).tradingSymbol()] = *it_s; d->securitiesByName[(*it_s).name()] = *it_s; } int progress = 0; - QValueList::const_iterator it_p = s.m_listPrices.begin(); + TQValueList::const_iterator it_p = s.m_listPrices.begin(); while(it_p != s.m_listPrices.end()) { processPriceEntry(*it_p); signalProgress(++progress, 0); @@ -375,7 +375,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess // delete all payees created in vain int payeeCount = d->payees.count(); - QValueList::const_iterator it_p; + TQValueList::const_iterator it_p; for(it_p = d->payees.begin(); it_p != d->payees.end(); ++it_p) { try { MyMoneyFile::instance()->removePayee(*it_p); @@ -389,21 +389,21 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess if(s.m_closingBalance.isAutoCalc()) { messages += i18n(" Statement balance is not contained in statement."); } else { - messages += i18n(" Statement balance on %1 is reported to be %2").arg(s.m_dateEnd.toString(Qt::ISODate)).arg(s.m_closingBalance.formatMoney("",2)); + messages += i18n(" Statement balance on %1 is reported to be %2").tqarg(s.m_dateEnd.toString(Qt::ISODate)).tqarg(s.m_closingBalance.formatMoney("",2)); } messages += i18n(" Transactions"); - messages += i18n(" %1 processed").arg(d->transactionsCount); - messages += i18n(" %1 added").arg(d->transactionsAdded); - messages += i18n(" %1 matched").arg(d->transactionsMatched); - messages += i18n(" %1 duplicates").arg(d->transactionsDuplicate); + messages += i18n(" %1 processed").tqarg(d->transactionsCount); + messages += i18n(" %1 added").tqarg(d->transactionsAdded); + messages += i18n(" %1 matched").tqarg(d->transactionsMatched); + messages += i18n(" %1 duplicates").tqarg(d->transactionsDuplicate); messages += i18n(" Payees"); - messages += i18n(" %1 created").arg(payeeCount); - messages += QString(); + messages += i18n(" %1 created").tqarg(payeeCount); + messages += TQString(); // remove the Don't ask again entries KConfig* config = KGlobal::config(); - config->setGroup(QString::fromLatin1("Notification Messages")); - QStringList::ConstIterator it; + config->setGroup(TQString::tqfromLatin1("Notification Messages")); + TQStringList::ConstIterator it; for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) { config->deleteEntry(*it); @@ -426,20 +426,20 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess void MyMoneyStatementReader::processPriceEntry(const MyMoneyStatement::Price& p_in) { - if(d->securitiesBySymbol.contains(p_in.m_strSecurity)) { + if(d->securitiesBySymbol.tqcontains(p_in.m_strSecurity)) { MyMoneyPrice price(d->securitiesBySymbol[p_in.m_strSecurity].id(), MyMoneyFile::instance()->baseCurrency().id(), p_in.m_date, - p_in.m_amount, "QIF"); + p_in.m_amount, "TQIF"); MyMoneyFile::instance()->addPrice(price); - } else if(d->securitiesByName.contains(p_in.m_strSecurity)) { + } else if(d->securitiesByName.tqcontains(p_in.m_strSecurity)) { MyMoneyPrice price(d->securitiesByName[p_in.m_strSecurity].id(), MyMoneyFile::instance()->baseCurrency().id(), p_in.m_date, - p_in.m_amount, "QIF"); + p_in.m_amount, "TQIF"); MyMoneyFile::instance()->addPrice(price); } @@ -456,8 +456,8 @@ void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Securi // In a statement, we do not know what type of security this is, so we will // not use type as a matching factor. MyMoneySecurity security; - QValueList list = file->securityList(); - QValueList::ConstIterator it = list.begin(); + TQValueList list = file->securityList(); + TQValueList::ConstIterator it = list.begin(); while ( it != list.end() && security.id().isEmpty() ) { if(sec_in.m_strSymbol.isEmpty()) { @@ -485,7 +485,7 @@ void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Securi ft.commit(); kdDebug(0) << "Created " << security.name() << " with id " << security.id() << endl; } catch(MyMoneyException *e) { - KMessageBox::error(0, i18n("Error creating security record: %1").arg(e->what()), i18n("Error")); + KMessageBox::error(0, i18n("Error creating security record: %1").tqarg(e->what()), i18n("Error")); } } else { kdDebug(0) << "Found " << security.name() << " with id " << security.id() << endl; @@ -499,8 +499,8 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra MyMoneyTransaction t; #if 0 - QString dbgMsg; - dbgMsg = QString("Process %1, '%3', %2").arg(t_in.m_datePosted.toString(Qt::ISODate)).arg(t_in.m_amount.formatMoney("", 2)).arg(t_in.m_strBankID); + TQString dbgMsg; + dbgMsg = TQString("Process %1, '%3', %2").tqarg(t_in.m_datePosted.toString(Qt::ISODate)).tqarg(t_in.m_amount.formatMoney("", 2)).tqarg(t_in.m_strBankID); qDebug("%s", dbgMsg.data()); #endif @@ -540,7 +540,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // If the user has chosen to import into an investment account, determine the correct account to use MyMoneyAccount thisaccount = m_account; - QString brokerageactid; + TQString brokerageactid; if ( thisaccount.accountType() == MyMoneyAccount::Investment ) { @@ -565,11 +565,11 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // search through each subordinate account bool found = false; - QStringList accounts = thisaccount.accountList(); - QStringList::const_iterator it_account = accounts.begin(); + TQStringList accounts = thisaccount.accountList(); + TQStringList::const_iterator it_account = accounts.begin(); while( !found && it_account != accounts.end() ) { - QString currencyid = file->account(*it_account).currencyId(); + TQString currencyid = file->account(*it_account).currencyId(); MyMoneySecurity security = file->security( currencyid ); if((t_in.m_strSymbol.lower() == security.tradingSymbol().lower()) || (t_in.m_strSecurity.lower() == security.name().lower())) @@ -584,7 +584,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra { // update the price, while we're here. in the future, this should be // an option - QString basecurrencyid = file->baseCurrency().id(); + TQString basecurrencyid = file->baseCurrency().id(); MyMoneyPrice price = file->price( currencyid, basecurrencyid, t_in.m_datePosted, true ); if ( !price.isValid() && ((!t_in.m_amount.isZero() && !t_in.m_shares.isZero()) || !t_in.m_price.isZero())) { @@ -614,14 +614,14 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra if ( t_in.m_strSecurity.isEmpty() ) { - KMessageBox::information(0, i18n("This imported statement contains investment transactions with no security. These transactions will be ignored.").arg(t_in.m_strSecurity),i18n("Security not found"),QString("BlankSecurity")); + KMessageBox::information(0, i18n("This imported statement contains investment transactions with no security. These transactions will be ignored.").tqarg(t_in.m_strSecurity),i18n("Security not found"),TQString("BlankSecurity")); return; } else { MyMoneySecurity security; - QValueList list = MyMoneyFile::instance()->securityList(); - QValueList::ConstIterator it = list.begin(); + TQValueList list = MyMoneyFile::instance()->securityList(); + TQValueList::ConstIterator it = list.begin(); while ( it != list.end() && security.id().isEmpty() ) { if(t_in.m_strSecurity.lower() == (*it).tradingSymbol().lower() @@ -646,7 +646,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // This should be rare. A statement should have a security entry for any // of the securities referred to in the transactions. The only way to get // here is if that's NOT the case. - KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.").arg(t_in.m_strSecurity),i18n("Security not found"),QString("MissingSecurity%1").arg(t_in.m_strSecurity.stripWhiteSpace())); + KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.").tqarg(t_in.m_strSecurity),i18n("Security not found"),TQString("MissingSecurity%1").tqarg(t_in.m_strSecurity.stripWhiteSpace())); return; } } @@ -784,7 +784,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // written. However, if a user has an associated brokerage account, // we can stuff the transaction there. - QString brokerageactid = m_account.value("kmm-brokerage-account").utf8(); + TQString brokerageactid = m_account.value("kmm-brokerage-account").utf8(); if (brokerageactid.isEmpty() ) { brokerageactid = file->accountByName(m_account.brokerageName()).id(); @@ -823,29 +823,29 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra } - QString payeename = t_in.m_strPayee; + TQString payeename = t_in.m_strPayee; if(!payeename.isEmpty()) { - QString payeeid; + TQString payeeid; try { - QValueList pList = file->payeeList(); - QValueList::const_iterator it_p; - QMap matchMap; + TQValueList pList = file->payeeList(); + TQValueList::const_iterator it_p; + TQMap matchMap; for(it_p = pList.begin(); it_p != pList.end(); ++it_p) { bool ignoreCase; - QStringList keys; - QStringList::const_iterator it_s; + TQStringList keys; + TQStringList::const_iterator it_s; switch((*it_p).matchData(ignoreCase, keys)) { case MyMoneyPayee::matchDisabled: break; case MyMoneyPayee::matchName: - keys << QString("%1").arg(QRegExp::escape((*it_p).name())); + keys << TQString("%1").tqarg(TQRegExp::escape((*it_p).name())); // tricky fall through here case MyMoneyPayee::matchKey: for(it_s = keys.begin(); it_s != keys.end(); ++it_s) { - QRegExp exp(*it_s, !ignoreCase); + TQRegExp exp(*it_s, !ignoreCase); if(exp.search(payeename) != -1) { matchMap[exp.matchedLength()] = (*it_p).id(); } @@ -863,7 +863,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // in case of a) we take the one with the largest matchedLength() // which happens to be the last one in the map if(matchMap.count() > 1) { - QMap::const_iterator it_m = matchMap.end(); + TQMap::const_iterator it_m = matchMap.end(); --it_m; payeeid = *it_m; } else if(matchMap.count() == 1) @@ -882,16 +882,16 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra if(m_autoCreatePayee == false) { // Ask the user if that is what he intended to do? - QString msg = i18n("Do you want to add \"%1\" as payee/receiver?\n\n").arg(payeename); + TQString msg = i18n("Do you want to add \"%1\" as payee/receiver?\n\n").tqarg(payeename); msg += i18n("Selecting \"Yes\" will create the payee, \"No\" will skip " "creation of a payee record and remove the payee information " "from this transaction. Selecting \"Cancel\" aborts the import " "operation.\n\nIf you select \"No\" here and mark the \"Don't ask " "again\" checkbox, the payee information for all following transactions " - "referencing \"%1\" will be removed.").arg(payeename); + "referencing \"%1\" will be removed.").tqarg(payeename); - QString askKey = QString("Statement-Import-Payee-")+payeename; - if(!m_dontAskAgain.contains(askKey)) { + TQString askKey = TQString("Statement-Import-Payee-")+payeename; + if(!m_dontAskAgain.tqcontains(askKey)) { m_dontAskAgain += askKey; } rc = KMessageBox::questionYesNoCancel(0, msg, i18n("New payee/receiver"), @@ -909,12 +909,12 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // is called in the context of an automatic procedure it // might distract the user. payee.setName(payeename); - payee.setMatchData(MyMoneyPayee::matchName, true, QStringList()); + payee.setMatchData(MyMoneyPayee::matchName, true, TQStringList()); if (m_askPayeeCategory) { - // We use a QGuardedPtr because the dialog may get deleted - // during exec() if the parent of the dialog gets deleted. + // We use a TQGuardedPtr because the dialog may get deleted + // during exec() if the tqparent of the dialog gets deleted. // In that case the guarded ptr will reset to 0. - QGuardedPtr dialog = new KDialogBase( + TQGuardedPtr dialog = new KDialogBase( "Default Category for Payee", KDialogBase::Yes | KDialogBase::No | KDialogBase::Cancel, KDialogBase::Yes, KDialogBase::Cancel, @@ -922,20 +922,20 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra KGuiItem(i18n("Save Category")), KGuiItem(i18n("No Category")), KGuiItem(i18n("Abort"))); - QVBox *topcontents = new QVBox (dialog); + TQVBox *topcontents = new TQVBox (dialog); topcontents->setSpacing(KDialog::spacingHint()*2); topcontents->setMargin(KDialog::marginHint()); //add in caption? and account combo here - QLabel *label1 = new QLabel( topcontents); - label1->setText(i18n("Please select a default category for payee '%1':").arg(payee.name().data())); + TQLabel *label1 = new TQLabel( topcontents); + label1->setText(i18n("Please select a default category for payee '%1':").tqarg(payee.name())); - QGuardedPtr accountCombo = new KMyMoneyAccountCombo(topcontents); + TQGuardedPtr accountCombo = new KMyMoneyAccountCombo(topcontents); dialog->setMainWidget(topcontents); int result = dialog->exec(); - QString accountId; + TQString accountId; if (accountCombo && !accountCombo->selectedAccounts().isEmpty()) { accountId = accountCombo->selectedAccounts().front(); } @@ -961,13 +961,13 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to add payee/receiver"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } else if(rc == KMessageBox::No) { - s1.setPayeeId(QString()); + s1.setPayeeId(TQString()); } else { throw new MYMONEYEXCEPTION("USERABORT"); @@ -995,7 +995,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra MyMoneySplit s; s.setReconcileFlag(MyMoneySplit::Cleared); s.clearId(); - s.setBankID(QString()); + s.setBankID(TQString()); s.setShares(-s1.shares()); s.setValue(-s1.value()); s.setAccountId(payeeObj.defaultAccountId()); @@ -1004,7 +1004,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra else if (t_in.m_listSplits.isEmpty() && !d->m_skipCategoryMatching) { MyMoneyTransactionFilter filter(thisaccount.id()); filter.addPayee(payeeid); - QValueList list = file->transactionList(filter); + TQValueList list = file->transactionList(filter); if(!list.empty()) { // Default to using the most recent transaction as the reference @@ -1015,7 +1015,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // with the same VALUE as our imported transaction, and if so take that one. if ( list.count() > 1 ) { - QValueList::ConstIterator it_trans = list.fromLast(); + TQValueList::ConstIterator it_trans = list.fromLast(); while ( it_trans != list.end() ) { MyMoneySplit s = (*it_trans).splitByAccount(thisaccount.id()); @@ -1028,7 +1028,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra } } - QValueList::ConstIterator it_split; + TQValueList::ConstIterator it_split; for(it_split = t_old.splits().begin(); it_split != t_old.splits().end(); ++it_split) { // We don't need the split that covers this account, @@ -1038,7 +1038,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra MyMoneySplit s(*it_split); s.setReconcileFlag(MyMoneySplit::NotReconciled); s.clearId(); - s.setBankID(QString()); + s.setBankID(TQString()); if ( t_old.splits().count() == 2 ) { @@ -1085,7 +1085,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // process splits //****************************************** - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = t_in.m_listSplits.begin(); it_s != t_in.m_listSplits.end(); ++it_s) { MyMoneySplit s2; s2.setAccountId((*it_s).m_accountId); @@ -1101,7 +1101,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra } #if 0 - QString accountId; + TQString accountId; int count; int cnt = 0; count = t_in.m_listSplits.count(); @@ -1113,7 +1113,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra s2.clearId(); s2.setValue(t_in.m_listSplits[cnt].m_amount); s2.setShares(t_in.m_listSplits[cnt].m_amount); - s2.setAccountId(QString(t_in.m_listSplits[cnt].m_accountId)); + s2.setAccountId(TQString(t_in.m_listSplits[cnt].m_accountId)); #if 0 accountId = file->nameToAccount(t_in.m_listSplits[cnt].m_strCategoryName); if (accountId.isEmpty()) @@ -1164,7 +1164,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra // to enter the schedule and match it agains the new transaction. Otherwise, we // just leave the transaction as imported. MyMoneySchedule schedule(*(dynamic_cast(o))); - if(KMessageBox::questionYesNo(0, QString("%1").arg(i18n("KMyMoney has found a scheduled transaction named %1 which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ").arg(schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) { + if(KMessageBox::questionYesNo(0, TQString("%1").tqarg(i18n("KMyMoney has found a scheduled transaction named %1 which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ").tqarg(schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) { KEnterScheduleDlg dlg(0, schedule); TransactionEditor* editor = dlg.startEdit(); if(editor) { @@ -1197,7 +1197,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra } editor->createTransaction(torig, dlg.transaction(), dlg.transaction().splits()[0], true); - QString newId; + TQString newId; if(editor->enterTransactions(newId, false, true)) { if(!newId.isEmpty()) { torig = MyMoneyFile::instance()->transaction(newId); @@ -1221,7 +1221,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra } delete o; } catch (MyMoneyException *e) { - QString message(i18n("Problem adding or matching imported transaction with id '%1': %2").arg(t_in.m_strBankID).arg(e->what())); + TQString message(i18n("Problem adding or matching imported transaction with id '%1': %2").tqarg(t_in.m_strBankID).tqarg(e->what())); qDebug("%s", message.data()); delete e; @@ -1237,22 +1237,22 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode MyMoneyFile* file = MyMoneyFile::instance(); - QString accountId; + TQString accountId; // Try to find an existing account in the engine which matches this one. // There are two ways to be a "matching account". The account number can // match the statement account OR the "StatementKey" property can match. // Either way, we'll update the "StatementKey" property for next time. - QString accountNumber = account.number(); + TQString accountNumber = account.number(); if ( ! accountNumber.isEmpty() ) { // Get a list of all accounts - QValueList accounts; + TQValueList accounts; file->accountList(accounts); // Iterate through them - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { if ( @@ -1270,13 +1270,13 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode } } - QString msg = i18n("You have downloaded a statement for the following account:

"); - msg += i18n(" - Account Name: %1").arg(account.name()) + "
"; - msg += i18n(" - Account Type: %1").arg(KMyMoneyUtils::accountTypeToString(account.accountType())) + "
"; - msg += i18n(" - Account Number: %1").arg(account.number()) + "
"; + TQString msg = i18n("You have downloaded a statement for the following account:

"); + msg += i18n(" - Account Name: %1").tqarg(account.name()) + "
"; + msg += i18n(" - Account Type: %1").tqarg(KMyMoneyUtils::accountTypeToString(account.accountType())) + "
"; + msg += i18n(" - Account Number: %1").tqarg(account.number()) + "
"; msg += "
"; - QString header; + TQString header; if(!account.name().isEmpty()) { @@ -1302,11 +1302,11 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode accountSelect.setMode(false); accountSelect.showAbortButton(true); accountSelect.m_qifEntry->hide(); - QString accname; + TQString accname; bool done = false; while ( !done ) { - if ( accountSelect.exec() == QDialog::Accepted && !accountSelect.selectedAccount().isEmpty() ) + if ( accountSelect.exec() == TQDialog::Accepted && !accountSelect.selectedAccount().isEmpty() ) { result = true; done = true; @@ -1332,18 +1332,18 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode //throw new MYMONEYEXCEPTION("USERABORT"); done = true; else - KMessageBox::error(0, QString("%1").arg(i18n("You must select an account, create a new one, or press the Abort button."))); + KMessageBox::error(0, TQString("%1").tqarg(i18n("You must select an account, create a new one, or press the Abort button."))); } } return result; } -void MyMoneyStatementReader::setProgressCallback(void(*callback)(int, int, const QString&)) +void MyMoneyStatementReader::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStatementReader::signalProgress(int current, int total, const QString& msg) +void MyMoneyStatementReader::signalProgress(int current, int total, const TQString& msg) { if(m_progressCallback != 0) (*m_progressCallback)(current, total, msg); diff --git a/kmymoney2/converter/mymoneystatementreader.h b/kmymoney2/converter/mymoneystatementreader.h index 46d74d7..6ea2ef9 100644 --- a/kmymoney2/converter/mymoneystatementreader.h +++ b/kmymoney2/converter/mymoneystatementreader.h @@ -27,9 +27,9 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -45,16 +45,17 @@ #include "../mymoney/mymoneystatement.h" class MyMoneyFileTransaction; -class QStringList; +class TQStringList; /** * This is a pared-down version of a MyMoneyQifReader object * * @author Ace Jones */ -class MyMoneyStatementReader : public QObject +class MyMoneyStatementReader : public TQObject { Q_OBJECT + TQ_OBJECT public: MyMoneyStatementReader(); @@ -68,7 +69,7 @@ public: * @retval true the import was processed successfully * @retval false the import resulted in a failure. */ - bool import(const MyMoneyStatement& s, QStringList& messages); + bool import(const MyMoneyStatement& s, TQStringList& messages); /** * This method is used to modify the auto payee creation flag. @@ -87,7 +88,7 @@ public: const MyMoneyAccount& account() const { return m_account; }; - void setProgressCallback(void(*callback)(int, int, const QString&)); + void setProgressCallback(void(*callback)(int, int, const TQString&)); /** * Returns true in case any transaction has been added to the engine @@ -103,7 +104,7 @@ private: * * For a parameter description see KMyMoneyView::progressCallback(). */ - void signalProgress(int current, int total, const QString& = ""); + void signalProgress(int current, int total, const TQString& = ""); void processTransactionEntry(const MyMoneyStatement::Transaction& t_in); void processSecurityEntry(const MyMoneyStatement::Security& s_in); @@ -138,14 +139,14 @@ private: /// \internal d-pointer instance. Private* const d; MyMoneyAccount m_account; - QStringList m_dontAskAgain; + TQStringList m_dontAskAgain; bool m_skipAccount; bool m_userAbort; bool m_autoCreatePayee; bool m_askPayeeCategory; MyMoneyFileTransaction* m_ft; - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); }; #endif diff --git a/kmymoney2/converter/mymoneytemplate.cpp b/kmymoney2/converter/mymoneytemplate.cpp index 63305c6..1a8860b 100644 --- a/kmymoney2/converter/mymoneytemplate.cpp +++ b/kmymoney2/converter/mymoneytemplate.cpp @@ -20,9 +20,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,7 +54,7 @@ MyMoneyTemplate::~MyMoneyTemplate() bool MyMoneyTemplate::loadTemplate(const KURL& url) { - QString filename; + TQString filename; if(!url.isValid()) { qDebug("Invalid template URL '%s'", url.url().latin1()); @@ -67,10 +67,10 @@ bool MyMoneyTemplate::loadTemplate(const KURL& url) } else { bool rc; - rc = KIO::NetAccess::download(url, filename, qApp->mainWidget()); + rc = KIO::NetAccess::download(url, filename, tqApp->mainWidget()); if(!rc) { - KMessageBox::detailedError(qApp->mainWidget(), - i18n("Error while loading file '%1'!").arg(url.url()), + KMessageBox::detailedError(tqApp->mainWidget(), + i18n("Error while loading file '%1'!").tqarg(url.url()), KIO::NetAccess::lastErrorString(), i18n("File access error")); return false; @@ -78,27 +78,27 @@ bool MyMoneyTemplate::loadTemplate(const KURL& url) } bool rc = true; - QFile file(filename); - QFileInfo info(file); + TQFile file(filename); + TQFileInfo info(file); if(!info.isFile()) { - QString msg=i18n("%1 is not a template file.").arg(filename); - KMessageBox::error(qApp->mainWidget(), QString("

")+msg, i18n("Filetype Error")); + TQString msg=i18n("%1 is not a template file.").tqarg(filename); + KMessageBox::error(tqApp->mainWidget(), TQString("

")+msg, i18n("Filetype Error")); return false; } if(file.open(IO_ReadOnly)) { - QString errMsg; + TQString errMsg; int errLine, errColumn; if(!m_doc.setContent(&file, &errMsg, &errLine, &errColumn)) { - QString msg=i18n("Error while reading template file %1 in line %2, column %3").arg(filename).arg(errLine).arg(errColumn); - KMessageBox::detailedError(qApp->mainWidget(), QString("

")+msg, errMsg, i18n("Template Error")); + TQString msg=i18n("Error while reading template file %1 in line %2, column %3").tqarg(filename).tqarg(errLine).tqarg(errColumn); + KMessageBox::detailedError(tqApp->mainWidget(), TQString("

")+msg, errMsg, i18n("Template Error")); rc = false; } else { rc = loadDescription(); } file.close(); } else { - KMessageBox::sorry(qApp->mainWidget(), i18n("File '%1' not found!").arg(filename)); + KMessageBox::sorry(tqApp->mainWidget(), i18n("File '%1' not found!").tqarg(filename)); rc = false; } @@ -119,12 +119,12 @@ bool MyMoneyTemplate::loadDescription(void) const int invalid = 0x10; const int validHeader = 0x0F; - QDomElement rootElement = m_doc.documentElement(); + TQDomElement rootElement = m_doc.documentElement(); if(!rootElement.isNull() && rootElement.tagName() == "kmymoney-account-template") { - QDomNode child = rootElement.firstChild(); + TQDomNode child = rootElement.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); // qDebug("MyMoneyTemplate::import: Processing child node %s", childElement.tagName().data()); if(childElement.tagName() == "accounts") { m_accounts = childElement.firstChild(); @@ -139,7 +139,7 @@ bool MyMoneyTemplate::loadDescription(void) m_longDesc = childElement.text(); validMask |= validLong; } else { - KMessageBox::error(qApp->mainWidget(), QString("

")+i18n("Invalid tag %1 in template file %2!").arg(childElement.tagName()).arg(m_source.prettyURL())); + KMessageBox::error(tqApp->mainWidget(), TQString("

")+i18n("Invalid tag %1 in template file %2!").tqarg(childElement.tagName()).tqarg(m_source.prettyURL())); validMask |= invalid; } child = child.nextSibling(); @@ -148,14 +148,14 @@ bool MyMoneyTemplate::loadDescription(void) return validMask == validHeader; } -bool MyMoneyTemplate::hierarchy(QMap& list, const QString& parent, QDomNode account) +bool MyMoneyTemplate::hierarchy(TQMap& list, const TQString& tqparent, TQDomNode account) { bool rc = true; while(rc == true && !account.isNull()) { if(account.isElement()) { - QDomElement accountElement = account.toElement(); + TQDomElement accountElement = account.toElement(); if(accountElement.tagName() == "account") { - QString name = QString("%1:%2").arg(parent).arg(accountElement.attribute("name")); + TQString name = TQString("%1:%2").tqarg(tqparent).tqarg(accountElement.attribute("name")); list[name] = 0; hierarchy(list, name, account.firstChild()); } @@ -165,12 +165,12 @@ bool MyMoneyTemplate::hierarchy(QMap& list, const QStri return rc; } -void MyMoneyTemplate::hierarchy(QMap& list) +void MyMoneyTemplate::hierarchy(TQMap& list) { bool rc = !m_accounts.isNull(); - QDomNode accounts = m_accounts; + TQDomNode accounts = m_accounts; while(rc == true && !accounts.isNull() && accounts.isElement()) { - QDomElement childElement = accounts.toElement(); + TQDomElement childElement = accounts.toElement(); if(childElement.tagName() == "account" && childElement.attribute("name") == "") { switch(childElement.attribute("type").toUInt()) { @@ -206,44 +206,44 @@ void MyMoneyTemplate::hierarchy(QMap& list) } } -bool MyMoneyTemplate::importTemplate(void(*callback)(int, int, const QString&)) +bool MyMoneyTemplate::importTemplate(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; bool rc = !m_accounts.isNull(); MyMoneyFile* file = MyMoneyFile::instance(); - signalProgress(0, m_doc.elementsByTagName("account").count(), i18n("Loading template %1").arg(m_source.url())); + signalProgress(0, m_doc.elementsByTagName("account").count(), i18n("Loading template %1").tqarg(m_source.url())); m_accountsRead = 0; while(rc == true && !m_accounts.isNull() && m_accounts.isElement()) { - QDomElement childElement = m_accounts.toElement(); + TQDomElement childElement = m_accounts.toElement(); if(childElement.tagName() == "account" && childElement.attribute("name") == "") { ++m_accountsRead; - MyMoneyAccount parent; + MyMoneyAccount tqparent; switch(childElement.attribute("type").toUInt()) { case MyMoneyAccount::Asset: - parent = file->asset(); + tqparent = file->asset(); break; case MyMoneyAccount::Liability: - parent = file->liability(); + tqparent = file->liability(); break; case MyMoneyAccount::Income: - parent = file->income(); + tqparent = file->income(); break; case MyMoneyAccount::Expense: - parent = file->expense(); + tqparent = file->expense(); break; case MyMoneyAccount::Equity: - parent = file->equity(); + tqparent = file->equity(); break; default: - KMessageBox::error(qApp->mainWidget(), QString("

")+i18n("Invalid top-level account type %1 in template file %2!").arg(childElement.attribute("type")).arg(m_source.prettyURL())); + KMessageBox::error(tqApp->mainWidget(), TQString("

")+i18n("Invalid top-level account type %1 in template file %2!").tqarg(childElement.attribute("type")).tqarg(m_source.prettyURL())); rc = false; } if(rc == true) { - rc = createAccounts(parent, childElement.firstChild()); + rc = createAccounts(tqparent, childElement.firstChild()); } } else { rc = false; @@ -254,20 +254,20 @@ bool MyMoneyTemplate::importTemplate(void(*callback)(int, int, const QString&)) return rc; } -bool MyMoneyTemplate::createAccounts(MyMoneyAccount& parent, QDomNode account) +bool MyMoneyTemplate::createAccounts(MyMoneyAccount& tqparent, TQDomNode account) { bool rc = true; while(rc == true && !account.isNull()) { MyMoneyAccount acc; if(account.isElement()) { - QDomElement accountElement = account.toElement(); + TQDomElement accountElement = account.toElement(); if(accountElement.tagName() == "account") { signalProgress(++m_accountsRead, 0); - QValueList subAccountList; - QValueList::ConstIterator it; + TQValueList subAccountList; + TQValueList::ConstIterator it; it = subAccountList.end(); - if(!parent.accountList().isEmpty()) { - MyMoneyFile::instance()->accountList(subAccountList, parent.accountList()); + if(!tqparent.accountList().isEmpty()) { + MyMoneyFile::instance()->accountList(subAccountList, tqparent.accountList()); for(it = subAccountList.begin(); it != subAccountList.end(); ++it) { if((*it).name() == accountElement.attribute("name")) { acc = *it; @@ -281,7 +281,7 @@ bool MyMoneyTemplate::createAccounts(MyMoneyAccount& parent, QDomNode account) acc.setAccountType(static_cast(accountElement.attribute("type").toUInt())); setFlags(acc, account.firstChild()); try { - MyMoneyFile::instance()->addAccount(acc, parent); + MyMoneyFile::instance()->addAccount(acc, tqparent); } catch(MyMoneyException *e) { delete e; } @@ -294,19 +294,19 @@ bool MyMoneyTemplate::createAccounts(MyMoneyAccount& parent, QDomNode account) return rc; } -bool MyMoneyTemplate::setFlags(MyMoneyAccount& acc, QDomNode flags) +bool MyMoneyTemplate::setFlags(MyMoneyAccount& acc, TQDomNode flags) { bool rc = true; while(rc == true && !flags.isNull()) { if(flags.isElement()) { - QDomElement flagElement = flags.toElement(); + TQDomElement flagElement = flags.toElement(); if(flagElement.tagName() == "flag") { // make sure, we only store flags we know! - QString value = flagElement.attribute("name"); + TQString value = flagElement.attribute("name"); if(value == "Tax") { acc.setValue(value.latin1(), "Yes"); } else { - KMessageBox::error(qApp->mainWidget(), QString("

")+i18n("Invalid flag type %1 for account %3 in template file %2!").arg(flagElement.attribute("name")).arg(m_source.prettyURL()).arg(acc.name())); + KMessageBox::error(tqApp->mainWidget(), TQString("

")+i18n("Invalid flag type %1 for account %3 in template file %2!").tqarg(flagElement.attribute("name")).tqarg(m_source.prettyURL()).tqarg(acc.name())); rc = false; } } @@ -316,34 +316,34 @@ bool MyMoneyTemplate::setFlags(MyMoneyAccount& acc, QDomNode flags) return rc; } -void MyMoneyTemplate::signalProgress(int current, int total, const QString& msg) +void MyMoneyTemplate::signalProgress(int current, int total, const TQString& msg) { if(m_progressCallback != 0) (*m_progressCallback)(current, total, msg); } -bool MyMoneyTemplate::exportTemplate(void(*callback)(int, int, const QString&)) +bool MyMoneyTemplate::exportTemplate(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; - m_doc = QDomDocument("KMYMONEY-TEMPLATE"); + m_doc = TQDomDocument("KMYMONEY-TEMPLATE"); - QDomProcessingInstruction instruct = m_doc.createProcessingInstruction(QString("xml"), QString("version=\"1.0\" encoding=\"utf-8\"")); + TQDomProcessingInstruction instruct = m_doc.createProcessingInstruction(TQString("xml"), TQString("version=\"1.0\" encoding=\"utf-8\"")); m_doc.appendChild(instruct); - QDomElement mainElement = m_doc.createElement("kmymoney-account-template"); + TQDomElement mainElement = m_doc.createElement("kmymoney-account-template"); m_doc.appendChild(mainElement); - QDomElement title = m_doc.createElement("title"); + TQDomElement title = m_doc.createElement("title"); mainElement.appendChild(title); - QDomElement shortDesc = m_doc.createElement("shortdesc"); + TQDomElement shortDesc = m_doc.createElement("shortdesc"); mainElement.appendChild(shortDesc); - QDomElement longDesc = m_doc.createElement("longdesc"); + TQDomElement longDesc = m_doc.createElement("longdesc"); mainElement.appendChild(longDesc); - QDomElement accounts = m_doc.createElement("accounts"); + TQDomElement accounts = m_doc.createElement("accounts"); mainElement.appendChild(accounts); // addAccountStructure(accounts, MyMoneyFile::instance()->asset()); @@ -355,24 +355,24 @@ bool MyMoneyTemplate::exportTemplate(void(*callback)(int, int, const QString&)) return true; } -bool MyMoneyTemplate::addAccountStructure(QDomElement& parent, const MyMoneyAccount& acc) +bool MyMoneyTemplate::addAccountStructure(TQDomElement& tqparent, const MyMoneyAccount& acc) { - QDomElement account = m_doc.createElement("account"); - parent.appendChild(account); + TQDomElement account = m_doc.createElement("account"); + tqparent.appendChild(account); if(MyMoneyFile::instance()->isStandardAccount(acc.id())) - account.setAttribute(QString("name"), QString()); + account.setAttribute(TQString("name"), TQString()); else - account.setAttribute(QString("name"), acc.name()); - account.setAttribute(QString("type"), acc.accountType()); + account.setAttribute(TQString("name"), acc.name()); + account.setAttribute(TQString("type"), acc.accountType()); // FIXME: add tax flag stuff // any child accounts? if(acc.accountList().count() > 0) { - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list, acc.accountList(), false); - QValueList::Iterator it; + TQValueList::Iterator it; for(it = list.begin(); it != list.end(); ++it) { addAccountStructure(account, *it); } @@ -382,7 +382,7 @@ bool MyMoneyTemplate::addAccountStructure(QDomElement& parent, const MyMoneyAcco bool MyMoneyTemplate::saveTemplate(const KURL& url) { - QString filename; + TQString filename; if(!url.isValid()) { qDebug("Invalid template URL '%s'", url.url().latin1()); @@ -395,25 +395,25 @@ bool MyMoneyTemplate::saveTemplate(const KURL& url) if(qfile.status() == 0) { saveToLocalFile(qfile.file()); if(!qfile.close()) { - throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); + throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename)); } } else { - throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); + throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename)); } } else { KTempFile tmpfile; saveToLocalFile(tmpfile.file()); if(!KIO::NetAccess::upload(tmpfile.name(), url, NULL)) - throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").arg(url.url())); + throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").tqarg(url.url())); tmpfile.unlink(); } return true; } -bool MyMoneyTemplate::saveToLocalFile(QFile* qfile) +bool MyMoneyTemplate::saveToLocalFile(TQFile* qfile) { - QTextStream stream(qfile); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(qfile); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << m_doc.toString(); return true; diff --git a/kmymoney2/converter/mymoneytemplate.h b/kmymoney2/converter/mymoneytemplate.h index 5c96b1f..352fd4e 100644 --- a/kmymoney2/converter/mymoneytemplate.h +++ b/kmymoney2/converter/mymoneytemplate.h @@ -21,9 +21,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QFile; -class QListViewItem; +#include +class TQFile; +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes @@ -55,22 +55,22 @@ public: bool loadTemplate(const KURL& url); bool saveTemplate(const KURL& url); - bool importTemplate(void(*callback)(int, int, const QString&)); - bool exportTemplate(void(*callback)(int, int, const QString&)); + bool importTemplate(void(*callback)(int, int, const TQString&)); + bool exportTemplate(void(*callback)(int, int, const TQString&)); - const QString& title(void) const { return m_title; } - const QString& shortDescription(void) const { return m_shortDesc; } - const QString& longDescription(void) const { return m_longDesc; } + const TQString& title(void) const { return m_title; } + const TQString& shortDescription(void) const { return m_shortDesc; } + const TQString& longDescription(void) const { return m_longDesc; } - void hierarchy(QMap& list); + void hierarchy(TQMap& list); protected: bool loadDescription(void); - bool createAccounts(MyMoneyAccount& parent, QDomNode account); - bool setFlags(MyMoneyAccount& acc, QDomNode flags); - bool saveToLocalFile(QFile* qfile); - bool addAccountStructure(QDomElement& parent, const MyMoneyAccount& acc); - bool hierarchy(QMap& list, const QString& parent, QDomNode account); + bool createAccounts(MyMoneyAccount& tqparent, TQDomNode account); + bool setFlags(MyMoneyAccount& acc, TQDomNode flags); + bool saveToLocalFile(TQFile* qfile); + bool addAccountStructure(TQDomElement& tqparent, const MyMoneyAccount& acc); + bool hierarchy(TQMap& list, const TQString& tqparent, TQDomNode account); /** * This method is used to update the progress information. It @@ -78,16 +78,16 @@ protected: * * For a parameter description see KMyMoneyView::progressCallback(). */ - void signalProgress(int current, int total, const QString& = ""); + void signalProgress(int current, int total, const TQString& = ""); private: - QDomDocument m_doc; - QDomNode m_accounts; - QString m_title; - QString m_shortDesc; - QString m_longDesc; + TQDomDocument m_doc; + TQDomNode m_accounts; + TQString m_title; + TQString m_shortDesc; + TQString m_longDesc; KURL m_source; - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); int m_accountsRead; }; diff --git a/kmymoney2/converter/webpricequote.cpp b/kmymoney2/converter/webpricequote.cpp index de30963..325560b 100644 --- a/kmymoney2/converter/webpricequote.cpp +++ b/kmymoney2/converter/webpricequote.cpp @@ -18,10 +18,10 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -46,51 +46,51 @@ #include "webpricequote.h" // define static members -QString WebPriceQuote::m_financeQuoteScriptPath; -QStringList WebPriceQuote::m_financeQuoteSources; +TQString WebPriceQuote::m_financeQuoteScriptPath; +TQStringList WebPriceQuote::m_financeQuoteSources; -QString * WebPriceQuote::lastErrorMsg; +TQString * WebPriceQuote::lastErrorMsg; int WebPriceQuote::lastErrorCode = 0; -WebPriceQuote::WebPriceQuote( QObject* _parent, const char* _name ): - QObject( _parent, _name ) +WebPriceQuote::WebPriceQuote( TQObject* _parent, const char* _name ): + TQObject( _parent, _name ) { m_financeQuoteScriptPath = - KGlobal::dirs()->findResource("appdata", QString("misc/financequote.pl")); - connect(&m_filter,SIGNAL(processExited(const QString&)),this,SLOT(slotParseQuote(const QString&))); + KGlobal::dirs()->findResource("appdata", TQString("misc/financequote.pl")); + connect(&m_filter,TQT_SIGNAL(processExited(const TQString&)),this,TQT_SLOT(slotParseQuote(const TQString&))); } WebPriceQuote::~WebPriceQuote() { } -bool WebPriceQuote::launch( const QString& _symbol, const QString& _id, const QString& _sourcename ) +bool WebPriceQuote::launch( const TQString& _symbol, const TQString& _id, const TQString& _sourcename ) { - if (_sourcename.contains("Finance::Quote")) + if (_sourcename.tqcontains("Finance::Quote")) return (launchFinanceQuote (_symbol, _id, _sourcename)); else return (launchNative (_symbol, _id, _sourcename)); } -bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, const QString& _sourcename ) { +bool WebPriceQuote::launchNative( const TQString& _symbol, const TQString& _id, const TQString& _sourcename ) { bool result = true; m_symbol = _symbol; m_id = _id; -// emit status(QString("(Debug) symbol=%1 id=%2...").arg(_symbol,_id)); +// emit status(TQString("(Debug) symbol=%1 id=%2...").tqarg(_symbol,_id)); // if we're running normally, with a UI, we can just get these the normal way, // from the config file if ( kapp ) { - QString sourcename = _sourcename; + TQString sourcename = _sourcename; if ( sourcename.isEmpty() ) sourcename = "Yahoo"; - if ( quoteSources().contains(sourcename) ) + if ( quoteSources().tqcontains(sourcename) ) m_source = WebPriceQuoteSource(sourcename); else - emit error(QString("Source <%1> does not exist.").arg(sourcename)); + emit error(TQString("Source <%1> does not exist.").tqarg(sourcename)); } // otherwise, if we have no kapp, we have no config. so we just get them from // the defaults @@ -105,21 +105,21 @@ bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, co KURL url; // if the source has room for TWO symbols.. - if ( m_source.m_url.contains("%2") ) + if ( m_source.m_url.tqcontains("%2") ) { // this is a two-symbol quote. split the symbol into two. valid symbol // characters are: 0-9, A-Z and the dot. anything else is a separator - QRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/); + TQRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/); // if we've truly found 2 symbols delimited this way... if ( splitrx.search(m_symbol) != -1 ) - url = KURL::fromPathOrURL(m_source.m_url.arg(splitrx.cap(1),splitrx.cap(2))); + url = KURL::fromPathOrURL(m_source.m_url.tqarg(splitrx.cap(1),splitrx.cap(2))); else - kdDebug(2) << "WebPriceQuote::launch() did not find 2 symbols" << endl; + kdDebug(2) << "WebPriceQuote::launch() did not tqfind 2 symbols" << endl; } else // a regular one-symbol quote - url = KURL::fromPathOrURL(m_source.m_url.arg(m_symbol)); + url = KURL::fromPathOrURL(m_source.m_url.tqarg(m_symbol)); // If we're running a non-interactive session (with no UI), we can't // use KIO::NetAccess, so we have to get our web data the old-fashioned @@ -133,10 +133,10 @@ bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, co if ( url.isLocalFile() ) { - emit status(QString("Executing %1...").arg(url.path())); + emit status(TQString("Executing %1...").tqarg(url.path())); m_filter.clearArguments(); - m_filter << QStringList::split(" ",url.path()); + m_filter << TQStringList::split(" ",url.path()); m_filter.setSymbol(m_symbol); // if we're running non-interactive, we'll need to block. @@ -152,52 +152,52 @@ bool WebPriceQuote::launchNative( const QString& _symbol, const QString& _id, co } else { - emit error(QString("Unable to launch: %1").arg(url.path())); - slotParseQuote(QString()); + emit error(TQString("Unable to launch: %1").tqarg(url.path())); + slotParseQuote(TQString()); } } else { - emit status(QString("Fetching URL %1...").arg(url.prettyURL())); + emit status(TQString("Fetching URL %1...").tqarg(url.prettyURL())); - QString tmpFile; + TQString tmpFile; if( download( url, tmpFile, NULL ) ) { kdDebug(2) << "Downloaded " << tmpFile << endl; - QFile f(tmpFile); + TQFile f(tmpFile); if ( f.open( IO_ReadOnly ) ) { result = true; - QString quote = QTextStream(&f).read(); + TQString quote = TQTextStream(&f).read(); f.close(); slotParseQuote(quote); } else { - slotParseQuote(QString()); + slotParseQuote(TQString()); } removeTempFile( tmpFile ); } else { emit error(KIO::NetAccess::lastErrorString()); - slotParseQuote(QString()); + slotParseQuote(TQString()); } } return result; } -void WebPriceQuote::removeTempFile(const QString& tmpFile) +void WebPriceQuote::removeTempFile(const TQString& tmpFile) { if(tmpFile == m_tmpFile) { unlink(tmpFile); - m_tmpFile = QString(); + m_tmpFile = TQString(); } } -bool WebPriceQuote::download(const KURL& u, QString & target, QWidget* window) +bool WebPriceQuote::download(const KURL& u, TQString & target, TQWidget* window) { - m_tmpFile = QString(); + m_tmpFile = TQString(); // the following code taken and adapted from KIO::NetAccess::download() if (target.isEmpty()) @@ -218,8 +218,8 @@ bool WebPriceQuote::download(const KURL& u, QString & target, QWidget* window) KIO::Job * job = KIO::file_copy( u, dest, -1, true, false, false ); job->setWindow (window); job->addMetaData("cache", "reload"); // bypass cache - connect( job, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotResult (KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotResult (KIO::Job *) ) ); enter_loop(); return bJobOK; @@ -229,15 +229,15 @@ bool WebPriceQuote::download(const KURL& u, QString & target, QWidget* window) // The following parts are copied and adjusted from KIO::NetAccess // If a troll sees this, he kills me -void qt_enter_modal( QWidget *widget ); -void qt_leave_modal( QWidget *widget ); +void qt_enter_modal( TQWidget *widget ); +void qt_leave_modal( TQWidget *widget ); void WebPriceQuote::enter_loop(void) { - QWidget dummy(0,0,WType_Dialog | WShowModal); - dummy.setFocusPolicy( QWidget::NoFocus ); + TQWidget dummy(0,0,WType_Dialog | WShowModal); + dummy.setFocusPolicy( TQ_NoFocus ); qt_enter_modal(&dummy); - qApp->enter_loop(); + tqApp->enter_loop(); qt_leave_modal(&dummy); } @@ -248,34 +248,34 @@ void WebPriceQuote::slotResult( KIO::Job * job ) if ( !bJobOK ) { if ( !lastErrorMsg ) - lastErrorMsg = new QString; + lastErrorMsg = new TQString; *lastErrorMsg = job->errorString(); } - qApp->exit_loop(); + tqApp->exit_loop(); } // The above parts are copied and adjusted from KIO::NetAccess -bool WebPriceQuote::launchFinanceQuote ( const QString& _symbol, const QString& _id, - const QString& _sourcename ) { +bool WebPriceQuote::launchFinanceQuote ( const TQString& _symbol, const TQString& _id, + const TQString& _sourcename ) { bool result = true; m_symbol = _symbol; m_id = _id; - QString FQSource = _sourcename.section (" ", 1); + TQString FTQSource = _sourcename.section (" ", 1); m_source = WebPriceQuoteSource (_sourcename, m_financeQuoteScriptPath, "\"([^,\"]*)\",.*", // symbol regexp "[^,]*,[^,]*,\"([^\"]*)\"", // price regexp "[^,]*,([^,]*),.*", // date regexp "%y-%m-%d"); // date format - //emit status(QString("(Debug) symbol=%1 id=%2...").arg(_symbol,_id)); + //emit status(TQString("(Debug) symbol=%1 id=%2...").tqarg(_symbol,_id)); m_filter.clearArguments(); - m_filter << "perl" << m_financeQuoteScriptPath << FQSource << KProcess::quote(_symbol); + m_filter << "perl" << m_financeQuoteScriptPath << FTQSource << KProcess::quote(_symbol); m_filter.setUseShell(true); m_filter.setSymbol(m_symbol); - emit status(QString("Executing %1 %2 %3...").arg(m_financeQuoteScriptPath).arg(FQSource).arg(_symbol)); + emit status(TQString("Executing %1 %2 %3...").tqarg(m_financeQuoteScriptPath).tqarg(FTQSource).tqarg(_symbol)); // if we're running non-interactive, we'll need to block. // otherwise, just let us know when it's done. @@ -290,16 +290,16 @@ bool WebPriceQuote::launchFinanceQuote ( const QString& _symbol, const QString& } else { - emit error(QString("Unable to launch: %1").arg(m_financeQuoteScriptPath)); - slotParseQuote(QString()); + emit error(TQString("Unable to launch: %1").tqarg(m_financeQuoteScriptPath)); + slotParseQuote(TQString()); } return result; } -void WebPriceQuote::slotParseQuote(const QString& _quotedata) +void WebPriceQuote::slotParseQuote(const TQString& _quotedata) { - QString quotedata = _quotedata; + TQString quotedata = _quotedata; bool gotprice = false; bool gotdate = false; @@ -313,10 +313,10 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata) // // HTML tags - quotedata.remove(QRegExp("<[^>]*>")); + quotedata.remove(TQRegExp("<[^>]*>")); // &...;'s - quotedata.replace(QRegExp("&\\w+;")," "); + quotedata.tqreplace(TQRegExp("&\\w+;")," "); // Extra white space quotedata = quotedata.simplifyWhiteSpace(); @@ -324,20 +324,20 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata) #if KMM_DEBUG // Enable to get a look at the data coming back from the source after it's stripped - QFile file("stripped.txt"); + TQFile file("stripped.txt"); if ( file.open( IO_WriteOnly ) ) { - QTextStream( &file ) << quotedata; + TQTextStream( &file ) << quotedata; file.close(); } #endif - QRegExp symbolRegExp(m_source.m_sym); - QRegExp dateRegExp(m_source.m_date); - QRegExp priceRegExp(m_source.m_price); + TQRegExp symbolRegExp(m_source.m_sym); + TQRegExp dateRegExp(m_source.m_date); + TQRegExp priceRegExp(m_source.m_price); if( symbolRegExp.search(quotedata) > -1) - emit status(i18n("Symbol found: %1").arg(symbolRegExp.cap(1))); + emit status(i18n("Symbol found: %1").tqarg(symbolRegExp.cap(1))); if(priceRegExp.search(quotedata)> -1) { @@ -350,39 +350,39 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata) // // Remove all non-digits from the price string except the last one, and // set the last one to a period. - QString pricestr = priceRegExp.cap(1); + TQString pricestr = priceRegExp.cap(1); - int pos = pricestr.findRev(QRegExp("\\D")); + int pos = pricestr.tqfindRev(TQRegExp("\\D")); if ( pos > 0 ) { pricestr[pos] = '.'; - pos = pricestr.findRev(QRegExp("\\D"),pos-1); + pos = pricestr.tqfindRev(TQRegExp("\\D"),pos-1); } while ( pos > 0 ) { pricestr.remove(pos,1); - pos = pricestr.findRev(QRegExp("\\D"),pos); + pos = pricestr.tqfindRev(TQRegExp("\\D"),pos); } m_price = pricestr.toDouble(); - emit status(i18n("Price found: %1 (%2)").arg(pricestr).arg(m_price)); + emit status(i18n("Price found: %1 (%2)").tqarg(pricestr).tqarg(m_price)); } if(dateRegExp.search(quotedata) > -1) { - QString datestr = dateRegExp.cap(1); + TQString datestr = dateRegExp.cap(1); MyMoneyDateFormat dateparse(m_source.m_dateformat); try { m_date = dateparse.convertString( datestr,false /*strict*/ ); gotdate = true; - emit status(i18n("Date found: %1").arg(m_date.toString()));; + emit status(i18n("Date found: %1").tqarg(m_date.toString()));; } catch (MyMoneyException* e) { - // emit error(i18n("Unable to parse date %1 using format %2: %3").arg(datestr,dateparse.format(),e->what())); - m_date = QDate::currentDate(); + // emit error(i18n("Unable to parse date %1 using format %2: %3").tqarg(datestr,dateparse.format(),e->what())); + m_date = TQDate::tqcurrentDate(); gotdate = true; delete e; } @@ -394,20 +394,20 @@ void WebPriceQuote::slotParseQuote(const QString& _quotedata) } else { - emit error(i18n("Unable to update price for %1").arg(m_symbol)); + emit error(i18n("Unable to update price for %1").tqarg(m_symbol)); emit failed( m_id, m_symbol ); } } else { - emit error(i18n("Unable to update price for %1").arg(m_symbol)); + emit error(i18n("Unable to update price for %1").tqarg(m_symbol)); emit failed( m_id, m_symbol ); } } -QMap WebPriceQuote::defaultQuoteSources(void) +TQMap WebPriceQuote::defaultQuoteSources(void) { - QMap result; + TQMap result; result["Yahoo"] = WebPriceQuoteSource("Yahoo", "http://finance.yahoo.com/d/quotes.csv?s=%1&f=sl1d1", @@ -448,7 +448,7 @@ QMap WebPriceQuote::defaultQuoteSources(void) result["Globe & Mail"] = WebPriceQuoteSource("Globe & Mail", "http://globefunddb.theglobeandmail.com/gishome/plsql/gis.price_history?pi_fund_id=%1", - QString(), // symbolregexp + TQString(), // symbolregexp "Reinvestment Price \\w+ \\d+, \\d+ (\\d+\\.\\d+)", // priceregexp "Reinvestment Price (\\w+ \\d+, \\d+)", // dateregexp "%m %d %y" // dateformat @@ -456,7 +456,7 @@ QMap WebPriceQuote::defaultQuoteSources(void) result["MSN.CA"] = WebPriceQuoteSource("MSN.CA", "http://ca.moneycentral.msn.com/investor/quotes/quotes.asp?symbol=%1", - QString(), // symbolregexp + TQString(), // symbolregexp "Net Asset Value (\\d+\\.\\d+)", // priceregexp "NAV update (\\d+\\D+\\d+\\D+\\d+)", // dateregexp "%d %m %y" // dateformat @@ -464,7 +464,7 @@ QMap WebPriceQuote::defaultQuoteSources(void) // Finanztreff (replaces VWD.DE) and boerseonline supplied by Micahel Zimmerman result["Finanztreff"] = WebPriceQuoteSource("Finanztreff", "http://finanztreff.de/kurse_einzelkurs_detail.htn?u=100&i=%1", - QString(), // symbolregexp + TQString(), // symbolregexp "([0-9]+,\\d+).+Gattung:Fonds", // priceregexp "\\).(\\d+\\D+\\d+\\D+\\d+)", // dateregexp (doesn't work; date in chart "%d.%m.%y" // dateformat @@ -472,7 +472,7 @@ QMap WebPriceQuote::defaultQuoteSources(void) result["boerseonline"] = WebPriceQuoteSource("boerseonline", "http://www.boerse-online.de/tools/boerse/einzelkurs_kurse.htm?&s=%1", - QString(), // symbolregexp + TQString(), // symbolregexp "Akt\\. Kurs.(\\d+,\\d\\d)", // priceregexp "Datum.(\\d+\\.\\d+\\.\\d+)", // dateregexp (doesn't work; date in chart "%d.%m.%y" // dateformat @@ -538,7 +538,7 @@ QMap WebPriceQuote::defaultQuoteSources(void) result["Gielda Papierow Wartosciowych (GPW)"] = WebPriceQuoteSource("Gielda Papierow Wartosciowych (GPW)", "http://stooq.com/q/?s=%1", - QString(), // symbol regexp + TQString(), // symbol regexp "Kurs.*(\\d+\\.\\d+).*Data", // price regexp "(\\d{4,4}-\\d{2,2}-\\d{2,2})", // date regexp "%y %m %d" // date format @@ -548,7 +548,7 @@ QMap WebPriceQuote::defaultQuoteSources(void) // at OMX Baltic market. result["OMX Baltic funds"] = WebPriceQuoteSource("OMX Baltic funds", "http://www.baltic.omxgroup.com/market/?pg=nontradeddetails¤cy=0&instrument=%1", - QString(), // symbolregexp + TQString(), // symbolregexp "NAV (\\d+,\\d+)", // priceregexp "Kpv (\\d+.\\d+.\\d+)", // dateregexp "%d.%m.%y" // dateformat @@ -589,20 +589,20 @@ QMap WebPriceQuote::defaultQuoteSources(void) return result; } -QStringList WebPriceQuote::quoteSources (const _quoteSystemE _system) { +TQStringList WebPriceQuote::quoteSources (const _quoteSystemE _system) { if (_system == Native) return (quoteSourcesNative()); else return (quoteSourcesFinanceQuote()); } -QStringList WebPriceQuote::quoteSourcesNative() +TQStringList WebPriceQuote::quoteSourcesNative() { KConfig *kconfig = KGlobal::config(); - QStringList groups = kconfig->groupList(); + TQStringList groups = kconfig->groupList(); - QStringList::Iterator it; - QRegExp onlineQuoteSource(QString("^Online-Quote-Source-(.*)$")); + TQStringList::Iterator it; + TQRegExp onlineQuoteSource(TQString("^Online-Quote-Source-(.*)$")); // get rid of all 'non online quote source' entries for(it = groups.begin(); it != groups.end(); it = groups.remove(it)) { @@ -617,14 +617,14 @@ QStringList WebPriceQuote::quoteSourcesNative() if ( ! groups.count() && kconfig->hasGroup("Online Quotes Options") ) { kconfig->setGroup("Online Quotes Options"); - QString url(kconfig->readEntry("URL","http://finance.yahoo.com/d/quotes.csv?s=%1&f=sl1d1")); - QString symbolRegExp(kconfig->readEntry("SymbolRegex","\"([^,\"]*)\",.*")); - QString priceRegExp(kconfig->readEntry("PriceRegex","[^,]*,([^,]*),.*")); - QString dateRegExp(kconfig->readEntry("DateRegex","[^,]*,[^,]*,\"([^\"]*)\"")); + TQString url(kconfig->readEntry("URL","http://finance.yahoo.com/d/quotes.csv?s=%1&f=sl1d1")); + TQString symbolRegExp(kconfig->readEntry("SymbolRegex","\"([^,\"]*)\",.*")); + TQString priceRegExp(kconfig->readEntry("PriceRegex","[^,]*,([^,]*),.*")); + TQString dateRegExp(kconfig->readEntry("DateRegex","[^,]*,[^,]*,\"([^\"]*)\"")); kconfig->deleteGroup("Online Quotes Options"); groups += "Old Source"; - kconfig->setGroup(QString("Online-Quote-Source-%1").arg("Old Source")); + kconfig->setGroup(TQString("Online-Quote-Source-%1").tqarg("Old Source")); kconfig->writeEntry("URL", url); kconfig->writeEntry("SymbolRegex", symbolRegExp); kconfig->writeEntry("PriceRegex",priceRegExp); @@ -635,11 +635,11 @@ QStringList WebPriceQuote::quoteSourcesNative() // Set up each of the default sources. These are done piecemeal so that // when we add a new source, it's automatically picked up. - QMap defaults = defaultQuoteSources(); - QMap::const_iterator it_source = defaults.begin(); + TQMap defaults = defaultQuoteSources(); + TQMap::const_iterator it_source = defaults.begin(); while ( it_source != defaults.end() ) { - if ( ! groups.contains( (*it_source).m_name ) ) + if ( ! groups.tqcontains( (*it_source).m_name ) ) { groups += (*it_source).m_name; (*it_source).write(); @@ -651,15 +651,15 @@ QStringList WebPriceQuote::quoteSourcesNative() return groups; } -QStringList WebPriceQuote::quoteSourcesFinanceQuote() +TQStringList WebPriceQuote::quoteSourcesFinanceQuote() { if (m_financeQuoteSources.empty()) { // run the process one time only FinanceQuoteProcess getList; m_financeQuoteScriptPath = - KGlobal::dirs()->findResource("appdata", QString("misc/financequote.pl")); + KGlobal::dirs()->findResource("appdata", TQString("misc/financequote.pl")); getList.launch( m_financeQuoteScriptPath ); while (!getList.isFinished()) { - qApp->processEvents(); + tqApp->processEvents(); } m_financeQuoteSources = getList.getSourceList(); } @@ -670,7 +670,7 @@ QStringList WebPriceQuote::quoteSourcesFinanceQuote() // Helper class to load/save an individual source // -WebPriceQuoteSource::WebPriceQuoteSource(const QString& name, const QString& url, const QString& sym, const QString& price, const QString& date, const QString& dateformat): +WebPriceQuoteSource::WebPriceQuoteSource(const TQString& name, const TQString& url, const TQString& sym, const TQString& price, const TQString& date, const TQString& dateformat): m_name(name), m_url(url), m_sym(sym), @@ -680,11 +680,11 @@ WebPriceQuoteSource::WebPriceQuoteSource(const QString& name, const QString& url { } -WebPriceQuoteSource::WebPriceQuoteSource(const QString& name) +WebPriceQuoteSource::WebPriceQuoteSource(const TQString& name) { m_name = name; KConfig *kconfig = KGlobal::config(); - kconfig->setGroup(QString("Online-Quote-Source-%1").arg(m_name)); + kconfig->setGroup(TQString("Online-Quote-Source-%1").tqarg(m_name)); m_sym = kconfig->readEntry("SymbolRegex"); m_date = kconfig->readEntry("DateRegex"); m_dateformat = kconfig->readEntry("DateFormatRegex","%m %d %y"); @@ -696,7 +696,7 @@ WebPriceQuoteSource::WebPriceQuoteSource(const QString& name) void WebPriceQuoteSource::write(void) const { KConfig *kconfig = KGlobal::config(); - kconfig->setGroup(QString("Online-Quote-Source-%1").arg(m_name)); + kconfig->setGroup(TQString("Online-Quote-Source-%1").tqarg(m_name)); kconfig->writeEntry("URL", m_url); kconfig->writeEntry("PriceRegex", m_price); kconfig->writeEntry("DateRegex", m_date); @@ -708,7 +708,7 @@ void WebPriceQuoteSource::write(void) const kconfig->deleteEntry("SkipStripping"); } -void WebPriceQuoteSource::rename(const QString& name) +void WebPriceQuoteSource::rename(const TQString& name) { remove(); m_name = name; @@ -718,7 +718,7 @@ void WebPriceQuoteSource::rename(const QString& name) void WebPriceQuoteSource::remove(void) const { KConfig *kconfig = KGlobal::config(); - kconfig->deleteGroup(QString("Online-Quote-Source-%1").arg(m_name)); + kconfig->deleteGroup(TQString("Online-Quote-Source-%1").tqarg(m_name)); } // @@ -727,17 +727,17 @@ void WebPriceQuoteSource::remove(void) const WebPriceQuoteProcess::WebPriceQuoteProcess(void) { - connect(this, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(slotReceivedDataFromFilter(KProcess*, char*, int))); - connect(this, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*))); + connect(this, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedDataFromFilter(KProcess*, char*, int))); + connect(this, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotProcessExited(KProcess*))); } void WebPriceQuoteProcess::slotReceivedDataFromFilter(KProcess* /*_process*/, char* _pcbuffer, int _nbufferlen) { - QByteArray data; + TQByteArray data; data.duplicate(_pcbuffer, _nbufferlen); -// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << QString(data) << endl; - m_string += QString(data); +// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << TQString(data) << endl; + m_string += TQString(data); } void WebPriceQuoteProcess::slotProcessExited(KProcess*) @@ -809,17 +809,17 @@ FinanceQuoteProcess::FinanceQuoteProcess(void) m_fqNames["yahoo_europe"] = "Yahoo Europe"; m_fqNames["yahoo_nz"] = "Yahoo New Zealand"; m_fqNames["zifunds"] = "Zuerich Investments"; - connect(this, SIGNAL(receivedStdout(KProcess*, char*, int)), this, SLOT(slotReceivedDataFromFilter(KProcess*, char*, int))); - connect(this, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited(KProcess*))); + connect(this, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(slotReceivedDataFromFilter(KProcess*, char*, int))); + connect(this, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotProcessExited(KProcess*))); } void FinanceQuoteProcess::slotReceivedDataFromFilter(KProcess* /*_process*/, char* _pcbuffer, int _nbufferlen) { - QByteArray data; + TQByteArray data; data.duplicate(_pcbuffer, _nbufferlen); -// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << QString(data) << endl; - m_string += QString(data); +// kdDebug(2) << "WebPriceQuoteProcess::slotReceivedDataFromFilter(): " << TQString(data) << endl; + m_string += TQString(data); } void FinanceQuoteProcess::slotProcessExited(KProcess*) @@ -828,19 +828,19 @@ void FinanceQuoteProcess::slotProcessExited(KProcess*) m_isDone = true; } -void FinanceQuoteProcess::launch (const QString& scriptPath) { +void FinanceQuoteProcess::launch (const TQString& scriptPath) { clearArguments(); - arguments.append(QCString("perl")); - arguments.append (QCString(scriptPath)); - arguments.append (QCString("-l")); + arguments.append(TQCString("perl")); + arguments.append (TQCString(scriptPath)); + arguments.append (TQCString("-l")); if (!start(KProcess::NotifyOnExit, KProcess::Stdout)) qFatal ("Unable to start FQ script"); return; } -QStringList FinanceQuoteProcess::getSourceList() { - QStringList raw = QStringList::split(0x0A, m_string); - QStringList sources; - QStringList::iterator it; +TQStringList FinanceQuoteProcess::getSourceList() { + TQStringList raw = TQStringList::split(0x0A, m_string); + TQStringList sources; + TQStringList::iterator it; for (it = raw.begin(); it != raw.end(); ++it) { if (m_fqNames[*it].isEmpty()) sources.append(*it); else sources.append(m_fqNames[*it]); @@ -849,8 +849,8 @@ QStringList FinanceQuoteProcess::getSourceList() { return (sources); } -const QString FinanceQuoteProcess::crypticName(const QString& niceName) { - QString ret (niceName); +const TQString FinanceQuoteProcess::crypticName(const TQString& niceName) { + TQString ret (niceName); fqNameMap::iterator it; for (it = m_fqNames.begin(); it != m_fqNames.end(); ++it) { if (niceName == it.data()) { @@ -861,8 +861,8 @@ const QString FinanceQuoteProcess::crypticName(const QString& niceName) { return (ret); } -const QString FinanceQuoteProcess::niceName(const QString& crypticName) { - QString ret (m_fqNames[crypticName]); +const TQString FinanceQuoteProcess::niceName(const TQString& crypticName) { + TQString ret (m_fqNames[crypticName]); if (ret.isEmpty()) ret = crypticName; return (ret); } @@ -870,29 +870,29 @@ const QString FinanceQuoteProcess::niceName(const QString& crypticName) { // Universal date converter // -// In 'strict' mode, this is designed to be compatable with the QIF profile date +// In 'strict' mode, this is designed to be compatable with the TQIF profile date // converter. However, that converter deals with the concept of an apostrophe // format in a way I don't understand. So for the moment, they are 99% // compatable, waiting on that issue. (acejones) -QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigned _centurymidpoint) const +TQDate MyMoneyDateFormat::convertString(const TQString& _in, bool _strict, unsigned _centurymidpoint) const { // // Break date format string into component parts // - QRegExp formatrex("%([mdy]+)(\\W+)%([mdy]+)(\\W+)%([mdy]+)",false /* case sensitive */); + TQRegExp formatrex("%([mdy]+)(\\W+)%([mdy]+)(\\W+)%([mdy]+)",false /* case sensitive */); if ( formatrex.search(m_format) == -1 ) { throw new MYMONEYEXCEPTION("Invalid format string"); } - QStringList formatParts; + TQStringList formatParts; formatParts += formatrex.cap(1); formatParts += formatrex.cap(3); formatParts += formatrex.cap(5); - QStringList formatDelimiters; + TQStringList formatDelimiters; formatDelimiters += formatrex.cap(2); formatDelimiters += formatrex.cap(4); @@ -901,13 +901,13 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne // using the delimiters found in the format string // - QRegExp inputrex; + TQRegExp inputrex; inputrex.setCaseSensitive(false); // strict mode means we must enforce the delimiters as specified in the // format. non-strict allows any delimiters if ( _strict ) - inputrex.setPattern(QString("(\\w+)%1(\\w+)%2(\\w+)").arg(formatDelimiters[0],formatDelimiters[1])); + inputrex.setPattern(TQString("(\\w+)%1(\\w+)%2(\\w+)").tqarg(formatDelimiters[0],formatDelimiters[1])); else inputrex.setPattern("(\\w+)\\W+(\\w+)\\W+(\\w+)"); @@ -916,7 +916,7 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne throw new MYMONEYEXCEPTION("Invalid input string"); } - QStringList scannedParts; + TQStringList scannedParts; scannedParts += inputrex.cap(1).lower(); scannedParts += inputrex.cap(2).lower(); scannedParts += inputrex.cap(3).lower(); @@ -927,9 +927,9 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne unsigned day = 0, month = 0, year = 0; bool ok; - QRegExp digitrex("(\\d+)"); - QStringList::const_iterator it_scanned = scannedParts.begin(); - QStringList::const_iterator it_format = formatParts.begin(); + TQRegExp digitrex("(\\d+)"); + TQStringList::const_iterator it_scanned = scannedParts.begin(); + TQStringList::const_iterator it_format = formatParts.begin(); while ( it_scanned != scannedParts.end() ) { switch ( (*it_format)[0] ) @@ -940,7 +940,7 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne if ( digitrex.search(*it_scanned) != -1 ) day = digitrex.cap(1).toUInt(&ok); if ( !ok || day > 31 ) - throw new MYMONEYEXCEPTION(QString("Invalid day entry: %1").arg(*it_scanned)); + throw new MYMONEYEXCEPTION(TQString("Invalid day entry: %1").tqarg(*it_scanned)); break; case 'm': month = (*it_scanned).toUInt(&ok); @@ -958,18 +958,18 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne } if ( month < 1 || month > 12 ) - throw new MYMONEYEXCEPTION(QString("Invalid month entry: %1").arg(*it_scanned)); + throw new MYMONEYEXCEPTION(TQString("Invalid month entry: %1").tqarg(*it_scanned)); break; case 'y': if ( _strict && (*it_scanned).length() != (*it_format).length()) - throw new MYMONEYEXCEPTION(QString("Length of year (%1) does not match expected length (%2).") - .arg(*it_scanned,*it_format)); + throw new MYMONEYEXCEPTION(TQString("Length of year (%1) does not match expected length (%2).") + .tqarg(*it_scanned,*it_format)); year = (*it_scanned).toUInt(&ok); if (!ok) - throw new MYMONEYEXCEPTION(QString("Invalid year entry: %1").arg(*it_scanned)); + throw new MYMONEYEXCEPTION(TQString("Invalid year entry: %1").tqarg(*it_scanned)); // // 2-digit year case @@ -988,7 +988,7 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne } if ( year < 1900 ) - throw new MYMONEYEXCEPTION(QString("Invalid year (%1)").arg(year)); + throw new MYMONEYEXCEPTION(TQString("Invalid year (%1)").tqarg(year)); break; default: @@ -999,9 +999,9 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne ++it_format; } - QDate result(year,month,day); + TQDate result(year,month,day); if ( ! result.isValid() ) - throw new MYMONEYEXCEPTION(QString("Invalid date (yr%1 mo%2 dy%3)").arg(year).arg(month).arg(day)); + throw new MYMONEYEXCEPTION(TQString("Invalid date (yr%1 mo%2 dy%3)").tqarg(year).tqarg(month).tqarg(day)); return result; } @@ -1010,35 +1010,35 @@ QDate MyMoneyDateFormat::convertString(const QString& _in, bool _strict, unsigne // Unit test helpers // -convertertest::QuoteReceiver::QuoteReceiver(WebPriceQuote* q, QObject* parent, const char *name) : - QObject(parent,name) +convertertest::QuoteReceiver::QuoteReceiver(WebPriceQuote* q, TQObject* tqparent, const char *name) : + TQObject(tqparent,name) { - connect(q,SIGNAL(quote(const QString&,const QDate&, const double&)), - this,SLOT(slotGetQuote(const QString&,const QDate&, const double&))); - connect(q,SIGNAL(status(const QString&)), - this,SLOT(slotStatus(const QString&))); - connect(q,SIGNAL(error(const QString&)), - this,SLOT(slotError(const QString&))); + connect(q,TQT_SIGNAL(quote(const TQString&,const TQDate&, const double&)), + this,TQT_SLOT(slotGetQuote(const TQString&,const TQDate&, const double&))); + connect(q,TQT_SIGNAL(status(const TQString&)), + this,TQT_SLOT(slottqStatus(const TQString&))); + connect(q,TQT_SIGNAL(error(const TQString&)), + this,TQT_SLOT(slotError(const TQString&))); } convertertest::QuoteReceiver::~QuoteReceiver() { } -void convertertest::QuoteReceiver::slotGetQuote(const QString&,const QDate& d, const double& m) +void convertertest::QuoteReceiver::slotGetQuote(const TQString&,const TQDate& d, const double& m) { // kdDebug(2) << "test::QuoteReceiver::slotGetQuote( , " << d << " , " << m.toString() << " )" << endl; m_price = MyMoneyMoney(m); m_date = d; } -void convertertest::QuoteReceiver::slotStatus(const QString& msg) +void convertertest::QuoteReceiver::slottqStatus(const TQString& msg) { -// kdDebug(2) << "test::QuoteReceiver::slotStatus( " << msg << " )" << endl; +// kdDebug(2) << "test::QuoteReceiver::slottqStatus( " << msg << " )" << endl; m_statuses += msg; } -void convertertest::QuoteReceiver::slotError(const QString& msg) +void convertertest::QuoteReceiver::slotError(const TQString& msg) { // kdDebug(2) << "test::QuoteReceiver::slotError( " << msg << " )" << endl; diff --git a/kmymoney2/converter/webpricequote.h b/kmymoney2/converter/webpricequote.h index e25dfb8..ba8146b 100644 --- a/kmymoney2/converter/webpricequote.h +++ b/kmymoney2/converter/webpricequote.h @@ -15,16 +15,16 @@ * * ***************************************************************************/ -#ifndef WEBPRICEQUOTE_H -#define WEBPRICEQUOTE_H +#ifndef WEBPRICETQUOTE_H +#define WEBPRICETQUOTE_H // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -48,20 +48,21 @@ of a local script being used to fetch the quote. class WebPriceQuoteProcess: public KProcess { Q_OBJECT + TQ_OBJECT public: WebPriceQuoteProcess(void); - void setSymbol(const QString& _symbol) { m_symbol = _symbol; m_string.truncate(0); } + void setSymbol(const TQString& _symbol) { m_symbol = _symbol; m_string.truncate(0); } public slots: void slotReceivedDataFromFilter(KProcess*, char*, int); void slotProcessExited(KProcess*); signals: - void processExited(const QString&); + void processExited(const TQString&); private: - QString m_symbol; - QString m_string; + TQString m_symbol; + TQString m_string; }; /** @@ -75,13 +76,14 @@ by the Finance::Quote package, and more user-friendly names. class FinanceQuoteProcess: public KProcess { Q_OBJECT + TQ_OBJECT public: FinanceQuoteProcess(void); - void launch (const QString& scriptPath); + void launch (const TQString& scriptPath); bool isFinished() { return(m_isDone);}; - QStringList getSourceList(); - const QString crypticName(const QString& niceName); - const QString niceName(const QString& crypticName); + TQStringList getSourceList(); + const TQString crypticName(const TQString& niceName); + const TQString niceName(const TQString& crypticName); public slots: void slotReceivedDataFromFilter(KProcess*, char*, int); @@ -89,8 +91,8 @@ class FinanceQuoteProcess: public KProcess private: bool m_isDone; - QString m_string; - typedef QMap fqNameMap; + TQString m_string; + typedef TQMap fqNameMap; fqNameMap m_fqNames; }; @@ -103,20 +105,20 @@ class FinanceQuoteProcess: public KProcess struct WebPriceQuoteSource { WebPriceQuoteSource() {} - WebPriceQuoteSource(const QString& name); - WebPriceQuoteSource(const QString& name, const QString& url, const QString& sym, const QString& price, const QString& date, const QString& dateformat); + WebPriceQuoteSource(const TQString& name); + WebPriceQuoteSource(const TQString& name, const TQString& url, const TQString& sym, const TQString& price, const TQString& date, const TQString& dateformat); ~WebPriceQuoteSource() {} void write(void) const; - void rename(const QString& name); + void rename(const TQString& name); void remove(void) const; - QString m_name; - QString m_url; - QString m_sym; - QString m_price; - QString m_date; - QString m_dateformat; + TQString m_name; + TQString m_url; + TQString m_sym; + TQString m_price; + TQString m_date; + TQString m_dateformat; bool m_skipStripping; }; @@ -125,11 +127,12 @@ Retrieves a price quote from a web-based quote source @author Ace Jones */ -class WebPriceQuote: public QObject +class WebPriceQuote: public TQObject { Q_OBJECT + TQ_OBJECT public: - WebPriceQuote( QObject* = 0, const char* = 0 ); + WebPriceQuote( TQObject* = 0, const char* = 0 ); ~WebPriceQuote(); typedef enum _quoteSystemE { @@ -146,78 +149,78 @@ public: * @param _id an arbitrary identifier, which will be emitted in the quote * signal when a price is sent back. * @param _source the source of the quote (must be a valid value returned - * by quoteSources(). Send QString() to use the default + * by quoteSources(). Send TQString() to use the default * source. * @return bool Whether the quote fetch process was launched successfully */ - bool launch(const QString& _symbol, const QString& _id, const QString& _source=QString()); + bool launch(const TQString& _symbol, const TQString& _id, const TQString& _source=TQString()); /** * This returns a list of the names of the quote sources * currently defined. * * @param _system whether to return Native or Finance::Quote source list - * @return QStringList of quote source names + * @return TQStringList of quote source names */ - static QStringList quoteSources(const _quoteSystemE _system=Native); + static TQStringList quoteSources(const _quoteSystemE _system=Native); signals: - void quote(const QString&, const QString&, const QDate&, const double&); - void failed(const QString&, const QString&); - void status(const QString&); - void error(const QString&); + void quote(const TQString&, const TQString&, const TQDate&, const double&); + void failed(const TQString&, const TQString&); + void status(const TQString&); + void error(const TQString&); protected slots: - void slotParseQuote(const QString&); + void slotParseQuote(const TQString&); protected: - static QMap defaultQuoteSources(void); + static TQMap defaultQuoteSources(void); private: - bool download(const KURL& u, QString & target, QWidget* window); - void removeTempFile(const QString& tmpFile); + bool download(const KURL& u, TQString & target, TQWidget* window); + void removeTempFile(const TQString& tmpFile); private slots: void slotResult( KIO::Job * job ); private: - bool launchNative(const QString& _symbol, const QString& _id, const QString& _source=QString()); - bool launchFinanceQuote(const QString& _symbol, const QString& _id, const QString& _source=QString()); + bool launchNative(const TQString& _symbol, const TQString& _id, const TQString& _source=TQString()); + bool launchFinanceQuote(const TQString& _symbol, const TQString& _id, const TQString& _source=TQString()); void enter_loop(void); - static QStringList quoteSourcesNative(); - static QStringList quoteSourcesFinanceQuote(); + static TQStringList quoteSourcesNative(); + static TQStringList quoteSourcesFinanceQuote(); WebPriceQuoteProcess m_filter; - QString m_symbol; - QString m_id; - QDate m_date; + TQString m_symbol; + TQString m_id; + TQDate m_date; double m_price; WebPriceQuoteSource m_source; - static QString m_financeQuoteScriptPath; - static QStringList m_financeQuoteSources; + static TQString m_financeQuoteScriptPath; + static TQStringList m_financeQuoteSources; /** * Whether the download succeeded or not. Taken from KIO::NetAccess */ bool bJobOK; - static QString* lastErrorMsg; + static TQString* lastErrorMsg; static int lastErrorCode; - QString m_tmpFile; + TQString m_tmpFile; }; class MyMoneyDateFormat { public: - MyMoneyDateFormat(const QString& _format): m_format(_format) {} - QString convertDate(const QDate& _in) const; - QDate convertString(const QString& _in, bool _strict=true, unsigned _centurymidpoint = QDate::currentDate().year() ) const; - const QString& format(void) const { return m_format; } + MyMoneyDateFormat(const TQString& _format): m_format(_format) {} + TQString convertDate(const TQDate& _in) const; + TQDate convertString(const TQString& _in, bool _strict=true, unsigned _centurymidpoint = TQDate::tqcurrentDate().year() ) const; + const TQString& format(void) const { return m_format; } private: - QString m_format; + TQString m_format; }; namespace convertertest { @@ -227,26 +230,27 @@ Simple class to handle signals/slots for unit tests @author Ace Jones */ -class QuoteReceiver : public QObject +class QuoteReceiver : public TQObject { Q_OBJECT + TQ_OBJECT public: - QuoteReceiver(WebPriceQuote* q, QObject *parent = 0, const char *name = 0); + QuoteReceiver(WebPriceQuote* q, TQObject *tqparent = 0, const char *name = 0); ~QuoteReceiver(); public slots: - void slotGetQuote(const QString&,const QDate&, const double&); - void slotStatus(const QString&); - void slotError(const QString&); + void slotGetQuote(const TQString&,const TQDate&, const double&); + void slottqStatus(const TQString&); + void slotError(const TQString&); public: - QStringList m_statuses; - QStringList m_errors; + TQStringList m_statuses; + TQStringList m_errors; MyMoneyMoney m_price; - QDate m_date; + TQDate m_date; }; } // end namespace convertertest -#endif // WEBPRICEQUOTE_H +#endif // WEBPRICETQUOTE_H // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/dialogs/investactivities.cpp b/kmymoney2/dialogs/investactivities.cpp index d929c38..be0f6d1 100644 --- a/kmymoney2/dialogs/investactivities.cpp +++ b/kmymoney2/dialogs/investactivities.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -39,12 +39,12 @@ using namespace Invest; using namespace KMyMoneyRegister; -bool Activity::isComplete(QString& reason) const +bool Activity::isComplete(TQString& reason) const { bool rc = false; KMyMoneySecurity* security = dynamic_cast(haveWidget("security")); if(!security->currentText().isEmpty()) { - rc = security->selector()->contains(security->currentText()); + rc = security->selector()->tqcontains(security->currentText()); } return rc; } @@ -58,12 +58,12 @@ bool Activity::haveAssetAccount(void) const rc = !cat->currentText().isEmpty(); if(rc && !cat->currentText().isEmpty()) { - rc = cat->selector()->contains(cat->currentText()); + rc = cat->selector()->tqcontains(cat->currentText()); } return rc; } -bool Activity::haveCategoryAndAmount(const QString& category, const QString& amount, bool optional) const +bool Activity::haveCategoryAndAmount(const TQString& category, const TQString& amount, bool optional) const { KMyMoneyCategory* cat = dynamic_cast(haveWidget(category)); @@ -72,7 +72,7 @@ bool Activity::haveCategoryAndAmount(const QString& category, const QString& amo rc = !cat->currentText().isEmpty(); if(rc && !cat->currentText().isEmpty()) { - rc = cat->selector()->contains(cat->currentText()) || cat->isSplitTransaction(); + rc = cat->selector()->tqcontains(cat->currentText()) || cat->isSplitTransaction(); if(rc && !amount.isEmpty()) { MyMoneyMoney value = dynamic_cast(haveWidget(amount))->value(); if(!isMultiSelection()) @@ -100,14 +100,14 @@ bool Activity::havePrice(void) const return !amount->value().isZero(); } -bool Activity::createCategorySplits(const MyMoneyTransaction& t, KMyMoneyCategory* cat, kMyMoneyEdit* amount, MyMoneyMoney factor, QValueList&splits, const QValueList& osplits ) const +bool Activity::createCategorySplits(const MyMoneyTransaction& t, KMyMoneyCategory* cat, kMyMoneyEdit* amount, MyMoneyMoney factor, TQValueList&splits, const TQValueList& osplits ) const { bool rc = true; if(!isMultiSelection() || (isMultiSelection() && !cat->currentText().isEmpty())) { if(!cat->isSplitTransaction()) { splits.clear(); MyMoneySplit s1; - QString categoryId; + TQString categoryId; categoryId = cat->selectedItem(); if(!categoryId.isEmpty()) { s1.setAccountId(categoryId); @@ -128,18 +128,18 @@ void Activity::createAssetAccountSplit(MyMoneySplit& split, const MyMoneySplit& { KMyMoneyCategory* cat = dynamic_cast(haveWidget("asset-account")); if(!isMultiSelection() || (isMultiSelection() && !cat->currentText().isEmpty())) { - QString categoryId; + TQString categoryId; categoryId = cat->selectedItem(); split.setAccountId(categoryId); } split.setMemo(stockSplit.memo()); } -MyMoneyMoney Activity::sumSplits(const MyMoneySplit& s0, const QValueList& feeSplits, const QValueList& interestSplits) const +MyMoneyMoney Activity::sumSplits(const MyMoneySplit& s0, const TQValueList& feeSplits, const TQValueList& interestSplits) const { MyMoneyMoney total; total = s0.value(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = feeSplits.begin(); it_s != feeSplits.end(); ++it_s) { total += (*it_s).value(); } @@ -149,13 +149,13 @@ MyMoneyMoney Activity::sumSplits(const MyMoneySplit& s0, const QValueList(haveWidget(idx)); + TQLabel* w = dynamic_cast(haveWidget(idx)); if(w) { w->setText(txt); } else { - qDebug("Unknown QLabel named '%s'", idx.data()); + qDebug("Unknown TQLabel named '%s'", idx.data()); } } @@ -165,7 +165,7 @@ void Activity::preloadAssetAccount(void) cat = dynamic_cast(haveWidget("asset-account")); if(cat->isVisible()) { if(cat->currentText().isEmpty()) { - MyMoneyAccount acc = MyMoneyFile::instance()->accountByName(i18n("%1 (Brokerage)").arg(m_parent->account().name())); + MyMoneyAccount acc = MyMoneyFile::instance()->accountByName(i18n("%1 (Brokerage)").tqarg(m_parent->account().name())); if(!acc.id().isEmpty()) { bool blocked = cat->signalsBlocked(); // block signals, so that the focus does not go crazy @@ -182,13 +182,13 @@ void Buy::showWidgets(void) const { KMyMoneyCategory* cat; cat = dynamic_cast(haveWidget("fee-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); cat = dynamic_cast(haveWidget("interest-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); kMyMoneyEdit* shareEdit = dynamic_cast(haveWidget("shares")); shareEdit->show(); shareEdit->setPrecision(MyMoneyMoney::denomToPrec(m_parent->security().smallestAccountFraction())); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); haveWidget("asset-account")->show(); haveWidget("price")->show(); haveWidget("total")->show(); @@ -201,7 +201,7 @@ void Buy::showWidgets(void) const setLabelText("total-label", i18n("Total")); } -bool Buy::isComplete(QString& reason) const +bool Buy::isComplete(TQString& reason) const { bool rc = Activity::isComplete(reason); rc &= haveAssetAccount(); @@ -213,13 +213,13 @@ bool Buy::isComplete(QString& reason) const return rc; } -bool Buy::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Buy::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(m_interestSplits); Q_UNUSED(security); Q_UNUSED(currency); - QString reason; + TQString reason; if(!isComplete(reason)) return false; @@ -271,9 +271,9 @@ void Sell::showWidgets(void) const { KMyMoneyCategory* cat; cat = dynamic_cast(haveWidget("interest-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); cat = dynamic_cast(haveWidget("fee-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); kMyMoneyEdit* shareEdit = dynamic_cast(haveWidget("shares")); shareEdit->show(); shareEdit->setPrecision(MyMoneyMoney::denomToPrec(m_parent->security().smallestAccountFraction())); @@ -290,7 +290,7 @@ void Sell::showWidgets(void) const setLabelText("total-label", i18n("Total")); } -bool Sell::isComplete(QString& reason) const +bool Sell::isComplete(TQString& reason) const { bool rc = Activity::isComplete(reason); rc &= haveAssetAccount(); @@ -301,12 +301,12 @@ bool Sell::isComplete(QString& reason) const return rc; } -bool Sell::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Sell::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(security); Q_UNUSED(currency); - QString reason; + TQString reason; if(!isComplete(reason)) return false; @@ -360,7 +360,7 @@ void Div::showWidgets(void) const { KMyMoneyCategory* cat; cat = dynamic_cast(haveWidget("interest-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); haveWidget("asset-account")->show(); haveWidget("total")->show(); @@ -370,20 +370,20 @@ void Div::showWidgets(void) const setLabelText("total-label", i18n("Total")); } -bool Div::isComplete(QString& reason) const +bool Div::isComplete(TQString& reason) const { bool rc = haveAssetAccount(); rc &= haveInterest(false); return rc; } -bool Div::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Div::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(m_feeSplits); Q_UNUSED(security); Q_UNUSED(currency); - QString reason; + TQString reason; if(!isComplete(reason)) return false; @@ -413,9 +413,9 @@ void Reinvest::showWidgets(void) const { KMyMoneyCategory* cat; cat = dynamic_cast(haveWidget("interest-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); cat = dynamic_cast(haveWidget("fee-account")); - cat->parentWidget()->show(); + cat->tqparentWidget()->show(); kMyMoneyEdit* shareEdit = dynamic_cast(haveWidget("shares")); shareEdit->show(); shareEdit->setPrecision(MyMoneyMoney::denomToPrec(m_parent->security().smallestAccountFraction())); @@ -429,23 +429,23 @@ void Reinvest::showWidgets(void) const setLabelText("total-label", i18n("Total")); } -bool Reinvest::isComplete(QString& reason) const +bool Reinvest::isComplete(TQString& reason) const { bool rc = Activity::isComplete(reason); - rc &= haveCategoryAndAmount("interest-account", QString(), false); + rc &= haveCategoryAndAmount("interest-account", TQString(), false); rc &= haveFees(true); rc &= haveShares(); rc &= havePrice(); return rc; } -bool Reinvest::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Reinvest::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(assetAccountSplit); Q_UNUSED(security); Q_UNUSED(currency); - QString reason; + TQString reason; if(!isComplete(reason)) return false; @@ -490,7 +490,7 @@ bool Reinvest::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMone MyMoneySplit& s1 = interestSplits[0]; - MyMoneyMoney total = sumSplits(s0, feeSplits, QValueList()); + MyMoneyMoney total = sumSplits(s0, feeSplits, TQValueList()); s1.setValue(-total); if(!m_parent->setupPrice(t, s1)) @@ -508,14 +508,14 @@ void Add::showWidgets(void) const setLabelText("shares-label", i18n("Shares")); } -bool Add::isComplete(QString& reason) const +bool Add::isComplete(TQString& reason) const { bool rc = Activity::isComplete(reason); rc &= haveShares(); return rc; } -bool Add::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Add::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(t); Q_UNUSED(assetAccountSplit); @@ -524,7 +524,7 @@ bool Add::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySpli Q_UNUSED(security); Q_UNUSED(currency); - QString reason; + TQString reason; if(!isComplete(reason)) return false; @@ -549,14 +549,14 @@ void Remove::showWidgets(void) const setLabelText("shares-label", i18n("Shares")); } -bool Remove::isComplete(QString& reason) const +bool Remove::isComplete(TQString& reason) const { bool rc = Activity::isComplete(reason); rc &= haveShares(); return rc; } -bool Remove::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Remove::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(t); Q_UNUSED(assetAccountSplit); @@ -565,7 +565,7 @@ bool Remove::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneyS Q_UNUSED(security); Q_UNUSED(currency); - QString reason; + TQString reason; if(!isComplete(reason)) return false; @@ -592,14 +592,14 @@ void Split::showWidgets(void) const setLabelText("shares-label", i18n("Ratio 1/")); } -bool Split::isComplete(QString& reason) const +bool Split::isComplete(TQString& reason) const { bool rc = Activity::isComplete(reason); rc &= haveShares(); return rc; } -bool Split::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) +bool Split::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) { Q_UNUSED(t); Q_UNUSED(assetAccountSplit); diff --git a/kmymoney2/dialogs/investactivities.h b/kmymoney2/dialogs/investactivities.h index 91b474d..49a33e3 100644 --- a/kmymoney2/dialogs/investactivities.h +++ b/kmymoney2/dialogs/investactivities.h @@ -37,7 +37,7 @@ class Activity public: virtual MyMoneySplit::investTransactionTypeE type(void) const = 0; virtual void showWidgets(void) const = 0; - virtual bool isComplete(QString& reason) const = 0; + virtual bool isComplete(TQString& reason) const = 0; /** * Create a transaction @p t based on the split @p s0 and the data contained @@ -47,30 +47,30 @@ public: * * @return @p true if creation was successful, @p false otherwise */ - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) = 0; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency) = 0; virtual void preloadAssetAccount(void); virtual ~Activity() {} protected: Activity(InvestTransactionEditor* editor) { m_parent = editor; } - QWidget* haveWidget(const QString& name) const { return m_parent->haveWidget(name); } + TQWidget* haveWidget(const TQString& name) const { return m_parent->haveWidget(name); } bool haveAssetAccount(void) const; bool haveFees(bool optional = false) const { return haveCategoryAndAmount("fee-account", "fee-amount", optional); } bool haveInterest(bool optional = false) const { return haveCategoryAndAmount("interest-account", "interest-amount", optional); } bool haveShares(void) const; bool havePrice(void) const; bool isMultiSelection(void) const { return m_parent->isMultiSelection(); } - bool createCategorySplits(const MyMoneyTransaction& t, KMyMoneyCategory* cat, kMyMoneyEdit* amount, MyMoneyMoney factor, QValueList&splits, const QValueList& osplits ) const; + bool createCategorySplits(const MyMoneyTransaction& t, KMyMoneyCategory* cat, kMyMoneyEdit* amount, MyMoneyMoney factor, TQValueList&splits, const TQValueList& osplits ) const; void createAssetAccountSplit(MyMoneySplit& split, const MyMoneySplit& stockSplit) const; - MyMoneyMoney sumSplits(const MyMoneySplit& s0, const QValueList& feeSplits, const QValueList& interestSplits) const; - bool haveCategoryAndAmount(const QString& category, const QString& amount, bool optional) const; - void setLabelText(const QString& idx, const QString& txt) const; + MyMoneyMoney sumSplits(const MyMoneySplit& s0, const TQValueList& feeSplits, const TQValueList& interestSplits) const; + bool haveCategoryAndAmount(const TQString& category, const TQString& amount, bool optional) const; + void setLabelText(const TQString& idx, const TQString& txt) const; InvestTransactionEditor::priceModeE priceMode(void) const { return m_parent->priceMode(); } protected: InvestTransactionEditor* m_parent; - QMap m_priceInfo; + TQMap m_priceInfo; }; class Buy : public Activity @@ -80,8 +80,8 @@ public: virtual ~Buy() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::BuyShares; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; class Sell : public Activity @@ -91,8 +91,8 @@ public: virtual ~Sell() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::SellShares; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; class Div : public Activity @@ -102,8 +102,8 @@ public: virtual ~Div() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::Dividend; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; class Reinvest : public Activity @@ -113,8 +113,8 @@ public: virtual ~Reinvest() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::ReinvestDividend; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; class Add : public Activity @@ -124,8 +124,8 @@ public: virtual ~Add() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::AddShares; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; class Remove : public Activity @@ -135,8 +135,8 @@ public: virtual ~Remove() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::RemoveShares; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; class Split : public Activity @@ -146,8 +146,8 @@ public: virtual ~Split() {} virtual MyMoneySplit::investTransactionTypeE type(void) const { return MyMoneySplit::SplitShares; } virtual void showWidgets(void) const; - virtual bool isComplete(QString& reason) const; - virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& m_feeSplits, QValueList& interestSplits, QValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); + virtual bool isComplete(TQString& reason) const; + virtual bool createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& m_feeSplits, TQValueList& interestSplits, TQValueList& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency); }; } // namespace Invest diff --git a/kmymoney2/dialogs/investtransactioneditor.cpp b/kmymoney2/dialogs/investtransactioneditor.cpp index 5a62436..d235ae5 100644 --- a/kmymoney2/dialogs/investtransactioneditor.cpp +++ b/kmymoney2/dialogs/investtransactioneditor.cpp @@ -20,11 +20,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -64,8 +64,8 @@ class InvestTransactionEditor::Private { friend class Invest::Activity; public: - Private(InvestTransactionEditor* parent) : - m_parent(parent), + Private(InvestTransactionEditor* tqparent) : + m_parent(tqparent), m_activity(0) { m_phonyAccount = MyMoneyAccount("Phony-ID", MyMoneyAccount()); @@ -75,7 +75,7 @@ public: delete m_activity; } - QWidget* haveWidget(const QString& name) { return m_parent->haveWidget(name); } + TQWidget* haveWidget(const TQString& name) { return m_parent->haveWidget(name); } InvestTransactionEditor* m_parent; Activity* m_activity; @@ -94,7 +94,7 @@ InvestTransactionEditor::~InvestTransactionEditor() delete d; } -InvestTransactionEditor::InvestTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::InvestTransaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate) : +InvestTransactionEditor::InvestTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::InvestTransaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate) : TransactionEditor(regForm, item, list, lastPostDate), d(new Private(this)) { @@ -143,14 +143,14 @@ void InvestTransactionEditor::activityFactory(MyMoneySplit::investTransactionTyp } } -void InvestTransactionEditor::dissectTransaction(const MyMoneyTransaction& transaction, const MyMoneySplit& split, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency, MyMoneySplit::investTransactionTypeE& transactionType) +void InvestTransactionEditor::dissectTransaction(const MyMoneyTransaction& transaction, const MyMoneySplit& split, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency, MyMoneySplit::investTransactionTypeE& transactionType) { // collect the splits. split references the stock account and should already // be set up. assetAccountSplit references the corresponding asset account (maybe // empty), feeSplits is the list of all expenses and interestSplits // the list of all incomes MyMoneyFile* file = MyMoneyFile::instance(); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { MyMoneyAccount acc = file->account((*it_s).accountId()); if((*it_s).id() == split.id()) { @@ -194,45 +194,45 @@ void InvestTransactionEditor::createEditWidgets(void) { KMyMoneyActivityCombo* activity = new KMyMoneyActivityCombo(); m_editWidgets["activity"] = activity; - connect(activity, SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, SLOT(slotUpdateActivity(MyMoneySplit::investTransactionTypeE))); - connect(activity, SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, SLOT(slotUpdateButtonState())); + connect(activity, TQT_SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, TQT_SLOT(slotUpdateActivity(MyMoneySplit::investTransactionTypeE))); + connect(activity, TQT_SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, TQT_SLOT(slotUpdateButtonState())); m_editWidgets["postdate"] = new kMyMoneyDateInput; - connect(m_editWidgets["postdate"], SIGNAL(dateChanged(const QDate&)), this, SLOT(slotUpdateButtonState())); + connect(m_editWidgets["postdate"], TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotUpdateButtonState())); KMyMoneySecurity* security = new KMyMoneySecurity; security->setHint(i18n("Security")); m_editWidgets["security"] = security; - connect(security, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateSecurity(const QString&))); - connect(security, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(security, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateSecurity(const QString&, QString&))); - connect(security, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); + connect(security, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateSecurity(const TQString&))); + connect(security, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(security, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateSecurity(const TQString&, TQString&))); + connect(security, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); KMyMoneyCategory* asset = new KMyMoneyCategory(0, 0, false); asset->setHint(i18n("Asset account")); m_editWidgets["asset-account"] = asset; - connect(asset, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(asset, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); + connect(asset, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(asset, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); KMyMoneyCategory* fees = new KMyMoneyCategory(0, 0, true); fees->setHint(i18n("Fees")); m_editWidgets["fee-account"] = fees; - connect(fees, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateFeeCategory(const QString&))); - connect(fees, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(fees, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateFeeVisibility(const QString&))); - connect(fees, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateFeeCategory(const QString&, QString&))); - connect(fees, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(fees->splitButton(), SIGNAL(clicked()), this, SLOT(slotEditFeeSplits())); + connect(fees, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateFeeCategory(const TQString&))); + connect(fees, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(fees, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateFeeVisibility(const TQString&))); + connect(fees, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateFeeCategory(const TQString&, TQString&))); + connect(fees, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(fees->splitButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditFeeSplits())); KMyMoneyCategory* interest = new KMyMoneyCategory(0, 0, true); interest->setHint(i18n("Interest")); m_editWidgets["interest-account"] = interest; - connect(interest, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateInterestCategory(const QString&))); - connect(interest, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(interest, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateInterestVisibility(const QString&))); - connect(interest, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateInterestCategory(const QString&, QString&))); - connect(interest, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(interest->splitButton(), SIGNAL(clicked()), this, SLOT(slotEditInterestSplits())); + connect(interest, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateInterestCategory(const TQString&))); + connect(interest, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(interest, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateInterestVisibility(const TQString&))); + connect(interest, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateInterestCategory(const TQString&, TQString&))); + connect(interest, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(interest->splitButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditInterestSplits())); KTextEdit* memo = new KTextEdit; memo->setTabChangesFocus(true); @@ -242,76 +242,76 @@ void InvestTransactionEditor::createEditWidgets(void) value->setHint(i18n("Shares")); value->setResetButtonVisible(false); m_editWidgets["shares"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); value = new kMyMoneyEdit; value->setHint(i18n("Price")); value->setResetButtonVisible(false); value->setPrecision(KMyMoneyGlobalSettings::pricePrecision()); m_editWidgets["price"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); value = new kMyMoneyEdit; // TODO once we have the selected transactions as array of Transaction // we can allow multiple splits for fee and interest value->setResetButtonVisible(false); m_editWidgets["fee-amount"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); value = new kMyMoneyEdit; // TODO once we have the selected transactions as array of Transaction // we can allow multiple splits for fee and interest value->setResetButtonVisible(false); m_editWidgets["interest-amount"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); KMyMoneyReconcileCombo* reconcile = new KMyMoneyReconcileCombo; m_editWidgets["status"] = reconcile; - connect(reconcile, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateButtonState())); + connect(reconcile, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); - KMyMoneyRegister::QWidgetContainer::iterator it_w; + KMyMoneyRegister::TQWidgetContainer::iterator it_w; for(it_w = m_editWidgets.begin(); it_w != m_editWidgets.end(); ++it_w) { (*it_w)->installEventFilter(this); } - QLabel* label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::AlignRight | Qt::DontClip); + TQLabel* label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::AlignRight | TQt::DontClip); m_editWidgets["total"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["total-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["asset-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["fee-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["fee-amount-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["interest-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["interest-amount-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["price-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["shares-label"] = label; // if we don't have more than 1 selected transaction, we don't need @@ -323,17 +323,17 @@ void InvestTransactionEditor::createEditWidgets(void) int InvestTransactionEditor::slotEditFeeSplits(void) { - return editSplits("fee-account", "fee-amount", m_feeSplits, false, SLOT(slotEditFeeSplits())); + return editSplits("fee-account", "fee-amount", m_feeSplits, false, TQT_SLOT(slotEditFeeSplits())); } int InvestTransactionEditor::slotEditInterestSplits(void) { - return editSplits("interest-account", "interest-amount", m_interestSplits, true, SLOT(slotEditInterestSplits())); + return editSplits("interest-account", "interest-amount", m_interestSplits, true, TQT_SLOT(slotEditInterestSplits())); } -int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const QString& amountWidgetName, QValueList& splits, bool isIncome, const char* slotEditSplits) +int InvestTransactionEditor::editSplits(const TQString& categoryWidgetName, const TQString& amountWidgetName, TQValueList& splits, bool isIncome, const char* slotEditSplits) { - int rc = QDialog::Rejected; + int rc = TQDialog::Rejected; if(!m_openEditSplits) { // only get in here in a single instance @@ -341,7 +341,7 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const // force focus change to update all data KMyMoneyCategory* category = dynamic_cast(m_editWidgets[categoryWidgetName]); - QWidget* w = category->splitButton(); + TQWidget* w = category->splitButton(); if(w) w->setFocus(); @@ -377,13 +377,13 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const 0, m_priceInfo, m_regForm); - // connect(dlg, SIGNAL(newCategory(MyMoneyAccount&)), this, SIGNAL(newCategory(MyMoneyAccount&))); + // connect(dlg, TQT_SIGNAL(newCategory(MyMoneyAccount&)), this, TQT_SIGNAL(newCategory(MyMoneyAccount&))); - if((rc = dlg->exec()) == QDialog::Accepted) { + if((rc = dlg->exec()) == TQDialog::Accepted) { transaction = dlg->transaction(); // collect splits out of the transaction splits.clear(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; MyMoneyMoney fees; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { if((*it_s).accountId() == d->m_phonyAccount.id()) @@ -394,7 +394,7 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const if(isIncome) fees = -fees; - QString categoryId; + TQString categoryId; setupCategoryWidget(category, splits, categoryId, slotEditSplits); amount->setValue(fees); slotUpdateTotalAmount(); @@ -413,7 +413,7 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const return rc; } -bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, const QValueList& splits) +bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, const TQValueList& splits) { t.removeSplits(); @@ -424,7 +424,7 @@ bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, con t.addSplit(split); d->m_phonySplit = split; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { split = *it_s; split.clearId(); @@ -433,10 +433,10 @@ bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, con return true; } -void InvestTransactionEditor::slotCreateSecurity(const QString& name, QString& id) +void InvestTransactionEditor::slotCreateSecurity(const TQString& name, TQString& id) { MyMoneyAccount acc; - QRegExp exp("([^:]+)"); + TQRegExp exp("([^:]+)"); if(exp.search(name) != -1) { acc.setName(exp.cap(1)); @@ -451,7 +451,7 @@ void InvestTransactionEditor::slotCreateSecurity(const QString& name, QString& i } } -void InvestTransactionEditor::slotCreateFeeCategory(const QString& name, QString& id) +void InvestTransactionEditor::slotCreateFeeCategory(const TQString& name, TQString& id) { MyMoneyAccount acc; acc.setName(name); @@ -462,28 +462,28 @@ void InvestTransactionEditor::slotCreateFeeCategory(const QString& name, QString id = acc.id(); } -void InvestTransactionEditor::slotUpdateFeeCategory(const QString& id) +void InvestTransactionEditor::slotUpdateFeeCategory(const TQString& id) { haveWidget("fee-amount")->setDisabled(id.isEmpty()); } -void InvestTransactionEditor::slotUpdateFeeVisibility(const QString& txt) +void InvestTransactionEditor::slotUpdateFeeVisibility(const TQString& txt) { haveWidget("fee-amount")->setHidden(txt.isEmpty()); - QWidget* w = haveWidget("fee-amount-label"); + TQWidget* w = haveWidget("fee-amount-label"); if(w) w->setShown(haveWidget("fee-amount")->isVisible()); } -void InvestTransactionEditor::slotUpdateInterestCategory(const QString& id) +void InvestTransactionEditor::slotUpdateInterestCategory(const TQString& id) { haveWidget("interest-amount")->setDisabled(id.isEmpty()); } -void InvestTransactionEditor::slotUpdateInterestVisibility(const QString& txt) +void InvestTransactionEditor::slotUpdateInterestVisibility(const TQString& txt) { KMyMoneyCategory* interest = dynamic_cast(haveWidget("interest-account")); - QWidget* w = haveWidget("interest-amount-label"); + TQWidget* w = haveWidget("interest-amount-label"); if(dynamic_cast(d->m_activity)) { interest->splitButton()->hide(); @@ -501,7 +501,7 @@ void InvestTransactionEditor::slotUpdateInterestVisibility(const QString& txt) w->setShown(haveWidget("interest-amount")->isVisible()); } -void InvestTransactionEditor::slotCreateInterestCategory(const QString& name, QString& id) +void InvestTransactionEditor::slotCreateInterestCategory(const TQString& name, TQString& id) { MyMoneyAccount acc; acc.setName(name); @@ -519,19 +519,19 @@ void InvestTransactionEditor::slotReloadEditWidgets(void) KMyMoneySecurity* security = dynamic_cast(haveWidget("security")); AccountSet aSet; - QString id; + TQString id; // interest-account aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Income); aSet.load(interest->selector()); - setupCategoryWidget(interest, m_interestSplits, id, SLOT(slotEditInterestSplits())); + setupCategoryWidget(interest, m_interestSplits, id, TQT_SLOT(slotEditInterestSplits())); // fee-account aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Expense); aSet.load(fees->selector()); - setupCategoryWidget(fees, m_feeSplits, id, SLOT(slotEditFeeSplits())); + setupCategoryWidget(fees, m_feeSplits, id, TQT_SLOT(slotEditFeeSplits())); // security aSet.clear(); @@ -540,7 +540,7 @@ void InvestTransactionEditor::slotReloadEditWidgets(void) void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action */) { - QString id; + TQString id; kMyMoneyDateInput* postDate = dynamic_cast(haveWidget("postdate")); KMyMoneyReconcileCombo* reconcile = dynamic_cast(haveWidget("status")); @@ -554,7 +554,7 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action // check if the current transaction has a reference to an equity account bool haveEquityAccount = false; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = m_transaction.splits().begin(); !haveEquityAccount && it_s != m_transaction.splits().end(); ++it_s) { MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); if(acc.accountType() == MyMoneyAccount::Equity) @@ -586,7 +586,7 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action else if(m_lastPostDate.isValid()) postDate->setDate(m_lastPostDate); else - postDate->setDate(QDate::currentDate()); + postDate->setDate(TQDate::tqcurrentDate()); // security (but only if it's not the investment account) if(m_split.accountId() != m_account.id()) { @@ -605,14 +605,14 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Income); aSet.load(interest->selector()); - setupCategoryWidget(interest, m_interestSplits, id, SLOT(slotEditInterestSplits())); + setupCategoryWidget(interest, m_interestSplits, id, TQT_SLOT(slotEditInterestSplits())); slotUpdateInterestVisibility(interest->currentText()); // fee-account aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Expense); aSet.load(fees->selector()); - setupCategoryWidget(fees, m_feeSplits, id, SLOT(slotEditFeeSplits())); + setupCategoryWidget(fees, m_feeSplits, id, TQT_SLOT(slotEditFeeSplits())); slotUpdateFeeVisibility(fees->currentText()); // memo @@ -650,9 +650,9 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action reconcile->setState(m_split.reconcileFlag()); } else { - postDate->loadDate(QDate()); + postDate->loadDate(TQDate()); reconcile->setState(MyMoneySplit::Unknown); - memo->setText(QString()); + memo->setText(TQString()); // We don't allow to change the activity activity->setActivity(d->m_activity->type()); @@ -662,16 +662,16 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action // scan the list of selected transactions and check that they have // the same activity. KMyMoneyRegister::SelectedTransactions::iterator it_t = m_transactions.begin(); - const QString& action = m_item->split().action(); + const TQString& action = m_item->split().action(); bool isNegative = m_item->split().shares().isNegative(); bool allSameActivity = true; for(it_t = m_transactions.begin(); allSameActivity && (it_t != m_transactions.end()); ++it_t) { allSameActivity = (action == (*it_t).split().action() && (*it_t).split().shares().isNegative() == isNegative); } - QStringList fields; + TQStringList fields; fields << "shares" << "price" << "fee-amount" << "interest-amount"; - QStringList::const_iterator it_f; + TQStringList::const_iterator it_f; for(it_f = fields.begin(); it_f != fields.end(); ++it_f) { value = dynamic_cast(haveWidget((*it_f))); value->setText(""); @@ -681,7 +681,7 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action // if we have transactions with different activities, disable some more widgets if(!allSameActivity) { fields << "asset-account" << "fee-account" << "interest-account"; - QStringList::const_iterator it_f; + TQStringList::const_iterator it_f; for(it_f = fields.begin(); it_f != fields.end(); ++it_f) { haveWidget(*it_f)->setDisabled(true); } @@ -689,21 +689,21 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action } } -QWidget* InvestTransactionEditor::firstWidget(void) const +TQWidget* InvestTransactionEditor::firstWidget(void) const { return 0; // let the creator use the first widget in the tab order } -bool InvestTransactionEditor::isComplete(QString& reason) const +bool InvestTransactionEditor::isComplete(TQString& reason) const { - reason = QString(); - // reason.clear(); // for Qt4 + reason = TQString(); + // reason.clear(); // for TQt4 return d->m_activity->isComplete(reason); } -MyMoneyMoney InvestTransactionEditor::subtotal(const QValueList& splits) const +MyMoneyMoney InvestTransactionEditor::subtotal(const TQValueList& splits) const { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; MyMoneyMoney sum; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { @@ -713,7 +713,7 @@ MyMoneyMoney InvestTransactionEditor::subtotal(const QValueList& s return sum; } -void InvestTransactionEditor::slotUpdateSecurity(const QString& stockId) +void InvestTransactionEditor::slotUpdateSecurity(const TQString& stockId) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount stock = file->account(stockId); @@ -785,7 +785,7 @@ void InvestTransactionEditor::totalAmount(MyMoneyMoney& amount) const void InvestTransactionEditor::slotUpdateTotalAmount(void) { - QLabel* total = dynamic_cast(haveWidget("total")); + TQLabel* total = dynamic_cast(haveWidget("total")); if(total && total->isVisible()) { MyMoneyMoney amount; @@ -801,19 +801,19 @@ void InvestTransactionEditor::slotUpdateActivity(MyMoneySplit::investTransaction KMyMoneyCategory* cat; - // hide all dynamic widgets (make sure to use the parentWidget for the + // hide all dynamic widgets (make sure to use the tqparentWidget for the // category widgets) - haveWidget("interest-account")->parentWidget()->hide(); - haveWidget("fee-account")->parentWidget()->hide(); + haveWidget("interest-account")->tqparentWidget()->hide(); + haveWidget("fee-account")->tqparentWidget()->hide(); - QStringList dynwidgets; + TQStringList dynwidgets; dynwidgets << "total-label" << "asset-label" << "fee-label" << "fee-amount-label" << "interest-label" << "interest-amount-label" << "price-label" << "shares-label"; // hiding labels works by clearing them. hide() does not do the job - // as the underlying text in the QTable object will shine through - QStringList::const_iterator it_s; + // as the underlying text in the TQTable object will shine through + TQStringList::const_iterator it_s; for(it_s = dynwidgets.begin(); it_s != dynwidgets.end(); ++it_s) { - QLabel* w = dynamic_cast(haveWidget(*it_s)); + TQLabel* w = dynamic_cast(haveWidget(*it_s)); if(w) w->setText(" "); } @@ -823,7 +823,7 @@ void InvestTransactionEditor::slotUpdateActivity(MyMoneySplit::investTransaction dynwidgets << "asset-account" << "interest-amount" << "fee-amount" << "shares" << "price" << "total"; for(it_s = dynwidgets.begin(); it_s != dynwidgets.end(); ++it_s) { - QWidget* w = haveWidget(*it_s); + TQWidget* w = haveWidget(*it_s); if(w) w->hide(); } @@ -833,11 +833,11 @@ void InvestTransactionEditor::slotUpdateActivity(MyMoneySplit::investTransaction d->m_activity->preloadAssetAccount(); cat = dynamic_cast(haveWidget("interest-account")); - if(cat->parentWidget()->isVisible()) + if(cat->tqparentWidget()->isVisible()) slotUpdateInterestVisibility(cat->currentText()); cat = dynamic_cast(haveWidget("fee-account")); - if(cat->parentWidget()->isVisible()) + if(cat->tqparentWidget()->isVisible()) slotUpdateFeeVisibility(cat->currentText()); } @@ -845,7 +845,7 @@ InvestTransactionEditor::priceModeE InvestTransactionEditor::priceMode(void) con { priceModeE mode = static_cast(0); KMyMoneySecurity* sec = dynamic_cast(m_editWidgets["security"]); - QString accId; + TQString accId; if(!sec->currentText().isEmpty()) { accId = sec->selectedItem(); if(accId.isEmpty()) @@ -854,7 +854,7 @@ InvestTransactionEditor::priceModeE InvestTransactionEditor::priceMode(void) con while(!accId.isEmpty() && mode == 0) { MyMoneyAccount acc = MyMoneyFile::instance()->account(accId); if(acc.value("priceMode").isEmpty()) - accId = acc.parentAccountId(); + accId = acc.tqparentAccountId(); else mode = static_cast(acc.value("priceMode").toInt()); } @@ -873,9 +873,9 @@ bool InvestTransactionEditor::setupPrice(const MyMoneyTransaction& t, MyMoneySpl int fract = acc.fraction(); if(acc.currencyId() != t.commodity()) { - QMap::Iterator it_p; - QString key = t.commodity() + "-" + acc.currencyId(); - it_p = m_priceInfo.find(key); + TQMap::Iterator it_p; + TQString key = t.commodity() + "-" + acc.currencyId(); + it_p = m_priceInfo.tqfind(key); // if it's not found, then collect it from the user first MyMoneyMoney price; @@ -895,7 +895,7 @@ bool InvestTransactionEditor::setupPrice(const MyMoneyTransaction& t, MyMoneySpl fract, m_regForm, "currencyCalculator"); - if(calc.exec() == QDialog::Rejected) { + if(calc.exec() == TQDialog::Rejected) { return false; } price = calc.price(); @@ -924,11 +924,11 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM KMyMoneySecurity* sec = dynamic_cast(m_editWidgets["security"]); if(!isMultiSelection() || (isMultiSelection() && !sec->currentText().isEmpty())) { - QString securityId = sec->selectedItem(); + TQString securityId = sec->selectedItem(); if(!securityId.isEmpty()) { s0.setAccountId(securityId); MyMoneyAccount stockAccount = file->account(securityId); - QString currencyId = stockAccount.currencyId(); + TQString currencyId = stockAccount.currencyId(); MyMoneySecurity security = file->security(currencyId); t.setCommodity(security.tradingCurrency()); @@ -940,7 +940,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM // extract price info from original transaction m_priceInfo.clear(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; if(!torig.id().isEmpty()) { for(it_s = torig.splits().begin(); it_s != torig.splits().end(); ++it_s) { if((*it_s).id() != sorig.id()) { @@ -973,8 +973,8 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM } MyMoneySplit assetAccountSplit; - QValueList feeSplits; - QValueList interestSplits; + TQValueList feeSplits; + TQValueList interestSplits; MyMoneySecurity security, currency; MyMoneySplit::investTransactionTypeE transactionType; @@ -1014,7 +1014,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM s0.setReconcileFlag(status->state()); if(s0.reconcileFlag() == MyMoneySplit::Reconciled && !s0.reconcileDate().isValid()) - s0.setReconcileDate(QDate::currentDate()); + s0.setReconcileDate(TQDate::tqcurrentDate()); // call the creation logic for the current selected activity bool rc = d->m_activity->createTransaction(t, s0, assetAccountSplit, feeSplits, m_feeSplits, interestSplits, m_interestSplits, security, currency); @@ -1032,7 +1032,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM t.addSplit(s0); - QValueList::iterator it_s; + TQValueList::iterator it_s; for(it_s = feeSplits.begin(); it_s != feeSplits.end(); ++it_s) { (*it_s).clearId(); t.addSplit(*it_s); @@ -1057,7 +1057,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM void InvestTransactionEditor::updatePriceMode(const MyMoneySplit& split) { - QLabel* label = dynamic_cast(haveWidget("price-label")); + TQLabel* label = dynamic_cast(haveWidget("price-label")); if(label) { kMyMoneyEdit* sharesEdit = dynamic_cast(haveWidget("shares")); kMyMoneyEdit* priceEdit = dynamic_cast(haveWidget("price")); diff --git a/kmymoney2/dialogs/investtransactioneditor.h b/kmymoney2/dialogs/investtransactioneditor.h index 4d56697..c943dc3 100644 --- a/kmymoney2/dialogs/investtransactioneditor.h +++ b/kmymoney2/dialogs/investtransactioneditor.h @@ -35,6 +35,7 @@ class InvestTransactionEditor : public TransactionEditor friend class InvestTransactionEditorPrivate; Q_OBJECT + TQ_OBJECT public: typedef enum { PricePerShare = 1, @@ -42,7 +43,7 @@ public: } priceModeE; InvestTransactionEditor(); - InvestTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::InvestTransaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate); + InvestTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::InvestTransaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate); virtual ~InvestTransactionEditor(); /** @@ -60,15 +61,15 @@ public: * * @sa transactionDataSufficient() */ - virtual bool isComplete(QString& reason) const; + virtual bool isComplete(TQString& reason) const; - virtual QWidget* firstWidget(void) const; + virtual TQWidget* firstWidget(void) const; virtual bool fixTransactionCommodity(const MyMoneyAccount& /* account */) { return true; } void totalAmount(MyMoneyMoney& amount) const; - static void dissectTransaction(const MyMoneyTransaction& transaction, const MyMoneySplit& split, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency, MyMoneySplit::investTransactionTypeE& transactionType); + static void dissectTransaction(const MyMoneyTransaction& transaction, const MyMoneySplit& split, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency, MyMoneySplit::investTransactionTypeE& transactionType); bool setupPrice(const MyMoneyTransaction& t, MyMoneySplit& split); @@ -98,20 +99,20 @@ public: const MyMoneySecurity& security(void) const { return m_security; } protected slots: - void slotCreateSecurity(const QString& name, QString& id); - void slotCreateFeeCategory(const QString& name, QString& id); - void slotCreateInterestCategory(const QString& name, QString& id); + void slotCreateSecurity(const TQString& name, TQString& id); + void slotCreateFeeCategory(const TQString& name, TQString& id); + void slotCreateInterestCategory(const TQString& name, TQString& id); int slotEditInterestSplits(void); int slotEditFeeSplits(void); void slotReloadEditWidgets(void); void slotUpdateActivity(MyMoneySplit::investTransactionTypeE); - void slotUpdateSecurity(const QString& stockId); - void slotUpdateInterestCategory(const QString& id); - void slotUpdateInterestVisibility(const QString&); - void slotUpdateFeeCategory(const QString& id); - void slotUpdateFeeVisibility(const QString&); + void slotUpdateSecurity(const TQString& stockId); + void slotUpdateInterestCategory(const TQString& id); + void slotUpdateInterestVisibility(const TQString&); + void slotUpdateFeeCategory(const TQString& id); + void slotUpdateFeeVisibility(const TQString&); void slotUpdateTotalAmount(void); protected: @@ -132,13 +133,13 @@ protected: void activityFactory(MyMoneySplit::investTransactionTypeE type); - MyMoneyMoney subtotal(const QValueList& splits) const; + MyMoneyMoney subtotal(const TQValueList& splits) const; /** * This method creates a transaction to be used for the split fee/interest editor. * It has a reference to a phony account and the splits contained in @a splits . */ - bool createPseudoTransaction(MyMoneyTransaction& t, const QValueList& splits); + bool createPseudoTransaction(MyMoneyTransaction& t, const TQValueList& splits); /** * Convenience method used by slotEditInterestSplits() and slotEditFeeSplits(). @@ -151,7 +152,7 @@ protected: * category widget named @p categoryWidgetName in case of multiple splits * in @p splits . */ - int editSplits(const QString& categoryWidgetName, const QString& amountWidgetName, QValueList& splits, bool isIncome, const char* slotEditSplits); + int editSplits(const TQString& categoryWidgetName, const TQString& amountWidgetName, TQValueList& splits, bool isIncome, const char* slotEditSplits); void updatePriceMode(const MyMoneySplit& split = MyMoneySplit()); @@ -159,8 +160,8 @@ protected: private: MyMoneySplit m_assetAccountSplit; - QValueList m_interestSplits; - QValueList m_feeSplits; + TQValueList m_interestSplits; + TQValueList m_feeSplits; MyMoneySecurity m_security; MyMoneySecurity m_currency; MyMoneySplit::investTransactionTypeE m_transactionType; diff --git a/kmymoney2/dialogs/kaccountselectdlg.cpp b/kmymoney2/dialogs/kaccountselectdlg.cpp index 0b172f0..48cef18 100644 --- a/kmymoney2/dialogs/kaccountselectdlg.cpp +++ b/kmymoney2/dialogs/kaccountselectdlg.cpp @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -48,8 +48,8 @@ #include <../kmymoney2.h> -KAccountSelectDlg::KAccountSelectDlg(const KMyMoneyUtils::categoryTypeE accountType, const QString& purpose, QWidget *parent, const char *name ) - : KAccountSelectDlgDecl(parent, name), +KAccountSelectDlg::KAccountSelectDlg(const KMyMoneyUtils::categoryTypeE accountType, const TQString& purpose, TQWidget *tqparent, const char *name ) + : KAccountSelectDlgDecl(tqparent, name), m_purpose(purpose), m_accountType(accountType), m_aborted(false) @@ -62,31 +62,31 @@ KAccountSelectDlg::KAccountSelectDlg(const KMyMoneyUtils::categoryTypeE accountT KIconLoader* il = KGlobal::iconLoader(); KGuiItem skipButtonItem( i18n( "&Skip" ), - QIconSet(il->loadIcon("redo", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("redo", KIcon::Small, KIcon::SizeSmall)), i18n("Skip this transaction"), i18n("Use this to skip importing this transaction and proceed with the next one.")); m_qbuttonCancel->setGuiItem(skipButtonItem); KGuiItem createButtenItem( i18n( "&Create..." ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new account/category"), i18n("Use this to add a new account/category to the file")); m_createButton->setGuiItem(createButtenItem); m_qbuttonOk->setGuiItem(KStdGuiItem::ok()); KGuiItem abortButtenItem( i18n("&Abort" ), - QIconSet(il->loadIcon("stop", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("stop", KIcon::Small, KIcon::SizeSmall)), i18n("Abort the import operation and dismiss all changes"), - i18n("Use this to abort the import. Your financial data will be in the state before you started the QIF import.")); + i18n("Use this to abort the import. Your financial data will be in the state before you started the TQIF import.")); m_kButtonAbort->setGuiItem(abortButtenItem); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotReloadWidget())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadWidget())); - connect(m_createButton, SIGNAL(clicked()), this, SLOT(slotCreateAccount())); - connect(m_qbuttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(m_qbuttonCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_kButtonAbort, SIGNAL(clicked()), this, SLOT(abort())); + connect(m_createButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCreateAccount())); + connect(m_qbuttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(m_qbuttonCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_kButtonAbort, TQT_SIGNAL(clicked()), this, TQT_SLOT(abort())); } KAccountSelectDlg::~KAccountSelectDlg() @@ -110,17 +110,17 @@ void KAccountSelectDlg::slotReloadWidget(void) set.load(m_accountSelector->selector()); } -void KAccountSelectDlg::setDescription(const QString& msg) +void KAccountSelectDlg::setDescription(const TQString& msg) { m_descLabel->setText(msg); } -void KAccountSelectDlg::setHeader(const QString& msg) +void KAccountSelectDlg::setHeader(const TQString& msg) { m_headerLabel->setText(msg); } -void KAccountSelectDlg::setAccount(const MyMoneyAccount& account, const QString& id) +void KAccountSelectDlg::setAccount(const MyMoneyAccount& account, const TQString& id) { m_account = account; m_accountSelector->setSelectedItem(id); @@ -184,7 +184,7 @@ int KAccountSelectDlg::exec(void) return rc; } -const QString& KAccountSelectDlg::selectedAccount(void) const +const TQString& KAccountSelectDlg::selectedAccount(void) const { return m_accountSelector->selectedItem(); } diff --git a/kmymoney2/dialogs/kaccountselectdlg.h b/kmymoney2/dialogs/kaccountselectdlg.h index 271cd0f..180587e 100644 --- a/kmymoney2/dialogs/kaccountselectdlg.h +++ b/kmymoney2/dialogs/kaccountselectdlg.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -47,8 +47,9 @@ class KAccountSelectDlg : public KAccountSelectDlgDecl { Q_OBJECT + TQ_OBJECT public: - KAccountSelectDlg(const KMyMoneyUtils::categoryTypeE type, const QString& purpose = "General", QWidget *parent=0, const char *name=0); + KAccountSelectDlg(const KMyMoneyUtils::categoryTypeE type, const TQString& purpose = "General", TQWidget *tqparent=0, const char *name=0); ~KAccountSelectDlg(); /** @@ -56,9 +57,9 @@ public: * selection dialog box. The @p msg should contain a descriptive * text about the purpose of the dialog and it's options. * - * @param msg const reference to QString object containing the text. + * @param msg const reference to TQString object containing the text. */ - void setDescription(const QString& msg); + void setDescription(const TQString& msg); /** * This method is used to setup the buddy text of the account @@ -66,9 +67,9 @@ public: * which is placed above the selection box with the account * names. * - * @param msg const reference to QString object containing the text. + * @param msg const reference to TQString object containing the text. */ - void setHeader(const QString& msg); + void setHeader(const TQString& msg); /** * This method is used to pass information to the account selection @@ -78,14 +79,14 @@ public: * @param account MyMoneyAccount filled with the relevant and available information * @param id account id to be used. */ - void setAccount(const MyMoneyAccount& account, const QString& id); + void setAccount(const MyMoneyAccount& account, const TQString& id); /** * This method returns the name of the selected account in the combo box. * - * @return QString containing the id of the selected account + * @return TQString containing the id of the selected account */ - const QString& selectedAccount(void) const; + const TQString& selectedAccount(void) const; /** * This method is used to set the mode of the dialog. Two modes @@ -117,7 +118,7 @@ public: public slots: /** - * Reimplemented from QDialog + * Reimplemented from TQDialog */ int exec(); @@ -145,7 +146,7 @@ protected slots: void slotReloadWidget(void); private: - QString m_purpose; + TQString m_purpose; MyMoneyAccount m_account; int m_mode; // 0 - select or create, 1 - create only KMyMoneyUtils::categoryTypeE m_accountType; diff --git a/kmymoney2/dialogs/kaccountselectdlgdecl.ui b/kmymoney2/dialogs/kaccountselectdlgdecl.ui index 1908339..09b8afb 100644 --- a/kmymoney2/dialogs/kaccountselectdlgdecl.ui +++ b/kmymoney2/dialogs/kaccountselectdlgdecl.ui @@ -1,6 +1,6 @@ KAccountSelectDlgDecl - + KAccountSelectDlgDecl @@ -28,15 +28,15 @@ 6 - + - layout19 + tqlayout19 unnamed - + m_qifEntry @@ -56,17 +56,17 @@ false - + - layout18 + tqlayout18 unnamed - + - layout17 + tqlayout17 @@ -95,7 +95,7 @@ Expanding - + 110 20 @@ -107,7 +107,7 @@ m_descLabel - + m_headerLabel @@ -127,7 +127,7 @@ Expanding - + 16 20 @@ -152,9 +152,9 @@ Horizontal - + - layout4 + tqlayout4 @@ -184,7 +184,7 @@ Expanding - + 160 0 @@ -211,5 +211,8 @@ - + + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/kbackupdlg.cpp b/kmymoney2/dialogs/kbackupdlg.cpp index d98aeaf..d975e46 100644 --- a/kmymoney2/dialogs/kbackupdlg.cpp +++ b/kmymoney2/dialogs/kbackupdlg.cpp @@ -20,21 +20,17 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes #include #include -#if QT_VERSION > 300 #include -#else -#include -#endif #include #include @@ -48,8 +44,8 @@ #include "kbackupdlg.h" -KBackupDlg::KBackupDlg( QWidget* parent, const char* name/*, bool modal*/) - : kbackupdlgdecl( parent, name , true) +KBackupDlg::KBackupDlg( TQWidget* tqparent, const char* name/*, bool modal*/) + : kbackupdlgdecl( tqparent, name , true) { readConfig(); @@ -59,14 +55,14 @@ KBackupDlg::KBackupDlg( QWidget* parent, const char* name/*, bool modal*/) btnCancel->setGuiItem(KStdGuiItem::cancel()); KGuiItem chooseButtenItem( i18n("C&hoose..."), - QIconSet(il->loadIcon("folder", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("folder", KIcon::Small, KIcon::SizeSmall)), i18n("Select mount point"), i18n("Use this to browse to the mount point.")); chooseButton->setGuiItem(chooseButtenItem); - connect(chooseButton, SIGNAL(clicked()), this, SLOT(chooseButtonClicked())); - connect(btnOK,SIGNAL(clicked()),this,SLOT(accept())); - connect(btnCancel,SIGNAL(clicked()),this,SLOT(reject())); + connect(chooseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(chooseButtonClicked())); + connect(btnOK,TQT_SIGNAL(clicked()),this,TQT_SLOT(accept())); + connect(btnCancel,TQT_SIGNAL(clicked()),this,TQT_SLOT(reject())); } KBackupDlg::~KBackupDlg() diff --git a/kmymoney2/dialogs/kbackupdlg.h b/kmymoney2/dialogs/kbackupdlg.h index b275606..be2e749 100644 --- a/kmymoney2/dialogs/kbackupdlg.h +++ b/kmymoney2/dialogs/kbackupdlg.h @@ -20,7 +20,7 @@ #ifndef KBACKUPDIALOG_H #define KBACKUPDIALOG_H -#include +#include #include "../dialogs/kbackupdlgdecl.h" /** @@ -29,6 +29,7 @@ class KBackupDlg : public kbackupdlgdecl { Q_OBJECT + TQ_OBJECT private: void readConfig(void); void writeConfig(void); @@ -37,7 +38,7 @@ protected slots: void chooseButtonClicked(); public: - KBackupDlg( QWidget* parent, const char* name/*, bool modal*/); + KBackupDlg( TQWidget* tqparent, const char* name/*, bool modal*/); ~KBackupDlg(); }; diff --git a/kmymoney2/dialogs/kbackupdlgdecl.ui b/kmymoney2/dialogs/kbackupdlgdecl.ui index ff9795f..ae7cce6 100644 --- a/kmymoney2/dialogs/kbackupdlgdecl.ui +++ b/kmymoney2/dialogs/kbackupdlgdecl.ui @@ -1,6 +1,6 @@ kbackupdlgdecl - + kbackupdlgdecl @@ -17,7 +17,7 @@ 6 - + Layout4 @@ -31,7 +31,7 @@ 6 - + TextLabel1 @@ -42,7 +42,7 @@ Please make sure you have a disk inserted and that the drive is ready. Then choo Click OK to perform the backup. If your system does not use an automounter, make sure you mark the checkbox below to "mount this directory before backing up." - + WordBreak|AlignTop @@ -62,7 +62,7 @@ Click OK to perform the backup. If your system does not use an automounter, make Horizontal - + GroupBox1 @@ -79,7 +79,7 @@ Click OK to perform the backup. If your system does not use an automounter, make 6 - + Layout42 @@ -93,7 +93,7 @@ Click OK to perform the backup. If your system does not use an automounter, make 6 - + lblMountPoint @@ -102,7 +102,7 @@ Click OK to perform the backup. If your system does not use an automounter, make This is the mount point - + txtMountPoint @@ -117,7 +117,7 @@ Click OK to perform the backup. If your system does not use an automounter, make - + mountCheckBox @@ -135,7 +135,7 @@ Click OK to perform the backup. If your system does not use an automounter, make Expanding - + 0 24 @@ -144,7 +144,7 @@ Click OK to perform the backup. If your system does not use an automounter, make - + Layout44 @@ -168,7 +168,7 @@ Click OK to perform the backup. If your system does not use an automounter, make Expanding - + 455 0 @@ -206,5 +206,5 @@ Click OK to perform the backup. If your system does not use an automounter, make - + diff --git a/kmymoney2/dialogs/kbalancechartdlg.cpp b/kmymoney2/dialogs/kbalancechartdlg.cpp index 05eccf3..f1fcdda 100644 --- a/kmymoney2/dialogs/kbalancechartdlg.cpp +++ b/kmymoney2/dialogs/kbalancechartdlg.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -52,22 +52,22 @@ #define KMM_KDCHART_PROPSET_NORMAL_DATA KDCHART_PROPSET_NORMAL_DATA #endif -KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* parent, const char* name) : - KDialog(parent, name) +KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, TQWidget* tqparent, const char* name) : + KDialog(tqparent, name) { #ifdef HAVE_KDCHART - setCaption(i18n("Balance of %1").arg(account.name())); + setCaption(i18n("Balance of %1").tqarg(account.name())); setSizeGripEnabled( TRUE ); setModal( TRUE ); - QVBoxLayout* KBalanceChartDlgLayout = new QVBoxLayout( this, 11, 6, "KBalanceChartDlgLayout"); + TQVBoxLayout* KBalanceChartDlgLayout = new TQVBoxLayout( this, 11, 6, "KBalanceChartDlgLayout"); MyMoneyReport reportCfg = MyMoneyReport( MyMoneyReport::eAssetLiability, MyMoneyReport::eMonths, MyMoneyTransactionFilter::userDefined, // overridden by the setDateFilter() call below MyMoneyReport::eDetailTotal, - i18n("%1 Balance History").arg(account.name()), + i18n("%1 Balance History").tqarg(account.name()), i18n("Generated Report") ); reportCfg.setChartByDefault(true); @@ -76,14 +76,14 @@ KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* paren reportCfg.setChartType(MyMoneyReport::eChartLine); reportCfg.setIncludingSchedules( true ); if(account.accountType() == MyMoneyAccount::Investment) { - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) reportCfg.addAccount(*it_a); } else reportCfg.addAccount(account.id()); reportCfg.setColumnsAreDays( true ); reportCfg.setConvertCurrency( false ); - reportCfg.setDateFilter(QDate::currentDate().addDays(-90),QDate::currentDate().addDays(+90)); + reportCfg.setDateFilter(TQDate::tqcurrentDate().addDays(-90),TQDate::tqcurrentDate().addDays(+90)); reports::PivotTable table(reportCfg); @@ -102,7 +102,7 @@ KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* paren int m_idPropFutureValue = chartWidget->params()->registerProperties(propSetFutureValue); KDChartPropertySet propSetLastValue("last value", m_idPropFutureValue); - propSetLastValue.setExtraLinesAlign(KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignBottom); + propSetLastValue.setExtraLinesAlign(KDChartPropertySet::OwnID, TQt::AlignLeft | TQt::AlignBottom); propSetLastValue.setExtraLinesWidth(KDChartPropertySet::OwnID, -4); propSetLastValue.setExtraLinesColor(KDChartPropertySet::OwnID, KMyMoneyGlobalSettings::listGridColor()); @@ -110,7 +110,7 @@ KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* paren KDChartPropertySet propSetMinBalance("min balance", m_idPropFutureValue); propSetMinBalance.setLineStyle(KDChartPropertySet::OwnID, Qt::NoPen); - propSetMinBalance.setExtraLinesAlign(KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignRight); + propSetMinBalance.setExtraLinesAlign(KDChartPropertySet::OwnID, TQt::AlignLeft | TQt::AlignRight); int m_idPropMinBalance = chartWidget->params()->registerProperties(propSetMinBalance); KDChartPropertySet propSetMaxCredit("max credit", m_idPropMinBalance); @@ -180,13 +180,13 @@ KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* paren - QFrame* line1 = new QFrame( this, "line1" ); - line1->setFrameShape( QFrame::HLine ); - line1->setFrameShadow( QFrame::Sunken ); - line1->setFrameShape( QFrame::HLine ); + TQFrame* line1 = new TQFrame( this, "line1" ); + line1->setFrameShape( TQFrame::HLine ); + line1->setFrameShadow( TQFrame::Sunken ); + line1->setFrameShape( TQFrame::HLine ); KBalanceChartDlgLayout->addWidget(line1); - QHBoxLayout* Layout1 = new QHBoxLayout( KBalanceChartDlgLayout, 6, "Layout1"); + TQHBoxLayout* Layout1 = new TQHBoxLayout( KBalanceChartDlgLayout, 6, "Layout1"); #if 0 KPushButton* buttonHelp = new KPushButton( this, "buttonHelp" ); buttonHelp->setAutoDefault( TRUE ); @@ -194,8 +194,8 @@ KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* paren Layout1->addWidget( buttonHelp ); #endif - QSpacerItem* Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); - Layout1->addItem( Horizontal_Spacing2 ); + TQSpacerItem*Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); + Layout1->addItem(Horizontal_Spacing2 ); #if 0 KPushButton* buttonOk = new KPushButton( this, "buttonOk" ); @@ -210,10 +210,10 @@ KBalanceChartDlg::KBalanceChartDlg(const MyMoneyAccount& account, QWidget* paren buttonClose->setGuiItem(KStdGuiItem::Close); Layout1->addWidget( buttonClose ); - // connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( accept() ) ); + // connect( buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); + connect( buttonClose, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) ); - resize( QSize(700, 500).expandedTo(minimumSizeHint()) ); + resize( TQSize(700, 500).expandedTo(tqminimumSizeHint()) ); clearWState( WState_Polished ); #endif } diff --git a/kmymoney2/dialogs/kbalancechartdlg.h b/kmymoney2/dialogs/kbalancechartdlg.h index 8fe2502..afb1b1d 100644 --- a/kmymoney2/dialogs/kbalancechartdlg.h +++ b/kmymoney2/dialogs/kbalancechartdlg.h @@ -37,8 +37,9 @@ class MyMoneyAccount; class KBalanceChartDlg : public KDialog { Q_OBJECT + TQ_OBJECT public: - KBalanceChartDlg(const MyMoneyAccount& account, QWidget* parent = 0, const char* name = 0); + KBalanceChartDlg(const MyMoneyAccount& account, TQWidget* tqparent = 0, const char* name = 0); ~KBalanceChartDlg(); }; diff --git a/kmymoney2/dialogs/kbalancewarning.cpp b/kmymoney2/dialogs/kbalancewarning.cpp index 16f3dc0..358210c 100644 --- a/kmymoney2/dialogs/kbalancewarning.cpp +++ b/kmymoney2/dialogs/kbalancewarning.cpp @@ -18,8 +18,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -36,12 +36,12 @@ class KBalanceWarning::Private { public: - QString dontShowAgain() const { return "BalanceWarning"; } - QMap m_deselectedAccounts; + TQString dontShowAgain() const { return "BalanceWarning"; } + TQMap m_deselectedAccounts; }; -KBalanceWarning::KBalanceWarning(QObject* parent, const char* name) : - QObject(parent, name), +KBalanceWarning::KBalanceWarning(TQObject* tqparent, const char* name) : + TQObject(tqparent, name), d(new Private) { KMessageBox::enableMessage(d->dontShowAgain()); @@ -52,10 +52,10 @@ KBalanceWarning::~KBalanceWarning() delete d; } -void KBalanceWarning::slotShowMessage(QWidget* parent, const MyMoneyAccount& account, const QString& msg) +void KBalanceWarning::slotShowMessage(TQWidget* tqparent, const MyMoneyAccount& account, const TQString& msg) { - if(d->m_deselectedAccounts.find(account.id()) == d->m_deselectedAccounts.end()) { - KMessageBox::information(parent, msg, QString::null, d->dontShowAgain()); + if(d->m_deselectedAccounts.tqfind(account.id()) == d->m_deselectedAccounts.end()) { + KMessageBox::information(tqparent, msg, TQString(), d->dontShowAgain()); if(!KMessageBox::shouldBeShownContinue(d->dontShowAgain())) { d->m_deselectedAccounts[account.id()] = true; KMessageBox::enableMessage(d->dontShowAgain()); diff --git a/kmymoney2/dialogs/kbalancewarning.h b/kmymoney2/dialogs/kbalancewarning.h index 2e3c4d4..cb9848d 100644 --- a/kmymoney2/dialogs/kbalancewarning.h +++ b/kmymoney2/dialogs/kbalancewarning.h @@ -20,9 +20,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QString; -class QWidget; +#include +class TQString; +class TQWidget; // ---------------------------------------------------------------------------- // KDE Includes @@ -32,15 +32,16 @@ class QWidget; class MyMoneyAccount; -class KBalanceWarning : public QObject +class KBalanceWarning : public TQObject { Q_OBJECT + TQ_OBJECT public: - KBalanceWarning(QObject* parent, const char* name = 0); + KBalanceWarning(TQObject* tqparent, const char* name = 0); virtual ~KBalanceWarning(); public slots: - void slotShowMessage(QWidget* parent, const MyMoneyAccount& account, const QString& msg); + void slotShowMessage(TQWidget* tqparent, const MyMoneyAccount& account, const TQString& msg); private: class Private; diff --git a/kmymoney2/dialogs/kcategoryreassigndlg.cpp b/kmymoney2/dialogs/kcategoryreassigndlg.cpp index f457134..3bead48 100644 --- a/kmymoney2/dialogs/kcategoryreassigndlg.cpp +++ b/kmymoney2/dialogs/kcategoryreassigndlg.cpp @@ -36,12 +36,12 @@ #include #include -KCategoryReassignDlg::KCategoryReassignDlg( QWidget* parent, const char* name) : - KCategoryReassignDlgDecl( parent, name) +KCategoryReassignDlg::KCategoryReassignDlg( TQWidget* tqparent, const char* name) : + KCategoryReassignDlgDecl( tqparent, name) { buttonOk->setGuiItem(KStdGuiItem::ok()); buttonCancel->setGuiItem(KStdGuiItem::cancel()); - kMandatoryFieldGroup* mandatory = new kMandatoryFieldGroup(this); + kMandatoryFieldGroup* mandatory = new kMandatoryFieldGroup(TQT_TQOBJECT(this)); mandatory->add(m_category); mandatory->setOkButton(buttonOk); } @@ -50,10 +50,10 @@ KCategoryReassignDlg::~KCategoryReassignDlg() { } -QString KCategoryReassignDlg::show(const MyMoneyAccount& category) +TQString KCategoryReassignDlg::show(const MyMoneyAccount& category) { if (category.id().isEmpty()) - return QString(); // no payee available? nothing can be selected... + return TQString(); // no payee available? nothing can be selected... AccountSet set; set.addAccountGroup(MyMoneyAccount::Income); @@ -64,8 +64,8 @@ QString KCategoryReassignDlg::show(const MyMoneyAccount& category) m_category->selector()->removeItem(category.id()); // make sure the available categories have the same currency - QStringList list; - QStringList::const_iterator it_a; + TQStringList list; + TQStringList::const_iterator it_a; m_category->selector()->itemList(list); for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); @@ -78,13 +78,13 @@ QString KCategoryReassignDlg::show(const MyMoneyAccount& category) // if there is no category for reassignment left, we bail out if(list.isEmpty()) { - KMessageBox::sorry(this, QString("")+i18n("At least one transaction/schedule still references the category %1. However, at least one category with the same currency must exist so that the transactions/schedules can be reassigned.").arg(category.name())+QString("")); - return QString(); + KMessageBox::sorry(this, TQString("")+i18n("At least one transaction/schedule still references the category %1. However, at least one category with the same currency must exist so that the transactions/schedules can be reassigned.").tqarg(category.name())+TQString("")); + return TQString(); } // execute dialog and if aborted, return empty string - if (this->exec() == QDialog::Rejected) - return QString(); + if (this->exec() == TQDialog::Rejected) + return TQString(); // otherwise return index of selected payee return m_category->selectedItem(); diff --git a/kmymoney2/dialogs/kcategoryreassigndlg.h b/kmymoney2/dialogs/kcategoryreassigndlg.h index ce756ee..4639bd4 100644 --- a/kmymoney2/dialogs/kcategoryreassigndlg.h +++ b/kmymoney2/dialogs/kcategoryreassigndlg.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -39,9 +39,10 @@ class KCategoryReassignDlg : public KCategoryReassignDlgDecl { Q_OBJECT + TQ_OBJECT public: /** Default constructor */ - KCategoryReassignDlg( QWidget* parent = 0, const char* name = 0); + KCategoryReassignDlg( TQWidget* tqparent = 0, const char* name = 0); /** Destructor */ ~KCategoryReassignDlg(); @@ -52,11 +53,11 @@ public: * * @param category reference to MyMoneyAccount object of the category to be deleted * - * @return Returns the id of the selected category in the list or QString() if - * the dialog was aborted. QString() is also returned if the @a category + * @return Returns the id of the selected category in the list or TQString() if + * the dialog was aborted. TQString() is also returned if the @a category * does not have an id. */ - QString show(const MyMoneyAccount& category); + TQString show(const MyMoneyAccount& category); protected: void accept(void); diff --git a/kmymoney2/dialogs/kcategoryreassigndlgdecl.ui b/kmymoney2/dialogs/kcategoryreassigndlgdecl.ui index 5b9a954..be2e661 100644 --- a/kmymoney2/dialogs/kcategoryreassigndlgdecl.ui +++ b/kmymoney2/dialogs/kcategoryreassigndlgdecl.ui @@ -1,6 +1,6 @@ KCategoryReassignDlgDecl - + KCategoryeReassignDlgDecl @@ -25,11 +25,11 @@ unnamed - + textLabel1 - + 300 0 @@ -38,7 +38,7 @@ The transactions, schedules and budgets associated with the selected category need to be re-assigned to a different category before the selected category can be deleted. Please select a category from the list below. - + WordBreak|AlignJustify|AlignTop @@ -52,14 +52,14 @@ Fixed - + 20 16 - + textLabel2 @@ -82,7 +82,7 @@ Expanding - + 20 16 @@ -103,9 +103,9 @@ Horizontal - + - layout2 + tqlayout2 @@ -121,7 +121,7 @@ Expanding - + 305 20 @@ -171,5 +171,8 @@ reject() - + + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/kchooseimportexportdlg.cpp b/kmymoney2/dialogs/kchooseimportexportdlg.cpp index 0c390a8..1038bf1 100644 --- a/kmymoney2/dialogs/kchooseimportexportdlg.cpp +++ b/kmymoney2/dialogs/kchooseimportexportdlg.cpp @@ -19,17 +19,13 @@ ***************************************************************************/ #include #include -#if QT_VERSION > 300 #include -#else -#include -#endif -#include +#include -#include -#include -#include +#include +#include +#include #include #include @@ -37,10 +33,10 @@ #include "kchooseimportexportdlg.h" -KChooseImportExportDlg::KChooseImportExportDlg(int type, QWidget *parent, const char *name ) - : KChooseImportExportDlgDecl(parent,name, true) +KChooseImportExportDlg::KChooseImportExportDlg(int type, TQWidget *tqparent, const char *name ) + : KChooseImportExportDlgDecl(tqparent,name, true) { - QString filename; + TQString filename; if (type==0) { // import topLabel->setText(i18n("Please choose the type of import you wish to perform. A simple explanation\n" @@ -60,11 +56,11 @@ KChooseImportExportDlg::KChooseImportExportDlg(int type, QWidget *parent, const readConfig(); slotTypeActivated(m_lastType); - typeCombo->setCurrentItem(((m_lastType=="QIF") ? 0 : 1)); + typeCombo->setCurrentItem(((m_lastType=="TQIF") ? 0 : 1)); - connect(typeCombo, SIGNAL(activated(const QString&)), this, SLOT(slotTypeActivated(const QString&))); - connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); - connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); + connect(typeCombo, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotTypeActivated(const TQString&))); + connect(okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); } KChooseImportExportDlg::~KChooseImportExportDlg() @@ -72,10 +68,10 @@ KChooseImportExportDlg::~KChooseImportExportDlg() writeConfig(); } -void KChooseImportExportDlg::slotTypeActivated(const QString& text) +void KChooseImportExportDlg::slotTypeActivated(const TQString& text) { - if (text=="QIF") { - descriptionLabel->setText(i18n("QIF files are created by the popular accounting program Quicken.\n" + if (text=="TQIF") { + descriptionLabel->setText(i18n("TQIF files are created by the popular accounting program Quicken.\n" "Another dialog will appear, if you choose this type, asking for further\n" "information relevant to the Quicken format.")); } else { @@ -85,7 +81,7 @@ void KChooseImportExportDlg::slotTypeActivated(const QString& text) } } -QString KChooseImportExportDlg::importExportType(void) +TQString KChooseImportExportDlg::importExportType(void) { return typeCombo->currentText(); } diff --git a/kmymoney2/dialogs/kchooseimportexportdlg.h b/kmymoney2/dialogs/kchooseimportexportdlg.h index ac562f3..c93ba8b 100644 --- a/kmymoney2/dialogs/kchooseimportexportdlg.h +++ b/kmymoney2/dialogs/kchooseimportexportdlg.h @@ -21,7 +21,7 @@ #ifndef KCHOOSEIMPORTEXPORTDLG_H #define KCHOOSEIMPORTEXPORTDLG_H -#include +#include #include "../dialogs/kchooseimportexportdlgdecl.h" /** @@ -30,18 +30,19 @@ class KChooseImportExportDlg : public KChooseImportExportDlgDecl { Q_OBJECT + TQ_OBJECT private: void readConfig(void); void writeConfig(void); - QString m_lastType; + TQString m_lastType; protected slots: - void slotTypeActivated(const QString& text); + void slotTypeActivated(const TQString& text); public: - KChooseImportExportDlg(int type, QWidget *parent=0, const char *name=0); + KChooseImportExportDlg(int type, TQWidget *tqparent=0, const char *name=0); ~KChooseImportExportDlg(); - QString importExportType(void); + TQString importExportType(void); }; #endif diff --git a/kmymoney2/dialogs/kchooseimportexportdlgdecl.ui b/kmymoney2/dialogs/kchooseimportexportdlgdecl.ui index 3d12a14..f52cbca 100644 --- a/kmymoney2/dialogs/kchooseimportexportdlgdecl.ui +++ b/kmymoney2/dialogs/kchooseimportexportdlgdecl.ui @@ -1,7 +1,7 @@ KChooseImportExportDlgDecl - QDialog + TQDialog name kChooseImportDlgDecl @@ -20,7 +20,7 @@ 6 - QLayoutWidget + TQLayoutWidget name Layout4 @@ -35,7 +35,7 @@ 6 - QLabel + TQLabel name topLabel @@ -67,7 +67,7 @@ Once you have chosen an import type please press the OK button. - QLayoutWidget + TQLayoutWidget name Layout3 @@ -95,7 +95,7 @@ Once you have chosen an import type please press the OK button. Expanding - sizeHint + tqsizeHint 20 20 @@ -103,7 +103,7 @@ Once you have chosen an import type please press the OK button. - QLabel + TQLabel name promptLabel @@ -114,11 +114,11 @@ Once you have chosen an import type please press the OK button. - QComboBox + TQComboBox text - QIF + TQIF @@ -132,7 +132,7 @@ Once you have chosen an import type please press the OK button. typeCombo - minimumSize + tqminimumSize 100 0 @@ -142,7 +142,7 @@ Once you have chosen an import type please press the OK button. - QLabel + TQLabel name descriptionLabel @@ -155,7 +155,7 @@ Once you have chosen an import type please press the OK button. - minimumSize + tqminimumSize 410 100 @@ -167,7 +167,7 @@ Once you have chosen an import type please press the OK button. - QLayoutWidget + TQLayoutWidget name Layout2 @@ -195,7 +195,7 @@ Once you have chosen an import type please press the OK button. Expanding - sizeHint + tqsizeHint 20 20 @@ -203,7 +203,7 @@ Once you have chosen an import type please press the OK button. - QPushButton + TQPushButton name okButton @@ -218,7 +218,7 @@ Once you have chosen an import type please press the OK button. - QPushButton + TQPushButton name cancelButton diff --git a/kmymoney2/dialogs/kconfirmmanualenterdlg.cpp b/kmymoney2/dialogs/kconfirmmanualenterdlg.cpp index 3c20a48..8c1678f 100644 --- a/kmymoney2/dialogs/kconfirmmanualenterdlg.cpp +++ b/kmymoney2/dialogs/kconfirmmanualenterdlg.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -36,8 +36,8 @@ #include #include "kconfirmmanualenterdlg.h" -KConfirmManualEnterDlg::KConfirmManualEnterDlg(const MyMoneySchedule& schedule, QWidget* parent, const char* name) : - KConfirmManualEnterDlgDecl(parent, name) +KConfirmManualEnterDlg::KConfirmManualEnterDlg(const MyMoneySchedule& schedule, TQWidget* tqparent, const char* name) : + KConfirmManualEnterDlgDecl(tqparent, name) { buttonOk->setGuiItem(KStdGuiItem::ok()); buttonCancel->setGuiItem(KStdGuiItem::cancel()); @@ -53,7 +53,7 @@ KConfirmManualEnterDlg::KConfirmManualEnterDlg(const MyMoneySchedule& schedule, void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, const MyMoneyTransaction& tn) { - QString messageDetail(""); + TQString messageDetail(""); MyMoneyFile* file = MyMoneyFile::instance(); int noItemsChanged=0; @@ -75,7 +75,7 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons try { - QString po, pn; + TQString po, pn; if(to.splits()[0].payeeId()) po = file->payee(to.splits()[0].payeeId()).name(); if(tn.splits()[0].payeeId()) @@ -83,7 +83,7 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons if (po != pn) { noItemsChanged++; - messageDetail += i18n("Payee changed.
   Old: %1, New: %2

").arg(po).arg(pn); + messageDetail += i18n("Payee changed.
   Old: %1, New: %2

").tqarg(po).tqarg(pn); } #if 0 if ( (m_schedule.type() == MyMoneySchedule::TYPE_TRANSFER || @@ -92,7 +92,7 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons { noItemsChanged++; messageDetail += i18n("Account changed. Old: \"%1\", New: \"%2\"") - .arg(m_schedule.account().name()).arg(m_from->currentText()) + QString("\n"); + .tqarg(m_schedule.account().name()).tqarg(m_from->currentText()) + TQString("\n"); } if ( m_schedule.type() == MyMoneySchedule::TYPE_DEPOSIT && @@ -100,26 +100,26 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons { noItemsChanged++; messageDetail += i18n("Account changed. Old: \"%1\", New: \"%2\"") - .arg(m_schedule.account().name()).arg(m_to->currentText()) + QString("\n"); + .tqarg(m_schedule.account().name()).tqarg(m_to->currentText()) + TQString("\n"); } #endif if(to.splits()[0].accountId() != tn.splits()[0].accountId()) { noItemsChanged++; messageDetail += i18n("Account changed.
   Old: %1, New: %2

") - .arg(file->account(to.splits()[0].accountId()).name()) - .arg(file->account(tn.splits()[0].accountId()).name()); + .tqarg(file->account(to.splits()[0].accountId()).name()) + .tqarg(file->account(tn.splits()[0].accountId()).name()); } if(file->isTransfer(to) && file->isTransfer(tn)) { if(to.splits()[1].accountId() != tn.splits()[1].accountId()) { noItemsChanged++; messageDetail += i18n("Transfer account changed.
   Old: %1, New: %2

") - .arg(file->account(to.splits()[1].accountId()).name()) - .arg(file->account(tn.splits()[1].accountId()).name()); + .tqarg(file->account(to.splits()[1].accountId()).name()) + .tqarg(file->account(tn.splits()[1].accountId()).name()); } } else { - QString co, cn; + TQString co, cn; switch(to.splitCount()) { default: co = i18n("Split transaction (category replacement)", "Split transaction"); @@ -142,21 +142,21 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons if (co != cn) { noItemsChanged++; - messageDetail += i18n("Category changed.
   Old: %1, New: %2

").arg(co).arg(cn); + messageDetail += i18n("Category changed.
   Old: %1, New: %2

").tqarg(co).tqarg(cn); } } - QString mo, mn; + TQString mo, mn; mo = to.splits()[0].memo(); mn = tn.splits()[0].memo(); if(mo.isEmpty()) - mo = QString("")+i18n("empty")+QString(""); + mo = TQString("")+i18n("empty")+TQString(""); if(mn.isEmpty()) - mn = QString("")+i18n("empty")+QString(""); + mn = TQString("")+i18n("empty")+TQString(""); if (mo != mn) { noItemsChanged++; - messageDetail += i18n("Memo changed.
   Old: %1, New: %2

").arg(mo).arg(mn); + messageDetail += i18n("Memo changed.
   Old: %1, New: %2

").tqarg(mo).tqarg(mn); } const MyMoneySecurity& sec = MyMoneyFile::instance()->security(to.commodity()); @@ -166,7 +166,7 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons if (ao != an) { noItemsChanged++; messageDetail += i18n("Amount changed.
   Old: %1, New: %2

") - .arg(ao.formatMoney(sec.smallestAccountFraction())).arg(an.formatMoney(sec.smallestAccountFraction())); + .tqarg(ao.formatMoney(sec.smallestAccountFraction())).tqarg(an.formatMoney(sec.smallestAccountFraction())); } MyMoneySplit::reconcileFlagE fo, fn; @@ -175,8 +175,8 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons if(fo != fn) { noItemsChanged++; messageDetail += i18n("Reconciliation flag changed.
   Old: %1, New: %2

") - .arg(KMyMoneyUtils::reconcileStateToString(fo, true)) - .arg(KMyMoneyUtils::reconcileStateToString(fn, true)); + .tqarg(KMyMoneyUtils::reconcileStateToString(fo, true)) + .tqarg(KMyMoneyUtils::reconcileStateToString(fn, true)); } } catch (MyMoneyException *e) diff --git a/kmymoney2/dialogs/kconfirmmanualenterdlg.h b/kmymoney2/dialogs/kconfirmmanualenterdlg.h index 43ff65a..95a0b9b 100644 --- a/kmymoney2/dialogs/kconfirmmanualenterdlg.h +++ b/kmymoney2/dialogs/kconfirmmanualenterdlg.h @@ -36,8 +36,9 @@ class KConfirmManualEnterDlg : public KConfirmManualEnterDlgDecl { Q_OBJECT + TQ_OBJECT public: - KConfirmManualEnterDlg(const MyMoneySchedule& schedule, QWidget* parent = 0, const char* name = 0); + KConfirmManualEnterDlg(const MyMoneySchedule& schedule, TQWidget* tqparent = 0, const char* name = 0); typedef enum { UseOriginal = 0, diff --git a/kmymoney2/dialogs/kconfirmmanualenterdlgdecl.ui b/kmymoney2/dialogs/kconfirmmanualenterdlgdecl.ui index f88f0ce..f358370 100644 --- a/kmymoney2/dialogs/kconfirmmanualenterdlgdecl.ui +++ b/kmymoney2/dialogs/kconfirmmanualenterdlgdecl.ui @@ -1,6 +1,6 @@ KConfirmManualEnterDlgDecl - + KConfirmManualEnterDlgDecl @@ -28,7 +28,7 @@ 6 - + m_message @@ -47,7 +47,7 @@ true - + buttonGroup1 @@ -65,7 +65,7 @@ unnamed - + m_discardRadio @@ -73,7 +73,7 @@ Discard the changes and enter the original transaction into the register. - + m_onceRadio @@ -81,7 +81,7 @@ Enter these new values this one time, for this occurence only. - + m_setRadio @@ -91,9 +91,9 @@ - + - layout3 + tqlayout3 @@ -109,7 +109,7 @@ Expanding - + 180 16 @@ -156,5 +156,5 @@ reject() - + diff --git a/kmymoney2/dialogs/kcsvprogressdlg.cpp b/kmymoney2/dialogs/kcsvprogressdlg.cpp index d8f85ed..7b923e7 100644 --- a/kmymoney2/dialogs/kcsvprogressdlg.cpp +++ b/kmymoney2/dialogs/kcsvprogressdlg.cpp @@ -19,22 +19,18 @@ ***************************************************************************/ #include #include -#if QT_VERSION > 300 #include -#else -#include -#endif -#include +#include // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -51,8 +47,8 @@ #include "../kmymoneyutils.h" /** Simple constructor */ -KCsvProgressDlg::KCsvProgressDlg(int type, MyMoneyAccount *account, QWidget *parent, const char *name ) - : KCsvProgressDlgDecl(parent,name, true) +KCsvProgressDlg::KCsvProgressDlg(int type, MyMoneyAccount *account, TQWidget *tqparent, const char *name ) + : KCsvProgressDlgDecl(tqparent,name, true) { m_nType = type; if (m_nType==0) @@ -70,11 +66,11 @@ KCsvProgressDlg::KCsvProgressDlg(int type, MyMoneyAccount *account, QWidget *par readConfig(); - connect(m_qbuttonBrowse, SIGNAL(clicked()), this, SLOT(slotBrowseClicked())); - connect(m_qbuttonRun, SIGNAL(clicked()), this, SLOT(slotRunClicked())); - connect(m_qlineeditFile, SIGNAL(textChanged(const QString&)), this, - SLOT(slotFileTextChanged(const QString&))); - connect(m_qbuttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(m_qbuttonBrowse, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowseClicked())); + connect(m_qbuttonRun, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRunClicked())); + connect(m_qlineeditFile, TQT_SIGNAL(textChanged(const TQString&)), this, + TQT_SLOT(slotFileTextChanged(const TQString&))); + connect(m_qbuttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); } /** Simple destructor */ @@ -94,16 +90,16 @@ void KCsvProgressDlg::performExport(void) return; } - QString strFile = m_qlineeditFile->text(); - if(KMyMoneyUtils::appendCorrectFileExt(strFile, QString("csv"))) + TQString strFile = m_qlineeditFile->text(); + if(KMyMoneyUtils::appendCorrectFileExt(strFile, TQString("csv"))) m_qlineeditFile->setText(strFile); - if (m_kmymoneydateEnd->getQDate() < m_kmymoneydateStart->getQDate()) { + if (m_kmymoneydateEnd->getTQDate() < m_kmymoneydateStart->getTQDate()) { KMessageBox::information(this, i18n("Please enter a start date lower than the end date.")); return; } - QFile qfile(m_qlineeditFile->text()); + TQFile qfile(m_qlineeditFile->text()); if (!qfile.open(IO_WriteOnly)) { KMessageBox::error(this, i18n("Unable to open export file for writing.")); return; @@ -111,27 +107,27 @@ void KCsvProgressDlg::performExport(void) qfile.close(); m_qlabelAccount->setText(m_mymoneyaccount->name()); - m_qlabelTransaction->setText(QString("0") + i18n(" of ") + QString::number(m_mymoneyaccount->transactionCount())); + m_qlabelTransaction->setText(TQString("0") + i18n(" of ") + TQString::number(m_mymoneyaccount->transactionCount())); m_qprogressbar->setTotalSteps(m_mymoneyaccount->transactionCount()); // Make sure we have an account to operate on if (m_mymoneyaccount) { // Connect to the provided signals in MyMoneyAccount // These signals will be emitted at appropriate times. - connect(m_mymoneyaccount, SIGNAL(signalProgressCount(int)), m_qprogressbar, SLOT(setTotalSteps(int))); - connect(m_mymoneyaccount, SIGNAL(signalProgress(int)), this, SLOT(slotSetProgress(int))); + connect(m_mymoneyaccount, TQT_SIGNAL(signalProgressCount(int)), m_qprogressbar, TQT_SLOT(setTotalSteps(int))); + connect(m_mymoneyaccount, TQT_SIGNAL(signalProgress(int)), this, TQT_SLOT(slotSetProgress(int))); int nTransCount = 0; // Do the actual write - if (!m_mymoneyaccount->writeCSVFile(m_qlineeditFile->text(), m_kmymoneydateStart->getQDate(), - m_kmymoneydateEnd->getQDate(), nTransCount)) { + if (!m_mymoneyaccount->writeCSVFile(m_qlineeditFile->text(), m_kmymoneydateStart->getTQDate(), + m_kmymoneydateEnd->getTQDate(), nTransCount)) { KMessageBox::error(this, i18n("Error occurred whilst exporting to csv file."), i18n("Export CSV")); } else { - QString qstringPrompt = i18n("Export finished successfully.\n\n"); + TQString qstringPrompt = i18n("Export finished successfully.\n\n"); qstringPrompt += i18n("Number of transactions exported "); - qstringPrompt += QString::number(nTransCount); + qstringPrompt += TQString::number(nTransCount); qstringPrompt += "."; KMessageBox::information(this, qstringPrompt, i18n("Export CSV")); } @@ -150,7 +146,7 @@ void KCsvProgressDlg::performImport(void) return; } - QFile qfile(m_qlineeditFile->text()); + TQFile qfile(m_qlineeditFile->text()); if (!qfile.open(IO_ReadOnly)) { KMessageBox::error(this, i18n("Unable to open import file for reading.")); return; @@ -163,8 +159,8 @@ void KCsvProgressDlg::performImport(void) if (m_mymoneyaccount) { // Connect to the provided signals in MyMoneyAccount // These signals will be emitted at appropriate times. - connect(m_mymoneyaccount, SIGNAL(signalProgressCount(int)), m_qprogressbar, SLOT(setTotalSteps(int))); - connect(m_mymoneyaccount, SIGNAL(signalProgress(int)), this, SLOT(slotSetProgress(int))); + connect(m_mymoneyaccount, TQT_SIGNAL(signalProgressCount(int)), m_qprogressbar, TQT_SLOT(setTotalSteps(int))); + connect(m_mymoneyaccount, TQT_SIGNAL(signalProgress(int)), this, TQT_SLOT(slotSetProgress(int))); int nTransCount = 0; @@ -173,9 +169,9 @@ void KCsvProgressDlg::performImport(void) KMessageBox::error(this, i18n("Error occurred whilst importing csv file."), i18n("Import CSV")); } else { - QString qstringPrompt = i18n("Import finished successfully.\n\n"); + TQString qstringPrompt = i18n("Import finished successfully.\n\n"); qstringPrompt += i18n("Number of transactions imported "); - qstringPrompt += QString::number(nTransCount); + qstringPrompt += TQString::number(nTransCount); qstringPrompt += "."; KMessageBox::information(this, qstringPrompt, i18n("Import CSV")); } @@ -186,7 +182,7 @@ void KCsvProgressDlg::performImport(void) /** Called when the user clicks on the Browser button */ void KCsvProgressDlg::slotBrowseClicked() { - QString newName = KFileDialog::getSaveFileName(QString::null,"*.CSV"); + TQString newName = KFileDialog::getSaveFileName(TQString(),"*.CSV"); if (!newName.isEmpty()) { m_qlineeditFile->setText(newName); @@ -207,7 +203,7 @@ void KCsvProgressDlg::slotRunClicked() } /** Make sure the text input is ok */ -void KCsvProgressDlg::slotFileTextChanged(const QString& text) +void KCsvProgressDlg::slotFileTextChanged(const TQString& text) { if (!text.isEmpty()) { m_qlineeditFile->setText(text); @@ -234,8 +230,8 @@ void KCsvProgressDlg::writeConfig(void) KConfig *kconfig = KGlobal::config(); kconfig->setGroup("Last Use Settings"); kconfig->writeEntry("KCsvProgressDlg_LastFile", m_qlineeditFile->text()); - kconfig->writeEntry("KCsvProgressDlg_StartDate", QDateTime(m_kmymoneydateStart->date())); - kconfig->writeEntry("KCsvProgressDlg_EndDate", QDateTime(m_kmymoneydateEnd->date())); + kconfig->writeEntry("KCsvProgressDlg_StartDate", TQDateTime(m_kmymoneydateStart->date())); + kconfig->writeEntry("KCsvProgressDlg_EndDate", TQDateTime(m_kmymoneydateEnd->date())); kconfig->sync(); } @@ -243,9 +239,9 @@ void KCsvProgressDlg::writeConfig(void) void KCsvProgressDlg::slotSetProgress(int progress) { m_qprogressbar->setProgress(progress); - QString qstring = QString::number(progress); + TQString qstring = TQString::number(progress); qstring += i18n(" of "); - qstring += QString::number(m_qprogressbar->totalSteps()); + qstring += TQString::number(m_qprogressbar->totalSteps()); m_qlabelTransaction->setText(qstring); } diff --git a/kmymoney2/dialogs/kcsvprogressdlg.h b/kmymoney2/dialogs/kcsvprogressdlg.h index 339d210..20d6990 100644 --- a/kmymoney2/dialogs/kcsvprogressdlg.h +++ b/kmymoney2/dialogs/kcsvprogressdlg.h @@ -22,7 +22,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -44,6 +44,7 @@ **/ class KCsvProgressDlg : public KCsvProgressDlgDecl { Q_OBJECT + TQ_OBJECT private: MyMoneyAccount *m_mymoneyaccount; int m_nType; @@ -57,11 +58,11 @@ protected: protected slots: void slotBrowseClicked(); void slotRunClicked(); - void slotFileTextChanged(const QString& text); + void slotFileTextChanged(const TQString& text); void slotSetProgress(int progress); public: - KCsvProgressDlg(int type, MyMoneyAccount *account, QWidget *parent=0, const char *name=0); + KCsvProgressDlg(int type, MyMoneyAccount *account, TQWidget *tqparent=0, const char *name=0); ~KCsvProgressDlg(); }; diff --git a/kmymoney2/dialogs/kcsvprogressdlgdecl.ui b/kmymoney2/dialogs/kcsvprogressdlgdecl.ui index 4b1afd5..d7c0f20 100644 --- a/kmymoney2/dialogs/kcsvprogressdlgdecl.ui +++ b/kmymoney2/dialogs/kcsvprogressdlgdecl.ui @@ -1,7 +1,7 @@ KCsvProgressDlgDecl - QDialog + TQDialog name kcsvprogressdlgdecl @@ -20,7 +20,7 @@ 6 - QLayoutWidget + TQLayoutWidget name Layout7 @@ -35,7 +35,7 @@ 6 - QLabel + TQLabel name TextLabel2_2 @@ -62,7 +62,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLayoutWidget + TQLayoutWidget name Layout20 @@ -77,7 +77,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLayoutWidget + TQLayoutWidget name Layout19 @@ -92,7 +92,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLabel + TQLabel name TextLabel1_2 @@ -103,7 +103,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLayoutWidget + TQLayoutWidget name Layout18 @@ -118,14 +118,14 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLineEdit + TQLineEdit name m_qlineeditFile - QPushButton + TQPushButton name m_qbuttonBrowse @@ -140,7 +140,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QGroupBox + TQGroupBox name m_qgroupboxDates @@ -159,7 +159,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLayoutWidget + TQLayoutWidget name Layout8 @@ -174,7 +174,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLabel + TQLabel name lblStartDate @@ -187,7 +187,7 @@ You can cancel the process at any time by clicking on the Cancel button. - minimumSize + tqminimumSize 50 0 @@ -215,7 +215,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLayoutWidget + TQLayoutWidget name Layout7_2 @@ -230,7 +230,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLabel + TQLabel name lblEndDate @@ -243,7 +243,7 @@ You can cancel the process at any time by clicking on the Cancel button. - minimumSize + tqminimumSize 50 0 @@ -275,7 +275,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLayoutWidget + TQLayoutWidget name Layout7 @@ -303,7 +303,7 @@ You can cancel the process at any time by clicking on the Cancel button.Expanding - sizeHint + tqsizeHint 20 20 @@ -311,7 +311,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QPushButton + TQPushButton name m_qbuttonRun @@ -328,7 +328,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QGroupBox + TQGroupBox name m_qgroupbox @@ -351,7 +351,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLayoutWidget + TQLayoutWidget name Layout2 @@ -366,7 +366,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLabel + TQLabel name TextLabel2 @@ -377,7 +377,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLabel + TQLabel name m_qlabelAccount @@ -387,7 +387,7 @@ You can cancel the process at any time by clicking on the Cancel button.Unknown - alignment + tqalignment AlignVCenter|AlignRight @@ -397,7 +397,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLayoutWidget + TQLayoutWidget name Layout1 @@ -412,7 +412,7 @@ You can cancel the process at any time by clicking on the Cancel button.6 - QLabel + TQLabel name TextLabel3 @@ -423,7 +423,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLabel + TQLabel name m_qlabelTransaction @@ -433,7 +433,7 @@ You can cancel the process at any time by clicking on the Cancel button.0 of 0 - alignment + tqalignment AlignVCenter|AlignRight @@ -443,7 +443,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QProgressBar + TQProgressBar name m_qprogressbar @@ -456,7 +456,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QLayoutWidget + TQLayoutWidget name Layout3 @@ -484,7 +484,7 @@ You can cancel the process at any time by clicking on the Cancel button.Expanding - sizeHint + tqsizeHint 20 20 @@ -492,7 +492,7 @@ You can cancel the process at any time by clicking on the Cancel button. - QPushButton + TQPushButton name m_qbuttonOk diff --git a/kmymoney2/dialogs/kcurrencycalculator.cpp b/kmymoney2/dialogs/kcurrencycalculator.cpp index 6e674dc..0457a98 100644 --- a/kmymoney2/dialogs/kcurrencycalculator.cpp +++ b/kmymoney2/dialogs/kcurrencycalculator.cpp @@ -23,11 +23,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -51,7 +51,7 @@ #include "../kmymoneyutils.h" -bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const QMap& priceInfo, QWidget* parentWidget) +bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const TQMap& priceInfo, TQWidget* tqparentWidget) { bool rc = true; MyMoneyFile* file = MyMoneyFile::instance(); @@ -72,7 +72,7 @@ bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTra fromValue = s.value().abs(); // if we had a price info in the beginning, we use it here - if(priceInfo.find(cat.currencyId()) != priceInfo.end()) { + if(priceInfo.tqfind(cat.currencyId()) != priceInfo.end()) { toValue = (fromValue * priceInfo[cat.currencyId()]).convert(fract); } @@ -95,9 +95,9 @@ bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTra toValue, t.postDate(), fract, - parentWidget, "currencyCalculator"); + tqparentWidget, "currencyCalculator"); - if(calc.exec() == QDialog::Rejected) { + if(calc.exec() == TQDialog::Rejected) { rc = false; } else shares = (s.value() * calc.price()).convert(fract); @@ -111,8 +111,8 @@ bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTra return rc; } -KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const QDate& date, const signed64 resultFraction, QWidget *parent, const char *name ) : - KCurrencyCalculatorDecl(parent, name), +KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const TQDate& date, const signed64 resultFraction, TQWidget *tqparent, const char *name ) : + KCurrencyCalculatorDecl(tqparent, name), m_fromCurrency(from), m_toCurrency(to), m_result(shares.abs()), @@ -125,7 +125,7 @@ KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMo if(date.isValid()) m_dateEdit->setDate(date); else - m_dateEdit->setDate(QDate::currentDate()); + m_dateEdit->setDate(TQDate::tqcurrentDate()); m_fromCurrencyText->setText(m_fromCurrency.isCurrency() ? m_fromCurrency.id() : m_fromCurrency.tradingSymbol()); m_toCurrencyText->setText(m_toCurrency.isCurrency() ? m_toCurrency.id() : m_toCurrency.tradingSymbol()); @@ -157,13 +157,13 @@ KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMo m_conversionRate->setPrecision(KMyMoneyGlobalSettings::pricePrecision()); - connect(m_amountButton, SIGNAL(clicked()), this, SLOT(slotSetToAmount())); - connect(m_rateButton, SIGNAL(clicked()), this, SLOT(slotSetExchangeRate())); + connect(m_amountButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetToAmount())); + connect(m_rateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetExchangeRate())); - connect(m_toAmount, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateResult(const QString&))); - connect(m_conversionRate, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateRate(const QString&))); - connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_okButton, SIGNAL(clicked()), this, SLOT(accept())); + connect(m_toAmount, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateResult(const TQString&))); + connect(m_conversionRate, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateRate(const TQString&))); + connect(m_cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); // use this as the default m_amountButton->animateClick(); @@ -204,14 +204,14 @@ void KCurrencyCalculator::slotSetExchangeRate(void) m_conversionRate->setEnabled(true); } -void KCurrencyCalculator::slotUpdateResult(const QString& /*txt*/) +void KCurrencyCalculator::slotUpdateResult(const TQString& /*txt*/) { MyMoneyMoney result = m_toAmount->value(); MyMoneyMoney price(0, 1); if(result.isNegative()) { m_toAmount->setValue(-result); - slotUpdateResult(QString()); + slotUpdateResult(TQString()); return; } @@ -225,13 +225,13 @@ void KCurrencyCalculator::slotUpdateResult(const QString& /*txt*/) updateExample(price); } -void KCurrencyCalculator::slotUpdateRate(const QString& /*txt*/) +void KCurrencyCalculator::slotUpdateRate(const TQString& /*txt*/) { MyMoneyMoney price = m_conversionRate->value(); if(price.isNegative()) { m_conversionRate->setValue(-price); - slotUpdateRate(QString()); + slotUpdateRate(TQString()); return; } @@ -245,24 +245,24 @@ void KCurrencyCalculator::slotUpdateRate(const QString& /*txt*/) void KCurrencyCalculator::updateExample(const MyMoneyMoney& price) { - QString msg; + TQString msg; if(price.isZero()) { - msg = QString("1 %1 = ? %2").arg(m_fromCurrency.tradingSymbol()) - .arg(m_toCurrency.tradingSymbol()); + msg = TQString("1 %1 = ? %2").tqarg(m_fromCurrency.tradingSymbol()) + .tqarg(m_toCurrency.tradingSymbol()); if(m_fromCurrency.isCurrency()) { - msg += QString("\n"); - msg += QString("1 %1 = ? %2").arg(m_toCurrency.tradingSymbol()) - .arg(m_fromCurrency.tradingSymbol()); + msg += TQString("\n"); + msg += TQString("1 %1 = ? %2").tqarg(m_toCurrency.tradingSymbol()) + .tqarg(m_fromCurrency.tradingSymbol()); } } else { - msg = QString("1 %1 = %2 %3").arg(m_fromCurrency.tradingSymbol()) - .arg(price.formatMoney("", KMyMoneyGlobalSettings::pricePrecision())) - .arg(m_toCurrency.tradingSymbol()); + msg = TQString("1 %1 = %2 %3").tqarg(m_fromCurrency.tradingSymbol()) + .tqarg(price.formatMoney("", KMyMoneyGlobalSettings::pricePrecision())) + .tqarg(m_toCurrency.tradingSymbol()); if(m_fromCurrency.isCurrency()) { - msg += QString("\n"); - msg += QString("1 %1 = %2 %3").arg(m_toCurrency.tradingSymbol()) - .arg((MyMoneyMoney(1,1)/price).formatMoney("", KMyMoneyGlobalSettings::pricePrecision())) - .arg(m_fromCurrency.tradingSymbol()); + msg += TQString("\n"); + msg += TQString("1 %1 = %2 %3").tqarg(m_toCurrency.tradingSymbol()) + .tqarg((MyMoneyMoney(1,1)/price).formatMoney("", KMyMoneyGlobalSettings::pricePrecision())) + .tqarg(m_fromCurrency.tradingSymbol()); } } m_conversionExample->setText(msg); @@ -272,9 +272,9 @@ void KCurrencyCalculator::updateExample(const MyMoneyMoney& price) void KCurrencyCalculator::accept(void) { if(m_conversionRate->isEnabled()) - slotUpdateRate(QString()); + slotUpdateRate(TQString()); else - slotUpdateResult(QString()); + slotUpdateResult(TQString()); if(m_updateButton->isChecked()) { MyMoneyPrice pr = MyMoneyFile::instance()->price(m_fromCurrency.id(), m_toCurrency.id(), m_dateEdit->date()); diff --git a/kmymoney2/dialogs/kcurrencycalculator.h b/kmymoney2/dialogs/kcurrencycalculator.h index d9934da..a301129 100644 --- a/kmymoney2/dialogs/kcurrencycalculator.h +++ b/kmymoney2/dialogs/kcurrencycalculator.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -44,6 +44,7 @@ class KCurrencyCalculator : public KCurrencyCalculatorDecl { Q_OBJECT + TQ_OBJECT public: /** @@ -53,19 +54,19 @@ public: * @param shares the number of foreign currency units * @param date the date when the conversion took place * @param resultFraction the smallest fraction of the result (default 100) - * @param parent see QWidget constructor - * @param name see QWidget constructor + * @param tqparent see TQWidget constructor + * @param name see TQWidget constructor * * @note @p value must not be 0! */ - KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const QDate& date, const signed64 resultFraction = 100, QWidget *parent=0, const char *name=0); + KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const TQDate& date, const signed64 resultFraction = 100, TQWidget *tqparent=0, const char *name=0); ~KCurrencyCalculator(); const MyMoneyMoney price(void) const; void setupPriceEditor(void); - static bool setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const QMap& priceInfo, QWidget* parentWidget); + static bool setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const TQMap& priceInfo, TQWidget* tqparentWidget); protected: void updateExample(const MyMoneyMoney& price); @@ -73,8 +74,8 @@ protected: protected slots: void slotSetToAmount(void); void slotSetExchangeRate(void); - void slotUpdateResult(const QString& txt); - void slotUpdateRate(const QString& txt); + void slotUpdateResult(const TQString& txt); + void slotUpdateRate(const TQString& txt); virtual void accept(void); private: diff --git a/kmymoney2/dialogs/kcurrencycalculatordecl.ui b/kmymoney2/dialogs/kcurrencycalculatordecl.ui index 688a282..16a8c3f 100644 --- a/kmymoney2/dialogs/kcurrencycalculatordecl.ui +++ b/kmymoney2/dialogs/kcurrencycalculatordecl.ui @@ -1,6 +1,6 @@ KCurrencyCalculatorDecl - + KCurrencyCalculatorDecl @@ -25,7 +25,7 @@ unnamed - + m_amountDateFrame @@ -42,15 +42,15 @@ 0 - + - layout9 + tqlayout9 unnamed - + textLabel3 @@ -58,7 +58,7 @@ Amount - + m_fromAmount @@ -76,14 +76,14 @@ Expanding - + 80 20 - + textLabel2 @@ -91,7 +91,7 @@ Date - + m_dateText @@ -109,7 +109,7 @@ Expanding - + 145 20 @@ -120,15 +120,15 @@ - + - layout9 + tqlayout9 unnamed - + groupBox2_2 @@ -142,7 +142,7 @@ 0 - + m_fromType @@ -150,20 +150,20 @@ Currency - + m_fromCurrencyText xxx - + AlignVCenter|AlignRight - + groupBox3 @@ -177,7 +177,7 @@ 0 - + m_toType @@ -185,14 +185,14 @@ Currency - + m_toCurrencyText xxx - + AlignVCenter|AlignRight @@ -200,9 +200,9 @@ - + - layout14 + tqlayout14 @@ -213,7 +213,7 @@ m_conversionRate - + buttonGroup1 @@ -239,7 +239,7 @@ 0 - + m_amountButton @@ -247,7 +247,7 @@ To amount - + m_rateButton @@ -257,7 +257,7 @@ - + m_dateFrame @@ -277,7 +277,7 @@ 0 - + textLabel1 @@ -292,7 +292,7 @@ - + m_conversionExample @@ -308,7 +308,7 @@ xx - + m_updateButton @@ -329,7 +329,7 @@ xx Expanding - + 20 16 @@ -350,9 +350,9 @@ xx Horizontal - + - layout1 + tqlayout1 @@ -368,7 +368,7 @@ xx Expanding - + 20 20 @@ -410,5 +410,9 @@ xx m_okButton m_cancelButton - + + kmymoney/kmymoneydateinput.h + kmymoney/kmymoneyedit.h + + diff --git a/kmymoney2/dialogs/kcurrencyeditdlg.cpp b/kmymoney2/dialogs/kcurrencyeditdlg.cpp index 55bac30..aad8f20 100644 --- a/kmymoney2/dialogs/kcurrencyeditdlg.cpp +++ b/kmymoney2/dialogs/kcurrencyeditdlg.cpp @@ -25,13 +25,13 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -56,8 +56,8 @@ #include "../widgets/kmymoneypriceview.h" -KCurrencyEditDlg::KCurrencyEditDlg(QWidget *parent, const char *name ) : - KCurrencyEditDlgDecl(parent,name) +KCurrencyEditDlg::KCurrencyEditDlg(TQWidget *tqparent, const char *name ) : + KCurrencyEditDlgDecl(tqparent,name) { m_currencyList->addColumn(i18n("Currency")); m_currencyList->header()->hide(); @@ -65,18 +65,18 @@ KCurrencyEditDlg::KCurrencyEditDlg(QWidget *parent, const char *name ) : // FIXME: the online source table currently has no functionality m_onlineSourceTable->hide(); - connect(m_currencyList, SIGNAL(rightButtonPressed(QListViewItem* , const QPoint&, int)), - this, SLOT(slotListClicked(QListViewItem*, const QPoint&, int))); - connect(m_currencyList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectCurrency(QListViewItem*))); + connect(m_currencyList, TQT_SIGNAL(rightButtonPressed(TQListViewItem* , const TQPoint&, int)), + this, TQT_SLOT(slotListClicked(TQListViewItem*, const TQPoint&, int))); + connect(m_currencyList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectCurrency(TQListViewItem*))); - connect(m_currencyList, SIGNAL(itemRenamed(QListViewItem*,int,const QString&)), this, SIGNAL(renameCurrency(QListViewItem*,int,const QString&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadCurrencies())); + connect(m_currencyList, TQT_SIGNAL(itemRenamed(TQListViewItem*,int,const TQString&)), this, TQT_SIGNAL(renameCurrency(TQListViewItem*,int,const TQString&))); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadCurrencies())); slotLoadCurrencies(); - connect(m_baseCurrencyButton, SIGNAL(clicked()), this, SLOT(slotSelectBaseCurrency())); - connect(buttonClose, SIGNAL(clicked()), this, SLOT(slotClose())); + connect(m_baseCurrencyButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectBaseCurrency())); + connect(buttonClose, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClose())); // FIXME: currently, no online help available buttonHelp->hide(); @@ -85,14 +85,14 @@ KCurrencyEditDlg::KCurrencyEditDlg(QWidget *parent, const char *name ) : m_description->hide(); resize(width()-1, height()-1); - QTimer::singleShot(10, this, SLOT(timerDone())); + TQTimer::singleShot(10, this, TQT_SLOT(timerDone())); } void KCurrencyEditDlg::timerDone(void) { if(!m_currency.id().isEmpty()) { - QListViewItemIterator it(m_currencyList); - QListViewItem* q; + TQListViewItemIterator it(m_currencyList); + TQListViewItem* q; while((q = it.current()) != 0) { KMyMoneyListViewItem* p = static_cast(q); if(p->id() == m_currency.id()) { @@ -113,7 +113,7 @@ KCurrencyEditDlg::~KCurrencyEditDlg() { } -void KCurrencyEditDlg::resizeEvent(QResizeEvent* /* e*/) +void KCurrencyEditDlg::resizeEvent(TQResizeEvent* /* e*/) { int w = m_currencyList->visibleWidth(); @@ -122,25 +122,25 @@ void KCurrencyEditDlg::resizeEvent(QResizeEvent* /* e*/) void KCurrencyEditDlg::slotLoadCurrencies(void) { - QValueList list = MyMoneyFile::instance()->currencyList(); - QValueList::ConstIterator it; - QListViewItem *first = 0; + TQValueList list = MyMoneyFile::instance()->currencyList(); + TQValueList::ConstIterator it; + TQListViewItem *first = 0; - QString localCurrency(localeconv()->int_curr_symbol); + TQString localCurrency(localeconv()->int_curr_symbol); localCurrency.truncate(3); - QString baseCurrency = MyMoneyFile::instance()->baseCurrency().id(); + TQString baseCurrency = MyMoneyFile::instance()->baseCurrency().id(); // construct a transparent 16x16 pixmap - QPixmap empty(16, 16); - empty.setMask(QBitmap(16, 16, true)); + TQPixmap empty(16, 16); + empty.setMask(TQBitmap(16, 16, true)); m_currencyList->clear(); for(it = list.begin(); it != list.end(); ++it) { - KMyMoneyListViewItem* p = new KMyMoneyListViewItem(m_currencyList, (*it).name(), QString(), (*it).id()); + KMyMoneyListViewItem* p = new KMyMoneyListViewItem(m_currencyList, (*it).name(), TQString(), (*it).id()); p->setRenameEnabled(0, true); if((*it).id() == baseCurrency) { - p->setPixmap(0, QPixmap( locate("icon","hicolor/16x16/apps/kmymoney2.png"))); + p->setPixmap(0, TQPixmap( locate("icon","hicolor/16x16/apps/kmymoney2.png"))); if(m_currency.id().isEmpty()) first = p; } else { @@ -182,9 +182,9 @@ void KCurrencyEditDlg::updateCurrency(void) } } -void KCurrencyEditDlg::slotSelectCurrency(const QString& id) +void KCurrencyEditDlg::slotSelectCurrency(const TQString& id) { - QListViewItemIterator it(m_currencyList); + TQListViewItemIterator it(m_currencyList); while(it.current()) { KMyMoneyListViewItem* p = static_cast(it.current()); @@ -198,17 +198,17 @@ void KCurrencyEditDlg::slotSelectCurrency(const QString& id) } } -void KCurrencyEditDlg::slotSelectCurrency(QListViewItem *item) +void KCurrencyEditDlg::slotSelectCurrency(TQListViewItem *item) { - QMap history; + TQMap history; MyMoneyFile* file = MyMoneyFile::instance(); updateCurrency(); m_detailGroup->setEnabled(item != 0); m_onlineSourceTable->clear(); - m_idLabel->setText(QString()); - m_symbolEdit->setText(QString()); + m_idLabel->setText(TQString()); + m_symbolEdit->setText(TQString()); if(item) { try { @@ -221,8 +221,8 @@ void KCurrencyEditDlg::slotSelectCurrency(QListViewItem *item) delete e; m_currency = MyMoneySecurity(); m_onlineSourceTable->clear(); - m_idLabel->setText(QString()); - m_symbolEdit->setText(QString()); + m_idLabel->setText(TQString()); + m_symbolEdit->setText(TQString()); } m_baseCurrencyButton->setDisabled(m_currency.id() == file->baseCurrency().id()); emit selectObject(m_currency); @@ -237,20 +237,20 @@ void KCurrencyEditDlg::slotClose(void) void KCurrencyEditDlg::slotStartRename(void) { - QListViewItemIterator it_l(m_currencyList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_currencyList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; if((it_v = it_l.current()) != 0) { it_v->startRename(0); } } -void KCurrencyEditDlg::slotListClicked(QListViewItem* item, const QPoint&, int) +void KCurrencyEditDlg::slotListClicked(TQListViewItem* item, const TQPoint&, int) { slotSelectCurrency(item); emit openContextMenu(m_currency); } -void KCurrencyEditDlg::slotRenameCurrency(QListViewItem* item, int /* col */, const QString& txt) +void KCurrencyEditDlg::slotRenameCurrency(TQListViewItem* item, int /* col */, const TQString& txt) { MyMoneyFile* file = MyMoneyFile::instance(); KMyMoneyListViewItem* p = static_cast(item); @@ -279,7 +279,7 @@ void KCurrencyEditDlg::slotRenameCurrency(QListViewItem* item, int /* col */, co void KCurrencyEditDlg::slotSelectBaseCurrency(void) { if(!m_currency.id().isEmpty()) { - QListViewItem* p = m_currencyList->selectedItem(); + TQListViewItem* p = m_currencyList->selectedItem(); emit selectBaseCurrency(m_currency); // in case the dataChanged() signal was not sent out (nested FileTransaction) // we update the list manually diff --git a/kmymoney2/dialogs/kcurrencyeditdlg.h b/kmymoney2/dialogs/kcurrencyeditdlg.h index f1a4871..5a1e00f 100644 --- a/kmymoney2/dialogs/kcurrencyeditdlg.h +++ b/kmymoney2/dialogs/kcurrencyeditdlg.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,25 +46,26 @@ class KPopupMenu; class KCurrencyEditDlg : public KCurrencyEditDlgDecl { Q_OBJECT + TQ_OBJECT public: - KCurrencyEditDlg(QWidget *parent=0, const char *name=0); + KCurrencyEditDlg(TQWidget *tqparent=0, const char *name=0); ~KCurrencyEditDlg(); public slots: - void slotSelectCurrency(const QString& id); + void slotSelectCurrency(const TQString& id); protected: /// the resize event - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); void updateCurrency(void); protected slots: - void slotSelectCurrency(QListViewItem *); + void slotSelectCurrency(TQListViewItem *); void slotClose(void); void slotStartRename(void); - void slotListClicked(QListViewItem* item, const QPoint&, int); - void slotRenameCurrency(QListViewItem* item, int col, const QString& txt); + void slotListClicked(TQListViewItem* item, const TQPoint&, int); + void slotRenameCurrency(TQListViewItem* item, int col, const TQString& txt); void slotLoadCurrencies(void); private slots: @@ -74,7 +75,7 @@ private slots: signals: void selectObject(const MyMoneySecurity& currency); void openContextMenu(const MyMoneySecurity& currency); - void renameCurrency(QListViewItem* item, int, const QString& txt); + void renameCurrency(TQListViewItem* item, int, const TQString& txt); void selectBaseCurrency(const MyMoneySecurity& currency); private: diff --git a/kmymoney2/dialogs/kcurrencyeditdlgdecl.ui b/kmymoney2/dialogs/kcurrencyeditdlgdecl.ui index 4a0a740..6c4a50c 100644 --- a/kmymoney2/dialogs/kcurrencyeditdlgdecl.ui +++ b/kmymoney2/dialogs/kcurrencyeditdlgdecl.ui @@ -1,6 +1,6 @@ KCurrencyEditDlgDecl - + KCurrencyEditDlgDecl @@ -22,17 +22,17 @@ unnamed - + - layout6 + tqlayout6 unnamed - + - layout5 + tqlayout5 @@ -43,7 +43,7 @@ m_currencyList - + m_baseCurrencyFrame @@ -60,9 +60,9 @@ 0 - + - layout4 + tqlayout4 @@ -78,7 +78,7 @@ Expanding - + 51 21 @@ -103,7 +103,7 @@ Expanding - + 61 31 @@ -116,7 +116,7 @@ - + m_detailGroup @@ -127,15 +127,15 @@ unnamed - + - layout4 + tqlayout4 unnamed - + textLabel3 @@ -143,7 +143,7 @@ Symbol - + m_idLabel @@ -156,7 +156,7 @@ m_symbolEdit - + textLabel1 @@ -166,7 +166,7 @@ - + m_description @@ -205,7 +205,7 @@ - + Layout1 @@ -219,7 +219,7 @@ 6 - + buttonHelp @@ -246,14 +246,14 @@ Expanding - + 20 20 - + buttonClose @@ -300,5 +300,5 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000042149444154789c8d95c18b1c4514c67fbb29e5b54ea05b26da1d36b08d096e8b11261871837bc8e282ac7ac82187e049a317e32d37110992bf42123c694eea414c0e0bf1b0ec6c402139485a54e8810c54c10e741146fa110bd643f74c12bd642e4d75f77cf5d5ef7dafdfc2ce7087d9eff32fdfdff74e5114104011e489d6e952cce5cfbe5998692dec0c77b87aedd3fddd9f2b3efce02291082209aa3504685022e4ffd7a000a82a765c515615ce95acae659c3f7765c100ec6e575cf8f822e991025f3b6a6f890c484f181ccfc1583428f5d4e2fe84da039aa04121b40eb32483a0ec6e5bce9f8385d36fa7fb9b1b17c8f31cbfe7a95c45be94520c72b2141a1caa160d1666e24ea94aa11ee7685054159d2ada34d41387c40dc63b8844f0b5c73a4bb19cb3f9de001f2aac1fa23aa209168c004224902e29d22ff1e38abbdb275055c4800610233867311a1491847a62c98f66ac6f14d8e99072f22daa15b68a8108424d6422e24c88e3966fbce4c9d786945b27f0be0103ed13c16004d59a2c4d58df28a87548e9aee2274ab95d60c7193c9a0281fc959ae2a4450364a9e2572c7a2b43438374ef2dd2154012d050514dbec7396578a3130d9d6850066f0ad9d186f2d78cdbbb799b0a202f2c48d3aebbb418310240b112637588574bf54b8efaa4fd9b691dacbf5b305813542bae63a9eee4c4694d967b5494eca8c7ef0933bdc5d90e6a2caa0e3f013b7adce9fa5b03d637561113a30106a71d18c5fd9677058338ad01e91c0b8b743b880182ce19cd9c0e5e2b583fbdda565d3d04cfedad180942133af201b2bc3588e111c680068f489780ce69b192b279768088524f2b3458ea694d3de99a4323bc976ed34eb86b98c51993f6be10f77240c99685cd731991f1582df15aa15a213d583f5313a7806988fb8a0640e336359d9e9933568bf44062214ba19e2a7652a13d8b068ff596b807182189234e9da9f1ceb78c81b28c3ac6fe21e306c58e41d5118952acd6a0c2f56b9e6a5c72f346cdcd6b19a3bf8010010d714f89533b674c90c7189b598eab12a45fb5c75b8253672b863fbcccf5af93b6904119fe9851bf5153ac3a746ae7b9d5698c1dc58f313e70e4707ce9d84bafa2f79fc23fb8c7c1438ef04031a2642fee21060ec69ee47020796ecaa12313ccd333d1b67935047acf2be3bb11aa010dbe656cc755dbe3b772084a7ebc6d5711253b593dfcc0cc8fcd3cafda455512c7f200ec56cbfac0f1d7d34b7fdf0f98fd88a92a7e9cb0e70cc933c0b38a2c823ea0bd76c70c016adb67f47bc2a117a6d40abeea33fa23c2fb867edfb413e4a34fded94ffb3991c46dc7754cd3634ad2af490b857f5a5137126a97e02a8120a485235b6a28ef80bd077ee2b9f2d54fed04595dcbd8ddb6c4bd87334c10cadb2064e856177e7864e669fbe1df154a0142839f7ad2e5b6880bff1da66eece78e315d959f609da670f98befe6c3f45fb42672c9acff7f660000000049454e44ae426082 - + diff --git a/kmymoney2/dialogs/keditequityentrydecl.ui b/kmymoney2/dialogs/keditequityentrydecl.ui index 4acf703..baa92c9 100644 --- a/kmymoney2/dialogs/keditequityentrydecl.ui +++ b/kmymoney2/dialogs/keditequityentrydecl.ui @@ -1,7 +1,7 @@ KEditEquityEntryDecl Kevin Tambascio - + KEditEquityEntryDecl @@ -23,9 +23,9 @@ unnamed - + - layout6 + tqlayout6 @@ -56,7 +56,7 @@ cmbInvestmentType - + textLabel2 @@ -64,15 +64,15 @@ Smallest fraction: - + - layout4 + tqlayout4 unnamed - + textLabel1 @@ -87,7 +87,7 @@ 1 / - + AlignVCenter|AlignRight @@ -98,7 +98,7 @@ - + lblType @@ -106,7 +106,7 @@ Investment Type: - + lblEquityName @@ -119,7 +119,7 @@ edtMarketSymbol - + lblSymbol @@ -129,7 +129,7 @@ - + groupBox1 @@ -145,9 +145,9 @@ kpvPriceHistory - + - layout6 + tqlayout6 @@ -163,7 +163,7 @@ Expanding - + 21 21 @@ -204,7 +204,7 @@ Expanding - + 21 21 @@ -215,9 +215,9 @@ - + - layout5 + tqlayout5 @@ -233,7 +233,7 @@ Expanding - + 238 21 @@ -302,5 +302,5 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000030149444154789cb59531681b5718c77f0e377c070e3c810a3a70e0041eac51852e0a19e45134830a1d9a4c69a04bc8928e990a693a640e1d0c8642b08742321894c1507991b484c890902bb8701a047760c3bd21701fe4201dde49b6a41a32b8df72dcbbeffdbefffbbfefbd5b1b0c07cce266ebe667ae2006c3c1dada0cdc3be87d6e6c35b0d692a409d9c7ec8b20d65ae29398d19b1114e7e3de4ce98b3f5e10dc0053cf0951b4506496e1b964bf7ce6c585d9054c62d01d617ca48be0596553cf496d8f2c8b01c5f795fc93904e85ec4c01a152857a5d9175d0b2805c872080f18595ccc1499a10a225d4e2fbc2877786fe81253ab6c04c8d106e09db5d43ab0d146e5c64d1a23938fb98a185cea1c33eecfd9eba49eb427dcb201e245365f2b7b2fb5b4a3a31dcb927178afe07d86901df870fefa4842aed6f6b74ba42e52b4014d580e1eb9cbd9d94de7e4aad16d2f9be02d805f0b5e532f927a1ffcacea1777f122a8105b164a7c25faf323a5d9f1f1fd600e1e5bec59e2d4b5c7ef5209d0ad17b8b31864e57c0b3e0815ac3ee33253ab664a770ff5185d1a1cb8d2267d3e58aa1dc7d2508cbe597d0e74fdd269aaaf0f52d414c4ea3e9762c996869e42560d7a72e41c4799a2586e74f95e8d8151481fa86efbe7b3398ac58b1a2b8527589f15451ad303ac2293542ad6648a796278f13a27185e4c4754310facb98c53a79e19a3fdc1426ff28c3d7399d1f7cb25343eb96106cf83c790ce9c4f2eb831855c55485663327992eb6dc8a6259874ed700b0b793323cccb9ffa842b30d6133e3e75fea989ac15a8b16ca76b746b0b92278d919774c5b6d48a78697fb29bbcf52468742a32120909c24e899ce67beed5be2db01e22d1e9485bb620e47f9ee9e606a21bd3f5d3744c7e7c54d55e87443867d8b554515ac5db4620e8e4f62263170fd1cdee90aad7640141992891b0f367c9adfe4049bb07d3b7022bd8c687c0978f46684ee084150b65ac1fcca94591b7a90a496e4c095164fb016a2b192a497795cc0f84817aebe25f7bf70ccc54a575c555c03f78ffa5fc0570d1f0c076bff0232285a0901e2257b0000000049454e44ae426082 - + diff --git a/kmymoney2/dialogs/keditequityentrydlg.cpp b/kmymoney2/dialogs/keditequityentrydlg.cpp index 854ce9a..ef9ed84 100644 --- a/kmymoney2/dialogs/keditequityentrydlg.cpp +++ b/kmymoney2/dialogs/keditequityentrydlg.cpp @@ -22,7 +22,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -40,27 +40,27 @@ #include "kupdatestockpricedlg.h" #include "../widgets/kmymoneypriceview.h" -KEditEquityEntryDlg::KEditEquityEntryDlg(const MyMoneySecurity& selectedSecurity, QWidget *parent, const char *name) - : KEditEquityEntryDecl(parent, name, true) +KEditEquityEntryDlg::KEditEquityEntryDlg(const MyMoneySecurity& selectedSecurity, TQWidget *tqparent, const char *name) + : KEditEquityEntryDecl(tqparent, name, true) { m_selectedSecurity = selectedSecurity; - connect(btnOK, SIGNAL(clicked()), this, SLOT(slotOKClicked())); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(edtEquityName, SIGNAL(textChanged(const QString &)), this, SLOT(slotDataChanged())); - connect(edtMarketSymbol, SIGNAL(textChanged(const QString &)), this, SLOT(slotDataChanged())); - connect(edtFraction, SIGNAL(textChanged(const QString&)), this, SLOT(slotDataChanged())); - connect(btnAddEntry, SIGNAL(clicked()), kpvPriceHistory, SLOT(slotAddPrice())); - connect(btnEditEntry, SIGNAL(clicked()), kpvPriceHistory, SLOT(slotEditPrice())); - connect(btnRemoveEntry, SIGNAL(clicked()), kpvPriceHistory, SLOT(slotDeletePrice())); - connect(kpvPriceHistory, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectionChanged(QListViewItem*))); + connect(btnOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOKClicked())); + connect(btnCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(edtEquityName, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotDataChanged())); + connect(edtMarketSymbol, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotDataChanged())); + connect(edtFraction, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotDataChanged())); + connect(btnAddEntry, TQT_SIGNAL(clicked()), kpvPriceHistory, TQT_SLOT(slotAddPrice())); + connect(btnEditEntry, TQT_SIGNAL(clicked()), kpvPriceHistory, TQT_SLOT(slotEditPrice())); + connect(btnRemoveEntry, TQT_SIGNAL(clicked()), kpvPriceHistory, TQT_SLOT(slotDeletePrice())); + connect(kpvPriceHistory, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectionChanged(TQListViewItem*))); //fill in the fields with what we know. edtEquityName->setText(m_selectedSecurity.name()); edtMarketSymbol->setText(m_selectedSecurity.tradingSymbol()); edtFraction->setPrecision(0); edtFraction->setCalculatorButtonVisible(false); - edtFraction->loadText(QString::number(m_selectedSecurity.smallestAccountFraction())); + edtFraction->loadText(TQString::number(m_selectedSecurity.smallestAccountFraction())); cmbInvestmentType->setCurrentItem((int)m_selectedSecurity.securityType()); // FIXME PRICE // kpvPriceHistory->setHistory(m_selectedSecurity.priceHistory()); @@ -73,7 +73,7 @@ KEditEquityEntryDlg::KEditEquityEntryDlg(const MyMoneySecurity& selectedSecurity btnAddEntry->setGuiItem(KStdGuiItem::add()); KGuiItem editButtenItem( i18n( "&Edit" ), - QIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), i18n("Modify the selected entry"), i18n("Change the price information of the selected entry.")); btnEditEntry->setGuiItem(editButtenItem); @@ -82,9 +82,9 @@ KEditEquityEntryDlg::KEditEquityEntryDlg(const MyMoneySecurity& selectedSecurity slotDataChanged(); m_changes = false; - // force a resize to optimize the layout of all widgets + // force a resize to optimize the tqlayout of all widgets resize(width()-1, height()-1); - QTimer::singleShot(10, this, SLOT(slotTimerDone())); + TQTimer::singleShot(10, this, TQT_SLOT(slotTimerDone())); } KEditEquityEntryDlg::~KEditEquityEntryDlg() @@ -115,7 +115,7 @@ void KEditEquityEntryDlg::slotOKClicked() accept(); } -void KEditEquityEntryDlg::slotSelectionChanged(QListViewItem* item) +void KEditEquityEntryDlg::slotSelectionChanged(TQListViewItem* item) { btnEditEntry->setEnabled(item != 0); btnRemoveEntry->setEnabled(item != 0); diff --git a/kmymoney2/dialogs/keditequityentrydlg.h b/kmymoney2/dialogs/keditequityentrydlg.h index 0fdf40e..ae9dc58 100644 --- a/kmymoney2/dialogs/keditequityentrydlg.h +++ b/kmymoney2/dialogs/keditequityentrydlg.h @@ -20,13 +20,13 @@ * * ***************************************************************************/ -#ifndef KEDITEQUITYENTRYDLG_H -#define KEDITEQUITYENTRYDLG_H +#ifndef KEDITETQUITYENTRYDLG_H +#define KEDITETQUITYENTRYDLG_H // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -47,8 +47,9 @@ class KEditEquityEntryDlg : public KEditEquityEntryDecl { Q_OBJECT + TQ_OBJECT public: - KEditEquityEntryDlg(const MyMoneySecurity& selectedSecurity, QWidget *parent = NULL, const char *name = NULL); + KEditEquityEntryDlg(const MyMoneySecurity& selectedSecurity, TQWidget *tqparent = NULL, const char *name = NULL); ~KEditEquityEntryDlg(); void updatedEquity(MyMoneySecurity& security) { security = m_selectedSecurity; } @@ -56,7 +57,7 @@ public: protected slots: void slotOKClicked(); void slotDataChanged(void); - void slotSelectionChanged(QListViewItem* item); + void slotSelectionChanged(TQListViewItem* item); private slots: void slotTimerDone(void); diff --git a/kmymoney2/dialogs/keditloanwizard.cpp b/kmymoney2/dialogs/keditloanwizard.cpp index 6054cec..3992550 100644 --- a/kmymoney2/dialogs/keditloanwizard.cpp +++ b/kmymoney2/dialogs/keditloanwizard.cpp @@ -23,9 +23,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -48,19 +48,19 @@ #include "../mymoney/mymoneyfile.h" #include "../kmymoneyutils.h" -KEditLoanWizard::KEditLoanWizard(const MyMoneyAccount& account, QWidget *parent, const char *name ) : - KNewLoanWizard(parent, name) +KEditLoanWizard::KEditLoanWizard(const MyMoneyAccount& account, TQWidget *tqparent, const char *name ) : + KNewLoanWizard(tqparent, name) { MyMoneyFile* file = MyMoneyFile::instance(); setCaption(i18n("Edit loan wizard")); - m_effectiveDateLabel->setText(QString("\n") + i18n( + m_effectiveDateLabel->setText(TQString("\n") + i18n( "Please enter the date from which on the following changes will be effective. " "The date entered must be later than the opening date of this account (%1), but must " - "not be in the future. The default will be today.").arg(KGlobal::locale()->formatDate(account.openingDate(), true))); + "not be in the future. The default will be today.").tqarg(KGlobal::locale()->formatDate(account.openingDate(), true))); m_account = account; try { - QString id = m_account.value("schedule"); + TQString id = m_account.value("schedule"); m_schedule = file->schedule(id); } catch (MyMoneyException *e) { delete e; @@ -71,11 +71,11 @@ KEditLoanWizard::KEditLoanWizard(const MyMoneyAccount& account, QWidget *parent, loadWidgets(m_account); - if(m_account.openingDate() > QDate::currentDate()) { - m_effectiveDateNoteLabel->setText(QString("\n") + i18n( + if(m_account.openingDate() > TQDate::tqcurrentDate()) { + m_effectiveDateNoteLabel->setText(TQString("\n") + i18n( "Note: you will not be able to modify this account today, because the opening date \"%1\" is in the future. " "Please revisit this dialog when the time has come." - ).arg(KGlobal::locale()->formatDate(m_account.openingDate(), true))); + ).tqarg(KGlobal::locale()->formatDate(m_account.openingDate(), true))); } else { m_effectiveDateNoteLabel->hide(); } @@ -94,9 +94,9 @@ KEditLoanWizard::KEditLoanWizard(const MyMoneyAccount& account, QWidget *parent, setAppropriate(m_editSelectionPage, true); // setup connections - connect(m_effectiveChangeDateEdit, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotCheckPageFinished())); - connect(m_newPaymentEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished())); - connect(m_newInterestRateEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished())); + connect(m_effectiveChangeDateEdit, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotCheckPageFinished())); + connect(m_newPaymentEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished())); + connect(m_newInterestRateEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished())); // make sure, we show the correct start page showPage(m_editIntroPage); @@ -109,7 +109,7 @@ KEditLoanWizard::~KEditLoanWizard() void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */) { MyMoneyFile* file = MyMoneyFile::instance(); - QString paymentAccountId, interestAccountId; + TQString paymentAccountId, interestAccountId; m_nameEdit->loadText(m_account.name()); m_loanAmountEdit->loadText(m_account.loanAmount().formatMoney(m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId())))); @@ -123,15 +123,15 @@ void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */) } MyMoneyMoney ir; - if(m_schedule.startDate() > QDate::currentDate()) { + if(m_schedule.startDate() > TQDate::tqcurrentDate()) { ir = m_account.interestRate(m_schedule.startDate()); } else { - ir = m_account.interestRate(QDate::currentDate()); + ir = m_account.interestRate(TQDate::tqcurrentDate()); } m_interestRateEdit->loadText(ir.formatMoney("", 3)); m_newInterestRateEdit->loadText(ir.formatMoney("", 3)); m_newInterestRateEdit->setPrecision(3); - m_interestRateLabel->setText(QString(" ") + ir.formatMoney("", 3) + QString("%")); + m_interestRateLabel->setText(TQString(" ") + ir.formatMoney("", 3) + TQString("%")); m_paymentFrequencyUnitEdit->setCurrentItem(i18n(m_schedule.occurenceToString())); updateTermWidgets(m_account.term()); @@ -144,7 +144,7 @@ void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */) m_transaction = m_schedule.transaction(); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = m_schedule.transaction().splits().begin(); it_s != m_schedule.transaction().splits().end(); ++it_s) { @@ -210,7 +210,7 @@ void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */) int fraction = m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId())); m_paymentEdit->loadText(basePayment.formatMoney(fraction)); m_newPaymentEdit->loadText(basePayment.formatMoney(fraction)); - m_paymentLabel->setText(QString(" ") + basePayment.formatMoney(fraction)); + m_paymentLabel->setText(TQString(" ") + basePayment.formatMoney(fraction)); m_additionalCost->setText(addPayment.formatMoney(fraction)); m_interestAccountEdit->setSelected(interestAccountId); @@ -234,16 +234,16 @@ void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */) void KEditLoanWizard::next() { bool dontLeavePage = false; - QButton* button = m_selectionButtonGroup->find(m_lastSelection); + TQButton* button = m_selectionButtonGroup->tqfind(m_lastSelection); if(currentPage() == m_editSelectionPage) { if(button != 0 && m_lastSelection != m_selectionButtonGroup->id(m_selectionButtonGroup->selected())) { - QString errMsg = i18n( + TQString errMsg = i18n( "Your previous selection was \"%1\". If you select another option, " "KMyMoney will dismiss the changes you have just entered. " - "Do you wish to proceed?").arg(button->text()); + "Do you wish to proceed?").tqarg(button->text()); if(KMessageBox::questionYesNo(this, errMsg) == KMessageBox::No) { dontLeavePage = true; @@ -363,12 +363,12 @@ void KEditLoanWizard::next() // now and always calculate with the full loan amount. MyMoneyMoney balance = m_account.openingBalance(); - QValueList list; - QValueList::ConstIterator it; + TQValueList list; + TQValueList::ConstIterator it; MyMoneySplit split; MyMoneyTransactionFilter filter(m_account.id()); - filter.setDateFilter(QDate(), m_effectiveChangeDateEdit->date().addDays(-1)); + filter.setDateFilter(TQDate(), m_effectiveChangeDateEdit->date().addDays(-1)); list = MyMoneyFile::instance()->transactionList(filter); for(it = list.begin(); it != list.end(); ++it) { @@ -417,7 +417,7 @@ void KEditLoanWizard::slotCheckPageFinished(void) if(currentPage() == m_effectiveDatePage) { if(m_effectiveChangeDateEdit->date() < m_account.openingDate() - || m_effectiveChangeDateEdit->date() > QDate::currentDate()) + || m_effectiveChangeDateEdit->date() > TQDate::tqcurrentDate()) nextButton()->setEnabled(false); } else if(currentPage() == m_interestEditPage) { @@ -438,15 +438,15 @@ void KEditLoanWizard::updateEditSummary(void) // calculate the number of affected transactions MyMoneyTransactionFilter filter(m_account.id()); - filter.setDateFilter(m_effectiveChangeDateEdit->date(), QDate()); + filter.setDateFilter(m_effectiveChangeDateEdit->date(), TQDate()); int count = 0; - QValueList list; - QValueList::ConstIterator it; + TQValueList list; + TQValueList::ConstIterator it; list = MyMoneyFile::instance()->transactionList(filter); for(it = list.begin(); it != list.end(); ++it) { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; int match = 0; for(it_s = (*it).splits().begin(); it_s != (*it).splits().end(); ++it_s) { // we only count those transactions that have an interest @@ -460,7 +460,7 @@ void KEditLoanWizard::updateEditSummary(void) count++; } - m_affectedPayments->setText(QString().sprintf("%d", count)); + m_affectedPayments->setText(TQString().sprintf("%d", count)); } const MyMoneySchedule KEditLoanWizard::schedule(void) const @@ -503,7 +503,7 @@ const MyMoneyAccount KEditLoanWizard::account(void) const const MyMoneyTransaction KEditLoanWizard::transaction() const { MyMoneyTransaction t = KNewLoanWizard::transaction(); - MyMoneySplit s = t.splitByAccount(QString("Phony-ID")); + MyMoneySplit s = t.splitByAccount(TQString("Phony-ID")); s.setAccountId(m_account.id()); t.modifySplit(s); diff --git a/kmymoney2/dialogs/keditloanwizard.h b/kmymoney2/dialogs/keditloanwizard.h index 0598248..f2efbdf 100644 --- a/kmymoney2/dialogs/keditloanwizard.h +++ b/kmymoney2/dialogs/keditloanwizard.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -44,8 +44,9 @@ class KEditLoanWizard : public KNewLoanWizard { Q_OBJECT + TQ_OBJECT public: - KEditLoanWizard(const MyMoneyAccount& account, QWidget *parent=0, const char *name=0); + KEditLoanWizard(const MyMoneyAccount& account, TQWidget *tqparent=0, const char *name=0); ~KEditLoanWizard(); /** diff --git a/kmymoney2/dialogs/keditscheduledlg.cpp b/kmymoney2/dialogs/keditscheduledlg.cpp index 635d564..559fddd 100644 --- a/kmymoney2/dialogs/keditscheduledlg.cpp +++ b/kmymoney2/dialogs/keditscheduledlg.cpp @@ -18,12 +18,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -55,13 +55,13 @@ class KEditScheduleDlg::Private { public: MyMoneySchedule m_schedule; KMyMoneyRegister::Transaction* m_item; - QWidgetList m_tabOrderWidgets; + TQWidgetList m_tabOrderWidgets; TransactionEditor* m_editor; kMandatoryFieldGroup* m_requiredFields; }; -KEditScheduleDlg::KEditScheduleDlg(const MyMoneySchedule& schedule, QWidget *parent, const char *name) : - KEditScheduleDlgDecl(parent, name, true), +KEditScheduleDlg::KEditScheduleDlg(const MyMoneySchedule& schedule, TQWidget *tqparent, const char *name) : + KEditScheduleDlgDecl(tqparent, name, true), d(new Private) { d->m_schedule = schedule; @@ -71,12 +71,12 @@ KEditScheduleDlg::KEditScheduleDlg(const MyMoneySchedule& schedule, QWidget *par buttonCancel->setGuiItem(KStdGuiItem::cancel()); buttonHelp->setGuiItem(KStdGuiItem::help()); - d->m_requiredFields = new kMandatoryFieldGroup (this); + d->m_requiredFields = new kMandatoryFieldGroup (TQT_TQOBJECT(this)); d->m_requiredFields->setOkButton(buttonOk); // button to be enabled when all fields present // make sure, we have a tabbar with the form // insert it after the horizontal line - m_paymentInformationLayout->insertWidget(2, m_form->tabBar(m_form->parentWidget())); + m_paymentInformationLayout->insertWidget(2, m_form->tabBar(m_form->tqparentWidget())); // we never need to see the register m_register->hide(); @@ -111,7 +111,7 @@ KEditScheduleDlg::KEditScheduleDlg(const MyMoneySchedule& schedule, QWidget *par m_paymentMethodEdit->insertItem(i18n("Direct debit"), MyMoneySchedule::STYPE_DIRECTDEBIT); m_paymentMethodEdit->insertItem(i18n("Standing order"), MyMoneySchedule::STYPE_STANDINGORDER); m_paymentMethodEdit->insertItem(i18n("Bank transfer"), MyMoneySchedule::STYPE_BANKTRANSFER); - m_paymentMethodEdit->insertItem(i18n("Write check"), MyMoneySchedule::STYPE_WRITECHEQUE); + m_paymentMethodEdit->insertItem(i18n("Write check"), MyMoneySchedule::STYPE_WRITECHETQUE); m_paymentMethodEdit->insertItem(i18n("Other"), MyMoneySchedule::STYPE_OTHER); MyMoneySchedule::paymentTypeE method = d->m_schedule.paymentType(); @@ -140,18 +140,18 @@ KEditScheduleDlg::KEditScheduleDlg(const MyMoneySchedule& schedule, QWidget *par m_FinalPaymentEdit->setDate(d->m_schedule.endDate()); } - connect(m_RemainingEdit, SIGNAL(valueChanged(int)), - this, SLOT(slotRemainingChanged(int))); - connect(m_FinalPaymentEdit, SIGNAL(dateChanged(const QDate&)), - this, SLOT(slotEndDateChanged(const QDate&))); - connect(m_frequencyEdit, SIGNAL(itemSelected(int)), - this, SLOT(slotFrequencyChanged(int))); - connect(m_frequencyNoEdit, SIGNAL(valueChanged(int)), - this, SLOT(slotOccurenceMultiplierChanged(int))); - connect(buttonHelp, SIGNAL(clicked()), this, SLOT(slotShowHelp())); + connect(m_RemainingEdit, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotRemainingChanged(int))); + connect(m_FinalPaymentEdit, TQT_SIGNAL(dateChanged(const TQDate&)), + this, TQT_SLOT(slotEndDateChanged(const TQDate&))); + connect(m_frequencyEdit, TQT_SIGNAL(itemSelected(int)), + this, TQT_SLOT(slotFrequencyChanged(int))); + connect(m_frequencyNoEdit, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotOccurenceMultiplierChanged(int))); + connect(buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotShowHelp())); // force the initial height to be as small as possible - QTimer::singleShot(0, this, SLOT(slotSetupSize())); + TQTimer::singleShot(0, this, TQT_SLOT(slotSetupSize())); // we just hide the variation field for now and enable the logic // once we have a respective member in the MyMoneySchedule object @@ -165,13 +165,13 @@ KEditScheduleDlg::~KEditScheduleDlg() void KEditScheduleDlg::slotSetupSize(void) { - resize(width(), minimumSizeHint().height()); + resize(width(), tqminimumSizeHint().height()); } TransactionEditor* KEditScheduleDlg::startEdit(void) { KMyMoneyRegister::SelectedTransactions list(m_register); - TransactionEditor* editor = d->m_item->createEditor(m_form, list, QDate()); + TransactionEditor* editor = d->m_item->createEditor(m_form, list, TQDate()); // check that we use the same transaction commodity in all selected transactions // if not, we need to update this in the editor's list. The user can also bail out @@ -186,18 +186,18 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) } if(editor) { - connect(editor, SIGNAL(transactionDataSufficient(bool)), buttonOk, SLOT(setEnabled(bool))); - connect(editor, SIGNAL(escapePressed()), buttonCancel, SLOT(animateClick())); - connect(editor, SIGNAL(returnPressed()), buttonOk, SLOT(animateClick())); - - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), editor, SLOT(slotReloadEditWidgets())); - // connect(editor, SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&))); - connect(editor, SIGNAL(createPayee(const QString&, QString&)), kmymoney2, SLOT(slotPayeeNew(const QString&, QString&))); - connect(editor, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); - connect(editor, SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), editor, SLOT(slotReloadEditWidgets())); - - // create the widgets, place them in the parent and load them with data + connect(editor, TQT_SIGNAL(transactionDataSufficient(bool)), buttonOk, TQT_SLOT(setEnabled(bool))); + connect(editor, TQT_SIGNAL(escapePressed()), buttonCancel, TQT_SLOT(animateClick())); + connect(editor, TQT_SIGNAL(returnPressed()), buttonOk, TQT_SLOT(animateClick())); + + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), editor, TQT_SLOT(slotReloadEditWidgets())); + // connect(editor, TQT_SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&))); + connect(editor, TQT_SIGNAL(createPayee(const TQString&, TQString&)), kmymoney2, TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + connect(editor, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(editor, TQT_SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), editor, TQT_SLOT(slotReloadEditWidgets())); + + // create the widgets, place them in the tqparent and load them with data // setup tab order d->m_tabOrderWidgets.clear(); KMyMoneyRegister::Action action = KMyMoneyRegister::ActionWithdrawal; @@ -216,7 +216,7 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) // into the transaction and determine the type. in case we don't have a transaction with splits // we stick with the default action already set up if(d->m_schedule.transaction().splits().count() > 0) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; bool isDeposit = false; bool isTransfer = false; for(it_s = d->m_schedule.transaction().splits().begin(); it_s != d->m_schedule.transaction().splits().end(); ++it_s) { @@ -241,10 +241,10 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) // if it's not a check, then we need to clear // a possibly assigned check number - if(d->m_schedule.paymentType() != MyMoneySchedule::STYPE_WRITECHEQUE) { - QWidget* w = editor->haveWidget("number"); + if(d->m_schedule.paymentType() != MyMoneySchedule::STYPE_WRITECHETQUE) { + TQWidget* w = editor->haveWidget("number"); if(w) - dynamic_cast(w)->loadText(QString()); + dynamic_cast(w)->loadText(TQString()); } Q_ASSERT(!d->m_tabOrderWidgets.isEmpty()); @@ -268,7 +268,7 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) d->m_tabOrderWidgets.append(m_form); // install event filter in all taborder widgets - QWidget* w; + TQWidget* w; for(w = d->m_tabOrderWidgets.first(); w; w = d->m_tabOrderWidgets.next()) { w->installEventFilter(this); w->installEventFilter(editor); @@ -277,7 +277,7 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) // connect the postdate modification signal to our update routine kMyMoneyDateInput* dateEdit = dynamic_cast(editor->haveWidget("postdate")); if(dateEdit) - connect(dateEdit, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotPostDateChanged(const QDate&))); + connect(dateEdit, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotPostDateChanged(const TQDate&))); m_nameEdit->setFocus(); @@ -288,7 +288,7 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) d->m_requiredFields->add(editor->haveWidget("category")); // fix labels - QLabel* label = dynamic_cast(editor->haveWidget("date-label")); + TQLabel* label = dynamic_cast(editor->haveWidget("date-label")); if(label) { label->setText(i18n("Next due date")); } @@ -296,7 +296,7 @@ TransactionEditor* KEditScheduleDlg::startEdit(void) d->m_editor = editor; slotSetPaymentMethod(d->m_schedule.paymentType()); - connect(m_paymentMethodEdit, SIGNAL(itemSelected(int)), this, SLOT(slotSetPaymentMethod(int))); + connect(m_paymentMethodEdit, TQT_SIGNAL(itemSelected(int)), this, TQT_SLOT(slotSetPaymentMethod(int))); } return editor; @@ -366,7 +366,7 @@ const MyMoneySchedule& KEditScheduleDlg::schedule(void) const if(m_endSeriesEdit->isEnabled() && m_endSeriesEdit->isChecked()) { d->m_schedule.setEndDate(m_FinalPaymentEdit->date()); } else { - d->m_schedule.setEndDate(QDate()); + d->m_schedule.setEndDate(TQDate()); } } return d->m_schedule; @@ -381,7 +381,7 @@ MyMoneyTransaction KEditScheduleDlg::transaction(void) const } t.clearId(); - t.setEntryDate(QDate()); + t.setEntryDate(TQDate()); return t; } @@ -390,13 +390,13 @@ bool KEditScheduleDlg::focusNextPrevChild(bool next) bool rc = false; // qDebug("KEditScheduleDlg::focusNextPrevChild(editmode=%s)", m_inEditMode ? "true" : "false"); - QWidget *w = 0; - QWidget *currentWidget; + TQWidget *w = 0; + TQWidget *currentWidget; - w = qApp->focusWidget(); - while(w && d->m_tabOrderWidgets.find(w) == -1) { - // qDebug("'%s' not in list, use parent", w->className()); - w = w->parentWidget(); + w = tqApp->tqfocusWidget(); + while(w && d->m_tabOrderWidgets.tqfind(w) == -1) { + // qDebug("'%s' not in list, use tqparent", w->className()); + w = w->tqparentWidget(); } // if(w) qDebug("tab order is at '%s'", w->className()); currentWidget = d->m_tabOrderWidgets.current(); @@ -408,7 +408,7 @@ bool KEditScheduleDlg::focusNextPrevChild(bool next) } if(w != currentWidget - && ((w->focusPolicy() & TabFocus) == TabFocus) + && ((w->focusPolicy() & TQ_TabFocus) == TQ_TabFocus) && w->isVisible() && w->isEnabled()) { // qDebug("Selecting '%s' as focus", w->className()); w->setFocus(); @@ -421,7 +421,7 @@ bool KEditScheduleDlg::focusNextPrevChild(bool next) return rc; } -void KEditScheduleDlg::resizeEvent(QResizeEvent* ev) +void KEditScheduleDlg::resizeEvent(TQResizeEvent* ev) { m_register->resize(KMyMoneyRegister::DetailColumn); m_form->resize(KMyMoneyTransactionForm::ValueColumn1); @@ -444,7 +444,7 @@ void KEditScheduleDlg::slotRemainingChanged(int value) } } -void KEditScheduleDlg::slotEndDateChanged(const QDate& date) +void KEditScheduleDlg::slotEndDateChanged(const TQDate& date) { // Make sure the required fields are set kMyMoneyDateInput* dateEdit = dynamic_cast(d->m_editor->haveWidget("postdate")); @@ -458,7 +458,7 @@ void KEditScheduleDlg::slotEndDateChanged(const QDate& date) } } -void KEditScheduleDlg::slotPostDateChanged(const QDate& date) +void KEditScheduleDlg::slotPostDateChanged(const TQDate& date) { if(d->m_schedule.nextDueDate() != date) { if (m_endOptionsFrame->isEnabled()) { @@ -475,13 +475,13 @@ void KEditScheduleDlg::slotSetPaymentMethod(int item) { kMyMoneyLineEdit* dateEdit = dynamic_cast(d->m_editor->haveWidget("number")); if(dateEdit) { - dateEdit->setShown(item == MyMoneySchedule::STYPE_WRITECHEQUE); + dateEdit->setShown(item == MyMoneySchedule::STYPE_WRITECHETQUE); // hiding the label does not work, because the label underneath will shine // through. So we either write the label or a blank - QLabel* label = dynamic_cast(d->m_editor->haveWidget("number-label")); + TQLabel* label = dynamic_cast(d->m_editor->haveWidget("number-label")); if(label) { - label->setText((item == MyMoneySchedule::STYPE_WRITECHEQUE) ? i18n("Number") : " "); + label->setText((item == MyMoneySchedule::STYPE_WRITECHETQUE) ? i18n("Number") : " "); } } } diff --git a/kmymoney2/dialogs/keditscheduledlg.h b/kmymoney2/dialogs/keditscheduledlg.h index 94c3101..db80aea 100644 --- a/kmymoney2/dialogs/keditscheduledlg.h +++ b/kmymoney2/dialogs/keditscheduledlg.h @@ -40,11 +40,12 @@ class TransactionEditor; class KEditScheduleDlg : public KEditScheduleDlgDecl { Q_OBJECT + TQ_OBJECT public: /** - * Standard QWidget constructor. + * Standard TQWidget constructor. **/ - KEditScheduleDlg(const MyMoneySchedule& schedule, QWidget *parent=0, const char *name=0); + KEditScheduleDlg(const MyMoneySchedule& schedule, TQWidget *tqparent=0, const char *name=0); /** * Standard destructor. @@ -66,19 +67,19 @@ protected: * This method adjusts @a _date according to the rules specified by * the schedule's weekend option. */ - QDate adjustDate(const QDate& _date) const; + TQDate adjustDate(const TQDate& _date) const; /// Overridden for internal reasons. No API changes. bool focusNextPrevChild(bool next); /// Overridden for internal reasons. No API changes. - void resizeEvent(QResizeEvent* ev); + void resizeEvent(TQResizeEvent* ev); private slots: void slotSetupSize(void); void slotRemainingChanged(int); - void slotEndDateChanged(const QDate& date); - void slotPostDateChanged(const QDate& date); + void slotEndDateChanged(const TQDate& date); + void slotPostDateChanged(const TQDate& date); void slotSetPaymentMethod(int); void slotFrequencyChanged(int item); void slotShowHelp(void); diff --git a/kmymoney2/dialogs/keditscheduledlgdecl.ui b/kmymoney2/dialogs/keditscheduledlgdecl.ui index 8555c58..494fa46 100644 --- a/kmymoney2/dialogs/keditscheduledlgdecl.ui +++ b/kmymoney2/dialogs/keditscheduledlgdecl.ui @@ -1,6 +1,6 @@ KEditScheduleDlgDecl - + KEditScheduleDlgDecl @@ -22,23 +22,23 @@ unnamed - + - layout8 + tqlayout8 unnamed - + - layout9 + tqlayout9 unnamed - + textLabel1 @@ -53,15 +53,15 @@ - + - layout7 + tqlayout7 unnamed - + textLabel3 @@ -92,7 +92,7 @@ - + m_paymentInformation @@ -103,15 +103,15 @@ unnamed - + - layout7 + tqlayout7 unnamed - + textLabel1_3 @@ -142,7 +142,7 @@ Expanding - + 61 21 @@ -234,7 +234,7 @@ - + groupBox2 @@ -245,9 +245,9 @@ unnamed - + - layout6 + tqlayout6 @@ -273,7 +273,7 @@ m_weekendOptionEdit - + textLabel1_2 @@ -283,15 +283,15 @@ - + - layout7 + tqlayout7 unnamed - + m_estimateEdit @@ -320,7 +320,7 @@ Expanding - + 21 20 @@ -329,7 +329,7 @@ - + m_autoEnterEdit @@ -337,7 +337,7 @@ Enter this schedule into the register automatically when it is due - + m_endSeriesEdit @@ -345,7 +345,7 @@ This schedule will end at some time - + m_endOptionsFrame @@ -372,14 +372,14 @@ Fixed - + 20 20 - + m_endLabel1 @@ -398,7 +398,7 @@ 9999 - + m_endLabel2 @@ -428,16 +428,16 @@ Expanding - + 20 16 - + - layout10_3 + tqlayout10_3 @@ -467,7 +467,7 @@ Expanding - + 280 0 @@ -528,5 +528,8 @@ setEnabled(bool) - + + kmymoney/kmymoneydateinput.h + + diff --git a/kmymoney2/dialogs/kendingbalancedlg.cpp b/kmymoney2/dialogs/kendingbalancedlg.cpp index 0760cc2..05b2896 100644 --- a/kmymoney2/dialogs/kendingbalancedlg.cpp +++ b/kmymoney2/dialogs/kendingbalancedlg.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,7 +46,7 @@ public: MyMoneyTransaction m_tInterest; MyMoneyTransaction m_tCharges; MyMoneyAccount m_account; - QMap m_helpAnchor; + TQMap m_helpAnchor; }; class KEndingBalanceLoanDlg::Private @@ -55,22 +55,22 @@ public: MyMoneyTransaction m_tInterest; MyMoneyTransaction m_tCharges; MyMoneyAccountLoan m_account; - QMap m_helpAnchor; + TQMap m_helpAnchor; }; -KEndingBalanceDlg::KEndingBalanceDlg(const MyMoneyAccount& account, QWidget *parent, const char *name) : - KEndingBalanceDlgDecl(parent, name, true), +KEndingBalanceDlg::KEndingBalanceDlg(const MyMoneyAccount& account, TQWidget *tqparent, const char *name) : + KEndingBalanceDlgDecl(tqparent, name, true), d(new Private) { - QString value; + TQString value; MyMoneyMoney endBalance, startBalance; d->m_account = account; MyMoneySecurity currency = MyMoneyFile::instance()->security(account.currencyId()); - m_enterInformationLabel->setText(QString("")+i18n("Please enter the following fields with the information as you find them on your statement. Make sure to enter all values in %1.").arg(currency.name())+QString("")); + m_enterInformationLabel->setText(TQString("")+i18n("Please enter the following fields with the information as you find them on your statement. Make sure to enter all values in %1.").tqarg(currency.name())+TQString("")); - m_statementDate->setDate(QDate::currentDate()); + m_statementDate->setDate(TQDate::tqcurrentDate()); // If the previous reconciliation was postponed, // we show a different first page @@ -79,8 +79,8 @@ KEndingBalanceDlg::KEndingBalanceDlg(const MyMoneyAccount& account, QWidget *par // if the last statement has been entered long enough ago (more than one month), // then take the last statement date and add one month and use that as statement // date. - QDate lastStatementDate = account.lastReconciliationDate(); - if(lastStatementDate.addMonths(1) < QDate::currentDate()) { + TQDate lastStatementDate = account.lastReconciliationDate(); + if(lastStatementDate.addMonths(1) < TQDate::tqcurrentDate()) { m_statementDate->setDate(lastStatementDate.addMonths(1)); } @@ -111,18 +111,18 @@ KEndingBalanceDlg::KEndingBalanceDlg(const MyMoneyAccount& account, QWidget *par } // We don't need to add the default into the list (see ::help() why) - // m_helpAnchor[m_startPageCheckings] = QString(""); - d->m_helpAnchor[m_interestChargeCheckings] = QString("details.reconcile.wizard.interest"); - d->m_helpAnchor[m_statementInfoPageCheckings] = QString("details.reconcile.wizard.statement"); + // m_helpAnchor[m_startPageCheckings] = TQString(""); + d->m_helpAnchor[m_interestChargeCheckings] = TQString("details.reconcile.wizard.interest"); + d->m_helpAnchor[m_statementInfoPageCheckings] = TQString("details.reconcile.wizard.statement"); value = account.value("statementDate"); if(!value.isEmpty()) - m_statementDate->setDate(QDate::fromString(value, Qt::ISODate)); + m_statementDate->setDate(TQDate::fromString(value, Qt::ISODate)); - m_lastStatementDate->setText(QString()); + m_lastStatementDate->setText(TQString()); if(account.lastReconciliationDate().isValid()) { m_lastStatementDate->setText(i18n("Last reconciled statement: %1") - .arg(KGlobal::locale()->formatDate(account.lastReconciliationDate(), true))); + .tqarg(KGlobal::locale()->formatDate(account.lastReconciliationDate(), true))); } // remove all unwanted pages @@ -131,16 +131,16 @@ KEndingBalanceDlg::KEndingBalanceDlg(const MyMoneyAccount& account, QWidget *par removePage(m_adjustmentTransactionPage); // connect the signals with the slots - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotReloadEditWidgets())); - connect(m_payeeEdit, SIGNAL(createItem(const QString&, QString&)), this, SIGNAL(createPayee(const QString&, QString&))); - connect(m_interestCategoryEdit, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateInterestCategory(const QString&, QString&))); - connect(m_chargesCategoryEdit, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateChargesCategory(const QString&, QString&))); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadEditWidgets())); + connect(m_payeeEdit, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SIGNAL(createPayee(const TQString&, TQString&))); + connect(m_interestCategoryEdit, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateInterestCategory(const TQString&, TQString&))); + connect(m_chargesCategoryEdit, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateChargesCategory(const TQString&, TQString&))); - connect(m_interestEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished(void))); - connect(m_interestCategoryEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished(void))); - connect(m_chargesEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished(void))); - connect(m_chargesCategoryEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished(void))); - connect(m_statementDate, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotUpdateBalances())); + connect(m_interestEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_interestCategoryEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_chargesEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_chargesCategoryEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_statementDate, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotUpdateBalances())); slotReloadEditWidgets(); @@ -180,8 +180,8 @@ void KEndingBalanceDlg::slotUpdateBalances(void) filter.addState(MyMoneyTransactionFilter::cleared); filter.setReportAllSplits(true); - QValueList > transactionList; - QValueList >::const_iterator it; + TQValueList > transactionList; + TQValueList >::const_iterator it; // retrieve the list from the engine MyMoneyFile::instance()->transactionList(transactionList, filter); @@ -236,22 +236,22 @@ void KEndingBalanceDlg::accept(void) KEndingBalanceDlgDecl::accept(); } -void KEndingBalanceDlg::slotCreateInterestCategory(const QString& txt, QString& id) +void KEndingBalanceDlg::slotCreateInterestCategory(const TQString& txt, TQString& id) { createCategory(txt, id, MyMoneyFile::instance()->income()); } -void KEndingBalanceDlg::slotCreateChargesCategory(const QString& txt, QString& id) +void KEndingBalanceDlg::slotCreateChargesCategory(const TQString& txt, TQString& id) { createCategory(txt, id, MyMoneyFile::instance()->expense()); } -void KEndingBalanceDlg::createCategory(const QString& txt, QString& id, const MyMoneyAccount& parent) +void KEndingBalanceDlg::createCategory(const TQString& txt, TQString& id, const MyMoneyAccount& tqparent) { MyMoneyAccount acc; acc.setName(txt); - emit createCategory(acc, parent); + emit createCategory(acc, tqparent); id = acc.id(); } @@ -273,7 +273,7 @@ const MyMoneyMoney KEndingBalanceDlg::adjustedReturnValue(const MyMoneyMoney& v) void KEndingBalanceDlg::slotReloadEditWidgets(void) { - QString payeeId, interestId, chargesId; + TQString payeeId, interestId, chargesId; // keep current selected items payeeId = m_payeeEdit->selectedItem(); @@ -351,7 +351,7 @@ bool KEndingBalanceDlg::createTransaction(MyMoneyTransaction &t, const int sign, t.addSplit(s1); t.addSplit(s2); - QMap priceInfo; // just empty + TQMap priceInfo; // just empty MyMoneyMoney shares; if(!KCurrencyCalculator::setupSplitPrice(shares, t, s2, priceInfo, this)) { t = MyMoneyTransaction(); @@ -373,19 +373,19 @@ bool KEndingBalanceDlg::createTransaction(MyMoneyTransaction &t, const int sign, void KEndingBalanceDlg::help(void) { - QString anchor = d->m_helpAnchor[currentPage()]; + TQString anchor = d->m_helpAnchor[currentPage()]; if(anchor.isEmpty()) - anchor = QString("details.reconcile.whatis"); + anchor = TQString("details.reconcile.whatis"); kapp->invokeHelp(anchor); } -KEndingBalanceLoanDlg::KEndingBalanceLoanDlg(const MyMoneyAccount& account, QWidget *parent, const char *name) : - KEndingBalanceDlgDecl(parent, name, true), +KEndingBalanceLoanDlg::KEndingBalanceLoanDlg(const MyMoneyAccount& account, TQWidget *tqparent, const char *name) : + KEndingBalanceDlgDecl(tqparent, name, true), d(new Private) { d->m_account = account; - QDate value = account.lastReconciliationDate(); + TQDate value = account.lastReconciliationDate(); if(value.isValid()) m_startDateEdit->setDate(value.addDays(1)); else @@ -404,10 +404,10 @@ KEndingBalanceLoanDlg::KEndingBalanceLoanDlg(const MyMoneyAccount& account, QWid removePage(m_interestChargeCheckings); // connect the signals with the slots - connect(m_amortizationTotalEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished(void))); - connect(m_interestTotalEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished(void))); - connect(m_accountEdit, SIGNAL(stateChanged(void)), this, SLOT(slotCheckPageFinished(void))); - connect(m_categoryEdit, SIGNAL(stateChanged(void)), this, SLOT(slotCheckPageFinished(void))); + connect(m_amortizationTotalEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_interestTotalEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_accountEdit, TQT_SIGNAL(stateChanged(void)), this, TQT_SLOT(slotCheckPageFinished(void))); + connect(m_categoryEdit, TQT_SIGNAL(stateChanged(void)), this, TQT_SLOT(slotCheckPageFinished(void))); } KEndingBalanceLoanDlg::~KEndingBalanceLoanDlg() @@ -452,17 +452,17 @@ void KEndingBalanceLoanDlg::slotCheckPageFinished(void) } } -const MyMoneyMoney KEndingBalanceLoanDlg::totalInterest(const QDate& start, const QDate& end) const +const MyMoneyMoney KEndingBalanceLoanDlg::totalInterest(const TQDate& start, const TQDate& end) const { MyMoneyMoney interest; MyMoneyTransactionFilter filter(d->m_account.id()); filter.setDateFilter(start, end); - QValueList list = MyMoneyFile::instance()->transactionList(filter); - QValueList::ConstIterator it_t; + TQValueList list = MyMoneyFile::instance()->transactionList(filter); + TQValueList::ConstIterator it_t; for(it_t = list.begin(); it_t != list.end(); ++it_t) { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionInterest) { interest += (*it_s).value(); @@ -472,7 +472,7 @@ const MyMoneyMoney KEndingBalanceLoanDlg::totalInterest(const QDate& start, cons return interest; } -const MyMoneyMoney KEndingBalanceLoanDlg::totalAmortization(const QDate& start, const QDate& end) const +const MyMoneyMoney KEndingBalanceLoanDlg::totalAmortization(const TQDate& start, const TQDate& end) const { MyMoneyMoney amortization; MyMoneyMoney adjust(1,1); @@ -482,11 +482,11 @@ const MyMoneyMoney KEndingBalanceLoanDlg::totalAmortization(const QDate& start, if(d->m_account.accountType() == MyMoneyAccount::AssetLoan) adjust = -adjust; - QValueList list = MyMoneyFile::instance()->transactionList(filter); - QValueList::ConstIterator it_t; + TQValueList list = MyMoneyFile::instance()->transactionList(filter); + TQValueList::ConstIterator it_t; for(it_t = list.begin(); it_t != list.end(); ++it_t) { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { if((*it_s).accountId() == d->m_account.id() && (*it_s).action() == MyMoneySplit::ActionAmortization @@ -510,8 +510,8 @@ void KEndingBalanceLoanDlg::next(void) m_loanOverview->setText(i18n("KMyMoney has calculated the following amounts for " "interest and amortization according to recorded payments " "between %1 and %2.") - .arg(KGlobal::locale()->formatDate(m_startDateEdit->date(), true)) - .arg(KGlobal::locale()->formatDate(m_endDateEdit->date(), true))); + .tqarg(KGlobal::locale()->formatDate(m_startDateEdit->date(), true)) + .tqarg(KGlobal::locale()->formatDate(m_endDateEdit->date(), true))); // preload widgets with calculated values if they are empty if(m_amortizationTotalEdit->value().isZero() && !amortization.isZero()) @@ -600,9 +600,9 @@ const MyMoneyTransaction KEndingBalanceLoanDlg::adjustmentTransaction(void) cons void KEndingBalanceLoanDlg::help(void) { - QString anchor = d->m_helpAnchor[currentPage()]; + TQString anchor = d->m_helpAnchor[currentPage()]; if(anchor.isEmpty()) - anchor = QString("details.reconcile.whatis"); + anchor = TQString("details.reconcile.whatis"); kapp->invokeHelp(anchor); } diff --git a/kmymoney2/dialogs/kendingbalancedlg.h b/kmymoney2/dialogs/kendingbalancedlg.h index 3b9de00..67a1098 100644 --- a/kmymoney2/dialogs/kendingbalancedlg.h +++ b/kmymoney2/dialogs/kendingbalancedlg.h @@ -20,12 +20,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -51,13 +51,14 @@ class kMyMoneyEdit; class KEndingBalanceDlg : public KEndingBalanceDlgDecl { Q_OBJECT + TQ_OBJECT public: - KEndingBalanceDlg(const MyMoneyAccount& account, QWidget *parent=0, const char *name=0); + KEndingBalanceDlg(const MyMoneyAccount& account, TQWidget *tqparent=0, const char *name=0); ~KEndingBalanceDlg(); const MyMoneyMoney endingBalance(void) const; const MyMoneyMoney previousBalance(void) const; - const QDate statementDate(void) const { return m_statementDate->date(); }; + const TQDate statementDate(void) const { return m_statementDate->date(); }; const MyMoneyTransaction interestTransaction(void); const MyMoneyTransaction chargeTransaction(void); @@ -65,27 +66,27 @@ public: protected: bool createTransaction(MyMoneyTransaction& t, const int sign, kMyMoneyEdit *amountEdit, KMyMoneyCategory *categoryEdit, kMyMoneyDateInput* dateEdit); const MyMoneyMoney adjustedReturnValue(const MyMoneyMoney& v) const; - void createCategory(const QString& txt, QString& id, const MyMoneyAccount& parent); + void createCategory(const TQString& txt, TQString& id, const MyMoneyAccount& tqparent); protected slots: void slotCheckPageFinished(void); void slotReloadEditWidgets(void); void help(void); - void slotCreateInterestCategory(const QString& txt, QString& id); - void slotCreateChargesCategory(const QString& txt, QString& id); + void slotCreateInterestCategory(const TQString& txt, TQString& id); + void slotCreateChargesCategory(const TQString& txt, TQString& id); void accept(void); void slotUpdateBalances(void); signals: /** - * proxy signal for KMyMoneyPayeeCombo::createItem(const QString&, QString&) + * proxy signal for KMyMoneyPayeeCombo::createItem(const TQString&, TQString&) */ - void createPayee(const QString&, QString&); + void createPayee(const TQString&, TQString&); /** * emit when a category is about to be created */ - void createCategory(MyMoneyAccount& acc, const MyMoneyAccount& parent); + void createCategory(MyMoneyAccount& acc, const MyMoneyAccount& tqparent); private: /// \internal d-pointer class. @@ -102,8 +103,9 @@ private: class KEndingBalanceLoanDlg : public KEndingBalanceDlgDecl { Q_OBJECT + TQ_OBJECT public: - KEndingBalanceLoanDlg(const MyMoneyAccount& account, QWidget *parent=0, const char *name=0); + KEndingBalanceLoanDlg(const MyMoneyAccount& account, TQWidget *tqparent=0, const char *name=0); ~KEndingBalanceLoanDlg(); /** @@ -115,20 +117,20 @@ public: /** * This method returns the starting date of the statement as provided * by the user. The value returned is only valid if the dialog returned - * with QDialog::accept. + * with TQDialog::accept. */ - const QDate startDate(void) const { return m_startDateEdit->date(); }; + const TQDate startDate(void) const { return m_startDateEdit->date(); }; /** * This method returns the ending date of the statement as provided * by the user. The value returned is only valid if the dialog returned - * with QDialog::accept. + * with TQDialog::accept. */ - const QDate endDate(void) const { return m_endDateEdit->date(); }; + const TQDate endDate(void) const { return m_endDateEdit->date(); }; protected: - const MyMoneyMoney totalInterest(const QDate& start, const QDate& end) const; - const MyMoneyMoney totalAmortization(const QDate& start, const QDate& end) const; + const MyMoneyMoney totalInterest(const TQDate& start, const TQDate& end) const; + const MyMoneyMoney totalAmortization(const TQDate& start, const TQDate& end) const; public slots: void next(); diff --git a/kmymoney2/dialogs/kendingbalancedlgdecl.ui b/kmymoney2/dialogs/kendingbalancedlgdecl.ui index 0f77810..ed4d921 100644 --- a/kmymoney2/dialogs/kendingbalancedlgdecl.ui +++ b/kmymoney2/dialogs/kendingbalancedlgdecl.ui @@ -1,6 +1,6 @@ KEndingBalanceDlgDecl - + KEndingBalanceDlgDecl @@ -15,7 +15,7 @@ Reconciliation Wizard - + m_startPageCheckings @@ -32,7 +32,7 @@ 6 - + TextLabel6 @@ -43,13 +43,13 @@ All relevant information necessary for this process is usually printed on your s On the next page you will verify, that the starting and ending balance are matching those on your statement. If not, please modify the figures. - + WordBreak|AlignTop - + m_startPageLoan @@ -66,7 +66,7 @@ On the next page you will verify, that the starting and ending balance are match 6 - + TextLabel7 @@ -75,7 +75,7 @@ On the next page you will verify, that the starting and ending balance are match Please enter the following information found on your statement: - + WordBreak|AlignTop @@ -89,14 +89,14 @@ Please enter the following information found on your statement: Expanding - + 0 19 - + Layout10 @@ -120,14 +120,14 @@ Please enter the following information found on your statement: Expanding - + 42 0 - + Layout9 @@ -146,7 +146,7 @@ Please enter the following information found on your statement: m_startDateEdit - + TextLabel3_2 @@ -159,7 +159,7 @@ Please enter the following information found on your statement: m_endDateEdit - + TextLabel2_2 @@ -179,7 +179,7 @@ Please enter the following information found on your statement: Expanding - + 44 0 @@ -198,7 +198,7 @@ Please enter the following information found on your statement: Expanding - + 0 20 @@ -207,7 +207,7 @@ Please enter the following information found on your statement: - + m_checkPaymentsPage @@ -224,18 +224,18 @@ Please enter the following information found on your statement: 6 - + m_loanOverview 1 - + WordBreak|AlignTop - + Layout12 @@ -259,14 +259,14 @@ Please enter the following information found on your statement: Expanding - + 51 0 - + Layout11 @@ -280,7 +280,7 @@ Please enter the following information found on your statement: 6 - + TextLabel1 @@ -293,7 +293,7 @@ Please enter the following information found on your statement: m_amortizationTotalEdit - + TextLabel2_3 @@ -318,7 +318,7 @@ Please enter the following information found on your statement: Expanding - + 71 0 @@ -327,14 +327,14 @@ Please enter the following information found on your statement: - + TextLabel4_2 If your statement shows different amounts, please cancel this dialog and correct the false transactions or correct the values in this dialog. In the later case, KMyMoney will create an adjustment transaction and add it to the ledger. - + WordBreak|AlignTop @@ -348,7 +348,7 @@ Please enter the following information found on your statement: Expanding - + 0 19 @@ -357,7 +357,7 @@ Please enter the following information found on your statement: - + m_adjustmentTransactionPage @@ -374,18 +374,18 @@ Please enter the following information found on your statement: 6 - + TextLabel5_2 In order to create the adjustment transaction, KMyMoney requires an account and possibly an interest category to assign the differences to. Please select an account and - if necessary - a category. - + WordBreak|AlignTop - + Layout19 @@ -399,7 +399,7 @@ Please enter the following information found on your statement: 6 - + Layout16 @@ -413,7 +413,7 @@ Please enter the following information found on your statement: 6 - + TextLabel7_2 @@ -431,7 +431,7 @@ Please enter the following information found on your statement: - + Layout18 @@ -445,7 +445,7 @@ Please enter the following information found on your statement: 6 - + TextLabel6_2 @@ -475,7 +475,7 @@ Please enter the following information found on your statement: Expanding - + 0 25 @@ -484,7 +484,7 @@ Please enter the following information found on your statement: - + m_pagePreviousPostpone @@ -501,7 +501,7 @@ Please enter the following information found on your statement: 6 - + TextLabel8 @@ -512,13 +512,13 @@ It is important, that you continue with the same statement you used when you pos All information you have entered into this wizard will be shown and all transactions that you already cleared are marked with a 'C'. - + WordBreak|AlignTop - + m_statementInfoPageCheckings @@ -547,14 +547,14 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 20 50 - + Layout9 @@ -578,14 +578,14 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 42 0 - + Layout8 @@ -599,7 +599,7 @@ All information you have entered into this wizard will be shown and all transact 6 - + TextLabel3 @@ -612,7 +612,7 @@ All information you have entered into this wizard will be shown and all transact m_statementDate - + TextLabel2 @@ -625,7 +625,7 @@ All information you have entered into this wizard will be shown and all transact m_previousBalance - + TextLabel4 @@ -650,7 +650,7 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 46 0 @@ -669,14 +669,14 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 16 87 - + m_lastStatementDate @@ -686,7 +686,7 @@ All information you have entered into this wizard will be shown and all transact - + m_interestChargeCheckings @@ -729,16 +729,16 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 16 16 - + - layout17 + tqlayout17 @@ -754,30 +754,30 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 60 20 - + - layout16 + tqlayout16 unnamed - + - layout15 + tqlayout15 unnamed - + textLabel1 @@ -808,7 +808,7 @@ All information you have entered into this wizard will be shown and all transact - + groupBox1 @@ -835,9 +835,9 @@ All information you have entered into this wizard will be shown and all transact - + - layout18 + tqlayout18 @@ -860,7 +860,7 @@ All information you have entered into this wizard will be shown and all transact - + groupBox2 @@ -887,9 +887,9 @@ All information you have entered into this wizard will be shown and all transact - + - layout19 + tqlayout19 @@ -924,7 +924,7 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 60 20 @@ -943,7 +943,7 @@ All information you have entered into this wizard will be shown and all transact Expanding - + 16 16 @@ -976,5 +976,10 @@ All information you have entered into this wizard will be shown and all transact 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000042149444154789c8d95c18b1c4514c67fbb29e5b54ea05b26da1d36b08d096e8b11261871837bc8e282ac7ac82187e049a317e32d37110992bf42123c694eea414c0e0bf1b0ec6c402139485a54e8810c54c10e741146fa110bd643f74c12bd642e4d75f77cf5d5ef7dafdfc2ce7087d9eff32fdfdff74e5114104011e489d6e952cce5cfbe5998692dec0c77b87aedd3fddd9f2b3efce02291082209aa3504685022e4ffd7a000a82a765c515615ce95acae659c3f7765c100ec6e575cf8f822e991025f3b6a6f890c484f181ccfc1583428f5d4e2fe84da039aa04121b40eb32483a0ec6e5bce9f8385d36fa7fb9b1b17c8f31cbfe7a95c45be94520c72b2141a1caa160d1666e24ea94aa11ee7685054159d2ada34d41387c40dc63b8844f0b5c73a4bb19cb3f9de001f2aac1fa23aa209168c004224902e29d22ff1e38abbdb275055c4800610233867311a1491847a62c98f66ac6f14d8e99072f22daa15b68a8108424d6422e24c88e3966fbce4c9d786945b27f0be0103ed13c16004d59a2c4d58df28a87548e9aee2274ab95d60c7193c9a0281fc959ae2a4450364a9e2572c7a2b43438374ef2dd2154012d050514dbec7396578a3130d9d6850066f0ad9d186f2d78cdbbb799b0a202f2c48d3aebbb418310240b112637588574bf54b8efaa4fd9b691dacbf5b305813542bae63a9eee4c4694d967b5494eca8c7ef0933bdc5d90e6a2caa0e3f013b7adce9fa5b03d637561113a30106a71d18c5fd9677058338ad01e91c0b8b743b880182ce19cd9c0e5e2b583fbdda565d3d04cfedad180942133af201b2bc3588e111c680068f489780ce69b192b279768088524f2b3458ea694d3de99a4323bc976ed34eb86b98c51993f6be10f77240c99685cd731991f1582df15aa15a213d583f5313a7806988fb8a0640e336359d9e9933568bf44062214ba19e2a7652a13d8b068ff596b807182189234e9da9f1ceb78c81b28c3ac6fe21e306c58e41d5118952acd6a0c2f56b9e6a5c72f346cdcd6b19a3bf8010010d714f89533b674c90c7189b598eab12a45fb5c75b8253672b863fbcccf5af93b6904119fe9851bf5153ac3a746ae7b9d5698c1dc58f313e70e4707ce9d84bafa2f79fc23fb8c7c1438ef04031a2642fee21060ec69ee47020796ecaa12313ccd333d1b67935047acf2be3bb11aa010dbe656cc755dbe3b772084a7ebc6d5711253b593dfcc0cc8fcd3cafda455512c7f200ec56cbfac0f1d7d34b7fdf0f98fd88a92a7e9cb0e70cc933c0b38a2c823ea0bd76c70c016adb67f47bc2a117a6d40abeea33fa23c2fb867edfb413e4a34fded94ffb3991c46dc7754cd3634ad2af490b857f5a5137126a97e02a8120a485235b6a28ef80bd077ee2b9f2d54fed04595dcbd8ddb6c4bd87334c10cadb2064e856177e7864e669fbe1df154a0142839f7ad2e5b6880bff1da66eece78e315d959f609da670f98befe6c3f45fb42672c9acff7f660000000049454e44ae426082 - + + kmymoney/kmymoneydateinput.h + kmymoney/kmymoneyedit.h + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/kenterscheduledlg.cpp b/kmymoney2/dialogs/kenterscheduledlg.cpp index f39f003..47f881f 100644 --- a/kmymoney2/dialogs/kenterscheduledlg.cpp +++ b/kmymoney2/dialogs/kenterscheduledlg.cpp @@ -18,9 +18,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -57,13 +57,13 @@ public: MyMoneySchedule m_schedule; KMyMoneyRegister::Transaction* m_item; - QWidgetList m_tabOrderWidgets; + TQWidgetList m_tabOrderWidgets; bool m_showWarningOnce; KMyMoneyUtils::EnterScheduleResultCodeE m_extendedReturnCode; }; -KEnterScheduleDlg::KEnterScheduleDlg(QWidget *parent, const MyMoneySchedule& schedule) : - KEnterScheduleDlgDecl(parent, "kenterscheduledlg"), +KEnterScheduleDlg::KEnterScheduleDlg(TQWidget *tqparent, const MyMoneySchedule& schedule) : + KEnterScheduleDlgDecl(tqparent, "kenterscheduledlg"), d(new Private) { d->m_schedule = schedule; @@ -76,7 +76,7 @@ KEnterScheduleDlg::KEnterScheduleDlg(QWidget *parent, const MyMoneySchedule& sch buttonSkip->setHidden(true); // make sure, we have a tabbar with the form - KMyMoneyTransactionForm::TabBar* tabbar = m_form->tabBar(m_form->parentWidget()); + KMyMoneyTransactionForm::TabBar* tabbar = m_form->tabBar(m_form->tqparentWidget()); // we never need to see the register m_register->hide(); @@ -103,12 +103,12 @@ KEnterScheduleDlg::KEnterScheduleDlg(QWidget *parent, const MyMoneySchedule& sch m_scheduleName->setText(d->m_schedule.name()); m_type->setText(KMyMoneyUtils::scheduleTypeToString(d->m_schedule.type())); - connect(buttonHelp, SIGNAL(clicked()), this, SLOT(slotShowHelp())); - connect(buttonIgnore, SIGNAL(clicked()), this, SLOT(slotIgnore())); - connect(buttonSkip, SIGNAL(clicked()), this, SLOT(slotSkip())); + connect(buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotShowHelp())); + connect(buttonIgnore, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotIgnore())); + connect(buttonSkip, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSkip())); // force the initial height to be as small as possible - QTimer::singleShot(0, this, SLOT(slotSetupSize())); + TQTimer::singleShot(0, this, TQT_SLOT(slotSetupSize())); } KEnterScheduleDlg::~KEnterScheduleDlg() @@ -118,7 +118,7 @@ KEnterScheduleDlg::~KEnterScheduleDlg() KMyMoneyUtils::EnterScheduleResultCodeE KEnterScheduleDlg::resultCode(void) const { - if(result() == QDialog::Accepted) + if(result() == TQDialog::Accepted) return d->m_extendedReturnCode; return KMyMoneyUtils::Cancel; } @@ -147,7 +147,7 @@ MyMoneyTransaction KEnterScheduleDlg::transaction(void) try { if (d->m_schedule.type() == MyMoneySchedule::TYPE_LOANPAYMENT) { - KMyMoneyUtils::calculateAutoLoan(d->m_schedule, t, QMap()); + KMyMoneyUtils::calculateAutoLoan(d->m_schedule, t, TQMap()); } } catch (MyMoneyException* e) { KMessageBox::detailedError(this, i18n("Unable to load schedule details"), e->what()); @@ -155,17 +155,17 @@ MyMoneyTransaction KEnterScheduleDlg::transaction(void) } t.clearId(); - t.setEntryDate(QDate()); + t.setEntryDate(TQDate()); return t; } -QDate KEnterScheduleDlg::date(const QDate& _date) const +TQDate KEnterScheduleDlg::date(const TQDate& _date) const { - QDate date(_date); + TQDate date(_date); return d->m_schedule.adjustedDate(date, d->m_schedule.weekendOption()); } -void KEnterScheduleDlg::resizeEvent(QResizeEvent* ev) +void KEnterScheduleDlg::resizeEvent(TQResizeEvent* ev) { m_register->resize(KMyMoneyRegister::DetailColumn); m_form->resize(KMyMoneyTransactionForm::ValueColumn1); @@ -175,14 +175,14 @@ void KEnterScheduleDlg::resizeEvent(QResizeEvent* ev) void KEnterScheduleDlg::slotSetupSize(void) { - resize(width(), minimumSizeHint().height()); + resize(width(), tqminimumSizeHint().height()); } int KEnterScheduleDlg::exec(void) { if(d->m_showWarningOnce) { d->m_showWarningOnce = false; - KMessageBox::information(this, QString("")+i18n("

Please check that all the details in the following dialog are correct and press OK.

Editable data can be changed and can either be applied to just this occurence or for all subsequent occurences for this schedule. (You will be asked what you intend after pressing OK in the following dialog)

")+QString(""), i18n("Enter scheduled transaction"), "EnterScheduleDlgInfo"); + KMessageBox::information(this, TQString("")+i18n("

Please check that all the details in the following dialog are correct and press OK.

Editable data can be changed and can either be applied to just this occurence or for all subsequent occurences for this schedule. (You will be asked what you intend after pressing OK in the following dialog)

")+TQString("
"), i18n("Enter scheduled transaction"), "EnterScheduleDlgInfo"); } return KEnterScheduleDlgDecl::exec(); @@ -191,7 +191,7 @@ int KEnterScheduleDlg::exec(void) TransactionEditor* KEnterScheduleDlg::startEdit(void) { KMyMoneyRegister::SelectedTransactions list(m_register); - TransactionEditor* editor = d->m_item->createEditor(m_form, list, QDate()); + TransactionEditor* editor = d->m_item->createEditor(m_form, list, TQDate()); // check that we use the same transaction commodity in all selected transactions // if not, we need to update this in the editor's list. The user can also bail out @@ -206,18 +206,18 @@ TransactionEditor* KEnterScheduleDlg::startEdit(void) } if(editor) { - connect(editor, SIGNAL(transactionDataSufficient(bool)), buttonOk, SLOT(setEnabled(bool))); - connect(editor, SIGNAL(escapePressed()), buttonCancel, SLOT(animateClick())); - connect(editor, SIGNAL(returnPressed()), buttonOk, SLOT(animateClick())); - - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), editor, SLOT(slotReloadEditWidgets())); - // connect(editor, SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&))); - connect(editor, SIGNAL(createPayee(const QString&, QString&)), kmymoney2, SLOT(slotPayeeNew(const QString&, QString&))); - connect(editor, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); - connect(editor, SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), editor, SLOT(slotReloadEditWidgets())); - - // create the widgets, place them in the parent and load them with data + connect(editor, TQT_SIGNAL(transactionDataSufficient(bool)), buttonOk, TQT_SLOT(setEnabled(bool))); + connect(editor, TQT_SIGNAL(escapePressed()), buttonCancel, TQT_SLOT(animateClick())); + connect(editor, TQT_SIGNAL(returnPressed()), buttonOk, TQT_SLOT(animateClick())); + + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), editor, TQT_SLOT(slotReloadEditWidgets())); + // connect(editor, TQT_SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&))); + connect(editor, TQT_SIGNAL(createPayee(const TQString&, TQString&)), kmymoney2, TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + connect(editor, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(editor, TQT_SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), editor, TQT_SLOT(slotReloadEditWidgets())); + + // create the widgets, place them in the tqparent and load them with data // setup tab order d->m_tabOrderWidgets.clear(); KMyMoneyRegister::Action action = KMyMoneyRegister::ActionWithdrawal; @@ -245,10 +245,10 @@ TransactionEditor* KEnterScheduleDlg::startEdit(void) // if it's not a check, then we need to clear // a possibly assigned check number - if(d->m_schedule.paymentType() != MyMoneySchedule::STYPE_WRITECHEQUE) { - QWidget* w = editor->haveWidget("number"); + if(d->m_schedule.paymentType() != MyMoneySchedule::STYPE_WRITECHETQUE) { + TQWidget* w = editor->haveWidget("number"); if(w) - dynamic_cast(w)->loadText(QString()); + dynamic_cast(w)->loadText(TQString()); } Q_ASSERT(!d->m_tabOrderWidgets.isEmpty()); @@ -259,17 +259,17 @@ TransactionEditor* KEnterScheduleDlg::startEdit(void) d->m_tabOrderWidgets.append(buttonHelp); // install event filter in all taborder widgets - for(QWidget* w = d->m_tabOrderWidgets.first(); w; w = d->m_tabOrderWidgets.next()) { + for(TQWidget* w = d->m_tabOrderWidgets.first(); w; w = d->m_tabOrderWidgets.next()) { w->installEventFilter(this); w->installEventFilter(editor); } // Check if the editor has some preference on where to set the focus // If not, set the focus to the first widget in the tab order - QWidget* focusWidget = editor->firstWidget(); - if(!focusWidget) - focusWidget = d->m_tabOrderWidgets.first(); - focusWidget->setFocus(); + TQWidget* tqfocusWidget = editor->firstWidget(); + if(!tqfocusWidget) + tqfocusWidget = d->m_tabOrderWidgets.first(); + tqfocusWidget->setFocus(); // Make sure, we use the adjusted date kMyMoneyDateInput* dateEdit = dynamic_cast(editor->haveWidget("postdate")); @@ -286,13 +286,13 @@ bool KEnterScheduleDlg::focusNextPrevChild(bool next) bool rc = false; // qDebug("KGlobalLedgerView::focusNextPrevChild(editmode=%s)", m_inEditMode ? "true" : "false"); - QWidget *w = 0; - QWidget *currentWidget; + TQWidget *w = 0; + TQWidget *currentWidget; - w = qApp->focusWidget(); - while(w && d->m_tabOrderWidgets.find(w) == -1) { - // qDebug("'%s' not in list, use parent", w->className()); - w = w->parentWidget(); + w = tqApp->tqfocusWidget(); + while(w && d->m_tabOrderWidgets.tqfind(w) == -1) { + // qDebug("'%s' not in list, use tqparent", w->className()); + w = w->tqparentWidget(); } // if(w) qDebug("tab order is at '%s'", w->className()); currentWidget = d->m_tabOrderWidgets.current(); @@ -304,7 +304,7 @@ bool KEnterScheduleDlg::focusNextPrevChild(bool next) } if(w != currentWidget - && ((w->focusPolicy() & TabFocus) == TabFocus) + && ((w->focusPolicy() & TQ_TabFocus) == TQ_TabFocus) && w->isVisible() && w->isEnabled()) { // qDebug("Selecting '%s' as focus", w->className()); w->setFocus(); diff --git a/kmymoney2/dialogs/kenterscheduledlg.h b/kmymoney2/dialogs/kenterscheduledlg.h index 0e14ad4..8f45d75 100644 --- a/kmymoney2/dialogs/kenterscheduledlg.h +++ b/kmymoney2/dialogs/kenterscheduledlg.h @@ -39,8 +39,9 @@ class TransactionEditor; class KEnterScheduleDlg : public KEnterScheduleDlgDecl { Q_OBJECT + TQ_OBJECT public: - KEnterScheduleDlg(QWidget *parent, const MyMoneySchedule& schedule); + KEnterScheduleDlg(TQWidget *tqparent, const MyMoneySchedule& schedule); ~KEnterScheduleDlg(); TransactionEditor* startEdit(void); @@ -68,9 +69,9 @@ protected: * This method returns the adjusts @a _date according to * the setting of the schedule's weekend option. */ - QDate date(const QDate& _date) const; + TQDate date(const TQDate& _date) const; - void resizeEvent(QResizeEvent* ev); + void resizeEvent(TQResizeEvent* ev); public slots: int exec(void); diff --git a/kmymoney2/dialogs/kenterscheduledlgdecl.ui b/kmymoney2/dialogs/kenterscheduledlgdecl.ui index 3efed94..f81cdf8 100644 --- a/kmymoney2/dialogs/kenterscheduledlgdecl.ui +++ b/kmymoney2/dialogs/kenterscheduledlgdecl.ui @@ -1,6 +1,6 @@ KEnterScheduleDlgDecl - + KEnterScheduleDlgDecl @@ -22,7 +22,7 @@ unnamed - + groupBox1 @@ -33,7 +33,7 @@ unnamed - + textLabel5 @@ -45,7 +45,7 @@ 0 - + 70 0 @@ -59,7 +59,7 @@ Name: - + m_scheduleName @@ -67,7 +67,7 @@ - + textLabel1_2 @@ -79,7 +79,7 @@ 0 - + 70 0 @@ -93,7 +93,7 @@ Type: - + m_type @@ -167,7 +167,7 @@ 12 - + frame4 @@ -219,9 +219,9 @@ Horizontal - + - layout2 + tqlayout2 @@ -245,7 +245,7 @@ Expanding - + 190 20 @@ -326,5 +326,5 @@ reject() - + diff --git a/kmymoney2/dialogs/kequitypriceupdatedlg.cpp b/kmymoney2/dialogs/kequitypriceupdatedlg.cpp index 4111bfa..f5014d0 100644 --- a/kmymoney2/dialogs/kequitypriceupdatedlg.cpp +++ b/kmymoney2/dialogs/kequitypriceupdatedlg.cpp @@ -24,13 +24,13 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -61,8 +61,8 @@ #define ID_COL 4 #define SOURCE_COL 5 -KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(QWidget *parent, const QString& securityId) : - KEquityPriceUpdateDlgDecl(parent), +KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(TQWidget *tqparent, const TQString& securityId) : + KEquityPriceUpdateDlgDecl(tqparent), m_fUpdateAll(false) { lvEquityList->setRootIsDecorated(false); @@ -78,8 +78,8 @@ KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(QWidget *parent, const QString& sec lvEquityList->setColumnWidth(ID_COL, 0); lvEquityList->setMultiSelection(true); - lvEquityList->setColumnWidthMode(SYMBOL_COL, QListView::Maximum); - lvEquityList->setColumnWidthMode(ID_COL, QListView::Manual); + lvEquityList->setColumnWidthMode(SYMBOL_COL, TQListView::Maximum); + lvEquityList->setColumnWidthMode(ID_COL, TQListView::Manual); lvEquityList->setAllColumnsShowFocus(true); btnUpdateAll->setEnabled(false); @@ -92,7 +92,7 @@ KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(QWidget *parent, const QString& sec // send in securityId == "XXX YYY" to get a single-shot update for XXX to YYY. // for consistency reasons, this accepts the same delimiters as WebPriceQuote::launch() - QRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/); + TQRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/); MyMoneySecurityPair currencyIds; if ( splitrx.search(securityId) != -1 ) currencyIds = MyMoneySecurityPair(splitrx.cap(1).utf8(),splitrx.cap(2).utf8()); @@ -104,7 +104,7 @@ KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(QWidget *parent, const QString& sec if ( file->security( pair.first ).isCurrency() && ( securityId.isEmpty() || ( pair == currencyIds ) ) ) { const MyMoneyPriceEntries& entries = (*it_price); - if(entries.count() > 0 && entries.begin().key() <= QDate::currentDate()) { + if(entries.count() > 0 && entries.begin().key() <= TQDate::tqcurrentDate()) { addPricePair(pair); btnUpdateAll->setEnabled(true); } @@ -115,8 +115,8 @@ KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(QWidget *parent, const QString& sec // Add each investment // - QValueList securities = file->securityList(); - for(QValueList::ConstIterator it = securities.begin(); it != securities.end(); ++it) + TQValueList securities = file->securityList(); + for(TQValueList::ConstIterator it = securities.begin(); it != securities.end(); ++it) { if ( !(*it).isCurrency() && ( securityId.isEmpty() || ( (*it).id() == securityId ) ) @@ -133,33 +133,33 @@ KEquityPriceUpdateDlg::KEquityPriceUpdateDlg(QWidget *parent, const QString& sec addPricePair(currencyIds, true); } - connect(btnOK, SIGNAL(clicked()), this, SLOT(accept())); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(btnUpdateSelected, SIGNAL(clicked()), this, SLOT(slotUpdateSelectedClicked())); - connect(btnUpdateAll, SIGNAL(clicked()), this, SLOT(slotUpdateAllClicked())); + connect(btnOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(btnCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(btnUpdateSelected, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpdateSelectedClicked())); + connect(btnUpdateAll, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpdateAllClicked())); - connect(&m_webQuote,SIGNAL(quote(const QString&, const QString&,const QDate&, const double&)), - this,SLOT(slotReceivedQuote(const QString&, const QString&,const QDate&, const double&))); - connect(&m_webQuote,SIGNAL(failed(const QString&, const QString&)), - this,SLOT(slotQuoteFailed(const QString&, const QString&))); - connect(&m_webQuote,SIGNAL(status(const QString&)), - this,SLOT(logStatusMessage(const QString&))); - connect(&m_webQuote,SIGNAL(error(const QString&)), - this,SLOT(logErrorMessage(const QString&))); + connect(&m_webQuote,TQT_SIGNAL(quote(const TQString&, const TQString&,const TQDate&, const double&)), + this,TQT_SLOT(slotReceivedQuote(const TQString&, const TQString&,const TQDate&, const double&))); + connect(&m_webQuote,TQT_SIGNAL(failed(const TQString&, const TQString&)), + this,TQT_SLOT(slotQuoteFailed(const TQString&, const TQString&))); + connect(&m_webQuote,TQT_SIGNAL(status(const TQString&)), + this,TQT_SLOT(logStatusMessage(const TQString&))); + connect(&m_webQuote,TQT_SIGNAL(error(const TQString&)), + this,TQT_SLOT(logErrorMessage(const TQString&))); - connect(lvEquityList, SIGNAL(selectionChanged()), this, SLOT(slotUpdateSelection())); + connect(lvEquityList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotUpdateSelection())); // Not implemented yet. btnConfigure->hide(); - //connect(btnConfigure, SIGNAL(clicked()), this, SLOT(slotConfigureClicked())); + //connect(btnConfigure, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotConfigureClicked())); if ( !securityId.isEmpty() ) { btnUpdateSelected->hide(); btnUpdateAll->hide(); - // delete layout1; + // delete tqlayout1; - QTimer::singleShot(100,this,SLOT(slotUpdateAllClicked())); + TQTimer::singleShot(100,this,TQT_SLOT(slotUpdateAllClicked())); } // Hide OK button until we have received the first update @@ -183,19 +183,19 @@ void KEquityPriceUpdateDlg::addPricePair(const MyMoneySecurityPair& pair, bool d { MyMoneyFile* file = MyMoneyFile::instance(); - QString symbol = QString("%1 > %2").arg(pair.first,pair.second); - QString id = QString("%1 %2").arg(pair.first,pair.second); - if ( ! lvEquityList->findItem(id,ID_COL,Qt::ExactMatch) ) + TQString symbol = TQString("%1 > %2").tqarg(pair.first,pair.second); + TQString id = TQString("%1 %2").tqarg(pair.first,pair.second); + if ( ! lvEquityList->tqfindItem(id,ID_COL,TQt::ExactMatch) ) { MyMoneyPrice pr = file->price(pair.first,pair.second); if(pr.source() != "KMyMoney") { bool keep = true; if((pair.first == file->baseCurrency().id()) || (pair.second == file->baseCurrency().id())) { - const QString& foreignCurrency = file->foreignCurrency(pair.first, pair.second); + const TQString& foreignCurrency = file->foreignCurrency(pair.first, pair.second); // check that the foreign currency is still in use - QValueList::const_iterator it_a; - QValueList list; + TQValueList::const_iterator it_a; + TQValueList list; file->accountList(list); for(it_a = list.begin(); !dontCheckExistance && it_a != list.end(); ++it_a) { // if it's an account denominated in the foreign currency @@ -219,7 +219,7 @@ void KEquityPriceUpdateDlg::addPricePair(const MyMoneySecurityPair& pair, bool d if(keep) { KListViewItem* item = new KListViewItem(lvEquityList, symbol, - i18n("%1 units in %2").arg(pair.first,pair.second)); + i18n("%1 units in %2").tqarg(pair.first,pair.second)); if(pr.isValid()) { item->setText(PRICE_COL, pr.rate(pair.second).formatMoney(file->currency(pair.second).tradingSymbol(), KMyMoneyGlobalSettings::pricePrecision())); item->setText(DATE_COL, pr.date().toString(Qt::ISODate)); @@ -235,13 +235,13 @@ void KEquityPriceUpdateDlg::addInvestment(const MyMoneySecurity& inv) { MyMoneyFile* file = MyMoneyFile::instance(); - QString symbol = inv.tradingSymbol(); - QString id = inv.id(); - if ( ! lvEquityList->findItem(id, ID_COL, Qt::ExactMatch) ) + TQString symbol = inv.tradingSymbol(); + TQString id = inv.id(); + if ( ! lvEquityList->tqfindItem(id, ID_COL, TQt::ExactMatch) ) { // check that the security is still in use - QValueList::const_iterator it_a; - QValueList list; + TQValueList::const_iterator it_a; + TQValueList list; file->accountList(list); for(it_a = list.begin(); it_a != list.end(); ++it_a) { if((*it_a).isInvest() @@ -260,7 +260,7 @@ void KEquityPriceUpdateDlg::addInvestment(const MyMoneySecurity& inv) } item->setText(ID_COL,id); if (inv.value("kmm-online-quote-system") == "Finance::Quote") - item->setText(SOURCE_COL, QString("Finance::Quote %1").arg( inv.value("kmm-online-source"))); + item->setText(SOURCE_COL, TQString("Finance::Quote %1").tqarg( inv.value("kmm-online-source"))); else item->setText(SOURCE_COL, inv.value("kmm-online-source")); @@ -275,40 +275,40 @@ void KEquityPriceUpdateDlg::addInvestment(const MyMoneySecurity& inv) } } -void KEquityPriceUpdateDlg::logErrorMessage(const QString& message) +void KEquityPriceUpdateDlg::logErrorMessage(const TQString& message) { - logStatusMessage(QString("") + message + QString("")); + logStatusMessage(TQString("") + message + TQString("")); } -void KEquityPriceUpdateDlg::logStatusMessage(const QString& message) +void KEquityPriceUpdateDlg::logStatusMessage(const TQString& message) { - lbStatus->append(message); + lbtqStatus->append(message); } -MyMoneyPrice KEquityPriceUpdateDlg::price(const QString& id) const +MyMoneyPrice KEquityPriceUpdateDlg::price(const TQString& id) const { MyMoneyPrice price; - QListViewItem* item; + TQListViewItem* item; - if((item = lvEquityList->findItem(id, ID_COL, Qt::ExactMatch)) != 0) { + if((item = lvEquityList->tqfindItem(id, ID_COL, TQt::ExactMatch)) != 0) { MyMoneyMoney rate(item->text(PRICE_COL)); if ( !rate.isZero() ) { - QString id = item->text(ID_COL).utf8(); + TQString id = item->text(ID_COL).utf8(); // if the ID has a space, then this is TWO ID's, so it's a currency quote - if ( QString(id).contains(" ") ) + if ( TQString(id).tqcontains(" ") ) { - QStringList ids = QStringList::split(" ",QString(id)); - QString fromid = ids[0].utf8(); - QString toid = ids[1].utf8(); - price = MyMoneyPrice(fromid,toid,QDate().fromString(item->text(DATE_COL), Qt::ISODate),rate,item->text(SOURCE_COL)); + TQStringList ids = TQStringList::split(" ",TQString(id)); + TQString fromid = ids[0].utf8(); + TQString toid = ids[1].utf8(); + price = MyMoneyPrice(fromid,toid,TQDate().fromString(item->text(DATE_COL), Qt::ISODate),rate,item->text(SOURCE_COL)); } else // otherwise, it's a security quote { MyMoneySecurity security = MyMoneyFile::instance()->security(id); - price = MyMoneyPrice(id, security.tradingCurrency(), QDate().fromString(item->text(DATE_COL), Qt::ISODate), rate, item->text(SOURCE_COL)); + price = MyMoneyPrice(id, security.tradingCurrency(), TQDate().fromString(item->text(DATE_COL), Qt::ISODate), rate, item->text(SOURCE_COL)); } } } @@ -320,11 +320,11 @@ void KEquityPriceUpdateDlg::storePrices(void) // update the new prices into the equities MyMoneyFile* file = MyMoneyFile::instance(); - QValueList equities = file->securityList(); + TQValueList equities = file->securityList(); - QListViewItem* item = lvEquityList->firstChild(); + TQListViewItem* item = lvEquityList->firstChild(); MyMoneyFileTransaction ft; - QString name; + TQString name; try { while ( item ) { @@ -334,16 +334,16 @@ void KEquityPriceUpdateDlg::storePrices(void) MyMoneyMoney rate(item->text(PRICE_COL)); if ( !rate.isZero() ) { - QString id = item->text(ID_COL).utf8(); + TQString id = item->text(ID_COL).utf8(); // if the ID has a space, then this is TWO ID's, so it's a currency quote - if ( QString(id).contains(" ") ) + if ( TQString(id).tqcontains(" ") ) { - QStringList ids = QStringList::split(" ",QString(id)); - QString fromid = ids[0].utf8(); - QString toid = ids[1].utf8(); - name = QString("%1 --> %2").arg(fromid).arg(toid); - MyMoneyPrice price(fromid,toid,QDate().fromString(item->text(DATE_COL), Qt::ISODate),rate,item->text(SOURCE_COL)); + TQStringList ids = TQStringList::split(" ",TQString(id)); + TQString fromid = ids[0].utf8(); + TQString toid = ids[1].utf8(); + name = TQString("%1 --> %2").tqarg(fromid).tqarg(toid); + MyMoneyPrice price(fromid,toid,TQDate().fromString(item->text(DATE_COL), Qt::ISODate),rate,item->text(SOURCE_COL)); file->addPrice(price); } else @@ -351,7 +351,7 @@ void KEquityPriceUpdateDlg::storePrices(void) { MyMoneySecurity security = MyMoneyFile::instance()->security(id); name = security.name(); - MyMoneyPrice price(id, security.tradingCurrency(), QDate().fromString(item->text(DATE_COL), Qt::ISODate), rate, item->text(SOURCE_COL)); + MyMoneyPrice price(id, security.tradingCurrency(), TQDate().fromString(item->text(DATE_COL), Qt::ISODate), rate, item->text(SOURCE_COL)); // TODO (Ace) Better handling of the case where there is already a price // for this date. Currently, it just overrides the old value. Really it @@ -374,7 +374,7 @@ void KEquityPriceUpdateDlg::slotUpdateSelection(void) { btnUpdateSelected->setEnabled(false); - QListViewItem* item = lvEquityList->firstChild(); + TQListViewItem* item = lvEquityList->firstChild(); while ( item && !item->isSelected()) item = item->nextSibling(); @@ -384,7 +384,7 @@ void KEquityPriceUpdateDlg::slotUpdateSelection(void) void KEquityPriceUpdateDlg::slotUpdateSelectedClicked(void) { - QListViewItem* item = lvEquityList->firstChild(); + TQListViewItem* item = lvEquityList->firstChild(); int skipCnt = 1; while ( item && !item->isSelected()) { @@ -403,7 +403,7 @@ void KEquityPriceUpdateDlg::slotUpdateSelectedClicked(void) void KEquityPriceUpdateDlg::slotUpdateAllClicked(void) { - QListViewItem* item = lvEquityList->firstChild(); + TQListViewItem* item = lvEquityList->firstChild(); if ( item ) { prgOnlineProgress->setTotalSteps(1+lvEquityList->childCount()); @@ -415,16 +415,16 @@ void KEquityPriceUpdateDlg::slotUpdateAllClicked(void) logErrorMessage("Security list is empty."); } -void KEquityPriceUpdateDlg::slotQuoteFailed(const QString& _id, const QString& _symbol) +void KEquityPriceUpdateDlg::slotQuoteFailed(const TQString& _id, const TQString& _symbol) { - QListViewItem* item = lvEquityList->findItem(_id,ID_COL,Qt::ExactMatch); + TQListViewItem* item = lvEquityList->tqfindItem(_id,ID_COL,TQt::ExactMatch); // Give the user some options int result; - if(_id.contains(" ")) { - result = KMessageBox::warningContinueCancel(this, i18n("Failed to retrieve an exchange rate for %1 from %2. It will be skipped this time.").arg(_symbol, item->text(SOURCE_COL)), i18n("Price Update Failed")); + if(_id.tqcontains(" ")) { + result = KMessageBox::warningContinueCancel(this, i18n("Failed to retrieve an exchange rate for %1 from %2. It will be skipped this time.").tqarg(_symbol, item->text(SOURCE_COL)), i18n("Price Update Failed")); } else { - result = KMessageBox::questionYesNoCancel(this, QString("%1").arg(i18n("Failed to retrieve a quote for %1 from %2. Press No to remove the online price source from this security permanently, Yes to continue updating this security during future price updates or Cancel to stop the current update operation.").arg(_symbol, item->text(SOURCE_COL))), i18n("Price Update Failed"), KStdGuiItem::yes(), KStdGuiItem::no()); + result = KMessageBox::questionYesNoCancel(this, TQString("%1").tqarg(i18n("Failed to retrieve a quote for %1 from %2. Press No to remove the online price source from this security permanently, Yes to continue updating this security during future price updates or Cancel to stop the current update operation.").tqarg(_symbol, item->text(SOURCE_COL))), i18n("Price Update Failed"), KStdGuiItem::yes(), KStdGuiItem::no()); } if ( result == KMessageBox::No ) @@ -437,14 +437,14 @@ void KEquityPriceUpdateDlg::slotQuoteFailed(const QString& _id, const QString& _ MyMoneySecurity security = MyMoneyFile::instance()->security(_id.utf8()); // Set the quote source to blank - security.setValue("kmm-online-source",QString()); - security.setValue("kmm-online-quote-system",QString()); + security.setValue("kmm-online-source",TQString()); + security.setValue("kmm-online-quote-system",TQString()); // Re-commit the security MyMoneyFile::instance()->modifySecurity(security); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::error(this, QString("")+i18n("Cannot update security %1: %2").arg(_symbol, e->what())+QString(""), i18n("Price Update Failed")); + KMessageBox::error(this, TQString("")+i18n("Cannot update security %1: %2").tqarg(_symbol, e->what())+TQString(""), i18n("Price Update Failed")); delete e; } } @@ -452,7 +452,7 @@ void KEquityPriceUpdateDlg::slotQuoteFailed(const QString& _id, const QString& _ // As long as the user doesn't want to cancel, move on! if ( result != KMessageBox::Cancel ) { - QListViewItem* next = NULL; + TQListViewItem* next = NULL; prgOnlineProgress->advance(1); item->listView()->setSelected(item, false); @@ -482,25 +482,25 @@ void KEquityPriceUpdateDlg::slotQuoteFailed(const QString& _id, const QString& _ } } -void KEquityPriceUpdateDlg::slotReceivedQuote(const QString& _id, const QString& _symbol,const QDate& _date, const double& _price) +void KEquityPriceUpdateDlg::slotReceivedQuote(const TQString& _id, const TQString& _symbol,const TQDate& _date, const double& _price) { - QListViewItem* item = lvEquityList->findItem(_id,ID_COL,Qt::ExactMatch); - QListViewItem* next = NULL; + TQListViewItem* item = lvEquityList->tqfindItem(_id,ID_COL,TQt::ExactMatch); + TQListViewItem* next = NULL; if ( item ) { if ( _price > 0.0f && _date.isValid() ) { - QDate date = _date; - if ( date > QDate::currentDate() ) - date = QDate::currentDate(); + TQDate date = _date; + if ( date > TQDate::tqcurrentDate() ) + date = TQDate::tqcurrentDate(); double price = _price; - QString id = _id.utf8(); + TQString id = _id.utf8(); MyMoneySecurity sec; - if ( _id.contains(" ") == 0) { + if ( _id.tqcontains(" ") == 0) { MyMoneySecurity security = MyMoneyFile::instance()->security(id); - QString factor = security.value("kmm-online-factor"); + TQString factor = security.value("kmm-online-factor"); if(!factor.isEmpty()) { price *= MyMoneyMoney(factor).toDouble(); } @@ -513,7 +513,7 @@ void KEquityPriceUpdateDlg::slotReceivedQuote(const QString& _id, const QString& } } else { - QRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/); + TQRegExp splitrx("([0-9a-z\\.]+)[^a-z0-9]+([0-9a-z\\.]+)",false /*case sensitive*/); if ( splitrx.search(_id) != -1 ) { try { sec = MyMoneyFile::instance()->security(splitrx.cap(2).utf8()); @@ -525,13 +525,13 @@ void KEquityPriceUpdateDlg::slotReceivedQuote(const QString& _id, const QString& } item->setText(PRICE_COL, KGlobal::locale()->formatMoney(price, sec.tradingSymbol(), KMyMoneyGlobalSettings::pricePrecision())); item->setText(DATE_COL, date.toString(Qt::ISODate)); - logStatusMessage(i18n("Price for %1 updated (id %2)").arg(_symbol,_id)); + logStatusMessage(i18n("Price for %1 updated (id %2)").tqarg(_symbol,_id)); // make sure to make OK button available btnOK->setEnabled(true); } else { - logErrorMessage(i18n("Received an invalid price for %1, unable to update.").arg(_symbol)); + logErrorMessage(i18n("Received an invalid price for %1, unable to update.").tqarg(_symbol)); } prgOnlineProgress->advance(1); @@ -551,7 +551,7 @@ void KEquityPriceUpdateDlg::slotReceivedQuote(const QString& _id, const QString& } else { - logErrorMessage(i18n("Received a price for %1 (id %2), but this symbol is not on the list! Aborting entire update.").arg(_symbol,_id)); + logErrorMessage(i18n("Received a price for %1 (id %2), but this symbol is not on the list! Aborting entire update.").tqarg(_symbol,_id)); } if (next) diff --git a/kmymoney2/dialogs/kequitypriceupdatedlg.h b/kmymoney2/dialogs/kequitypriceupdatedlg.h index 7dbc6a5..a5a0bac 100644 --- a/kmymoney2/dialogs/kequitypriceupdatedlg.h +++ b/kmymoney2/dialogs/kequitypriceupdatedlg.h @@ -20,16 +20,16 @@ * * ***************************************************************************/ -#ifndef KEQUITYPRICEUPDATEDIALOG_H -#define KEQUITYPRICEUPDATEDIALOG_H +#ifndef KETQUITYPRICEUPDATEDIALOG_H +#define KETQUITYPRICEUPDATEDIALOG_H // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -class QListViewItem; +#include +#include +#include +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes @@ -51,21 +51,22 @@ class QListViewItem; class KEquityPriceUpdateDlg : public KEquityPriceUpdateDlgDecl { Q_OBJECT + TQ_OBJECT public: - KEquityPriceUpdateDlg(QWidget *parent, const QString& securityId = QString()); + KEquityPriceUpdateDlg(TQWidget *tqparent, const TQString& securityId = TQString()); ~KEquityPriceUpdateDlg(); void storePrices(void); - MyMoneyPrice price(const QString& id) const; + MyMoneyPrice price(const TQString& id) const; protected slots: void slotUpdateSelectedClicked(void); void slotUpdateAllClicked(void); void slotUpdateSelection(void); - void logStatusMessage(const QString&); - void logErrorMessage(const QString&); - void slotReceivedQuote(const QString&, const QString&,const QDate&, const double&); - void slotQuoteFailed(const QString& _id, const QString& _symbol); + void logStatusMessage(const TQString&); + void logErrorMessage(const TQString&); + void slotReceivedQuote(const TQString&, const TQString&,const TQDate&, const double&); + void slotQuoteFailed(const TQString& _id, const TQString& _symbol); protected: void addPricePair(const MyMoneySecurityPair& pair, bool dontCheckExistance = false); diff --git a/kmymoney2/dialogs/kequitypriceupdatedlgdecl.ui b/kmymoney2/dialogs/kequitypriceupdatedlgdecl.ui index a06c44d..91a1fc6 100644 --- a/kmymoney2/dialogs/kequitypriceupdatedlgdecl.ui +++ b/kmymoney2/dialogs/kequitypriceupdatedlgdecl.ui @@ -1,7 +1,7 @@ KEquityPriceUpdateDlgDecl Kevin Tambascio <ktambascio@users.sourceforge.net> - + kequitypriceupdatedlgdecl @@ -24,7 +24,7 @@ lvEquityList - + 350 0 @@ -49,9 +49,9 @@ List of known Equities, and the date they were last updated on. - + - layout5 + tqlayout5 @@ -75,7 +75,7 @@ Expanding - + 21 20 @@ -100,17 +100,17 @@ - + textLabel1 - Status: + tqStatus: - lbStatus + lbtqStatus LogText @@ -121,9 +121,9 @@ prgOnlineProgress - + - layout3 + tqlayout3 @@ -139,7 +139,7 @@ Expanding - + 91 20 @@ -175,5 +175,5 @@ - + diff --git a/kmymoney2/dialogs/kexportdlg.cpp b/kmymoney2/dialogs/kexportdlg.cpp index c00e3cf..701d138 100644 --- a/kmymoney2/dialogs/kexportdlg.cpp +++ b/kmymoney2/dialogs/kexportdlg.cpp @@ -20,20 +20,16 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers #include #include -#if QT_VERSION > 300 #include -#else -#include -#endif #include #include #include @@ -49,8 +45,8 @@ #include "../widgets/kmymoneyaccountcombo.h" #include "../kmymoneyutils.h" -KExportDlg::KExportDlg(QWidget *parent) - : KExportDlgDecl(parent, 0, true) +KExportDlg::KExportDlg(TQWidget *tqparent) + : KExportDlgDecl(tqparent, 0, true) { // Set (almost) all the last used options readConfig(); @@ -63,40 +59,40 @@ KExportDlg::KExportDlg(QWidget *parent) m_qbuttonCancel->setGuiItem(KStdGuiItem::cancel()); KGuiItem okButtenItem( i18n( "&Export" ), - QIconSet(il->loadIcon("fileexport", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("fileexport", KIcon::Small, KIcon::SizeSmall)), i18n("Start operation"), i18n("Use this to start the export operation")); m_qbuttonOk->setGuiItem(okButtenItem); KGuiItem browseButtenItem( i18n( "&Browse..." ), - QIconSet(il->loadIcon("fileopen", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("fileopen", KIcon::Small, KIcon::SizeSmall)), i18n("Select filename"), i18n("Use this to select a filename to export to")); m_qbuttonBrowse->setGuiItem(browseButtenItem); KGuiItem newButtenItem( i18n( "&New..." ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new profile"), i18n("Use this to open the profile editor")); m_profileEditorButton->setGuiItem(newButtenItem); // connect the buttons to their functionality - connect(m_qbuttonBrowse, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); - connect(m_profileEditorButton, SIGNAL(clicked()), this, SLOT(slotNewProfile())); - connect(m_qbuttonOk, SIGNAL(clicked()), this, SLOT(slotOkClicked())); - connect(m_qbuttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(m_qbuttonBrowse, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotBrowse() ) ); + connect(m_profileEditorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewProfile())); + connect(m_qbuttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOkClicked())); + connect(m_qbuttonCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); // connect the change signals to the check slot and perform initial check - connect(m_qlineeditFile, SIGNAL(textChanged(const QString&)), this, SLOT(checkData())); - connect(m_qcheckboxAccount, SIGNAL(toggled(bool)), this, SLOT(checkData())); - connect(m_qcheckboxCategories, SIGNAL(toggled(bool)), this, SLOT(checkData())); - connect(m_accountComboBox, SIGNAL(accountSelected(const QString&)), this, SLOT(checkData(const QString&))); - connect(m_profileComboBox, SIGNAL(highlighted(int)), this, SLOT(checkData())); - connect(m_kmymoneydateStart, SIGNAL(dateChanged(const QDate&)), this, SLOT(checkData())); - connect(m_kmymoneydateEnd, SIGNAL(dateChanged(const QDate&)), this, SLOT(checkData())); - - checkData(QString()); + connect(m_qlineeditFile, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(checkData())); + connect(m_qcheckboxAccount, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkData())); + connect(m_qcheckboxCategories, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(checkData())); + connect(m_accountComboBox, TQT_SIGNAL(accountSelected(const TQString&)), this, TQT_SLOT(checkData(const TQString&))); + connect(m_profileComboBox, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(checkData())); + connect(m_kmymoneydateStart, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(checkData())); + connect(m_kmymoneydateEnd, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(checkData())); + + checkData(TQString()); } KExportDlg::~KExportDlg() @@ -105,15 +101,15 @@ KExportDlg::~KExportDlg() void KExportDlg::slotBrowse() { - QString newName(KFileDialog::getSaveFileName(QString::null,"*.QIF")); - KMyMoneyUtils::appendCorrectFileExt(newName, QString("qif")); + TQString newName(KFileDialog::getSaveFileName(TQString(),"*.TQIF")); + KMyMoneyUtils::appendCorrectFileExt(newName, TQString("qif")); if (!newName.isEmpty()) m_qlineeditFile->setText(newName); } void KExportDlg::slotNewProfile(void) { - MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "QIF Profile Editor"); + MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "TQIF Profile Editor"); if(editor->exec()) { m_profileComboBox->setCurrentText(editor->selectedProfile()); loadProfiles(); @@ -129,11 +125,11 @@ void KExportDlg::loadProfiles(const bool selectLast) edit->slotOk(); delete edit; - QString current = m_profileComboBox->currentText(); + TQString current = m_profileComboBox->currentText(); m_profileComboBox->clear(); - QStringList list; + TQStringList list; KConfig* config = KGlobal::config(); config->setGroup("Profiles"); @@ -147,7 +143,7 @@ void KExportDlg::loadProfiles(const bool selectLast) } m_profileComboBox->setCurrentItem(0); - if(list.contains(current) > 0) + if(list.tqcontains(current) > 0) m_profileComboBox->setCurrentText(current); } @@ -178,19 +174,19 @@ void KExportDlg::writeConfig(void) kconfig->writeEntry("KExportDlg_LastFile", m_qlineeditFile->text()); kconfig->writeEntry("KExportDlg_AccountOpt", m_qcheckboxAccount->isChecked()); kconfig->writeEntry("KExportDlg_CatOpt", m_qcheckboxCategories->isChecked()); - kconfig->writeEntry("KExportDlg_StartDate", QDateTime(m_kmymoneydateStart->date())); - kconfig->writeEntry("KExportDlg_EndDate", QDateTime(m_kmymoneydateEnd->date())); + kconfig->writeEntry("KExportDlg_StartDate", TQDateTime(m_kmymoneydateStart->date())); + kconfig->writeEntry("KExportDlg_EndDate", TQDateTime(m_kmymoneydateEnd->date())); kconfig->writeEntry("KExportDlg_LastProfile", m_profileComboBox->currentText()); kconfig->sync(); } -void KExportDlg::checkData(const QString& accountId) +void KExportDlg::checkData(const TQString& accountId) { bool okEnabled = false; if(!m_qlineeditFile->text().isEmpty()) { - QString strFile(m_qlineeditFile->text()); - if(KMyMoneyUtils::appendCorrectFileExt(strFile, QString("qif"))) + TQString strFile(m_qlineeditFile->text()); + if(KMyMoneyUtils::appendCorrectFileExt(strFile, TQString("qif"))) m_qlineeditFile->setText(strFile); } @@ -200,8 +196,8 @@ void KExportDlg::checkData(const QString& accountId) account = file->account(accountId); if(m_lastAccount != accountId) { MyMoneyTransactionFilter filter(accountId); - QValueList list = file->transactionList(filter); - QValueList::Iterator it; + TQValueList list = file->transactionList(filter); + TQValueList::Iterator it; if(!list.isEmpty()) { it = list.begin(); @@ -228,14 +224,14 @@ void KExportDlg::checkData(const QString& accountId) void KExportDlg::loadAccounts(void) { /* - QStringList strList; + TQStringList strList; try { MyMoneyFile *file = MyMoneyFile::instance(); // read all account items from the MyMoneyFile objects and add them to the listbox - addCategories(strList, file->liability().id(), QString()); - addCategories(strList, file->asset().id(), QString()); + addCategories(strList, file->liability().id(), TQString()); + addCategories(strList, file->asset().id(), TQString()); } catch (MyMoneyException *e) { qDebug("Exception '%s' thrown in %s, line %ld caught in KExportDlg::loadAccounts:%d", @@ -247,26 +243,26 @@ void KExportDlg::loadAccounts(void) /* m_accountComboBox->setCurrentItem(0); - if(strList.contains(current) > 0) + if(strList.tqcontains(current) > 0) m_accountComboBox->setCurrentText(current); */ } -QString KExportDlg::accountId() const +TQString KExportDlg::accountId() const { return m_lastAccount; } /* -void KExportDlg::addCategories(QStringList& strList, const QString& id, const QString& leadIn) const +void KExportDlg::addCategories(TQStringList& strList, const TQString& id, const TQString& leadIn) const { MyMoneyFile *file = MyMoneyFile::instance(); - QString name; + TQString name; MyMoneyAccount account = file->account(id); - QStringList accList = account.accountList(); - QStringList::ConstIterator it_a; + TQStringList accList = account.accountList(); + TQStringList::ConstIterator it_a; for(it_a = accList.begin(); it_a != accList.end(); ++it_a) { account = file->account(*it_a); @@ -275,7 +271,7 @@ void KExportDlg::addCategories(QStringList& strList, const QString& id, const QS } } -QString KExportDlg::accountId(const QString& account) const +TQString KExportDlg::accountId(const TQString& account) const { return MyMoneyFile::instance()->nameToAccount(account); } diff --git a/kmymoney2/dialogs/kexportdlg.h b/kmymoney2/dialogs/kexportdlg.h index cad5091..9afca12 100644 --- a/kmymoney2/dialogs/kexportdlg.h +++ b/kmymoney2/dialogs/kexportdlg.h @@ -23,8 +23,8 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -39,9 +39,9 @@ /** * This class is used to select the required user input to export - * a specified account to the popular QIF format. - * It relies upon the QIF file handling routines in MyMoneyQifProfile and - * MyMoneyQifWriter to do the actual writing of QIF files. + * a specified account to the popular TQIF format. + * It relies upon the TQIF file handling routines in MyMoneyQifProfile and + * MyMoneyQifWriter to do the actual writing of TQIF files. * * It uses the global KConfig object to read and write the application * settings. @@ -50,47 +50,48 @@ * * @author Felix Rodriguez, Michael Edwardes, Thomas Baumgart 2000-2003 * - * @short A class to select user data required to export a specified account to the popular QIF format. + * @short A class to select user data required to export a specified account to the popular TQIF format. **/ class KExportDlg : public KExportDlgDecl { Q_OBJECT + TQ_OBJECT public: - KExportDlg(QWidget *parent); + KExportDlg(TQWidget *tqparent); ~KExportDlg(); /** * This method returns the filename entered into the edit field * - * @return QString with filename + * @return TQString with filename */ - const QString filename(void) const { return m_qlineeditFile->text(); }; + const TQString filename(void) const { return m_qlineeditFile->text(); }; /** * This method returns the account id that has been selected for export * - * @return QString with account id + * @return TQString with account id */ - QString accountId(void) const; + TQString accountId(void) const; /** * This method returns the name of the profile that has been selected * for the export operation * - * @return QString with profile name + * @return TQString with profile name */ - const QString profile(void) const { return m_profileComboBox->currentText(); }; + const TQString profile(void) const { return m_profileComboBox->currentText(); }; /** * This method returns the start date of the export dialog */ - const QDate startDate(void) const { return m_kmymoneydateStart->date(); }; + const TQDate startDate(void) const { return m_kmymoneydateStart->date(); }; /** * This method returns the end date of the export dialog */ - const QDate endDate(void) const { return m_kmymoneydateEnd->date(); }; + const TQDate endDate(void) const { return m_kmymoneydateEnd->date(); }; /** * This method returns the state of the account checkbox @@ -109,7 +110,7 @@ protected slots: void slotOkClicked(); /** - * Called when the user needs to browse the filesystem for a QIF file + * Called when the user needs to browse the filesystem for a TQIF file */ void slotBrowse(); @@ -130,7 +131,7 @@ protected slots: * * @param account The id of the selected account. */ - void checkData(const QString& account = QString()); + void checkData(const TQString& account = TQString()); private: void readConfig(void); @@ -162,7 +163,7 @@ private: * @param id Account id to add * @param leadIn constant leadin to be added in front of the account name */ - // void addCategories(QStringList& strList, const QString& id, const QString& leadIn) const; + // void addCategories(TQStringList& strList, const TQString& id, const TQString& leadIn) const; /** * This method is used to return the account id of a given account name @@ -171,10 +172,10 @@ private: * @return the ID of the account will be returned. * See MyMoneyFile::nameToAccount() for details. */ - // QString accountId(const QString& account) const; + // TQString accountId(const TQString& account) const; private: - QString m_lastAccount; + TQString m_lastAccount; }; #endif diff --git a/kmymoney2/dialogs/kexportdlgdecl.ui b/kmymoney2/dialogs/kexportdlgdecl.ui index 5425210..922355d 100644 --- a/kmymoney2/dialogs/kexportdlgdecl.ui +++ b/kmymoney2/dialogs/kexportdlgdecl.ui @@ -1,6 +1,6 @@ KExportDlgDecl - + KExportDlgDecl @@ -20,7 +20,7 @@ 6 - + Layout7 @@ -34,7 +34,7 @@ 6 - + TextLabel2 @@ -57,7 +57,7 @@ You can choose the file's path, the account and the format of the QIF file (profile). Choose Account to export all the transactions between the specified dates or just categories. You can also limit the transactions that are exported by start and ending date. Once you have pressed the Export button a message box will appear when the export has completed detailing how many transactions, categories and payees were exported. - + WordBreak|AlignTop|AlignLeft @@ -79,7 +79,7 @@ You can choose the file's path, the account and the format of the QIF file (prof Horizontal - + Layout45 @@ -93,7 +93,7 @@ You can choose the file's path, the account and the format of the QIF file (prof 6 - + lblFileExport @@ -109,7 +109,7 @@ You can choose the file's path, the account and the format of the QIF file (prof File to export to: - + m_qlineeditFile @@ -130,23 +130,23 @@ You can choose the file's path, the account and the format of the QIF file (prof - + - layout11 + tqlayout11 unnamed - + - layout10 + tqlayout10 unnamed - + TextLabel2_2 @@ -161,7 +161,7 @@ You can choose the file's path, the account and the format of the QIF file (prof - + Layout47 @@ -175,7 +175,7 @@ You can choose the file's path, the account and the format of the QIF file (prof 6 - + TextLabel3 @@ -183,7 +183,7 @@ You can choose the file's path, the account and the format of the QIF file (prof QIF Profile - + Layout46 @@ -209,7 +209,7 @@ You can choose the file's path, the account and the format of the QIF file (prof 0 - + 200 0 @@ -233,15 +233,15 @@ You can choose the file's path, the account and the format of the QIF file (prof - + - layout13 + tqlayout13 unnamed - + m_qgroupboxContents @@ -258,7 +258,7 @@ You can choose the file's path, the account and the format of the QIF file (prof 6 - + m_qcheckboxAccount @@ -266,7 +266,7 @@ You can choose the file's path, the account and the format of the QIF file (prof Account - + m_qcheckboxCategories @@ -276,7 +276,7 @@ You can choose the file's path, the account and the format of the QIF file (prof - + m_qgroupboxDates @@ -293,9 +293,9 @@ You can choose the file's path, the account and the format of the QIF file (prof 6 - + - layout12 + tqlayout12 @@ -306,7 +306,7 @@ You can choose the file's path, the account and the format of the QIF file (prof m_kmymoneydateStart - + lblEndDate @@ -318,7 +318,7 @@ You can choose the file's path, the account and the format of the QIF file (prof 0 - + 50 0 @@ -328,7 +328,7 @@ You can choose the file's path, the account and the format of the QIF file (prof End on: - + lblStartDate @@ -340,7 +340,7 @@ You can choose the file's path, the account and the format of the QIF file (prof 0 - + 50 0 @@ -377,7 +377,7 @@ You can choose the file's path, the account and the format of the QIF file (prof Expanding - + 230 16 @@ -400,7 +400,7 @@ You can choose the file's path, the account and the format of the QIF file (prof Horizontal - + Layout49 @@ -424,7 +424,7 @@ You can choose the file's path, the account and the format of the QIF file (prof Expanding - + 451 0 @@ -503,5 +503,5 @@ You can choose the file's path, the account and the format of the QIF file (prof 789c9595c94eeb581086f73c4544ed50ab6eecd889ad562f1802843961a6d58b632764228c616cf5bb77f9d45fe75e11165c4c703e55d55fc319f8b152bb38daafadfc587a9abbf9b8ac9523f7585be93fcf66ef7ffff3d7bf4bcb715c93df2891d7f21f4bcb5cd4cadac1ddedc003fd02ddf9af16274075ffe3b91738f33c01276aa722b0b753ec390b7c0cce107f092e238d7fa838aa578fe713b0c5bf1aabdddd8033e49f1923be052e11df31867dc77366fe1c81cdbeab1c5b3d4d30f2d351c571dd988fc196ffda731e43cf811b98a79b06d6fa5e8c11ff1458e775054ec0dd8a1b91f9731d9ca9dd0d9513d35ff79c9b9dc7c68ddcdbf7c125ecefca16cf7e9e4994987dcfb34b73d86363e41f559cc6691ff93f8c119f2a3723b5bb8931faffc91abf691cabfd0e9c42ffd21876bf9ea90bf946c6a9f37ca66cf16e0c463fb46a8cf95e0456bb3346be3ad8fa3d34463fcf153763b33b678cf853e516e6415bc688bf31567fde04a7e8cffcd13ffbf56f4afea6ef971265f157bdd218f9d7c0e8878fc0a88ffdfe6f355a51abe1b9ad9c59ff0781fd7e62afdf2a5a79abf0f63765f377857123f2f67bb0e5f3e7256bb4f24cf3ed83fbcad4530efe99e722373e5476981faf05d679ad1aa3fe0b63ad8737c0982fed19c33ea8384ff2284f3c1f283b9be746609dc79bb19e37877837403d3bca458cf3531a23de9fdfbc147fed673bb0d6f7688cfc5960cdd737c6bc87caa2affe8dc09aefc338d17e3be026f291b1fad318ecb0bf38b0f677628cf5f1f7ab4b4c8f7363d4731b58eb2763d43f02231f9f0656bd8631f44cdfe6d535c67afaf9b8d245aef43c05a7e04439c44f8d511f2b9736cf79609d0ff44b9bd719d8ea7b0763fdd89f8742ea6beabfed73e53206df05d6fbecd618e7f311dc84ff0bd82993df7f453fd81f02abdecc58f737a56087fbf3d518f14f81f5bed17afb7dac07b58dd19fbfcfcab418383d3f73e550df36d8fa7f0eacfa57ca03ccbb3b67928ffbc6435eaf10ef92fb3ce06b1e7ef18c78cc138d80bee329dff08c6ff98eeff9811ff989e7fcecdf2ffcca6ffcfed39f0bf93610ef0f5ee5355ee70d6ef3266fc9df6deec8b3c3bbbcf7497f5fb40ff8503c8eb8cb3d6fedf1b1d0099f4accd927fd219f7bef0bf1eaf1255f719d23ff3de606279c7ed26f4addeba25629b738e39c98881c891695d45fd4a7016fd075e54d431ad1980f684253bae11ecde896ee16f41fe95e6c0f9c55def4484f92ab4573afd1a6e785fa5f65264ebc72effd22b1aff446eff421d60b5a5dd09fd39af8af134b254fbe8f8836a84d958aa3ad85fab765de3dea48979b555db4237ebbb447fbf23ea0c3c5fa799b643ea2d595ba7ba2bd2b9e0f744c27dca0d32feaef5029fe056f499767744e173413cb842ee98aea5fe877a4d7a85a577aa148a6b94fb1ecb3091d5183924ffa234a659f9c4ae61b8e6cffd2896837a945d9c2fa8e650fcadea2bc72e3b69399b842a2afe41eebbb81bbfea43f7143d983a91b714a776e4cab74e89f3a6db9899bba9b4ffadf7c82fe6ff857e7f7f7f425e25b39baf3e5fffe5cfa1fdc4beba0 - + diff --git a/kmymoney2/dialogs/kfindtransactiondlg.cpp b/kmymoney2/dialogs/kfindtransactiondlg.cpp index f122ba2..a1d5214 100644 --- a/kmymoney2/dialogs/kfindtransactiondlg.cpp +++ b/kmymoney2/dialogs/kfindtransactiondlg.cpp @@ -17,12 +17,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -56,15 +56,15 @@ #include "ksortoptiondlg.h" -KFindTransactionDlg::KFindTransactionDlg(QWidget *parent, const char *name) : - KFindTransactionDlgDecl(parent, name, false), +KFindTransactionDlg::KFindTransactionDlg(TQWidget *tqparent, const char *name) : + KFindTransactionDlgDecl(tqparent, name, false), m_needReload(false) { m_register->installEventFilter(this); m_tabWidget->setTabEnabled(m_resultPage, false); // 'cause we don't have a separate setupTextPage - connect(m_textEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); + connect(m_textEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); setupAccountsPage(); setupCategoriesPage(); @@ -74,16 +74,16 @@ KFindTransactionDlg::KFindTransactionDlg(QWidget *parent, const char *name) : setupDetailsPage(); // We don't need to add the default into the list (see ::slotShowHelp() why) - // m_helpAnchor[m_textTab] = QString("details.search"); - m_helpAnchor[m_accountTab] = QString("details.search.account"); - m_helpAnchor[m_dateTab] = QString("details.search.date"); - m_helpAnchor[m_amountTab] = QString("details.search.amount"); - m_helpAnchor[m_categoryTab] = QString("details.search.category"); - m_helpAnchor[m_payeeTab] = QString("details.search.payee"); - m_helpAnchor[m_detailsTab] = QString("details.search.details"); + // m_helpAnchor[m_textTab] = TQString("details.search"); + m_helpAnchor[m_accountTab] = TQString("details.search.account"); + m_helpAnchor[m_dateTab] = TQString("details.search.date"); + m_helpAnchor[m_amountTab] = TQString("details.search.amount"); + m_helpAnchor[m_categoryTab] = TQString("details.search.category"); + m_helpAnchor[m_payeeTab] = TQString("details.search.payee"); + m_helpAnchor[m_detailsTab] = TQString("details.search.details"); // setup the register - QValueList cols; + TQValueList cols; cols << KMyMoneyRegister::DateColumn; cols << KMyMoneyRegister::AccountColumn; cols << KMyMoneyRegister::DetailColumn; @@ -91,26 +91,26 @@ KFindTransactionDlg::KFindTransactionDlg(QWidget *parent, const char *name) : cols << KMyMoneyRegister::PaymentColumn; cols << KMyMoneyRegister::DepositColumn; m_register->setupRegister(MyMoneyAccount(), cols); - m_register->setSelectionMode(QTable::Single); + m_register->setSelectionMode(TQTable::Single); - connect(m_register, SIGNAL(editTransaction()), this, SLOT(slotSelectTransaction())); - connect(m_register, SIGNAL(headerClicked()), this, SLOT(slotSortOptions())); + connect(m_register, TQT_SIGNAL(editTransaction()), this, TQT_SLOT(slotSelectTransaction())); + connect(m_register, TQT_SIGNAL(headerClicked()), this, TQT_SLOT(slotSortOptions())); slotUpdateSelections(); // setup the connections - connect(m_searchButton, SIGNAL(clicked()), this, SLOT(slotSearch())); - connect(m_resetButton, SIGNAL(clicked()), this, SLOT(slotReset())); - connect(m_resetButton, SIGNAL(clicked()), m_accountsView, SLOT(slotSelectAllAccounts())); - connect(m_resetButton, SIGNAL(clicked()), m_categoriesView, SLOT(slotSelectAllAccounts())); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(deleteLater())); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotShowHelp())); + connect(m_searchButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSearch())); + connect(m_resetButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReset())); + connect(m_resetButton, TQT_SIGNAL(clicked()), m_accountsView, TQT_SLOT(slotSelectAllAccounts())); + connect(m_resetButton, TQT_SIGNAL(clicked()), m_categoriesView, TQT_SLOT(slotSelectAllAccounts())); + connect(m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteLater())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotShowHelp())); // only allow searches when a selection has been made - connect(this, SIGNAL(selectionEmpty(bool)), m_searchButton, SLOT(setDisabled(bool))); + connect(this, TQT_SIGNAL(selectionEmpty(bool)), m_searchButton, TQT_SLOT(setDisabled(bool))); // get signal about engine changes - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotRefreshView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotRefreshView())); slotUpdateSelections(); @@ -119,7 +119,7 @@ KFindTransactionDlg::KFindTransactionDlg(QWidget *parent, const char *name) : void KFindTransactionDlg::slotReset(void) { - m_textEdit->setText(QString()); + m_textEdit->setText(TQString()); m_regExp->setChecked(false); m_caseSensitive->setChecked(false); m_textNegate->setCurrentItem(0); @@ -127,9 +127,9 @@ void KFindTransactionDlg::slotReset(void) m_amountEdit->setEnabled(true); m_amountFromEdit->setEnabled(false); m_amountToEdit->setEnabled(false); - m_amountEdit->loadText(QString()); - m_amountFromEdit->loadText(QString()); - m_amountToEdit->loadText(QString()); + m_amountEdit->loadText(TQString()); + m_amountFromEdit->loadText(TQString()); + m_amountToEdit->loadText(TQString()); m_amountButton->setChecked(true); m_amountRangeButton->setChecked(false); @@ -143,9 +143,9 @@ void KFindTransactionDlg::slotReset(void) m_nrEdit->setEnabled(true); m_nrFromEdit->setEnabled(false); m_nrToEdit->setEnabled(false); - m_nrEdit->setText(QString()); - m_nrFromEdit->setText(QString()); - m_nrToEdit->setText(QString()); + m_nrEdit->setText(TQString()); + m_nrFromEdit->setText(TQString()); + m_nrToEdit->setText(TQString()); m_nrButton->setChecked(true); m_nrRangeButton->setChecked(false); @@ -160,14 +160,14 @@ void KFindTransactionDlg::slotReset(void) void KFindTransactionDlg::slotUpdateSelections(void) { - QString txt; + TQString txt; // Text tab if(!m_textEdit->text().isEmpty()) { if(!txt.isEmpty()) txt += ", "; txt += i18n("Text"); - m_regExp->setEnabled(QRegExp(m_textEdit->text()).isValid()); + m_regExp->setEnabled(TQRegExp(m_textEdit->text()).isValid()); } else m_regExp->setEnabled(false); @@ -241,13 +241,13 @@ void KFindTransactionDlg::slotUpdateSelections(void) m_selectedCriteria->setText(i18n("Current selections: ") + txt); } -bool KFindTransactionDlg::allItemsSelected(const QListViewItem *item) const +bool KFindTransactionDlg::allItemsSelected(const TQListViewItem *item) const { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { if(it_v->rtti() == 1) { - QCheckListItem* it_c = static_cast(it_v); + TQCheckListItem* it_c = static_cast(it_v); if(!(it_c->isOn() && allItemsSelected(it_v))) return false; } @@ -255,14 +255,14 @@ bool KFindTransactionDlg::allItemsSelected(const QListViewItem *item) const return true; } -bool KFindTransactionDlg::allItemsSelected(const QListView* view) const +bool KFindTransactionDlg::allItemsSelected(const TQListView* view) const { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = view->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { if(it_v->rtti() == 1) { - QCheckListItem* it_c = static_cast(it_v); - if(it_c->type() == QCheckListItem::CheckBox) { + TQCheckListItem* it_c = static_cast(it_v); + if(it_c->type() == TQCheckListItem::CheckBox) { if(!(it_c->isOn() && allItemsSelected(it_v))) return false; } else { @@ -276,23 +276,23 @@ bool KFindTransactionDlg::allItemsSelected(const QListView* view) const void KFindTransactionDlg::setupAccountsPage(void) { - m_accountsView->setSelectionMode(QListView::Multi); + m_accountsView->setSelectionMode(TQListView::Multi); AccountSet accountSet; accountSet.addAccountGroup(MyMoneyAccount::Asset); accountSet.addAccountGroup(MyMoneyAccount::Liability); //set the accountset to show closed account if the settings say so accountSet.setHideClosedAccounts(KMyMoneyGlobalSettings::hideClosedAccounts()); accountSet.load(m_accountsView); - connect(m_accountsView, SIGNAL(stateChanged()), this, SLOT(slotUpdateSelections())); + connect(m_accountsView, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotUpdateSelections())); } -void KFindTransactionDlg::selectAllItems(QListView* view, const bool state) +void KFindTransactionDlg::selectAllItems(TQListView* view, const bool state) { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = view->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { - QCheckListItem* it_c = static_cast(it_v); - if(it_c->type() == QCheckListItem::CheckBox) { + TQCheckListItem* it_c = static_cast(it_v); + if(it_c->type() == TQCheckListItem::CheckBox) { it_c->setOn(state); } selectAllSubItems(it_v, state); @@ -301,13 +301,13 @@ void KFindTransactionDlg::selectAllItems(QListView* view, const bool state) slotUpdateSelections(); } -void KFindTransactionDlg::selectItems(QListView* view, const QStringList& list, const bool state) +void KFindTransactionDlg::selectItems(TQListView* view, const TQStringList& list, const bool state) { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = view->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { KMyMoneyCheckListItem* it_c = static_cast(it_v); - if(it_c->type() == QCheckListItem::CheckBox && list.contains(it_c->id())) { + if(it_c->type() == TQCheckListItem::CheckBox && list.tqcontains(it_c->id())) { it_c->setOn(state); } selectSubItems(it_v, list, state); @@ -318,31 +318,31 @@ void KFindTransactionDlg::selectItems(QListView* view, const QStringList& list, void KFindTransactionDlg::setupCategoriesPage(void) { - m_categoriesView->setSelectionMode(QListView::Multi); + m_categoriesView->setSelectionMode(TQListView::Multi); AccountSet categorySet; categorySet.addAccountGroup(MyMoneyAccount::Income); categorySet.addAccountGroup(MyMoneyAccount::Expense); categorySet.load(m_categoriesView); - connect(m_categoriesView, SIGNAL(stateChanged()), this, SLOT(slotUpdateSelections())); + connect(m_categoriesView, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotUpdateSelections())); } -void KFindTransactionDlg::selectAllSubItems(QListViewItem* item, const bool state) +void KFindTransactionDlg::selectAllSubItems(TQListViewItem* item, const bool state) { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { - static_cast(it_v)->setOn(state); + static_cast(it_v)->setOn(state); selectAllSubItems(it_v, state); } } -void KFindTransactionDlg::selectSubItems(QListViewItem* item, const QStringList& list, const bool state) +void KFindTransactionDlg::selectSubItems(TQListViewItem* item, const TQStringList& list, const bool state) { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { KMyMoneyCheckListItem* it_c = static_cast(it_v); - if(list.contains(it_c->id())) + if(list.tqcontains(it_c->id())) it_c->setOn(state); selectSubItems(it_v, list, state); } @@ -355,9 +355,9 @@ void KFindTransactionDlg::setupDatePage(void) MyMoneyTransactionFilter::translateDateRange(static_cast(i), m_startDates[i], m_endDates[i]); } - connect(m_dateRange, SIGNAL(itemSelected(int)), this, SLOT(slotDateRangeChanged(int))); - connect(m_fromDate, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotDateChanged())); - connect(m_toDate, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotDateChanged())); + connect(m_dateRange, TQT_SIGNAL(itemSelected(int)), this, TQT_SLOT(slotDateRangeChanged(int))); + connect(m_fromDate, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotDateChanged())); + connect(m_toDate, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotDateChanged())); slotDateRangeChanged(MyMoneyTransactionFilter::allDates); } @@ -367,8 +367,8 @@ void KFindTransactionDlg::slotDateRangeChanged(int idx) switch(idx) { case MyMoneyTransactionFilter::allDates: case MyMoneyTransactionFilter::userDefined: - m_fromDate->loadDate(QDate()); - m_toDate->loadDate(QDate()); + m_fromDate->loadDate(TQDate()); + m_toDate->loadDate(TQDate()); break; default: m_fromDate->loadDate(m_startDates[idx]); @@ -399,12 +399,12 @@ void KFindTransactionDlg::slotDateChanged(void) void KFindTransactionDlg::setupAmountPage(void) { - connect(m_amountButton, SIGNAL(clicked()), this, SLOT(slotAmountSelected())); - connect(m_amountRangeButton, SIGNAL(clicked()), this, SLOT(slotAmountRangeSelected())); + connect(m_amountButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAmountSelected())); + connect(m_amountRangeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAmountRangeSelected())); - connect(m_amountEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); - connect(m_amountFromEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); - connect(m_amountToEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); + connect(m_amountEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); + connect(m_amountFromEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); + connect(m_amountToEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); m_amountButton->setChecked(true); slotAmountSelected(); @@ -428,28 +428,28 @@ void KFindTransactionDlg::slotAmountRangeSelected(void) void KFindTransactionDlg::setupPayeesPage(void) { - m_payeesView->setSelectionMode(QListView::Single); + m_payeesView->setSelectionMode(TQListView::Single); m_payeesView->header()->hide(); loadPayees(); m_emptyPayeesButton->setChecked(false); - connect(m_allPayeesButton, SIGNAL(clicked()), this, SLOT(slotSelectAllPayees())); - connect(m_clearPayeesButton, SIGNAL(clicked()), this, SLOT(slotDeselectAllPayees())); - connect(m_emptyPayeesButton, SIGNAL(stateChanged(int)), this, SLOT(slotUpdateSelections())); + connect(m_allPayeesButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectAllPayees())); + connect(m_clearPayeesButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeselectAllPayees())); + connect(m_emptyPayeesButton, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(slotUpdateSelections())); } void KFindTransactionDlg::loadPayees(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList list; - QValueList::Iterator it_l; + TQValueList list; + TQValueList::Iterator it_l; list = file->payeeList(); // load view for(it_l = list.begin(); it_l != list.end(); ++it_l) { - KMyMoneyCheckListItem* item = new KMyMoneyCheckListItem(m_payeesView, (*it_l).name(), QString(), (*it_l).id()); - connect(item, SIGNAL(stateChanged(bool)), this, SLOT(slotUpdateSelections())); + KMyMoneyCheckListItem* item = new KMyMoneyCheckListItem(m_payeesView, (*it_l).name(), TQString(), (*it_l).id()); + connect(item, TQT_SIGNAL(stateChanged(bool)), this, TQT_SLOT(slotUpdateSelections())); item->setOn(true); } } @@ -465,15 +465,15 @@ void KFindTransactionDlg::slotDeselectAllPayees(void) void KFindTransactionDlg::setupDetailsPage(void) { - connect(m_typeBox, SIGNAL(activated(int)), this, SLOT(slotUpdateSelections())); - connect(m_stateBox, SIGNAL(activated(int)), this, SLOT(slotUpdateSelections())); - connect(m_validityBox, SIGNAL(activated(int)), this, SLOT(slotUpdateSelections())); + connect(m_typeBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotUpdateSelections())); + connect(m_stateBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotUpdateSelections())); + connect(m_validityBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotUpdateSelections())); - connect(m_nrButton, SIGNAL(clicked()), this, SLOT(slotNrSelected())); - connect(m_nrRangeButton, SIGNAL(clicked()), this, SLOT(slotNrRangeSelected())); - connect(m_nrEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); - connect(m_nrFromEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); - connect(m_nrToEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateSelections())); + connect(m_nrButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNrSelected())); + connect(m_nrRangeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNrRangeSelected())); + connect(m_nrEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); + connect(m_nrFromEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); + connect(m_nrToEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateSelections())); m_nrButton->setChecked(true); slotNrSelected(); @@ -495,7 +495,7 @@ void KFindTransactionDlg::slotNrRangeSelected(void) slotUpdateSelections(); } -void KFindTransactionDlg::addItemToFilter(const opTypeE op, const QString& id) +void KFindTransactionDlg::addItemToFilter(const opTypeE op, const TQString& id) { switch(op) { case addAccountToFilter: @@ -510,14 +510,14 @@ void KFindTransactionDlg::addItemToFilter(const opTypeE op, const QString& id) } } -void KFindTransactionDlg::scanCheckListItems(const QListViewItem* item, const opTypeE op) +void KFindTransactionDlg::scanCheckListItems(const TQListViewItem* item, const opTypeE op) { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { if(it_v->rtti() == 1) { KMyMoneyCheckListItem* it_c = static_cast(it_v); - if(it_c->type() == QCheckListItem::CheckBox) { + if(it_c->type() == TQCheckListItem::CheckBox) { if(it_c->isOn()) addItemToFilter(op, (*it_c).id()); } @@ -526,14 +526,14 @@ void KFindTransactionDlg::scanCheckListItems(const QListViewItem* item, const op } } -void KFindTransactionDlg::scanCheckListItems(const QListView* view, const opTypeE op) +void KFindTransactionDlg::scanCheckListItems(const TQListView* view, const opTypeE op) { - QListViewItem* it_v; + TQListViewItem* it_v; for(it_v = view->firstChild(); it_v != 0; it_v = it_v->nextSibling()) { if(it_v->rtti() == 1) { KMyMoneyCheckListItem* it_c = static_cast(it_v); - if(it_c->type() == QCheckListItem::CheckBox) { + if(it_c->type() == TQCheckListItem::CheckBox) { if(it_c->isOn()) addItemToFilter(op, (*it_c).id()); } @@ -548,27 +548,27 @@ void KFindTransactionDlg::setupFilter(void) // Text tab if(!m_textEdit->text().isEmpty()) { - QRegExp exp(m_textEdit->text(), m_caseSensitive->isChecked(), !m_regExp->isChecked()); + TQRegExp exp(m_textEdit->text(), m_caseSensitive->isChecked(), !m_regExp->isChecked()); m_filter.setTextFilter(exp, m_textNegate->currentItem() != 0); } // Account tab if(!m_accountsView->allItemsSelected()) { // retrieve a list of selected accounts - QStringList list; + TQStringList list; m_accountsView->selectedItems(list); // if we're not in expert mode, we need to make sure // that all stock accounts for the selected investment // account are also selected if(!KMyMoneyGlobalSettings::expertMode()) { - QStringList missing; - QStringList::const_iterator it_a, it_b; + TQStringList missing; + TQStringList::const_iterator it_a, it_b; for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!list.contains(*it_b)) { + if(!list.tqcontains(*it_b)) { missing.append(*it_b); } } @@ -608,7 +608,7 @@ void KFindTransactionDlg::setupFilter(void) // Payees tab if(m_emptyPayeesButton->isChecked()) { - m_filter.addPayee(QString()); + m_filter.addPayee(TQString()); } else if(!allItemsSelected(m_payeesView)) { scanCheckListItems(m_payeesView, addPayeeToFilter); @@ -674,8 +674,8 @@ void KFindTransactionDlg::loadView(void) MyMoneyFile::instance()->transactionList(m_transactionList, m_filter); // create the elements for the register - QValueList >::const_iterator it; - QMapuniqueMap; + TQValueList >::const_iterator it; + TQMapuniqueMap; MyMoneyMoney deposit, payment; int splitCount = 0; @@ -714,15 +714,15 @@ void KFindTransactionDlg::loadView(void) #if KMM_DEBUG m_foundText->setText(i18n("Found %1 matching transactions (D %2 / P %3 = %4)") - .arg(splitCount).arg(deposit.formatMoney("", 2)).arg(payment.formatMoney("", 2)).arg((deposit-payment).formatMoney("", 2))); + .tqarg(splitCount).tqarg(deposit.formatMoney("", 2)).tqarg(payment.formatMoney("", 2)).tqarg((deposit-payment).formatMoney("", 2))); #else - m_foundText->setText(i18n("Found %1 matching transactions") .arg(splitCount)); + m_foundText->setText(i18n("Found %1 matching transactions") .tqarg(splitCount)); #endif m_tabWidget->setTabEnabled(m_resultPage, true); m_tabWidget->setCurrentPage(m_tabWidget->indexOf(m_resultPage)); - QTimer::singleShot(10, this, SLOT(slotRightSize())); + TQTimer::singleShot(10, this, TQT_SLOT(slotRightSize())); } void KFindTransactionDlg::slotRightSize(void) @@ -730,7 +730,7 @@ void KFindTransactionDlg::slotRightSize(void) m_register->updateContents(); } -void KFindTransactionDlg::resizeEvent(QResizeEvent* ev) +void KFindTransactionDlg::resizeEvent(TQResizeEvent* ev) { // Columns // 1 = Date @@ -775,7 +775,7 @@ void KFindTransactionDlg::resizeEvent(QResizeEvent* ev) void KFindTransactionDlg::slotSelectTransaction(void) { - QValueList list = m_register->selectedItems(); + TQValueList list = m_register->selectedItems(); if(!list.isEmpty()) { KMyMoneyRegister::Transaction* t = dynamic_cast(list[0]); if(t) { @@ -785,21 +785,21 @@ void KFindTransactionDlg::slotSelectTransaction(void) } } -bool KFindTransactionDlg::eventFilter(QObject* o, QEvent* e) +bool KFindTransactionDlg::eventFilter(TQObject* o, TQEvent* e) { bool rc = false; if(o->isWidgetType()) { - if(e->type() == QEvent::KeyPress) { - const QWidget* w = dynamic_cast(o); - QKeyEvent *k = static_cast (e); + if(e->type() == TQEvent::KeyPress) { + const TQWidget* w = dynamic_cast(o); + TQKeyEvent *k = TQT_TQKEYEVENT (e); if(w == m_register) { switch(k->key()) { default: break; - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: rc = true; slotSelectTransaction(); break; @@ -812,9 +812,9 @@ bool KFindTransactionDlg::eventFilter(QObject* o, QEvent* e) void KFindTransactionDlg::slotShowHelp(void) { - QString anchor = m_helpAnchor[m_criteriaTab->currentPage()]; + TQString anchor = m_helpAnchor[m_criteriaTab->currentPage()]; if(anchor.isEmpty()) - anchor = QString("details.search"); + anchor = TQString("details.search"); kapp->invokeHelp(anchor); } @@ -823,11 +823,11 @@ void KFindTransactionDlg::slotSortOptions(void) { KSortOptionDlg* dlg = new KSortOptionDlg(this); - dlg->setSortOption(KMyMoneyGlobalSettings::sortSearchView(), QString()); + dlg->setSortOption(KMyMoneyGlobalSettings::sortSearchView(), TQString()); dlg->hideDefaultButton(); - if(dlg->exec() == QDialog::Accepted) { - QString sortOrder = dlg->sortOption(); + if(dlg->exec() == TQDialog::Accepted) { + TQString sortOrder = dlg->sortOption(); if(sortOrder != KMyMoneyGlobalSettings::sortSearchView()) { KMyMoneyGlobalSettings::setSortSearchView(sortOrder); slotRefreshView(); diff --git a/kmymoney2/dialogs/kfindtransactiondlg.h b/kmymoney2/dialogs/kfindtransactiondlg.h index edf9504..bd0cb7a 100644 --- a/kmymoney2/dialogs/kfindtransactiondlg.h +++ b/kmymoney2/dialogs/kfindtransactiondlg.h @@ -20,9 +20,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -36,8 +36,8 @@ #include "../dialogs/kfindtransactiondlgdecl.h" -class QListView; -class QListViewItem; +class TQListView; +class TQListViewItem; /** * @author Thomas Baumgart @@ -45,6 +45,7 @@ class QListViewItem; class KFindTransactionDlg : public KFindTransactionDlgDecl { Q_OBJECT + TQ_OBJECT public: /* @@ -77,16 +78,16 @@ public: dateOptionCount }; */ - KFindTransactionDlg(QWidget *parent=0, const char *name=0); + KFindTransactionDlg(TQWidget *tqparent=0, const char *name=0); ~KFindTransactionDlg() {} - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); public slots: void show(void); protected: - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); protected slots: virtual void slotReset(void); @@ -117,7 +118,7 @@ protected slots: /** * This slot selects the current selected transaction/split and emits - * the signal @a transactionSelected(const QString& accountId, const QString& transactionId) + * the signal @a transactionSelected(const TQString& accountId, const TQString& transactionId) */ void slotSelectTransaction(void); @@ -126,7 +127,7 @@ protected slots: void slotSortOptions(void); signals: - void transactionSelected(const QString& accountId, const QString& transactionId); + void transactionSelected(const TQString& accountId, const TQString& transactionId); /** * This signal is sent out when no selection has been made. It is @@ -150,10 +151,10 @@ protected: void setupFilter(void); - void selectAllItems(QListView* view, const bool state); - void selectAllSubItems(QListViewItem* item, const bool state); - void selectItems(QListView* view, const QStringList& list, const bool state); - void selectSubItems(QListViewItem* item, const QStringList& list, const bool state); + void selectAllItems(TQListView* view, const bool state); + void selectAllSubItems(TQListViewItem* item, const bool state); + void selectItems(TQListView* view, const TQStringList& list, const bool state); + void selectSubItems(TQListViewItem* item, const TQStringList& list, const bool state); /** * This method loads the m_payeesView with the payees name @@ -177,25 +178,25 @@ protected: * * @note If the view contains no items the method returns @p true. */ - bool allItemsSelected(const QListView* view) const; - bool allItemsSelected(const QListViewItem *item) const; + bool allItemsSelected(const TQListView* view) const; + bool allItemsSelected(const TQListViewItem *item) const; - void scanCheckListItems(const QListView* view, const opTypeE op); - void scanCheckListItems(const QListViewItem* item, const opTypeE op); - void addItemToFilter(const opTypeE op, const QString& id); + void scanCheckListItems(const TQListView* view, const opTypeE op); + void scanCheckListItems(const TQListViewItem* item, const opTypeE op); + void addItemToFilter(const opTypeE op, const TQString& id); protected: - QDate m_startDates[MyMoneyTransactionFilter::dateOptionCount]; - QDate m_endDates[MyMoneyTransactionFilter::dateOptionCount]; + TQDate m_startDates[MyMoneyTransactionFilter::dateOptionCount]; + TQDate m_endDates[MyMoneyTransactionFilter::dateOptionCount]; /** * This member holds a list of all transactions matching the filter criteria */ - QValueList > m_transactionList; + TQValueList > m_transactionList; MyMoneyTransactionFilter m_filter; - QMap m_helpAnchor; + TQMap m_helpAnchor; bool m_needReload; }; diff --git a/kmymoney2/dialogs/kfindtransactiondlgdecl.ui b/kmymoney2/dialogs/kfindtransactiondlgdecl.ui index 3340afd..8887776 100644 --- a/kmymoney2/dialogs/kfindtransactiondlgdecl.ui +++ b/kmymoney2/dialogs/kfindtransactiondlgdecl.ui @@ -1,6 +1,6 @@ KFindTransactionDlgDecl - + KFindTransactionDlgDecl @@ -28,11 +28,11 @@ 6 - + m_tabWidget - + m_criteriaPage @@ -43,7 +43,7 @@ unnamed - + TextLabel1 @@ -51,7 +51,7 @@ Define your search criteria - + m_criteriaTab @@ -63,7 +63,7 @@ 3 - + m_textTab @@ -84,7 +84,7 @@ Expanding - + 16 83 @@ -103,7 +103,7 @@ 0 - + 300 0 @@ -125,7 +125,7 @@ m_textNegate - + m_regExp @@ -133,7 +133,7 @@ Treat text as regular expression - + m_caseSensitive @@ -143,7 +143,7 @@ - + m_accountTab @@ -167,7 +167,7 @@ - + m_dateTab @@ -178,17 +178,17 @@ unnamed - + - layout16 + tqlayout16 unnamed - + - layout15 + tqlayout15 @@ -199,7 +199,7 @@ m_dateRange - + TextLabel4 @@ -212,7 +212,7 @@ m_fromDate - + TextLabel6 @@ -221,7 +221,7 @@ To (Date) - + TextLabel5 @@ -247,7 +247,7 @@ Expanding - + 40 20 @@ -266,7 +266,7 @@ Expanding - + 20 30 @@ -275,7 +275,7 @@ - + m_amountTab @@ -286,15 +286,15 @@ unnamed - + - layout22 + tqlayout22 unnamed - + ButtonGroup1 @@ -314,7 +314,7 @@ 0 - + m_amountButton @@ -322,7 +322,7 @@ Search this amount - + m_amountRangeButton @@ -332,9 +332,9 @@ - + - layout20 + tqlayout20 @@ -344,14 +344,14 @@ m_amountToEdit - + 100 0 - + TextLabel9 @@ -359,7 +359,7 @@ - + TextLabel8 @@ -372,14 +372,14 @@ m_amountEdit - + 100 0 - + TextLabel7 @@ -392,7 +392,7 @@ m_amountFromEdit - + 100 0 @@ -411,7 +411,7 @@ Expanding - + 16 16 @@ -430,7 +430,7 @@ Expanding - + 16 75 @@ -439,7 +439,7 @@ - + m_categoryTab @@ -457,7 +457,7 @@ - + m_payeeTab @@ -474,7 +474,7 @@ 6 - + Layout46 @@ -504,7 +504,7 @@ m_payeesView - + m_emptyPayeesButton @@ -514,7 +514,7 @@ - + Layout45 @@ -554,7 +554,7 @@ Expanding - + 0 42 @@ -565,7 +565,7 @@ - + m_detailsTab @@ -576,23 +576,23 @@ unnamed - + - layout19 + tqlayout19 unnamed - + - layout18 + tqlayout18 unnamed - + TextLabel11_2 @@ -600,7 +600,7 @@ Validity - + TextLabel10 @@ -678,7 +678,7 @@ m_validityBox - + TextLabel11 @@ -698,7 +698,7 @@ Expanding - + 130 20 @@ -707,15 +707,15 @@ - + - layout21 + tqlayout21 unnamed - + ButtonGroup2 @@ -729,7 +729,7 @@ unnamed - + m_nrButton @@ -737,7 +737,7 @@ Search this number - + m_nrRangeButton @@ -755,15 +755,15 @@ - + - layout17 + tqlayout17 unnamed - + TextLabel12 @@ -771,7 +771,7 @@ - + TextLabel14 @@ -790,7 +790,7 @@ m_nrEdit - + TextLabel13 @@ -816,7 +816,7 @@ Expanding - + 20 20 @@ -835,7 +835,7 @@ Expanding - + 16 16 @@ -845,18 +845,18 @@ - + m_selectedCriteria text - + AlignTop - + m_transferWarning @@ -886,7 +886,7 @@ Expanding - + 20 24 @@ -895,7 +895,7 @@ - + m_resultPage @@ -962,23 +962,23 @@ 12 - + m_foundText F - + AlignVCenter|AlignLeft - + - layout25 + tqlayout25 @@ -1008,7 +1008,7 @@ Expanding - + 51 20 @@ -1097,5 +1097,10 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000041d49444154388d8d95c18b1c4514c67fbb29e5b54ea05b26da1d36b08d09a6c508138cb8c13d647141163de49043bca9f1628eb9294810f24f88c15b728b07617358888785d980427290b4a8d00b19a8821da8228cf42316ac87eed9247ac95c9aeaeef9eaabdffb5ebf85f178ccfcf7f5b79fec07a7280a08a008f25ceb7c29e5da573716e65a0be3f198ef6f5ededff9b9e1b34faf90882092a1ea21428b9220ffbf46054055b19386ba6970ae6665b5e0d2c5eb0b066067bbe1f21757c88f5504eff0c192189081303a5582b16854fccce2fe041f00cdd0a8103b874556405476b62d972ec2c2b90ff3fd8df5cb946549d80b34aea15ccaa94625450e2d0e558b460b7371a734b5e027251a155545678ab62d7eea90b4c504078908c107acb354cb251b1f8f08b1c18631aabbb4d18211404804f22545863561d2f060fb34aa8a18d0086204e72c46a32292e1a796f278c1da7a859d8da9a737506db04d0a24103d8949480b214d3bbee952a05c1d536f9d2684160c744f048311543d459eb1b65ee1754cedae13a64abd5d6127053c9d0281f22d4f75c6a2118a5c09272d7ab740638bf4ef2dd2174032d0d8d04c6fe19c32bedd8bc65e342aa3f785e2784bfd6bc1bd9db24b05505616a4edd67d5a8c1801a03a9962754c504bf34b8986acfb9be91cac7d54315a15541b36b134f74bd2dc53940115a5381e087bc25c6f71be831a8baa234cc1ee3eeb74ed83116beb2b8849d108a3730e8ce27e2bfb82419a7b407ac7c222fd0e6280a8078ce64e47ef54ac9d5be9aaae0162e0de568a44a18d3df90845d919c4f01463406340a44f40efb43a99b371618488e2670d1a2d7ee6f1d3be39342104e937ed85fb86599c33e9ee0be9a004946259d8b858909880d59aa00daa0d3280b5f39e34074c4b3a5434029a76a9e9f5cc0163b5c80024158a1cfc4cb1d3061d5834066cb0a403c008599a70f6bc27b8d03106ea3ae91987278c5b143b015547224ab5e24185cd9b81665273e7b6e7cecd82ddbf8098002de94049737bc09828cf3036f31c3735c8b0e98eb704672f348c7f7c93cd1fb2ae905119ff54e0dff3542b0e9dd983dcea2cc5eea6cf303e74ec687af5c41b6fa38f5e203c7ec8e1238ef85831a214afef21060ea781ec68247b65c6916353cc8b73d1ae79354606af2a930709aa118da1636c274dd7e3774b884a79aa6b5711a538d33cf9c01c1c9b83bc6a1f55c91ccb23b05b1deb43a7decdaffefd2862f61366aa8449c69e33642f012f2bb208fa98eeda1f3346f076c8eeef19475e9be115423364f78f84105a8643d34d90cfbfdcd8cf872589a45dc7f54cf3134a36f4e495c23f9da8db15bccb708d4014f2ca512cb5d4f7c13e84300d5cff6eb39b202bab053bdb9674f0648609427d0f8402ddeac30f4fcd3ced3efc3b422d406c09b340bedc1571e1bfc3d44dc281634c5fe5e758e7395cfbe6d6c130fd17d92372d277c159b70000000049454e44ae426082 - + + kmymoney/kmymoneydateinput.h + kmymoney/kmymoneyedit.h + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/kgncimportoptionsdlg.cpp b/kmymoney2/dialogs/kgncimportoptionsdlg.cpp index e11ff69..9aaf5b6 100644 --- a/kmymoney2/dialogs/kgncimportoptionsdlg.cpp +++ b/kmymoney2/dialogs/kgncimportoptionsdlg.cpp @@ -17,11 +17,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -35,8 +35,8 @@ #include "kgncimportoptionsdlg.h" // dialog constructor -KGncImportOptionsDlg::KGncImportOptionsDlg(QWidget *parent, const char *name) - : KGncImportOptionsDlgDecl(parent, name) +KGncImportOptionsDlg::KGncImportOptionsDlg(TQWidget *tqparent, const char *name) + : KGncImportOptionsDlgDecl(tqparent, name) { buttonInvestGroup->setRadioButtonExclusive (true); buttonInvestGroup->setButton (0); @@ -50,7 +50,7 @@ KGncImportOptionsDlg::KGncImportOptionsDlg(QWidget *parent, const char *name) checkDebugXML->setChecked (false); checkAnonymize->setChecked (false); - connect (checkDecode, SIGNAL(toggled(bool)), this, SLOT(slotDecodeOptionChanged(bool))); + connect (checkDecode, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotDecodeOptionChanged(bool))); } KGncImportOptionsDlg::~KGncImportOptionsDlg() @@ -71,12 +71,12 @@ void KGncImportOptionsDlg::slotDecodeOptionChanged(bool isOn) { // try to get the others in some sort of order of likelihood void KGncImportOptionsDlg::buildCodecList () { - m_localeCodec = QTextCodec::codecForLocale(); + m_localeCodec = TQTextCodec::codecForLocale(); m_codecList.setAutoDelete (true); // retrieve all codec pointers - QTextCodec *codec; + TQTextCodec *codec; unsigned int i; - for (i = 0; (codec = QTextCodec::codecForIndex(i)); i++) { + for (i = 0; (codec = TQTextCodec::codecForIndex(i)); i++) { int rank; if (codec == m_localeCodec) rank = 999; // ensure locale rank comes first else rank = codec->heuristicNameMatch(m_localeCodec->name()); @@ -86,7 +86,7 @@ void KGncImportOptionsDlg::buildCodecList () { } m_codecList.sort(); for (i = 0; i < m_codecList.count(); i++) { - QString name (m_codecList.at(i)->second->name()); + TQString name (m_codecList.at(i)->second->name()); comboDecode->insertItem (name); } } @@ -102,8 +102,8 @@ int codecDataList::compareItems (void *a, void *b) { return (1); } // ranks are equal, sort on name, case insensitive - QString sa(pa->second->name()); - QString sb(pb->second->name()); + TQString sa(pa->second->name()); + TQString sb(pb->second->name()); if (sa.lower() > sb.lower()) { return (1); } else { @@ -112,7 +112,7 @@ int codecDataList::compareItems (void *a, void *b) { } // return selected codec or 0 -QTextCodec* KGncImportOptionsDlg::decodeOption(void) { +TQTextCodec* KGncImportOptionsDlg::decodeOption(void) { if (!checkDecode->isChecked()) { return (0); } else { diff --git a/kmymoney2/dialogs/kgncimportoptionsdlg.h b/kmymoney2/dialogs/kgncimportoptionsdlg.h index 5ab6202..787bd8b 100644 --- a/kmymoney2/dialogs/kgncimportoptionsdlg.h +++ b/kmymoney2/dialogs/kgncimportoptionsdlg.h @@ -20,10 +20,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -32,24 +32,25 @@ // Project Includes #include "../dialogs/kgncimportoptionsdlgdecl.h" -typedef QPair codecData; +typedef TQPair codecData; // class to sort codec list -class codecDataList : public QPtrList { - int compareItems (QPtrCollection::Item a, QPtrCollection::Item b); +class codecDataList : public TQPtrList { + int compareItems (TQPtrCollection::Item a, TQPtrCollection::Item b); }; class KGncImportOptionsDlg : public KGncImportOptionsDlgDecl { Q_OBJECT + TQ_OBJECT public: - KGncImportOptionsDlg(QWidget *parent = 0, const char *name = 0); + KGncImportOptionsDlg(TQWidget *tqparent = 0, const char *name = 0); ~KGncImportOptionsDlg(); int investmentOption () const {return (buttonInvestGroup->selectedId());}; bool quoteOption() const {return (checkFinanceQuote->isChecked());}; bool scheduleOption () const {return (checkSchedules->isChecked());}; - QTextCodec* decodeOption (); + TQTextCodec* decodeOption (); bool txNotesOption () const {return (checkTxNotes->isChecked());}; bool generalDebugOption () const {return (checkDebugGeneral->isChecked());}; bool xmlDebugOption () const {return (checkDebugXML->isChecked());}; @@ -62,7 +63,7 @@ public slots: private: void buildCodecList (); - QTextCodec* m_localeCodec; + TQTextCodec* m_localeCodec; codecDataList m_codecList; }; diff --git a/kmymoney2/dialogs/kgncimportoptionsdlgdecl.ui b/kmymoney2/dialogs/kgncimportoptionsdlgdecl.ui index e32197b..852a19e 100644 --- a/kmymoney2/dialogs/kgncimportoptionsdlgdecl.ui +++ b/kmymoney2/dialogs/kgncimportoptionsdlgdecl.ui @@ -1,6 +1,6 @@ KGncImportOptionsDlgDecl - + KGncImportOptionsDlgDecl @@ -15,9 +15,9 @@ GnuCash Import Options - + - layout8 + tqlayout8 @@ -31,18 +31,18 @@ unnamed - + textLabel1 Use 'Help' for more information on these options - + AlignCenter - + buttonInvestGroup @@ -53,7 +53,7 @@ unnamed - + radioInvest1 @@ -64,7 +64,7 @@ true - + radioInvest2 @@ -72,7 +72,7 @@ One investment account for all stocks - + radioInvest3 @@ -82,7 +82,7 @@ - + buttonGroup5 @@ -93,7 +93,7 @@ unnamed - + checkFinanceQuote @@ -103,7 +103,7 @@ - + buttonGroup2 @@ -114,7 +114,7 @@ unnamed - + checkSchedules @@ -124,7 +124,7 @@ - + buttonGroup4 @@ -135,9 +135,9 @@ unnamed - + - layout8 + tqlayout8 @@ -149,7 +149,7 @@ 0 - + checkDecode @@ -167,14 +167,14 @@ Expanding - + 140 20 - + comboDecode @@ -183,14 +183,14 @@ - + buttonGroup18 Transaction Notes option - + checkTxNotes @@ -207,7 +207,7 @@ - + buttonGroup3 @@ -218,7 +218,7 @@ unnamed - + checkDebugGeneral @@ -226,7 +226,7 @@ General debug data - + checkDebugXML @@ -234,7 +234,7 @@ Display XML data - + checkAnonymize @@ -254,16 +254,16 @@ Expanding - + 20 40 - + - layout12 + tqlayout12 @@ -275,7 +275,7 @@ 6 - + buttonHelp @@ -299,14 +299,14 @@ Expanding - + 200 20 - + buttonOk @@ -323,7 +323,7 @@ true - + buttonCancel @@ -376,8 +376,8 @@ slotHelp() - + slotHelp() - - + + diff --git a/kmymoney2/dialogs/kgncpricesourcedlg.cpp b/kmymoney2/dialogs/kgncpricesourcedlg.cpp index 2246e01..5058d5b 100644 --- a/kmymoney2/dialogs/kgncpricesourcedlg.cpp +++ b/kmymoney2/dialogs/kgncpricesourcedlg.cpp @@ -17,12 +17,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -36,17 +36,17 @@ #include "kgncpricesourcedlg.h" #include "../converter/webpricequote.h" -KGncPriceSourceDlg::KGncPriceSourceDlg(QWidget *parent, const char *name) - : KGncPriceSourceDlgDecl(parent, name) +KGncPriceSourceDlg::KGncPriceSourceDlg(TQWidget *tqparent, const char *name) + : KGncPriceSourceDlgDecl(tqparent, name) { } -KGncPriceSourceDlg::KGncPriceSourceDlg(const QString &stockName, const QString &gncSource){ +KGncPriceSourceDlg::KGncPriceSourceDlg(const TQString &stockName, const TQString &gncSource){ // signals and slots connections - connect( buttonGroup5, SIGNAL( released(int) ), this, SLOT( buttonPressed(int) ) ); - connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( slotHelp() ) ); + connect( buttonGroup5, TQT_SIGNAL( released(int) ), this, TQT_SLOT( buttonPressed(int) ) ); + connect( buttonHelp, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotHelp() ) ); // initialize data fields - textStockName->setText (i18n ("Investment: %1").arg(stockName)); - textGncSource->setText (i18n ("Quote source: %1").arg(gncSource)); + textStockName->setText (i18n ("Investment: %1").tqarg(stockName)); + textGncSource->setText (i18n ("Quote source: %1").tqarg(gncSource)); listKnownSource->insertStringList (WebPriceQuote::quoteSources()); lineUserSource->setText (gncSource); checkAlwaysUse->setChecked(true); @@ -87,8 +87,8 @@ void KGncPriceSourceDlg::buttonPressed (int buttonId) { } } -QString KGncPriceSourceDlg::selectedSource() const { - QString s; +TQString KGncPriceSourceDlg::selectedSource() const { + TQString s; switch (m_currentButton) { case NOSOURCE: s = ""; break; case KMMSOURCE: s = listKnownSource->currentText(); break; diff --git a/kmymoney2/dialogs/kgncpricesourcedlg.h b/kmymoney2/dialogs/kgncpricesourcedlg.h index 6351b02..1d2eac6 100644 --- a/kmymoney2/dialogs/kgncpricesourcedlg.h +++ b/kmymoney2/dialogs/kgncpricesourcedlg.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -34,12 +34,13 @@ class KGncPriceSourceDlg : public KGncPriceSourceDlgDecl { Q_OBJECT + TQ_OBJECT public: - KGncPriceSourceDlg(QWidget *parent = 0, const char *name = 0); - KGncPriceSourceDlg(const QString &stockName, const QString &gncSource); + KGncPriceSourceDlg(TQWidget *tqparent = 0, const char *name = 0); + KGncPriceSourceDlg(const TQString &stockName, const TQString &gncSource); ~KGncPriceSourceDlg(); - QString selectedSource () const; + TQString selectedSource () const; bool alwaysUse() const { return (checkAlwaysUse->isChecked()); } public slots: diff --git a/kmymoney2/dialogs/kgncpricesourcedlgdecl.ui b/kmymoney2/dialogs/kgncpricesourcedlgdecl.ui index c781f81..b335268 100644 --- a/kmymoney2/dialogs/kgncpricesourcedlgdecl.ui +++ b/kmymoney2/dialogs/kgncpricesourcedlgdecl.ui @@ -1,6 +1,6 @@ KGncPriceSourceDlgDecl - + KGncPriceSourceDlgDecl @@ -15,9 +15,9 @@ Online Quotes - Select price source - + - layout4 + tqlayout4 @@ -41,14 +41,14 @@ Expanding - + 91 20 - + buttonHelp @@ -66,14 +66,14 @@ Expanding - + 80 20 - + buttonOK @@ -94,7 +94,7 @@ Expanding - + 171 20 @@ -103,7 +103,7 @@ - + splitter1 @@ -118,15 +118,15 @@ Horizontal - + - layout6 + tqlayout6 unnamed - + textStockName @@ -134,7 +134,7 @@ - + textGncSource @@ -142,7 +142,7 @@ - + textLabel4 @@ -150,7 +150,7 @@ This price source is not known to KMyMoney. Please select an option below. - + buttonGroup5 @@ -161,7 +161,7 @@ unnamed - + buttonNoSource @@ -172,7 +172,7 @@ 0 - + buttonSelectSource @@ -183,12 +183,12 @@ 1 - + listKnownSource - + buttonUserSource @@ -200,14 +200,14 @@ 2 - + lineUserSource - + checkAlwaysUse @@ -227,7 +227,7 @@ Expanding - + 21 370 @@ -244,5 +244,5 @@ close() - + diff --git a/kmymoney2/dialogs/kgpgkeyselectiondlg.cpp b/kmymoney2/dialogs/kgpgkeyselectiondlg.cpp index 37ddcc5..38ff094 100644 --- a/kmymoney2/dialogs/kgpgkeyselectiondlg.cpp +++ b/kmymoney2/dialogs/kgpgkeyselectiondlg.cpp @@ -17,9 +17,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -34,41 +34,41 @@ #include "kgpgkeyselectiondlg.h" #include -KGpgKeySelectionDlg::KGpgKeySelectionDlg(QWidget *parent, const char *name) : - KDialogBase(parent, name, true, i18n("Select additional keys"), Ok | Cancel), +KGpgKeySelectionDlg::KGpgKeySelectionDlg(TQWidget *tqparent, const char *name) : + KDialogBase(tqparent, name, true, i18n("Select additional keys"), Ok | Cancel), m_needCheckList(true), m_listOk(false), m_checkCount(0) { - QWidget* page = new QWidget(this); + TQWidget* page = new TQWidget(this); setMainWidget(page); - QVBoxLayout* topLayout = new QVBoxLayout(page, 0, spacingHint()); + TQVBoxLayout* topLayout = new TQVBoxLayout(page, 0, spacingHint()); m_listBox = new KEditListBox(page); m_listBox->setTitle(i18n("User identification")); m_listBox->setButtons( int( KEditListBox::Remove | KEditListBox::Add ) ); - QWhatsThis::add( m_listBox, i18n( "Enter the id of the key you want to use for data encryption. This can either be an e-mail address or the hexadecimal key id. In case of the key id don't forget the leading 0x." ) ); + TQWhatsThis::add( m_listBox, i18n( "Enter the id of the key you want to use for data encryption. This can either be an e-mail address or the hexadecimal key id. In case of the key id don't forget the leading 0x." ) ); topLayout->addWidget(m_listBox); // add a LED for the availability of all keys - QHBoxLayout* ledBox = new QHBoxLayout(0, 0, 6, "ledBoxLayout"); + TQHBoxLayout* ledBox = new TQHBoxLayout(0, 0, 6, "ledBoxLayout"); m_keyLed = new KLed(page); m_keyLed->setShape( KLed::Circular ); m_keyLed->setLook( KLed::Sunken ); ledBox->addWidget(m_keyLed); - ledBox->addWidget(new QLabel(i18n("Keys for all of the above user ids found"), page)); - ledBox->addItem(new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum )); + ledBox->addWidget(new TQLabel(i18n("Keys for all of the above user ids found"), page)); + ledBox->addItem(new TQSpacerItem( 50, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum )); topLayout->addLayout(ledBox); - connect(m_listBox, SIGNAL(changed()), this, SLOT(slotIdChanged())); - connect(m_listBox, SIGNAL(added(const QString&)), this, SLOT(slotKeyListChanged())); - connect(m_listBox, SIGNAL(removed(const QString&)), this, SLOT(slotKeyListChanged())); + connect(m_listBox, TQT_SIGNAL(changed()), this, TQT_SLOT(slotIdChanged())); + connect(m_listBox, TQT_SIGNAL(added(const TQString&)), this, TQT_SLOT(slotKeyListChanged())); + connect(m_listBox, TQT_SIGNAL(removed(const TQString&)), this, TQT_SLOT(slotKeyListChanged())); } -void KGpgKeySelectionDlg::setKeys(const QStringList& list) +void KGpgKeySelectionDlg::setKeys(const TQStringList& list) { m_listBox->clear(); m_listBox->insertStringList(list); @@ -78,9 +78,9 @@ void KGpgKeySelectionDlg::setKeys(const QStringList& list) #if 0 void KGpgKeySelectionDlg::slotShowHelp(void) { - QString anchor = m_helpAnchor[m_criteriaTab->currentPage()]; + TQString anchor = m_helpAnchor[m_criteriaTab->currentPage()]; if(anchor.isEmpty()) - anchor = QString("details.search"); + anchor = TQString("details.search"); kapp->invokeHelp(anchor); } @@ -114,8 +114,8 @@ void KGpgKeySelectionDlg::slotIdChanged(void) // if it is available, then scan the current list if we need to if(keysOk) { if(m_needCheckList) { - QStringList keys = m_listBox->items(); - QStringList::const_iterator it_s; + TQStringList keys = m_listBox->items(); + TQStringList::const_iterator it_s; for(it_s = keys.begin(); keysOk && it_s != keys.end(); ++it_s) { if(!KGPGFile::keyAvailable(*it_s)) keysOk = false; diff --git a/kmymoney2/dialogs/kgpgkeyselectiondlg.h b/kmymoney2/dialogs/kgpgkeyselectiondlg.h index 4355478..35b86b4 100644 --- a/kmymoney2/dialogs/kgpgkeyselectiondlg.h +++ b/kmymoney2/dialogs/kgpgkeyselectiondlg.h @@ -36,20 +36,21 @@ class KLed; class KGpgKeySelectionDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KGpgKeySelectionDlg(QWidget *parent=0, const char *name=0); + KGpgKeySelectionDlg(TQWidget *tqparent=0, const char *name=0); virtual ~KGpgKeySelectionDlg() {} /** * preset the key list with the given key ids in @a list */ - void setKeys(const QStringList& list); + void setKeys(const TQStringList& list); /** * Returns the list of keys currently listed in the KEditListBox */ - const QStringList keys(void) const { return m_listBox->items(); } + const TQStringList keys(void) const { return m_listBox->items(); } protected slots: void slotIdChanged(void); diff --git a/kmymoney2/dialogs/kimportdlg.cpp b/kmymoney2/dialogs/kimportdlg.cpp index c9cc2d5..e8489d2 100644 --- a/kmymoney2/dialogs/kimportdlg.cpp +++ b/kmymoney2/dialogs/kimportdlg.cpp @@ -21,13 +21,13 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -51,8 +51,8 @@ #include "mymoneyqifprofileeditor.h" #include "../converter/mymoneyqifprofile.h" -KImportDlg::KImportDlg(QWidget *parent, const char * name) - : KImportDlgDecl(parent, name, TRUE) +KImportDlg::KImportDlg(TQWidget *tqparent, const char * name) + : KImportDlgDecl(tqparent, name, TRUE) { // Set all the last used options readConfig(); @@ -64,32 +64,32 @@ KImportDlg::KImportDlg(QWidget *parent, const char * name) KIconLoader* il = KGlobal::iconLoader(); KGuiItem okButtenItem( i18n( "&Import" ), - QIconSet(il->loadIcon("fileimport", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("fileimport", KIcon::Small, KIcon::SizeSmall)), i18n("Start operation"), i18n("Use this to start the import operation")); m_qbuttonOk->setGuiItem(okButtenItem); KGuiItem browseButtenItem( i18n( "&Browse..." ), - QIconSet(il->loadIcon("fileopen", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("fileopen", KIcon::Small, KIcon::SizeSmall)), i18n("Select filename"), i18n("Use this to select a filename to export to")); m_qbuttonBrowse->setGuiItem(browseButtenItem); KGuiItem newButtenItem( i18n( "&New..." ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new profile"), i18n("Use this to open the profile editor")); m_profileEditorButton->setGuiItem(newButtenItem); // connect the buttons to their functionality - connect(m_qbuttonBrowse, SIGNAL( clicked() ), this, SLOT( slotBrowse() ) ); - connect(m_qbuttonOk, SIGNAL(clicked()), this, SLOT(slotOkClicked())); - connect(m_qbuttonCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_profileEditorButton, SIGNAL(clicked()), this, SLOT(slotNewProfile())); + connect(m_qbuttonBrowse, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotBrowse() ) ); + connect(m_qbuttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOkClicked())); + connect(m_qbuttonCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_profileEditorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewProfile())); // connect the change signals to the check slot and perform initial check - connect(m_qlineeditFile, SIGNAL(textChanged(const QString&)), this, - SLOT(slotFileTextChanged(const QString&))); + connect(m_qlineeditFile, TQT_SIGNAL(textChanged(const TQString&)), this, + TQT_SLOT(slotFileTextChanged(const TQString&))); // setup button enable status slotFileTextChanged(m_qlineeditFile->text()); @@ -107,11 +107,11 @@ void KImportDlg::slotBrowse() tmpprofile.loadProfile("Profile-" + profile()); KFileDialog dialog(KGlobalSettings::documentPath(), - i18n("%1|Import files\n%2|All files (*.*)").arg(tmpprofile.filterFileType()).arg("*"), + i18n("%1|Import files\n%2|All files (*.*)").tqarg(tmpprofile.filterFileType()).tqarg("*"), this, i18n("Import File..."), true); dialog.setMode(KFile::File | KFile::ExistingOnly); - if(dialog.exec() == QDialog::Accepted) { + if(dialog.exec() == TQDialog::Accepted) { #if KDE_IS_VERSION(3,4,0) m_qlineeditFile->setText(dialog.selectedURL().pathOrURL()); #else @@ -145,9 +145,9 @@ void KImportDlg::writeConfig(void) } /** Make sure the text input is ok */ -void KImportDlg::slotFileTextChanged(const QString& text) +void KImportDlg::slotFileTextChanged(const TQString& text) { - if (!text.isEmpty() && KIO::NetAccess::exists(text, true, qApp->mainWidget())) { + if (!text.isEmpty() && KIO::NetAccess::exists(text, true, tqApp->mainWidget())) { // m_qcomboboxDateFormat->setEnabled(true); m_qbuttonOk->setEnabled(true); m_qlineeditFile->setText(text); @@ -159,7 +159,7 @@ void KImportDlg::slotFileTextChanged(const QString& text) void KImportDlg::slotNewProfile(void) { - MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "QIF Profile Editor"); + MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "TQIF Profile Editor"); if(editor->exec()) { m_profileComboBox->setCurrentText(editor->selectedProfile()); @@ -169,7 +169,7 @@ void KImportDlg::slotNewProfile(void) delete editor; } -void KImportDlg::slotSelectProfile(const QString& profile) +void KImportDlg::slotSelectProfile(const TQString& profile) { m_profileComboBox->setCurrentText(profile); loadProfiles(); @@ -183,11 +183,11 @@ void KImportDlg::loadProfiles(const bool selectLast) edit->slotOk(); delete edit; - QString current = m_profileComboBox->currentText(); + TQString current = m_profileComboBox->currentText(); m_profileComboBox->clear(); - QStringList list; + TQStringList list; KConfig* config = KGlobal::config(); config->setGroup("Profiles"); @@ -201,20 +201,20 @@ void KImportDlg::loadProfiles(const bool selectLast) } m_profileComboBox->setCurrentItem(0); - if(list.contains(current) > 0) { + if(list.tqcontains(current) > 0) { m_profileComboBox->setCurrentText(current); } } -void KImportDlg::addCategories(QStringList& strList, const QString& id, const QString& leadIn) const +void KImportDlg::addCategories(TQStringList& strList, const TQString& id, const TQString& leadIn) const { MyMoneyFile *file = MyMoneyFile::instance(); - QString name; + TQString name; MyMoneyAccount account = file->account(id); - QStringList accList = account.accountList(); - QStringList::ConstIterator it_a; + TQStringList accList = account.accountList(); + TQStringList::ConstIterator it_a; for(it_a = accList.begin(); it_a != accList.end(); ++it_a) { account = file->account(*it_a); diff --git a/kmymoney2/dialogs/kimportdlg.h b/kmymoney2/dialogs/kimportdlg.h index 06f1003..119d77d 100644 --- a/kmymoney2/dialogs/kimportdlg.h +++ b/kmymoney2/dialogs/kimportdlg.h @@ -22,9 +22,9 @@ // ---------------------------------------------------------------------------- // QT Headers -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -39,8 +39,8 @@ /** * This class is used to import a qif file to an account. - * It relies upon the QIF file handling routines in MyMoneyAccount to do - * the actual writing of QIF files. + * It relies upon the TQIF file handling routines in MyMoneyAccount to do + * the actual writing of TQIF files. * * It uses the global KConfig object to read and write the application * settings. @@ -54,30 +54,31 @@ class KImportDlg : public KImportDlgDecl { Q_OBJECT + TQ_OBJECT public: /** * Standard constructor */ - KImportDlg(QWidget *parent, const char *name = 0); + KImportDlg(TQWidget *tqparent, const char *name = 0); /** Standard destructor */ ~KImportDlg(); /** */ - const QString filename(void) const { return m_qlineeditFile->text(); }; + const TQString filename(void) const { return m_qlineeditFile->text(); }; /** */ - const QString profile(void) const { return m_profileComboBox->currentText(); }; + const TQString profile(void) const { return m_profileComboBox->currentText(); }; protected slots: - /** Called to let the user browse for a QIF file to import from. */ + /** Called to let the user browse for a TQIF file to import from. */ void slotBrowse(); /** Test whether to enable the buttons */ - void slotFileTextChanged(const QString& text); + void slotFileTextChanged(const TQString& text); /** * Called when the user needs a new profile @@ -86,7 +87,7 @@ protected slots: void slotOkClicked(void); - void slotSelectProfile(const QString& text); + void slotSelectProfile(const TQString& text); private: /** @@ -109,7 +110,7 @@ private: * @param id Account id to add * @param leadIn constant leadin to be added in front of the account name */ - void addCategories(QStringList& strList, const QString& id, const QString& leadIn) const; + void addCategories(TQStringList& strList, const TQString& id, const TQString& leadIn) const; void readConfig(void); void writeConfig(void); diff --git a/kmymoney2/dialogs/kimportdlgdecl.ui b/kmymoney2/dialogs/kimportdlgdecl.ui index c915f12..0ebd81b 100644 --- a/kmymoney2/dialogs/kimportdlgdecl.ui +++ b/kmymoney2/dialogs/kimportdlgdecl.ui @@ -1,6 +1,6 @@ KImportDlgDecl - + KImportDlgDecl @@ -50,15 +50,15 @@ Please enter the path to the QIF file or select it by clicking on the Browse but AutoAll - + - layout15 + tqlayout15 unnamed - + lblImportFile @@ -74,7 +74,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but QIF File to Import: - + m_optionGroupBox @@ -103,7 +103,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but Select <b>Bank statement</b> turns on automatic category matching which is turned off in case of <b>Historic data</b>. Use the latter if you import files from other Personal Finance Management software. - + textLabel1 @@ -111,7 +111,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but Source of QIF - + TextLabel3_2 @@ -131,7 +131,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but 0 - + 200 0 @@ -159,7 +159,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but Browse... - + m_qlineeditFile @@ -180,7 +180,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but Horizontal - + Layout90 @@ -204,7 +204,7 @@ Please enter the path to the QIF file or select it by clicking on the Browse but Expanding - + 411 0 @@ -242,5 +242,5 @@ Please enter the path to the QIF file or select it by clicking on the Browse but - + diff --git a/kmymoney2/dialogs/kloadtemplatedlg.cpp b/kmymoney2/dialogs/kloadtemplatedlg.cpp index d765f8a..3666281 100644 --- a/kmymoney2/dialogs/kloadtemplatedlg.cpp +++ b/kmymoney2/dialogs/kloadtemplatedlg.cpp @@ -33,17 +33,17 @@ #include "kloadtemplatedlg.h" #include "../widgets/kaccounttemplateselector.h" -KLoadTemplateDlg::KLoadTemplateDlg(QWidget* parent, const char* name) : - KLoadTemplateDlgDecl(parent, name) +KLoadTemplateDlg::KLoadTemplateDlg(TQWidget* tqparent, const char* name) : + KLoadTemplateDlgDecl(tqparent, name) { buttonOk->setGuiItem(KStdGuiItem::ok()); buttonCancel->setGuiItem(KStdGuiItem::cancel()); buttonHelp->setGuiItem(KStdGuiItem::help()); - connect(buttonHelp, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect(buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); } -QValueList KLoadTemplateDlg::templates(void) const +TQValueList KLoadTemplateDlg::templates(void) const { return m_templateSelector->selectedTemplates(); } diff --git a/kmymoney2/dialogs/kloadtemplatedlg.h b/kmymoney2/dialogs/kloadtemplatedlg.h index 44fdfee..d2f36b1 100644 --- a/kmymoney2/dialogs/kloadtemplatedlg.h +++ b/kmymoney2/dialogs/kloadtemplatedlg.h @@ -33,11 +33,12 @@ class KLoadTemplateDlg : public KLoadTemplateDlgDecl { Q_OBJECT + TQ_OBJECT public: - KLoadTemplateDlg(QWidget *parent = 0, const char *name = 0); + KLoadTemplateDlg(TQWidget *tqparent = 0, const char *name = 0); - QValueList templates(void) const; + TQValueList templates(void) const; private slots: void slotHelp(void); diff --git a/kmymoney2/dialogs/kloadtemplatedlgdecl.ui b/kmymoney2/dialogs/kloadtemplatedlgdecl.ui index 4790de9..4e9b4e9 100644 --- a/kmymoney2/dialogs/kloadtemplatedlgdecl.ui +++ b/kmymoney2/dialogs/kloadtemplatedlgdecl.ui @@ -1,6 +1,6 @@ KLoadTemplateDlgDecl - + KLoadTemplateDlgDecl @@ -27,9 +27,9 @@ m_templateSelector - + - layout4 + tqlayout4 @@ -53,7 +53,7 @@ Expanding - + 228 20 @@ -102,5 +102,8 @@ accept() - + + kmymoney/kaccounttemplateselector.h + + diff --git a/kmymoney2/dialogs/kmergetransactionsdlg.cpp b/kmymoney2/dialogs/kmergetransactionsdlg.cpp index 692c88f..99dadbd 100644 --- a/kmymoney2/dialogs/kmergetransactionsdlg.cpp +++ b/kmymoney2/dialogs/kmergetransactionsdlg.cpp @@ -31,8 +31,8 @@ #include "kmergetransactionsdlg.h" -KMergeTransactionsDlg::KMergeTransactionsDlg(const MyMoneyAccount& account, QWidget* parent, const char* name) : - KSelectTransactionsDlg(account, parent, name) +KMergeTransactionsDlg::KMergeTransactionsDlg(const MyMoneyAccount& account, TQWidget* tqparent, const char* name) : + KSelectTransactionsDlg(account, tqparent, name) { // setup descriptive texts @@ -40,7 +40,7 @@ KMergeTransactionsDlg::KMergeTransactionsDlg(const MyMoneyAccount& account, QWid m_description->setText(i18n("Are you sure you wish to merge these transactions?")); // no selection possible - m_register->setSelectionMode(QTable::NoSelection); + m_register->setSelectionMode(TQTable::NoSelection); // override default and enable ok button right away buttonOk->setEnabled(true); diff --git a/kmymoney2/dialogs/kmergetransactionsdlg.h b/kmymoney2/dialogs/kmergetransactionsdlg.h index ebbfd82..23d1d5d 100644 --- a/kmymoney2/dialogs/kmergetransactionsdlg.h +++ b/kmymoney2/dialogs/kmergetransactionsdlg.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -class QResizeEvent; +class TQResizeEvent; // ---------------------------------------------------------------------------- // KDE Includes @@ -39,10 +39,11 @@ class QResizeEvent; class KMergeTransactionsDlg: public KSelectTransactionsDlg { Q_OBJECT + TQ_OBJECT public: - KMergeTransactionsDlg(const MyMoneyAccount& account, QWidget* parent = 0, const char* name = 0); + KMergeTransactionsDlg(const MyMoneyAccount& account, TQWidget* tqparent = 0, const char* name = 0); - bool eventFilter(QObject* , QEvent* ) { return false; } + bool eventFilter(TQObject* , TQEvent* ) { return false; } public slots: void slotHelp(); diff --git a/kmymoney2/dialogs/kmymoneyfileinfodlg.cpp b/kmymoney2/dialogs/kmymoneyfileinfodlg.cpp index 108c776..c7ae4b1 100644 --- a/kmymoney2/dialogs/kmymoneyfileinfodlg.cpp +++ b/kmymoney2/dialogs/kmymoneyfileinfodlg.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -34,8 +34,8 @@ #include #include -KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(QWidget *parent, const char *name ) - : KMyMoneyFileInfoDlgDecl(parent, name) +KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(TQWidget *tqparent, const char *name ) + : KMyMoneyFileInfoDlgDecl(tqparent, name) { // Hide the unused buttons. buttonCancel->hide(); @@ -48,16 +48,16 @@ KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(QWidget *parent, const char *name ) m_lastModificationDate->setText(storage->lastModificationDate().toString(Qt::ISODate)); m_baseCurrency->setText(storage->value("kmm-baseCurrency")); - m_payeeCount->setText(QString("%1").arg(storage->payeeList().count())); - m_institutionCount->setText(QString("%1").arg(storage->institutionList().count())); + m_payeeCount->setText(TQString("%1").tqarg(storage->payeeList().count())); + m_institutionCount->setText(TQString("%1").tqarg(storage->institutionList().count())); - QValueList a_list; + TQValueList a_list; storage->accountList(a_list); - m_accountCount->setText(QString("%1").arg(a_list.count())); + m_accountCount->setText(TQString("%1").tqarg(a_list.count())); - QMap accountMap; - QMap accountMapClosed; - QValueList::const_iterator it_a; + TQMap accountMap; + TQMap accountMapClosed; + TQValueList::const_iterator it_a; for(it_a = a_list.begin(); it_a != a_list.end(); ++it_a) { accountMap[(*it_a).accountType()] = accountMap[(*it_a).accountType()] + 1; accountMapClosed[(*it_a).accountType()] = accountMapClosed[(*it_a).accountType()] + 0; @@ -65,24 +65,24 @@ KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(QWidget *parent, const char *name ) accountMapClosed[(*it_a).accountType()] = accountMapClosed[(*it_a).accountType()] + 1; } - QMap::const_iterator it_m; + TQMap::const_iterator it_m; for(it_m = accountMap.begin(); it_m != accountMap.end(); ++it_m) { - new KListViewItem(m_accountView, KMyMoneyUtils::accountTypeToString(it_m.key()), QString("%1").arg(*it_m), QString("%1").arg(accountMapClosed[it_m.key()])); + new KListViewItem(m_accountView, KMyMoneyUtils::accountTypeToString(it_m.key()), TQString("%1").tqarg(*it_m), TQString("%1").tqarg(accountMapClosed[it_m.key()])); } MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - m_transactionCount->setText(QString("%1").arg(storage->transactionList(filter).count())); + m_transactionCount->setText(TQString("%1").tqarg(storage->transactionList(filter).count())); filter.setReportAllSplits(true); - m_splitCount->setText(QString("%1").arg(storage->transactionList(filter).count())); - m_scheduleCount->setText(QString("%1").arg(storage->scheduleList().count())); + m_splitCount->setText(TQString("%1").tqarg(storage->transactionList(filter).count())); + m_scheduleCount->setText(TQString("%1").tqarg(storage->scheduleList().count())); MyMoneyPriceList list = storage->priceList(); MyMoneyPriceList::const_iterator it_p; int pCount = 0; for(it_p = list.begin(); it_p != list.end(); ++it_p) pCount += (*it_p).count(); - m_priceCount->setText(QString("%1").arg(pCount)); + m_priceCount->setText(TQString("%1").tqarg(pCount)); } KMyMoneyFileInfoDlg::~KMyMoneyFileInfoDlg() diff --git a/kmymoney2/dialogs/kmymoneyfileinfodlg.h b/kmymoney2/dialogs/kmymoneyfileinfodlg.h index 9ba7f56..548b5a3 100644 --- a/kmymoney2/dialogs/kmymoneyfileinfodlg.h +++ b/kmymoney2/dialogs/kmymoneyfileinfodlg.h @@ -36,8 +36,9 @@ class KMyMoneyFileInfoDlg : public KMyMoneyFileInfoDlgDecl { Q_OBJECT + TQ_OBJECT public: - KMyMoneyFileInfoDlg(QWidget *parent=0, const char *name=0); + KMyMoneyFileInfoDlg(TQWidget *tqparent=0, const char *name=0); virtual ~KMyMoneyFileInfoDlg(); }; diff --git a/kmymoney2/dialogs/kmymoneyfileinfodlgdecl.ui b/kmymoney2/dialogs/kmymoneyfileinfodlgdecl.ui index fe2cd18..58528ed 100644 --- a/kmymoney2/dialogs/kmymoneyfileinfodlgdecl.ui +++ b/kmymoney2/dialogs/kmymoneyfileinfodlgdecl.ui @@ -1,6 +1,6 @@ KMyMoneyFileInfoDlgDecl - + KMyMoneyFileInfoDlgDecl @@ -25,15 +25,15 @@ unnamed - + - layout3 + tqlayout3 unnamed - + m_baseCurrency @@ -41,7 +41,7 @@ x - + m_scheduleCount @@ -96,7 +96,7 @@ AllColumns - + textLabel7 @@ -104,7 +104,7 @@ Accounts/Categories - + textLabel19 @@ -112,7 +112,7 @@ Prices - + textLabel3 @@ -120,7 +120,7 @@ Created on - + m_priceCount @@ -128,7 +128,7 @@ x - + textLabel9 @@ -136,7 +136,7 @@ Schedules - + textLabel8 @@ -144,7 +144,7 @@ Transactions - + textLabel1 @@ -152,7 +152,7 @@ Splits - + m_payeeCount @@ -160,7 +160,7 @@ x - + m_institutionCount @@ -168,7 +168,7 @@ x - + textLabel6 @@ -176,7 +176,7 @@ Institutions - + m_creationDate @@ -184,7 +184,7 @@ x - + m_transactionCount @@ -192,7 +192,7 @@ x - + m_accountCount @@ -200,7 +200,7 @@ x - + textLabel10 @@ -208,7 +208,7 @@ Payees - + textLabel5 @@ -216,7 +216,7 @@ Base currency - + textLabel4 @@ -224,7 +224,7 @@ Last modified on - + m_splitCount @@ -232,7 +232,7 @@ x - + m_lastModificationDate @@ -252,7 +252,7 @@ Expanding - + 20 20 @@ -273,15 +273,15 @@ Horizontal - + - layout2 + tqlayout2 unnamed - + buttonHelp @@ -305,7 +305,7 @@ Expanding - + 120 20 @@ -354,5 +354,5 @@ reject() - + diff --git a/kmymoney2/dialogs/kmymoneypricedlg.cpp b/kmymoney2/dialogs/kmymoneypricedlg.cpp index cd8d66f..a64fd13 100644 --- a/kmymoney2/dialogs/kmymoneypricedlg.cpp +++ b/kmymoney2/dialogs/kmymoneypricedlg.cpp @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -53,47 +53,47 @@ #define PRICE_COL 3 #define SOURCE_COL 4 -KMyMoneyPriceDlg::KMyMoneyPriceDlg(QWidget* parent, const char *name) : - KMyMoneyPriceDlgDecl(parent, name) +KMyMoneyPriceDlg::KMyMoneyPriceDlg(TQWidget* tqparent, const char *name) : + KMyMoneyPriceDlgDecl(tqparent, name) { KIconLoader *il = KGlobal::iconLoader(); KGuiItem removeButtenItem( i18n( "&Delete" ), - QIconSet(il->loadIcon("delete", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("delete", KIcon::Small, KIcon::SizeSmall)), i18n("Delete this entry"), i18n("Remove this price item from the file")); m_deleteButton->setGuiItem(removeButtenItem); KGuiItem newButtenItem( i18n( "&New" ), - QIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), i18n("Add a new entry"), i18n("Create a new price entry.")); m_newButton->setGuiItem(newButtenItem); KGuiItem editButtenItem( i18n( "&Edit" ), - QIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), i18n("Modify the selected entry"), i18n("Change the details of selected price information.")); m_editButton->setGuiItem(editButtenItem); KGuiItem okButtenItem( i18n("&Close" ), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Close the dialog"), i18n("Use this to close the dialog and return to the application.")); m_closeButton->setGuiItem(okButtenItem); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(accept())); - connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditPrice())); - connect(m_priceList, SIGNAL(editPrice()), this, SLOT(slotEditPrice())); - connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(slotDeletePrice())); - connect(m_priceList, SIGNAL(deletePrice()), this, SLOT(slotDeletePrice())); - connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNewPrice())); - connect(m_priceList, SIGNAL(newPrice()), this, SLOT(slotNewPrice())); - connect(m_priceList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectPrice(QListViewItem*))); - connect(m_onlineQuoteButton, SIGNAL(clicked()), this, SLOT(slotOnlinePriceUpdate())); - connect(m_priceList, SIGNAL(onlinePriceUpdate()), this, SLOT(slotOnlinePriceUpdate())); + connect(m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(m_editButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditPrice())); + connect(m_priceList, TQT_SIGNAL(editPrice()), this, TQT_SLOT(slotEditPrice())); + connect(m_deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeletePrice())); + connect(m_priceList, TQT_SIGNAL(deletePrice()), this, TQT_SLOT(slotDeletePrice())); + connect(m_newButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewPrice())); + connect(m_priceList, TQT_SIGNAL(newPrice()), this, TQT_SLOT(slotNewPrice())); + connect(m_priceList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectPrice(TQListViewItem*))); + connect(m_onlineQuoteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOnlinePriceUpdate())); + connect(m_priceList, TQT_SIGNAL(onlinePriceUpdate()), this, TQT_SLOT(slotOnlinePriceUpdate())); - connect(m_showAllPrices, SIGNAL(toggled(bool)), this, SLOT(slotLoadWidgets())); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadWidgets())); + connect(m_showAllPrices, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotLoadWidgets())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadWidgets())); slotLoadWidgets(); slotSelectPrice(0); @@ -128,7 +128,7 @@ void KMyMoneyPriceDlg::slotLoadWidgets(void) } } -void KMyMoneyPriceDlg::slotSelectPrice(QListViewItem * item) +void KMyMoneyPriceDlg::slotSelectPrice(TQListViewItem * item) { m_currentItem = item; m_editButton->setEnabled(item != 0); @@ -162,7 +162,7 @@ void KMyMoneyPriceDlg::slotNewPrice(void) m_priceList->setSelected(p, true); // If the user cancels the following operation, we delete the new item // and re-select any previously selected one - if(slotEditPrice() == QDialog::Rejected) { + if(slotEditPrice() == TQDialog::Rejected) { delete p; if(item) m_priceList->setSelected(item, true); @@ -172,7 +172,7 @@ void KMyMoneyPriceDlg::slotNewPrice(void) int KMyMoneyPriceDlg::slotEditPrice(void) { - int rc = QDialog::Rejected; + int rc = TQDialog::Rejected; KMyMoneyPriceItem* item = dynamic_cast(m_priceList->selectedItem()); if(item) { MyMoneySecurity from(MyMoneyFile::instance()->security(item->price().from())); @@ -217,11 +217,11 @@ void KMyMoneyPriceDlg::slotOnlinePriceUpdate(void) if(item) { KEquityPriceUpdateDlg dlg(this, (item->text(COMMODITY_COL)+" "+item->text(CURRENCY_COL)).utf8()); - if(dlg.exec() == QDialog::Accepted) + if(dlg.exec() == TQDialog::Accepted) dlg.storePrices(); } else { KEquityPriceUpdateDlg dlg(this); - if(dlg.exec() == QDialog::Accepted) + if(dlg.exec() == TQDialog::Accepted) dlg.storePrices(); } } @@ -234,9 +234,9 @@ void KMyMoneyPriceDlg::slotOnlinePriceUpdate(void) // complains and if not, we get rid of this whole block one day. (2007-06-22 ipwizard) // // kmymoney2/widgets/kmymoneypriceview.cpp:179: undefined reference to -// `KUpdateStockPriceDlg::KUpdateStockPriceDlg[in-charge](QWidget*, char const*)' +// `KUpdateStockPriceDlg::KUpdateStockPriceDlg[in-charge](TQWidget*, char const*)' // kmymoney2/widgets/kmymoneypriceview.cpp:204: undefined reference to -// `KUpdateStockPriceDlg::KUpdateStockPriceDlg[in-charge](QDate const&, QString const&, QWidget*, char const*)' +// `KUpdateStockPriceDlg::KUpdateStockPriceDlg[in-charge](TQDate const&, TQString const&, TQWidget*, char const*)' void KEditEquityEntryDlg_useless(void) { delete new KUpdateStockPriceDlg(); diff --git a/kmymoney2/dialogs/kmymoneypricedlg.h b/kmymoney2/dialogs/kmymoneypricedlg.h index c7e7c99..c3c23e5 100644 --- a/kmymoney2/dialogs/kmymoneypricedlg.h +++ b/kmymoney2/dialogs/kmymoneypricedlg.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -class QListViewItem; +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes @@ -40,12 +40,13 @@ class QListViewItem; class KMyMoneyPriceDlg : public KMyMoneyPriceDlgDecl { Q_OBJECT + TQ_OBJECT public: - KMyMoneyPriceDlg(QWidget* parent, const char *name); + KMyMoneyPriceDlg(TQWidget* tqparent, const char *name); ~KMyMoneyPriceDlg(); protected slots: - void slotSelectPrice(QListViewItem* item); + void slotSelectPrice(TQListViewItem* item); void slotNewPrice(void); void slotDeletePrice(void); int slotEditPrice(void); @@ -53,7 +54,7 @@ protected slots: void slotOnlinePriceUpdate(void); private: - QListViewItem* m_currentItem; + TQListViewItem* m_currentItem; }; #endif // KMYMONEYPRICEDLG_H diff --git a/kmymoney2/dialogs/kmymoneypricedlgdecl.ui b/kmymoney2/dialogs/kmymoneypricedlgdecl.ui index 27895e3..424c25d 100644 --- a/kmymoney2/dialogs/kmymoneypricedlgdecl.ui +++ b/kmymoney2/dialogs/kmymoneypricedlgdecl.ui @@ -1,6 +1,6 @@ KMyMoneyPriceDlgDecl - + KMyMoneyPriceDlgDecl @@ -19,17 +19,17 @@ unnamed - + - layout24 + tqlayout24 unnamed - + - layout23 + tqlayout23 @@ -40,7 +40,7 @@ m_priceList - + m_showAllPrices @@ -50,9 +50,9 @@ - + - layout9 + tqlayout9 @@ -100,7 +100,7 @@ Expanding - + 21 150 @@ -133,9 +133,9 @@ Horizontal - + - layout8 + tqlayout8 @@ -151,16 +151,16 @@ Expanding - + 560 20 - + - layout7 + tqlayout7 @@ -216,5 +216,5 @@ m_onlineQuoteButton m_closeButton - + diff --git a/kmymoney2/dialogs/kmymoneysplittable.cpp b/kmymoney2/dialogs/kmymoneysplittable.cpp index 5b5f1af..d1182ec 100644 --- a/kmymoney2/dialogs/kmymoneysplittable.cpp +++ b/kmymoney2/dialogs/kmymoneysplittable.cpp @@ -25,13 +25,13 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -62,8 +62,8 @@ #include "../mymoney/mymoneyutils.h" -kMyMoneySplitTable::kMyMoneySplitTable(QWidget *parent, const char *name ) : - QTable(parent,name), +kMyMoneySplitTable::kMyMoneySplitTable(TQWidget *tqparent, const char *name ) : + TQTable(tqparent,name), m_currentRow(0), m_maxRows(0), m_editMode(false), @@ -78,7 +78,7 @@ kMyMoneySplitTable::kMyMoneySplitTable(QWidget *parent, const char *name ) : horizontalHeader()->setLabel(0, i18n("Category")); horizontalHeader()->setLabel(1, i18n("Memo")); horizontalHeader()->setLabel(2, i18n("Amount")); - setSelectionMode(QTable::NoSelection); + setSelectionMode(TQTable::NoSelection); setLeftMargin(0); verticalHeader()->hide(); setColumnStretchable(0, false); @@ -88,63 +88,63 @@ kMyMoneySplitTable::kMyMoneySplitTable(QWidget *parent, const char *name ) : horizontalHeader()->setMovingEnabled(false); horizontalHeader()->setFont(KMyMoneyGlobalSettings::listHeaderFont()); - setVScrollBarMode(QScrollView::AlwaysOn); + setVScrollBarMode(TQScrollView::AlwaysOn); // never show a horizontal scroll bar - setHScrollBarMode(QScrollView::AlwaysOff); + setHScrollBarMode(TQScrollView::AlwaysOff); // setup the context menu m_contextMenu = new KPopupMenu(this); KIconLoader *il = KGlobal::iconLoader(); m_contextMenu->insertTitle(il->loadIcon("transaction", KIcon::MainToolbar), i18n("Split Options")); - m_contextMenu->insertItem(il->loadIcon("edit", KIcon::Small), i18n("Edit..."), this, SLOT(slotStartEdit())); - m_contextMenuDuplicate = m_contextMenu->insertItem(il->loadIcon("editcopy", KIcon::Small), i18n("Duplicate"), this, SLOT(slotDuplicateSplit())); + m_contextMenu->insertItem(il->loadIcon("edit", KIcon::Small), i18n("Edit..."), this, TQT_SLOT(slotStartEdit())); + m_contextMenuDuplicate = m_contextMenu->insertItem(il->loadIcon("editcopy", KIcon::Small), i18n("Duplicate"), this, TQT_SLOT(slotDuplicateSplit())); m_contextMenuDelete = m_contextMenu->insertItem(il->loadIcon("delete", KIcon::Small), i18n("Delete ..."), - this, SLOT(slotDeleteSplit())); + this, TQT_SLOT(slotDeleteSplit())); - connect(this, SIGNAL(clicked(int, int, int, const QPoint&)), - this, SLOT(slotSetFocus(int, int, int, const QPoint&))); + connect(this, TQT_SIGNAL(clicked(int, int, int, const TQPoint&)), + this, TQT_SLOT(slotSetFocus(int, int, int, const TQPoint&))); - connect(this, SIGNAL(transactionChanged(const MyMoneyTransaction&)), - this, SLOT(slotUpdateData(const MyMoneyTransaction&))); + connect(this, TQT_SIGNAL(transactionChanged(const MyMoneyTransaction&)), + this, TQT_SLOT(slotUpdateData(const MyMoneyTransaction&))); } kMyMoneySplitTable::~kMyMoneySplitTable() { } -void kMyMoneySplitTable::setup(const QMap& priceInfo) +void kMyMoneySplitTable::setup(const TQMap& priceInfo) { m_priceInfo = priceInfo; } -const QColor kMyMoneySplitTable::rowBackgroundColor(const int row) const +const TQColor kMyMoneySplitTable::rowBackgroundColor(const int row) const { return (row % 2) ? KMyMoneyGlobalSettings::listColor() : KMyMoneyGlobalSettings::listBGColor(); } -void kMyMoneySplitTable::paintCell(QPainter *p, int row, int col, const QRect& r, bool /*selected*/) +void kMyMoneySplitTable::paintCell(TQPainter *p, int row, int col, const TQRect& r, bool /*selected*/) { - QColorGroup g = colorGroup(); - QColor textColor; + TQColorGroup g = tqcolorGroup(); + TQColor textColor; - g.setColor(QColorGroup::Base, rowBackgroundColor(row)); + g.setColor(TQColorGroup::Base, rowBackgroundColor(row)); p->setFont(KMyMoneyGlobalSettings::listCellFont()); - QString firsttext = text(row, col); - QString qstringCategory; - QString qstringMemo; + TQString firsttext = text(row, col); + TQString qstringCategory; + TQString qstringMemo; - int intPos = firsttext.find("|"); + int intPos = firsttext.tqfind("|"); if(intPos > -1) { qstringCategory = firsttext.left(intPos); qstringMemo = firsttext.mid(intPos + 1); } - QRect rr = r; - QRect rr2 = r; + TQRect rr = r; + TQRect rr2 = r; rr.setX(0); rr.setY(0); rr.setWidth(columnWidth(col)); @@ -157,12 +157,12 @@ void kMyMoneySplitTable::paintCell(QPainter *p, int row, int col, const QRect& r if(row == m_currentRow) { - QBrush backgroundBrush(g.highlight()); + TQBrush backgroundBrush(g.highlight()); textColor = g.highlightedText(); p->fillRect(rr,backgroundBrush); } else { - QBrush backgroundBrush(g.base()); + TQBrush backgroundBrush(g.base()); textColor = g.text(); p->fillRect(rr,backgroundBrush); } @@ -178,17 +178,17 @@ void kMyMoneySplitTable::paintCell(QPainter *p, int row, int col, const QRect& r switch (col) { case 0: // category case 1: // memo - p->drawText(rr2, Qt::AlignLeft | Qt::AlignVCenter, text(row, col)); + p->drawText(rr2, TQt::AlignLeft | TQt::AlignVCenter, text(row, col)); break; case 2: // amount - p->drawText(rr2, Qt::AlignRight | Qt::AlignVCenter,firsttext); + p->drawText(rr2, TQt::AlignRight | TQt::AlignVCenter,firsttext); break; } } -/** Override the QTable member function to avoid display of focus */ -void kMyMoneySplitTable::paintFocus(QPainter * /* p */, const QRect & /*cr*/) +/** Override the TQTable member function to avoid display of focus */ +void kMyMoneySplitTable::paintFocus(TQPainter * /* p */, const TQRect & /*cr*/) { } @@ -198,42 +198,42 @@ void kMyMoneySplitTable::columnWidthChanged(int col) updateCell(i, col); } -/** Override the QTable member function to avoid confusion with our own functionality */ -void kMyMoneySplitTable::endEdit(int /*row*/, int /*col*/, bool /*accept*/, bool /*replace*/ ) +/** Override the TQTable member function to avoid confusion with our own functionality */ +void kMyMoneySplitTable::endEdit(int /*row*/, int /*col*/, bool /*accept*/, bool /*tqreplace*/ ) { } -bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) +bool kMyMoneySplitTable::eventFilter(TQObject *o, TQEvent *e) { // MYMONEYTRACER(tracer); - QKeyEvent *k = static_cast (e); + TQKeyEvent *k = TQT_TQKEYEVENT (e); bool rc = false; int row = currentRow(); int lines = visibleHeight()/rowHeight(0); - QWidget* w; + TQWidget* w; - if(e->type() == QEvent::KeyPress && !isEditMode()) { + if(e->type() == TQEvent::KeyPress && !isEditMode()) { rc = true; switch(k->key()) { - case Qt::Key_Up: + case TQt::Key_Up: if(row) slotSetFocus(row-1); break; - case Qt::Key_Down: + case TQt::Key_Down: if(row < static_cast (m_transaction.splits().count()-1)) slotSetFocus(row+1); break; - case Qt::Key_Home: + case TQt::Key_Home: slotSetFocus(0); break; - case Qt::Key_End: + case TQt::Key_End: slotSetFocus(m_transaction.splits().count()-1); break; - case Qt::Key_PageUp: + case TQt::Key_PageUp: if(lines) { while(lines-- > 0 && row) row--; @@ -241,7 +241,7 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) } break; - case Qt::Key_PageDown: + case TQt::Key_PageDown: if(row < static_cast (m_transaction.splits().count()-1)) { while(lines-- > 0 && row < static_cast (m_transaction.splits().count()-1)) row++; @@ -249,12 +249,12 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) } break; - case Qt::Key_Delete: + case TQt::Key_Delete: slotDeleteSplit(); break; - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: if(row < static_cast (m_transaction.splits().count()-1) && KMyMoneyGlobalSettings::enterMovesBetweenFields()) { slotStartEdit(); @@ -262,18 +262,18 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) emit returnPressed(); break; - case Qt::Key_Escape: + case TQt::Key_Escape: emit escapePressed(); break; - case Qt::Key_F2: + case TQt::Key_F2: slotStartEdit(); break; default: rc = true; KShortcut copySplit(i18n("Duplicate split", "CTRL+c")); - KShortcut newSplit(QKeySequence(Qt::CTRL | Qt::Key_Insert)); + KShortcut newSplit(TQKeySequence(TQt::CTRL | TQt::Key_Insert)); if(copySplit.contains(KKey(k))) { slotDuplicateSplit(); @@ -284,26 +284,26 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) } else if ( k->text()[ 0 ].isPrint() ) { w = slotStartEdit(); // make sure, the widget receives the key again - QApplication::sendEvent(w, e); + TQApplication::sendEvent(w, e); } break; } - } else if(e->type() == QEvent::KeyPress && isEditMode()) { + } else if(e->type() == TQEvent::KeyPress && isEditMode()) { bool terminate = true; rc = true; switch(k->key()) { // suppress the F2 functionality to start editing in inline edit mode - case Qt::Key_F2: + case TQt::Key_F2: // suppress the cursor movement in inline edit mode - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_PageUp: - case Qt::Key_PageDown: + case TQt::Key_Up: + case TQt::Key_Down: + case TQt::Key_PageUp: + case TQt::Key_PageDown: break; - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: // we cannot call the slot directly, as it destroys the caller of // this method :-( So we let the event handler take care of calling // the respective slot using a timeout. For a KLineEdit derived object @@ -322,38 +322,38 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) // in case we have the 'enter moves focus between fields', we need to simulate // a TAB key when the object 'o' points to the category or memo field. if(KMyMoneyGlobalSettings::enterMovesBetweenFields()) { - if(o == m_editCategory->lineEdit() || o == m_editMemo) { + if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_editCategory->lineEdit()) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_editMemo)) { terminate = false; - QKeyEvent evt(e->type(), - Key_Tab, 0, k->state(), QString::null, + TQKeyEvent evt(e->type(), + Key_Tab, 0, k->state(), TQString(), k->isAutoRepeat(), k->count()); - QApplication::sendEvent( o, &evt ); + TQApplication::sendEvent( o, &evt ); } } if(terminate) { - QTimer::singleShot(0, this, SLOT(slotEndEditKeyboard())); + TQTimer::singleShot(0, this, TQT_SLOT(slotEndEditKeyboard())); } break; - case Qt::Key_Escape: + case TQt::Key_Escape: // we cannot call the slot directly, as it destroys the caller of // this method :-( So we let the event handler take care of calling // the respective slot using a timeout. - QTimer::singleShot(0, this, SLOT(slotCancelEdit())); + TQTimer::singleShot(0, this, TQT_SLOT(slotCancelEdit())); break; default: rc = false; break; } - } else if(e->type() == QEvent::KeyRelease && !isEditMode()) { + } else if(e->type() == TQEvent::KeyRelease && !isEditMode()) { // for some reason, we only see a KeyRelease event of the Menu key // here. In other locations (e.g. Register::eventFilter()) we see // a KeyPress event. Strange. (ipwizard - 2008-05-10) switch(k->key()) { - case Qt::Key_Menu: + case TQt::Key_Menu: // if the very last entry is selected, the delete // operation is not available otherwise it is m_contextMenu->setItemEnabled(m_contextMenuDelete, @@ -361,7 +361,7 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) m_contextMenu->setItemEnabled(m_contextMenuDuplicate, row < static_cast (m_transaction.splits().count()-1)); - m_contextMenu->exec(QCursor::pos()); + m_contextMenu->exec(TQCursor::pos()); rc = true; break; default: @@ -372,16 +372,16 @@ bool kMyMoneySplitTable::eventFilter(QObject *o, QEvent *e) // if the event has not been processed here, forward it to // the base class implementation if it's not a key event if(rc == false) { - if(e->type() != QEvent::KeyPress - && e->type() != QEvent::KeyRelease) { - rc = QTable::eventFilter(o, e); + if(e->type() != TQEvent::KeyPress + && e->type() != TQEvent::KeyRelease) { + rc = TQTable::eventFilter(o, e); } } return rc; } -void kMyMoneySplitTable::slotSetFocus(int realrow, int /* col */, int button, const QPoint& /* point */) +void kMyMoneySplitTable::slotSetFocus(int realrow, int /* col */, int button, const TQPoint& /* point */) { MYMONEYTRACER(tracer); int row = realrow; @@ -422,22 +422,22 @@ void kMyMoneySplitTable::slotSetFocus(int realrow, int /* col */, int button, co m_contextMenu->setItemEnabled(m_contextMenuDuplicate, row < static_cast (m_transaction.splits().count()-1)); - m_contextMenu->exec(QCursor::pos()); + m_contextMenu->exec(TQCursor::pos()); } } } -void kMyMoneySplitTable::contentsMousePressEvent( QMouseEvent* e ) +void kMyMoneySplitTable::contentsMousePressEvent( TQMouseEvent* e ) { slotSetFocus( rowAt(e->pos().y()), columnAt(e->pos().x()), e->button(), e->pos() ); } -/* turn off QTable behaviour */ -void kMyMoneySplitTable::contentsMouseReleaseEvent( QMouseEvent* /* e */ ) +/* turn off TQTable behaviour */ +void kMyMoneySplitTable::contentsMouseReleaseEvent( TQMouseEvent* /* e */ ) { } -void kMyMoneySplitTable::contentsMouseDoubleClickEvent( QMouseEvent *e ) +void kMyMoneySplitTable::contentsMouseDoubleClickEvent( TQMouseEvent *e ) { MYMONEYTRACER(tracer); @@ -452,7 +452,7 @@ void kMyMoneySplitTable::contentsMouseDoubleClickEvent( QMouseEvent *e ) break; case 2: - editWidget = dynamic_cast (m_editAmount->focusWidget()); + editWidget = dynamic_cast (m_editAmount->tqfocusWidget()); break; default: @@ -463,7 +463,7 @@ void kMyMoneySplitTable::contentsMouseDoubleClickEvent( QMouseEvent *e ) editWidget->selectAll(); // we need to call setFocus on the edit widget from the // main loop again to get the keyboard focus to the widget also - QTimer::singleShot(0, editWidget, SLOT(setFocus())); + TQTimer::singleShot(0, editWidget, TQT_SLOT(setFocus())); } } @@ -474,8 +474,8 @@ void kMyMoneySplitTable::setCurrentCell(int row, int /* col */) if(row > m_maxRows) row = m_maxRows; m_currentRow = row; - QTable::setCurrentCell(row, 0); - QValueList list = getSplits(m_transaction); + TQTable::setCurrentCell(row, 0); + TQValueList list = getSplits(m_transaction); if(row < static_cast(list.count())) m_split = list[row]; else @@ -484,16 +484,16 @@ void kMyMoneySplitTable::setCurrentCell(int row, int /* col */) void kMyMoneySplitTable::setNumRows(int irows) { - QTable::setNumRows(irows); + TQTable::setNumRows(irows); // determine row height according to the edit widgets // we use the category widget as the base - QFontMetrics fm( KMyMoneyGlobalSettings::listCellFont() ); + TQFontMetrics fm( KMyMoneyGlobalSettings::listCellFont() ); int height = fm.lineSpacing()+6; #if 0 // recalculate row height hint KMyMoneyCategory cat; - height = QMAX(cat.sizeHint().height(), height); + height = TQMAX(cat.tqsizeHint().height(), height); #endif verticalHeader()->setUpdatesEnabled(false); @@ -517,10 +517,10 @@ void kMyMoneySplitTable::setTransaction(const MyMoneyTransaction& t, const MyMon slotUpdateData(m_transaction); } -const QValueList kMyMoneySplitTable::getSplits(const MyMoneyTransaction& t) const +const TQValueList kMyMoneySplitTable::getSplits(const MyMoneyTransaction& t) const { - QValueList list; - QValueList::Iterator it; + TQValueList list; + TQValueList::Iterator it; // get list of splits list = t.splits(); @@ -541,14 +541,14 @@ void kMyMoneySplitTable::slotUpdateData(const MyMoneyTransaction& t) MYMONEYTRACER(tracer); unsigned long rowCount=0; - QValueList list = getSplits(t); + TQValueList list = getSplits(t); updateTransactionTableSize(); // fill the part that is used by transactions - QValueList::Iterator it; + TQValueList::Iterator it; kMyMoneyEdit* valfield = new kMyMoneyEdit(); for(it = list.begin(); it != list.end(); ++it) { - QString colText; + TQString colText; MyMoneyMoney value = (*it).value(); if(!(*it).accountId().isEmpty()) { try { @@ -558,17 +558,17 @@ void kMyMoneySplitTable::slotUpdateData(const MyMoneyTransaction& t) delete e; } } - QString amountTxt = value.formatMoney(m_account.fraction()); + TQString amountTxt = value.formatMoney(m_account.fraction()); if(value == MyMoneyMoney::autoCalc) { amountTxt = i18n("will be calculated"); } if(colText.isEmpty() && (*it).memo().isEmpty() && value.isZero()) - amountTxt = QString(); + amountTxt = TQString(); unsigned width = fontMetrics().width(amountTxt); valfield->setMinimumWidth(width); - width = valfield->minimumSizeHint().width(); + width = valfield->tqminimumSizeHint().width(); if(width > m_amountWidth) m_amountWidth = width; @@ -613,7 +613,7 @@ void kMyMoneySplitTable::updateTransactionTableSize(void) m_maxRows = splitCount; } -void kMyMoneySplitTable::resizeEvent(QResizeEvent* /* ev */) +void kMyMoneySplitTable::resizeEvent(TQResizeEvent* /* ev */) { int w = visibleWidth() - m_amountWidth; @@ -628,7 +628,7 @@ void kMyMoneySplitTable::resizeEvent(QResizeEvent* /* ev */) void kMyMoneySplitTable::slotDuplicateSplit(void) { MYMONEYTRACER(tracer); - QValueList list = getSplits(m_transaction); + TQValueList list = getSplits(m_transaction); if(m_currentRow < static_cast (list.count())) { MyMoneySplit split = list[m_currentRow]; split.clearId(); @@ -645,7 +645,7 @@ void kMyMoneySplitTable::slotDuplicateSplit(void) void kMyMoneySplitTable::slotDeleteSplit(void) { MYMONEYTRACER(tracer); - QValueList list = getSplits(m_transaction); + TQValueList list = getSplits(m_transaction); if(m_currentRow < static_cast (list.count())) { if(KMessageBox::warningContinueCancel (this, i18n("You are about to delete the selected split. " @@ -669,7 +669,7 @@ void kMyMoneySplitTable::slotDeleteSplit(void) } } -QWidget* kMyMoneySplitTable::slotStartEdit(void) +TQWidget* kMyMoneySplitTable::slotStartEdit(void) { MYMONEYTRACER(tracer); return createEditWidgets(); @@ -735,7 +735,7 @@ void kMyMoneySplitTable::endEdit(bool keyBoardDriven) fromValue = s1.value().abs(); // if we had a price info in the beginning, we use it here - if(m_priceInfo.find(cat.currencyId()) != m_priceInfo.end()) { + if(m_priceInfo.tqfind(cat.currencyId()) != m_priceInfo.end()) { toValue = (fromValue * m_priceInfo[cat.currencyId()]).convert(fract); } @@ -760,7 +760,7 @@ void kMyMoneySplitTable::endEdit(bool keyBoardDriven) fract, this, "currencyCalculator"); - if(calc.exec() == QDialog::Rejected) { + if(calc.exec() == TQDialog::Rejected) { return; } else { s1.setShares((s1.value() * calc.price()).convert(fract)); @@ -817,7 +817,7 @@ void kMyMoneySplitTable::destroyEditWidgets(void) { MYMONEYTRACER(tracer); - disconnect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadEditWidgets())); + disconnect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadEditWidgets())); clearCellWidget(m_currentRow, 0); clearCellWidget(m_currentRow, 1); @@ -825,14 +825,14 @@ void kMyMoneySplitTable::destroyEditWidgets(void) clearCellWidget(m_currentRow+1, 0); m_editMode = false; - QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 100); + TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 100); } -QWidget* kMyMoneySplitTable::createEditWidgets(void) +TQWidget* kMyMoneySplitTable::createEditWidgets(void) { MYMONEYTRACER(tracer); - QFont cellFont = KMyMoneyGlobalSettings::listCellFont(); + TQFont cellFont = KMyMoneyGlobalSettings::listCellFont(); m_tabOrderWidgets.clear(); // create the widgets @@ -843,8 +843,8 @@ QWidget* kMyMoneySplitTable::createEditWidgets(void) m_editCategory = new KMyMoneyCategory(); m_editCategory->setHint(i18n("Category")); m_editCategory->setFont(cellFont); - connect(m_editCategory, SIGNAL(createItem(const QString&, QString&)), this, SIGNAL(createCategory(const QString&, QString&))); - connect(m_editCategory, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); + connect(m_editCategory, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SIGNAL(createCategory(const TQString&, TQString&))); + connect(m_editCategory, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); m_editMemo = new kMyMoneyLineEdit(0, 0, false, AlignLeft|AlignVCenter); m_editMemo->setHint(i18n("Memo")); @@ -852,22 +852,22 @@ QWidget* kMyMoneySplitTable::createEditWidgets(void) // create buttons for the mouse users KIconLoader *il = KGlobal::iconLoader(); - m_registerButtonFrame = new QFrame(this, "buttonFrame"); - QPalette palette = m_registerButtonFrame->palette(); - palette.setColor(QColorGroup::Background, rowBackgroundColor(m_currentRow+1) ); + m_registerButtonFrame = new TQFrame(this, "buttonFrame"); + TQPalette palette = m_registerButtonFrame->palette(); + palette.setColor(TQColorGroup::Background, rowBackgroundColor(m_currentRow+1) ); m_registerButtonFrame->setPalette(palette); - QHBoxLayout* l = new QHBoxLayout(m_registerButtonFrame); - m_registerEnterButton = new KPushButton(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall), QString(), m_registerButtonFrame, "EnterButton"); + TQHBoxLayout* l = new TQHBoxLayout(m_registerButtonFrame); + m_registerEnterButton = new KPushButton(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall), TQString(), m_registerButtonFrame, "EnterButton"); - m_registerCancelButton = new KPushButton(il->loadIcon("button_cancel", KIcon::Small, KIcon::SizeSmall), QString(), m_registerButtonFrame, "CancelButton"); + m_registerCancelButton = new KPushButton(il->loadIcon("button_cancel", KIcon::Small, KIcon::SizeSmall), TQString(), m_registerButtonFrame, "CancelButton"); l->addWidget(m_registerEnterButton); l->addWidget(m_registerCancelButton); l->addStretch(2); - connect(m_registerEnterButton, SIGNAL(clicked()), this, SLOT(slotEndEdit())); - connect(m_registerCancelButton, SIGNAL(clicked()), this, SLOT(slotCancelEdit())); + connect(m_registerEnterButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEndEdit())); + connect(m_registerCancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCancelEdit())); // setup tab order addToTabOrder(m_editCategory); @@ -882,8 +882,8 @@ QWidget* kMyMoneySplitTable::createEditWidgets(void) // check if the transaction is balanced or not. If not, // assign the remainder to the amount. MyMoneyMoney diff; - QValueList list = m_transaction.splits(); - QValueList::ConstIterator it_s; + TQValueList list = m_transaction.splits(); + TQValueList::ConstIterator it_s; for(it_s = list.begin(); it_s != list.end(); ++it_s) { if(!(*it_s).accountId().isEmpty()) diff += (*it_s).value(); @@ -906,10 +906,10 @@ QWidget* kMyMoneySplitTable::createEditWidgets(void) // load e.g. the category widget with the account list slotLoadEditWidgets(); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadEditWidgets())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadEditWidgets())); // setup the keyboard filter for all widgets - for(QWidget* w = m_tabOrderWidgets.first(); w; w = m_tabOrderWidgets.next()) { + for(TQWidget* w = m_tabOrderWidgets.first(); w; w = m_tabOrderWidgets.next()) { w->installEventFilter(this); } @@ -923,7 +923,7 @@ QWidget* kMyMoneySplitTable::createEditWidgets(void) void kMyMoneySplitTable::slotLoadEditWidgets(void) { // reload category widget - QString categoryId = m_editCategory->selectedItem(); + TQString categoryId = m_editCategory->selectedItem(); AccountSet aSet; aSet.addAccountGroup(MyMoneyAccount::Asset); @@ -951,11 +951,11 @@ void kMyMoneySplitTable::slotLoadEditWidgets(void) } -void kMyMoneySplitTable::addToTabOrder(QWidget* w) +void kMyMoneySplitTable::addToTabOrder(TQWidget* w) { if(w) { while(w->focusProxy()) - w = w->focusProxy(); + w = TQT_TQWIDGET(w->focusProxy()); m_tabOrderWidgets.append(w); } } @@ -966,10 +966,10 @@ bool kMyMoneySplitTable::focusNextPrevChild(bool next) bool rc = false; if(m_editCategory) { - QWidget *w = 0; - QWidget *currentWidget; + TQWidget *w = 0; + TQWidget *currentWidget; - m_tabOrderWidgets.find(qApp->focusWidget()); + m_tabOrderWidgets.tqfind(tqApp->tqfocusWidget()); currentWidget = m_tabOrderWidgets.current(); w = next ? m_tabOrderWidgets.next() : m_tabOrderWidgets.prev(); @@ -979,7 +979,7 @@ bool kMyMoneySplitTable::focusNextPrevChild(bool next) } if(w != currentWidget - && ((w->focusPolicy() & TabFocus) == TabFocus) + && ((w->focusPolicy() & TQ_TabFocus) == TQ_TabFocus) && w->isVisible() && w->isEnabled()) { w->setFocus(); rc = true; @@ -989,7 +989,7 @@ bool kMyMoneySplitTable::focusNextPrevChild(bool next) } while(w != currentWidget); } else - rc = QTable::focusNextPrevChild(next); + rc = TQTable::focusNextPrevChild(next); return rc; } diff --git a/kmymoney2/dialogs/kmymoneysplittable.h b/kmymoney2/dialogs/kmymoneysplittable.h index 023660f..477084f 100644 --- a/kmymoney2/dialogs/kmymoneysplittable.h +++ b/kmymoney2/dialogs/kmymoneysplittable.h @@ -26,10 +26,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -50,15 +50,16 @@ class kMyMoneyEdit; /** * @author Thomas Baumgart */ -class kMyMoneySplitTable : public QTable +class kMyMoneySplitTable : public TQTable { Q_OBJECT + TQ_OBJECT public: - kMyMoneySplitTable(QWidget *parent=0, const char *name=0); + kMyMoneySplitTable(TQWidget *tqparent=0, const char *name=0); virtual ~kMyMoneySplitTable(); - void paintCell(QPainter *p, int row, int col, const QRect& r, bool /*selected*/); - void paintFocus(QPainter *p, const QRect &cr); + void paintCell(TQPainter *p, int row, int col, const TQRect& r, bool /*selected*/); + void paintFocus(TQPainter *p, const TQRect &cr); /** * This method is used to load the widget with the information about @@ -83,19 +84,19 @@ public: * @param t reference to transaction * @return list of splits */ - const QValueList getSplits(const MyMoneyTransaction& t) const; + const TQValueList getSplits(const MyMoneyTransaction& t) const; - void setup(const QMap& priceInfo); + void setup(const TQMap& priceInfo); protected: - void contentsMousePressEvent( QMouseEvent* e ); - void contentsMouseReleaseEvent( QMouseEvent* e ); - void contentsMouseDoubleClickEvent( QMouseEvent* e ); - bool eventFilter(QObject *o, QEvent *e); - void endEdit(int row, int col, bool accept, bool replace ); - - void resizeEvent(QResizeEvent*); - QWidget* createEditWidgets(void); + void contentsMousePressEvent( TQMouseEvent* e ); + void contentsMouseReleaseEvent( TQMouseEvent* e ); + void contentsMouseDoubleClickEvent( TQMouseEvent* e ); + bool eventFilter(TQObject *o, TQEvent *e); + void endEdit(int row, int col, bool accept, bool tqreplace ); + + void resizeEvent(TQResizeEvent*); + TQWidget* createEditWidgets(void); void destroyEditWidgets(void); /** @@ -108,7 +109,7 @@ protected: * pressed by the user */ virtual bool focusNextPrevChild(bool next); - void addToTabOrder(QWidget* w); + void addToTabOrder(TQWidget* w); /** * convenience function for setCurrentCell(int row, int col) @@ -128,9 +129,9 @@ protected: * This method retuns the background color for a given @p row. * * @param row the row in question - * @return the color as QColor object + * @return the color as TQColor object */ - const QColor rowBackgroundColor(const int row) const; + const TQColor rowBackgroundColor(const int row) const; void endEdit(bool keyboardDriven); @@ -140,7 +141,7 @@ public slots: virtual void setNumRows(int r); - QWidget* slotStartEdit(void); + TQWidget* slotStartEdit(void); void slotEndEdit(void); void slotEndEditKeyboard(void); void slotDeleteSplit(void); @@ -151,7 +152,7 @@ protected slots: virtual void columnWidthChanged(int col); /// move the focus to the selected @p row. - void slotSetFocus(int row, int col = 0, int button = Qt::LeftButton, const QPoint & mousePos = QPoint(0, 0)); + void slotSetFocus(int row, int col = 0, int button = Qt::LeftButton, const TQPoint & mousePos = TQPoint(0, 0)); /** * Calling this slot refills the widget with the data @@ -190,7 +191,7 @@ signals: * @param txt The name of the category to be created * @param id A connected slot should store the id of the created object in this variable */ - void createCategory(const QString& txt, QString& id); + void createCategory(const TQString& txt, TQString& id); /** * Signal is emitted, if any of the widgets enters (@a state equals @a true) @@ -233,32 +234,32 @@ private: * The widget will be created and destroyed dynamically in createInputWidgets() * and destroyInputWidgets(). */ - QGuardedPtr m_editCategory; + TQGuardedPtr m_editCategory; /** * This member contains a pointer to the input widget for the memo. * The widget will be created and destroyed dynamically in createInputWidgets() * and destroyInputWidgets(). */ - QGuardedPtr m_editMemo; + TQGuardedPtr m_editMemo; /** * This member contains a pointer to the input widget for the amount. * The widget will be created and destroyed dynamically in createInputWidgets() * and destroyInputWidgets(). */ - QGuardedPtr m_editAmount; + TQGuardedPtr m_editAmount; /** * This member keeps the tab order for the above widgets */ - QWidgetList m_tabOrderWidgets; + TQWidgetList m_tabOrderWidgets; - QGuardedPtr m_registerButtonFrame; - QGuardedPtr m_registerEnterButton; - QGuardedPtr m_registerCancelButton; + TQGuardedPtr m_registerButtonFrame; + TQGuardedPtr m_registerEnterButton; + TQGuardedPtr m_registerCancelButton; - QMap m_priceInfo; + TQMap m_priceInfo; }; #endif diff --git a/kmymoney2/dialogs/knewaccountdlg.cpp b/kmymoney2/dialogs/knewaccountdlg.cpp index f941f2e..fb01aef 100644 --- a/kmymoney2/dialogs/knewaccountdlg.cpp +++ b/kmymoney2/dialogs/knewaccountdlg.cpp @@ -23,19 +23,19 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -88,24 +88,24 @@ #define KMM_KDCHART_PROPSET_NORMAL_DATA KDCHART_PROPSET_NORMAL_DATA #endif -KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bool categoryEditor, QWidget *parent, const char *name, const QString& title) - : KNewAccountDlgDecl(parent,name,true), +KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bool categoryEditor, TQWidget *tqparent, const char *name, const TQString& title) + : KNewAccountDlgDecl(tqparent,name,true), m_account(account), m_bSelectedParentAccount(false), m_categoryEditor(categoryEditor), m_isEditing(isEditing) { - QString columnName = ( (categoryEditor) ? i18n("Categories") : i18n("Accounts") ); + TQString columnName = ( (categoryEditor) ? i18n("Categories") : i18n("Accounts") ); m_qlistviewParentAccounts->setRootIsDecorated(true); m_qlistviewParentAccounts->setAllColumnsShowFocus(true); m_qlistviewParentAccounts->setSectionHeader(columnName); m_qlistviewParentAccounts->setMultiSelection(false); m_qlistviewParentAccounts->header()->setResizeEnabled(true); - m_qlistviewParentAccounts->setColumnWidthMode(0, QListView::Maximum); + m_qlistviewParentAccounts->setColumnWidthMode(0, TQListView::Maximum); m_qlistviewParentAccounts->setEnabled(false); // never show the horizontal scroll bar - m_qlistviewParentAccounts->setHScrollBarMode(QScrollView::AlwaysOff); + m_qlistviewParentAccounts->setHScrollBarMode(TQScrollView::AlwaysOff); m_subAccountLabel->setText(i18n("Is a sub account")); @@ -135,7 +135,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo if (categoryEditor) { // get rid of the tabs that are not used for categories - QWidget* tab = m_tab->page(m_tab->indexOf(m_institutionTab)); + TQWidget* tab = m_tab->page(m_tab->indexOf(m_institutionTab)); if(tab) m_tab->removePage(tab); tab = m_tab->page(m_tab->indexOf(m_limitsTab)); @@ -178,7 +178,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo else { // get rid of the tabs that are not used for accounts - QWidget* taxtab = m_tab->page(m_tab->indexOf(m_taxTab)); + TQWidget* taxtab = m_tab->page(m_tab->indexOf(m_taxTab)); if (taxtab) { if(m_account.isAssetLiability()) { m_vatCategory->setText(i18n( "VAT account")); @@ -206,7 +206,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo default: // no limit available, so we might get rid of the tab - QWidget* tab = m_tab->page(m_tab->indexOf(m_limitsTab)); + TQWidget* tab = m_tab->page(m_tab->indexOf(m_limitsTab)); if(tab) m_tab->removePage(tab); // don't try to hide the widgets we just wiped @@ -289,7 +289,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo } if(!m_account.openingDate().isValid()) - m_account.setOpeningDate(QDate::currentDate()); + m_account.setOpeningDate(TQDate::tqcurrentDate()); startDateEdit->setDate(m_account.openingDate()); accountNoEdit->setText(account.number()); @@ -334,14 +334,14 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo // Load the institutions // then the accounts - QString institutionName; + TQString institutionName; try { if (m_isEditing && !account.institutionId().isEmpty()) institutionName = file->institution(account.institutionId()).name(); else - institutionName = QString(); + institutionName = TQString(); } catch (MyMoneyException *e) { @@ -349,7 +349,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo delete e; } - initParentWidget(account.parentAccountId(), account.id()); + initParentWidget(account.tqparentAccountId(), account.id()); if(m_account.isInvest()) m_qlistviewParentAccounts->setEnabled(false); @@ -366,44 +366,44 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo cancelButton->setGuiItem(KStdGuiItem::cancel()); createButton->setGuiItem(KStdGuiItem::ok()); - connect(cancelButton, SIGNAL(clicked()), SLOT(reject())); - connect(createButton, SIGNAL(clicked()), this, SLOT(okClicked())); - connect(m_qlistviewParentAccounts, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(slotSelectionChanged(QListViewItem*))); - connect(m_qbuttonNew, SIGNAL(clicked()), this, SLOT(slotNewClicked())); - connect(typeCombo, SIGNAL(activated(const QString&)), - this, SLOT(slotAccountTypeChanged(const QString&))); + connect(cancelButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); + connect(createButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(okClicked())); + connect(m_qlistviewParentAccounts, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(slotSelectionChanged(TQListViewItem*))); + connect(m_qbuttonNew, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewClicked())); + connect(typeCombo, TQT_SIGNAL(activated(const TQString&)), + this, TQT_SLOT(slotAccountTypeChanged(const TQString&))); - connect(accountNameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckFinished())); + connect(accountNameEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckFinished())); - connect(m_vatCategory, SIGNAL(toggled(bool)), this, SLOT(slotVatChanged(bool))); - connect(m_vatAssignment, SIGNAL(toggled(bool)), this, SLOT(slotVatAssignmentChanged(bool))); - connect(m_vatCategory, SIGNAL(toggled(bool)), this, SLOT(slotCheckFinished())); - connect(m_vatAssignment, SIGNAL(toggled(bool)), this, SLOT(slotCheckFinished())); - connect(m_vatRate, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckFinished())); - connect(m_vatAccount, SIGNAL(stateChanged()), this, SLOT(slotCheckFinished())); + connect(m_vatCategory, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotVatChanged(bool))); + connect(m_vatAssignment, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotVatAssignmentChanged(bool))); + connect(m_vatCategory, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotCheckFinished())); + connect(m_vatAssignment, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotCheckFinished())); + connect(m_vatRate, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckFinished())); + connect(m_vatAccount, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotCheckFinished())); - connect(m_minBalanceEarlyEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMinBalanceAbsoluteEdit(const QString&))); - connect(m_minBalanceAbsoluteEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMinBalanceEarlyEdit(const QString&))); - connect(m_maxCreditEarlyEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMaxCreditAbsoluteEdit(const QString&))); - connect(m_maxCreditAbsoluteEdit, SIGNAL(valueChanged(const QString&)), this, SLOT(slotAdjustMaxCreditEarlyEdit(const QString&))); + connect(m_minBalanceEarlyEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMinBalanceAbsoluteEdit(const TQString&))); + connect(m_minBalanceAbsoluteEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMinBalanceEarlyEdit(const TQString&))); + connect(m_maxCreditEarlyEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMaxCreditAbsoluteEdit(const TQString&))); + connect(m_maxCreditAbsoluteEdit, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotAdjustMaxCreditEarlyEdit(const TQString&))); - connect(m_qcomboboxInstitutions, SIGNAL(activated(const QString&)), this, SLOT(slotLoadInstitutions(const QString&))); + connect(m_qcomboboxInstitutions, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotLoadInstitutions(const TQString&))); m_vatCategory->setChecked(false); m_vatAssignment->setChecked(false); - // make sure our account does not have an id and no parent assigned - // and certainly no children in case we create a new account + // make sure our account does not have an id and no tqparent assigned + // and certainly no tqchildren in case we create a new account if(!m_isEditing) { m_account.clearId(); - m_account.setParentAccountId(QString()); - QStringList::ConstIterator it; + m_account.setParentAccountId(TQString()); + TQStringList::ConstIterator it; while((it = m_account.accountList().begin()) != m_account.accountList().end()) m_account.removeAccountId(*it); if(m_parentItem == 0) { - // force loading of initial parent + // force loading of initial tqparent m_account.setAccountType(MyMoneyAccount::UnknownAccountType); MyMoneyAccount::_accountTypeE type = account.accountType(); if(type == MyMoneyAccount::UnknownAccountType) @@ -416,7 +416,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo m_vatRate->setValue(MyMoneyMoney(m_account.value("VatRate"))*MyMoneyMoney(100,1)); } else { if(!m_account.value("VatAccount").isEmpty()) { - QString accId = m_account.value("VatAccount").latin1(); + TQString accId = m_account.value("VatAccount").latin1(); try { // make sure account exists MyMoneyFile::instance()->account(accId); @@ -435,14 +435,14 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo slotVatAssignmentChanged(m_vatAssignment->isChecked()); slotCheckFinished(); - kMandatoryFieldGroup* requiredFields = new kMandatoryFieldGroup (this); + kMandatoryFieldGroup* requiredFields = new kMandatoryFieldGroup (TQT_TQOBJECT(this)); requiredFields->setOkButton(createButton); // button to be enabled when all fields present requiredFields->add(accountNameEdit); // using a timeout is the only way, I got the 'ensureItemVisible' // working when creating the dialog. I assume, this // has something to do with the delayed update of the display somehow. - QTimer::singleShot(50, this, SLOT(timerDone())); + TQTimer::singleShot(50, this, TQT_SLOT(timerDone())); } void KNewAccountDlg::timerDone(void) @@ -451,7 +451,7 @@ void KNewAccountDlg::timerDone(void) if(m_parentItem) m_qlistviewParentAccounts->ensureItemVisible(m_parentItem); // KNewAccountDlgDecl::resizeEvent(0); m_qlistviewParentAccounts->setColumnWidth(m_qlistviewParentAccounts->nameColumn(), m_qlistviewParentAccounts->visibleWidth()); - m_qlistviewParentAccounts->repaintContents(false); + m_qlistviewParentAccounts->tqrepaintContents(false); } void KNewAccountDlg::setOpeningBalance(const MyMoneyMoney& balance) @@ -468,7 +468,7 @@ void KNewAccountDlg::okClicked() { MyMoneyFile* file = MyMoneyFile::instance(); - QString accountNameText = accountNameEdit->text(); + TQString accountNameText = accountNameEdit->text(); if (accountNameText.isEmpty()) { KMessageBox::error(this, i18n("You have not specified a name.\nPlease fill in this field.")); @@ -476,24 +476,24 @@ void KNewAccountDlg::okClicked() return; } - MyMoneyAccount parent = parentAccount(); - if (parent.name().length() == 0) + MyMoneyAccount tqparent = tqparentAccount(); + if (tqparent.name().length() == 0) { - KMessageBox::error(this, i18n("Please select a parent account.")); + KMessageBox::error(this, i18n("Please select a tqparent account.")); return; } if (!m_categoryEditor) { - QString institutionNameText = m_qcomboboxInstitutions->currentText(); + TQString institutionNameText = m_qcomboboxInstitutions->currentText(); if (institutionNameText != i18n("")) { try { MyMoneyFile *file = MyMoneyFile::instance(); - QValueList list = file->institutionList(); - QValueList::ConstIterator institutionIterator; + TQValueList list = file->institutionList(); + TQValueList::ConstIterator institutionIterator; for (institutionIterator = list.begin(); institutionIterator != list.end(); ++institutionIterator) { if ((*institutionIterator).name() == institutionNameText) @@ -508,7 +508,7 @@ void KNewAccountDlg::okClicked() } else { - m_account.setInstitutionId(QString()); + m_account.setInstitutionId(TQString()); } } @@ -532,16 +532,16 @@ void KNewAccountDlg::okClicked() storeKVP("lastNumberUsed", m_lastCheckNumberUsed); // delete a previous version of the minimumbalance information - storeKVP("minimumBalance", QString(), QString()); + storeKVP("minimumBalance", TQString(), TQString()); MyMoneyAccount::accountTypeE acctype; if (!m_categoryEditor) { acctype = KMyMoneyUtils::stringToAccountType(typeCombo->currentText()); - // If it's a loan, check if the parent is asset or liability. In + // If it's a loan, check if the tqparent is asset or liability. In // case of asset, we change the account type to be AssetLoan if(acctype == MyMoneyAccount::Loan - && parent.accountGroup() == MyMoneyAccount::Asset) + && tqparent.accountGroup() == MyMoneyAccount::Asset) acctype = MyMoneyAccount::AssetLoan; #if 0 @@ -549,22 +549,22 @@ void KNewAccountDlg::okClicked() // we don't need this check anymore. if(!file->nameToAccount(accountNameText).isEmpty() && (file->nameToAccount(accountNameText) != m_account.id())) { - KMessageBox::error(this, QString("")+i18n("An account named %1 already exists. You cannot create a second account with the same name.").arg(accountNameText)+QString("")); + KMessageBox::error(this, TQString("")+i18n("An account named %1 already exists. You cannot create a second account with the same name.").tqarg(accountNameText)+TQString("")); return; } #endif } else { - acctype = parent.accountGroup(); - QString newName; - if(!MyMoneyFile::instance()->isStandardAccount(parent.id())) { - newName = MyMoneyFile::instance()->accountToCategory(parent.id()) + MyMoneyFile::AccountSeperator; + acctype = tqparent.accountGroup(); + TQString newName; + if(!MyMoneyFile::instance()->isStandardAccount(tqparent.id())) { + newName = MyMoneyFile::instance()->accountToCategory(tqparent.id()) + MyMoneyFile::AccountSeperator; } newName += accountNameText; if(!file->categoryToAccount(newName, acctype).isEmpty() && (file->categoryToAccount(newName, acctype) != m_account.id())) { - KMessageBox::error(this, QString("")+i18n("A category named %1 already exists. You cannot create a second category with the same name.").arg(newName)+QString("")); + KMessageBox::error(this, TQString("")+i18n("A category named %1 already exists. You cannot create a second category with the same name.").tqarg(newName)+TQString("")); return; } } @@ -619,7 +619,7 @@ void KNewAccountDlg::okClicked() accept(); } -void KNewAccountDlg::loadKVP(const QString& key, kMyMoneyEdit* widget) +void KNewAccountDlg::loadKVP(const TQString& key, kMyMoneyEdit* widget) { if(!widget) return; @@ -631,7 +631,7 @@ void KNewAccountDlg::loadKVP(const QString& key, kMyMoneyEdit* widget) } } -void KNewAccountDlg::loadKVP(const QString& key, KLineEdit* widget) +void KNewAccountDlg::loadKVP(const TQString& key, KLineEdit* widget) { if(!widget) return; @@ -639,7 +639,7 @@ void KNewAccountDlg::loadKVP(const QString& key, KLineEdit* widget) widget->setText(m_account.value(key)); } -void KNewAccountDlg::storeKVP(const QString& key, const QString& text, const QString& value) +void KNewAccountDlg::storeKVP(const TQString& key, const TQString& text, const TQString& value) { if(text.isEmpty()) m_account.deletePair(key); @@ -647,12 +647,12 @@ void KNewAccountDlg::storeKVP(const QString& key, const QString& text, const QSt m_account.setValue(key, value); } -void KNewAccountDlg::storeKVP(const QString& key, kMyMoneyEdit* widget) +void KNewAccountDlg::storeKVP(const TQString& key, kMyMoneyEdit* widget) { storeKVP(key, widget->lineedit()->text(), widget->text()); } -void KNewAccountDlg::storeKVP(const QString& key, KLineEdit* widget) +void KNewAccountDlg::storeKVP(const TQString& key, KLineEdit* widget) { storeKVP(key, widget->text(), widget->text()); } @@ -669,14 +669,14 @@ const MyMoneyAccount& KNewAccountDlg::account(void) break; case 1: case 2: - m_account.setValue("priceMode", QString("%1").arg(m_priceMode->currentItem())); + m_account.setValue("priceMode", TQString("%1").tqarg(m_priceMode->currentItem())); break; } return m_account; } -const MyMoneyAccount& KNewAccountDlg::parentAccount(void) +const MyMoneyAccount& KNewAccountDlg::tqparentAccount(void) { if (!m_bSelectedParentAccount) { @@ -710,7 +710,7 @@ const MyMoneyAccount& KNewAccountDlg::parentAccount(void) return m_parentAccount; } -void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId) +void KNewAccountDlg::initParentWidget(TQString tqparentId, const TQString& accountId) { MyMoneyFile *file = MyMoneyFile::instance(); @@ -723,18 +723,18 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_parentItem = 0; m_accountItem = 0; - // Determine the parent account + // Determine the tqparent account try { - m_parentAccount = file->account(parentId); + m_parentAccount = file->account(tqparentId); } catch (MyMoneyException *e) { m_bSelectedParentAccount = false; m_parentAccount = MyMoneyAccount(); if(m_account.accountType() != MyMoneyAccount::UnknownAccountType) { - parentAccount(); - parentId = m_parentAccount.id(); + tqparentAccount(); + tqparentId = m_parentAccount.id(); } delete e; } @@ -748,7 +748,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_qlistviewParentAccounts->clear(); - // Now scan all 4 account roots to load the list and mark the parent + // Now scan all 4 account roots to load the list and mark the tqparent try { if (!m_categoryEditor) @@ -759,15 +759,15 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = assetAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == assetAccount.id()) + if (tqparentId == assetAccount.id()) m_parentItem = assetTopLevelAccount; assetTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = assetAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = assetAccount.accountList().begin(); it != assetAccount.accountList().end(); ++it ) { @@ -777,7 +777,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(assetTopLevelAccount, acc); - if(parentId == acc.id()) { + if(tqparentId == acc.id()) { m_parentItem = accountItem; } else if(accountId == acc.id()) { if(m_isEditing) @@ -785,10 +785,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = acc.accountList(); + TQStringList subAccounts = acc.accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, acc.id()); + showSubAccounts(subAccounts, accountItem, tqparentId, acc.id()); } } } @@ -799,15 +799,15 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = liabilityAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == liabilityAccount.id()) + if (tqparentId == liabilityAccount.id()) m_parentItem = liabilityTopLevelAccount; liabilityTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = liabilityAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = liabilityAccount.accountList().begin(); it != liabilityAccount.accountList().end(); ++it ) { @@ -817,7 +817,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(liabilityTopLevelAccount, acc); - if(parentId == acc.id()) { + if(tqparentId == acc.id()) { m_parentItem = accountItem; } else if(accountId == acc.id()) { if(m_isEditing) @@ -825,10 +825,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = acc.accountList(); + TQStringList subAccounts = acc.accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, acc.id()); + showSubAccounts(subAccounts, accountItem, tqparentId, acc.id()); } } } @@ -842,23 +842,23 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = incomeAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == incomeAccount.id()) + if (tqparentId == incomeAccount.id()) m_parentItem = incomeTopLevelAccount; incomeTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = incomeAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = incomeAccount.accountList().begin(); it != incomeAccount.accountList().end(); ++it ) { KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(incomeTopLevelAccount, file->account(*it)); - QString id = file->account(*it).id(); - if(parentId == id) { + TQString id = file->account(*it).id(); + if(tqparentId == id) { m_parentItem = accountItem; } else if(accountId == id) { if(m_isEditing) @@ -866,10 +866,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = file->account(*it).accountList(); + TQStringList subAccounts = file->account(*it).accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, accountId); + showSubAccounts(subAccounts, accountItem, tqparentId, accountId); } } } @@ -881,23 +881,23 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if(m_parentAccount.id().isEmpty()) { m_parentAccount = expenseAccount; - parentId = m_parentAccount.id(); + tqparentId = m_parentAccount.id(); } - if (parentId == expenseAccount.id()) + if (tqparentId == expenseAccount.id()) m_parentItem = expenseTopLevelAccount; expenseTopLevelAccount->setOpen(true); - for ( QStringList::ConstIterator it = expenseAccount.accountList().begin(); + for ( TQStringList::ConstIterator it = expenseAccount.accountList().begin(); it != expenseAccount.accountList().end(); ++it ) { KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(expenseTopLevelAccount, file->account(*it)); - QString id = file->account(*it).id(); - if(parentId == id) { + TQString id = file->account(*it).id(); + if(tqparentId == id) { m_parentItem = accountItem; } else if(accountId == id) { if(m_isEditing) @@ -905,10 +905,10 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_accountItem = accountItem; } - QStringList subAccounts = file->account(*it).accountList(); + TQStringList subAccounts = file->account(*it).accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, accountId); + showSubAccounts(subAccounts, accountItem, tqparentId, accountId); } } } @@ -924,7 +924,7 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId if (m_parentItem) { - m_subAccountLabel->setText(i18n("Is a sub account of %1").arg(m_parentAccount.name())); + m_subAccountLabel->setText(i18n("Is a sub account of %1").tqarg(m_parentAccount.name())); m_parentItem->setOpen(true); m_qlistviewParentAccounts->setSelected(m_parentItem, true); } @@ -932,18 +932,18 @@ void KNewAccountDlg::initParentWidget(QString parentId, const QString& accountId m_qlistviewParentAccounts->setEnabled(true); } -void KNewAccountDlg::showSubAccounts(QStringList accounts, KMyMoneyAccountTreeBaseItem *parentItem, - const QString& parentId, const QString& accountId) +void KNewAccountDlg::showSubAccounts(TQStringList accounts, KMyMoneyAccountTreeBaseItem *tqparentItem, + const TQString& tqparentId, const TQString& accountId) { MyMoneyFile *file = MyMoneyFile::instance(); - for ( QStringList::ConstIterator it = accounts.begin(); it != accounts.end(); ++it ) + for ( TQStringList::ConstIterator it = accounts.begin(); it != accounts.end(); ++it ) { - KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(parentItem, + KMyMoneyAccountTreeBaseItem *accountItem = new KMyMoneyAccountTreeItem(tqparentItem, file->account(*it)); - QString id = file->account(*it).id(); - if(parentId == id) { + TQString id = file->account(*it).id(); + if(tqparentId == id) { m_parentItem = accountItem; } else if(accountId == id) { if(m_isEditing) @@ -951,15 +951,15 @@ void KNewAccountDlg::showSubAccounts(QStringList accounts, KMyMoneyAccountTreeBa m_accountItem = accountItem; } - QStringList subAccounts = file->account(*it).accountList(); + TQStringList subAccounts = file->account(*it).accountList(); if (subAccounts.count() >= 1) { - showSubAccounts(subAccounts, accountItem, parentId, accountId); + showSubAccounts(subAccounts, accountItem, tqparentId, accountId); } } } -void KNewAccountDlg::resizeEvent(QResizeEvent* e) +void KNewAccountDlg::resizeEvent(TQResizeEvent* e) { m_qlistviewParentAccounts->setColumnWidth(0, m_qlistviewParentAccounts->width()); @@ -967,7 +967,7 @@ void KNewAccountDlg::resizeEvent(QResizeEvent* e) KNewAccountDlgDecl::resizeEvent(e); } -void KNewAccountDlg::slotSelectionChanged(QListViewItem *item) +void KNewAccountDlg::slotSelectionChanged(TQListViewItem *item) { KMyMoneyAccountTreeBaseItem *accountItem = dynamic_cast(item); try @@ -976,7 +976,7 @@ void KNewAccountDlg::slotSelectionChanged(QListViewItem *item) //qDebug("Selected account id: %s", accountItem->accountID().data()); m_parentAccount = file->account(accountItem->id()); - m_subAccountLabel->setText(i18n("Is a sub account of %1").arg(m_parentAccount.name())); + m_subAccountLabel->setText(i18n("Is a sub account of %1").tqarg(m_parentAccount.name())); if(m_qlistviewParentAccounts->isEnabled()) { m_bSelectedParentAccount = true; } @@ -990,13 +990,13 @@ void KNewAccountDlg::slotSelectionChanged(QListViewItem *item) void KNewAccountDlg::loadVatAccounts(void) { - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list); - QValueList::Iterator it; - QStringList loadListExpense; - QStringList loadListIncome; - QStringList loadListAsset; - QStringList loadListLiability; + TQValueList::Iterator it; + TQStringList loadListExpense; + TQStringList loadListIncome; + TQStringList loadListAsset; + TQStringList loadListLiability; for(it = list.begin(); it != list.end(); ++it) { if(!(*it).value("VatRate").isEmpty()) { if((*it).accountType() == MyMoneyAccount::Expense) @@ -1020,11 +1020,11 @@ void KNewAccountDlg::loadVatAccounts(void) vatSet.load(m_vatAccount, i18n("Expense"), loadListExpense, false); } -void KNewAccountDlg::slotLoadInstitutions(const QString& name) +void KNewAccountDlg::slotLoadInstitutions(const TQString& name) { int id=-1, counter=0; m_qcomboboxInstitutions->clear(); - QString bic; + TQString bic; // Are we forcing the user to use institutions? m_qcomboboxInstitutions->insertItem(i18n("")); m_bicValue->setText(" "); @@ -1034,8 +1034,8 @@ void KNewAccountDlg::slotLoadInstitutions(const QString& name) { MyMoneyFile *file = MyMoneyFile::instance(); - QValueList list = file->institutionList(); - QValueList::ConstIterator institutionIterator; + TQValueList list = file->institutionList(); + TQValueList::ConstIterator institutionIterator; for (institutionIterator = list.begin(), counter=1; institutionIterator != list.end(); ++institutionIterator, counter++) { if ((*institutionIterator).name() == name) { @@ -1084,7 +1084,7 @@ void KNewAccountDlg::slotNewClicked() } } -void KNewAccountDlg::slotAccountTypeChanged(const QString& typeStr) +void KNewAccountDlg::slotAccountTypeChanged(const TQString& typeStr) { MyMoneyAccount::accountTypeE type; MyMoneyAccount::accountTypeE oldType; @@ -1094,25 +1094,25 @@ void KNewAccountDlg::slotAccountTypeChanged(const QString& typeStr) try { oldType = m_account.accountType(); if(oldType != type) { - QString parentId; + TQString tqparentId; switch(MyMoneyAccount::accountGroup(type)) { case MyMoneyAccount::Asset: - parentId = file->asset().id(); + tqparentId = file->asset().id(); break; case MyMoneyAccount::Liability: - parentId = file->liability().id(); + tqparentId = file->liability().id(); break; case MyMoneyAccount::Expense: - parentId = file->expense().id(); + tqparentId = file->expense().id(); break; case MyMoneyAccount::Income: - parentId = file->income().id(); + tqparentId = file->income().id(); break; default: qWarning("Unknown account group in KNewAccountDlg::slotAccountTypeChanged()"); break; } - initParentWidget(parentId, QString()); + initParentWidget(tqparentId, TQString()); m_account.setAccountType(type); } } catch(MyMoneyException *e) { @@ -1176,30 +1176,30 @@ void KNewAccountDlg::adjustEditWidgets(kMyMoneyEdit* dst, kMyMoneyEdit* src, cha } } -void KNewAccountDlg::slotAdjustMinBalanceAbsoluteEdit(const QString&) +void KNewAccountDlg::slotAdjustMinBalanceAbsoluteEdit(const TQString&) { adjustEditWidgets(m_minBalanceAbsoluteEdit, m_minBalanceEarlyEdit, '<', -1); } -void KNewAccountDlg::slotAdjustMinBalanceEarlyEdit(const QString&) +void KNewAccountDlg::slotAdjustMinBalanceEarlyEdit(const TQString&) { adjustEditWidgets(m_minBalanceEarlyEdit, m_minBalanceAbsoluteEdit, '>', -1); } -void KNewAccountDlg::slotAdjustMaxCreditAbsoluteEdit(const QString&) +void KNewAccountDlg::slotAdjustMaxCreditAbsoluteEdit(const TQString&) { adjustEditWidgets(m_maxCreditAbsoluteEdit, m_maxCreditEarlyEdit, '>', 1); } -void KNewAccountDlg::slotAdjustMaxCreditEarlyEdit(const QString&) +void KNewAccountDlg::slotAdjustMaxCreditEarlyEdit(const TQString&) { adjustEditWidgets(m_maxCreditEarlyEdit, m_maxCreditAbsoluteEdit, '<', 1); } -void KNewAccountDlg::addTab(QWidget* w, const QString& name) +void KNewAccountDlg::addTab(TQWidget* w, const TQString& name) { if(w) { - w->reparent(m_tab, QPoint(0,0)); + w->reparent(m_tab, TQPoint(0,0)); m_tab->addTab(w, name); } } diff --git a/kmymoney2/dialogs/knewaccountdlg.h b/kmymoney2/dialogs/knewaccountdlg.h index ee09158..5b6e481 100644 --- a/kmymoney2/dialogs/knewaccountdlg.h +++ b/kmymoney2/dialogs/knewaccountdlg.h @@ -48,6 +48,7 @@ namespace reports { class KNewAccountDlg : public KNewAccountDlgDecl { Q_OBJECT + TQ_OBJECT private: MyMoneyAccount m_account; @@ -64,14 +65,14 @@ private: int m_idPropMaxCredit; int m_idPropMinBalance; - void initParentWidget(QString parentId, const QString& accountId); - void showSubAccounts(QStringList accounts, KMyMoneyAccountTreeBaseItem *parentItem, const QString& parentId, const QString& accountId); + void initParentWidget(TQString tqparentId, const TQString& accountId); + void showSubAccounts(TQStringList accounts, KMyMoneyAccountTreeBaseItem *tqparentItem, const TQString& tqparentId, const TQString& accountId); void loadVatAccounts(void); - void storeKVP(const QString& key, kMyMoneyEdit* widget); - void storeKVP(const QString& key, KLineEdit* widget); - void storeKVP(const QString& key, const QString& text, const QString& value); - void loadKVP(const QString& key, kMyMoneyEdit* widget); - void loadKVP(const QString& key, KLineEdit* widget); + void storeKVP(const TQString& key, kMyMoneyEdit* widget); + void storeKVP(const TQString& key, KLineEdit* widget); + void storeKVP(const TQString& key, const TQString& text, const TQString& value); + void loadKVP(const TQString& key, kMyMoneyEdit* widget); + void loadKVP(const TQString& key, KLineEdit* widget); public: /** @@ -80,17 +81,17 @@ public: * apply and will be handled by the dialog. * * @param account The original data to be used to create the account. In case - * of @p isEditing is false, the account id, the parent account id + * of @p isEditing is false, the account id, the tqparent account id * and the list of all child accounts will be cleared. * @param isEditing If @p false, rules for new account creation apply. * If @p true, rules for account editing apply * @param categoryEditor If @p false, rules for asset/liability accounts apply. * If @p true, rules for income/expense account apply. - * @param parent Pointer to parent object (passed to QDialog). Default is 0. - * @param name Name of the object (passed to QDialog). Default is 0. - * @param title Caption of the object (passed to QDialog). Default is empty string. + * @param tqparent Pointer to tqparent object (passed to TQDialog). Default is 0. + * @param name Name of the object (passed to TQDialog). Default is 0. + * @param title Caption of the object (passed to TQDialog). Default is empty string. */ - KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bool categoryEditor, QWidget *parent=0, const char *name=0, const QString& title=QString::null); + KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bool categoryEditor, TQWidget *tqparent=0, const char *name=0, const TQString& title=TQString()); /** * This method returns the edited account object. @@ -98,9 +99,9 @@ public: const MyMoneyAccount& account(void); /** - * This method returns the parent account of the edited account object. + * This method returns the tqparent account of the edited account object. */ - const MyMoneyAccount& parentAccount(void); + const MyMoneyAccount& tqparentAccount(void); void setOpeningBalance(const MyMoneyMoney& balance); @@ -113,26 +114,26 @@ public: * This tab is usually defined by a plugin (eg. online banking). If @a w is * zero, this is a NOP. @a name is used as the text to be placed on the tab. */ - void addTab(QWidget* w, const QString& name); + void addTab(TQWidget* w, const TQString& name); protected: - void resizeEvent(QResizeEvent* e); - void displayOnlineBankingStatus(void); + void resizeEvent(TQResizeEvent* e); + void displayOnlineBankingtqStatus(void); void adjustEditWidgets(kMyMoneyEdit* dst, kMyMoneyEdit* src, char mode, int corr); protected slots: void okClicked(); - void slotSelectionChanged(QListViewItem *item); - void slotAccountTypeChanged(const QString& type); + void slotSelectionChanged(TQListViewItem *item); + void slotAccountTypeChanged(const TQString& type); void slotVatChanged(bool); void slotVatAssignmentChanged(bool); void slotNewClicked(void); void slotCheckFinished(void); - void slotLoadInstitutions(const QString&); - void slotAdjustMinBalanceAbsoluteEdit(const QString&); - void slotAdjustMinBalanceEarlyEdit(const QString&); - void slotAdjustMaxCreditAbsoluteEdit(const QString&); - void slotAdjustMaxCreditEarlyEdit(const QString&); + void slotLoadInstitutions(const TQString&); + void slotAdjustMinBalanceAbsoluteEdit(const TQString&); + void slotAdjustMinBalanceEarlyEdit(const TQString&); + void slotAdjustMaxCreditAbsoluteEdit(const TQString&); + void slotAdjustMaxCreditEarlyEdit(const TQString&); private slots: void timerDone(void); diff --git a/kmymoney2/dialogs/knewaccountdlgdecl.ui b/kmymoney2/dialogs/knewaccountdlgdecl.ui index 6f6357e..5d374e7 100644 --- a/kmymoney2/dialogs/knewaccountdlgdecl.ui +++ b/kmymoney2/dialogs/knewaccountdlgdecl.ui @@ -1,6 +1,6 @@ KNewAccountDlgDecl - + kNewAccountDlgDecl @@ -22,11 +22,11 @@ unnamed - + m_tab - + m_generalTab @@ -37,25 +37,25 @@ unnamed - + - layout15 + tqlayout15 unnamed - + TextLabel1 - + 60 0 - + 60 32767 @@ -71,14 +71,14 @@ Name: - + accountNameEdit - + groupBox4 @@ -100,7 +100,7 @@ m_currency - + m_currencyText @@ -108,7 +108,7 @@ Currency: - + typeCombo @@ -124,7 +124,7 @@ - + textLabel2 @@ -132,11 +132,11 @@ Type: - + TextLabel1_2 - + 0 0 @@ -157,7 +157,7 @@ startDateEdit - + textLabel1_3 @@ -172,7 +172,7 @@ - + groupBox6 @@ -183,17 +183,17 @@ unnamed - + - layout20 + tqlayout20 unnamed - + - layout19 + tqlayout19 @@ -214,7 +214,7 @@ Expanding - + 140 20 @@ -223,7 +223,7 @@ - + textLabel1_2 @@ -231,17 +231,17 @@ Last check number: - + TextLabel5 - + 0 0 - + 32767 32767 @@ -250,26 +250,26 @@ Notes: - + AlignTop - + descriptionEdit - + - layout18 + tqlayout18 unnamed - + m_qcheckboxNoVat @@ -277,15 +277,15 @@ No auto-VAT-assignment - + - layout17 + tqlayout17 unnamed - + textLabel1_5 @@ -311,7 +311,7 @@ - + m_qcheckboxPreferred @@ -333,7 +333,7 @@ Expanding - + 20 16 @@ -342,7 +342,7 @@ - + m_institutionTab @@ -353,7 +353,7 @@ unnamed - + m_institutionBox @@ -364,7 +364,7 @@ unnamed - + Layout11 @@ -378,12 +378,12 @@ 6 - + m_qcomboboxInstitutions - + m_qbuttonNew @@ -401,9 +401,9 @@ - + - layout14 + tqlayout14 @@ -414,17 +414,17 @@ accountNoEdit - + TextLabel2_2 - + 60 0 - + 60 32767 @@ -434,7 +434,7 @@ Number: - + textLabel1_4 @@ -447,7 +447,7 @@ ibanEdit - + textLabel3 @@ -455,7 +455,7 @@ IBAN - + m_bicValue @@ -477,7 +477,7 @@ Expanding - + 21 30 @@ -486,7 +486,7 @@ - + m_hiearchyTab @@ -497,7 +497,7 @@ unnamed - + m_subAccountLabel @@ -513,7 +513,7 @@ - + m_limitsTab @@ -532,15 +532,15 @@ This page allows to setup certain limits. KMyMoney will warn you when the account balance reaches a limit. - + - layout16 + tqlayout16 unnamed - + textLabel2_2 @@ -556,7 +556,7 @@ false - + textLabel3_2 @@ -564,7 +564,7 @@ Absolute limit - + m_maxCreditLabel @@ -596,7 +596,7 @@ false - + m_minBalanceLabel @@ -618,7 +618,7 @@ Horizontal - + textLabel4 @@ -638,7 +638,7 @@ Expanding - + 20 30 @@ -647,7 +647,7 @@ - + m_taxTab @@ -658,7 +658,7 @@ unnamed - + groupBox3 @@ -669,15 +669,15 @@ unnamed - + - layout34 + tqlayout34 unnamed - + m_vatCategory @@ -685,7 +685,7 @@ VAT category - + m_vatCategoryFrame @@ -702,7 +702,7 @@ 0 - + textLabel1 @@ -710,9 +710,9 @@ VAT percentage - + - layout33 + tqlayout33 @@ -733,7 +733,7 @@ Expanding - + 21 20 @@ -754,7 +754,7 @@ Expanding - + 20 40 @@ -763,7 +763,7 @@ - + m_vatAssignmentFrame @@ -780,15 +780,15 @@ 0 - + - layout8 + tqlayout8 unnamed - + m_vatAssignment @@ -803,25 +803,25 @@ - + - layout13 + tqlayout13 unnamed - + m_amountGroup - + 0 0 - + 32767 32767 @@ -840,7 +840,7 @@ unnamed - + m_grossAmount @@ -851,7 +851,7 @@ true - + m_netAmount @@ -871,7 +871,7 @@ Expanding - + 20 21 @@ -884,7 +884,7 @@ - + m_qcheckboxTax @@ -909,7 +909,7 @@ Horizontal - + Layout29 @@ -933,7 +933,7 @@ Expanding - + 422 0 @@ -1040,5 +1040,10 @@ createButton cancelButton - + + kmymoney/kmymoneydateinput.h + kmymoney/kmymoneyedit.h + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/knewbankdlg.cpp b/kmymoney2/dialogs/knewbankdlg.cpp index f1c4e3f..fd886b8 100644 --- a/kmymoney2/dialogs/knewbankdlg.cpp +++ b/kmymoney2/dialogs/knewbankdlg.cpp @@ -21,8 +21,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,8 +43,8 @@ #include "knewbankdlg.h" -KNewBankDlg::KNewBankDlg(MyMoneyInstitution& institution, QWidget *parent, const char *name) - : KNewBankDlgDecl(parent,name,true), m_institution(institution) +KNewBankDlg::KNewBankDlg(MyMoneyInstitution& institution, TQWidget *tqparent, const char *name) + : KNewBankDlgDecl(tqparent,name,true), m_institution(institution) { okBtn->setGuiItem(KStdGuiItem::ok()); cancelBtn->setGuiItem(KStdGuiItem::cancel()); @@ -58,17 +58,17 @@ KNewBankDlg::KNewBankDlg(MyMoneyInstitution& institution, QWidget *parent, const bicEdit->setText(institution.value("bic")); sortCodeEdit->setText(institution.sortcode()); - connect(okBtn, SIGNAL(clicked()), SLOT(okClicked())); - connect(cancelBtn, SIGNAL(clicked()), SLOT(reject())); - connect(nameEdit, SIGNAL(textChanged ( const QString & )), SLOT(institutionNameChanged( const QString &))); + connect(okBtn, TQT_SIGNAL(clicked()), TQT_SLOT(okClicked())); + connect(cancelBtn, TQT_SIGNAL(clicked()), TQT_SLOT(reject())); + connect(nameEdit, TQT_SIGNAL(textChanged ( const TQString & )), TQT_SLOT(institutionNameChanged( const TQString &))); institutionNameChanged( nameEdit->text()); - kMandatoryFieldGroup* requiredFields = new kMandatoryFieldGroup (this); + kMandatoryFieldGroup* requiredFields = new kMandatoryFieldGroup (TQT_TQOBJECT(this)); requiredFields->setOkButton(okBtn); // button to be enabled when all fields present requiredFields->add(nameEdit); } -void KNewBankDlg::institutionNameChanged( const QString &_text) +void KNewBankDlg::institutionNameChanged( const TQString &_text) { okBtn->setEnabled( !_text.isEmpty() ); } diff --git a/kmymoney2/dialogs/knewbankdlg.h b/kmymoney2/dialogs/knewbankdlg.h index f829a4c..55deee1 100644 --- a/kmymoney2/dialogs/knewbankdlg.h +++ b/kmymoney2/dialogs/knewbankdlg.h @@ -20,7 +20,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -39,15 +39,16 @@ class KNewBankDlg : public KNewBankDlgDecl { Q_OBJECT + TQ_OBJECT public: - KNewBankDlg(MyMoneyInstitution& institution, QWidget *parent = 0, const char *name = 0); + KNewBankDlg(MyMoneyInstitution& institution, TQWidget *tqparent = 0, const char *name = 0); ~KNewBankDlg(); const MyMoneyInstitution& institution(void); protected slots: void okClicked(); - void institutionNameChanged( const QString &); + void institutionNameChanged( const TQString &); private: MyMoneyInstitution m_institution; diff --git a/kmymoney2/dialogs/knewbankdlgdecl.ui b/kmymoney2/dialogs/knewbankdlgdecl.ui index e6d4f52..71d496a 100644 --- a/kmymoney2/dialogs/knewbankdlgdecl.ui +++ b/kmymoney2/dialogs/knewbankdlgdecl.ui @@ -1,6 +1,6 @@ KNewBankDlgDecl - + kNewBankDlgDecl @@ -28,7 +28,7 @@ 6 - + GroupBox1 @@ -45,7 +45,7 @@ 6 - + TextLabel1 @@ -58,11 +58,11 @@ nameEdit - + TextLabel2 - + 100 0 @@ -77,11 +77,11 @@ cityEdit - + TextLabel3 - + 100 0 @@ -96,11 +96,11 @@ streetEdit - + TextLabel4 - + 100 0 @@ -115,11 +115,11 @@ postcodeEdit - + TextLabel5 - + 100 0 @@ -134,11 +134,11 @@ telephoneEdit - + TextLabel6 - + 100 0 @@ -153,11 +153,11 @@ sortCodeEdit - + TextLabel7 - + 100 0 @@ -184,7 +184,7 @@ Expanding - + 16 16 @@ -208,7 +208,7 @@ Horizontal - + Layout51 @@ -232,7 +232,7 @@ Expanding - + 449 0 @@ -264,5 +264,5 @@ - + diff --git a/kmymoney2/dialogs/knewbudgetdlg.cpp b/kmymoney2/dialogs/knewbudgetdlg.cpp index 5971e54..67fcbda 100644 --- a/kmymoney2/dialogs/knewbudgetdlg.cpp +++ b/kmymoney2/dialogs/knewbudgetdlg.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -37,19 +37,19 @@ const int KNewBudgetDlg::m_icFutureYears = 5; const int KNewBudgetDlg::m_icPastYears = 2; -KNewBudgetDlg::KNewBudgetDlg(QWidget* parent, const char *name) : - KNewBudgetDlgDecl(parent, name) +KNewBudgetDlg::KNewBudgetDlg(TQWidget* tqparent, const char *name) : + KNewBudgetDlgDecl(tqparent, name) { - QStringList slYear; - QDate dToday = QDate::currentDate(); + TQStringList slYear; + TQDate dToday = TQDate::tqcurrentDate(); int iYear = dToday.year(); for (int i=0; i<=m_icFutureYears; i++) - m_cbYear->insertItem( QString::number(iYear++) ); + m_cbYear->insertItem( TQString::number(iYear++) ); iYear = dToday.year(); for (int i=0; i<=m_icFutureYears; i++) - m_cbYear->insertItem( QString::number(--iYear) ); + m_cbYear->insertItem( TQString::number(--iYear) ); } KNewBudgetDlg::~KNewBudgetDlg() diff --git a/kmymoney2/dialogs/knewbudgetdlg.h b/kmymoney2/dialogs/knewbudgetdlg.h index db63e11..697ecfd 100644 --- a/kmymoney2/dialogs/knewbudgetdlg.h +++ b/kmymoney2/dialogs/knewbudgetdlg.h @@ -21,13 +21,13 @@ // ---------------------------------------------------------------------------- // QT Includes -class QListViewItem; +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -36,12 +36,13 @@ class QListViewItem; class KNewBudgetDlg : public KNewBudgetDlgDecl { Q_OBJECT + TQ_OBJECT public: - KNewBudgetDlg(QWidget* parent, const char *name); + KNewBudgetDlg(TQWidget* tqparent, const char *name); ~KNewBudgetDlg(); - QString& getYear() {return m_year;}; - QString& getName() {return m_name;}; + TQString& getYear() {return m_year;}; + TQString& getName() {return m_name;}; public slots: virtual void m_pbCancel_clicked(); @@ -52,8 +53,8 @@ private: static const int m_icFutureYears; static const int m_icPastYears; - QString m_year; - QString m_name; + TQString m_year; + TQString m_name; }; #endif // KNEWBUDGETDLG_H diff --git a/kmymoney2/dialogs/knewbudgetdlgdecl.ui b/kmymoney2/dialogs/knewbudgetdlgdecl.ui index 7066a56..7a18195 100644 --- a/kmymoney2/dialogs/knewbudgetdlgdecl.ui +++ b/kmymoney2/dialogs/knewbudgetdlgdecl.ui @@ -1,6 +1,6 @@ KNewBudgetDlgDecl - + KNewBudgetDlgDecl @@ -22,31 +22,31 @@ unnamed - + - layout5 + tqlayout5 unnamed - + - layout11 + tqlayout11 unnamed - + - layout10 + tqlayout10 unnamed - + textLabel2 @@ -54,7 +54,7 @@ Name - + textLabel1 @@ -64,20 +64,20 @@ - + - layout8 + tqlayout8 unnamed - + m_leBudgetName - + m_cbYear @@ -100,9 +100,9 @@ - + - layout4 + tqlayout4 @@ -163,11 +163,11 @@ knewbudgetdlgdecl.ui.h - + m_pbOk_clicked() m_pbCancel_clicked() - - + + diff --git a/kmymoney2/dialogs/knewequityentrydecl.ui b/kmymoney2/dialogs/knewequityentrydecl.ui index affd116..4f97f92 100644 --- a/kmymoney2/dialogs/knewequityentrydecl.ui +++ b/kmymoney2/dialogs/knewequityentrydecl.ui @@ -1,6 +1,6 @@ kNewEquityEntryDecl - + kNewEquityEntryDecl @@ -22,15 +22,15 @@ unnamed - + - layout10 + tqlayout10 unnamed - + lblEquityName @@ -38,7 +38,7 @@ Equity Name: - + lblType @@ -57,15 +57,15 @@ Trading Symbol of the stock or mutual fund, not required. - + - layout8 + tqlayout8 unnamed - + textLabel1_2 @@ -80,7 +80,7 @@ 1 / - + AlignVCenter|AlignRight @@ -91,7 +91,7 @@ - + lblSymbol @@ -99,7 +99,7 @@ Market Symbol: - + textLabel1 @@ -150,16 +150,16 @@ Expanding - + 20 16 - + - layout6 + tqlayout6 @@ -175,7 +175,7 @@ Expanding - + 81 20 @@ -232,5 +232,5 @@ btnOK btnCancel - + diff --git a/kmymoney2/dialogs/knewequityentrydlg.cpp b/kmymoney2/dialogs/knewequityentrydlg.cpp index 86a1ab8..29a91b3 100644 --- a/kmymoney2/dialogs/knewequityentrydlg.cpp +++ b/kmymoney2/dialogs/knewequityentrydlg.cpp @@ -36,19 +36,19 @@ #include "../widgets/kmymoneyedit.h" #include "../mymoney/mymoneymoney.h" -KNewEquityEntryDlg::KNewEquityEntryDlg(QWidget *parent, const char *name) - : kNewEquityEntryDecl(parent, name, TRUE) +KNewEquityEntryDlg::KNewEquityEntryDlg(TQWidget *tqparent, const char *name) + : kNewEquityEntryDecl(tqparent, name, TRUE) { edtFraction->setCalculatorButtonVisible(false); edtFraction->setPrecision(0); edtFraction->loadText("100"); - connect(btnOK, SIGNAL(clicked()), this, SLOT(onOKClicked())); - connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(btnOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(onOKClicked())); + connect(btnCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); - connect(edtFraction, SIGNAL(textChanged(const QString&)), this, SLOT(slotDataChanged())); - connect(edtMarketSymbol, SIGNAL(textChanged(const QString&)), this, SLOT(slotDataChanged())); - connect(edtEquityName, SIGNAL(textChanged(const QString&)), this, SLOT(slotDataChanged())); + connect(edtFraction, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotDataChanged())); + connect(edtMarketSymbol, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotDataChanged())); + connect(edtEquityName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotDataChanged())); // add icons to buttons btnOK->setGuiItem(KStdGuiItem::ok()); @@ -72,13 +72,13 @@ void KNewEquityEntryDlg::onOKClicked() accept(); } -void KNewEquityEntryDlg::setSymbolName(const QString& str) +void KNewEquityEntryDlg::setSymbolName(const TQString& str) { m_strSymbolName = str; edtMarketSymbol->setText(m_strSymbolName); } -void KNewEquityEntryDlg::setName(const QString& str) +void KNewEquityEntryDlg::setName(const TQString& str) { m_strName = str; edtEquityName->setText(m_strName); diff --git a/kmymoney2/dialogs/knewequityentrydlg.h b/kmymoney2/dialogs/knewequityentrydlg.h index 25605c6..d3a5a89 100644 --- a/kmymoney2/dialogs/knewequityentrydlg.h +++ b/kmymoney2/dialogs/knewequityentrydlg.h @@ -20,10 +20,10 @@ * * ***************************************************************************/ -#ifndef KNEWEQUITYENTRY_H -#define KNEWEQUITYENTRY_H +#ifndef KNEWETQUITYENTRY_H +#define KNEWETQUITYENTRY_H -#include +#include #include #include "../dialogs/knewequityentrydecl.h" @@ -39,15 +39,16 @@ class KNewEquityEntryDlg : public kNewEquityEntryDecl { Q_OBJECT + TQ_OBJECT public: - KNewEquityEntryDlg(QWidget *parent = NULL, const char *name = NULL); + KNewEquityEntryDlg(TQWidget *tqparent = NULL, const char *name = NULL); virtual ~KNewEquityEntryDlg(); - void setSymbolName(const QString& str); - QString symbolName(void) const { return m_strSymbolName; } + void setSymbolName(const TQString& str); + TQString symbolName(void) const { return m_strSymbolName; } - void setName(const QString& str); - QString name(void) const { return m_strName; } + void setName(const TQString& str); + TQString name(void) const { return m_strName; } int fraction(void) const { return m_fraction; } @@ -56,8 +57,8 @@ protected slots: void slotDataChanged(void); private: - QString m_strSymbolName; - QString m_strName; + TQString m_strSymbolName; + TQString m_strName; int m_fraction; }; diff --git a/kmymoney2/dialogs/knewfiledlg.cpp b/kmymoney2/dialogs/knewfiledlg.cpp index 2ea043f..7a3b221 100644 --- a/kmymoney2/dialogs/knewfiledlg.cpp +++ b/kmymoney2/dialogs/knewfiledlg.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -43,16 +43,16 @@ #include "knewfiledlg.h" -KNewFileDlg::KNewFileDlg(QWidget *parent, const char *name, const QString& title) - : KNewFileDlgDecl(parent,name,true) +KNewFileDlg::KNewFileDlg(TQWidget *tqparent, const char *name, const TQString& title) + : KNewFileDlgDecl(tqparent,name,true) { init(title); } -KNewFileDlg::KNewFileDlg(QString userName, QString userStreet, - QString userTown, QString userCounty, QString userPostcode, QString userTelephone, - QString userEmail, QWidget *parent, const char *name, const QString& title) - : KNewFileDlgDecl(parent,name,true) +KNewFileDlg::KNewFileDlg(TQString userName, TQString userStreet, + TQString userTown, TQString userCounty, TQString userPostcode, TQString userTelephone, + TQString userEmail, TQWidget *tqparent, const char *name, const TQString& title) + : KNewFileDlgDecl(tqparent,name,true) { userNameEdit->setText(userName); streetEdit->setText(userStreet); @@ -65,7 +65,7 @@ KNewFileDlg::KNewFileDlg(QString userName, QString userStreet, init(title); } -void KNewFileDlg::init(const QString& title) +void KNewFileDlg::init(const TQString& title) { bool showLoadButton = false; okBtn->setGuiItem(KStdGuiItem::ok()); @@ -86,9 +86,9 @@ void KNewFileDlg::init(const QString& title) userNameEdit->setFocus(); - connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); - connect(okBtn, SIGNAL(clicked()), this, SLOT(okClicked())); - connect(kabcBtn, SIGNAL(clicked()), this, SLOT(loadFromKABC())); + connect(cancelBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(okBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(okClicked())); + connect(kabcBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(loadFromKABC())); } KNewFileDlg::~KNewFileDlg(){ diff --git a/kmymoney2/dialogs/knewfiledlg.h b/kmymoney2/dialogs/knewfiledlg.h index 706a139..3cf8c7c 100644 --- a/kmymoney2/dialogs/knewfiledlg.h +++ b/kmymoney2/dialogs/knewfiledlg.h @@ -19,7 +19,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -33,27 +33,28 @@ // Use the second constructor to edit a file. class KNewFileDlg : public KNewFileDlgDecl { Q_OBJECT + TQ_OBJECT public: - KNewFileDlg(QWidget *parent=0, const char *name=0, const QString& title=QString()); - KNewFileDlg(QString userName, QString userStreet, - QString userTown, QString userCounty, QString userPostcode, QString userTelephone, - QString userEmail, QWidget *parent=0, const char *name=0, const QString& title=QString()); + KNewFileDlg(TQWidget *tqparent=0, const char *name=0, const TQString& title=TQString()); + KNewFileDlg(TQString userName, TQString userStreet, + TQString userTown, TQString userCounty, TQString userPostcode, TQString userTelephone, + TQString userEmail, TQWidget *tqparent=0, const char *name=0, const TQString& title=TQString()); ~KNewFileDlg(); KPushButton* cancelButton(void) { return cancelBtn; }; public: - QString userNameText; - QString userStreetText; - QString userTownText; - QString userCountyText; - QString userPostcodeText; - QString userTelephoneText; - QString userEmailText; + TQString userNameText; + TQString userStreetText; + TQString userTownText; + TQString userCountyText; + TQString userPostcodeText; + TQString userTelephoneText; + TQString userEmailText; protected: /// helper method for constructors - void init(const QString& title); + void init(const TQString& title); protected slots: void okClicked(); diff --git a/kmymoney2/dialogs/knewfiledlgdecl.ui b/kmymoney2/dialogs/knewfiledlgdecl.ui index 9097a74..9658fad 100644 --- a/kmymoney2/dialogs/knewfiledlgdecl.ui +++ b/kmymoney2/dialogs/knewfiledlgdecl.ui @@ -1,6 +1,6 @@ KNewFileDlgDecl - + kNewFileDlgDecl @@ -28,7 +28,7 @@ 6 - + Layout10 @@ -42,7 +42,7 @@ 6 - + TextLabel1_2 @@ -72,19 +72,19 @@ your KMyMoney file. Horizontal - + - layout20 + tqlayout20 unnamed - + TextLabel4 - + 100 0 @@ -94,26 +94,26 @@ your KMyMoney file. County/State: - + userNameEdit - + countyEdit - + townEdit - + TextLabel2 - + 100 0 @@ -123,16 +123,16 @@ your KMyMoney file. Street: - + streetEdit - + TextLabel7 - + 100 0 @@ -142,7 +142,7 @@ your KMyMoney file. Email: - + TextLabel1 @@ -150,11 +150,11 @@ your KMyMoney file. Your name: - + TextLabel6 - + 100 0 @@ -164,11 +164,11 @@ your KMyMoney file. Telephone: - + TextLabel3 - + 100 0 @@ -178,16 +178,16 @@ your KMyMoney file. Town: - + emailEdit - + TextLabel5 - + 100 0 @@ -197,21 +197,21 @@ your KMyMoney file. Postal Code: - + telephoneEdit - + postcodeEdit - + - layout22 + tqlayout22 @@ -235,7 +235,7 @@ your KMyMoney file. Expanding - + 305 21 @@ -254,16 +254,16 @@ your KMyMoney file. Expanding - + 20 16 - + - layout10 + tqlayout10 @@ -279,7 +279,7 @@ your KMyMoney file. Expanding - + 360 16 @@ -324,5 +324,5 @@ your KMyMoney file. okBtn cancelBtn - + diff --git a/kmymoney2/dialogs/knewinvestmentwizard.cpp b/kmymoney2/dialogs/knewinvestmentwizard.cpp index d0c9046..a1e2e9e 100644 --- a/kmymoney2/dialogs/knewinvestmentwizard.cpp +++ b/kmymoney2/dialogs/knewinvestmentwizard.cpp @@ -18,8 +18,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,18 +45,18 @@ #include "../converter/webpricequote.h" #include "../kmymoneyutils.h" -KNewInvestmentWizard::KNewInvestmentWizard( QWidget *parent, const char *name ) : - KNewInvestmentWizardDecl( parent, name ) +KNewInvestmentWizard::KNewInvestmentWizard( TQWidget *tqparent, const char *name ) : + KNewInvestmentWizardDecl( tqparent, name ) { init1(); - slotCheckPage(QString()); + slotCheckPage(TQString()); m_investmentSymbol->setFocus(); - connect(m_investmentSymbol, SIGNAL(lineChanged(const QString&)), this, SLOT(slotCheckForExistingSymbol(const QString&))); + connect(m_investmentSymbol, TQT_SIGNAL(lineChanged(const TQString&)), this, TQT_SLOT(slotCheckForExistingSymbol(const TQString&))); } -KNewInvestmentWizard::KNewInvestmentWizard( const MyMoneyAccount& acc, QWidget *parent, const char *name ) : - KNewInvestmentWizardDecl( parent, name ), +KNewInvestmentWizard::KNewInvestmentWizard( const MyMoneyAccount& acc, TQWidget *tqparent, const char *name ) : + KNewInvestmentWizardDecl( tqparent, name ), m_account(acc) { setCaption(i18n("Investment detail wizard")); @@ -75,8 +75,8 @@ KNewInvestmentWizard::KNewInvestmentWizard( const MyMoneyAccount& acc, QWidget * } -KNewInvestmentWizard::KNewInvestmentWizard( const MyMoneySecurity& security, QWidget *parent, const char *name ) : - KNewInvestmentWizardDecl( parent, name ), +KNewInvestmentWizard::KNewInvestmentWizard( const MyMoneySecurity& security, TQWidget *tqparent, const char *name ) : + KNewInvestmentWizardDecl( tqparent, name ), m_security(security) { setCaption(i18n("Security detail wizard")); @@ -102,7 +102,7 @@ void KNewInvestmentWizard::init1(void) m_fraction->setPrecision(0); m_fraction->setValue(MyMoneyMoney(100, 1)); - kMyMoneyMoneyValidator* fractionValidator = new kMyMoneyMoneyValidator(1, 100000, 0, this); + kMyMoneyMoneyValidator* fractionValidator = new kMyMoneyMoneyValidator(1, 100000, 0, TQT_TQOBJECT(this)); m_fraction->setValidator(fractionValidator); // load the price mode combo @@ -111,16 +111,16 @@ void KNewInvestmentWizard::init1(void) m_priceMode->insertItem(i18n("Total for all shares"), 2); // load the widget with the available currencies - m_tradingCurrencyEdit->update(QString()); + m_tradingCurrencyEdit->update(TQString()); - connect(helpButton(),SIGNAL(clicked()), this, SLOT(slotHelp(void))); - connect(m_investmentName, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPage(void))); - connect(m_investmentSymbol, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPage(void))); - connect(m_fraction, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPage(void))); - connect(m_investmentIdentification, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPage(void))); - connect(m_onlineFactor, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPage(void))); - connect(m_onlineSourceCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCheckPage(const QString&))); - connect(m_useFinanceQuote, SIGNAL(toggled(bool)), this, SLOT(slotSourceChanged(bool))); + connect(helpButton(),TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp(void))); + connect(m_investmentName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPage(void))); + connect(m_investmentSymbol, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPage(void))); + connect(m_fraction, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPage(void))); + connect(m_investmentIdentification, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPage(void))); + connect(m_onlineFactor, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPage(void))); + connect(m_onlineSourceCombo, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotCheckPage(const TQString&))); + connect(m_useFinanceQuote, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSourceChanged(bool))); m_createAccount = true; @@ -161,7 +161,7 @@ KNewInvestmentWizard::~KNewInvestmentWizard() { } -void KNewInvestmentWizard::setName(const QString& name) +void KNewInvestmentWizard::setName(const TQString& name) { m_investmentName->setText(name); } @@ -172,11 +172,11 @@ void KNewInvestmentWizard::next(void) slotCheckPage(); } -void KNewInvestmentWizard::slotCheckForExistingSymbol(const QString& symbol) +void KNewInvestmentWizard::slotCheckForExistingSymbol(const TQString& symbol) { if(m_investmentName->text().isEmpty()) { - QValueList list = MyMoneyFile::instance()->securityList(); - QValueList::const_iterator it_s; + TQValueList list = MyMoneyFile::instance()->securityList(); + TQValueList::const_iterator it_s; MyMoneySecurity::eSECURITYTYPE type = KMyMoneyUtils::stringToSecurity(m_securityType->currentText()); for(it_s = list.begin(); it_s != list.end(); ++it_s) { @@ -197,7 +197,7 @@ void KNewInvestmentWizard::slotCheckForExistingSymbol(const QString& symbol) void KNewInvestmentWizard::slotSourceChanged(bool useFQ) { m_onlineSourceCombo->clear(); - m_onlineSourceCombo->insertItem(QString(), 0); + m_onlineSourceCombo->insertItem(TQString(), 0); if (useFQ) { m_onlineSourceCombo->insertStringList( WebPriceQuote::quoteSources( WebPriceQuote::FinanceQuote ) ); } else { @@ -205,7 +205,7 @@ void KNewInvestmentWizard::slotSourceChanged(bool useFQ) } } -void KNewInvestmentWizard::slotCheckPage(const QString& txt) +void KNewInvestmentWizard::slotCheckPage(const TQString& txt) { m_onlineFactor->setEnabled(!txt.isEmpty()); } @@ -232,12 +232,12 @@ void KNewInvestmentWizard::slotHelp(void) kapp->invokeHelp("details.investments.newinvestmentwizard"); } -void KNewInvestmentWizard::createObjects(const QString& parentId) +void KNewInvestmentWizard::createObjects(const TQString& tqparentId) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList list = MyMoneyFile::instance()->securityList(); - QValueList::ConstIterator it; + TQValueList list = MyMoneyFile::instance()->securityList(); + TQValueList::ConstIterator it; MyMoneySecurity::eSECURITYTYPE type = KMyMoneyUtils::stringToSecurity(m_securityType->currentText()); MyMoneyFileTransaction ft; @@ -294,19 +294,19 @@ void KNewInvestmentWizard::createObjects(const QString& parentId) break; case 1: case 2: - m_account.setValue("priceMode", QString("%1").arg(m_priceMode->currentItem())); + m_account.setValue("priceMode", TQString("%1").tqarg(m_priceMode->currentItem())); break; } if(m_account.id().isEmpty()) { - MyMoneyAccount parent = file->account(parentId); - file->addAccount(m_account, parent); + MyMoneyAccount tqparent = file->account(tqparentId); + file->addAccount(m_account, tqparent); } else file->modifyAccount(m_account); } ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Unable to create all objects for the investment"), QString("%1 caugt in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Unable to create all objects for the investment"), TQString("%1 caugt in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } diff --git a/kmymoney2/dialogs/knewinvestmentwizard.h b/kmymoney2/dialogs/knewinvestmentwizard.h index 7540521..8e3be09 100644 --- a/kmymoney2/dialogs/knewinvestmentwizard.h +++ b/kmymoney2/dialogs/knewinvestmentwizard.h @@ -39,45 +39,46 @@ class KNewInvestmentWizard : public KNewInvestmentWizardDecl { Q_OBJECT + TQ_OBJECT public: /** * Use this constructor for the creation of a new investment */ - KNewInvestmentWizard( QWidget *parent = 0, const char *name = 0 ); + KNewInvestmentWizard( TQWidget *tqparent = 0, const char *name = 0 ); /** * Use this constructor for the modification of an existing investment */ - KNewInvestmentWizard( const MyMoneyAccount& acc, QWidget *parent = 0, const char *name = 0 ); + KNewInvestmentWizard( const MyMoneyAccount& acc, TQWidget *tqparent = 0, const char *name = 0 ); /** * Use this constructor for the modification of an existing security */ - KNewInvestmentWizard( const MyMoneySecurity& sec, QWidget *parent = 0, const char *name = 0 ); + KNewInvestmentWizard( const MyMoneySecurity& sec, TQWidget *tqparent = 0, const char *name = 0 ); ~KNewInvestmentWizard(); /** * This method sets the name in the name widget. */ - void setName(const QString& name); + void setName(const TQString& name); /** * Depending on the constructor used, this method either * creates all necessary objects for the investment or updates * them. * - * @param parentId id of parent account for the investment + * @param tqparentId id of tqparent account for the investment */ - void createObjects(const QString& parentId); + void createObjects(const TQString& tqparentId); const MyMoneyAccount& account(void) const { return m_account; } protected slots: void next(void); void slotCheckPage(void); - void slotCheckPage(const QString&); - void slotCheckForExistingSymbol(const QString&); + void slotCheckPage(const TQString&); + void slotCheckForExistingSymbol(const TQString&); void slotSourceChanged(bool); void slotHelp(void); diff --git a/kmymoney2/dialogs/knewinvestmentwizarddecl.ui b/kmymoney2/dialogs/knewinvestmentwizarddecl.ui index a6e9241..c6936c6 100644 --- a/kmymoney2/dialogs/knewinvestmentwizarddecl.ui +++ b/kmymoney2/dialogs/knewinvestmentwizarddecl.ui @@ -1,6 +1,6 @@ KNewInvestmentWizardDecl - + KNewInvestmentWizardDecl @@ -15,7 +15,7 @@ New Investment wizard - + m_investmentTypePage @@ -26,14 +26,14 @@ unnamed - + m_introLabel This wizard allows you to create a new investment. - + WordBreak|AlignTop @@ -47,21 +47,21 @@ Fixed - + 20 10 - + textLabel1 The first step in this process requires to select the type of investment. The following steps collect more details about the investment from you. - + WordBreak|AlignTop @@ -75,22 +75,22 @@ Expanding - + 20 30 - + - layout1 + tqlayout1 unnamed - + textLabel2 @@ -128,7 +128,7 @@ Expanding - + 61 21 @@ -147,7 +147,7 @@ Expanding - + 20 60 @@ -156,7 +156,7 @@ - + m_investmentDetailsPage @@ -167,14 +167,14 @@ unnamed - + textLabel3_2 Enter the details below and click <b>Next</b> to continue entering the online update details. - + WordBreak|AlignTop @@ -188,16 +188,16 @@ Expanding - + 20 16 - + - layout9 + tqlayout9 @@ -208,15 +208,15 @@ m_investmentName - + - layout4 + tqlayout4 unnamed - + textLabel1_5 @@ -231,7 +231,7 @@ 1 / - + AlignVCenter|AlignRight @@ -242,7 +242,7 @@ - + textLabel2_5 @@ -250,7 +250,7 @@ Price entry - + textLabel2_2_2 @@ -258,7 +258,7 @@ Fraction - + textLabel1_4 @@ -266,7 +266,7 @@ Trading Currency - + textLabel3 @@ -317,7 +317,7 @@ true - + textLabel2_2 @@ -325,7 +325,7 @@ Trading symbol - + textLabel1_2 @@ -354,7 +354,7 @@ Enter the CUSIP/ISIN/WKN identification number here - + textLabel1_3 @@ -374,7 +374,7 @@ Expanding - + 20 16 @@ -383,7 +383,7 @@ - + m_onlineUpdatePage @@ -394,20 +394,20 @@ unnamed - + textLabel6 Select an online source and click <b>Finish</b> to store the investment data. If you don't want to use online updates, just leave the data as is. - + WordBreak|AlignTop - + - layout25 + tqlayout25 @@ -419,23 +419,23 @@ 0 - + - layout24 + tqlayout24 unnamed - + - layout21 + tqlayout21 unnamed - + textLabel2_4 @@ -443,7 +443,7 @@ Use Finance::Quote - + m_useFinanceQuote @@ -453,15 +453,15 @@ - + - layout23 + tqlayout23 unnamed - + textLabel2_3 @@ -478,7 +478,7 @@ m_onlineSourceCombo - + 180 0 @@ -487,15 +487,15 @@ - + - layout22 + tqlayout22 unnamed - + textLabel1_6 @@ -522,7 +522,7 @@ Expanding - + 371 20 @@ -541,7 +541,7 @@ Expanding - + 20 181 @@ -587,5 +587,10 @@ m_onlineSourceCombo m_onlineFactor - + + kmymoney/kmymoneydateinput.h + kmymoney/kmymoneyedit.h + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/knewloanwizard.cpp b/kmymoney2/dialogs/knewloanwizard.cpp index 28c48ef..e56dbf9 100644 --- a/kmymoney2/dialogs/knewloanwizard.cpp +++ b/kmymoney2/dialogs/knewloanwizard.cpp @@ -25,9 +25,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -59,38 +59,38 @@ #include "../kmymoney2.h" -KNewLoanWizard::KNewLoanWizard(QWidget *parent, const char *name ) : - KNewLoanWizardDecl(parent, name, true) +KNewLoanWizard::KNewLoanWizard(TQWidget *tqparent, const char *name ) : + KNewLoanWizardDecl(tqparent, name, true) { - connect(m_borrowButton, SIGNAL(clicked()), this, SLOT(slotLiabilityLoan())); - connect(m_lendButton, SIGNAL(clicked()), this, SLOT(slotAssetLoan())); + connect(m_borrowButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotLiabilityLoan())); + connect(m_lendButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAssetLoan())); - connect(m_nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished())); - // connect(m_payeeEdit, SIGNAL(newPayee(const QString&)), this, SLOT(slotNewPayee(const QString&))); - connect(m_payeeEdit, SIGNAL(createItem(const QString&, QString&)), this, SIGNAL(createPayee(const QString&, QString&))); + connect(m_nameEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished())); + // connect(m_payeeEdit, TQT_SIGNAL(newPayee(const TQString&)), this, TQT_SLOT(slotNewPayee(const TQString&))); + connect(m_payeeEdit, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SIGNAL(createPayee(const TQString&, TQString&))); - connect(m_previousPaymentButton, SIGNAL(clicked()), this, SLOT(slotPaymentsMade())); - connect(m_noPreviousPaymentButton, SIGNAL(clicked()), this, SLOT(slotNoPaymentsMade())); + connect(m_previousPaymentButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotPaymentsMade())); + connect(m_noPreviousPaymentButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNoPaymentsMade())); - connect(m_allPaymentsButton, SIGNAL(clicked()), this, SLOT(slotRecordAllPayments())); - connect(m_thisYearPaymentButton, SIGNAL(clicked()), this, SLOT(slotRecordThisYearsPayments())); + connect(m_allPaymentsButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRecordAllPayments())); + connect(m_thisYearPaymentButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRecordThisYearsPayments())); - connect(m_firstDueDateEdit, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotCheckPageFinished())); + connect(m_firstDueDateEdit, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotCheckPageFinished())); - connect(m_interestOnPaymentButton, SIGNAL(clicked()), this, SLOT(slotInterestOnPayment())); - connect(m_interestOnReceptionButton, SIGNAL(clicked()), this, SLOT(slotInterestOnReception())); + connect(m_interestOnPaymentButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInterestOnPayment())); + connect(m_interestOnReceptionButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInterestOnReception())); - connect(m_loanAmountEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotCheckPageFinished())); + connect(m_loanAmountEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotCheckPageFinished())); - connect(m_interestAccountEdit, SIGNAL(stateChanged()), this, SLOT(slotCheckPageFinished())); + connect(m_interestAccountEdit, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotCheckPageFinished())); - connect(m_nextDueDateEdit, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotCheckPageFinished())); - connect(m_paymentAccountEdit, SIGNAL(stateChanged()), this, SLOT(slotCheckPageFinished())); + connect(m_nextDueDateEdit, TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotCheckPageFinished())); + connect(m_paymentAccountEdit, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotCheckPageFinished())); - connect(m_assetAccountEdit, SIGNAL(stateChanged()), this, SLOT(slotCheckPageFinished())); - connect(m_dontCreatePayoutCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckPageFinished())); + connect(m_assetAccountEdit, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotCheckPageFinished())); + connect(m_dontCreatePayoutCheckBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckPageFinished())); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotReloadEditWidgets())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadEditWidgets())); loadComboBoxes(); @@ -111,7 +111,7 @@ KNewLoanWizard::KNewLoanWizard(QWidget *parent, const char *name ) : m_interestFrequencyAmountEdit->setValue(1); m_interestFrequencyUnitEdit->setCurrentItem(static_cast(MyMoneyAccountLoan::changeYearly)); m_paymentFrequencyUnitEdit->setCurrentItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY))); - m_firstDueDateEdit->loadDate(QDate(QDate::currentDate().year(),QDate::currentDate().month(),30)); + m_firstDueDateEdit->loadDate(TQDate(TQDate::tqcurrentDate().year(),TQDate::tqcurrentDate().month(),30)); m_paymentAccountEdit->removeButtons(); m_assetAccountEdit->removeButtons(); @@ -120,25 +120,25 @@ KNewLoanWizard::KNewLoanWizard(QWidget *parent, const char *name ) : // load button icons KIconLoader* il = KGlobal::iconLoader(); KGuiItem createCategoryButtenItem( i18n( "&Create..." ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new category"), i18n("Use this to open the new account editor")); m_createCategoryButton->setGuiItem(createCategoryButtenItem); - connect(m_createCategoryButton, SIGNAL(clicked()), this, SLOT(slotCreateCategory())); + connect(m_createCategoryButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCreateCategory())); KGuiItem additionalFeeButtenItem( i18n( "&Additional fees..." ), - 0, //QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + 0, //TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Enter additional fees"), i18n("Use this to add any additional fees other than principal and interest contained in your periodical payments.")); m_additionalFeeButton->setGuiItem(additionalFeeButtenItem); - connect(m_additionalFeeButton, SIGNAL(clicked()), this, SLOT(slotAdditionalFees())); + connect(m_additionalFeeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAdditionalFees())); KGuiItem createAssetButtenItem( i18n( "&Create..." ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new asset account"), i18n("Use this to create a new account to which the initial payment should be made")); m_createNewAssetButton->setGuiItem(createAssetButtenItem); - connect(m_createNewAssetButton, SIGNAL(clicked()), kmymoney2, SLOT(slotAccountNew())); + connect(m_createNewAssetButton, TQT_SIGNAL(clicked()), kmymoney2, TQT_SLOT(slotAccountNew())); // enable the finish button on the last page setFinishEnabled(m_summaryPage, true); @@ -170,35 +170,35 @@ KNewLoanWizard::~KNewLoanWizard() void KNewLoanWizard::resetCalculator(void) { - m_loanAmount1->setText(QString()); - m_interestRate1->setText(QString()); - m_duration1->setText(QString()); - m_payment1->setText(QString()); - m_balloon1->setText(QString()); - - m_loanAmount2->setText(QString()); - m_interestRate2->setText(QString()); - m_duration2->setText(QString()); - m_payment2->setText(QString()); - m_balloon2->setText(QString()); - - m_loanAmount3->setText(QString()); - m_interestRate3->setText(QString()); - m_duration3->setText(QString()); - m_payment3->setText(QString()); - m_balloon3->setText(QString()); - - m_loanAmount4->setText(QString()); - m_interestRate4->setText(QString()); - m_duration4->setText(QString()); - m_payment4->setText(QString()); - m_balloon4->setText(QString()); - - m_loanAmount5->setText(QString()); - m_interestRate5->setText(QString()); - m_duration5->setText(QString()); - m_payment5->setText(QString()); - m_balloon5->setText(QString()); + m_loanAmount1->setText(TQString()); + m_interestRate1->setText(TQString()); + m_duration1->setText(TQString()); + m_payment1->setText(TQString()); + m_balloon1->setText(TQString()); + + m_loanAmount2->setText(TQString()); + m_interestRate2->setText(TQString()); + m_duration2->setText(TQString()); + m_payment2->setText(TQString()); + m_balloon2->setText(TQString()); + + m_loanAmount3->setText(TQString()); + m_interestRate3->setText(TQString()); + m_duration3->setText(TQString()); + m_payment3->setText(TQString()); + m_balloon3->setText(TQString()); + + m_loanAmount4->setText(TQString()); + m_interestRate4->setText(TQString()); + m_duration4->setText(TQString()); + m_payment4->setText(TQString()); + m_balloon4->setText(TQString()); + + m_loanAmount5->setText(TQString()); + m_interestRate5->setText(TQString()); + m_duration5->setText(TQString()); + m_payment5->setText(TQString()); + m_balloon5->setText(TQString()); m_additionalCost->setText(MyMoneyMoney(0).formatMoney(m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId())))); } @@ -229,14 +229,14 @@ void KNewLoanWizard::slotNoPaymentsMade(void) void KNewLoanWizard::slotRecordAllPayments(void) { m_firstPaymentLabel->setText( - QString("\n") + + TQString("\n") + i18n("Please enter the date, the first payment for this loan was/is due.")); m_firstPaymentNote->setText( i18n("Note: Consult the loan contract for details of the first due date. " "Keep in mind, that the first due date usually differs from the date " "the contract was signed")); m_balanceLabel->setText( - QString("\n") + + TQString("\n") + i18n("Please enter the original loan amount in the field below or leave it " "empty to be calculated.")); } @@ -244,13 +244,13 @@ void KNewLoanWizard::slotRecordAllPayments(void) void KNewLoanWizard::slotRecordThisYearsPayments(void) { m_firstPaymentLabel->setText( - QString("\n") + + TQString("\n") + i18n("Please enter the date, the first payment for this loan was/is due this year.")); m_firstPaymentNote->setText( i18n("Note: You can easily figure out the date of the first payment " "if you consult the last statement of last year.")); m_balanceLabel->setText( - QString("\n") + + TQString("\n") + i18n("Please enter the remaining loan amount of last years final " "statement in the field below. You should not leave this field empty.")); } @@ -306,9 +306,9 @@ void KNewLoanWizard::slotCheckPageFinished(void) void KNewLoanWizard::updateLoanAmount(void) { - QString txt; + TQString txt; if(m_loanAmountEdit->lineedit()->text().isEmpty()) { - txt = QString("<") + i18n("calculate") + QString(">"); + txt = TQString("<") + i18n("calculate") + TQString(">"); } else { txt = m_loanAmountEdit->value().formatMoney(m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId()))); } @@ -321,11 +321,11 @@ void KNewLoanWizard::updateLoanAmount(void) void KNewLoanWizard::updateInterestRate(void) { - QString txt; + TQString txt; if(m_interestRateEdit->lineedit()->text().isEmpty()) { - txt = QString("<") + i18n("calculate") + QString(">"); + txt = TQString("<") + i18n("calculate") + TQString(">"); } else { - txt = m_interestRateEdit->value().formatMoney("", 3) + QString("%"); + txt = m_interestRateEdit->value().formatMoney("", 3) + TQString("%"); } m_interestRate1->setText(txt); m_interestRate2->setText(txt); @@ -336,11 +336,11 @@ void KNewLoanWizard::updateInterestRate(void) void KNewLoanWizard::updateDuration(void) { - QString txt; + TQString txt; if(m_durationValueEdit->value() == 0) { - txt = QString("<") + i18n("calculate") + QString(">"); + txt = TQString("<") + i18n("calculate") + TQString(">"); } else { - txt = QString().sprintf("%d ", m_durationValueEdit->value()) + txt = TQString().sprintf("%d ", m_durationValueEdit->value()) + m_durationUnitEdit->currentText(); } m_duration1->setText(txt); @@ -352,9 +352,9 @@ void KNewLoanWizard::updateDuration(void) void KNewLoanWizard::updatePayment(void) { - QString txt; + TQString txt; if(m_paymentEdit->lineedit()->text().isEmpty()) { - txt = QString("<") + i18n("calculate") + QString(">"); + txt = TQString("<") + i18n("calculate") + TQString(">"); } else { txt = m_paymentEdit->value().formatMoney(m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId()))); } @@ -368,9 +368,9 @@ void KNewLoanWizard::updatePayment(void) void KNewLoanWizard::updateFinalPayment(void) { - QString txt; + TQString txt; if(m_finalPaymentEdit->lineedit()->text().isEmpty()) { - txt = QString("<") + i18n("calculate") + QString(">"); + txt = TQString("<") + i18n("calculate") + TQString(">"); } else { txt = m_finalPaymentEdit->value().formatMoney(m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId()))); } @@ -390,12 +390,12 @@ void KNewLoanWizard::updateLoanInfo(void) updateFinalPayment(); updatePeriodicPayment(); - QString txt; + TQString txt; int fraction = m_account.fraction(MyMoneyFile::instance()->security(m_account.currencyId())); m_loanAmount6->setText(m_loanAmountEdit->value().formatMoney(fraction)); - m_interestRate6->setText(m_interestRateEdit->value().formatMoney("", 3) + QString("%")); - txt = QString().sprintf("%d ", m_durationValueEdit->value()) + m_interestRate6->setText(m_interestRateEdit->value().formatMoney("", 3) + TQString("%")); + txt = TQString().sprintf("%d ", m_durationValueEdit->value()) + m_durationUnitEdit->currentText(); m_duration6->setText(txt); m_payment6->setText(m_paymentEdit->value().formatMoney(fraction)); @@ -439,7 +439,7 @@ void KNewLoanWizard::updateSummary(void) // Payment try { - QStringList sel = m_interestAccountEdit->selectedItems(); + TQStringList sel = m_interestAccountEdit->selectedItems(); if(sel.count() != 1) throw new MYMONEYEXCEPTION("Need a single selected interest category"); MyMoneyAccount acc = MyMoneyFile::instance()->account(sel.first()); @@ -453,7 +453,7 @@ void KNewLoanWizard::updateSummary(void) m_summaryNextPayment->setText(KGlobal::locale()->formatDate(m_nextDueDateEdit->date(), true)); try { - QStringList sel = m_paymentAccountEdit->selectedItems(); + TQStringList sel = m_paymentAccountEdit->selectedItems(); if(sel.count() != 1) throw new MYMONEYEXCEPTION("Need a single selected payment account"); MyMoneyAccount acc = MyMoneyFile::instance()->account(sel.first()); @@ -467,7 +467,7 @@ void KNewLoanWizard::updateSummary(void) void KNewLoanWizard::next() { bool dontLeavePage = false; - QString errMsg = i18n( + TQString errMsg = i18n( "The loan wizard is unable to calculate two different values for your loan " "at the same time. " "Please enter a value for the %1 on this page or backup to the page where the " @@ -510,7 +510,7 @@ void KNewLoanWizard::next() if(m_loanAmountEdit->lineedit()->text().isEmpty() && m_interestRateEdit->lineedit()->text().isEmpty()) { dontLeavePage = true; - KMessageBox::error(0, errMsg.arg(i18n("interest rate")), i18n("Calculation error")); + KMessageBox::error(0, errMsg.tqarg(i18n("interest rate")), i18n("Calculation error")); } else updateInterestRate(); @@ -519,7 +519,7 @@ void KNewLoanWizard::next() || m_interestRateEdit->lineedit()->text().isEmpty()) && m_durationValueEdit->value() == 0) { dontLeavePage = true; - KMessageBox::error(0, errMsg.arg(i18n("term")), i18n("Calculation error")); + KMessageBox::error(0, errMsg.tqarg(i18n("term")), i18n("Calculation error")); } else updateDuration(); @@ -529,7 +529,7 @@ void KNewLoanWizard::next() || m_durationValueEdit->value() == 0) && m_paymentEdit->lineedit()->text().isEmpty()) { dontLeavePage = true; - KMessageBox::error(0, errMsg.arg(i18n("principal and interest")), i18n("Calculation error")); + KMessageBox::error(0, errMsg.tqarg(i18n("principal and interest")), i18n("Calculation error")); } else updatePayment(); @@ -557,7 +557,7 @@ void KNewLoanWizard::next() if(m_assetAccountPage) setAppropriate(m_assetAccountPage, true); } else { - QDate nextPayment(QDate::currentDate().year(), 1, m_firstDueDateEdit->date().day()); + TQDate nextPayment(TQDate::tqcurrentDate().year(), 1, m_firstDueDateEdit->date().day()); m_nextDueDateEdit->setDate(nextPayment); if(m_assetAccountPage) setAppropriate(m_assetAccountPage, false); @@ -626,7 +626,7 @@ void KNewLoanWizard::loadComboBoxes(void) m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))); - m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))); + m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))); @@ -654,7 +654,7 @@ int KNewLoanWizard::calculateLoan(void) MyMoneyFinancialCalculator calc; long double val; int PF; - QString result; + TQString result; // FIXME: for now, we only support interest calculation at the end of the period calc.setBep(); @@ -709,14 +709,14 @@ int KNewLoanWizard::calculateLoan(void) val = calc.presentValue(); m_loanAmountEdit->loadText(MyMoneyMoney(static_cast(val)).abs().formatMoney(fraction)); result = i18n("KMyMoney has calculated the amount of the loan as %1.") - .arg(m_loanAmountEdit->lineedit()->text()); + .tqarg(m_loanAmountEdit->lineedit()->text()); } else if(m_interestRateEdit->lineedit()->text().isEmpty()) { // calculate the interest rate out of the other information val = calc.interestRate(); m_interestRateEdit->loadText(MyMoneyMoney(static_cast(val)).abs().formatMoney("", 3)); result = i18n("KMyMoney has calculated the interest rate to %1%.") - .arg(m_interestRateEdit->lineedit()->text()); + .tqarg(m_interestRateEdit->lineedit()->text()); } else if(m_paymentEdit->lineedit()->text().isEmpty()) { // calculate the periodical amount of the payment out of the other information @@ -729,7 +729,7 @@ int KNewLoanWizard::calculateLoan(void) calc.setPmt(val); result = i18n("KMyMoney has calculated a periodic payment of %1 to cover principal and interest.") - .arg(m_paymentEdit->lineedit()->text()); + .tqarg(m_paymentEdit->lineedit()->text()); val = calc.futureValue(); if((m_borrowButton->isChecked() && val < 0 && fabsl(val) >= fabsl(calc.payment())) @@ -739,9 +739,9 @@ int KNewLoanWizard::calculateLoan(void) val = calc.futureValue(); MyMoneyMoney refVal(static_cast(val)); m_finalPaymentEdit->loadText(refVal.abs().formatMoney(fraction)); - result += QString(" "); + result += TQString(" "); result += i18n("The number of payments has been decremented and the final payment has been modified to %1.") - .arg(m_finalPaymentEdit->lineedit()->text()); + .tqarg(m_finalPaymentEdit->lineedit()->text()); } else if((m_borrowButton->isChecked() && val < 0 && fabsl(val) < fabsl(calc.payment())) || (m_lendButton->isChecked() && val > 0 && fabs(val) < fabs(calc.payment()))) { m_finalPaymentEdit->loadText(MyMoneyMoney(0,1).formatMoney(fraction)); @@ -749,7 +749,7 @@ int KNewLoanWizard::calculateLoan(void) MyMoneyMoney refVal(static_cast(val)); m_finalPaymentEdit->loadText(refVal.abs().formatMoney(fraction)); result += i18n("The final payment has been modified to %1.") - .arg(m_finalPaymentEdit->lineedit()->text()); + .tqarg(m_finalPaymentEdit->lineedit()->text()); } } else if(m_durationValueEdit->value() == 0) { @@ -761,7 +761,7 @@ int KNewLoanWizard::calculateLoan(void) // if the number of payments has a fractional part, then we // round it to the smallest integer and calculate the balloon payment result = i18n("KMyMoney has calculated the term of your loan as %1. ") - .arg(updateTermWidgets(floorl(val))); + .tqarg(updateTermWidgets(floorl(val))); if(val != floorl(val)) { calc.setNpp(floorl(val)); @@ -769,7 +769,7 @@ int KNewLoanWizard::calculateLoan(void) MyMoneyMoney refVal(static_cast(val)); m_finalPaymentEdit->loadText(refVal.abs().formatMoney(fraction)); result += i18n("The final payment has been modified to %1.") - .arg(m_finalPaymentEdit->lineedit()->text()); + .tqarg(m_finalPaymentEdit->lineedit()->text()); } } else { @@ -800,7 +800,7 @@ int KNewLoanWizard::calculateLoan(void) MyMoneyMoney refVal(static_cast(val)); result = i18n("KMyMoney has calculated a final payment of %1 for this loan.") - .arg(refVal.abs().formatMoney(fraction)); + .tqarg(refVal.abs().formatMoney(fraction)); if(!m_finalPaymentEdit->lineedit()->text().isEmpty()) { if((m_finalPaymentEdit->value().abs() - refVal.abs()).abs().toDouble() > 1) { @@ -827,11 +827,11 @@ int KNewLoanWizard::calculateLoan(void) return 1; } -QString KNewLoanWizard::updateTermWidgets(const long double val) +TQString KNewLoanWizard::updateTermWidgets(const long double val) { long long vl = static_cast(floorl(val)); - QString valString; + TQString valString; MyMoneySchedule::occurenceE unit; unit = MyMoneySchedule::stringToOccurence(m_paymentFrequencyUnitEdit->currentText()); @@ -874,12 +874,12 @@ void KNewLoanWizard::slotCreateCategory(void) acc.setParentAccountId(base.id()); KNewAccountDlg* dlg = new KNewAccountDlg(acc, true, true); - if(dlg->exec() == QDialog::Accepted) { + if(dlg->exec() == TQDialog::Accepted) { acc = dlg->account(); MyMoneyFileTransaction ft; try { - QString id; + TQString id; id = file->createCategory(base, acc.name()); if(id.isEmpty()) throw new MYMONEYEXCEPTION("failure while creating the account hierarchy"); @@ -889,7 +889,7 @@ void KNewLoanWizard::slotCreateCategory(void) m_interestAccountEdit->setSelected(id); } catch (MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to add account: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to add account: %1").tqarg(e->what())); delete e; } } @@ -921,17 +921,17 @@ void KNewLoanWizard::loadAccountList(void) void KNewLoanWizard::slotAdditionalFees(void) { - // KMessageBox::information(0, QString("Not yet implemented ... if you want to help, contact kmymoney2-developer@lists.sourceforge.net"), QString("Development notice")); + // KMessageBox::information(0, TQString("Not yet implemented ... if you want to help, contact kmymoney2-developer@lists.sourceforge.net"), TQString("Development notice")); MyMoneyAccount account("Phony-ID", MyMoneyAccount()); - QMap priceInfo; + TQMap priceInfo; KSplitTransactionDlg* dlg = new KSplitTransactionDlg(m_transaction, m_split, account, false, !m_borrowButton->isChecked(), MyMoneyMoney(0), priceInfo); - connect(dlg, SIGNAL(newCategory(MyMoneyAccount&)), this, SIGNAL(newCategory(MyMoneyAccount&))); + connect(dlg, TQT_SIGNAL(newCategory(MyMoneyAccount&)), this, TQT_SIGNAL(newCategory(MyMoneyAccount&))); - if(dlg->exec() == QDialog::Accepted) { + if(dlg->exec() == TQDialog::Accepted) { m_transaction = dlg->transaction(); // sum up the additional fees - QValueList::ConstIterator it; + TQValueList::ConstIterator it; MyMoneyMoney fees; for(it = m_transaction.splits().begin(); it != m_transaction.splits().end(); ++it) { @@ -980,7 +980,7 @@ MyMoneyTransaction KNewLoanWizard::transaction() const sInterest.setAction(MyMoneySplit::ActionInterest); // payee - QString payeeId = m_payeeEdit->selectedItem(); + TQString payeeId = m_payeeEdit->selectedItem(); sPayment.setPayeeId(payeeId); sAmortization.setPayeeId(payeeId); @@ -994,7 +994,7 @@ MyMoneyTransaction KNewLoanWizard::transaction() const t.addSplit(sInterest); // copy the splits from the other costs and update the payment split - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_transaction.splits().begin(); it != m_transaction.splits().end(); ++it) { if((*it).accountId() != account.id()) { MyMoneySplit sp = (*it); @@ -1014,8 +1014,8 @@ MyMoneySchedule KNewLoanWizard::schedule(void) const MyMoneySchedule::TYPE_LOANPAYMENT, MyMoneySchedule::stringToOccurence(m_paymentFrequencyUnitEdit->currentText()), 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); @@ -1032,7 +1032,7 @@ void KNewLoanWizard::slotReloadEditWidgets(void) loadAccountList(); // reload payee widget - QString payeeId = m_payeeEdit->selectedItem(); + TQString payeeId = m_payeeEdit->selectedItem(); m_payeeEdit->loadPayees(MyMoneyFile::instance()->payeeList()); @@ -1069,18 +1069,18 @@ int KNewLoanWizard::term(void) const return factor; } -QString KNewLoanWizard::initialPaymentAccount(void) const +TQString KNewLoanWizard::initialPaymentAccount(void) const { if(m_dontCreatePayoutCheckBox->isChecked()) { - return QString(); + return TQString(); } return m_assetAccountEdit->selectedItems().first(); } -QDate KNewLoanWizard::initialPaymentDate(void) const +TQDate KNewLoanWizard::initialPaymentDate(void) const { if(m_dontCreatePayoutCheckBox->isChecked()) { - return QDate(); + return TQDate(); } return m_paymentDate->date(); } diff --git a/kmymoney2/dialogs/knewloanwizard.h b/kmymoney2/dialogs/knewloanwizard.h index 5e291b7..8cf019d 100644 --- a/kmymoney2/dialogs/knewloanwizard.h +++ b/kmymoney2/dialogs/knewloanwizard.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,8 +54,9 @@ class KNewLoanWizard : public KNewLoanWizardDecl { Q_OBJECT + TQ_OBJECT public: - KNewLoanWizard(QWidget *parent=0, const char *name=0); + KNewLoanWizard(TQWidget *tqparent=0, const char *name=0); ~KNewLoanWizard(); /** @@ -75,20 +76,20 @@ public: * This method returns the id of the account to/from which * the payout should be created. If the checkbox that allows * to skip the creation of this transaction is checked, this - * method returns QString() + * method returns TQString() * - * @return id of account or empty QString + * @return id of account or empty TQString */ - QString initialPaymentAccount(void) const; + TQString initialPaymentAccount(void) const; /** * This method returns the date of the payout transaction. * If the checkbox that allows to skip the creation of - * this transaction is checked, this method returns QDate() + * this transaction is checked, this method returns TQDate() * - * @return selected date or invalid QDate if checkbox is selected. + * @return selected date or invalid TQDate if checkbox is selected. */ - QDate initialPaymentDate(void) const; + TQDate initialPaymentDate(void) const; protected: /** @@ -114,7 +115,7 @@ protected slots: void slotInterestOnReception(void); void slotCreateCategory(void); virtual void slotAdditionalFees(void); - // void slotNewPayee(const QString&); + // void slotNewPayee(const TQString&); void slotReloadEditWidgets(void); protected: @@ -127,7 +128,7 @@ protected: void updatePayment(void); void updateFinalPayment(void); void updateLoanInfo(void); - QString updateTermWidgets(const long double v); + TQString updateTermWidgets(const long double v); void updatePeriodicPayment(void); void updateSummary(void); int calculateLoan(void); @@ -156,7 +157,7 @@ signals: * @param txt The name of the payee to be created * @param id A connected slot should store the id of the created object in this variable */ - void createPayee(const QString& txt, QString& id); + void createPayee(const TQString& txt, TQString& id); protected: MyMoneyAccountLoan m_account; diff --git a/kmymoney2/dialogs/knewloanwizarddecl.ui b/kmymoney2/dialogs/knewloanwizarddecl.ui index d45eb4b..6a70458 100644 --- a/kmymoney2/dialogs/knewloanwizarddecl.ui +++ b/kmymoney2/dialogs/knewloanwizarddecl.ui @@ -1,6 +1,6 @@ KNewLoanWizardDecl - + KNewLoanWizardDecl @@ -12,7 +12,7 @@ 458 - + 800 32767 @@ -28,7 +28,7 @@ - + m_newIntroPage @@ -39,7 +39,7 @@ unnamed - + Layout2 @@ -63,14 +63,14 @@ Expanding - + 98 0 - + TextLabel1_1 @@ -84,7 +84,7 @@ New Loan Account Wizard - + AlignTop|AlignHCenter @@ -98,7 +98,7 @@ Expanding - + 119 0 @@ -107,7 +107,7 @@ - + TextLabel1_2 @@ -117,7 +117,7 @@ Welcome to the New Loan Account Wizard which will guide you through the creation Please make sure that you have the relevant information handy. You usually get the information out of your contract and the last statement. - + WordBreak|AlignTop @@ -131,7 +131,7 @@ Please make sure that you have the relevant information handy. You usually get t Expanding - + 20 20 @@ -140,7 +140,7 @@ Please make sure that you have the relevant information handy. You usually get t - + m_editIntroPage @@ -151,7 +151,7 @@ Please make sure that you have the relevant information handy. You usually get t unnamed - + Layout2_2 @@ -175,14 +175,14 @@ Please make sure that you have the relevant information handy. You usually get t Expanding - + 98 0 - + TextLabel1_1_2 @@ -196,7 +196,7 @@ Please make sure that you have the relevant information handy. You usually get t Edit Loan Account Wizard - + AlignTop|AlignHCenter @@ -210,7 +210,7 @@ Please make sure that you have the relevant information handy. You usually get t Expanding - + 119 0 @@ -219,7 +219,7 @@ Please make sure that you have the relevant information handy. You usually get t - + TextLabel1_2_2 @@ -229,7 +229,7 @@ Welcome to the Edit Loan Account Wizard. Please use this wizard to modify inform Please make sure that you have the relevant information handy. You usually get the information out of your contract and the last statement. - + WordBreak|AlignTop @@ -243,7 +243,7 @@ Please make sure that you have the relevant information handy. You usually get t Expanding - + 20 20 @@ -252,7 +252,7 @@ Please make sure that you have the relevant information handy. You usually get t - + m_newGeneralInfoPage @@ -269,7 +269,7 @@ Please make sure that you have the relevant information handy. You usually get t 6 - + TextLabel2_2 @@ -277,7 +277,7 @@ Please make sure that you have the relevant information handy. You usually get t In the first step, KMyMoney will ask you some general information about the loan account to be created. - + WordBreak|AlignTop @@ -291,14 +291,14 @@ In the first step, KMyMoney will ask you some general information about the loan Expanding - + 0 32 - + Layout6 @@ -322,14 +322,14 @@ In the first step, KMyMoney will ask you some general information about the loan Expanding - + 138 0 - + Layout5 @@ -343,18 +343,18 @@ In the first step, KMyMoney will ask you some general information about the loan 6 - + TextLabel3 1. General Information - + AlignTop - + TextLabel4 @@ -378,7 +378,7 @@ In the first step, KMyMoney will ask you some general information about the loan Expanding - + 0 25 @@ -397,7 +397,7 @@ In the first step, KMyMoney will ask you some general information about the loan Expanding - + 137 0 @@ -416,7 +416,7 @@ In the first step, KMyMoney will ask you some general information about the loan Expanding - + 0 32 @@ -425,7 +425,7 @@ In the first step, KMyMoney will ask you some general information about the loan - + m_editSelectionPage @@ -442,7 +442,7 @@ In the first step, KMyMoney will ask you some general information about the loan 6 - + TextLabel2_2_1 @@ -450,7 +450,7 @@ In the first step, KMyMoney will ask you some general information about the loan Please select, which data of the loan you want to modify. - + WordBreak|AlignTop @@ -464,14 +464,14 @@ Please select, which data of the loan you want to modify. Expanding - + 0 48 - + Layout33 @@ -495,14 +495,14 @@ Please select, which data of the loan you want to modify. Expanding - + 93 0 - + m_selectionButtonGroup @@ -525,7 +525,7 @@ Please select, which data of the loan you want to modify. 6 - + m_editInterestRateButton @@ -533,7 +533,7 @@ Please select, which data of the loan you want to modify. Modify the interest rate - + m_editOtherCostButton @@ -541,7 +541,7 @@ Please select, which data of the loan you want to modify. Modify additional fees - + m_editOtherInfoButton @@ -561,7 +561,7 @@ Please select, which data of the loan you want to modify. Expanding - + 108 0 @@ -580,7 +580,7 @@ Please select, which data of the loan you want to modify. Expanding - + 0 47 @@ -589,7 +589,7 @@ Please select, which data of the loan you want to modify. - + m_effectiveDatePage @@ -606,25 +606,25 @@ Please select, which data of the loan you want to modify. 6 - + m_effectiveDateLabel 1 - + WordBreak|AlignTop - + m_effectiveDateNoteLabel 1 - + WordBreak|AlignTop @@ -638,14 +638,14 @@ Please select, which data of the loan you want to modify. Expanding - + 0 30 - + Layout34 @@ -659,7 +659,7 @@ Please select, which data of the loan you want to modify. 6 - + TextLabel1_7 @@ -684,7 +684,7 @@ Please select, which data of the loan you want to modify. Expanding - + 0 87 @@ -693,7 +693,7 @@ Please select, which data of the loan you want to modify. - + m_lendBorrowPage @@ -710,7 +710,7 @@ Please select, which data of the loan you want to modify. 6 - + TextLabel3_2 @@ -718,7 +718,7 @@ Please select, which data of the loan you want to modify. Do you borrow or lend money? - + WordBreak|AlignTop @@ -732,14 +732,14 @@ Do you borrow or lend money? Expanding - + 0 61 - + Layout38 @@ -753,7 +753,7 @@ Do you borrow or lend money? 6 - + ButtonGroup1 @@ -776,7 +776,7 @@ Do you borrow or lend money? 6 - + m_borrowButton @@ -784,7 +784,7 @@ Do you borrow or lend money? I am borrowing money - + m_lendButton @@ -804,7 +804,7 @@ Do you borrow or lend money? Expanding - + 299 0 @@ -823,7 +823,7 @@ Do you borrow or lend money? Expanding - + 0 60 @@ -832,7 +832,7 @@ Do you borrow or lend money? - + m_namePage @@ -843,7 +843,7 @@ Do you borrow or lend money? unnamed - + TextLabel4_2 @@ -851,7 +851,7 @@ Do you borrow or lend money? How do you want to call this loan? Examples for names are 'car loan', 'school loan', 'home owner loan'. - + WordBreak|AlignTop @@ -865,14 +865,14 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo Expanding - + 16 56 - + Layout13 @@ -886,7 +886,7 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo 6 - + TextLabel5 @@ -911,14 +911,14 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo Expanding - + 16 56 - + m_generalReceiverText @@ -926,15 +926,15 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo TextLabel6 - + - layout55 + tqlayout55 unnamed - + m_receiverLabel @@ -959,7 +959,7 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo Expanding - + 16 56 @@ -968,7 +968,7 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo - + m_interestTypePage @@ -985,7 +985,7 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo 6 - + TextLabel5_2 @@ -993,7 +993,7 @@ How do you want to call this loan? Examples for names are 'car loan', 'school lo Is the interest of this loan fixed over a period of time or is it adapted from time to time? If the interest rate changes during the amortization phase of the loan you should choose the option 'variable interest rate'. - + WordBreak|AlignTop @@ -1007,14 +1007,14 @@ Is the interest of this loan fixed over a period of time or is it adapted from t Expanding - + 0 53 - + Layout39 @@ -1028,7 +1028,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t 6 - + ButtonGroup2 @@ -1051,7 +1051,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t 6 - + m_fixedInterestButton @@ -1059,7 +1059,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t Fixed interest rate - + m_variableInterestButton @@ -1079,7 +1079,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t Expanding - + 286 0 @@ -1098,7 +1098,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t Expanding - + 0 53 @@ -1107,7 +1107,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t - + m_previousPaymentsPage @@ -1124,7 +1124,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t 6 - + TextLabel6_2 @@ -1132,7 +1132,7 @@ Is the interest of this loan fixed over a period of time or is it adapted from t Were there any payments for this loan whether they are entered into KMyMoney or not? - + WordBreak|AlignTop @@ -1146,14 +1146,14 @@ Were there any payments for this loan whether they are entered into KMyMoney or Expanding - + 0 32 - + Layout40 @@ -1167,7 +1167,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or 6 - + ButtonGroup3 @@ -1190,7 +1190,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or 6 - + m_noPreviousPaymentButton @@ -1198,7 +1198,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or No, no payments were made yet. - + m_previousPaymentButton @@ -1218,7 +1218,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or Expanding - + 202 0 @@ -1237,21 +1237,21 @@ Were there any payments for this loan whether they are entered into KMyMoney or Expanding - + 0 32 - + TextLabel3_3 Note: Payments made to obtain the loan (e.g. Dissagio) are not considered as payments in this context. - + WordBreak|AlignTop @@ -1265,7 +1265,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or Expanding - + 0 32 @@ -1274,7 +1274,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or - + m_recordPaymentPage @@ -1291,7 +1291,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or 6 - + TextLabel7_2 @@ -1299,7 +1299,7 @@ Were there any payments for this loan whether they are entered into KMyMoney or Do you want to record all payments of this loan with KMyMoney? - + WordBreak|AlignTop @@ -1313,14 +1313,14 @@ Do you want to record all payments of this loan with KMyMoney? Expanding - + 0 69 - + Layout41 @@ -1334,7 +1334,7 @@ Do you want to record all payments of this loan with KMyMoney? 6 - + ButtonGroup4 @@ -1357,7 +1357,7 @@ Do you want to record all payments of this loan with KMyMoney? 6 - + m_allPaymentsButton @@ -1365,7 +1365,7 @@ Do you want to record all payments of this loan with KMyMoney? Yes, record all payments. - + m_thisYearPaymentButton @@ -1385,7 +1385,7 @@ Do you want to record all payments of this loan with KMyMoney? Expanding - + 137 0 @@ -1404,7 +1404,7 @@ Do you want to record all payments of this loan with KMyMoney? Expanding - + 0 69 @@ -1413,7 +1413,7 @@ Do you want to record all payments of this loan with KMyMoney? - + m_variableInterestDatePage @@ -1424,7 +1424,7 @@ Do you want to record all payments of this loan with KMyMoney? unnamed - + TextLabel8_2 @@ -1432,7 +1432,7 @@ Do you want to record all payments of this loan with KMyMoney? Select the date when the interest rate for this loan will be modified and the frequency of the future changes. - + WordBreak|AlignTop @@ -1446,22 +1446,22 @@ Select the date when the interest rate for this loan will be modified and the fr Expanding - + 16 99 - + - layout44 + tqlayout44 unnamed - + TextLabel1 @@ -1469,9 +1469,9 @@ Select the date when the interest rate for this loan will be modified and the fr Next interest change on - + - layout42 + tqlayout42 @@ -1502,7 +1502,7 @@ Select the date when the interest rate for this loan will be modified and the fr m_interestChangeDateEdit - + TextLabel2 @@ -1522,7 +1522,7 @@ Select the date when the interest rate for this loan will be modified and the fr Expanding - + 20 80 @@ -1531,7 +1531,7 @@ Select the date when the interest rate for this loan will be modified and the fr - + m_paymentEditPage @@ -1548,7 +1548,7 @@ Select the date when the interest rate for this loan will be modified and the fr 6 - + TextLabel8_2_2 @@ -1556,7 +1556,7 @@ Select the date when the interest rate for this loan will be modified and the fr Please enter the amount you pay for principal and interest or leave the field empty to calculate it. - + WordBreak|AlignTop @@ -1570,14 +1570,14 @@ Please enter the amount you pay for principal and interest or leave the field em Expanding - + 0 21 - + Layout39 @@ -1601,14 +1601,14 @@ Please enter the amount you pay for principal and interest or leave the field em Expanding - + 100 0 - + Layout35 @@ -1627,7 +1627,7 @@ Please enter the amount you pay for principal and interest or leave the field em m_newPaymentEdit - + TextLabel2_4 @@ -1635,7 +1635,7 @@ Please enter the amount you pay for principal and interest or leave the field em Current amount - + m_paymentLabel @@ -1643,7 +1643,7 @@ Please enter the amount you pay for principal and interest or leave the field em 1 - + TextLabel1_5 @@ -1663,7 +1663,7 @@ Please enter the amount you pay for principal and interest or leave the field em Expanding - + 100 0 @@ -1682,14 +1682,14 @@ Please enter the amount you pay for principal and interest or leave the field em Expanding - + 0 19 - + TextLabel4_5 @@ -1698,13 +1698,13 @@ Please enter the amount you pay for principal and interest or leave the field em If KMyMoney should calculate this value for you, then leave the field blank. - + WordBreak|AlignVCenter - + m_interestEditPage @@ -1721,7 +1721,7 @@ If KMyMoney should calculate this value for you, then leave the field blank. 6 - + TextLabel5_4 @@ -1729,7 +1729,7 @@ If KMyMoney should calculate this value for you, then leave the field blank. Please enter the interest rate or leave the field empty to calculate it. - + WordBreak|AlignTop @@ -1743,14 +1743,14 @@ Please enter the interest rate or leave the field empty to calculate it. Expanding - + 0 29 - + Layout40 @@ -1774,14 +1774,14 @@ Please enter the interest rate or leave the field empty to calculate it. Expanding - + 101 0 - + Layout36 @@ -1800,7 +1800,7 @@ Please enter the interest rate or leave the field empty to calculate it.m_newInterestRateEdit - + m_interestRateLabel @@ -1808,7 +1808,7 @@ Please enter the interest rate or leave the field empty to calculate it.1 - + TextLabel7_3 @@ -1816,7 +1816,7 @@ Please enter the interest rate or leave the field empty to calculate it.Current rate - + TextLabel6_5 @@ -1836,7 +1836,7 @@ Please enter the interest rate or leave the field empty to calculate it. Expanding - + 101 0 @@ -1855,14 +1855,14 @@ Please enter the interest rate or leave the field empty to calculate it. Expanding - + 0 29 - + TextLabel9_4 @@ -1871,13 +1871,13 @@ Please enter the interest rate or leave the field empty to calculate it. - + WordBreak|AlignTop - + m_firstPaymentPage @@ -1894,14 +1894,14 @@ If KMyMoney should calculate this value for you, then leave the field blank. 6 - + m_firstPaymentLabel 1 - + WordBreak|AlignTop @@ -1915,14 +1915,14 @@ If KMyMoney should calculate this value for you, then leave the field blank. Expanding - + 0 78 - + Layout22_2 @@ -1936,7 +1936,7 @@ If KMyMoney should calculate this value for you, then leave the field blank. 6 - + TextLabel1_3 @@ -1961,27 +1961,27 @@ If KMyMoney should calculate this value for you, then leave the field blank. Expanding - + 0 28 - + m_firstPaymentNote - + WordBreak|AlignBottom - + m_newCalculateLoanPage @@ -1998,7 +1998,7 @@ If KMyMoney should calculate this value for you, then leave the field blank. 6 - + TextLabel2_2_2 @@ -2006,7 +2006,7 @@ If KMyMoney should calculate this value for you, then leave the field blank. You have successfully entered the general information about your loan. Next, KMyMoney needs some information about the calculation of the loan. - + WordBreak|AlignTop @@ -2020,14 +2020,14 @@ You have successfully entered the general information about your loan. Next, KMy Expanding - + 0 19 - + Layout31 @@ -2051,14 +2051,14 @@ You have successfully entered the general information about your loan. Next, KMy Expanding - + 136 0 - + Layout30 @@ -2072,7 +2072,7 @@ You have successfully entered the general information about your loan. Next, KMy 6 - + TextLabel3_4 @@ -2082,11 +2082,11 @@ You have successfully entered the general information about your loan. Next, KMy 1. General Information - + AlignTop - + TextLabel4_3_2 @@ -2095,7 +2095,7 @@ You have successfully entered the general information about your loan. Next, KMy 2. Calculate Loan - + TextLabel4_3 @@ -2117,7 +2117,7 @@ You have successfully entered the general information about your loan. Next, KMy Expanding - + 0 18 @@ -2136,7 +2136,7 @@ You have successfully entered the general information about your loan. Next, KMy Expanding - + 135 0 @@ -2155,7 +2155,7 @@ You have successfully entered the general information about your loan. Next, KMy Expanding - + 0 23 @@ -2164,7 +2164,7 @@ You have successfully entered the general information about your loan. Next, KMy - + m_paymentFrequencyPage @@ -2181,7 +2181,7 @@ You have successfully entered the general information about your loan. Next, KMy 6 - + TextLabel11_2 @@ -2189,7 +2189,7 @@ You have successfully entered the general information about your loan. Next, KMy How often will there be payments made to this loan? - + WordBreak|AlignTop @@ -2203,14 +2203,14 @@ How often will there be payments made to this loan? Expanding - + 0 49 - + Layout33 @@ -2234,7 +2234,7 @@ How often will there be payments made to this loan? Expanding - + 39 0 @@ -2256,7 +2256,7 @@ How often will there be payments made to this loan? Expanding - + 56 0 @@ -2275,7 +2275,7 @@ How often will there be payments made to this loan? Expanding - + 0 49 @@ -2284,7 +2284,7 @@ How often will there be payments made to this loan? - + m_interestCalculationPage @@ -2301,7 +2301,7 @@ How often will there be payments made to this loan? 6 - + TextLabel12_2 @@ -2309,7 +2309,7 @@ How often will there be payments made to this loan? When does the actual interest rate get calculated? - + WordBreak|AlignTop @@ -2323,14 +2323,14 @@ When does the actual interest rate get calculated? Expanding - + 0 69 - + Layout42 @@ -2344,7 +2344,7 @@ When does the actual interest rate get calculated? 6 - + ButtonGroup5 @@ -2367,7 +2367,7 @@ When does the actual interest rate get calculated? 6 - + m_interestOnReceptionButton @@ -2375,7 +2375,7 @@ When does the actual interest rate get calculated? When the payment is received. - + m_interestOnPaymentButton @@ -2395,7 +2395,7 @@ When does the actual interest rate get calculated? Expanding - + 296 0 @@ -2414,7 +2414,7 @@ When does the actual interest rate get calculated? Expanding - + 0 69 @@ -2423,7 +2423,7 @@ When does the actual interest rate get calculated? - + m_loanAmountPage @@ -2440,14 +2440,14 @@ When does the actual interest rate get calculated? 6 - + m_balanceLabel 1 - + WordBreak|AlignTop @@ -2461,14 +2461,14 @@ When does the actual interest rate get calculated? Expanding - + 0 15 - + Layout38 @@ -2482,7 +2482,7 @@ When does the actual interest rate get calculated? 6 - + TextLabel16 @@ -2497,7 +2497,7 @@ When does the actual interest rate get calculated? - + Frame3 @@ -2517,62 +2517,62 @@ When does the actual interest rate get calculated? 6 - + TextLabel6 Loan amount: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8 Interest rate: - + AlignVCenter|AlignRight - + TextLabel9 Term: - + AlignVCenter|AlignRight - + TextLabel10 Principal + Interest: - + AlignVCenter|AlignRight - + TextLabel11 Final amortization payment - + AlignVCenter|AlignRight - + m_loanAmount1 @@ -2588,7 +2588,7 @@ When does the actual interest rate get calculated? PlainText - + m_interestRate1 @@ -2604,7 +2604,7 @@ When does the actual interest rate get calculated? PlainText - + m_duration1 @@ -2620,7 +2620,7 @@ When does the actual interest rate get calculated? PlainText - + m_payment1 @@ -2636,7 +2636,7 @@ When does the actual interest rate get calculated? PlainText - + m_balloon1 @@ -2656,7 +2656,7 @@ When does the actual interest rate get calculated? - + m_interestPage @@ -2673,7 +2673,7 @@ When does the actual interest rate get calculated? 6 - + TextLabel14_2 @@ -2681,7 +2681,7 @@ When does the actual interest rate get calculated? Please enter the interest rate or leave the field empty to calculate it. - + WordBreak|AlignTop @@ -2695,14 +2695,14 @@ Please enter the interest rate or leave the field empty to calculate it. Expanding - + 0 16 - + Layout36 @@ -2716,7 +2716,7 @@ Please enter the interest rate or leave the field empty to calculate it. 6 - + TextLabel1_4 @@ -2731,7 +2731,7 @@ Please enter the interest rate or leave the field empty to calculate it. - + Frame3_2 @@ -2751,62 +2751,62 @@ Please enter the interest rate or leave the field empty to calculate it. 6 - + TextLabel6_3 Loan amount: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8_3 Interest rate: - + AlignVCenter|AlignRight - + TextLabel9_2 Term: - + AlignVCenter|AlignRight - + TextLabel10_2 Principal + Interest: - + AlignVCenter|AlignRight - + TextLabel11_3 Final amortization payment - + AlignVCenter|AlignRight - + m_loanAmount2 @@ -2822,7 +2822,7 @@ Please enter the interest rate or leave the field empty to calculate it.PlainText - + m_interestRate2 @@ -2838,7 +2838,7 @@ Please enter the interest rate or leave the field empty to calculate it.PlainText - + m_duration2 @@ -2854,7 +2854,7 @@ Please enter the interest rate or leave the field empty to calculate it.PlainText - + m_payment2 @@ -2870,7 +2870,7 @@ Please enter the interest rate or leave the field empty to calculate it.PlainText - + m_balloon2 @@ -2890,7 +2890,7 @@ Please enter the interest rate or leave the field empty to calculate it. - + m_durationPage @@ -2901,7 +2901,7 @@ Please enter the interest rate or leave the field empty to calculate it. unnamed - + TextLabel15_2 @@ -2909,7 +2909,7 @@ Please enter the interest rate or leave the field empty to calculate it. Please enter the term of this loan or leave the field empty to calculate it. The term is the time that is required to fully repay the loan. This time might be different from the time your loan contract is signed for. - + WordBreak|AlignTop @@ -2923,22 +2923,22 @@ Please enter the term of this loan or leave the field empty to calculate it. The Expanding - + 16 54 - + - layout43 + tqlayout43 unnamed - + TextLabel2_3 @@ -2966,7 +2966,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The - + Frame3_2_2 @@ -2986,62 +2986,62 @@ Please enter the term of this loan or leave the field empty to calculate it. The 6 - + TextLabel6_3_2 Loan amount: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8_3_2 Interest rate: - + AlignVCenter|AlignRight - + TextLabel9_2_2 Term: - + AlignVCenter|AlignRight - + TextLabel10_2_2 Principal + Interest: - + AlignVCenter|AlignRight - + TextLabel11_3_2 Final amortization payment - + AlignVCenter|AlignRight - + m_loanAmount3 @@ -3057,7 +3057,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The PlainText - + m_interestRate3 @@ -3073,7 +3073,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The PlainText - + m_duration3 @@ -3089,7 +3089,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The PlainText - + m_payment3 @@ -3105,7 +3105,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The PlainText - + m_balloon3 @@ -3125,7 +3125,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The - + m_paymentPage @@ -3142,7 +3142,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The 6 - + TextLabel16_2 @@ -3150,7 +3150,7 @@ Please enter the term of this loan or leave the field empty to calculate it. The Please enter the amount you pay for principal and interest or leave the field empty to calculate it. - + WordBreak|AlignTop @@ -3164,14 +3164,14 @@ Please enter the amount you pay for principal and interest or leave the field em Expanding - + 0 16 - + Layout36_2 @@ -3185,7 +3185,7 @@ Please enter the amount you pay for principal and interest or leave the field em 6 - + TextLabel1_4_2 @@ -3200,7 +3200,7 @@ Please enter the amount you pay for principal and interest or leave the field em - + Frame3_2_2_2 @@ -3220,62 +3220,62 @@ Please enter the amount you pay for principal and interest or leave the field em 6 - + TextLabel6_3_2_2 Loan amount: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8_3_2_2 Interest rate: - + AlignVCenter|AlignRight - + TextLabel9_2_2_2 Term: - + AlignVCenter|AlignRight - + TextLabel10_2_2_2 Principal + Interest: - + AlignVCenter|AlignRight - + TextLabel11_3_2_2 Final amortization payment - + AlignVCenter|AlignRight - + m_loanAmount4 @@ -3291,7 +3291,7 @@ Please enter the amount you pay for principal and interest or leave the field em PlainText - + m_interestRate4 @@ -3307,7 +3307,7 @@ Please enter the amount you pay for principal and interest or leave the field em PlainText - + m_duration4 @@ -3323,7 +3323,7 @@ Please enter the amount you pay for principal and interest or leave the field em PlainText - + m_payment4 @@ -3339,7 +3339,7 @@ Please enter the amount you pay for principal and interest or leave the field em PlainText - + m_balloon4 @@ -3359,7 +3359,7 @@ Please enter the amount you pay for principal and interest or leave the field em - + m_finalPaymentPage @@ -3376,7 +3376,7 @@ Please enter the amount you pay for principal and interest or leave the field em 6 - + TextLabel17_2 @@ -3384,7 +3384,7 @@ Please enter the amount you pay for principal and interest or leave the field em Please enter the amount of a final amortization payment or leave the field empty to calculate it. - + WordBreak|AlignTop @@ -3398,14 +3398,14 @@ Please enter the amount of a final amortization payment or leave the field empty Expanding - + 0 16 - + Layout44 @@ -3419,7 +3419,7 @@ Please enter the amount of a final amortization payment or leave the field empty 6 - + TextLabel1_4_2_2 @@ -3434,7 +3434,7 @@ Please enter the amount of a final amortization payment or leave the field empty - + Frame3_2_2_2_2 @@ -3454,62 +3454,62 @@ Please enter the amount of a final amortization payment or leave the field empty 6 - + TextLabel6_3_2_2_2 Loan amount: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8_3_2_2_2 Interest rate: - + AlignVCenter|AlignRight - + TextLabel9_2_2_2_2 Term: - + AlignVCenter|AlignRight - + TextLabel10_2_2_2_2 Principal + Interest: - + AlignVCenter|AlignRight - + TextLabel11_3_2_2_2 Final amortization payment - + AlignVCenter|AlignRight - + m_loanAmount5 @@ -3525,7 +3525,7 @@ Please enter the amount of a final amortization payment or leave the field empty PlainText - + m_interestRate5 @@ -3541,7 +3541,7 @@ Please enter the amount of a final amortization payment or leave the field empty PlainText - + m_duration5 @@ -3557,7 +3557,7 @@ Please enter the amount of a final amortization payment or leave the field empty PlainText - + m_payment5 @@ -3573,7 +3573,7 @@ Please enter the amount of a final amortization payment or leave the field empty PlainText - + m_balloon5 @@ -3593,7 +3593,7 @@ Please enter the amount of a final amortization payment or leave the field empty - + m_calculationOverviewPage @@ -3610,7 +3610,7 @@ Please enter the amount of a final amortization payment or leave the field empty 6 - + TextLabel18_2 @@ -3618,7 +3618,7 @@ Please enter the amount of a final amortization payment or leave the field empty KMyMoney has calculated the loan as shown in the overview below. You can accept these values by selecting "Next" or change them by choosing "Back" to return to the input field for the information you want to change. - + WordBreak|AlignTop @@ -3632,14 +3632,14 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept Expanding - + 0 22 - + Frame3_2_2_2_2_2 @@ -3659,62 +3659,62 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept 6 - + TextLabel6_3_2_2_2_2 Loan amount: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8_3_2_2_2_2 Interest rate: - + AlignVCenter|AlignRight - + TextLabel9_2_2_2_2_2 Term: - + AlignVCenter|AlignRight - + TextLabel10_2_2_2_2_2 Principal + Interest: - + AlignVCenter|AlignRight - + TextLabel11_3_2_2_2_2 Final amortization payment - + AlignVCenter|AlignRight - + m_loanAmount6 @@ -3730,7 +3730,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept PlainText - + m_interestRate6 @@ -3746,7 +3746,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept PlainText - + m_duration6 @@ -3762,7 +3762,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept PlainText - + m_payment6 @@ -3778,7 +3778,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept PlainText - + m_balloon6 @@ -3798,7 +3798,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept - + m_newPaymentsPage @@ -3815,7 +3815,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept 6 - + TextLabel19_2 @@ -3823,7 +3823,7 @@ KMyMoney has calculated the loan as shown in the overview below. You can accept In the following steps, KMyMoney supports you in setting up categories and schedules for your loan payments. - + WordBreak|AlignTop @@ -3837,14 +3837,14 @@ In the following steps, KMyMoney supports you in setting up categories and sched Expanding - + 0 14 - + Layout31_2 @@ -3868,14 +3868,14 @@ In the following steps, KMyMoney supports you in setting up categories and sched Expanding - + 136 0 - + Layout30_2 @@ -3889,7 +3889,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched 6 - + TextLabel19_3 @@ -3899,11 +3899,11 @@ In the following steps, KMyMoney supports you in setting up categories and sched 1. General Information - + AlignTop - + TextLabel19_4 @@ -3915,7 +3915,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched 2. Calculate Loan - + TextLabel19_5 @@ -3937,7 +3937,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched Expanding - + 0 18 @@ -3956,7 +3956,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched Expanding - + 135 0 @@ -3975,7 +3975,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched Expanding - + 0 18 @@ -3984,7 +3984,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched - + m_interestCategoryPage @@ -4001,7 +4001,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched 6 - + TextLabel20_2 @@ -4009,7 +4009,7 @@ In the following steps, KMyMoney supports you in setting up categories and sched Please select the category you want to assign the interest payments to or create a new category. - + WordBreak|AlignTop @@ -4023,7 +4023,7 @@ Please select the category you want to assign the interest payments to or create Expanding - + 0 38 @@ -4035,7 +4035,7 @@ Please select the category you want to assign the interest payments to or create m_interestAccountEdit - + Layout29 @@ -4059,7 +4059,7 @@ Please select the category you want to assign the interest payments to or create Expanding - + 264 0 @@ -4086,7 +4086,7 @@ Please select the category you want to assign the interest payments to or create Expanding - + 0 22 @@ -4095,7 +4095,7 @@ Please select the category you want to assign the interest payments to or create - + m_additionalFeesPage @@ -4112,7 +4112,7 @@ Please select the category you want to assign the interest payments to or create 6 - + TextLabel21_2 @@ -4120,7 +4120,7 @@ Please select the category you want to assign the interest payments to or create If your regular payment contains any additional fees, click on the button "Additional fees" to enter them. - + WordBreak|AlignTop @@ -4134,14 +4134,14 @@ If your regular payment contains any additional fees, click on the button "Addit Expanding - + 0 16 - + Frame9 @@ -4161,18 +4161,18 @@ If your regular payment contains any additional fees, click on the button "Addit 6 - + TextLabel21_1_3 = periodical payment: - + AlignVCenter|AlignRight - + m_periodicPayment @@ -4187,11 +4187,11 @@ If your regular payment contains any additional fees, click on the button "Addit PlainText - + AlignVCenter|AlignRight - + m_additionalCost @@ -4206,11 +4206,11 @@ If your regular payment contains any additional fees, click on the button "Addit PlainText - + AlignVCenter|AlignRight - + Layout63 @@ -4224,14 +4224,14 @@ If your regular payment contains any additional fees, click on the button "Addit 6 - + TextLabel21_1_2 + - + AlignVCenter|AlignRight @@ -4245,7 +4245,7 @@ If your regular payment contains any additional fees, click on the button "Addit - + m_basePayment @@ -4260,18 +4260,18 @@ If your regular payment contains any additional fees, click on the button "Addit PlainText - + AlignVCenter|AlignRight - + TextLabel21_1 Principal + Interest: - + AlignVCenter|AlignRight @@ -4285,7 +4285,7 @@ If your regular payment contains any additional fees, click on the button "Addit Expanding - + 40 20 @@ -4302,7 +4302,7 @@ If your regular payment contains any additional fees, click on the button "Addit Expanding - + 40 20 @@ -4321,21 +4321,21 @@ If your regular payment contains any additional fees, click on the button "Addit Expanding - + 0 16 - + TextLabel21_2_2 If no additional fees are included in your periodical payment or you have entered all such fees, then click on "Next". - + WordBreak|AlignTop @@ -4349,7 +4349,7 @@ If your regular payment contains any additional fees, click on the button "Addit Expanding - + 0 16 @@ -4358,7 +4358,7 @@ If your regular payment contains any additional fees, click on the button "Addit - + m_schedulePage @@ -4375,7 +4375,7 @@ If your regular payment contains any additional fees, click on the button "Addit 6 - + TextLabel22_2 @@ -4383,7 +4383,7 @@ If your regular payment contains any additional fees, click on the button "Addit KMyMoney will create a schedule for this payment and reminds you whenever a payment must be made.<p> If you selected to record all payments this date has already been supplied. If you selected to record only this years payments, then the <b>First payment due date</b> is the date of the first payment made in this year. - + WordBreak|AlignTop @@ -4397,14 +4397,14 @@ If you selected to record all payments this date has already been supplied. If y Expanding - + 0 23 - + Layout49 @@ -4428,7 +4428,7 @@ If you selected to record all payments this date has already been supplied. If y m_nextDueDateEdit - + m_dueLabel @@ -4436,14 +4436,14 @@ If you selected to record all payments this date has already been supplied. If y First payment due on: - + TextLabel2_5 Make payment from/to: - + AlignTop @@ -4459,7 +4459,7 @@ If you selected to record all payments this date has already been supplied. If y Expanding - + 0 24 @@ -4468,7 +4468,7 @@ If you selected to record all payments this date has already been supplied. If y - + m_summaryEditPage @@ -4485,7 +4485,7 @@ If you selected to record all payments this date has already been supplied. If y 6 - + TextLabel10_4 @@ -4493,7 +4493,7 @@ If you selected to record all payments this date has already been supplied. If y KMyMoney has calculated the loan as shown below. If you want to accept these values use the "Finish" button to update your account, otherwise use the "Back" button to modify your settings. - + WordBreak|AlignTop @@ -4507,14 +4507,14 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val Expanding - + 0 23 - + Frame3_2_2_2_2_2_2 @@ -4534,73 +4534,73 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val 6 - + TextLabel6_3_2_2_2_2_2 Principal + Interest: - + WordBreak|AlignVCenter|AlignRight - + TextLabel8_3_2_2_2_2_2 Additional fees: - + AlignVCenter|AlignRight - + TextLabel9_2_2_2_2_2_2 Total payment: - + AlignVCenter|AlignRight - + TextLabel10_2_2_2_2_2_2 Interest rate: - + AlignVCenter|AlignRight - + TextLabel11_3_2_2_2_2_2 Valid from: - + AlignVCenter|AlignRight - + TextLabel11_3_2_2_2_2_2_2 Affected payments: - + AlignVCenter|AlignRight - + m_payment7 @@ -4616,7 +4616,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val PlainText - + m_additionalFees7 @@ -4632,7 +4632,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val PlainText - + m_totalPayment7 @@ -4648,7 +4648,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val PlainText - + m_interestRate7 @@ -4664,7 +4664,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val PlainText - + m_startDateChanges @@ -4680,7 +4680,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val PlainText - + m_affectedPayments @@ -4700,7 +4700,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val - + m_assetAccountPage @@ -4711,7 +4711,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val unnamed - + TextLabel10_4_2 @@ -4719,7 +4719,7 @@ KMyMoney has calculated the loan as shown below. If you want to accept these val If this loan is for an asset, such as a car or a house, you can create the asset account now. An asset account represents the total value of an asset. The money from this loan will be transfered into the asset account you create or select. If this loan is a 'consumer loan' (money to use however you want), you can use a checking account instead. - + WordBreak|AlignTop @@ -4733,14 +4733,14 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a Expanding - + 20 21 - + m_dontCreatePayoutCheckBox @@ -4748,9 +4748,9 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a Don't create payout transaction - + - layout124 + tqlayout124 @@ -4761,9 +4761,9 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a m_assetAccountEdit - + - layout123 + tqlayout123 @@ -4779,7 +4779,7 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a Expanding - + 466 20 @@ -4804,15 +4804,15 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a - + - layout170 + tqlayout170 unnamed - + textLabel2 @@ -4837,7 +4837,7 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a Expanding - + 20 16 @@ -4846,7 +4846,7 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a - + m_summaryPage @@ -4863,7 +4863,7 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a 6 - + TextLabel22_2_2 @@ -4871,7 +4871,7 @@ If this loan is a 'consumer loan' (money to use however you want), you can use a This page summarizes the data you entered. If you need to modify anything, please use the "Back" button to go to respective page. Otherwise use the "Finish" button to create the account. - + WordBreak|AlignTop @@ -4885,14 +4885,14 @@ This page summarizes the data you entered. If you need to modify anything, pleas Expanding - + 0 16 - + Layout61 @@ -4906,7 +4906,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 6 - + Layout60 @@ -4920,7 +4920,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 6 - + GroupBox3 @@ -4937,7 +4937,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 1 - + Layout52 @@ -4951,18 +4951,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas 1 - + TextLabel5_3 Payee: - + AlignVCenter|AlignRight - + m_summaryLoanType @@ -4978,7 +4978,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + m_summaryPayee @@ -4994,18 +4994,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel4_4 First payment: - + AlignVCenter|AlignRight - + m_summaryFirstPayment @@ -5021,14 +5021,14 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel3_5 Amount is: - + AlignVCenter|AlignRight @@ -5036,7 +5036,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas - + GroupBox2 @@ -5053,7 +5053,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 1 - + Layout57 @@ -5067,7 +5067,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 1 - + m_summaryTotalPeriodicPayment @@ -5083,7 +5083,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + m_summaryPaymentAccount @@ -5099,7 +5099,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + m_summaryAdditionalFees @@ -5115,51 +5115,51 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel15 Periodic Payment: - + AlignVCenter|AlignRight - + TextLabel14 Additional Fees: - + AlignVCenter|AlignRight - + TextLabel13 Interest category: - + AlignVCenter|AlignRight - + TextLabel17 Payment from: - + AlignVCenter|AlignRight - + m_summaryInterestCategory @@ -5175,7 +5175,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + m_summaryNextPayment @@ -5191,14 +5191,14 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel16_3 Next due date: - + AlignVCenter|AlignRight @@ -5208,7 +5208,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas - + GroupBox1 @@ -5225,7 +5225,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 1 - + Layout59 @@ -5239,7 +5239,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas 1 - + m_summaryInterestRate @@ -5255,18 +5255,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel10_3 Term: - + AlignVCenter|AlignRight - + m_summaryPeriodicPayment @@ -5282,18 +5282,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel9_3 Interest rate: - + AlignVCenter|AlignRight - + m_summaryPaymentFrequency @@ -5309,18 +5309,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel12 Final Payment: - + AlignVCenter|AlignRight - + m_summaryTerm @@ -5336,18 +5336,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel6_4 Interest is due: - + AlignVCenter|AlignRight - + m_summaryAmount @@ -5363,18 +5363,18 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel11_4 Principal + Interest: - + AlignVCenter|AlignRight - + m_summaryBalloonPayment @@ -5390,29 +5390,29 @@ This page summarizes the data you entered. If you need to modify anything, pleas PlainText - + TextLabel8_4 Loan amount: - + AlignVCenter|AlignRight - + TextLabel7 Payment frequency: - + AlignVCenter|AlignRight - + m_summaryInterestDue @@ -5444,7 +5444,7 @@ This page summarizes the data you entered. If you need to modify anything, pleas Expanding - + 0 16 @@ -5493,5 +5493,10 @@ This page summarizes the data you entered. If you need to modify anything, pleas 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000041d49444154388d8d95c18b1c4514c67fbb29e5b54ea05b26da1d36b08d09a6c508138cb8c13d647141163de49043bca9f1628eb9294810f24f88c15b728b07617358888785d980427290b4a8d00b19a8821da8228cf42316ac87eed9247ac95c9aeaeef9eaabdffb5ebf85f178ccfcf7f5b79fec07a7280a08a008f25ceb7c29e5da573716e65a0be3f198ef6f5ededff9b9e1b34faf90882092a1ea21428b9220ffbf46054055b19386ba6970ae6665b5e0d2c5eb0b066067bbe1f21757c88f5504eff0c192189081303a5582b16854fccce2fe041f00cdd0a8103b874556405476b62d972ec2c2b90ff3fd8df5cb946549d80b34aea15ccaa94625450e2d0e558b460b7371a734b5e027251a155545678ab62d7eea90b4c504078908c107acb354cb251b1f8f08b1c18631aabbb4d18211404804f22545863561d2f060fb34aa8a18d0086204e72c46a32292e1a796f278c1da7a859d8da9a737506db04d0a24103d8949480b214d3bbee952a05c1d536f9d2684160c744f048311543d459eb1b65ee1754cedae13a64abd5d6127053c9d0281f22d4f75c6a2118a5c09272d7ab740638bf4ef2dd2174032d0d8d04c6fe19c32bedd8bc65e342aa3f785e2784bfd6bc1bd9db24b05505616a4edd67d5a8c1801a03a9962754c504bf34b8986acfb9be91cac7d54315a15541b36b134f74bd2dc53940115a5381e087bc25c6f71be831a8baa234cc1ee3eeb74ed83116beb2b8849d108a3730e8ce27e2bfb82419a7b407ac7c222fd0e6280a8078ce64e47ef54ac9d5be9aaae0162e0de568a44a18d3df90845d919c4f01463406340a44f40efb43a99b371618488e2670d1a2d7ee6f1d3be39342104e937ed85fb86599c33e9ee0be9a004946259d8b858909880d59aa00daa0d3280b5f39e34074c4b3a5434029a76a9e9f5cc0163b5c80024158a1cfc4cb1d3061d5834066cb0a403c008599a70f6bc27b8d03106ea3ae91987278c5b143b015547224ab5e24185cd9b81665273e7b6e7cecd82ddbf8098002de94049737bc09828cf3036f31c3735c8b0e98eb704672f348c7f7c93cd1fb2ae905119ff54e0dff3542b0e9dd983dcea2cc5eea6cf303e74ec687af5c41b6fa38f5e203c7ec8e1238ef85831a214afef21060ea781ec68247b65c6916353cc8b73d1ae79354606af2a930709aa118da1636c274dd7e3774b884a79aa6b5711a538d33cf9c01c1c9b83bc6a1f55c91ccb23b05b1deb43a7decdaffefd2862f61366aa8449c69e33642f012f2bb208fa98eeda1f3346f076c8eeef19475e9be115423364f78f84105a8643d34d90cfbfdcd8cf872589a45dc7f54cf3134a36f4e495c23f9da8db15bccb708d4014f2ca512cb5d4f7c13e84300d5cff6eb39b202bab053bdb9674f0648609427d0f8402ddeac30f4fcd3ced3efc3b422d406c09b340bedc1571e1bfc3d44dc281634c5fe5e758e7395cfbe6d6c130fd17d92372d277c159b70000000049454e44ae426082 - + + kmymoney/kmymoneydateinput.h + kmymoney/kmymoneyedit.h + kmymoney/kmymoneycategory.h + + diff --git a/kmymoney2/dialogs/konlinequoteconfigurationdecl.ui b/kmymoney2/dialogs/konlinequoteconfigurationdecl.ui index 0ca2d14..748d343 100644 --- a/kmymoney2/dialogs/konlinequoteconfigurationdecl.ui +++ b/kmymoney2/dialogs/konlinequoteconfigurationdecl.ui @@ -1,6 +1,6 @@ kOnlineQuoteConfigurationDecl - + kOnlineQuoteConfigurationDecl @@ -18,7 +18,7 @@ true - + Layout1 @@ -40,7 +40,7 @@ 6 - + buttonHelp @@ -64,14 +64,14 @@ Expanding - + 20 20 - + buttonOk @@ -88,7 +88,7 @@ true - + buttonCancel @@ -104,7 +104,7 @@ - + textLabel2 @@ -120,7 +120,7 @@ Perl Location: - + textLabel2_2 @@ -195,5 +195,5 @@ reject() - + diff --git a/kmymoney2/dialogs/konlinequoteconfigurationdlg.cpp b/kmymoney2/dialogs/konlinequoteconfigurationdlg.cpp index 8503d5a..d479c81 100644 --- a/kmymoney2/dialogs/konlinequoteconfigurationdlg.cpp +++ b/kmymoney2/dialogs/konlinequoteconfigurationdlg.cpp @@ -18,9 +18,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -38,7 +38,7 @@ #include "konlinequoteconfigurationdlg.h" -KOnlineQuoteConfigurationDlg::KOnlineQuoteConfigurationDlg(QWidget *parent) : kOnlineQuoteConfigurationDecl(parent) +KOnlineQuoteConfigurationDlg::KOnlineQuoteConfigurationDlg(TQWidget *tqparent) : kOnlineQuoteConfigurationDecl(tqparent) { } diff --git a/kmymoney2/dialogs/konlinequoteconfigurationdlg.h b/kmymoney2/dialogs/konlinequoteconfigurationdlg.h index f6ea139..7a9eb65 100644 --- a/kmymoney2/dialogs/konlinequoteconfigurationdlg.h +++ b/kmymoney2/dialogs/konlinequoteconfigurationdlg.h @@ -15,13 +15,13 @@ * * ***************************************************************************/ -#ifndef KONLINEQUOTECONFIGURATIONDIALOG_H -#define KONLINEQUOTECONFIGURATIONDIALOG_H +#ifndef KONLINETQUOTECONFIGURATIONDIALOG_H +#define KONLINETQUOTECONFIGURATIONDIALOG_H // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -40,8 +40,9 @@ class KOnlineQuoteConfigurationDlg : public kOnlineQuoteConfigurationDecl { Q_OBJECT + TQ_OBJECT public: - KOnlineQuoteConfigurationDlg(QWidget *parent); + KOnlineQuoteConfigurationDlg(TQWidget *tqparent); ~KOnlineQuoteConfigurationDlg(); }; diff --git a/kmymoney2/dialogs/kpayeereassigndlg.cpp b/kmymoney2/dialogs/kpayeereassigndlg.cpp index 0ed8a5a..dc03518 100644 --- a/kmymoney2/dialogs/kpayeereassigndlg.cpp +++ b/kmymoney2/dialogs/kpayeereassigndlg.cpp @@ -36,12 +36,12 @@ #include #include -KPayeeReassignDlg::KPayeeReassignDlg( QWidget* parent, const char* name) : - KPayeeReassignDlgDecl( parent, name) +KPayeeReassignDlg::KPayeeReassignDlg( TQWidget* tqparent, const char* name) : + KPayeeReassignDlgDecl( tqparent, name) { buttonOk->setGuiItem(KStdGuiItem::ok()); buttonCancel->setGuiItem(KStdGuiItem::cancel()); - kMandatoryFieldGroup* mandatory = new kMandatoryFieldGroup(this); + kMandatoryFieldGroup* mandatory = new kMandatoryFieldGroup(TQT_TQOBJECT(this)); mandatory->add(payeeCombo); mandatory->setOkButton(buttonOk); } @@ -50,16 +50,16 @@ KPayeeReassignDlg::~KPayeeReassignDlg() { } -QString KPayeeReassignDlg::show(const QValueList& payeeslist) +TQString KPayeeReassignDlg::show(const TQValueList& payeeslist) { if (payeeslist.isEmpty()) - return QString(); // no payee available? nothing can be selected... + return TQString(); // no payee available? nothing can be selected... payeeCombo->loadPayees(payeeslist); // execute dialog and if aborted, return empty string - if (this->exec() == QDialog::Rejected) - return QString(); + if (this->exec() == TQDialog::Rejected) + return TQString(); // otherwise return index of selected payee return payeeCombo->selectedItem(); diff --git a/kmymoney2/dialogs/kpayeereassigndlg.h b/kmymoney2/dialogs/kpayeereassigndlg.h index 3edab86..f0f21ac 100644 --- a/kmymoney2/dialogs/kpayeereassigndlg.h +++ b/kmymoney2/dialogs/kpayeereassigndlg.h @@ -23,8 +23,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -42,9 +42,10 @@ class KPayeeReassignDlg : public KPayeeReassignDlgDecl { Q_OBJECT + TQ_OBJECT public: /** Default constructor */ - KPayeeReassignDlg( QWidget* parent = 0, const char* name = 0); + KPayeeReassignDlg( TQWidget* tqparent = 0, const char* name = 0); /** Destructor */ ~KPayeeReassignDlg(); @@ -53,12 +54,12 @@ public: * This function sets up the dialog, lets the user select a payee and returns * the id of the selected payee in the payeeslist. * - * @param payeeslist reference to QValueList of MyMoneyPayee objects to be contained in the list + * @param payeeslist reference to TQValueList of MyMoneyPayee objects to be contained in the list * - * @return Returns the id of the selected payee in the list or QString() if - * the dialog was aborted. QString() is also returned if the payeeslist is empty. + * @return Returns the id of the selected payee in the list or TQString() if + * the dialog was aborted. TQString() is also returned if the payeeslist is empty. */ - QString show(const QValueList& payeeslist); + TQString show(const TQValueList& payeeslist); /** * Returns true, if the names of the payees to be deleted should be copied diff --git a/kmymoney2/dialogs/kpayeereassigndlgdecl.ui b/kmymoney2/dialogs/kpayeereassigndlgdecl.ui index a968709..1f85b76 100644 --- a/kmymoney2/dialogs/kpayeereassigndlgdecl.ui +++ b/kmymoney2/dialogs/kpayeereassigndlgdecl.ui @@ -1,6 +1,6 @@ KPayeeReassignDlgDecl - + KPayeeReassignDlgDecl @@ -25,11 +25,11 @@ unnamed - + textLabel1 - + 300 0 @@ -38,7 +38,7 @@ The transactions associated with the selected payees need to be re-assigned to a different payee before the selected payees can be deleted. Please select a payee from the list below. - + WordBreak|AlignJustify|AlignTop @@ -52,14 +52,14 @@ Fixed - + 20 16 - + textLabel2 @@ -82,14 +82,14 @@ Expanding - + 20 20 - + m_copyToMatchList @@ -114,9 +114,9 @@ Horizontal - + - layout2 + tqlayout2 @@ -132,7 +132,7 @@ Expanding - + 305 20 @@ -182,5 +182,5 @@ reject() - + diff --git a/kmymoney2/dialogs/kplugindlg.ui b/kmymoney2/dialogs/kplugindlg.ui index 33a6f88..19d7f03 100644 --- a/kmymoney2/dialogs/kplugindlg.ui +++ b/kmymoney2/dialogs/kplugindlg.ui @@ -1,6 +1,6 @@ KPluginDlg - + KPluginDlg @@ -36,7 +36,7 @@ - Status + tqStatus true @@ -82,7 +82,7 @@ Expanding - + 180 20 @@ -150,5 +150,5 @@ reject() - + diff --git a/kmymoney2/dialogs/krecentfileitem.cpp b/kmymoney2/dialogs/krecentfileitem.cpp index 679078d..dfcb0b8 100644 --- a/kmymoney2/dialogs/krecentfileitem.cpp +++ b/kmymoney2/dialogs/krecentfileitem.cpp @@ -23,10 +23,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -37,12 +37,12 @@ #include "krecentfileitem.h" -KRecentFileItem::KRecentFileItem(const QString& url, QIconView* parent, const QString& text, const QPixmap& icon) - : QIconViewItem(parent, text, icon), +KRecentFileItem::KRecentFileItem(const TQString& url, TQIconView* tqparent, const TQString& text, const TQPixmap& icon) + : TQIconViewItem(tqparent, text, icon), m_url(url), - m_parent(parent) + m_parent(tqparent) { - QToolTip::add(parent, rect(), url); + TQToolTip::add(tqparent, rect(), url); // avoid moving this item around setDragEnabled(false); } @@ -53,10 +53,10 @@ KRecentFileItem::~KRecentFileItem() bool KRecentFileItem::move( int x, int y ) { - QRect r = rect(); - QToolTip::remove(m_parent, rect()); - r.moveTopLeft(QPoint(x,y)); - QToolTip::add(m_parent, r, m_url); - return QIconViewItem::move(x,y); + TQRect r = rect(); + TQToolTip::remove(m_parent, rect()); + r.moveTopLeft(TQPoint(x,y)); + TQToolTip::add(m_parent, r, m_url); + return TQIconViewItem::move(x,y); } diff --git a/kmymoney2/dialogs/krecentfileitem.h b/kmymoney2/dialogs/krecentfileitem.h index bb88cba..1859c96 100644 --- a/kmymoney2/dialogs/krecentfileitem.h +++ b/kmymoney2/dialogs/krecentfileitem.h @@ -24,8 +24,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -40,17 +40,17 @@ * @author Michael Edwardes */ -class KRecentFileItem : public QIconViewItem { +class KRecentFileItem : public TQIconViewItem { public: - KRecentFileItem(const QString& url, QIconView* parent, const QString& text, const QPixmap& icon); + KRecentFileItem(const TQString& url, TQIconView* tqparent, const TQString& text, const TQPixmap& icon); ~KRecentFileItem(); - QString fileURL(void) const { return m_url; } + TQString fileURL(void) const { return m_url; } bool move( int x, int y ); private: - QString m_url; - QWidget* m_parent; + TQString m_url; + TQWidget* m_parent; }; #endif diff --git a/kmymoney2/dialogs/kreconciledlg.cpp b/kmymoney2/dialogs/kreconciledlg.cpp index 75e7b48..f7911b2 100644 --- a/kmymoney2/dialogs/kreconciledlg.cpp +++ b/kmymoney2/dialogs/kreconciledlg.cpp @@ -17,24 +17,20 @@ #include #include #include -#if QT_VERSION > 300 #include -#else -#include -#endif #include "kreconciledlg.h" KReconcileDlg::KReconcileDlg(const MyMoneyMoney /* previousBal */, const MyMoneyMoney /* endingBal */, - const QDate /* endingDate */, MyMoneyAccount* /*accountIndex */, - const MyMoneyFile* /* file */, QWidget *parent, const char *name) - : KReconcileDlgDecl(parent,name,true) + const TQDate /* endingDate */, MyMoneyAccount* /*accountIndex */, + const MyMoneyFile* /* file */, TQWidget *tqparent, const char *name) + : KReconcileDlgDecl(tqparent,name,true) { /* m_balanced = false; - m_debitsQList.setAutoDelete(false); - m_creditsQList.setAutoDelete(false); + m_debitsTQList.setAutoDelete(false); + m_creditsTQList.setAutoDelete(false); m_reconciledTransactions.setAutoDelete(false); m_file = file; @@ -47,11 +43,11 @@ KReconcileDlg::KReconcileDlg(const MyMoneyMoney /* previousBal */, const MyMoney m_endingDate = endingDate; - totalCreditsLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - totalDebitsLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - previousLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - endingLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - differenceLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + totalCreditsLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + totalDebitsLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + previousLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + endingLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + differenceLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); debitListView->setRootIsDecorated(false); @@ -63,7 +59,7 @@ KReconcileDlg::KReconcileDlg(const MyMoneyMoney /* previousBal */, const MyMoney debitListView->setMultiSelection(true); debitListView->setAllColumnsShowFocus(true); // never show a horizontal scroll bar - debitListView->setHScrollBarMode(QScrollView::AlwaysOff); + debitListView->setHScrollBarMode(TQScrollView::AlwaysOff); creditListView->setRootIsDecorated(false); creditListView->addColumn(i18n("Date")); @@ -74,7 +70,7 @@ KReconcileDlg::KReconcileDlg(const MyMoneyMoney /* previousBal */, const MyMoney creditListView->setMultiSelection(true); creditListView->setAllColumnsShowFocus(true); // never show a horizontal scroll bar - creditListView->setHScrollBarMode(QScrollView::AlwaysOff); + creditListView->setHScrollBarMode(TQScrollView::AlwaysOff); endingLabel->setText(KGlobal::locale()->formatMoney(m_clearedBalance.amount(),"")); @@ -90,11 +86,11 @@ KReconcileDlg::KReconcileDlg(const MyMoneyMoney /* previousBal */, const MyMoney loadLists(); insertTransactions(); - connect(debitListView, SIGNAL(clicked(QListViewItem*, const QPoint&, int)), this, SLOT(slotDebitSelected(QListViewItem*, const QPoint&, int))); - connect(creditListView, SIGNAL(clicked(QListViewItem*, const QPoint&, int)), this, SLOT(slotCreditSelected(QListViewItem*, const QPoint&, int))); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(cancelClicked())); - connect(buttonOk, SIGNAL(clicked()), this, SLOT(finishClicked())); - connect(buttonEdit, SIGNAL(clicked()), this, SLOT(editClicked())); + connect(debitListView, TQT_SIGNAL(clicked(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(slotDebitSelected(TQListViewItem*, const TQPoint&, int))); + connect(creditListView, TQT_SIGNAL(clicked(TQListViewItem*, const TQPoint&, int)), this, TQT_SLOT(slotCreditSelected(TQListViewItem*, const TQPoint&, int))); + connect(buttonCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(cancelClicked())); + connect(buttonOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(finishClicked())); + connect(buttonEdit, TQT_SIGNAL(clicked()), this, TQT_SLOT(editClicked())); doDifference(); */ @@ -108,14 +104,14 @@ void KReconcileDlg::clearReconcile() { /* MyMoneyTransaction *temp_transaction; - for(temp_transaction = m_creditsQList.first();temp_transaction;temp_transaction = m_creditsQList.next()) + for(temp_transaction = m_creditsTQList.first();temp_transaction;temp_transaction = m_creditsTQList.next()) { if(temp_transaction->state() == MyMoneyTransaction::Reconciled) { temp_transaction->setState(MyMoneyTransaction::Unreconciled); } } - for(temp_transaction = m_debitsQList.first();temp_transaction;temp_transaction = m_debitsQList.next()) + for(temp_transaction = m_debitsTQList.first();temp_transaction;temp_transaction = m_debitsTQList.next()) { if(temp_transaction->state() == MyMoneyTransaction::Reconciled) { @@ -129,8 +125,8 @@ void KReconcileDlg::loadLists(void) { /* // Load the internal transaaction lists - m_creditsQList.clear(); - m_debitsQList.clear(); + m_creditsTQList.clear(); + m_debitsTQList.clear(); unsigned int i=0; MyMoneyTransaction *transaction; @@ -141,11 +137,11 @@ void KReconcileDlg::loadLists(void) if (transaction->state()!=MyMoneyTransaction::Reconciled) { if (transaction->type() == MyMoneyTransaction::Debit) { transaction->setIndex(i); - m_debitsQList.append(transaction); + m_debitsTQList.append(transaction); } else { transaction->setIndex(i); - m_creditsQList.append(transaction); + m_creditsTQList.append(transaction); } } } @@ -159,12 +155,12 @@ void KReconcileDlg::insertTransactions(void) creditListView->clear(); debitListView->clear(); - QListIterator it(m_debitsQList); + TQListIterator it(m_debitsTQList); for ( ; it.current(); ++it) { (void) new KReconcileListItem(debitListView, it.current()); } - QListIterator it2(m_creditsQList); + TQListIterator it2(m_creditsTQList); for ( ; it2.current(); ++it2) { (void) new KReconcileListItem(creditListView, it2.current()); } @@ -173,7 +169,7 @@ void KReconcileDlg::insertTransactions(void) */ } -void KReconcileDlg::slotDebitSelected(QListViewItem* /* item */, const QPoint&/*p*/, int/* col*/) +void KReconcileDlg::slotDebitSelected(TQListViewItem* /* item */, const TQPoint&/*p*/, int/* col*/) { /* KReconcileListItem *reconcileItem = (KReconcileListItem*)item; @@ -210,7 +206,7 @@ void KReconcileDlg::slotDebitSelected(QListViewItem* /* item */, const QPoint&/* */ } -void KReconcileDlg::slotCreditSelected(QListViewItem* /* item */, const QPoint&, int) +void KReconcileDlg::slotCreditSelected(TQListViewItem* /* item */, const TQPoint&, int) { /* KReconcileListItem *reconcileItem = (KReconcileListItem*)item; @@ -279,8 +275,8 @@ void KReconcileDlg::updateData(void) // Simply reload the list clearing the status. qDebug("In updateData"); m_reconciledTransactions.clear(); - m_debitsQList.clear(); - m_creditsQList.clear(); + m_debitsTQList.clear(); + m_creditsTQList.clear(); loadLists(); insertTransactions(); @@ -297,12 +293,12 @@ void KReconcileDlg::cancelClicked() */ } -void KReconcileDlg::resetData(const MyMoneyMoney /* previousBal */, const MyMoneyMoney /* endingBal */, const QDate /* endingDate */, MyMoneyAccount* /* accountIndex */, const MyMoneyFile* /* file */) +void KReconcileDlg::resetData(const MyMoneyMoney /* previousBal */, const MyMoneyMoney /* endingBal */, const TQDate /* endingDate */, MyMoneyAccount* /* accountIndex */, const MyMoneyFile* /* file */) { /* m_reconciledTransactions.clear(); - m_debitsQList.clear(); - m_creditsQList.clear(); + m_debitsTQList.clear(); + m_creditsTQList.clear(); m_balanced = false; @@ -317,11 +313,11 @@ void KReconcileDlg::resetData(const MyMoneyMoney /* previousBal */, const MyMone m_endingDate = endingDate; - //totalCreditsLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - //totalDebitsLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - //previousLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - //endingLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); - //differenceLabel->setAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + //totalCreditsLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + //totalDebitsLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + //previousLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + //endingLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); + //differenceLabel->tqsetAlignment(AlignRight | AlignVCenter | ExpandTabs | SingleLine); endingLabel->setText(KGlobal::locale()->formatMoney(m_clearedBalance.amount(),"")); @@ -358,34 +354,34 @@ void KReconcileDlg::reloadLists() if (transaction->state()!=MyMoneyTransaction::Reconciled) { if (transaction->type() == MyMoneyTransaction::Debit) { transaction->setIndex(i); - if(m_debitsQList.find(transaction) < 0) + if(m_debitsTQList.tqfind(transaction) < 0) { - m_debitsQList.append(transaction); + m_debitsTQList.append(transaction); } } else { transaction->setIndex(i); - if(m_creditsQList.find(transaction) < 0) + if(m_creditsTQList.tqfind(transaction) < 0) { - m_creditsQList.append(transaction); + m_creditsTQList.append(transaction); } } } } - QListIterator it(m_debitsQList); + TQListIterator it(m_debitsTQList); for ( ; it.current(); ++it) { bool transactionFound = inTransactions(it.current()); if(transactionFound == false) - m_debitsQList.remove(it.current()); + m_debitsTQList.remove(it.current()); } - QListIterator it2(m_creditsQList); + TQListIterator it2(m_creditsTQList); for ( ; it2.current(); ++it2) { bool transactionFound = inTransactions(it2.current()); if(transactionFound == false) - m_creditsQList.remove(it2.current()); + m_creditsTQList.remove(it2.current()); } */ } @@ -408,7 +404,7 @@ bool KReconcileDlg::inTransactions(MyMoneyTransaction * /*credittrans */) /* Not used (yet?) bool KReconcileDlg::inCredits(MyMoneyTransaction *transaction) { - QListIterator it(m_creditsQList); + TQListIterator it(m_creditsTQList); for ( ; it.current(); ++it) { if(transaction == it.current()) return true; @@ -422,7 +418,7 @@ bool KReconcileDlg::inCredits(MyMoneyTransaction *transaction) /* Not used (yet?) bool KReconcileDlg::inDebits(MyMoneyTransaction *transaction) { - QListIterator it(m_debitsQList); + TQListIterator it(m_debitsTQList); for ( ; it.current(); ++it) { if(transaction == it.current()) return true; @@ -440,7 +436,7 @@ void KReconcileDlg::editClicked() */ } -void KReconcileDlg::resizeEvent(QResizeEvent* /* e */) +void KReconcileDlg::resizeEvent(TQResizeEvent* /* e */) { /* debitListView->setColumnWidth( 2, debitListView->visibleWidth() diff --git a/kmymoney2/dialogs/kreconciledlg.h b/kmymoney2/dialogs/kreconciledlg.h index 9ddb079..214c583 100644 --- a/kmymoney2/dialogs/kreconciledlg.h +++ b/kmymoney2/dialogs/kreconciledlg.h @@ -17,9 +17,9 @@ #ifndef KRECONCILEDLG_H #define KRECONCILEDLG_H -#include +#include #include -#include +#include #include "../mymoney/mymoneyfile.h" #include "../mymoney/mymoneymoney.h" @@ -29,19 +29,20 @@ // This dialog is used for reconciliation. class KReconcileDlg : public KReconcileDlgDecl { Q_OBJECT + TQ_OBJECT public: - KReconcileDlg(const MyMoneyMoney previousBal, const MyMoneyMoney endingBal, const QDate endingDate, MyMoneyAccount *accountIndex, const MyMoneyFile* file, QWidget *parent=0, const char *name=0); + KReconcileDlg(const MyMoneyMoney previousBal, const MyMoneyMoney endingBal, const TQDate endingDate, MyMoneyAccount *accountIndex, const MyMoneyFile* file, TQWidget *tqparent=0, const char *name=0); ~KReconcileDlg(); // void updateData(void); - void resetData(const MyMoneyMoney previousBal, const MyMoneyMoney endingBal, const QDate endingDate, MyMoneyAccount *accountIndex, const MyMoneyFile* file); + void resetData(const MyMoneyMoney previousBal, const MyMoneyMoney endingBal, const TQDate endingDate, MyMoneyAccount *accountIndex, const MyMoneyFile* file); /** No descriptions */ protected: - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); protected slots: - void slotDebitSelected(QListViewItem*, const QPoint&, int); - void slotCreditSelected(QListViewItem*, const QPoint&, int); + void slotDebitSelected(TQListViewItem*, const TQPoint&, int); + void slotCreditSelected(TQListViewItem*, const TQPoint&, int); void finishClicked(); void cancelClicked(); /** No descriptions */ @@ -61,13 +62,13 @@ private: //MyMoneyBank m_bankIndex; MyMoneyAccount *m_accountIndex; - QList m_debitsQList; - QList m_creditsQList; - QList m_reconciledTransactions; + TQList m_debitsTQList; + TQList m_creditsTQList; + TQList m_reconciledTransactions; bool m_balanced; // true when the account is balanced (determined by doDifference) - QDate m_endingDate; + TQDate m_endingDate; void loadLists(void); void insertTransactions(void); diff --git a/kmymoney2/dialogs/kreconciledlgdecl.ui b/kmymoney2/dialogs/kreconciledlgdecl.ui index c75ceed..9ed4dc1 100644 --- a/kmymoney2/dialogs/kreconciledlgdecl.ui +++ b/kmymoney2/dialogs/kreconciledlgdecl.ui @@ -1,6 +1,6 @@ KReconcileDlgDecl - + reconcileDlg @@ -12,7 +12,7 @@ 0 - + 0 0 @@ -34,7 +34,7 @@ 6 - + Layout10 @@ -48,7 +48,7 @@ 6 - + descriptionLabel @@ -63,7 +63,7 @@ a transaction you can return to the register by clicking on the Edit Transaction Your account is balanced when the Difference is Zero. Click on the Finish button to save the reconciled transactions. - + WordBreak|AlignVCenter|AlignLeft @@ -85,7 +85,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Horizontal - + Layout27 @@ -99,11 +99,11 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + Layout25 - + 420 0 @@ -119,7 +119,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + TextLabel1_3 @@ -131,7 +131,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 420 15 @@ -153,7 +153,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 420 100 @@ -162,7 +162,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout26 @@ -176,7 +176,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + TextLabel1_3_2 @@ -188,7 +188,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 0 15 @@ -210,7 +210,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 420 100 @@ -221,7 +221,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout11 @@ -235,7 +235,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + totalDebitsLabel @@ -264,14 +264,14 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Expanding - + 20 0 - + totalCreditsLabel @@ -289,7 +289,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout9 @@ -313,14 +313,14 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Expanding - + 20 0 - + infoGroup @@ -332,7 +332,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 250 120 @@ -351,7 +351,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + Layout8 @@ -365,7 +365,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + TextLabel1_2 @@ -377,7 +377,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 90 0 @@ -386,13 +386,13 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Previous Balance: - + AlignVCenter|AlignRight - + broughtForwardLabel @@ -407,7 +407,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + AlignVCenter|AlignRight @@ -415,7 +415,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout7 @@ -429,7 +429,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + TextLabel1 @@ -441,7 +441,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 90 0 @@ -450,13 +450,13 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Ending Balance: - + AlignVCenter|AlignRight - + previousLabel @@ -468,7 +468,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 0 0 @@ -477,7 +477,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + AlignVCenter|AlignRight @@ -485,7 +485,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout8 @@ -499,7 +499,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + TextLabel2 @@ -511,7 +511,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 90 0 @@ -520,13 +520,13 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Cleared Balance: - + AlignVCenter|AlignRight - + endingLabel @@ -538,7 +538,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 0 0 @@ -547,7 +547,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + AlignVCenter|AlignRight @@ -555,7 +555,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout9 @@ -569,7 +569,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + TextLabel3 @@ -581,7 +581,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + 90 0 @@ -590,13 +590,13 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Difference: - + AlignVCenter|AlignRight - + differenceLabel @@ -611,7 +611,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 0 - + AlignVCenter|AlignRight @@ -623,7 +623,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto - + Layout6 @@ -637,7 +637,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto 6 - + buttonEdit @@ -655,14 +655,14 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto Expanding - + 20 0 - + buttonOk @@ -676,7 +676,7 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto true - + buttonCancel @@ -705,5 +705,5 @@ Your account is balanced when the Difference is Zero. Click on the Finish butto reject() - + diff --git a/kmymoney2/dialogs/kreportconfigurationfilterdlg.cpp b/kmymoney2/dialogs/kreportconfigurationfilterdlg.cpp index 949601d..d904d1a 100644 --- a/kmymoney2/dialogs/kreportconfigurationfilterdlg.cpp +++ b/kmymoney2/dialogs/kreportconfigurationfilterdlg.cpp @@ -28,22 +28,22 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -76,8 +76,8 @@ #include "../widgets/kmymoneyreportconfigtabchartdecl.h" KReportConfigurationFilterDlg::KReportConfigurationFilterDlg( - MyMoneyReport report, QWidget *parent, const char *name) - : KFindTransactionDlg(parent, name), + MyMoneyReport report, TQWidget *tqparent, const char *name) + : KFindTransactionDlg(tqparent, name), m_tab2(0), m_tab3(0), m_tabChart(0), @@ -96,13 +96,13 @@ KReportConfigurationFilterDlg::KReportConfigurationFilterDlg( // // the Ok button is always enabled - disconnect(SIGNAL(selectionEmpty(bool))); + disconnect(TQT_SIGNAL(selectionEmpty(bool))); m_searchButton->setGuiItem( KStdGuiItem::ok() ); m_searchButton->setEnabled(true); // reconnect the close button m_closeButton->disconnect(); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(reject())); + connect(m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); // // Add new tabs @@ -115,10 +115,10 @@ KReportConfigurationFilterDlg::KReportConfigurationFilterDlg( { m_tab2 = new kMyMoneyReportConfigTab2Decl( m_criteriaTab, "kMyMoneyReportConfigTab2" ); m_criteriaTab->insertTab( m_tab2, i18n( "Rows/Columns"), 1 ); - connect(m_tab2->m_comboRows, SIGNAL(highlighted(int)), this, SLOT(slotRowTypeChanged(int))); - connect(m_tab2->m_comboColumns, SIGNAL(activated(int)), this, SLOT(slotColumnTypeChanged(int))); + connect(m_tab2->m_comboRows, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotRowTypeChanged(int))); + connect(m_tab2->m_comboColumns, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotColumnTypeChanged(int))); //control the state of the includeTransfer check - connect(m_categoriesView, SIGNAL(stateChanged()), this, SLOT(slotUpdateCheckTransfers())); + connect(m_categoriesView, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(slotUpdateCheckTransfers())); #ifdef HAVE_KDCHART m_tabChart = new kMyMoneyReportConfigTabChartDecl( m_criteriaTab, "kMyMoneyReportConfigTabChart" ); @@ -139,8 +139,8 @@ KReportConfigurationFilterDlg::KReportConfigurationFilterDlg( m_criteriaTab->showPage( m_tab1 ); m_criteriaTab->setMinimumSize( 500,200 ); - QValueList list = MyMoneyFile::instance()->budgetList(); - QValueList::const_iterator it_b; + TQValueList list = MyMoneyFile::instance()->budgetList(); + TQValueList::const_iterator it_b; for(it_b = list.begin(); it_b != list.end(); ++it_b) { m_budgets.push_back(*it_b); } @@ -201,7 +201,7 @@ void KReportConfigurationFilterDlg::slotSearch(void) if(m_tab2->m_comboBudget->isEnabled()) { m_currentState.setBudget(m_budgets[m_tab2->m_comboBudget->currentItem()].id(), m_initialState.rowType() == MyMoneyReport::eBudgetActual); } else { - m_currentState.setBudget(QString(), false); + m_currentState.setBudget(TQString(), false); } //set moving average days @@ -214,32 +214,32 @@ void KReportConfigurationFilterDlg::slotSearch(void) MyMoneyReport::ERowType rtq[7] = { MyMoneyReport::eCategory, MyMoneyReport::eTopCategory, MyMoneyReport::ePayee, MyMoneyReport::eAccount, MyMoneyReport::eTopAccount, MyMoneyReport::eMonth, MyMoneyReport::eWeek }; m_currentState.setRowType( rtq[m_tab3->m_comboOrganizeBy->currentItem()] ); - unsigned qc = MyMoneyReport::eQCnone; + unsigned qc = MyMoneyReport::eTQCnone; - if (m_currentState.queryColumns() & MyMoneyReport::eQCloan) + if (m_currentState.queryColumns() & MyMoneyReport::eTQCloan) // once a loan report, always a loan report - qc = MyMoneyReport::eQCloan; + qc = MyMoneyReport::eTQCloan; if ( m_tab3->m_checkNumber->isChecked() ) - qc |= MyMoneyReport::eQCnumber; + qc |= MyMoneyReport::eTQCnumber; if ( m_tab3->m_checkPayee->isChecked() ) - qc |= MyMoneyReport::eQCpayee; + qc |= MyMoneyReport::eTQCpayee; if ( m_tab3->m_checkCategory->isChecked() ) - qc |= MyMoneyReport::eQCcategory; + qc |= MyMoneyReport::eTQCcategory; if ( m_tab3->m_checkMemo->isChecked() ) - qc |= MyMoneyReport::eQCmemo; + qc |= MyMoneyReport::eTQCmemo; if ( m_tab3->m_checkAccount->isChecked() ) - qc |= MyMoneyReport::eQCaccount; + qc |= MyMoneyReport::eTQCaccount; if ( m_tab3->m_checkReconciled->isChecked() ) - qc |= MyMoneyReport::eQCreconciled; + qc |= MyMoneyReport::eTQCreconciled; if ( m_tab3->m_checkAction->isChecked() ) - qc |= MyMoneyReport::eQCaction; + qc |= MyMoneyReport::eTQCaction; if ( m_tab3->m_checkShares->isChecked() ) - qc |= MyMoneyReport::eQCshares; + qc |= MyMoneyReport::eTQCshares; if ( m_tab3->m_checkPrice->isChecked() ) - qc |= MyMoneyReport::eQCprice; + qc |= MyMoneyReport::eTQCprice; if( m_tab3->m_checkBalance->isChecked() ) - qc |= MyMoneyReport::eQCbalance; + qc |= MyMoneyReport::eTQCbalance; m_currentState.setQueryColumns(static_cast(qc)); @@ -373,12 +373,12 @@ void KReportConfigurationFilterDlg::slotReset(void) || m_initialState.rowType() == MyMoneyReport::eBudgetActual) { m_tab2->m_comboRows->setEnabled(false); m_tab2->m_budgetFrame->setEnabled(!m_budgets.empty()); - QValueVector::const_iterator it_b; + TQValueVector::const_iterator it_b; int i = 0; for(it_b = m_budgets.begin(); it_b != m_budgets.end(); ++it_b) { m_tab2->m_comboBudget->insertItem((*it_b).name(), i); //set the current selected item - if( (m_initialState.budget() == "Any" && (*it_b).budgetStart().year() == QDate::currentDate().year()) + if( (m_initialState.budget() == "Any" && (*it_b).budgetStart().year() == TQDate::tqcurrentDate().year()) || m_initialState.budget() == (*it_b).id()) m_tab2->m_comboBudget->setCurrentItem(i); i++; @@ -426,16 +426,16 @@ void KReportConfigurationFilterDlg::slotReset(void) } unsigned qc = m_initialState.queryColumns(); - m_tab3->m_checkNumber->setChecked(qc & MyMoneyReport::eQCnumber); - m_tab3->m_checkPayee->setChecked(qc & MyMoneyReport::eQCpayee); - m_tab3->m_checkCategory->setChecked(qc & MyMoneyReport::eQCcategory); - m_tab3->m_checkMemo->setChecked(qc & MyMoneyReport::eQCmemo); - m_tab3->m_checkAccount->setChecked(qc & MyMoneyReport::eQCaccount); - m_tab3->m_checkReconciled->setChecked(qc & MyMoneyReport::eQCreconciled); - m_tab3->m_checkAction->setChecked(qc & MyMoneyReport::eQCaction); - m_tab3->m_checkShares->setChecked(qc & MyMoneyReport::eQCshares); - m_tab3->m_checkPrice->setChecked(qc & MyMoneyReport::eQCprice); - m_tab3->m_checkBalance->setChecked(qc & MyMoneyReport::eQCbalance); + m_tab3->m_checkNumber->setChecked(qc & MyMoneyReport::eTQCnumber); + m_tab3->m_checkPayee->setChecked(qc & MyMoneyReport::eTQCpayee); + m_tab3->m_checkCategory->setChecked(qc & MyMoneyReport::eTQCcategory); + m_tab3->m_checkMemo->setChecked(qc & MyMoneyReport::eTQCmemo); + m_tab3->m_checkAccount->setChecked(qc & MyMoneyReport::eTQCaccount); + m_tab3->m_checkReconciled->setChecked(qc & MyMoneyReport::eTQCreconciled); + m_tab3->m_checkAction->setChecked(qc & MyMoneyReport::eTQCaction); + m_tab3->m_checkShares->setChecked(qc & MyMoneyReport::eTQCshares); + m_tab3->m_checkPrice->setChecked(qc & MyMoneyReport::eTQCprice); + m_tab3->m_checkBalance->setChecked(qc & MyMoneyReport::eTQCbalance); m_tab3->m_checkTax->setChecked( m_initialState.isTax() ); m_tab3->m_checkInvestments->setChecked( m_initialState.isInvestmentsOnly() ); @@ -478,7 +478,7 @@ void KReportConfigurationFilterDlg::slotReset(void) // Text Filter // - QRegExp textfilter; + TQRegExp textfilter; if ( m_initialState.textFilter(textfilter)) { m_textEdit->setText(textfilter.pattern()); @@ -503,7 +503,7 @@ void KReportConfigurationFilterDlg::slotReset(void) // Number Filter // - QString nrFrom, nrTo; + TQString nrFrom, nrTo; if ( m_initialState.numberFilter(nrFrom, nrTo) ) { if ( nrFrom == nrTo ) @@ -512,8 +512,8 @@ void KReportConfigurationFilterDlg::slotReset(void) m_nrFromEdit->setEnabled(false); m_nrToEdit->setEnabled(false); m_nrEdit->setText(nrFrom); - m_nrFromEdit->setText(QString()); - m_nrToEdit->setText(QString()); + m_nrFromEdit->setText(TQString()); + m_nrToEdit->setText(TQString()); m_nrButton->setChecked(true); m_nrRangeButton->setChecked(false); } @@ -522,7 +522,7 @@ void KReportConfigurationFilterDlg::slotReset(void) m_nrEdit->setEnabled(false); m_nrFromEdit->setEnabled(true); m_nrToEdit->setEnabled(false); - m_nrEdit->setText(QString()); + m_nrEdit->setText(TQString()); m_nrFromEdit->setText(nrFrom); m_nrToEdit->setText(nrTo); m_nrButton->setChecked(false); @@ -534,9 +534,9 @@ void KReportConfigurationFilterDlg::slotReset(void) m_nrEdit->setEnabled(true); m_nrFromEdit->setEnabled(false); m_nrToEdit->setEnabled(false); - m_nrEdit->setText(QString()); - m_nrFromEdit->setText(QString()); - m_nrToEdit->setText(QString()); + m_nrEdit->setText(TQString()); + m_nrFromEdit->setText(TQString()); + m_nrToEdit->setText(TQString()); m_nrButton->setChecked(true); m_nrRangeButton->setChecked(false); } @@ -553,9 +553,9 @@ void KReportConfigurationFilterDlg::slotReset(void) m_amountEdit->setEnabled(true); m_amountFromEdit->setEnabled(false); m_amountToEdit->setEnabled(false); - m_amountEdit->loadText(QString::number(from.toDouble())); - m_amountFromEdit->loadText(QString()); - m_amountToEdit->loadText(QString()); + m_amountEdit->loadText(TQString::number(from.toDouble())); + m_amountFromEdit->loadText(TQString()); + m_amountToEdit->loadText(TQString()); m_amountButton->setChecked(true); m_amountRangeButton->setChecked(false); } @@ -564,9 +564,9 @@ void KReportConfigurationFilterDlg::slotReset(void) m_amountEdit->setEnabled(false); m_amountFromEdit->setEnabled(true); m_amountToEdit->setEnabled(true); - m_amountEdit->loadText(QString()); - m_amountFromEdit->loadText(QString::number(from.toDouble())); - m_amountToEdit->loadText(QString::number(to.toDouble())); + m_amountEdit->loadText(TQString()); + m_amountFromEdit->loadText(TQString::number(from.toDouble())); + m_amountToEdit->loadText(TQString::number(to.toDouble())); m_amountButton->setChecked(false); m_amountRangeButton->setChecked(true); } @@ -576,9 +576,9 @@ void KReportConfigurationFilterDlg::slotReset(void) m_amountEdit->setEnabled(true); m_amountFromEdit->setEnabled(false); m_amountToEdit->setEnabled(false); - m_amountEdit->loadText(QString()); - m_amountFromEdit->loadText(QString()); - m_amountToEdit->loadText(QString()); + m_amountEdit->loadText(TQString()); + m_amountFromEdit->loadText(TQString()); + m_amountToEdit->loadText(TQString()); m_amountButton->setChecked(true); m_amountRangeButton->setChecked(false); } @@ -587,7 +587,7 @@ void KReportConfigurationFilterDlg::slotReset(void) // Payees Filter // - QStringList payees; + TQStringList payees; if ( m_initialState.payees(payees) ) { if ( payees.empty() ) @@ -609,7 +609,7 @@ void KReportConfigurationFilterDlg::slotReset(void) // Accounts Filter // - QStringList accounts; + TQStringList accounts; if ( m_initialState.accounts(accounts) ) { m_accountsView->selectAllItems(false); @@ -638,7 +638,7 @@ void KReportConfigurationFilterDlg::slotReset(void) // that's why we call it last m_initialState.updateDateFilter(); - QDate dateFrom, dateTo; + TQDate dateFrom, dateTo; if ( m_initialState.dateFilter( dateFrom, dateTo ) ) { if(m_initialState.isUserDefined()) { diff --git a/kmymoney2/dialogs/kreportconfigurationfilterdlg.h b/kmymoney2/dialogs/kreportconfigurationfilterdlg.h index 56e398d..0a80e60 100644 --- a/kmymoney2/dialogs/kreportconfigurationfilterdlg.h +++ b/kmymoney2/dialogs/kreportconfigurationfilterdlg.h @@ -24,7 +24,7 @@ #ifndef KREPORTCONFIGURATIONFILTERDLG_H #define KREPORTCONFIGURATIONFILTERDLG_H -#include +#include #include "../dialogs/kfindtransactiondlg.h" #include "../mymoney/mymoneyreport.h" @@ -42,8 +42,9 @@ class MyMoneyBudget; class KReportConfigurationFilterDlg : public KFindTransactionDlg { Q_OBJECT + TQ_OBJECT public: - KReportConfigurationFilterDlg(MyMoneyReport report, QWidget *parent = 0, const char *name = 0); + KReportConfigurationFilterDlg(MyMoneyReport report, TQWidget *tqparent = 0, const char *name = 0); ~KReportConfigurationFilterDlg(); const MyMoneyReport& getConfig(void) const { return m_currentState; } @@ -72,7 +73,7 @@ protected slots: virtual void slotDateChanged(void); private: - QValueVector m_budgets; + TQValueVector m_budgets; }; #endif diff --git a/kmymoney2/dialogs/ksecuritylisteditor.cpp b/kmymoney2/dialogs/ksecuritylisteditor.cpp index ee4c486..86e2e66 100644 --- a/kmymoney2/dialogs/ksecuritylisteditor.cpp +++ b/kmymoney2/dialogs/ksecuritylisteditor.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -51,49 +51,49 @@ #define ACCFRACT_COL 6 #define CASHFRACT_COL 7 -#define CURRENCY_MARKET QString("ISO 4217") +#define CURRENCY_MARKET TQString("ISO 4217") -KSecurityListEditor::KSecurityListEditor(QWidget *parent, const char *name) : - KSecurityListEditorDecl(parent, name) +KSecurityListEditor::KSecurityListEditor(TQWidget *tqparent, const char *name) : + KSecurityListEditorDecl(tqparent, name) { m_listView->setColumnWidth(ID_COL, 0); - m_listView->setColumnWidthMode(NAME_COL, QListView::Maximum); - m_listView->setColumnWidthMode(ID_COL, QListView::Manual); - m_listView->setColumnAlignment(CURR_COL, Qt::AlignHCenter); + m_listView->setColumnWidthMode(NAME_COL, TQListView::Maximum); + m_listView->setColumnWidthMode(ID_COL, TQListView::Manual); + m_listView->setColumnAlignment(CURR_COL, TQt::AlignHCenter); m_listView->setMultiSelection(false); m_listView->setAllColumnsShowFocus(true); KIconLoader *il = KGlobal::iconLoader(); KGuiItem removeButtenItem( i18n( "&Delete" ), - QIconSet(il->loadIcon("delete", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("delete", KIcon::Small, KIcon::SizeSmall)), i18n("Delete this entry"), i18n("Remove this security item from the file")); m_deleteButton->setGuiItem(removeButtenItem); KGuiItem addButtenItem( i18n( "&Add" ), - QIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), i18n("Add a new entry"), i18n("Create a new security entry.")); m_addButton->setGuiItem(addButtenItem); KGuiItem editButtenItem( i18n( "&Edit" ), - QIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("edit", KIcon::Small, KIcon::SizeSmall)), i18n("Modify the selected entry"), i18n("Change the security information of the selected entry.")); m_editButton->setGuiItem(editButtenItem); KGuiItem okButtenItem( i18n("&Close" ), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Close the dialog"), i18n("Use this to close the dialog and return to the application.")); m_closeButton->setGuiItem(okButtenItem); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_showCurrencyButton, SIGNAL(toggled(bool)), this, SLOT(slotLoadList())); - connect(m_listView, SIGNAL(selectionChanged()), this, SLOT(slotUpdateButtons())); + connect(m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_showCurrencyButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotLoadList())); + connect(m_listView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotUpdateButtons())); - connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditSecurity())); - connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteSecurity())); + connect(m_editButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSecurity())); + connect(m_deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDeleteSecurity())); // FIXME for now, the only way to add a new security is to add a new investment m_addButton->hide(); @@ -109,22 +109,22 @@ void KSecurityListEditor::slotLoadList(void) { m_listView->clear(); - QValueList list = MyMoneyFile::instance()->securityList(); - QValueList::ConstIterator it; + TQValueList list = MyMoneyFile::instance()->securityList(); + TQValueList::ConstIterator it; if(m_showCurrencyButton->isChecked()) { list += MyMoneyFile::instance()->currencyList(); } for(it = list.begin(); it != list.end(); ++it) { - KListViewItem* newItem = new KListViewItem(m_listView, QString((*it).id())); + KListViewItem* newItem = new KListViewItem(m_listView, TQString((*it).id())); fillItem(newItem, *it); } slotUpdateButtons(); } -void KSecurityListEditor::fillItem(QListViewItem* item, const MyMoneySecurity& security) +void KSecurityListEditor::fillItem(TQListViewItem* item, const MyMoneySecurity& security) { - QString market = security.tradingMarket(); + TQString market = security.tradingMarket(); MyMoneySecurity tradingCurrency; if(security.isCurrency()) market = CURRENCY_MARKET; @@ -136,16 +136,16 @@ void KSecurityListEditor::fillItem(QListViewItem* item, const MyMoneySecurity& s item->setText(SYMBOL_COL, security.tradingSymbol()); item->setText(MARKET_COL, market); item->setText(CURR_COL, tradingCurrency.tradingSymbol()); - item->setText(ACCFRACT_COL, QString::number(security.smallestAccountFraction())); + item->setText(ACCFRACT_COL, TQString::number(security.smallestAccountFraction())); // smallestCashFraction is only applicable for currencies if(security.isCurrency()) - item->setText(CASHFRACT_COL, QString::number(security.smallestCashFraction())); + item->setText(CASHFRACT_COL, TQString::number(security.smallestCashFraction())); } void KSecurityListEditor::slotUpdateButtons(void) { - QListViewItem* item = m_listView->selectedItem(); + TQListViewItem* item = m_listView->selectedItem(); if(item) { MyMoneySecurity security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); @@ -160,13 +160,13 @@ void KSecurityListEditor::slotUpdateButtons(void) void KSecurityListEditor::slotEditSecurity(void) { - QListViewItem* item = m_listView->selectedItem(); + TQListViewItem* item = m_listView->selectedItem(); if(item) { MyMoneySecurity security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); KNewInvestmentWizard dlg(security, this, "KNewInvestmentWizard"); - if(dlg.exec() == QDialog::Accepted) { - dlg.createObjects(QString()); + if(dlg.exec() == TQDialog::Accepted) { + dlg.createObjects(TQString()); security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); fillItem(item, security); } @@ -175,16 +175,16 @@ void KSecurityListEditor::slotEditSecurity(void) void KSecurityListEditor::slotDeleteSecurity(void) { - QListViewItem* item = m_listView->selectedItem(); + TQListViewItem* item = m_listView->selectedItem(); if(item) { MyMoneySecurity security = MyMoneyFile::instance()->security(item->text(ID_COL).latin1()); - QString msg; - QString dontAsk; + TQString msg; + TQString dontAsk; if(security.isCurrency()) { - msg = QString("

") + i18n("Do you really want to remove the currency %1 from the file?

Note: It is currently not supported to add currencies.").arg(security.name()); + msg = TQString("

") + i18n("Do you really want to remove the currency %1 from the file?

Note: It is currently not supported to add currencies.").tqarg(security.name()); dontAsk = "DeleteCurrency"; } else { - msg = QString("

") + i18n("Do you really want to remove the %1 %2 from the file?").arg(KMyMoneyUtils::securityTypeToString(security.securityType())).arg(security.name()); + msg = TQString("

") + i18n("Do you really want to remove the %1 %2 from the file?").tqarg(KMyMoneyUtils::securityTypeToString(security.securityType())).tqarg(security.name()); dontAsk = "DeleteSecurity"; } if(KMessageBox::questionYesNo(this, msg, i18n("Delete security"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk) == KMessageBox::Yes) { diff --git a/kmymoney2/dialogs/ksecuritylisteditor.h b/kmymoney2/dialogs/ksecuritylisteditor.h index 050edbe..ec77483 100644 --- a/kmymoney2/dialogs/ksecuritylisteditor.h +++ b/kmymoney2/dialogs/ksecuritylisteditor.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -class QListViewItem; +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes @@ -40,8 +40,9 @@ class QListViewItem; class KSecurityListEditor : public KSecurityListEditorDecl { Q_OBJECT + TQ_OBJECT public: - KSecurityListEditor(QWidget *parent, const char* name = 0); + KSecurityListEditor(TQWidget *tqparent, const char* name = 0); ~KSecurityListEditor(); protected slots: @@ -51,7 +52,7 @@ protected slots: void slotDeleteSecurity(void); protected: - void fillItem(QListViewItem* item, const MyMoneySecurity& security); + void fillItem(TQListViewItem* item, const MyMoneySecurity& security); }; diff --git a/kmymoney2/dialogs/ksecuritylisteditordecl.ui b/kmymoney2/dialogs/ksecuritylisteditordecl.ui index cbb9999..1347cb0 100644 --- a/kmymoney2/dialogs/ksecuritylisteditordecl.ui +++ b/kmymoney2/dialogs/ksecuritylisteditordecl.ui @@ -1,6 +1,6 @@ KSecurityListEditorDecl - + KSecurityListEditorDecl @@ -22,9 +22,9 @@ unnamed - + - layout6 + tqlayout6 @@ -123,9 +123,9 @@ m_listView - + - layout5 + tqlayout5 @@ -141,7 +141,7 @@ Expanding - + 20 51 @@ -182,7 +182,7 @@ Expanding - + 20 110 @@ -193,7 +193,7 @@ - + m_showCurrencyButton @@ -215,9 +215,9 @@ Horizontal - + - layout2 + tqlayout2 @@ -233,7 +233,7 @@ Expanding - + 91 20 @@ -258,5 +258,5 @@ - + diff --git a/kmymoney2/dialogs/kselectdatabasedlg.cpp b/kmymoney2/dialogs/kselectdatabasedlg.cpp index 941712c..47d092d 100644 --- a/kmymoney2/dialogs/kselectdatabasedlg.cpp +++ b/kmymoney2/dialogs/kselectdatabasedlg.cpp @@ -22,14 +22,14 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,24 +45,24 @@ #include "kselectdatabasedlg.h" -KSelectDatabaseDlg::KSelectDatabaseDlg(QWidget *parent, const char *name) - : KSelectDatabaseDlgDecl(parent, name) { +KSelectDatabaseDlg::KSelectDatabaseDlg(TQWidget *tqparent, const char *name) + : KSelectDatabaseDlgDecl(tqparent, name) { listDrivers->clear(); // list drivers supported by KMM - QMap map = m_map.driverMap(); + TQMap map = m_map.driverMap(); // list drivers installed on system - QStringList list = QSqlDatabase::drivers(); + TQStringList list = TQSqlDatabase::drivers(); if (list.count() == 0) { - KMessageBox::error (0, i18n("There are no Qt SQL drivers installed in your system.\n" - "Please consult documentation for your distro, or visit the Qt web site (www.trolltech.com)" + KMessageBox::error (0, i18n("There are no TQt SQL drivers installed in your system.\n" + "Please consult documentation for your distro, or visit the TQt web site (www.trolltech.com)" " and search for SQL drivers."), ""); setError(); } else { - QStringList::Iterator it = list.begin(); + TQStringList::Iterator it = list.begin(); while(it != list.end()) { - QString dname = *it; - if (map.keys().contains(dname)) { // only display if driver is supported + TQString dname = *it; + if (map.keys().tqcontains(dname)) { // only display if driver is supported dname = dname + " - " + map[dname]; listDrivers->insertItem (dname); } @@ -73,20 +73,20 @@ KSelectDatabaseDlg::KSelectDatabaseDlg(QWidget *parent, const char *name) textUserName->setText(""); struct passwd * pwd = getpwuid(geteuid()); if (pwd != 0) - textUserName->setText (QString(pwd->pw_name)); + textUserName->setText (TQString(pwd->pw_name)); textPassword->setText (""); - m_requiredFields = new kMandatoryFieldGroup(this); + m_requiredFields = new kMandatoryFieldGroup(TQT_TQOBJECT(this)); m_requiredFields->setOkButton(buttonOK); m_requiredFields->add(listDrivers); m_requiredFields->add(textDbName); - connect (listDrivers, SIGNAL(clicked(QListBoxItem *)), - this, SLOT(slotDriverSelected(QListBoxItem *))); - connect (buttonSQL, SIGNAL(clicked()), this, SLOT(slotGenerateSQL())); - connect (buttonOK, SIGNAL(clicked()), this, SLOT(accept())); + connect (listDrivers, TQT_SIGNAL(clicked(TQListBoxItem *)), + this, TQT_SLOT(slotDriverSelected(TQListBoxItem *))); + connect (buttonSQL, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGenerateSQL())); + connect (buttonOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); checkPreLoad->setChecked(false); buttonSQL->setEnabled(true); } - connect (buttonHelp, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect (buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); // ensure a driver gets selected; pre-select if only one listDrivers->clearSelection(); if (listDrivers->count() == 1) { @@ -95,30 +95,30 @@ KSelectDatabaseDlg::KSelectDatabaseDlg(QWidget *parent, const char *name) } } -KSelectDatabaseDlg::KSelectDatabaseDlg(KURL openURL, QWidget *parent, const char *name) - : KSelectDatabaseDlgDecl(parent, name) { +KSelectDatabaseDlg::KSelectDatabaseDlg(KURL openURL, TQWidget *tqparent, const char *name) + : KSelectDatabaseDlgDecl(tqparent, name) { // here we are re-opening a database from a URL // probably taken from the last-used or recent file list listDrivers->clear(); // check that the SQL driver is still available - QString driverName = openURL.queryItem("driver"); + TQString driverName = openURL.queryItem("driver"); // list drivers installed on system - QStringList list = QSqlDatabase::drivers(); + TQStringList list = TQSqlDatabase::drivers(); // list drivers supported by KMM - QMap map = m_map.driverMap(); - if (!list.contains(driverName)) { - KMessageBox::error (0, i18n("Qt SQL driver %1 is no longer installed on your system").arg(driverName), + TQMap map = m_map.driverMap(); + if (!list.tqcontains(driverName)) { + KMessageBox::error (0, i18n("TQt SQL driver %1 is no longer installed on your system").tqarg(driverName), ""); setError(); - } else if (!map.contains(driverName)) { - KMessageBox::error (0, i18n("Qt SQL driver %1 is not suported").arg(driverName), + } else if (!map.tqcontains(driverName)) { + KMessageBox::error (0, i18n("TQt SQL driver %1 is not suported").tqarg(driverName), ""); setError(); } else { // fill in the fixed data from the URL - listDrivers->insertItem (QString(driverName + " - " + map[driverName])); + listDrivers->insertItem (TQString(driverName + " - " + map[driverName])); listDrivers->setSelected(0,true); - QString dbName = openURL.path().right(openURL.path().length() - 1); // remove separator slash + TQString dbName = openURL.path().right(openURL.path().length() - 1); // remove separator slash textDbName->setText (dbName); textHostName->setText (openURL.host()); textUserName->setText(openURL.user()); @@ -131,14 +131,14 @@ KSelectDatabaseDlg::KSelectDatabaseDlg(KURL openURL, QWidget *parent, const char textPassword->setFocus(); buttonSQL->setEnabled(false); // set password as required - m_requiredFields = new kMandatoryFieldGroup(this); + m_requiredFields = new kMandatoryFieldGroup(TQT_TQOBJECT(this)); m_requiredFields->add(textPassword); m_requiredFields->setOkButton(buttonOK); - connect (buttonOK, SIGNAL(clicked()), this, SLOT(accept())); + connect (buttonOK, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); checkPreLoad->setChecked(false); } - connect (buttonHelp, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect (buttonHelp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); } @@ -158,20 +158,20 @@ const KURL KSelectDatabaseDlg::selectedURL() { url.setPass(textPassword->text()); url.setHost(textHostName->text()); url.setPath("/" + textDbName->text()); - QString qs = QString("driver=%1") - .arg(listDrivers->currentText().section (' ', 0, 0)); + TQString qs = TQString("driver=%1") + .tqarg(listDrivers->currentText().section (' ', 0, 0)); if (checkPreLoad->isChecked()) qs.append("&options=loadAll"); if (!textPassword->text().isEmpty()) qs.append("&secure=yes"); url.setQuery(qs); return (url); } -void KSelectDatabaseDlg::slotDriverSelected (QListBoxItem *driver) { +void KSelectDatabaseDlg::slotDriverSelected (TQListBoxItem *driver) { databaseTypeE dbType = m_map.driverToType(driver->text().section(' ', 0, 0)); if (!m_map.isTested(dbType)) { int rc = KMessageBox::warningContinueCancel (0, - i18n("Qt SQL driver %1 has not been fully tested in a KMyMoney environment. Please make sure you have adequate backups of your data. Please report any problems to the developer mailing list at kmymoney2-developer@lists.sourceforge.net") - .arg(driver->text()), + i18n("TQt SQL driver %1 has not been fully tested in a KMyMoney environment. Please make sure you have adequate backups of your data. Please report any problems to the developer mailing list at kmymoney2-developer@lists.sourceforge.net") + .tqarg(driver->text()), ""); if (rc == KMessageBox::Cancel) { listDrivers->clearSelection(); @@ -180,12 +180,12 @@ void KSelectDatabaseDlg::slotDriverSelected (QListBoxItem *driver) { } if (dbType == Sqlite3){ - QString dbName = QFileDialog::getOpenFileName( + TQString dbName = TQFileDialog::getOpenFileName( "", - i18n("SQLite files (*.sql);; All files (*.*)"), + i18n("STQLite files (*.sql);; All files (*.*)"), this, "", - i18n("Select SQLite file")); + i18n("Select STQLite file")); if (dbName.isNull()) { listDrivers->setSelected(driver, false); return; @@ -204,16 +204,16 @@ void KSelectDatabaseDlg::slotDriverSelected (QListBoxItem *driver) { } void KSelectDatabaseDlg::slotGenerateSQL () { - QString fileName = QFileDialog::getSaveFileName( + TQString fileName = TQFileDialog::getSaveFileName( "", i18n("All files (*.*)"), this, "", i18n("Select output file")); if (fileName == "") return; - QFile out(fileName); + TQFile out(fileName); if (!out.open(IO_WriteOnly)) return; - QTextStream s(&out); + TQTextStream s(&out); MyMoneyDbDef db; s << db.generateSQL(listDrivers->currentText().section (' ', 0, 0)); out.close(); diff --git a/kmymoney2/dialogs/kselectdatabasedlg.h b/kmymoney2/dialogs/kselectdatabasedlg.h index bc5a782..28c44d8 100644 --- a/kmymoney2/dialogs/kselectdatabasedlg.h +++ b/kmymoney2/dialogs/kselectdatabasedlg.h @@ -20,9 +20,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -37,9 +37,10 @@ class KSelectDatabaseDlg : public KSelectDatabaseDlgDecl { Q_OBJECT + TQ_OBJECT public: - KSelectDatabaseDlg(QWidget *parent = 0, const char *name = 0); - KSelectDatabaseDlg(KURL openURL, QWidget *parent = 0, const char *name = 0); + KSelectDatabaseDlg(TQWidget *tqparent = 0, const char *name = 0); + KSelectDatabaseDlg(KURL openURL, TQWidget *tqparent = 0, const char *name = 0); ~KSelectDatabaseDlg(); /** Set the mode of this dialog * @param - openMode (IO_ReadWrite = open database; IO_WriteOnly = saveas database) @@ -51,7 +52,7 @@ public: const KURL selectedURL(); public slots: - void slotDriverSelected(QListBoxItem *driver); + void slotDriverSelected(TQListBoxItem *driver); void slotHelp(); void slotGenerateSQL(); private: diff --git a/kmymoney2/dialogs/kselectdatabasedlgdecl.ui b/kmymoney2/dialogs/kselectdatabasedlgdecl.ui index 4736fb7..20a8dd0 100644 --- a/kmymoney2/dialogs/kselectdatabasedlgdecl.ui +++ b/kmymoney2/dialogs/kselectdatabasedlgdecl.ui @@ -1,6 +1,6 @@ KSelectDatabaseDlgDecl - + KSelectDatabaseDlgDecl @@ -19,7 +19,7 @@ unnamed - + groupBox6 @@ -50,7 +50,7 @@ As always, please make sure you have adequate backups of your data.</font> - + groupBox1 @@ -61,14 +61,14 @@ As always, please make sure you have adequate backups of your data.</font> unnamed - + listDrivers - + groupBox2 @@ -79,14 +79,14 @@ As always, please make sure you have adequate backups of your data.</font> unnamed - + textDbName - + groupBox3 @@ -97,14 +97,14 @@ As always, please make sure you have adequate backups of your data.</font> unnamed - + textHostName - + groupBox4 @@ -115,14 +115,14 @@ As always, please make sure you have adequate backups of your data.</font> unnamed - + textUserName - + groupBoxPassword @@ -133,7 +133,7 @@ As always, please make sure you have adequate backups of your data.</font> unnamed - + textPassword @@ -143,7 +143,7 @@ As always, please make sure you have adequate backups of your data.</font> - + checkPreLoad @@ -151,15 +151,15 @@ As always, please make sure you have adequate backups of your data.</font> Preload &all data - + - layout3 + tqlayout3 unnamed - + buttonHelp @@ -177,14 +177,14 @@ As always, please make sure you have adequate backups of your data.</font> Expanding - + 20 20 - + buttonSQL @@ -202,14 +202,14 @@ As always, please make sure you have adequate backups of your data.</font> Expanding - + 31 20 - + buttonOK @@ -220,7 +220,7 @@ As always, please make sure you have adequate backups of your data.</font> true - + buttonCancel @@ -246,5 +246,5 @@ As always, please make sure you have adequate backups of your data.</font> reject() - + diff --git a/kmymoney2/dialogs/kselecttransactionsdlg.cpp b/kmymoney2/dialogs/kselecttransactionsdlg.cpp index 7a87dc8..1b21089 100644 --- a/kmymoney2/dialogs/kselecttransactionsdlg.cpp +++ b/kmymoney2/dialogs/kselecttransactionsdlg.cpp @@ -36,8 +36,8 @@ #include "kmergetransactionsdlg.h" -KSelectTransactionsDlg::KSelectTransactionsDlg(const MyMoneyAccount& _account, QWidget* parent, const char* name) : - KSelectTransactionsDlgDecl(parent, name), +KSelectTransactionsDlg::KSelectTransactionsDlg(const MyMoneyAccount& _account, TQWidget* tqparent, const char* name) : + KSelectTransactionsDlgDecl(tqparent, name), m_account(_account) { // setup descriptive texts @@ -48,11 +48,11 @@ KSelectTransactionsDlg::KSelectTransactionsDlg(const MyMoneyAccount& _account, Q m_register->clear(); // no selection possible - m_register->setSelectionMode(QTable::Single); + m_register->setSelectionMode(TQTable::Single); // setup header font - QFont font = KMyMoneyGlobalSettings::listHeaderFont(); - QFontMetrics fm( font ); + TQFont font = KMyMoneyGlobalSettings::listHeaderFont(); + TQFontMetrics fm( font ); int height = fm.lineSpacing()+6; m_register->horizontalHeader()->setMinimumHeight(height); m_register->horizontalHeader()->setMaximumHeight(height); @@ -76,10 +76,10 @@ KSelectTransactionsDlg::KSelectTransactionsDlg(const MyMoneyAccount& _account, Q // catch some events from the register m_register->installEventFilter(this); - connect(m_register, SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, SLOT(slotEnableOk(const KMyMoneyRegister::SelectedTransactions&))); - connect(m_register, SIGNAL(editTransaction()), this, SLOT(accept())); + connect(m_register, TQT_SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SLOT(slotEnableOk(const KMyMoneyRegister::SelectedTransactions&))); + connect(m_register, TQT_SIGNAL(editTransaction()), this, TQT_SLOT(accept())); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); } void KSelectTransactionsDlg::slotEnableOk(const KMyMoneyRegister::SelectedTransactions& list) @@ -89,7 +89,7 @@ void KSelectTransactionsDlg::slotEnableOk(const KMyMoneyRegister::SelectedTransa void KSelectTransactionsDlg::addTransaction(const MyMoneyTransaction& t) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).accountId() == m_account.id()) { KMyMoneyRegister::Transaction* tr = KMyMoneyRegister::Register::transactionFactory(m_register, t, (*it_s), 0); @@ -121,7 +121,7 @@ void KSelectTransactionsDlg::show(void) m_register->resize(KMyMoneyRegister::DetailColumn); } -void KSelectTransactionsDlg::resizeEvent(QResizeEvent* ev) +void KSelectTransactionsDlg::resizeEvent(TQResizeEvent* ev) { // don't forget the resizer KSelectTransactionsDlgDecl::resizeEvent(ev); @@ -134,7 +134,7 @@ MyMoneyTransaction KSelectTransactionsDlg::transaction(void) const { MyMoneyTransaction t; - QValueList list; + TQValueList list; list = m_register->selectedItems(); if(list.count()) { KMyMoneyRegister::Transaction* _t = dynamic_cast(list[0]); @@ -144,19 +144,19 @@ MyMoneyTransaction KSelectTransactionsDlg::transaction(void) const return t; } -bool KSelectTransactionsDlg::eventFilter(QObject* o, QEvent* e) +bool KSelectTransactionsDlg::eventFilter(TQObject* o, TQEvent* e) { bool rc = false; - QKeyEvent* k; + TQKeyEvent* k; - if(o == m_register) { + if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_register)) { switch(e->type()) { - case QEvent::KeyPress: - k = dynamic_cast(e); - if((k->state() & Qt::KeyButtonMask) == 0) { + case TQEvent::KeyPress: + k = dynamic_cast(e); + if((k->state() & TQt::KeyButtonMask) == 0) { switch(k->key()) { - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: if(buttonOk->isEnabled()) { accept(); rc = true; diff --git a/kmymoney2/dialogs/kselecttransactionsdlg.h b/kmymoney2/dialogs/kselecttransactionsdlg.h index 7bab9eb..8a2e73b 100644 --- a/kmymoney2/dialogs/kselecttransactionsdlg.h +++ b/kmymoney2/dialogs/kselecttransactionsdlg.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -class QResizeEvent; +class TQResizeEvent; // ---------------------------------------------------------------------------- // KDE Includes @@ -39,8 +39,9 @@ class QResizeEvent; class KSelectTransactionsDlg: public KSelectTransactionsDlgDecl { Q_OBJECT + TQ_OBJECT public: - KSelectTransactionsDlg(const MyMoneyAccount& account, QWidget* parent = 0, const char* name = 0); + KSelectTransactionsDlg(const MyMoneyAccount& account, TQWidget* tqparent = 0, const char* name = 0); /** * Adds the transaction @a t to the dialog @@ -51,7 +52,7 @@ public: MyMoneyTransaction transaction(void) const; - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); public slots: virtual void slotHelp(); @@ -60,7 +61,7 @@ protected slots: void slotEnableOk(const KMyMoneyRegister::SelectedTransactions& list); protected: - void resizeEvent(QResizeEvent* ev); + void resizeEvent(TQResizeEvent* ev); private: /** diff --git a/kmymoney2/dialogs/kselecttransactionsdlgdecl.ui b/kmymoney2/dialogs/kselecttransactionsdlgdecl.ui index 76d825b..a8efa2c 100644 --- a/kmymoney2/dialogs/kselecttransactionsdlgdecl.ui +++ b/kmymoney2/dialogs/kselecttransactionsdlgdecl.ui @@ -1,6 +1,6 @@ KSelectTransactionsDlgDecl - + KSelectTransactionsDlgDecl @@ -97,9 +97,9 @@ 12 - + - layout2 + tqlayout2 @@ -123,7 +123,7 @@ Expanding - + 430 20 @@ -170,5 +170,5 @@ reject() - + diff --git a/kmymoney2/dialogs/ksortoptiondlg.ui b/kmymoney2/dialogs/ksortoptiondlg.ui index e5606ae..6ffb91a 100644 --- a/kmymoney2/dialogs/ksortoptiondlg.ui +++ b/kmymoney2/dialogs/ksortoptiondlg.ui @@ -1,6 +1,6 @@ KSortOptionDlg - + KSortOptionDlg @@ -22,7 +22,7 @@ unnamed - + m_useDefault @@ -35,9 +35,9 @@ m_sortOption - + - layout5 + tqlayout5 @@ -61,7 +61,7 @@ Expanding - + 237 20 @@ -117,13 +117,16 @@ ksortoptiondlg.ui.h - - setSortOption( const QString & option, const QString & def ) - + + setSortOption( const TQString & option, const TQString & def ) + init() - sortOption( void ) const + sortOption( void ) const hideDefaultButton( void ) - + + kmymoney/transactionsortoption.h + + diff --git a/kmymoney2/dialogs/ksortoptiondlg.ui.h b/kmymoney2/dialogs/ksortoptiondlg.ui.h index 62c26b7..322c147 100644 --- a/kmymoney2/dialogs/ksortoptiondlg.ui.h +++ b/kmymoney2/dialogs/ksortoptiondlg.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an +** TQt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ @@ -26,7 +26,7 @@ void KSortOptionDlg::init() m_helpButton->setGuiItem(KStdGuiItem::help()); } -void KSortOptionDlg::setSortOption(const QString& option, const QString& def) +void KSortOptionDlg::setSortOption(const TQString& option, const TQString& def) { if(option.isEmpty()) { m_sortOption->setSettings(def); @@ -37,9 +37,9 @@ void KSortOptionDlg::setSortOption(const QString& option, const QString& def) } } -QString KSortOptionDlg::sortOption(void) const +TQString KSortOptionDlg::sortOption(void) const { - QString rc; + TQString rc; if(!m_useDefault->isChecked()) { rc = m_sortOption->settings(); } diff --git a/kmymoney2/dialogs/ksplitcorrectiondlg.ui b/kmymoney2/dialogs/ksplitcorrectiondlg.ui index f5d9757..e37789e 100644 --- a/kmymoney2/dialogs/ksplitcorrectiondlg.ui +++ b/kmymoney2/dialogs/ksplitcorrectiondlg.ui @@ -1,6 +1,6 @@ KSplitCorrectionDlgDecl - + KSplitCorrectionDlgDecl @@ -12,7 +12,7 @@ 292 - + 80 0 @@ -31,9 +31,9 @@ 6 - + - layout4 + tqlayout4 @@ -50,7 +50,7 @@ xxx - + question @@ -61,7 +61,7 @@ How do you want to proceed? - + buttonGroup @@ -81,7 +81,7 @@ 6 - + continueBtn @@ -92,7 +92,7 @@ true - + changeBtn @@ -100,7 +100,7 @@ Change total amount of transaction to %1. - + distributeBtn @@ -111,7 +111,7 @@ Distribute difference of %1 among all splits. - + leaveBtn @@ -133,7 +133,7 @@ Expanding - + 20 41 @@ -154,9 +154,9 @@ Horizontal - + - layout3 + tqlayout3 @@ -172,7 +172,7 @@ Expanding - + 61 20 @@ -191,7 +191,7 @@ 0 - + 80 0 @@ -213,7 +213,7 @@ 0 - + 80 0 @@ -241,5 +241,5 @@ reject() - + diff --git a/kmymoney2/dialogs/ksplittransactiondlg.cpp b/kmymoney2/dialogs/ksplittransactiondlg.cpp index a197b4c..9236bea 100644 --- a/kmymoney2/dialogs/ksplittransactiondlg.cpp +++ b/kmymoney2/dialogs/ksplittransactiondlg.cpp @@ -23,14 +23,14 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -61,9 +61,9 @@ KSplitTransactionDlg::KSplitTransactionDlg(const MyMoneyTransaction& t, const bool amountValid, const bool deposit, const MyMoneyMoney& calculatedValue, - const QMap& priceInfo, - QWidget* parent, const char* name) : - KSplitTransactionDlgDecl(parent, name, true), + const TQMap& priceInfo, + TQWidget* tqparent, const char* name) : + KSplitTransactionDlgDecl(tqparent, name, true), m_account(acc), m_split(s), m_precision(2), @@ -75,14 +75,14 @@ KSplitTransactionDlg::KSplitTransactionDlg(const MyMoneyTransaction& t, KIconLoader *il = KGlobal::iconLoader(); KGuiItem clearButtenItem( i18n( "Clear &All" ), - QIconSet(il->loadIcon("edittrash", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("edittrash", KIcon::Small, KIcon::SizeSmall)), i18n("Clear all splits"), i18n("Use this to clear all splits of this transaction")); clearAllBtn->setGuiItem(clearButtenItem); KGuiItem mergeButtenItem( i18n( "&Merge" ), - QIconSet(il->loadIcon("math_sum", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("math_sum", KIcon::Small, KIcon::SizeSmall)), "", ""); mergeBtn->setGuiItem(mergeButtenItem); @@ -90,24 +90,24 @@ KSplitTransactionDlg::KSplitTransactionDlg(const MyMoneyTransaction& t, finishBtn->setDefault(true); // setup the focus - cancelBtn->setFocusPolicy(QWidget::NoFocus); - finishBtn->setFocusPolicy(QWidget::NoFocus); - clearAllBtn->setFocusPolicy(QWidget::NoFocus); + cancelBtn->setFocusPolicy(TQ_NoFocus); + finishBtn->setFocusPolicy(TQ_NoFocus); + clearAllBtn->setFocusPolicy(TQ_NoFocus); // connect signals with slots - connect(transactionsTable, SIGNAL(transactionChanged(const MyMoneyTransaction&)), - this, SLOT(slotSetTransaction(const MyMoneyTransaction&))); - connect(transactionsTable, SIGNAL(createCategory(const QString&, QString&)), this, SLOT(slotCreateCategory(const QString&, QString&))); - connect(transactionsTable, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); + connect(transactionsTable, TQT_SIGNAL(transactionChanged(const MyMoneyTransaction&)), + this, TQT_SLOT(slotSetTransaction(const MyMoneyTransaction&))); + connect(transactionsTable, TQT_SIGNAL(createCategory(const TQString&, TQString&)), this, TQT_SLOT(slotCreateCategory(const TQString&, TQString&))); + connect(transactionsTable, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); - connect(transactionsTable, SIGNAL(returnPressed()), this, SLOT(accept())); - connect(transactionsTable, SIGNAL(escapePressed()), this, SLOT(reject())); + connect(transactionsTable, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(accept())); + connect(transactionsTable, TQT_SIGNAL(escapePressed()), this, TQT_SLOT(reject())); - connect(cancelBtn, SIGNAL(clicked()), this, SLOT(reject())); - connect(finishBtn, SIGNAL(clicked()), this, SLOT(accept())); - connect(clearAllBtn, SIGNAL(clicked()), this, SLOT(slotClearAllSplits())); - connect(mergeBtn, SIGNAL(clicked()), this, SLOT(slotMergeSplits())); - connect(clearZeroBtn, SIGNAL(clicked()), this, SLOT(slotClearUnusedSplits())); + connect(cancelBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(finishBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(clearAllBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClearAllSplits())); + connect(mergeBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMergeSplits())); + connect(clearZeroBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClearUnusedSplits())); // setup the precision try { @@ -122,11 +122,11 @@ KSplitTransactionDlg::KSplitTransactionDlg(const MyMoneyTransaction& t, // pass on those vars transactionsTable->setup(priceInfo); - QSize size(width(), height()); + TQSize size(width(), height()); kapp->config()->setGroup("SplitTransactionEditor"); size = kapp->config()->readSizeEntry("Geometry", &size); size.setHeight(size.height()-1); - QDialog::resize( size.expandedTo(minimumSizeHint()) ); + TQDialog::resize( size.expandedTo(tqminimumSizeHint()) ); // Trick: it seems, that the initial sizing of the dialog does // not work correctly. At least, the columns do not get displayed @@ -134,7 +134,7 @@ KSplitTransactionDlg::KSplitTransactionDlg(const MyMoneyTransaction& t, // is incorrect. If the widget is visible, resizing works correctly. // So, we let the dialog show up and resize it then. It's not really // clean, but the only way I got the damned thing working. - QTimer::singleShot( 10, this, SLOT(initSize()) ); + TQTimer::singleShot( 10, this, TQT_SLOT(initSize()) ); } KSplitTransactionDlg::~KSplitTransactionDlg() @@ -166,7 +166,7 @@ int KSplitTransactionDlg::exec(void) rc = KSplitTransactionDlgDecl::exec(); - if(rc == QDialog::Accepted) { + if(rc == TQDialog::Accepted) { if(!diffAmount().isZero()) { KSplitCorrectionDlgDecl* corrDlg = new KSplitCorrectionDlgDecl(this, 0, true); @@ -175,23 +175,23 @@ int KSplitTransactionDlg::exec(void) corrDlg->cancelBtn->setGuiItem(KStdGuiItem::cancel()); MyMoneySplit split = m_transaction.splits()[0]; - QString total = (-split.value()).formatMoney("", m_precision); - QString sums = splitsValue().formatMoney("", m_precision); - QString diff = diffAmount().formatMoney("", m_precision); + TQString total = (-split.value()).formatMoney("", m_precision); + TQString sums = splitsValue().formatMoney("", m_precision); + TQString diff = diffAmount().formatMoney("", m_precision); // now modify the text items of the dialog to contain the correct values - QString q = i18n("The total amount of this transaction is %1 while " + TQString q = i18n("The total amount of this transaction is %1 while " "the sum of the splits is %2. The remaining %3 are " "unassigned.") - .arg(total) - .arg(sums) - .arg(diff); + .tqarg(total) + .tqarg(sums) + .tqarg(diff); corrDlg->explanation->setText(q); - q = i18n("Change &total amount of transaction to %1.").arg(sums); + q = i18n("Change &total amount of transaction to %1.").tqarg(sums); corrDlg->changeBtn->setText(q); - q = i18n("&Distribute difference of %1 among all splits.").arg(diff); + q = i18n("&Distribute difference of %1 among all splits.").tqarg(diff); corrDlg->distributeBtn->setText(q); // FIXME remove the following line once distribution among // all splits is implemented @@ -200,18 +200,18 @@ int KSplitTransactionDlg::exec(void) // if we have only two splits left, we don't allow leaving sth. unassigned. if(m_transaction.splitCount() < 3) { - q = i18n("&Leave total amount of transaction at %1.").arg(total); + q = i18n("&Leave total amount of transaction at %1.").tqarg(total); } else { - q = i18n("&Leave %1 unassigned.").arg(diff); + q = i18n("&Leave %1 unassigned.").tqarg(diff); } corrDlg->leaveBtn->setText(q); - if((rc = corrDlg->exec()) == QDialog::Accepted) { - QButton* button = corrDlg->buttonGroup->selected(); + if((rc = corrDlg->exec()) == TQDialog::Accepted) { + TQButton* button = corrDlg->buttonGroup->selected(); if(button != 0) { switch(corrDlg->buttonGroup->id(button)) { case 0: // continue to edit - rc = QDialog::Rejected; + rc = TQDialog::Rejected; break; case 1: // modify total @@ -234,7 +234,7 @@ int KSplitTransactionDlg::exec(void) } else break; - } while(rc != QDialog::Accepted); + } while(rc != TQDialog::Accepted); // for deposits, we inverted the sign of all splits. // now we revert it back, so that things are left correct @@ -252,7 +252,7 @@ int KSplitTransactionDlg::exec(void) void KSplitTransactionDlg::initSize(void) { - QDialog::resize(width(), height()+1); + TQDialog::resize(width(), height()+1); } void KSplitTransactionDlg::accept() @@ -281,8 +281,8 @@ void KSplitTransactionDlg::slotClearAllSplits(void) if(answer == KMessageBox::Continue) { transactionsTable->slotCancelEdit(); - QValueList list = transactionsTable->getSplits(m_transaction); - QValueList::ConstIterator it; + TQValueList list = transactionsTable->getSplits(m_transaction); + TQValueList::ConstIterator it; // clear all but the one referencing the account for(it = list.begin(); it != list.end(); ++it) { @@ -298,8 +298,8 @@ void KSplitTransactionDlg::slotClearUnusedSplits(void) { transactionsTable->slotEndEdit(); - QValueList list = transactionsTable->getSplits(m_transaction); - QValueList::ConstIterator it; + TQValueList list = transactionsTable->getSplits(m_transaction); + TQValueList::ConstIterator it; try { // remove all splits that don't have a value assigned @@ -320,14 +320,14 @@ void KSplitTransactionDlg::slotMergeSplits(void) { transactionsTable->slotEndEdit(); - QValueList list = transactionsTable->getSplits(m_transaction); - QValueList::ConstIterator it; + TQValueList list = transactionsTable->getSplits(m_transaction); + TQValueList::ConstIterator it; try { // collect all splits, merge them if needed and remove from transaction - QValueList splits; + TQValueList splits; for(it = list.begin(); it != list.end(); ++it) { - QValueList::iterator it_s; + TQValueList::iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { if((*it_s).accountId() == (*it).accountId() && (*it_s).memo().isEmpty() && (*it).memo().isEmpty()) @@ -343,7 +343,7 @@ void KSplitTransactionDlg::slotMergeSplits(void) } // now add them back to the transaction - QValueList::iterator it_s; + TQValueList::iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { (*it_s).clearId(); m_transaction.addSplit(*it_s); @@ -361,18 +361,18 @@ void KSplitTransactionDlg::slotSetTransaction(const MyMoneyTransaction& t) transactionsTable->slotCancelEdit(); m_transaction = t; - QValueList list = transactionsTable->getSplits(m_transaction); - QValueList::ConstIterator it; + TQValueList list = transactionsTable->getSplits(m_transaction); + TQValueList::ConstIterator it; // check if we can merge splits or not, have zero splits or not - QMap splits; + TQMap splits; bool haveZeroSplit = false; for(it = list.begin(); it != list.end(); ++it) { splits[(*it).accountId()]++; if(((*it).id() != m_split.id()) && ((*it).shares().isZero())) haveZeroSplit = true; } - QMap::const_iterator it_s; + TQMap::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { if((*it_s) > 1) break; @@ -400,8 +400,8 @@ void KSplitTransactionDlg::updateSums(void) MyMoneyMoney KSplitTransactionDlg::splitsValue(void) { MyMoneyMoney splitsValue(m_calculatedValue); - QValueList list = transactionsTable->getSplits(m_transaction); - QValueList::ConstIterator it; + TQValueList list = transactionsTable->getSplits(m_transaction); + TQValueList::ConstIterator it; // calculate the current sum of all split parts for(it = list.begin(); it != list.end(); ++it) { @@ -426,21 +426,21 @@ MyMoneyMoney KSplitTransactionDlg::diffAmount(void) return diff; } -void KSplitTransactionDlg::slotCreateCategory(const QString& name, QString& id) +void KSplitTransactionDlg::slotCreateCategory(const TQString& name, TQString& id) { - MyMoneyAccount acc, parent; + MyMoneyAccount acc, tqparent; acc.setName(name); if(m_isDeposit) - parent = MyMoneyFile::instance()->income(); + tqparent = MyMoneyFile::instance()->income(); else - parent = MyMoneyFile::instance()->expense(); + tqparent = MyMoneyFile::instance()->expense(); // TODO extract possible first part of a hierarchy and check if it is one - // of our top categories. If so, remove it and select the parent + // of our top categories. If so, remove it and select the tqparent // according to this information. - emit createCategory(acc, parent); + emit createCategory(acc, tqparent); // return id id = acc.id(); diff --git a/kmymoney2/dialogs/ksplittransactiondlg.h b/kmymoney2/dialogs/ksplittransactiondlg.h index 67a5b92..76261bd 100644 --- a/kmymoney2/dialogs/ksplittransactiondlg.h +++ b/kmymoney2/dialogs/ksplittransactiondlg.h @@ -51,6 +51,7 @@ class kMyMoneyLineEdit; class KSplitTransactionDlg : public KSplitTransactionDlgDecl { Q_OBJECT + TQ_OBJECT public: KSplitTransactionDlg(const MyMoneyTransaction& t, @@ -59,8 +60,8 @@ public: const bool amountValid, const bool deposit, const MyMoneyMoney& calculatedValue, - const QMap& priceInfo, - QWidget* parent = 0, const char* name = 0); + const TQMap& priceInfo, + TQWidget* tqparent = 0, const char* name = 0); virtual ~KSplitTransactionDlg(); @@ -106,7 +107,7 @@ protected slots: void slotClearAllSplits(void); void slotClearUnusedSplits(void); void slotSetTransaction(const MyMoneyTransaction& t); - void slotCreateCategory(const QString& txt, QString& id); + void slotCreateCategory(const TQString& txt, TQString& id); void slotMergeSplits(void); /// used internally to setup the initial size of all widgets @@ -115,13 +116,13 @@ protected slots: signals: /** * This signal is sent out, when a new category needs to be created - * Depending on the setting of either a payment or deposit, the parent + * Depending on the setting of either a payment or deposit, the tqparent * account will be preset to Expense or Income. * * @param account reference to account info. Will be filled by called slot - * @param parent reference to parent account + * @param tqparent reference to tqparent account */ - void createCategory(MyMoneyAccount& account, const MyMoneyAccount& parent); + void createCategory(MyMoneyAccount& account, const MyMoneyAccount& tqparent); /** * Signal is emitted, if any of the widgets enters (@a state equals @a true) diff --git a/kmymoney2/dialogs/ksplittransactiondlgdecl.ui b/kmymoney2/dialogs/ksplittransactiondlgdecl.ui index 72a19e3..2d2f231 100644 --- a/kmymoney2/dialogs/ksplittransactiondlgdecl.ui +++ b/kmymoney2/dialogs/ksplittransactiondlgdecl.ui @@ -1,6 +1,6 @@ KSplitTransactionDlgDecl - + KSplitTransactionDlgDecl @@ -28,7 +28,7 @@ 6 - + Layout61 @@ -58,7 +58,7 @@ 0 - + m_sumFrame @@ -88,18 +88,18 @@ Expanding - + 0 16 - + Layout49 - + 32767 80 @@ -115,7 +115,7 @@ 1 - + splitUnassigned @@ -127,7 +127,7 @@ 0 - + 120 15 @@ -136,13 +136,13 @@ <b>11,00<b> - + AlignVCenter|AlignRight - + transactionAmount @@ -154,7 +154,7 @@ 0 - + 120 15 @@ -163,13 +163,13 @@ <b>111,00<b> - + AlignVCenter|AlignRight - + TextLabel1_2 @@ -181,13 +181,13 @@ Unassigned - + AlignVCenter|AlignRight - + TextLabel1 @@ -199,13 +199,13 @@ Sum of splits - + AlignVCenter|AlignRight - + splitSum @@ -217,7 +217,7 @@ 0 - + 120 15 @@ -226,17 +226,17 @@ 100,00 - + AlignVCenter|AlignRight - + TextLabel1_2_2 - + 150 0 @@ -250,7 +250,7 @@ Transaction amount - + AlignVCenter|AlignRight @@ -272,7 +272,7 @@ - + Frame3 @@ -284,13 +284,13 @@ 0 - + 15 0 - + 32767 80 @@ -307,9 +307,9 @@ - + - layout4 + tqlayout4 @@ -364,7 +364,7 @@ Expanding - + 20 120 @@ -420,5 +420,5 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000c749444154388dad55db1184200c4c180bb81a28c73aad811228c356f42b3792db3cc0db2fc724bb7901dc7b270f27ed17fa5fa9b117b7cd90211f4ba0ac906a7f1453b4d30ca917bb590681552af23f69bfc4ffa71519d2c8f62546ea5ea03738b1c18c33a4d156f0d13f43b61952e4af6d6e8fb3a408f080448419a433d6486d85052fdba892a295f5d45785cd8c51a9d6de6a814a8d2131da51f98e7a3b64ec9da04a8db53d43be3c3c0b22cacf17e4cdb5a931649ceddf34b190cf0aa019f03f1fd3e7457f03b5a66c9ed26e86130000000049454e44ae426082 - + diff --git a/kmymoney2/dialogs/kstartdlg.cpp b/kmymoney2/dialogs/kstartdlg.cpp index d0af8eb..afdef28 100644 --- a/kmymoney2/dialogs/kstartdlg.cpp +++ b/kmymoney2/dialogs/kstartdlg.cpp @@ -18,24 +18,20 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes #include "kdecompat.h" -#if QT_VERSION > 300 #include -#else -#include -#endif #include #include @@ -54,9 +50,9 @@ #include "krecentfileitem.h" #include "../kmymoney2.h" -#include +#include -KStartDlg::KStartDlg(QWidget *parent, const char *name, bool modal) : KDialogBase(IconList,i18n("Start Dialog"),Help|Ok|Cancel,Ok, parent, name, modal, true) +KStartDlg::KStartDlg(TQWidget *tqparent, const char *name, bool modal) : KDialogBase(IconList,i18n("Start Dialog"),Help|Ok|Cancel,Ok, tqparent, name, modal, true) { setPage_Template(); setPage_Documents(); @@ -77,41 +73,41 @@ void KStartDlg::setPage_Template() KIconLoader *ic = KGlobal::iconLoader(); templateMainFrame = addVBoxPage( i18n("Templates"), i18n("Select templates"), DesktopIcon("wizard")); view_wizard = new KIconView( templateMainFrame, "view_options" ); - (void)new QIconViewItem( view_wizard, i18n("New KMyMoney document"), ic->loadIcon("mime_empty.png", KIcon::Desktop, KIcon::SizeLarge)/*QPixmap( locate("icon","hicolor/48x48/mimetypes/mime_empty.png") )*/ ); - connect(view_wizard, SIGNAL(executed(QIconViewItem *) ), this, SLOT(slotTemplateClicked(QIconViewItem *) ) ); - connect(view_wizard, SIGNAL(selectionChanged(QIconViewItem*)), - this, SLOT(slotTemplateSelectionChanged(QIconViewItem*))); - connect(this, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT(slotAboutToShowPage(QWidget*))); + (void)new TQIconViewItem( view_wizard, i18n("New KMyMoney document"), ic->loadIcon("mime_empty.png", KIcon::Desktop, KIcon::SizeLarge)/*TQPixmap( locate("icon","hicolor/48x48/mimetypes/mime_empty.png") )*/ ); + connect(view_wizard, TQT_SIGNAL(executed(TQIconViewItem *) ), this, TQT_SLOT(slotTemplateClicked(TQIconViewItem *) ) ); + connect(view_wizard, TQT_SIGNAL(selectionChanged(TQIconViewItem*)), + this, TQT_SLOT(slotTemplateSelectionChanged(TQIconViewItem*))); + connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget*)), this, TQT_SLOT(slotAboutToShowPage(TQWidget*))); } /** Set the Misc options Page of the preferences dialog */ void KStartDlg::setPage_Documents() { recentMainFrame = addPage( i18n("Open"), i18n("Open a KMyMoney document"), DesktopIcon("fileopen")); - QVBoxLayout *mainLayout = new QVBoxLayout( recentMainFrame ); + TQVBoxLayout *mainLayout = new TQVBoxLayout( recentMainFrame ); kurlrequest = new KURLRequester( recentMainFrame, "kurlrequest" ); //allow user to select either a .kmy file, or any generic file. - kurlrequest->fileDialog()->setFilter( i18n("%1|KMyMoney files (*.kmy)\n" "%2|All files (*.*)").arg("*.kmy").arg("*.*") ); + kurlrequest->fileDialog()->setFilter( i18n("%1|KMyMoney files (*.kmy)\n" "%2|All files (*.*)").tqarg("*.kmy").tqarg("*.*") ); kurlrequest->fileDialog()->setMode(KFile::File || KFile::ExistingOnly); kurlrequest->fileDialog()->setURL(KURL(kmymoney2->readLastUsedDir()));//kurlrequest->fileDialog()->setURL(KURL(KGlobalSettings::documentPath())); mainLayout->addWidget( kurlrequest ); - QLabel *label1 = new QLabel( recentMainFrame, "label1" ); + TQLabel *label1 = new TQLabel( recentMainFrame, "label1" ); label1->setText( i18n("Recent Files") ); mainLayout->addWidget( label1 ); view_recent = new KIconView( recentMainFrame, "view_recent" ); - connect( view_recent, SIGNAL( executed(QIconViewItem *) ), this, SLOT( slotRecentClicked(QIconViewItem *) ) ); + connect( view_recent, TQT_SIGNAL( executed(TQIconViewItem *) ), this, TQT_SLOT( slotRecentClicked(TQIconViewItem *) ) ); mainLayout->addWidget( view_recent ); view_recent->setArrangement(KIconView::LeftToRight/*TopToBottom*/); view_recent->setItemTextPos(KIconView::Bottom); - connect(view_recent, SIGNAL(selectionChanged(QIconViewItem*)), - this, SLOT(slotRecentSelectionChanged(QIconViewItem*))); + connect(view_recent, TQT_SIGNAL(selectionChanged(TQIconViewItem*)), + this, TQT_SLOT(slotRecentSelectionChanged(TQIconViewItem*))); } -void KStartDlg::slotTemplateClicked(QIconViewItem *item) +void KStartDlg::slotTemplateClicked(TQIconViewItem *item) { if(!item) return; @@ -129,7 +125,7 @@ void KStartDlg::slotTemplateClicked(QIconViewItem *item) /** Read config window */ void KStartDlg::readConfig() { - QString value; + TQString value; unsigned int i = 1; KConfig *config = KGlobal::config(); @@ -142,17 +138,17 @@ void KStartDlg::readConfig() // it does not make a difference, if you call setGroup() outside of // this loop. The first time it does make a difference! config->setGroup("Recent Files"); - value = config->readEntry( QString( "File%1" ).arg( i ), QString::null ); + value = config->readEntry( TQString( "File%1" ).tqarg( i ), TQString() ); if( !value.isNull() && fileExists(value) ) { - QString file_name = value.mid(value.findRev('/')+1); + TQString file_name = value.mid(value.tqfindRev('/')+1); (void)new KRecentFileItem( value, view_recent, file_name, il->loadIcon("kmy", KIcon::Desktop, KIcon::SizeLarge)); } i++; } while( !value.isNull() ); config->setGroup("Start Dialog"); - QSize *defaultSize = new QSize(400,300); + TQSize *defaultSize = new TQSize(400,300); this->resize( config->readSizeEntry("Geometry", defaultSize ) ); // Restore the last page viewed @@ -178,7 +174,7 @@ void KStartDlg::writeConfig() } /** slot to recent view */ -void KStartDlg::slotRecentClicked(QIconViewItem *item) +void KStartDlg::slotRecentClicked(TQIconViewItem *item) { KRecentFileItem *kitem = (KRecentFileItem*)item; if(!kitem) return; @@ -205,7 +201,7 @@ bool KStartDlg::fileExists(KURL url) #endif } -void KStartDlg::slotTemplateSelectionChanged(QIconViewItem* item) +void KStartDlg::slotTemplateSelectionChanged(TQIconViewItem* item) { if(!item) return; @@ -222,7 +218,7 @@ void KStartDlg::slotTemplateSelectionChanged(QIconViewItem* item) isopenfile = false; } -void KStartDlg::slotRecentSelectionChanged(QIconViewItem* item) +void KStartDlg::slotRecentSelectionChanged(TQIconViewItem* item) { KRecentFileItem *kitem = (KRecentFileItem*)item; if(!kitem) return; @@ -235,7 +231,7 @@ void KStartDlg::slotRecentSelectionChanged(QIconViewItem* item) kurlrequest->setURL( kitem->fileURL() ); } -void KStartDlg::slotAboutToShowPage(QWidget* page) +void KStartDlg::slotAboutToShowPage(TQWidget* page) { enableButtonOK(page == recentMainFrame); } diff --git a/kmymoney2/dialogs/kstartdlg.h b/kmymoney2/dialogs/kstartdlg.h index a09f72d..55d6955 100644 --- a/kmymoney2/dialogs/kstartdlg.h +++ b/kmymoney2/dialogs/kstartdlg.h @@ -27,27 +27,28 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /**KMyMoney 2 start dialog */ class KStartDlg : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KStartDlg( QWidget *parent=0, const char *name=0, bool modal=true ); + KStartDlg( TQWidget *tqparent=0, const char *name=0, bool modal=true ); virtual ~KStartDlg(); bool isNewFile(void) const { return isnewfile; } bool isOpenFile(void) const { return !kurlrequest->url().isEmpty(); } - const QString getURL(void) const { return kurlrequest->url(); } - QString getTemplateName(void) const { return templatename; } + const TQString getURL(void) const { return kurlrequest->url(); } + TQString getTemplateName(void) const { return templatename; } private: // Private methods - QString m_filename; + TQString m_filename; bool fileExists(KURL url); void setPage_Template(); @@ -63,22 +64,22 @@ private: // Private methods /** misc variables */ bool isnewfile; bool isopenfile; - QString templatename; - QVBox *templateMainFrame; - QFrame *recentMainFrame; + TQString templatename; + TQVBox *templateMainFrame; + TQFrame *recentMainFrame; protected slots: /** No descriptions */ void slotOk(); private slots: - void slotTemplateClicked(QIconViewItem *item); + void slotTemplateClicked(TQIconViewItem *item); /** slot to recent view */ - void slotRecentClicked(QIconViewItem *item); + void slotRecentClicked(TQIconViewItem *item); /** Handle selections */ - void slotTemplateSelectionChanged(QIconViewItem* item); - void slotRecentSelectionChanged(QIconViewItem* item); - void slotAboutToShowPage(QWidget* page); + void slotTemplateSelectionChanged(TQIconViewItem* item); + void slotRecentSelectionChanged(TQIconViewItem* item); + void slotAboutToShowPage(TQWidget* page); }; #endif diff --git a/kmymoney2/dialogs/kupdatestockpricedlg.cpp b/kmymoney2/dialogs/kupdatestockpricedlg.cpp index 05eee8a..ef7bfab 100644 --- a/kmymoney2/dialogs/kupdatestockpricedlg.cpp +++ b/kmymoney2/dialogs/kupdatestockpricedlg.cpp @@ -34,10 +34,10 @@ #include "kupdatestockpricedlg.h" #include "../widgets/kmymoneycurrencyselector.h" -KUpdateStockPriceDlg::KUpdateStockPriceDlg(QWidget* parent, const char* name) : - kUpdateStockPriceDecl(parent, name, true) +KUpdateStockPriceDlg::KUpdateStockPriceDlg(TQWidget* tqparent, const char* name) : + kUpdateStockPriceDecl(tqparent, name, true) { - m_date->setDate(QDate::currentDate()); + m_date->setDate(TQDate::tqcurrentDate()); init(); } @@ -50,15 +50,15 @@ void KUpdateStockPriceDlg::init() m_okButton->setGuiItem(KStdGuiItem::ok()); m_cancelButton->setGuiItem(KStdGuiItem::cancel()); - connect(m_okButton, SIGNAL(clicked()), this, SLOT(accept())); - connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); + connect(m_okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept())); + connect(m_cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); - connect(m_security, SIGNAL(activated(int)), this, SLOT(slotCheckData())); - connect(m_currency, SIGNAL(activated(int)), this, SLOT(slotCheckData())); + connect(m_security, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotCheckData())); + connect(m_currency, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotCheckData())); // load initial values into the selection widgets - m_currency->update(QString()); - m_security->update(QString()); + m_currency->update(TQString()); + m_security->update(TQString()); slotCheckData(); } @@ -71,8 +71,8 @@ int KUpdateStockPriceDlg::exec(void) void KUpdateStockPriceDlg::slotCheckData(void) { - QString from = m_security->security().id(); - QString to = m_currency->security().id(); + TQString from = m_security->security().id(); + TQString to = m_currency->security().id(); m_okButton->setEnabled(!from.isEmpty() && !to.isEmpty() && from != to); } diff --git a/kmymoney2/dialogs/kupdatestockpricedlg.h b/kmymoney2/dialogs/kupdatestockpricedlg.h index c7dd407..ed75120 100644 --- a/kmymoney2/dialogs/kupdatestockpricedlg.h +++ b/kmymoney2/dialogs/kupdatestockpricedlg.h @@ -31,7 +31,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -55,12 +55,13 @@ class KUpdateStockPriceDlg : public kUpdateStockPriceDecl { Q_OBJECT + TQ_OBJECT public: - KUpdateStockPriceDlg(QWidget* parent = NULL, const char* name = NULL); + KUpdateStockPriceDlg(TQWidget* tqparent = NULL, const char* name = NULL); ~KUpdateStockPriceDlg(); - const QDate date() const { return m_date->date(); }; + const TQDate date() const { return m_date->date(); }; const MyMoneyMoney price(void) const; public slots: diff --git a/kmymoney2/dialogs/kupdatestockpricedlgdecl.ui b/kmymoney2/dialogs/kupdatestockpricedlgdecl.ui index d9770b2..1e41eaa 100644 --- a/kmymoney2/dialogs/kupdatestockpricedlgdecl.ui +++ b/kmymoney2/dialogs/kupdatestockpricedlgdecl.ui @@ -1,6 +1,6 @@ kUpdateStockPriceDecl - + kUpdateStockPriceDecl @@ -19,17 +19,17 @@ unnamed - + - layout38 + tqlayout38 unnamed - + - layout37 + tqlayout37 @@ -50,7 +50,7 @@ Expanding - + 71 21 @@ -59,9 +59,9 @@ - + - layout36 + tqlayout36 @@ -90,7 +90,7 @@ Expanding - + 40 20 @@ -99,7 +99,7 @@ - + textLabel2 @@ -107,7 +107,7 @@ Currency - + lblDate @@ -115,7 +115,7 @@ Date: - + textLabel1 @@ -123,9 +123,9 @@ Security - + - layout35 + tqlayout35 @@ -154,7 +154,7 @@ Expanding - + 40 20 @@ -175,7 +175,7 @@ Expanding - + 31 40 @@ -196,9 +196,9 @@ Horizontal - + - layout9 + tqlayout9 @@ -214,7 +214,7 @@ Expanding - + 71 21 @@ -253,5 +253,8 @@ - + + + kmymoney/kmymoneydateinput.h + diff --git a/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp b/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp index cc43ced..cdb7a34 100644 --- a/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp +++ b/kmymoney2/dialogs/mymoneyqifprofileeditor.cpp @@ -18,11 +18,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -48,8 +48,8 @@ #include "mymoneyqifprofileeditor.h" -MyMoneyQifProfileNameValidator::MyMoneyQifProfileNameValidator(QObject *o, const char *name) - : QValidator(o, name) +MyMoneyQifProfileNameValidator::MyMoneyQifProfileNameValidator(TQObject *o, const char *name) + : TQValidator(o, name) { } @@ -57,26 +57,26 @@ MyMoneyQifProfileNameValidator::~MyMoneyQifProfileNameValidator() { } -QValidator::State MyMoneyQifProfileNameValidator::validate(QString& name, int&) const +TQValidator::State MyMoneyQifProfileNameValidator::validate(TQString& name, int&) const { KConfig* config = KGlobal::config(); config->setGroup("Profiles"); - QStringList list = config->readListEntry("profiles"); + TQStringList list = config->readListEntry("profiles"); // invalid character? - if(name.contains(",") != 0) - return QValidator::Invalid; + if(name.tqcontains(",") != 0) + return TQValidator::Invalid; // would not work in this form (empty or existing name) - if(name.isEmpty() || list.contains(name)) - return QValidator::Intermediate; + if(name.isEmpty() || list.tqcontains(name)) + return TQValidator::Intermediate; // is OK - return QValidator::Acceptable; + return TQValidator::Acceptable; } -MyMoneyQifProfileEditor::MyMoneyQifProfileEditor(const bool edit, QWidget *parent, const char *name ) - : MyMoneyQifProfileEditorDecl(parent,name), +MyMoneyQifProfileEditor::MyMoneyQifProfileEditor(const bool edit, TQWidget *tqparent, const char *name ) + : MyMoneyQifProfileEditorDecl(tqparent,name), m_inEdit(edit), m_isDirty(false), m_isAccepted(false), @@ -92,42 +92,42 @@ MyMoneyQifProfileEditor::MyMoneyQifProfileEditor(const bool edit, QWidget *paren // load button icons KIconLoader* il = KGlobal::iconLoader(); KGuiItem newButtenItem( i18n( "&New" ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new profile"), - i18n("Use this to create a new QIF import/export profile")); + i18n("Use this to create a new TQIF import/export profile")); m_newButton->setGuiItem(newButtenItem); - connect(m_profileListBox, SIGNAL(highlighted(const QString&)), this, SLOT(slotLoadProfileFromConfig(const QString&))); - connect(m_resetButton, SIGNAL(clicked()), this, SLOT(slotReset())); - connect(m_okButton, SIGNAL(clicked()), this, SLOT(slotOk())); - connect(m_renameButton, SIGNAL(clicked()), this, SLOT(slotRename())); - connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(slotDelete())); - connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNew())); - connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject())); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect(m_profileListBox, TQT_SIGNAL(highlighted(const TQString&)), this, TQT_SLOT(slotLoadProfileFromConfig(const TQString&))); + connect(m_resetButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReset())); + connect(m_okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotOk())); + connect(m_renameButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRename())); + connect(m_deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDelete())); + connect(m_newButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNew())); + connect(m_cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); - connect(m_editDescription, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setProfileDescription(const QString&))); - connect(m_editType, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setProfileType(const QString&))); - connect(m_editOpeningBalance, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setOpeningBalanceText(const QString&))); - connect(m_editAccountDelimiter, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setAccountDelimiter(const QString&))); - connect(m_editVoidMark, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setVoidMark(const QString&))); + connect(m_editDescription, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setProfileDescription(const TQString&))); + connect(m_editType, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setProfileType(const TQString&))); + connect(m_editOpeningBalance, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setOpeningBalanceText(const TQString&))); + connect(m_editAccountDelimiter, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setAccountDelimiter(const TQString&))); + connect(m_editVoidMark, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setVoidMark(const TQString&))); - //connect(m_editDateFormat, SIGNAL(highlighted(const QString&)), &m_profile, SLOT(setDateFormat(const QString&))); - connect(m_editApostrophe, SIGNAL(highlighted(const QString&)), &m_profile, SLOT(setApostropheFormat(const QString&))); + //connect(m_editDateFormat, TQT_SIGNAL(highlighted(const TQString&)), &m_profile, TQT_SLOT(setDateFormat(const TQString&))); + connect(m_editApostrophe, TQT_SIGNAL(highlighted(const TQString&)), &m_profile, TQT_SLOT(setApostropheFormat(const TQString&))); - connect(m_editAmounts, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotAmountTypeSelected(QListViewItem*))); - connect(m_decimalBox, SIGNAL(activated(const QString&)), this, SLOT(slotDecimalChanged(const QString&))); - connect(m_thousandsBox, SIGNAL(activated(const QString&)), this, SLOT(slotThousandsChanged(const QString&))); + connect(m_editAmounts, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotAmountTypeSelected(TQListViewItem*))); + connect(m_decimalBox, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotDecimalChanged(const TQString&))); + connect(m_thousandsBox, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(slotThousandsChanged(const TQString&))); - connect(m_editInputFilterLocation, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setFilterScriptImport(const QString&))); - connect(m_editInputFilterLocation, SIGNAL(urlSelected(const QString&)), m_editInputFilterLocation, SLOT(setURL(const QString&))); + connect(m_editInputFilterLocation, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setFilterScriptImport(const TQString&))); + connect(m_editInputFilterLocation, TQT_SIGNAL(urlSelected(const TQString&)), m_editInputFilterLocation, TQT_SLOT(setURL(const TQString&))); - connect(m_editInputFilterFileType, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setFilterFileType(const QString&))); + connect(m_editInputFilterFileType, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setFilterFileType(const TQString&))); - connect(m_editOutputFilterLocation, SIGNAL(textChanged(const QString&)), &m_profile, SLOT(setFilterScriptExport(const QString&))); - connect(m_editOutputFilterLocation, SIGNAL(urlSelected(const QString&)), m_editOutputFilterLocation, SLOT(setURL(const QString&))); + connect(m_editOutputFilterLocation, TQT_SIGNAL(textChanged(const TQString&)), &m_profile, TQT_SLOT(setFilterScriptExport(const TQString&))); + connect(m_editOutputFilterLocation, TQT_SIGNAL(urlSelected(const TQString&)), m_editOutputFilterLocation, TQT_SLOT(setURL(const TQString&))); - connect(m_attemptMatch, SIGNAL(toggled(bool)), &m_profile, SLOT(setAttemptMatchDuplicates(bool))); + connect(m_attemptMatch, TQT_SIGNAL(toggled(bool)), &m_profile, TQT_SLOT(setAttemptMatchDuplicates(bool))); } MyMoneyQifProfileEditor::~MyMoneyQifProfileEditor() @@ -145,9 +145,9 @@ MyMoneyQifProfileEditor::~MyMoneyQifProfileEditor() void MyMoneyQifProfileEditor::loadWidgets(void) { if(m_inEdit) - setCaption(i18n("QIF Profile Editor")); + setCaption(i18n("TQIF Profile Editor")); else - setCaption(i18n("QIF Profile Selector")); + setCaption(i18n("TQIF Profile Selector")); m_editDateFormat->clear(); m_editDateFormat->insertItem( "%d/%m/%yy" ); @@ -175,12 +175,12 @@ void MyMoneyQifProfileEditor::loadWidgets(void) m_editApostrophe->insertItem( "1900-1999" ); m_editApostrophe->insertItem( "2000-2099" ); - m_editAmounts->setColumnAlignment(1, Qt::AlignCenter); - m_editAmounts->setColumnAlignment(2, Qt::AlignCenter); - m_editAmounts->setColumnAlignment(3, Qt::AlignCenter); + m_editAmounts->setColumnAlignment(1, TQt::AlignCenter); + m_editAmounts->setColumnAlignment(2, TQt::AlignCenter); + m_editAmounts->setColumnAlignment(3, TQt::AlignCenter); m_editAmounts->setColumnWidth(4, 0); - m_editAmounts->setColumnWidthMode(4, QListView::Manual); + m_editAmounts->setColumnWidthMode(4, TQListView::Manual); m_editAmounts->setSorting(4); m_editAmounts->sort(); @@ -216,7 +216,7 @@ void MyMoneyQifProfileEditor::loadWidgets(void) void MyMoneyQifProfileEditor::loadProfileListFromConfig(void) { - QFontMetrics fontMetrics(m_profileListBox->font()); + TQFontMetrics fontMetrics(m_profileListBox->font()); int w = 100; // minimum is 100 pixels width for the list box if(m_profile.isDirty()) { @@ -226,14 +226,14 @@ void MyMoneyQifProfileEditor::loadProfileListFromConfig(void) m_profileListBox->clear(); - QStringList list; + TQStringList list; KConfig* config = KGlobal::config(); config->setGroup("Profiles"); list = config->readListEntry("profiles"); if(list.count() == 0) { m_profile.clear(); - m_profile.setProfileDescription(i18n("The default QIF profile")); + m_profile.setProfileDescription(i18n("The default TQIF profile")); addProfile("Default"); config->setGroup("Profiles"); @@ -249,28 +249,28 @@ void MyMoneyQifProfileEditor::loadProfileListFromConfig(void) } for(unsigned int i = 0; i < list.count(); ++i) { int nw = fontMetrics.width(list[i]) + 10; - w = QMAX( w, nw ); + w = TQMAX( w, nw ); } - w = QMIN(w, 200); + w = TQMIN(w, 200); m_profileListBox->setMinimumWidth(w); } -void MyMoneyQifProfileEditor::slotLoadProfileFromConfig(const QString& profile) +void MyMoneyQifProfileEditor::slotLoadProfileFromConfig(const TQString& profile) { - QString profileName = profile; + TQString profileName = profile; if(m_profile.isDirty()) { m_profile.saveProfile(); m_isDirty = true; } - if(m_profileListBox->findItem(profileName, Qt::ExactMatch | Qt::CaseSensitive) == NULL) { + if(m_profileListBox->tqfindItem(profileName, TQt::ExactMatch | TQt::CaseSensitive) == NULL) { profileName = m_profileListBox->text(0); } m_profile.loadProfile("Profile-" + profileName); - QListBoxItem *lbi = m_profileListBox->findItem(profileName, Qt::ExactMatch | Qt::CaseSensitive); + TQListBoxItem *lbi = m_profileListBox->tqfindItem(profileName, TQt::ExactMatch | TQt::CaseSensitive); int idx = m_profileListBox->index(lbi); showProfile(); if(idx >= 0) { @@ -294,11 +294,11 @@ void MyMoneyQifProfileEditor::showProfile(void) m_attemptMatch->setChecked(m_profile.attemptMatchDuplicates()); - QListViewItem* item; - QListViewItemIterator it(m_editAmounts); + TQListViewItem* item; + TQListViewItemIterator it(m_editAmounts); while((item = it.current()) != 0) { - QChar key = item->text(1)[0]; + TQChar key = item->text(1)[0]; item->setText(2, m_profile.amountDecimal(key)); item->setText(3, m_profile.amountThousands(key)); if(m_selectedAmountType == 0 && key == 'T' && m_inEdit) { @@ -311,25 +311,25 @@ void MyMoneyQifProfileEditor::showProfile(void) } } -void MyMoneyQifProfileEditor::deleteProfile(const QString& name) +void MyMoneyQifProfileEditor::deleteProfile(const TQString& name) { KConfig* config = KGlobal::config(); config->deleteGroup("Profile-" + name); config->setGroup("Profiles"); - QStringList list = config->readListEntry("profiles"); + TQStringList list = config->readListEntry("profiles"); list.remove(name); config->writeEntry("profiles", list); m_isDirty = true; } -void MyMoneyQifProfileEditor::addProfile(const QString& name) +void MyMoneyQifProfileEditor::addProfile(const TQString& name) { KConfig* config = KGlobal::config(); config->setGroup("Profiles"); - QStringList list = config->readListEntry("profiles"); + TQStringList list = config->readListEntry("profiles"); list += name; list.sort(); @@ -364,7 +364,7 @@ void MyMoneyQifProfileEditor::slotReset(void) config->rollback(); config->reparseConfiguration(); - QString currentProfile = m_profile.profileName().mid(8); + TQString currentProfile = m_profile.profileName().mid(8); loadProfileListFromConfig(); slotLoadProfileFromConfig(currentProfile); m_isDirty = false; @@ -373,7 +373,7 @@ void MyMoneyQifProfileEditor::slotReset(void) void MyMoneyQifProfileEditor::slotRename(void) { bool ok; - QString newName = enterName(ok); + TQString newName = enterName(ok); if(ok == true) { deleteProfile(m_profile.profileName().mid(8)); @@ -386,7 +386,7 @@ void MyMoneyQifProfileEditor::slotRename(void) void MyMoneyQifProfileEditor::slotNew(void) { bool ok; - QString newName = enterName(ok); + TQString newName = enterName(ok); if(ok == true) { m_profile.clear(); @@ -396,20 +396,20 @@ void MyMoneyQifProfileEditor::slotNew(void) } } -const QString MyMoneyQifProfileEditor::enterName(bool& ok) +const TQString MyMoneyQifProfileEditor::enterName(bool& ok) { - MyMoneyQifProfileNameValidator val(this, "Validator"); + MyMoneyQifProfileNameValidator val(TQT_TQOBJECT(this), "Validator"); #if KDE_IS_VERSION(3,2,0) - return KInputDialog::getText(i18n("QIF Profile Editor"), + return KInputDialog::getText(i18n("TQIF Profile Editor"), i18n("Enter new profile name"), - QString::null, + TQString(), &ok, this, 0, &val, 0); #else - QString rc; + TQString rc; // the blank in the next line as the value for the edit box is // there on purpose, so that with the following call to validateAndSet @@ -431,9 +431,9 @@ const QString MyMoneyQifProfileEditor::enterName(bool& ok) void MyMoneyQifProfileEditor::slotDelete(void) { - QString profile = m_profile.profileName().mid(8); + TQString profile = m_profile.profileName().mid(8); - if(KMessageBox::questionYesNo(this, i18n("Do you really want to delete profile '%1'?").arg(profile)) == KMessageBox::Yes) { + if(KMessageBox::questionYesNo(this, i18n("Do you really want to delete profile '%1'?").tqarg(profile)) == KMessageBox::Yes) { int idx = m_profileListBox->currentItem(); m_profile.saveProfile(); deleteProfile(profile); @@ -450,32 +450,32 @@ void MyMoneyQifProfileEditor::slotHelp(void) kapp->invokeHelp("details.impexp.qifimp.profile"); } -void MyMoneyQifProfileEditor::slotAmountTypeSelected(QListViewItem* item) +void MyMoneyQifProfileEditor::slotAmountTypeSelected(TQListViewItem* item) { m_decimalBox->setCurrentText(item->text(2)); m_thousandsBox->setCurrentText(item->text(3)); m_selectedAmountType = item; } -void MyMoneyQifProfileEditor::slotDecimalChanged(const QString& val) +void MyMoneyQifProfileEditor::slotDecimalChanged(const TQString& val) { if(m_selectedAmountType != 0) { - QChar key = m_selectedAmountType->text(1)[0]; + TQChar key = m_selectedAmountType->text(1)[0]; m_profile.setAmountDecimal(key, val[0]); m_selectedAmountType->setText(2, val); } } -void MyMoneyQifProfileEditor::slotThousandsChanged(const QString& val) +void MyMoneyQifProfileEditor::slotThousandsChanged(const TQString& val) { if(m_selectedAmountType != 0) { - QChar key = m_selectedAmountType->text(1)[0]; + TQChar key = m_selectedAmountType->text(1)[0]; m_profile.setAmountThousands(key, val[0]); m_selectedAmountType->setText(3, val); } } -const QString MyMoneyQifProfileEditor::selectedProfile() const +const TQString MyMoneyQifProfileEditor::selectedProfile() const { return m_profileListBox->currentText(); } diff --git a/kmymoney2/dialogs/mymoneyqifprofileeditor.h b/kmymoney2/dialogs/mymoneyqifprofileeditor.h index ce95c9a..67993c2 100644 --- a/kmymoney2/dialogs/mymoneyqifprofileeditor.h +++ b/kmymoney2/dialogs/mymoneyqifprofileeditor.h @@ -15,15 +15,15 @@ * * ***************************************************************************/ -#ifndef MYMONEYQIFPROFILEEDITOR_H -#define MYMONEYQIFPROFILEEDITOR_H +#ifndef MYMONEYTQIFPROFILEEDITOR_H +#define MYMONEYTQIFPROFILEEDITOR_H // ---------------------------------------------------------------------------- // QT Includes -#include -#include -class QListViewItem; +#include +#include +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes @@ -38,59 +38,61 @@ class QListViewItem; * @author Thomas Baumgart */ -class MyMoneyQifProfileNameValidator : public QValidator +class MyMoneyQifProfileNameValidator : public TQValidator { Q_OBJECT + TQ_OBJECT public: - MyMoneyQifProfileNameValidator(QObject *o, const char *name); + MyMoneyQifProfileNameValidator(TQObject *o, const char *name); virtual ~MyMoneyQifProfileNameValidator(); - QValidator::State validate(QString&, int&) const; + TQValidator::State validate(TQString&, int&) const; }; class MyMoneyQifProfileEditor : public MyMoneyQifProfileEditorDecl { Q_OBJECT + TQ_OBJECT public: - MyMoneyQifProfileEditor(const bool edit = false, QWidget *parent=0, const char *name=0); + MyMoneyQifProfileEditor(const bool edit = false, TQWidget *tqparent=0, const char *name=0); virtual ~MyMoneyQifProfileEditor(); /** * This method returns the currently selected profile in the list box. */ - const QString selectedProfile() const; + const TQString selectedProfile() const; public slots: void slotOk(void); protected slots: - void slotLoadProfileFromConfig(const QString& name); + void slotLoadProfileFromConfig(const TQString& name); void slotReset(void); void slotRename(void); void slotDelete(void); void slotNew(void); - void slotAmountTypeSelected(QListViewItem*); - void slotDecimalChanged(const QString& val); - void slotThousandsChanged(const QString& val); + void slotAmountTypeSelected(TQListViewItem*); + void slotDecimalChanged(const TQString& val); + void slotThousandsChanged(const TQString& val); void slotHelp(void); private: void loadProfileListFromConfig(void); void loadWidgets(void); void showProfile(void); - void addProfile(const QString& name); - void deleteProfile(const QString& name); - const QString enterName(bool& ok); + void addProfile(const TQString& name); + void deleteProfile(const TQString& name); + const TQString enterName(bool& ok); private: bool m_inEdit; MyMoneyQifProfile m_profile; bool m_isDirty; bool m_isAccepted; - QListViewItem* m_selectedAmountType; + TQListViewItem* m_selectedAmountType; }; #endif diff --git a/kmymoney2/dialogs/mymoneyqifprofileeditordecl.ui b/kmymoney2/dialogs/mymoneyqifprofileeditordecl.ui index 43e56fa..b88f241 100644 --- a/kmymoney2/dialogs/mymoneyqifprofileeditordecl.ui +++ b/kmymoney2/dialogs/mymoneyqifprofileeditordecl.ui @@ -1,6 +1,6 @@ MyMoneyQifProfileEditorDecl - + MyMoneyQifProfileEditorDecl @@ -28,15 +28,15 @@ 6 - + - layout15 + tqlayout15 unnamed - + @@ -57,11 +57,11 @@ true - + profileTabs - + tabGeneral @@ -72,19 +72,19 @@ unnamed - + - layout9 + tqlayout9 unnamed - + TextLabel2_2_3 - + 140 0 @@ -94,11 +94,11 @@ Void mark - + TextLabel2_2 - + 140 0 @@ -113,11 +113,11 @@ m_editOpeningBalance - + TextLabel2 - + 140 0 @@ -137,11 +137,11 @@ m_editVoidMark - + TextLabel2_2_2 - + 140 0 @@ -161,11 +161,11 @@ m_editDescription - + TextLabel1 - + 140 0 @@ -177,7 +177,7 @@ - + m_attemptMatch @@ -195,7 +195,7 @@ Expanding - + 20 20 @@ -204,7 +204,7 @@ - + tabDate @@ -215,17 +215,17 @@ unnamed - + - layout43 + tqlayout43 unnamed - + - layout36 + tqlayout36 @@ -239,11 +239,11 @@ The format of the dates in the QIF file. - + TextLabel3 - + 140 0 @@ -264,11 +264,11 @@ If a QIF file contains date entries with years represented with two digits then either an apostrophe or a slash may be used to delimit the year in the dates for certain centuries. This enables 1905 to be distinguished from 2005. Specify here which range of years will have year delimited by an apostrophe (eg. for Quicken this is usually 1900-1949). - + TextLabel4 - + 140 0 @@ -293,7 +293,7 @@ Expanding - + 90 20 @@ -312,7 +312,7 @@ Expanding - + 20 80 @@ -321,7 +321,7 @@ - + tabMoney @@ -332,7 +332,7 @@ unnamed - + Field @@ -561,17 +561,17 @@ Accept - + - layout41 + tqlayout41 unnamed - + - layout40 + tqlayout40 @@ -582,11 +582,11 @@ m_thousandsBox - + TextLabel1_2 - + 150 0 @@ -596,11 +596,11 @@ Decimal Symbol - + TextLabel1_3 - + 150 0 @@ -627,7 +627,7 @@ Expanding - + 100 20 @@ -646,7 +646,7 @@ Expanding - + 16 16 @@ -655,7 +655,7 @@ - + tabFilter @@ -666,19 +666,19 @@ unnamed - + - layout14 + tqlayout14 unnamed - + TextLabel1_4_2 - + 140 0 @@ -701,11 +701,11 @@ false - + TextLabel1_4_3 - + 140 0 @@ -715,7 +715,7 @@ Input filter file type - + m_editInputFilterFileType @@ -723,11 +723,11 @@ *.qif - + TextLabel1_4 - + 140 0 @@ -749,7 +749,7 @@ Expanding - + 20 90 @@ -761,7 +761,7 @@ - + Layout14 @@ -823,7 +823,7 @@ Expanding - + 104 0 @@ -901,5 +901,5 @@ m_editInputFilterLocation m_editOutputFilterLocation - + diff --git a/kmymoney2/dialogs/settings/ksettingscolors.cpp b/kmymoney2/dialogs/settings/ksettingscolors.cpp index 727241c..06a5199 100644 --- a/kmymoney2/dialogs/settings/ksettingscolors.cpp +++ b/kmymoney2/dialogs/settings/ksettingscolors.cpp @@ -25,8 +25,8 @@ #include "ksettingscolors.h" -KSettingsColors::KSettingsColors(QWidget* parent, const char* name) : - KSettingsColorsDecl(parent, name) +KSettingsColors::KSettingsColors(TQWidget* tqparent, const char* name) : + KSettingsColorsDecl(tqparent, name) { } diff --git a/kmymoney2/dialogs/settings/ksettingscolors.h b/kmymoney2/dialogs/settings/ksettingscolors.h index 896ad85..0f877a2 100644 --- a/kmymoney2/dialogs/settings/ksettingscolors.h +++ b/kmymoney2/dialogs/settings/ksettingscolors.h @@ -31,9 +31,10 @@ class KSettingsColors : public KSettingsColorsDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsColors(QWidget* parent = 0, const char* name = 0); + KSettingsColors(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsColors(); }; #endif diff --git a/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui b/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui index 2d4d15b..98fe42b 100644 --- a/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui @@ -1,6 +1,6 @@ KSettingsColorsDecl - + KSettingsColorsDecl @@ -19,11 +19,11 @@ unnamed - + tabWidget2 - + tab @@ -34,7 +34,7 @@ unnamed - + groupBox3 @@ -45,7 +45,7 @@ unnamed - + textLabel3 @@ -53,7 +53,7 @@ Grid color - + textLabel1_3 @@ -61,7 +61,7 @@ Erronous transaction - + textLabel4 @@ -99,7 +99,7 @@ - + textLabel5 @@ -157,7 +157,7 @@ Expanding - + 21 20 @@ -166,7 +166,7 @@ - + tab @@ -177,7 +177,7 @@ unnamed - + kcfg_useSystemColors @@ -185,7 +185,7 @@ Use system colors - + m_individualColorFrame @@ -196,7 +196,7 @@ unnamed - + textLabel2 @@ -204,7 +204,7 @@ Normal - + textLabel1 @@ -252,7 +252,7 @@ - + groupBox5 @@ -263,7 +263,7 @@ unnamed - + textLabel1_5 @@ -286,7 +286,7 @@ - + textLabel1_2 @@ -317,7 +317,7 @@ - + textLabel1_4 @@ -340,7 +340,7 @@ - + textLabel2_2 @@ -382,7 +382,7 @@ Expanding - + 20 20 @@ -402,5 +402,5 @@ setDisabled(bool) - + diff --git a/kmymoney2/dialogs/settings/ksettingsfonts.cpp b/kmymoney2/dialogs/settings/ksettingsfonts.cpp index a4aef71..c21437d 100644 --- a/kmymoney2/dialogs/settings/ksettingsfonts.cpp +++ b/kmymoney2/dialogs/settings/ksettingsfonts.cpp @@ -25,8 +25,8 @@ #include "ksettingsfonts.h" -KSettingsFonts::KSettingsFonts(QWidget* parent, const char* name) : - KSettingsFontsDecl(parent, name) +KSettingsFonts::KSettingsFonts(TQWidget* tqparent, const char* name) : + KSettingsFontsDecl(tqparent, name) { } diff --git a/kmymoney2/dialogs/settings/ksettingsfonts.h b/kmymoney2/dialogs/settings/ksettingsfonts.h index 40cb9de..eda94fd 100644 --- a/kmymoney2/dialogs/settings/ksettingsfonts.h +++ b/kmymoney2/dialogs/settings/ksettingsfonts.h @@ -31,9 +31,10 @@ class KSettingsFonts : public KSettingsFontsDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsFonts(QWidget* parent = 0, const char* name = 0); + KSettingsFonts(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsFonts(); }; #endif diff --git a/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui b/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui index cbaefeb..6cb100a 100644 --- a/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui @@ -1,6 +1,6 @@ KSettingsFontsDecl - + KSettingsFontsDecl @@ -19,7 +19,7 @@ unnamed - + kcfg_useSystemFont @@ -27,7 +27,7 @@ Use system fonts - + m_individualFontsFrame @@ -58,7 +58,7 @@ Expanding - + 110 20 @@ -75,14 +75,14 @@ Expanding - + 100 20 - + textLabel1 @@ -90,7 +90,7 @@ Cell font - + textLabel2 @@ -110,7 +110,7 @@ Expanding - + 20 30 @@ -127,5 +127,5 @@ setDisabled(bool) - + diff --git a/kmymoney2/dialogs/settings/ksettingsforecast.cpp b/kmymoney2/dialogs/settings/ksettingsforecast.cpp index 0a74252..d3e8770 100644 --- a/kmymoney2/dialogs/settings/ksettingsforecast.cpp +++ b/kmymoney2/dialogs/settings/ksettingsforecast.cpp @@ -25,8 +25,8 @@ #include "ksettingsforecast.h" -KSettingsForecast::KSettingsForecast(QWidget* parent, const char* name) : - KSettingsForecastDecl(parent, name) +KSettingsForecast::KSettingsForecast(TQWidget* tqparent, const char* name) : + KSettingsForecastDecl(tqparent, name) { } diff --git a/kmymoney2/dialogs/settings/ksettingsforecast.h b/kmymoney2/dialogs/settings/ksettingsforecast.h index 7195eee..4423a39 100644 --- a/kmymoney2/dialogs/settings/ksettingsforecast.h +++ b/kmymoney2/dialogs/settings/ksettingsforecast.h @@ -32,9 +32,10 @@ class KSettingsForecast : public KSettingsForecastDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsForecast(QWidget* parent = 0, const char* name = 0); + KSettingsForecast(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsForecast(); }; #endif diff --git a/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui b/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui index c412f81..c3f90df 100644 --- a/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui @@ -1,6 +1,6 @@ KSettingsForecastDecl - + KSettingsForecastDecl @@ -19,7 +19,7 @@ unnamed - + groupBox6 @@ -38,28 +38,28 @@ unnamed - + - layout7 + tqlayout7 unnamed - + - layout5 + tqlayout5 unnamed - + kcfg_forecastAccountCycle - + textLabel2 @@ -67,12 +67,12 @@ Number of Days of Account Cycle: - + kcfg_forecastDays - + textLabel1 @@ -80,12 +80,12 @@ Day of Month to start Forecast: - + kcfg_beginForecastDay - + textLabel4 @@ -105,7 +105,7 @@ Expanding - + 133 21 @@ -114,7 +114,7 @@ - + kcfg_forecastMethod @@ -125,7 +125,7 @@ unnamed - + radioButton9 @@ -136,7 +136,7 @@ 0 - + radioButton10 @@ -149,7 +149,7 @@ - + groupBox3 @@ -164,7 +164,7 @@ unnamed - + textLabel3 @@ -172,7 +172,7 @@ Number of Cycles to use in Forecast: - + kcfg_forecastCycles @@ -187,7 +187,7 @@ Expanding - + 130 21 @@ -195,7 +195,7 @@ - + kcfg_historyMethod @@ -206,7 +206,7 @@ unnamed - + radioButton11 @@ -217,7 +217,7 @@ 0 - + radioButton12 @@ -228,7 +228,7 @@ 1 - + radioButton13 @@ -255,7 +255,7 @@ Expanding - + 20 40 @@ -264,5 +264,5 @@ - + diff --git a/kmymoney2/dialogs/settings/ksettingsgeneral.cpp b/kmymoney2/dialogs/settings/ksettingsgeneral.cpp index 5acdd08..e36530f 100644 --- a/kmymoney2/dialogs/settings/ksettingsgeneral.cpp +++ b/kmymoney2/dialogs/settings/ksettingsgeneral.cpp @@ -17,7 +17,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -31,8 +31,8 @@ #include #include "ksettingsgeneral.h" -KSettingsGeneral::KSettingsGeneral(QWidget* parent, const char* name) : - KSettingsGeneralDecl(parent, name) +KSettingsGeneral::KSettingsGeneral(TQWidget* tqparent, const char* name) : + KSettingsGeneralDecl(tqparent, name) { // hide the internally used date field kcfg_StartDate->hide(); @@ -43,20 +43,20 @@ KSettingsGeneral::KSettingsGeneral(QWidget* parent, const char* name) : m_viewList->hide(); // setup connections, so that the sort optios get loaded once the edit fields are filled - connect(kcfg_StartDate, SIGNAL(valueChanged(const QDate&)), this, SLOT(slotLoadStartDate(const QDate&))); + connect(kcfg_StartDate, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(slotLoadStartDate(const TQDate&))); // setup connections, so that changes by the user are forwarded to the (hidden) edit fields - connect(m_startDateEdit, SIGNAL(dateChanged(const QDate&)), kcfg_StartDate, SLOT(setDate(const QDate&))); + connect(m_startDateEdit, TQT_SIGNAL(dateChanged(const TQDate&)), kcfg_StartDate, TQT_SLOT(setDate(const TQDate&))); } KSettingsGeneral::~KSettingsGeneral() { } -void KSettingsGeneral::slotLoadStartDate(const QDate&) +void KSettingsGeneral::slotLoadStartDate(const TQDate&) { // only need this once - disconnect(kcfg_StartDate, SIGNAL(valueChanged(const QDate&)), this, SLOT(slotLoadStartDate(const QDate&))); + disconnect(kcfg_StartDate, TQT_SIGNAL(valueChanged(const TQDate&)), this, TQT_SLOT(slotLoadStartDate(const TQDate&))); m_startDateEdit->setDate(kcfg_StartDate->date()); } diff --git a/kmymoney2/dialogs/settings/ksettingsgeneral.h b/kmymoney2/dialogs/settings/ksettingsgeneral.h index 3bd0992..246a600 100644 --- a/kmymoney2/dialogs/settings/ksettingsgeneral.h +++ b/kmymoney2/dialogs/settings/ksettingsgeneral.h @@ -31,13 +31,14 @@ class KSettingsGeneral : public KSettingsGeneralDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsGeneral(QWidget* parent = 0, const char* name = 0); + KSettingsGeneral(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsGeneral(); protected slots: - void slotLoadStartDate(const QDate&); + void slotLoadStartDate(const TQDate&); }; #endif diff --git a/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui b/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui index 9eeb181..b851f2b 100644 --- a/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui @@ -1,6 +1,6 @@ KSettingsGeneralDecl - + KSettingsGeneralDecl @@ -19,11 +19,11 @@ unnamed - + tabWidget2 - + tab @@ -34,7 +34,7 @@ unnamed - + kcfg_StartLastViewSelected @@ -48,7 +48,7 @@ unnamed - + radioButton1 @@ -62,7 +62,7 @@ 0 - + radioButton2 @@ -75,7 +75,7 @@ - + groupBox1 @@ -86,7 +86,7 @@ unnamed - + textLabel1 @@ -94,7 +94,7 @@ Price precision - + kcfg_PricePrecision @@ -102,7 +102,7 @@ 10 - + textLabel2 @@ -120,7 +120,7 @@ Expanding - + 61 21 @@ -129,7 +129,7 @@ - + groupBox3 @@ -140,7 +140,7 @@ unnamed - + kcfg_AutoSaveFile @@ -148,7 +148,7 @@ Autosave periodically - + m_periodFrame @@ -168,7 +168,7 @@ 0 - + kcfg_AutoSavePeriod @@ -176,7 +176,7 @@ 60 - + textLabel3 @@ -194,7 +194,7 @@ Expanding - + 354 20 @@ -205,7 +205,7 @@ - + groupBox6 @@ -216,7 +216,7 @@ unnamed - + textLabel1_2_2 @@ -304,7 +304,7 @@ Expanding - + 90 20 @@ -323,7 +323,7 @@ Expanding - + 20 20 @@ -332,7 +332,7 @@ - + tab @@ -343,7 +343,7 @@ unnamed - + kcfg_syncLedgerInvestment @@ -359,14 +359,14 @@ true - + m_viewLabel Check the views you want to enable, uncheck those you want to hide, because you don't need the functionality. - + WordBreak|AlignTop @@ -383,7 +383,7 @@ - + kcfg_iconSize @@ -397,7 +397,7 @@ unnamed - + radioButton3 @@ -405,7 +405,7 @@ Micro (16px) - + radioButton4 @@ -413,7 +413,7 @@ Small (32px) - + radioButton5 @@ -424,7 +424,7 @@ true - + radioButton6 @@ -434,7 +434,7 @@ - + kcfg_showTitleBar @@ -452,7 +452,7 @@ Expanding - + 20 21 @@ -461,7 +461,7 @@ - + TabPage @@ -472,7 +472,7 @@ unnamed - + groupBox2 @@ -483,7 +483,7 @@ unnamed - + kcfg_HideUnusedCategory @@ -494,7 +494,7 @@ This option hides all categories in the categories view that are not used in at least a single transaction. They are still shown in the category selection lists. - + kcfg_HideClosedAccounts @@ -507,7 +507,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden accounts in the views. - + kcfg_ExpertMode @@ -517,7 +517,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden - + groupBox4 @@ -528,7 +528,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden unnamed - + kcfg_HideFinishedSchedules @@ -541,7 +541,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden - + groupBox5 @@ -552,15 +552,15 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden unnamed - + - layout2 + tqlayout2 unnamed - + textLabel1_3 @@ -573,7 +573,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden m_startDateEdit - + kcfg_StartDate @@ -588,7 +588,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden Expanding - + 63 20 @@ -597,7 +597,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden - + kcfg_HideReconciledTransactions @@ -620,7 +620,7 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden Expanding - + 20 30 @@ -642,5 +642,8 @@ You can use <b>View/Show all accounts</b> to temporarily show hidden setEnabled(bool) - + + kmymoney/kmymoneydateinput.h + + diff --git a/kmymoney2/dialogs/settings/ksettingsgpg.cpp b/kmymoney2/dialogs/settings/ksettingsgpg.cpp index 2dba83e..133700d 100644 --- a/kmymoney2/dialogs/settings/ksettingsgpg.cpp +++ b/kmymoney2/dialogs/settings/ksettingsgpg.cpp @@ -17,9 +17,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -40,8 +40,8 @@ #define RECOVER_KEY_ID "0xD2B08440" #define RECOVER_KEY_ID_FULL "59B0F826D2B08440" -KSettingsGpg::KSettingsGpg(QWidget* parent, const char* name) : - KSettingsGpgDecl(parent, name), +KSettingsGpg::KSettingsGpg(TQWidget* tqparent, const char* name) : + KSettingsGpgDecl(tqparent, name), m_checkCount(0), m_needCheckList(true), m_listOk(false) @@ -51,11 +51,11 @@ KSettingsGpg::KSettingsGpg(QWidget* parent, const char* name) : // don't show the widget in which the master key is actually kept kcfg_GpgRecipient->hide(); - connect(kcfg_WriteDataEncrypted, SIGNAL(toggled(bool)), this, SLOT(slotStatusChanged(bool))); - connect(m_masterKeyCombo, SIGNAL(activated(int)), this, SLOT(slotIdChanged())); - connect(kcfg_GpgRecipientList, SIGNAL(changed()), this, SLOT(slotIdChanged())); - connect(kcfg_GpgRecipientList, SIGNAL(added(const QString&)), this, SLOT(slotKeyListChanged())); - connect(kcfg_GpgRecipientList, SIGNAL(removed(const QString&)), this, SLOT(slotKeyListChanged())); + connect(kcfg_WriteDataEncrypted, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotStatusChanged(bool))); + connect(m_masterKeyCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotIdChanged())); + connect(kcfg_GpgRecipientList, TQT_SIGNAL(changed()), this, TQT_SLOT(slotIdChanged())); + connect(kcfg_GpgRecipientList, TQT_SIGNAL(added(const TQString&)), this, TQT_SLOT(slotKeyListChanged())); + connect(kcfg_GpgRecipientList, TQT_SIGNAL(removed(const TQString&)), this, TQT_SLOT(slotKeyListChanged())); // Initial state setup slotStatusChanged(kcfg_WriteDataEncrypted->isChecked()); @@ -93,8 +93,8 @@ void KSettingsGpg::slotIdChanged(void) // if it is available, then scan the current list if we need to if(keysOk) { if(m_needCheckList) { - QStringList keys = kcfg_GpgRecipientList->items(); - QStringList::const_iterator it_s; + TQStringList keys = kcfg_GpgRecipientList->items(); + TQStringList::const_iterator it_s; for(it_s = keys.begin(); keysOk && it_s != keys.end(); ++it_s) { if(!KGPGFile::keyAvailable(*it_s)) keysOk = false; @@ -115,7 +115,7 @@ void KSettingsGpg::slotIdChanged(void) // if we have a master key, we store it in the hidden widget if(m_masterKeyCombo->currentItem() != 0) { - QRegExp keyExp(".* \\((.*)\\)"); + TQRegExp keyExp(".* \\((.*)\\)"); if(keyExp.search(m_masterKeyCombo->currentText()) != -1) { kcfg_GpgRecipient->setText(keyExp.cap(1)); } @@ -131,10 +131,10 @@ void KSettingsGpg::slotIdChanged(void) void KSettingsGpg::show(void) { - QString masterKey; + TQString masterKey; if(m_masterKeyCombo->currentItem() != 0) { - QRegExp keyExp(".* \\((.*)\\)"); + TQRegExp keyExp(".* \\((.*)\\)"); if(keyExp.search(m_masterKeyCombo->currentText()) != -1) { masterKey = keyExp.cap(1); } @@ -143,19 +143,19 @@ void KSettingsGpg::show(void) // fill the secret key combobox with a fresh list m_masterKeyCombo->clear(); - QStringList keyList; + TQStringList keyList; KGPGFile::secretKeyList(keyList); - for(QStringList::iterator it = keyList.begin(); it != keyList.end(); ++it) { - QStringList fields = QStringList::split(":", *it); + for(TQStringList::iterator it = keyList.begin(); it != keyList.end(); ++it) { + TQStringList fields = TQStringList::split(":", *it); if(fields[0] != RECOVER_KEY_ID_FULL) { - // replace parenthesis in name field with brackets - QString name = fields[1]; - name.replace('(', "["); - name.replace(')', "]"); - name = QString("%1 (0x%2)").arg(name).arg(fields[0]); + // replace tqparenthesis in name field with brackets + TQString name = fields[1]; + name.tqreplace('(', "["); + name.tqreplace(')', "]"); + name = TQString("%1 (0x%2)").tqarg(name).tqarg(fields[0]); m_masterKeyCombo->insertItem(name); - if(name.contains(masterKey)) + if(name.tqcontains(masterKey)) m_masterKeyCombo->setCurrentItem(name); } } @@ -177,7 +177,7 @@ void KSettingsGpg::slotStatusChanged(bool state) state = false; if((state == true) && (oncePerSession == true) && isVisible()) { - KMessageBox::information(this, QString("%1").arg(i18n("You have turned on the GPG encryption support. This means, that new files will be stored encrypted. Existing files will not be encrypted automatically. To achieve encryption of existing files, please use the File/Save as... feature and store the file under a different name. Once confident with the result, feel free to delete the old file and rename the encrypted one to the old name.")), i18n("GPG encryption activated"), "GpgEncryptionActivated"); + KMessageBox::information(this, TQString("%1").tqarg(i18n("You have turned on the GPG encryption support. This means, that new files will be stored encrypted. Existing files will not be encrypted automatically. To achieve encryption of existing files, please use the File/Save as... feature and store the file under a different name. Once confident with the result, feel free to delete the old file and rename the encrypted one to the old name.")), i18n("GPG encryption activated"), "GpgEncryptionActivated"); oncePerSession = false; } diff --git a/kmymoney2/dialogs/settings/ksettingsgpg.h b/kmymoney2/dialogs/settings/ksettingsgpg.h index ecea6ab..2508192 100644 --- a/kmymoney2/dialogs/settings/ksettingsgpg.h +++ b/kmymoney2/dialogs/settings/ksettingsgpg.h @@ -32,9 +32,10 @@ class KSettingsGpg : public KSettingsGpgDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsGpg(QWidget* parent = 0, const char* name = 0); + KSettingsGpg(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsGpg(); public slots: diff --git a/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui b/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui index 15d3bbe..0d82e45 100644 --- a/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui @@ -1,6 +1,6 @@ KSettingsGpgDecl - + KSettingsGpgDecl @@ -24,7 +24,7 @@ The <i>additional recovery encryption</i> is only accessible, if the unnamed - + kcfg_WriteDataEncrypted @@ -32,7 +32,7 @@ The <i>additional recovery encryption</i> is only accessible, if the Use GPG encryption - + m_idGroup @@ -46,15 +46,15 @@ The <i>additional recovery encryption</i> is only accessible, if the unnamed - + - layout3 + tqlayout3 unnamed - + textLabel1_2 @@ -102,9 +102,9 @@ The <i>additional recovery encryption</i> is only accessible, if the Enter the id of the key you want to use for data encryption. This can either be an e-mail address or the hexadecimal key id. In case of the key id don't forget the leading 0x. - + - layout6 + tqlayout6 @@ -124,7 +124,7 @@ The <i>additional recovery encryption</i> is only accessible, if the This symbol denotes, if the key for the given user id has been found in your keyring. It is green when found, dark otherwise. - + textLabel1 @@ -142,7 +142,7 @@ The <i>additional recovery encryption</i> is only accessible, if the Expanding - + 50 20 @@ -151,9 +151,9 @@ The <i>additional recovery encryption</i> is only accessible, if the - + - layout5 + tqlayout5 @@ -173,7 +173,7 @@ The <i>additional recovery encryption</i> is only accessible, if the This symbol denotes, if the KMyMoney recovery key has been found in your keyring. It is green when found, dark otherwise. - + textLabel2 @@ -191,7 +191,7 @@ The <i>additional recovery encryption</i> is only accessible, if the Expanding - + 16 20 @@ -200,7 +200,7 @@ The <i>additional recovery encryption</i> is only accessible, if the - + kcfg_EncryptRecover @@ -225,7 +225,7 @@ This mechanism is provided for the case that you have lost your key and cannot a Expanding - + 21 30 @@ -234,5 +234,5 @@ This mechanism is provided for the case that you have lost your key and cannot a - + diff --git a/kmymoney2/dialogs/settings/ksettingshome.cpp b/kmymoney2/dialogs/settings/ksettingshome.cpp index d2f471b..a874de7 100644 --- a/kmymoney2/dialogs/settings/ksettingshome.cpp +++ b/kmymoney2/dialogs/settings/ksettingshome.cpp @@ -17,8 +17,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -38,8 +38,8 @@ #include "kmymoney2/kmymoneyglobalsettings.h" #include "kmymoney2/kmymoneyutils.h" -KSettingsHome::KSettingsHome(QWidget* parent, const char* name) : - KSettingsHomeDecl(parent, name), +KSettingsHome::KSettingsHome(TQWidget* tqparent, const char* name) : + KSettingsHomeDecl(tqparent, name), m_noNeedToUpdateList(false) { m_homePageList->addColumn(""); @@ -49,11 +49,11 @@ KSettingsHome::KSettingsHome(QWidget* parent, const char* name) : KIconLoader* il = KGlobal::iconLoader(); KGuiItem upButtonItem( i18n( "&Up" ), - QIconSet(il->loadIcon("up", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("up", KIcon::Small, KIcon::SizeSmall)), i18n("Move selected item up"), i18n("Use this to move the selected item up by one position in the list.")); KGuiItem downButtonItem( i18n( "&Down" ), - QIconSet(il->loadIcon("down", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("down", KIcon::Small, KIcon::SizeSmall)), i18n("Move selected item down"), i18n("Use this to move the selected item down by one position in the list.")); @@ -63,14 +63,14 @@ KSettingsHome::KSettingsHome(QWidget* parent, const char* name) : m_downButton->setEnabled(false); // connect this, so that the list gets loaded once the edit field is filled - connect(kcfg_ItemList, SIGNAL(textChanged()), this, SLOT(slotLoadItems())); + connect(kcfg_ItemList, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadItems())); - connect(m_homePageList, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(slotSelectHomePageItem(QListViewItem *))); - connect(m_homePageList, SIGNAL(pressed(QListViewItem*)), this, SLOT(slotUpdateItemList())); + connect(m_homePageList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(slotSelectHomePageItem(TQListViewItem *))); + connect(m_homePageList, TQT_SIGNAL(pressed(TQListViewItem*)), this, TQT_SLOT(slotUpdateItemList())); - connect(m_upButton, SIGNAL(clicked()), this, SLOT(slotMoveUp())); - connect(m_downButton, SIGNAL(clicked()), this, SLOT(slotMoveDown())); + connect(m_upButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveUp())); + connect(m_downButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotMoveDown())); // Don't show it to the user, we only need it to load and save the settings kcfg_ItemList->hide(); @@ -85,14 +85,14 @@ void KSettingsHome::slotLoadItems(void) if(m_noNeedToUpdateList) return; - QStringList list = KMyMoneyGlobalSettings::itemList(); - QStringList::ConstIterator it; + TQStringList list = KMyMoneyGlobalSettings::itemList(); + TQStringList::ConstIterator it; int w = 0; m_homePageList->clear(); - QCheckListItem *sel = 0; + TQCheckListItem *sel = 0; - QFontMetrics fm( KGlobalSettings::generalFont()); - QCheckListItem* last = 0; + TQFontMetrics fm( KGlobalSettings::generalFont()); + TQCheckListItem* last = 0; for(it = list.begin(); it != list.end(); ++it) { int idx = (*it).toInt(); @@ -101,7 +101,7 @@ void KSettingsHome::slotLoadItems(void) continue; bool enabled = idx > 0; if(!enabled) idx = -idx; - QCheckListItem* item = new QCheckListItem(m_homePageList, KMyMoneyUtils::homePageItemToString(idx), QCheckListItem::CheckBox); + TQCheckListItem* item = new TQCheckListItem(m_homePageList, KMyMoneyUtils::homePageItemToString(idx), TQCheckListItem::CheckBox); if(last) item->moveItem(last); @@ -123,14 +123,14 @@ void KSettingsHome::slotLoadItems(void) void KSettingsHome::slotUpdateItemList(void) { - QString list; - QListViewItem *it; + TQString list; + TQListViewItem *it; for(it = m_homePageList->firstChild(); it; ) { int item = KMyMoneyUtils::stringToHomePageItem(it->text(0)); - if(!(static_cast(it)->isOn())) + if(!(static_cast(it)->isOn())) item = -item; - list += QString::number(item); + list += TQString::number(item); it = it->nextSibling(); if(it) list += ","; @@ -142,7 +142,7 @@ void KSettingsHome::slotUpdateItemList(void) m_noNeedToUpdateList = false; } -void KSettingsHome::slotSelectHomePageItem(QListViewItem *item) +void KSettingsHome::slotSelectHomePageItem(TQListViewItem *item) { m_upButton->setEnabled(m_homePageList->firstChild() != item); m_downButton->setEnabled(item->nextSibling()); @@ -150,8 +150,8 @@ void KSettingsHome::slotSelectHomePageItem(QListViewItem *item) void KSettingsHome::slotMoveUp(void) { - QListViewItem *item = m_homePageList->currentItem(); - QListViewItem *prev = item->itemAbove(); + TQListViewItem *item = m_homePageList->currentItem(); + TQListViewItem *prev = item->itemAbove(); if(prev) { prev->moveItem(item); slotSelectHomePageItem(item); @@ -161,8 +161,8 @@ void KSettingsHome::slotMoveUp(void) void KSettingsHome::slotMoveDown(void) { - QListViewItem *item = m_homePageList->currentItem(); - QListViewItem *next = item->nextSibling(); + TQListViewItem *item = m_homePageList->currentItem(); + TQListViewItem *next = item->nextSibling(); if(next) { item->moveItem(next); slotSelectHomePageItem(item); diff --git a/kmymoney2/dialogs/settings/ksettingshome.h b/kmymoney2/dialogs/settings/ksettingshome.h index c461210..9717b2d 100644 --- a/kmymoney2/dialogs/settings/ksettingshome.h +++ b/kmymoney2/dialogs/settings/ksettingshome.h @@ -20,7 +20,7 @@ // ---------------------------------------------------------------------------- // QT Includes -class QListViewItem; +class TQListViewItem; // ---------------------------------------------------------------------------- // KDE Includes @@ -33,15 +33,16 @@ class QListViewItem; class KSettingsHome : public KSettingsHomeDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsHome(QWidget* parent = 0, const char* name = 0); + KSettingsHome(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsHome(); protected slots: void slotLoadItems(void); void slotUpdateItemList(void); - void slotSelectHomePageItem(QListViewItem *); + void slotSelectHomePageItem(TQListViewItem *); void slotMoveUp(void); void slotMoveDown(void); diff --git a/kmymoney2/dialogs/settings/ksettingshomedecl.ui b/kmymoney2/dialogs/settings/ksettingshomedecl.ui index 49f6251..c248697 100644 --- a/kmymoney2/dialogs/settings/ksettingshomedecl.ui +++ b/kmymoney2/dialogs/settings/ksettingshomedecl.ui @@ -1,6 +1,6 @@ KSettingsHomeDecl - + KSettingsHomeDecl @@ -19,17 +19,17 @@ unnamed - + - layout9 + tqlayout9 unnamed - + - layout6 + tqlayout6 @@ -45,7 +45,7 @@ Fixed - + 20 20 @@ -78,7 +78,7 @@ Expanding - + 21 70 @@ -97,14 +97,14 @@ Expanding - + 80 21 - + textLabel4 @@ -118,9 +118,9 @@ Selected entries are shown on the home page of the application.<p> -Use the buttons and checkboxes to customize the layout of the home page. +Use the buttons and checkboxes to customize the tqlayout of the home page. - + WordBreak|AlignTop @@ -142,7 +142,7 @@ Use the buttons and checkboxes to customize the layout of the home page. - + groupbox @@ -153,7 +153,7 @@ Use the buttons and checkboxes to customize the layout of the home page. unnamed - + percentageLabel @@ -161,7 +161,7 @@ Use the buttons and checkboxes to customize the layout of the home page.Percentage of default font size: - + kcfg_RememberFontSize @@ -193,7 +193,7 @@ Use the buttons and checkboxes to customize the layout of the home page. Expanding - + 40 20 @@ -202,7 +202,7 @@ Use the buttons and checkboxes to customize the layout of the home page. - + groupbox2 @@ -213,7 +213,7 @@ Use the buttons and checkboxes to customize the layout of the home page. unnamed - + kcfg_ShowLimitInfo @@ -227,5 +227,5 @@ Use the buttons and checkboxes to customize the layout of the home page. - + diff --git a/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp b/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp index db4dc1e..a17fd6e 100644 --- a/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp +++ b/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp @@ -18,8 +18,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -39,10 +39,10 @@ #include "ksettingsonlinequotes.h" #include "kmymoney2/converter/webpricequote.h" -KSettingsOnlineQuotes::KSettingsOnlineQuotes(QWidget *parent, const char *name ) - : KSettingsOnlineQuotesDecl(parent, name) +KSettingsOnlineQuotes::KSettingsOnlineQuotes(TQWidget *tqparent, const char *name ) + : KSettingsOnlineQuotesDecl(tqparent, name) { - QStringList groups = WebPriceQuote::quoteSources(); + TQStringList groups = WebPriceQuote::quoteSources(); loadList(true /*updateResetList*/); @@ -50,36 +50,36 @@ KSettingsOnlineQuotes::KSettingsOnlineQuotes(QWidget *parent, const char *name ) KIconLoader* il = KGlobal::iconLoader(); KGuiItem updateButtenItem( i18n("&Update" ), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered data and stores it"), i18n("Use this to accept the modified data.")); m_updateButton->setGuiItem(updateButtenItem); KGuiItem deleteButtenItem( i18n( "&Delete" ), - QIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), i18n("Delete the selected source entry"), i18n("Use this to delete the selected online source entry")); m_deleteButton->setGuiItem(deleteButtenItem); KGuiItem newButtenItem( i18n( "&New..." ), - QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new source entry for online quotes"), i18n("Use this to create a new entry for online quotes")); m_newButton->setGuiItem(newButtenItem); - connect(m_updateButton, SIGNAL(clicked()), this, SLOT(slotUpdateEntry())); - connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNewEntry())); + connect(m_updateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpdateEntry())); + connect(m_newButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewEntry())); - connect(m_quoteSourceList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotLoadWidgets(QListViewItem*))); - connect(m_quoteSourceList, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotLoadWidgets(QListViewItem*))); - connect(m_quoteSourceList, SIGNAL(itemRenamed(QListViewItem*,const QString&,int)), this, SLOT(slotEntryRenamed(QListViewItem*,const QString&,int))); + connect(m_quoteSourceList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotLoadWidgets(TQListViewItem*))); + connect(m_quoteSourceList, TQT_SIGNAL(clicked(TQListViewItem*)), this, TQT_SLOT(slotLoadWidgets(TQListViewItem*))); + connect(m_quoteSourceList, TQT_SIGNAL(itemRenamed(TQListViewItem*,const TQString&,int)), this, TQT_SLOT(slotEntryRenamed(TQListViewItem*,const TQString&,int))); - connect(m_editURL, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); - connect(m_editSymbol, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); - connect(m_editDate, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); - connect(m_editDateFormat, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); - connect(m_editPrice, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); - connect(m_skipStripping, SIGNAL(toggled(bool)), this, SLOT(slotEntryChanged())); + connect(m_editURL, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotEntryChanged())); + connect(m_editSymbol, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotEntryChanged())); + connect(m_editDate, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotEntryChanged())); + connect(m_editDateFormat, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotEntryChanged())); + connect(m_editPrice, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotEntryChanged())); + connect(m_skipStripping, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEntryChanged())); // FIXME deleting a source is not yet implemented m_deleteButton->setEnabled(false); @@ -87,30 +87,30 @@ KSettingsOnlineQuotes::KSettingsOnlineQuotes(QWidget *parent, const char *name ) void KSettingsOnlineQuotes::loadList(const bool updateResetList) { - QStringList groups = WebPriceQuote::quoteSources(); + TQStringList groups = WebPriceQuote::quoteSources(); if(updateResetList) m_resetList.clear(); m_quoteSourceList->clear(); - QStringList::Iterator it; + TQStringList::Iterator it; for(it = groups.begin(); it != groups.end(); ++it) { - new QListViewItem(m_quoteSourceList, *it); + new TQListViewItem(m_quoteSourceList, *it); if(updateResetList) m_resetList += WebPriceQuoteSource(*it); } - QListViewItem* first = m_quoteSourceList->firstChild(); + TQListViewItem* first = m_quoteSourceList->firstChild(); if(first) m_quoteSourceList->setSelected(first, true); slotLoadWidgets(first); - m_newButton->setEnabled(m_quoteSourceList->findItem(i18n("New Quote Source"), 0) == 0); + m_newButton->setEnabled(m_quoteSourceList->tqfindItem(i18n("New Quote Source"), 0) == 0); } void KSettingsOnlineQuotes::resetConfig(void) { - QStringList::ConstIterator it; - QStringList groups = WebPriceQuote::quoteSources(); + TQStringList::ConstIterator it; + TQStringList groups = WebPriceQuote::quoteSources(); // delete all currently defined entries for(it = groups.begin(); it != groups.end(); ++it) { @@ -118,7 +118,7 @@ void KSettingsOnlineQuotes::resetConfig(void) } // and write back the one's from the reset list - QValueList::ConstIterator itr; + TQValueList::ConstIterator itr; for(itr = m_resetList.begin(); itr != m_resetList.end(); ++itr) { (*itr).write(); } @@ -126,7 +126,7 @@ void KSettingsOnlineQuotes::resetConfig(void) loadList(); } -void KSettingsOnlineQuotes::slotLoadWidgets(QListViewItem* item) +void KSettingsOnlineQuotes::slotLoadWidgets(TQListViewItem* item) { m_editURL->setEnabled(true); m_editSymbol->setEnabled(true); @@ -134,11 +134,11 @@ void KSettingsOnlineQuotes::slotLoadWidgets(QListViewItem* item) m_editDate->setEnabled(true); m_editDateFormat->setEnabled(true); m_skipStripping->setEnabled(true); - m_editURL->setText(QString()); - m_editSymbol->setText(QString()); - m_editPrice->setText(QString()); - m_editDate->setText(QString()); - m_editDateFormat->setText(QString()); + m_editURL->setText(TQString()); + m_editSymbol->setText(TQString()); + m_editPrice->setText(TQString()); + m_editDate->setText(TQString()); + m_editDateFormat->setText(TQString()); if(item) { m_currentItem = WebPriceQuoteSource(item->text(0)); @@ -190,17 +190,17 @@ void KSettingsOnlineQuotes::slotNewEntry(void) WebPriceQuoteSource newSource(i18n("New Quote Source")); newSource.write(); loadList(); - QListViewItem* item = m_quoteSourceList->findItem(i18n("New Quote Source"), 0); + TQListViewItem* item = m_quoteSourceList->tqfindItem(i18n("New Quote Source"), 0); if(item) { m_quoteSourceList->setSelected(item, true); slotLoadWidgets(item); } } -void KSettingsOnlineQuotes::slotEntryRenamed(QListViewItem* item, const QString& text, int /* col */) +void KSettingsOnlineQuotes::slotEntryRenamed(TQListViewItem* item, const TQString& text, int /* col */) { int nameCount = 0; - QListViewItemIterator it(m_quoteSourceList); + TQListViewItemIterator it(m_quoteSourceList); while(it.current()) { if(it.current()->text(0) == text) ++nameCount; @@ -213,7 +213,7 @@ void KSettingsOnlineQuotes::slotEntryRenamed(QListViewItem* item, const QString& } else { item->setText(0, m_currentItem.m_name); } - m_newButton->setEnabled(m_quoteSourceList->findItem(i18n("New Quote Source"), 0) == 0); + m_newButton->setEnabled(m_quoteSourceList->tqfindItem(i18n("New Quote Source"), 0) == 0); } #include "ksettingsonlinequotes.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsonlinequotes.h b/kmymoney2/dialogs/settings/ksettingsonlinequotes.h index 8c0b6f0..ef9abe2 100644 --- a/kmymoney2/dialogs/settings/ksettingsonlinequotes.h +++ b/kmymoney2/dialogs/settings/ksettingsonlinequotes.h @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef KSETTINGSONLINEQUOTES_H -#define KSETTINGSONLINEQUOTES_H +#ifndef KSETTINGSONLINETQUOTES_H +#define KSETTINGSONLINETQUOTES_H // ---------------------------------------------------------------------------- // QT Includes @@ -33,8 +33,9 @@ class KSettingsOnlineQuotes : public KSettingsOnlineQuotesDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsOnlineQuotes(QWidget* parent = 0, const char *name = 0); + KSettingsOnlineQuotes(TQWidget* tqparent = 0, const char *name = 0); virtual ~KSettingsOnlineQuotes() {} void writeConfig(void) {} @@ -43,16 +44,16 @@ public: protected slots: void slotUpdateEntry(void); - void slotLoadWidgets(QListViewItem* item); + void slotLoadWidgets(TQListViewItem* item); void slotEntryChanged(void); void slotNewEntry(void); - void slotEntryRenamed(QListViewItem* item, const QString& text, int col); + void slotEntryRenamed(TQListViewItem* item, const TQString& text, int col); protected: void loadList(const bool updateResetList = false); private: - QValueList m_resetList; + TQValueList m_resetList; WebPriceQuoteSource m_currentItem; }; diff --git a/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui b/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui index 3077b78..88678ec 100644 --- a/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui @@ -1,6 +1,6 @@ KSettingsOnlineQuotesDecl - + KSettingsOnlineQuotesDecl @@ -12,7 +12,7 @@ 442 - + 0 0 @@ -58,7 +58,7 @@ true - + groupParsing @@ -72,7 +72,7 @@ unnamed - + textLabel4 @@ -80,7 +80,7 @@ Date - + textLabel2 @@ -115,7 +115,7 @@ Enter the URL from which stock quotes will be fetched. <b>%1</b> will be replaced with the symbol for the security being quoted. For currency conversions, <b>%2</b> will be replaced with the currency to be quoted and <b>%1</b> with the currency the quote is based on. - + textLabel3 @@ -131,7 +131,7 @@ Regular Expression to extract the date from the downloaded data - + textLabel4_2 @@ -139,7 +139,7 @@ Date Format - + textLabel1 @@ -155,7 +155,7 @@ Regular Expression to extract the date from the downloaded data - + m_skipStripping @@ -177,9 +177,9 @@ - + - layout15 + tqlayout15 @@ -211,7 +211,7 @@ Expanding - + 240 20 @@ -230,5 +230,5 @@ - + diff --git a/kmymoney2/dialogs/settings/ksettingsplugins.cpp b/kmymoney2/dialogs/settings/ksettingsplugins.cpp index 0887315..b44e124 100644 --- a/kmymoney2/dialogs/settings/ksettingsplugins.cpp +++ b/kmymoney2/dialogs/settings/ksettingsplugins.cpp @@ -18,9 +18,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -35,13 +35,13 @@ #include "kmymoney2/plugins/pluginloader.h" #include "ksettingsplugins.h" -KSettingsPlugins::KSettingsPlugins(QWidget* parent) - : QWidget(parent) +KSettingsPlugins::KSettingsPlugins(TQWidget* tqparent) + : TQWidget(tqparent) { - QVBoxLayout *layout = new QVBoxLayout(this); - KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()->reparent(this, QPoint()); - layout->addWidget(KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()); - layout->setSpacing(KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); + KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()->reparent(this, TQPoint()); + tqlayout->addWidget(KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()); + tqlayout->setSpacing(KDialog::spacingHint()); } KSettingsPlugins::~KSettingsPlugins() diff --git a/kmymoney2/dialogs/settings/ksettingsplugins.h b/kmymoney2/dialogs/settings/ksettingsplugins.h index 9c36f67..0106afb 100644 --- a/kmymoney2/dialogs/settings/ksettingsplugins.h +++ b/kmymoney2/dialogs/settings/ksettingsplugins.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -29,13 +29,14 @@ // ---------------------------------------------------------------------------- // Project Includes -class KSettingsPlugins : public QWidget +class KSettingsPlugins : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KSettingsPlugins(QWidget* parent = 0); + KSettingsPlugins(TQWidget* tqparent = 0); ~KSettingsPlugins(); public slots: diff --git a/kmymoney2/dialogs/settings/ksettingsregister.cpp b/kmymoney2/dialogs/settings/ksettingsregister.cpp index 9f1fda2..e6a278e 100644 --- a/kmymoney2/dialogs/settings/ksettingsregister.cpp +++ b/kmymoney2/dialogs/settings/ksettingsregister.cpp @@ -28,8 +28,8 @@ #include "ksettingsregister.h" #include -KSettingsRegister::KSettingsRegister(QWidget* parent, const char* name) : - KSettingsRegisterDecl(parent, name) +KSettingsRegister::KSettingsRegister(TQWidget* tqparent, const char* name) : + KSettingsRegisterDecl(tqparent, name) { // hide the internally used text fields kcfg_sortNormalView->hide(); @@ -37,14 +37,14 @@ KSettingsRegister::KSettingsRegister(QWidget* parent, const char* name) : kcfg_sortSearchView->hide(); // setup connections, so that the sort optios get loaded once the edit fields are filled - connect(kcfg_sortNormalView, SIGNAL(textChanged()), this, SLOT(slotLoadNormal())); - connect(kcfg_sortReconcileView, SIGNAL(textChanged()), this, SLOT(slotLoadReconcile())); - connect(kcfg_sortSearchView, SIGNAL(textChanged()), this, SLOT(slotLoadSearch())); + connect(kcfg_sortNormalView, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadNormal())); + connect(kcfg_sortReconcileView, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadReconcile())); + connect(kcfg_sortSearchView, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadSearch())); // setup connections, so that changes by the user are forwarded to the (hidden) edit fields - connect(m_sortNormalView, SIGNAL(settingsChanged(const QString&)), kcfg_sortNormalView, SLOT(setText(const QString&))); - connect(m_sortReconcileView, SIGNAL(settingsChanged(const QString&)), kcfg_sortReconcileView, SLOT(setText(const QString&))); - connect(m_sortSearchView, SIGNAL(settingsChanged(const QString&)), kcfg_sortSearchView, SLOT(setText(const QString&))); + connect(m_sortNormalView, TQT_SIGNAL(settingsChanged(const TQString&)), kcfg_sortNormalView, TQT_SLOT(setText(const TQString&))); + connect(m_sortReconcileView, TQT_SIGNAL(settingsChanged(const TQString&)), kcfg_sortReconcileView, TQT_SLOT(setText(const TQString&))); + connect(m_sortSearchView, TQT_SIGNAL(settingsChanged(const TQString&)), kcfg_sortSearchView, TQT_SLOT(setText(const TQString&))); } KSettingsRegister::~KSettingsRegister() @@ -54,21 +54,21 @@ KSettingsRegister::~KSettingsRegister() void KSettingsRegister::slotLoadNormal(void) { // only need this once - disconnect(kcfg_sortNormalView, SIGNAL(textChanged()), this, SLOT(slotLoadNormal())); + disconnect(kcfg_sortNormalView, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadNormal())); m_sortNormalView->setSettings(kcfg_sortNormalView->text()); } void KSettingsRegister::slotLoadReconcile(void) { // only need this once - disconnect(kcfg_sortReconcileView, SIGNAL(textChanged()), this, SLOT(slotLoadReconcile())); + disconnect(kcfg_sortReconcileView, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadReconcile())); m_sortReconcileView->setSettings(kcfg_sortReconcileView->text()); } void KSettingsRegister::slotLoadSearch(void) { // only need this once - disconnect(kcfg_sortSearchView, SIGNAL(textChanged()), this, SLOT(slotLoadSearch())); + disconnect(kcfg_sortSearchView, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotLoadSearch())); m_sortSearchView->setSettings(kcfg_sortSearchView->text()); } diff --git a/kmymoney2/dialogs/settings/ksettingsregister.h b/kmymoney2/dialogs/settings/ksettingsregister.h index bcad7eb..7fa475f 100644 --- a/kmymoney2/dialogs/settings/ksettingsregister.h +++ b/kmymoney2/dialogs/settings/ksettingsregister.h @@ -31,9 +31,10 @@ class KSettingsRegister : public KSettingsRegisterDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsRegister(QWidget* parent = 0, const char* name = 0); + KSettingsRegister(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsRegister(); protected slots: diff --git a/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui b/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui index c03807e..1ad71bf 100644 --- a/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui @@ -1,6 +1,6 @@ KSettingsRegisterDecl - + KSettingsRegisterDecl @@ -19,11 +19,11 @@ unnamed - + tab - + tab @@ -34,7 +34,7 @@ unnamed - + kcfg_ShowGrid @@ -45,7 +45,7 @@ - + kcfg_LedgerLens @@ -59,7 +59,7 @@ Using the ledger lens shows the details for the transaction that has focus in the ledger. Usually, when using the transaction form, only a one line summary is displayed for each transaction as the details are shown in the form. - + kcfg_TransactionForm @@ -67,7 +67,7 @@ Show transaction form - + kcfg_AlwaysShowNrField @@ -78,7 +78,7 @@ - + kcfg_ShowFancyMarker @@ -92,7 +92,7 @@ Draws a larger header above each group of transaction. The grouping depends on the current sort order. - + kcfg_ShowFiscalMarker @@ -110,7 +110,7 @@ Expanding - + 20 40 @@ -119,7 +119,7 @@ - + sorting @@ -130,11 +130,11 @@ unnamed - + tabWidget3 - + tab @@ -157,7 +157,7 @@ - + tab @@ -180,7 +180,7 @@ - + TabPage @@ -214,7 +214,7 @@ - + TabPage @@ -225,7 +225,7 @@ unnamed - + kcfg_CopyTypeToNr @@ -233,7 +233,7 @@ Insert transaction type into No. field for new transactions - + kcfg_AutoIncCheckNumber @@ -244,7 +244,7 @@ - + kcfg_FocusChangeIsEnter @@ -252,7 +252,7 @@ Keep changes when selecting a different transaction/split - + kcfg_EnterMovesBetweenFields @@ -263,7 +263,7 @@ - + kcfg_stringMatchFromStart @@ -274,15 +274,15 @@ Mark this option, if you always want to match names e.g. for payees from the start. If unset, any substring is matched. - + - layout5 + tqlayout5 unnamed - + textLabel2_2 @@ -323,7 +323,7 @@ Expanding - + 31 20 @@ -332,7 +332,7 @@ - + kcfg_AutoFillTransaction @@ -349,7 +349,7 @@ unnamed - + radioButton1 @@ -360,15 +360,15 @@ Don't do autofill of transaction data at all. - + - layout4 + tqlayout4 unnamed - + radioButton2 @@ -398,7 +398,7 @@ Selecting 0% will list all transactions. Two transactions are usually treated identical for autofill, if they refer the same accounts. They are treated as different transactions though, when their amount varies by more than the percentage given here. - + textLabel2 @@ -409,7 +409,7 @@ Selecting 0% will list all transactions. - + radioButton3 @@ -432,7 +432,7 @@ Selecting 0% will list all transactions. Expanding - + 20 20 @@ -441,7 +441,7 @@ Selecting 0% will list all transactions. - + TabPage @@ -452,15 +452,15 @@ Selecting 0% will list all transactions. unnamed - + - layout4 + tqlayout4 unnamed - + textLabel1_2 @@ -498,7 +498,7 @@ Selecting 0% will list all transactions. Expanding - + 61 20 @@ -507,7 +507,7 @@ Selecting 0% will list all transactions. - + kcfg_askForPayeeCategory @@ -531,7 +531,7 @@ Selecting 0% will list all transactions. Expanding - + 20 60 @@ -545,5 +545,8 @@ Selecting 0% will list all transactions. - + + kmymoney/transactionsortoption.h + + diff --git a/kmymoney2/dialogs/settings/ksettingsschedules.cpp b/kmymoney2/dialogs/settings/ksettingsschedules.cpp index 6f9a77c..05dc80f 100644 --- a/kmymoney2/dialogs/settings/ksettingsschedules.cpp +++ b/kmymoney2/dialogs/settings/ksettingsschedules.cpp @@ -25,8 +25,8 @@ #include "ksettingsschedules.h" -KSettingsSchedules::KSettingsSchedules(QWidget* parent, const char* name) : - KSettingsSchedulesDecl(parent, name) +KSettingsSchedules::KSettingsSchedules(TQWidget* tqparent, const char* name) : + KSettingsSchedulesDecl(tqparent, name) { } diff --git a/kmymoney2/dialogs/settings/ksettingsschedules.h b/kmymoney2/dialogs/settings/ksettingsschedules.h index caa7d33..06e5af6 100644 --- a/kmymoney2/dialogs/settings/ksettingsschedules.h +++ b/kmymoney2/dialogs/settings/ksettingsschedules.h @@ -32,9 +32,10 @@ class KSettingsSchedules : public KSettingsSchedulesDecl { Q_OBJECT + TQ_OBJECT public: - KSettingsSchedules(QWidget* parent = 0, const char* name = 0); + KSettingsSchedules(TQWidget* tqparent = 0, const char* name = 0); ~KSettingsSchedules(); }; #endif diff --git a/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui b/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui index fca9aa9..4f7bd28 100644 --- a/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui +++ b/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui @@ -1,6 +1,6 @@ KSettingsSchedulesDecl - + KSettingsSchedulesDecl @@ -19,7 +19,7 @@ unnamed - + groupBox6 @@ -30,7 +30,7 @@ unnamed - + kcfg_CheckSchedule @@ -38,7 +38,7 @@ Check schedules on startup - + m_dayCountFrame @@ -55,7 +55,7 @@ unnamed - + textLabel3 @@ -63,7 +63,7 @@ Enter transactions this number of days in advance - + kcfg_CheckSchedulePreview @@ -72,15 +72,15 @@ - + - layout2 + tqlayout2 unnamed - + textLabel1 @@ -103,7 +103,7 @@ Expanding - + 41 21 @@ -122,7 +122,7 @@ Expanding - + 20 40 @@ -141,5 +141,5 @@ setEnabled(bool) - + diff --git a/kmymoney2/dialogs/transactioneditor.cpp b/kmymoney2/dialogs/transactioneditor.cpp index c53d3c6..91f60b8 100644 --- a/kmymoney2/dialogs/transactioneditor.cpp +++ b/kmymoney2/dialogs/transactioneditor.cpp @@ -18,12 +18,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -60,7 +60,7 @@ using namespace KMyMoneyRegister; using namespace KMyMoneyTransactionForm; -TransactionEditor::TransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate) : +TransactionEditor::TransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate) : m_transactions(list), m_regForm(regForm), m_item(item), @@ -70,14 +70,14 @@ TransactionEditor::TransactionEditor(TransactionEditorContainer* regForm, KMyMon m_openEditSplits(false) { m_item->startEditMode(); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotUpdateAccount())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotUpdateAccount())); } TransactionEditor::~TransactionEditor() { // Make sure the widgets do not send out signals to the editor anymore // After all, the editor is about to die - QMap::iterator it_w; + TQMap::iterator it_w; for(it_w = m_editWidgets.begin(); it_w != m_editWidgets.end(); ++it_w) { (*it_w)->disconnect(this); } @@ -87,7 +87,7 @@ TransactionEditor::~TransactionEditor() emit finishEdit(m_transactions); } -void TransactionEditor::slotUpdateAccount(const QString& id) +void TransactionEditor::slotUpdateAccount(const TQString& id) { m_account = MyMoneyFile::instance()->account(id); setupPrecision(); @@ -103,24 +103,24 @@ void TransactionEditor::slotUpdateAccount(void) void TransactionEditor::setupPrecision(void) { const int prec = (m_account.id().isEmpty()) ? 2 : MyMoneyMoney::denomToPrec(m_account.fraction()); - QStringList widgets = QStringList::split(",", "amount,deposit,payment"); - QStringList::const_iterator it_w; + TQStringList widgets = TQStringList::split(",", "amount,deposit,payment"); + TQStringList::const_iterator it_w; for(it_w = widgets.begin(); it_w != widgets.end(); ++it_w) { - QWidget * w; + TQWidget * w; if((w = haveWidget(*it_w)) != 0) { dynamic_cast(w)->setPrecision(prec); } } } -void TransactionEditor::setup(QWidgetList& tabOrderWidgets, const MyMoneyAccount& account, KMyMoneyRegister::Action action) +void TransactionEditor::setup(TQWidgetList& tabOrderWidgets, const MyMoneyAccount& account, KMyMoneyRegister::Action action) { m_account = account; m_initialAction = action; createEditWidgets(); m_regForm->arrangeEditWidgets(m_editWidgets, m_item); m_regForm->tabOrder(tabOrderWidgets, m_item); - QWidget* w = haveWidget("tabbar"); + TQWidget* w = haveWidget("tabbar"); if(w) tabOrderWidgets.append(w); loadEditWidgets(action); @@ -135,7 +135,7 @@ void TransactionEditor::clearFinalWidgets(void) m_finalEditWidgets.clear(); } -void TransactionEditor::addFinalWidget(const QWidget* w) +void TransactionEditor::addFinalWidget(const TQWidget* w) { if(w) { m_finalEditWidgets << w; @@ -146,11 +146,11 @@ void TransactionEditor::slotReloadEditWidgets(void) { } -bool TransactionEditor::eventFilter(QObject* o, QEvent* e) +bool TransactionEditor::eventFilter(TQObject* o, TQEvent* e) { bool rc = false; - if(o == haveWidget("number")) { - if(e->type() == QEvent::MouseButtonDblClick) { + if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(haveWidget("number"))) { + if(e->type() == TQEvent::MouseButtonDblClick) { emit assignNumber(); rc = true; } @@ -159,15 +159,15 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e) // if the object is a widget, the event is a key press event and // the object is one of our edit widgets, then .... if(o->isWidgetType() - && (e->type() == QEvent::KeyPress) - && m_editWidgets.values().contains(dynamic_cast(o))) { - QKeyEvent* k = dynamic_cast(e); - if((k->state() & Qt::KeyButtonMask) == 0) { + && (e->type() == TQEvent::KeyPress) + && m_editWidgets.values().tqcontains(dynamic_cast(o))) { + TQKeyEvent* k = dynamic_cast(e); + if((k->state() & TQt::KeyButtonMask) == 0) { bool isFinal = false; - QValueList::const_iterator it_w; + TQValueList::const_iterator it_w; switch(k->key()) { - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: // we check, if the object is one of the m_finalEditWidgets and if it's // a kMyMoneyEdit object that the value is not 0. If any of that is the // case, it's the final object. In other cases, we convert the enter @@ -176,7 +176,7 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e) // we treat the return/enter key as such. if(KMyMoneyGlobalSettings::enterMovesBetweenFields()) { for(it_w = m_finalEditWidgets.begin(); !isFinal && it_w != m_finalEditWidgets.end(); ++it_w) { - if(*it_w == o) { + if(TQT_BASE_OBJECT_CONST(*it_w) == TQT_BASE_OBJECT(o)) { if(dynamic_cast(*it_w)) { isFinal = !(dynamic_cast(*it_w)->value().isZero()); } else @@ -188,25 +188,25 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e) // for the non-final objects, we treat the return key as a TAB if(!isFinal) { - QKeyEvent evt(e->type(), - Key_Tab, 0, k->state(), QString::null, + TQKeyEvent evt(e->type(), + Key_Tab, 0, k->state(), TQString(), k->isAutoRepeat(), k->count()); - QApplication::sendEvent( o, &evt ); + TQApplication::sendEvent( o, &evt ); // in case of a category item and the split button is visible // send a second event so that we get passed the button. if(dynamic_cast(o) && dynamic_cast(o)->splitButton()) - QApplication::sendEvent( o, &evt ); + TQApplication::sendEvent( o, &evt ); } else { - QTimer::singleShot(0, this, SIGNAL(returnPressed())); + TQTimer::singleShot(0, this, TQT_SIGNAL(returnPressed())); } // don't process any further rc = true; break; - case Qt::Key_Escape: - QTimer::singleShot(0, this, SIGNAL(escapePressed())); + case TQt::Key_Escape: + TQTimer::singleShot(0, this, TQT_SIGNAL(escapePressed())); break; } } @@ -214,13 +214,13 @@ bool TransactionEditor::eventFilter(QObject* o, QEvent* e) return rc; } -void TransactionEditor::slotNumberChanged(const QString& txt) +void TransactionEditor::slotNumberChanged(const TQString& txt) { kMyMoneyLineEdit* number = dynamic_cast(haveWidget("number")); if(number) { if(MyMoneyFile::instance()->checkNoUsed(m_account.id(), txt)) { - if(KMessageBox::questionYesNo(m_regForm, QString("")+i18n("The number %1 has already been used in account %2. Do you want to replace it with the next available number?").arg(txt).arg(m_account.name())+QString(""), i18n("Duplicate number")) == KMessageBox::Yes) { + if(KMessageBox::questionYesNo(m_regForm, TQString("")+i18n("The number %1 has already been used in account %2. Do you want to replace it with the next available number?").tqarg(txt).tqarg(m_account.name())+TQString(""), i18n("Duplicate number")) == KMessageBox::Yes) { number->loadText(KMyMoneyUtils::nextCheckNumber(m_account)); } } @@ -229,18 +229,18 @@ void TransactionEditor::slotNumberChanged(const QString& txt) void TransactionEditor::slotUpdateButtonState(void) { - QString reason; + TQString reason; emit transactionDataSufficient(isComplete(reason)); } -QWidget* TransactionEditor::haveWidget(const QString& name) const +TQWidget* TransactionEditor::haveWidget(const TQString& name) const { return m_editWidgets.haveWidget(name); } int TransactionEditor::slotEditSplits(void) { - return QDialog::Rejected; + return TQDialog::Rejected; } #if 0 @@ -301,12 +301,12 @@ int TransactionEditor::slotEditSplits(void) } acc = MyMoneyAccount(); } - QString msg; - msg = QString("

")+i18n("This transaction has more than two splits and is based on a different currency (%1). Using this account to modify the transaction is currently not very well supported by KMyMoney and may result in false results.").arg(sec.name())+QString(" "); + TQString msg; + msg = TQString("

")+i18n("This transaction has more than two splits and is based on a different currency (%1). Using this account to modify the transaction is currently not very well supported by KMyMoney and may result in false results.").tqarg(sec.name())+TQString(" "); if(acc.id().isEmpty()) { msg += i18n("KMyMoney was not able to find a more appropriate account to edit this transaction. Nevertheless, you are allowed to modify the transaction. If you don't want to edit this transaction, please cancel from editing next."); } else { - msg += i18n("Using e.g. %1 to edit this transaction is a better choice. Nevertheless, you are allowed to modify the transaction. If you want to use the suggested account instead, please cancel from editing next and change the view to the suggested account.").arg(acc.name()); + msg += i18n("Using e.g. %1 to edit this transaction is a better choice. Nevertheless, you are allowed to modify the transaction. If you want to use the suggested account instead, please cancel from editing next and change the view to the suggested account.").tqarg(acc.name()); } KMessageBox::information(0, msg); } @@ -405,16 +405,16 @@ bool TransactionEditor::fixTransactionCommodity(const MyMoneyAccount& account) // this will happen and allow him to stop the processing (rc = false) try { - QString msg; + TQString msg; if(firstTimeMultiCurrency) { firstTimeMultiCurrency = false; if(!isMultiSelection()) { - msg = i18n("This transaction has more than two splits and is originally based on a different currency (%1). Using this account to modify the transaction may result in rounding errors. Do you want to continue?").arg(osec.name()); + msg = i18n("This transaction has more than two splits and is originally based on a different currency (%1). Using this account to modify the transaction may result in rounding errors. Do you want to continue?").tqarg(osec.name()); } else { - msg = i18n("At least one of the selected transactions has more than two splits and is originally based on a different currency (%1). Using this account to modify the transactions may result in rounding errors. Do you want to continue?").arg(osec.name()); + msg = i18n("At least one of the selected transactions has more than two splits and is originally based on a different currency (%1). Using this account to modify the transactions may result in rounding errors. Do you want to continue?").tqarg(osec.name()); } - if(KMessageBox::warningContinueCancel(0, QString("%1").arg(msg)) == KMessageBox::Cancel) { + if(KMessageBox::warningContinueCancel(0, TQString("%1").tqarg(msg)) == KMessageBox::Cancel) { rc = false; } } @@ -423,7 +423,7 @@ bool TransactionEditor::fixTransactionCommodity(const MyMoneyAccount& account) MyMoneyMoney price; if(!(*it_t).split().shares().isZero() && !(*it_t).split().value().isZero()) price = (*it_t).split().shares() / (*it_t).split().value(); - QValueList::iterator it_s; + TQValueList::iterator it_s; MyMoneySplit& mySplit = (*it_t).split(); for(it_s = (*it_t).transaction().splits().begin(); it_s != (*it_t).transaction().splits().end(); ++it_s) { MyMoneySplit s = (*it_s); @@ -472,9 +472,9 @@ bool TransactionEditor::canAssignNumber(void) const return (number != 0) && (number->text().isEmpty()); } -void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QValueList& splits, QString& categoryId, const char* splitEditSlot, bool /* allowObjectCreation */) +void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const TQValueList& splits, TQString& categoryId, const char* splitEditSlot, bool /* allowObjectCreation */) { - disconnect(category, SIGNAL(focusIn()), this, splitEditSlot); + disconnect(category, TQT_SIGNAL(focusIn()), this, splitEditSlot); #if 0 // FIXME must deal with the logic that suppressObjectCreation is // automatically turned off when the createItem() signal is connected @@ -484,13 +484,13 @@ void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QV switch(splits.count()) { case 0: - categoryId = QString(); + categoryId = TQString(); if(!category->currentText().isEmpty()) { category->setCurrentText(); // make sure, we don't see the selector category->completion()->hide(); } - category->completion()->setSelected(QString()); + category->completion()->setSelected(TQString()); break; case 1: @@ -500,9 +500,9 @@ void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QV break; default: - categoryId = QString(); + categoryId = TQString(); category->setSplitTransaction(); - connect(category, SIGNAL(focusIn()), this, splitEditSlot); + connect(category, TQT_SIGNAL(focusIn()), this, splitEditSlot); #if 0 // FIXME must deal with the logic that suppressObjectCreation is // automatically turned off when the createItem() signal is connected @@ -513,17 +513,17 @@ void TransactionEditor::setupCategoryWidget(KMyMoneyCategory* category, const QV } } -bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, bool suppressBalanceWarnings) +bool TransactionEditor::enterTransactions(TQString& newId, bool askForSchedule, bool suppressBalanceWarnings) { - newId = QString(); + newId = TQString(); MyMoneyFile* file = MyMoneyFile::instance(); // make sure to run through all stuff that is tied to 'focusout events'. - m_regForm->parentWidget()->setFocus(); - QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 10); + m_regForm->tqparentWidget()->setFocus(); + TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 10); // we don't need to update our widgets anymore, so we just disconnect the signal - disconnect(file, SIGNAL(dataChanged()), this, SLOT(slotReloadEditWidgets())); + disconnect(file, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadEditWidgets())); KMyMoneyRegister::SelectedTransactions::iterator it_t; MyMoneyTransaction t; @@ -538,7 +538,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b // collect the transactions to be stored in the engine in a local // list first, so that the user has a chance to interrupt the storage // process - QValueList list; + TQValueList list; bool storeTransactions = true; // collect transactions @@ -562,12 +562,12 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b MyMoneyFileTransaction ft; try { - QValueList::iterator it_ts; - QMap minBalanceEarly; - QMap minBalanceAbsolute; - QMap maxCreditEarly; - QMap maxCreditAbsolute; - QMap accountIds; + TQValueList::iterator it_ts; + TQMap minBalanceEarly; + TQMap minBalanceAbsolute; + TQMap maxCreditEarly; + TQMap maxCreditAbsolute; + TQMap accountIds; for(it_ts = list.begin(); it_ts != list.end(); ++it_ts) { // if we have a categorization, make sure we remove @@ -576,7 +576,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b (*it_ts).setImported(false); // create information about min and max balances - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = (*it_ts).splits().begin(); it_s != (*it_ts).splits().end(); ++it_s) { MyMoneyAccount acc = file->account((*it_s).accountId()); accountIds[acc.id()] = true; @@ -599,19 +599,19 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b if((*it_ts).id().isEmpty()) { bool enter = true; - if(askForSchedule && (*it_ts).postDate() > QDate::currentDate()) { + if(askForSchedule && (*it_ts).postDate() > TQDate::tqcurrentDate()) { KGuiItem enterItem; KIconLoader* il = KGlobal::iconLoader(); KGuiItem enterButton( i18n("&Enter" ), - QIconSet(il->loadIcon("kontact_journal", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("kontact_journal", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered data and stores it"), i18n("Use this to enter the transaction into the ledger.")); KGuiItem scheduleButton( i18n("&Schedule" ), - QIconSet(il->loadIcon("kontact_date", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("kontact_date", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered data and stores it as schedule"), i18n("Use this to schedule the transaction for later entry into the ledger.")); - enter = KMessageBox::questionYesNo(m_regForm, QString("%1").arg(i18n("The transaction you are about to enter has a post date in the future.

Do you want to enter it in the ledger or add it to the schedules?")), i18n("Dialog caption for 'Enter or schedule' dialog", "Enter or schedule?"), enterButton, scheduleButton, "EnterOrScheduleTransactionInFuture") == KMessageBox::Yes; + enter = KMessageBox::questionYesNo(m_regForm, TQString("%1").tqarg(i18n("The transaction you are about to enter has a post date in the future.

Do you want to enter it in the ledger or add it to the schedules?")), i18n("Dialog caption for 'Enter or schedule' dialog", "Enter or schedule?"), enterButton, scheduleButton, "EnterOrScheduleTransactionInFuture") == KMessageBox::Yes; } if(enter) { // add new transaction @@ -623,7 +623,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b t = (*it_ts); // if a new transaction has a valid number, keep it with the account - QString number = (*it_ts).splits()[0].number(); + TQString number = (*it_ts).splits()[0].number(); if(!number.isEmpty()) { m_account.setValue("lastNumberUsed", number); file->modifyAccount(m_account); @@ -667,37 +667,37 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b ft.commit(); // now analyse the balances and spit out warnings to the user - QMap::const_iterator it_a; + TQMap::const_iterator it_a; if(!suppressBalanceWarnings) { for(it_a = accountIds.begin(); it_a != accountIds.end(); ++it_a) { - QString msg; + TQString msg; MyMoneyAccount acc = file->account(it_a.key()); MyMoneyMoney balance = file->balance(acc.id()); const MyMoneySecurity& sec = file->security(acc.currencyId()); - QString key; + TQString key; key = "minBalanceEarly"; if(!acc.value(key).isEmpty()) { if(minBalanceEarly[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) { - msg = QString("%1").arg(i18n("The balance of account %1 dropped below the warning balance of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); + msg = TQString("%1").tqarg(i18n("The balance of account %1 dropped below the warning balance of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); } } key = "minBalanceAbsolute"; if(!acc.value(key).isEmpty()) { if(minBalanceAbsolute[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) { - msg = QString("%1").arg(i18n("The balance of account %1 dropped below the minimum balance of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); + msg = TQString("%1").tqarg(i18n("The balance of account %1 dropped below the minimum balance of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); } } key = "maxCreditEarly"; if(!acc.value(key).isEmpty()) { if(maxCreditEarly[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) { - msg = QString("%1").arg(i18n("The balance of account %1 dropped below the maximum credit warning limit of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); + msg = TQString("%1").tqarg(i18n("The balance of account %1 dropped below the maximum credit warning limit of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); } } key = "maxCreditAbsolute"; if(!acc.value(key).isEmpty()) { if(maxCreditAbsolute[acc.id()] == false && balance < MyMoneyMoney(acc.value(key))) { - msg = QString("%1").arg(i18n("The balance of account %1 dropped below the maximum credit limit of %2.").arg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); + msg = TQString("%1").tqarg(i18n("The balance of account %1 dropped below the maximum credit limit of %2.").tqarg(acc.name(), MyMoneyMoney(acc.value(key)).formatMoney(acc, sec))); } } @@ -713,7 +713,7 @@ bool TransactionEditor::enterTransactions(QString& newId, bool askForSchedule, b } emit statusProgress(-1, -1); - emit statusMsg(QString()); + emit statusMsg(TQString()); } return storeTransactions; @@ -724,7 +724,7 @@ StdTransactionEditor::StdTransactionEditor() { } -StdTransactionEditor::StdTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate) : +StdTransactionEditor::StdTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate) : TransactionEditor(regForm, item, list, lastPostDate), m_inUpdateVat(false) { @@ -738,15 +738,15 @@ StdTransactionEditor::~StdTransactionEditor() } } -bool StdTransactionEditor::eventFilter(QObject* o, QEvent* e) +bool StdTransactionEditor::eventFilter(TQObject* o, TQEvent* e) { bool rc = TransactionEditor::eventFilter(o, e); #if 0 // this is sofar dead code here, as the focus out event for Comboboxes // never comes along here. I don't know why (ipwizard - 2009-10-03) - if((e->type() == QEvent::FocusOut) - && (haveWidget("payee") == dynamic_cast(o))) { + if((e->type() == TQEvent::FocusOut) + && (haveWidget("payee") == dynamic_cast(o))) { // loosing the focus on the payee widget? qDebug("Loosing focus on payee"); KMyMoneyPayeeCombo* p = dynamic_cast(haveWidget("payee")); @@ -762,25 +762,25 @@ void StdTransactionEditor::createEditWidgets(void) KMyMoneyCategory* account = new KMyMoneyCategory; account->setHint(i18n("Account")); m_editWidgets["account"] = account; - connect(account, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(account, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateAccount(const QString&))); + connect(account, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(account, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateAccount(const TQString&))); KMyMoneyPayeeCombo* payee = new KMyMoneyPayeeCombo; payee->setHint(i18n("Payer/Receiver")); m_editWidgets["payee"] = payee; - connect(payee, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(payee, SIGNAL(createItem(const QString&, QString&)), this, SIGNAL(createPayee(const QString&, QString&))); - connect(payee, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(payee, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdatePayee(const QString&))); + connect(payee, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(payee, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SIGNAL(createPayee(const TQString&, TQString&))); + connect(payee, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(payee, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdatePayee(const TQString&))); KMyMoneyCategory* category = new KMyMoneyCategory(0, 0, true); category->setHint(i18n("Category/Account")); m_editWidgets["category"] = category; - connect(category, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateCategory(const QString&))); - connect(category, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(category, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateCategory(const QString&, QString&))); - connect(category, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(category->splitButton(), SIGNAL(clicked()), this, SLOT(slotEditSplits())); + connect(category, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateCategory(const TQString&))); + connect(category, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(category, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateCategory(const TQString&, TQString&))); + connect(category, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(category->splitButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditSplits())); category->splitButton()->setDisabled(true); KTextEdit* memo = new KTextEdit; @@ -812,41 +812,41 @@ void StdTransactionEditor::createEditWidgets(void) kMyMoneyLineEdit* number = new kMyMoneyLineEdit; number->setHint(i18n("Number")); m_editWidgets["number"] = number; - connect(number, SIGNAL(lineChanged(const QString&)), this, SLOT(slotNumberChanged(const QString&))); + connect(number, TQT_SIGNAL(lineChanged(const TQString&)), this, TQT_SLOT(slotNumberChanged(const TQString&))); // number->installEventFilter(this); } m_editWidgets["postdate"] = new kMyMoneyDateInput; - connect(m_editWidgets["postdate"], SIGNAL(dateChanged(const QDate&)), this, SLOT(slotUpdateButtonState())); + connect(m_editWidgets["postdate"], TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotUpdateButtonState())); kMyMoneyEdit* value = new kMyMoneyEdit; m_editWidgets["amount"] = value; value->setResetButtonVisible(false); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateAmount(const QString&))); - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateAmount(const TQString&))); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); value = new kMyMoneyEdit; m_editWidgets["payment"] = value; value->setResetButtonVisible(false); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdatePayment(const QString&))); - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdatePayment(const TQString&))); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); value = new kMyMoneyEdit; m_editWidgets["deposit"] = value; value->setResetButtonVisible(false); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateDeposit(const QString&))); - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateDeposit(const TQString&))); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); KMyMoneyCashFlowCombo* cashflow = new KMyMoneyCashFlowCombo(0, 0, m_account.accountGroup()); m_editWidgets["cashflow"] = cashflow; - connect(cashflow, SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, SLOT(slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection))); - connect(cashflow, SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, SLOT(slotUpdateButtonState())); + connect(cashflow, TQT_SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, TQT_SLOT(slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection))); + connect(cashflow, TQT_SIGNAL(directionSelected(KMyMoneyRegister::CashFlowDirection)), this, TQT_SLOT(slotUpdateButtonState())); KMyMoneyReconcileCombo* reconcile = new KMyMoneyReconcileCombo; m_editWidgets["status"] = reconcile; - connect(reconcile, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateButtonState())); + connect(reconcile, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); - KMyMoneyRegister::QWidgetContainer::iterator it_w; + KMyMoneyRegister::TQWidgetContainer::iterator it_w; for(it_w = m_editWidgets.begin(); it_w != m_editWidgets.end(); ++it_w) { (*it_w)->installEventFilter(this); } @@ -857,9 +857,9 @@ void StdTransactionEditor::createEditWidgets(void) cashflow->removeDontCare(); } - QLabel* label; - m_editWidgets["category-label"] = label = new QLabel(i18n("Category"), 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + TQLabel* label; + m_editWidgets["category-label"] = label = new TQLabel(i18n("Category"), 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); // create a copy of tabbar above the form (if we are created for a form) KMyMoneyTransactionForm::TransactionForm* form = dynamic_cast(m_regForm); @@ -868,29 +868,29 @@ void StdTransactionEditor::createEditWidgets(void) KMyMoneyTransactionForm::TabBar* tabbar = new KMyMoneyTransactionForm::TabBar; m_editWidgets["tabbar"] = tabbar; tabbar->copyTabs(form->tabBar()); - connect(tabbar, SIGNAL(tabSelected(int)), this, SLOT(slotUpdateAction(int))); + connect(tabbar, TQT_SIGNAL(tabSelected(int)), this, TQT_SLOT(slotUpdateAction(int))); } - label = new QLabel(i18n("Date"), 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel(i18n("Date"), 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["date-label"] = label; - label = new QLabel(i18n("Number"), 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel(i18n("Number"), 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["number-label"] = label; setupPrecision(); } -void StdTransactionEditor::setupCategoryWidget(QString& categoryId) +void StdTransactionEditor::setupCategoryWidget(TQString& categoryId) { - TransactionEditor::setupCategoryWidget(dynamic_cast(m_editWidgets["category"]), m_splits, categoryId, SLOT(slotEditSplits())); + TransactionEditor::setupCategoryWidget(dynamic_cast(m_editWidgets["category"]), m_splits, categoryId, TQT_SLOT(slotEditSplits())); if(m_splits.count() == 1) m_shares = m_splits[0].shares(); } -bool StdTransactionEditor::isTransfer(const QString& accId1, const QString& accId2) const +bool StdTransactionEditor::isTransfer(const TQString& accId1, const TQString& accId2) const { if(accId1.isEmpty() || accId2.isEmpty()) return false; @@ -903,8 +903,8 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) // don't kick off VAT processing from here m_inUpdateVat = true; - QMap::const_iterator it_w; - QWidget* w; + TQMap::const_iterator it_w; + TQWidget* w; AccountSet aSet; // load the account widget @@ -929,11 +929,11 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) // load the category widget KMyMoneyCategory* category = dynamic_cast(m_editWidgets["category"]); - disconnect(category, SIGNAL(focusIn()), this, SLOT(slotEditSplits())); + disconnect(category, TQT_SIGNAL(focusIn()), this, TQT_SLOT(slotEditSplits())); // check if the current transaction has a reference to an equity account bool haveEquityAccount = false; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = m_transaction.splits().begin(); !haveEquityAccount && it_s != m_transaction.splits().end(); ++it_s) { MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); if(acc.accountType() == MyMoneyAccount::Equity) @@ -966,7 +966,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) else if(m_lastPostDate.isValid()) dynamic_cast(m_editWidgets["postdate"])->setDate(m_lastPostDate); else - dynamic_cast(m_editWidgets["postdate"])->setDate(QDate::currentDate()); + dynamic_cast(m_editWidgets["postdate"])->setDate(TQDate::tqcurrentDate()); if((w = haveWidget("number")) != 0) { dynamic_cast(w)->loadText(m_split.number()); @@ -979,23 +979,23 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) } dynamic_cast(m_editWidgets["status"])->setState(m_split.reconcileFlag()); - QString payeeId = m_split.payeeId(); + TQString payeeId = m_split.payeeId(); if(!payeeId.isEmpty()) { payee->setSelectedItem(payeeId); } m_splits.clear(); if(m_transaction.splitCount() < 2) { - category->completion()->setSelected(QString()); + category->completion()->setSelected(TQString()); } else { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = m_transaction.splits().begin(); it_s != m_transaction.splits().end(); ++it_s) { if((*it_s) == m_split) continue; m_splits.append(*it_s); } } - QString categoryId; + TQString categoryId; setupCategoryWidget(categoryId); if((w = haveWidget("cashflow")) != 0) { @@ -1004,7 +1004,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) } if((w = haveWidget("category-label")) != 0) { - QLabel *categoryLabel = dynamic_cast(w); + TQLabel *categoryLabel = dynamic_cast(w); if(isTransfer(m_split.accountId(), categoryId)) { if(m_split.value().isPositive()) categoryLabel->setText(i18n("Transfer from")); @@ -1040,7 +1040,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) } } if(action != KMyMoneyRegister::ActionNone) { - QLabel *categoryLabel = dynamic_cast(w); + TQLabel *categoryLabel = dynamic_cast(w); if(action == KMyMoneyRegister::ActionTransfer) { if(m_split.value().isPositive()) categoryLabel->setText(i18n("Transfer from")); @@ -1071,7 +1071,7 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) } } else { - dynamic_cast(m_editWidgets["postdate"])->loadDate(QDate()); + dynamic_cast(m_editWidgets["postdate"])->loadDate(TQDate()); dynamic_cast(m_editWidgets["status"])->setState(MyMoneySplit::Unknown); if(haveWidget("deposit")) { dynamic_cast(m_editWidgets["deposit"])->loadText(""); @@ -1092,16 +1092,16 @@ void StdTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action action) w->setEnabled(false); } - category->completion()->setSelected(QString()); + category->completion()->setSelected(TQString()); } // allow kick off VAT processing again m_inUpdateVat = false; } -QWidget* StdTransactionEditor::firstWidget(void) const +TQWidget* StdTransactionEditor::firstWidget(void) const { - QWidget* w = 0; + TQWidget* w = 0; if(m_initialAction != KMyMoneyRegister::ActionNone) w = haveWidget("payee"); return w; @@ -1111,7 +1111,7 @@ void StdTransactionEditor::slotReloadEditWidgets(void) { // reload category widget KMyMoneyCategory* category = dynamic_cast(m_editWidgets["category"]); - QString categoryId = category->selectedItem(); + TQString categoryId = category->selectedItem(); AccountSet aSet; aSet.addAccountGroup(MyMoneyAccount::Asset); @@ -1133,7 +1133,7 @@ void StdTransactionEditor::slotReloadEditWidgets(void) // reload payee widget KMyMoneyPayeeCombo* payee = dynamic_cast(m_editWidgets["payee"]); - QString payeeId = payee->selectedItem(); + TQString payeeId = payee->selectedItem(); payee->loadPayees(MyMoneyFile::instance()->payeeList()); @@ -1142,12 +1142,12 @@ void StdTransactionEditor::slotReloadEditWidgets(void) } } -void StdTransactionEditor::slotUpdatePayee(const QString& payeeId) +void StdTransactionEditor::slotUpdatePayee(const TQString& payeeId) { // we have a new payee assigned to this transaction. // retrieve some information about the state of the category widget KMyMoneyCategory* category = dynamic_cast(m_editWidgets["category"]); - QStringList list; + TQStringList list; category->selectedItems(list); // If payee has associated default account (category), set that now if @@ -1173,9 +1173,9 @@ void StdTransactionEditor::slotUpdatePayee(const QString& payeeId) // check if all value fields are empty kMyMoneyEdit* amount; - QStringList fields; + TQStringList fields; fields << "amount" << "payment" << "deposit"; - QStringList::const_iterator it_f; + TQStringList::const_iterator it_f; for(it_f = fields.begin(); it_f != fields.end(); ++it_f) { amount = dynamic_cast(haveWidget(*it_f)); if(amount && !amount->value().isZero()) @@ -1195,7 +1195,7 @@ void StdTransactionEditor::slotUpdatePayee(const QString& payeeId) // check if date has been altered by user kMyMoneyDateInput* postDate = dynamic_cast(m_editWidgets["postdate"]); if((m_lastPostDate.isValid() && (postDate->date() != m_lastPostDate)) - || (!m_lastPostDate.isValid() && (postDate->date() != QDate::currentDate()))) + || (!m_lastPostDate.isValid() && (postDate->date() != TQDate::tqcurrentDate()))) return; #endif @@ -1207,7 +1207,7 @@ void StdTransactionEditor::slotUpdatePayee(const QString& payeeId) MyMoneyMoney StdTransactionEditor::shares(const MyMoneyTransaction& t) const { MyMoneyMoney result; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).accountId() == m_account.id()) { result += (*it_s).shares(); @@ -1221,9 +1221,9 @@ struct uniqTransaction { int cnt; }; -void StdTransactionEditor::autoFill(const QString& payeeId) +void StdTransactionEditor::autoFill(const TQString& payeeId) { - QValueList > list; + TQValueList > list; MyMoneyTransactionFilter filter(m_account.id()); filter.addPayee(payeeId); MyMoneyFile::instance()->transactionList(list, filter); @@ -1231,17 +1231,17 @@ void StdTransactionEditor::autoFill(const QString& payeeId) // ok, we found at least one previous transaction. now we clear out // what we have collected so far and add those splits from // the previous transaction. - QValueList >::const_iterator it_t; - QMap uniqList; + TQValueList >::const_iterator it_t; + TQMap uniqList; // collect the transactions and see if we have any duplicates for(it_t = list.begin(); it_t != list.end(); ++it_t) { - QString key = (*it_t).first.accountSignature(); + TQString key = (*it_t).first.accountSignature(); int cnt = 0; - QMap::iterator it_u; + TQMap::iterator it_u; do { - QString ukey = QString("%1-%2").arg(key).arg(cnt); - it_u = uniqList.find(ukey); + TQString ukey = TQString("%1-%2").tqarg(key).tqarg(cnt); + it_u = uniqList.tqfind(ukey); if(it_u == uniqList.end()) { uniqList[ukey].t = &((*it_t).first); uniqList[ukey].cnt = 1; @@ -1289,7 +1289,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId) KSelectTransactionsDlg dlg(m_account, m_regForm); dlg.setCaption(i18n("Select autofill transaction")); - QMap::const_iterator it_u; + TQMap::const_iterator it_u; for(it_u = uniqList.begin(); it_u != uniqList.end(); ++it_u) { dlg.addTransaction(*(*it_u).t); } @@ -1303,7 +1303,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId) if(dlg.m_register->lastItem()) dlg.m_register->selectItem(dlg.m_register->lastItem()); - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { t = dlg.transaction(); } #if 0 @@ -1311,7 +1311,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId) #endif } else { int maxCnt = 0; - QMap::const_iterator it_u; + TQMap::const_iterator it_u; for(it_u = uniqList.begin(); it_u != uniqList.end(); ++it_u) { if((*it_u).cnt > maxCnt) { t = *(*it_u).t; @@ -1324,18 +1324,18 @@ void StdTransactionEditor::autoFill(const QString& payeeId) m_transaction.removeSplits(); m_split = MyMoneySplit(); MyMoneySplit otherSplit; - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = t.splits().begin(); it != t.splits().end(); ++it) { MyMoneySplit s(*it); s.setReconcileFlag(MyMoneySplit::NotReconciled); - s.setReconcileDate(QDate()); + s.setReconcileDate(TQDate()); s.clearId(); - s.setBankID(QString()); + s.setBankID(TQString()); // older versions of KMyMoney used to set the action // we don't need this anymore if(s.action() != MyMoneySplit::ActionAmortization && s.action() != MyMoneySplit::ActionInterest) { - s.setAction(QString()); + s.setAction(TQString()); } // FIXME update check number. The old comment contained @@ -1360,7 +1360,7 @@ void StdTransactionEditor::autoFill(const QString& payeeId) // the autofilled memo text which will then also be used // in this split. See createTransaction() for this logic. if(s.accountId() != m_account.id() && t.splitCount() == 2) - s.setMemo(QString()); + s.setMemo(TQString()); m_transaction.addSplit(s); if(s.accountId() == m_account.id() && m_split == MyMoneySplit()) { @@ -1381,14 +1381,14 @@ void StdTransactionEditor::autoFill(const QString& payeeId) } // now setup the widgets with the new data but keep the date - QDate date = dynamic_cast(m_editWidgets["postdate"])->date(); + TQDate date = dynamic_cast(m_editWidgets["postdate"])->date(); loadEditWidgets(action); dynamic_cast(m_editWidgets["postdate"])->setDate(date); } } // focus jumps into the category field - QWidget* w; + TQWidget* w; if((w = haveWidget("payee")) != 0) { w->setFocus(); } @@ -1398,7 +1398,7 @@ void StdTransactionEditor::slotUpdateAction(int action) { TabBar* tabbar = dynamic_cast(haveWidget("tabbar")); if(tabbar) { - QLabel* categoryLabel = dynamic_cast(haveWidget("category-label")); + TQLabel* categoryLabel = dynamic_cast(haveWidget("category-label")); KMyMoneyCashFlowCombo* cashflow = dynamic_cast(m_editWidgets["cashflow"]); switch(action) { case KMyMoneyRegister::ActionDeposit: @@ -1419,7 +1419,7 @@ void StdTransactionEditor::slotUpdateAction(int action) void StdTransactionEditor::slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection dir) { - QLabel* categoryLabel = dynamic_cast(haveWidget("category-label")); + TQLabel* categoryLabel = dynamic_cast(haveWidget("category-label")); // qDebug("Update cashflow to %d", dir); if(categoryLabel) { @@ -1440,9 +1440,9 @@ void StdTransactionEditor::slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirectio } } -void StdTransactionEditor::slotUpdateCategory(const QString& id) +void StdTransactionEditor::slotUpdateCategory(const TQString& id) { - QLabel *categoryLabel = dynamic_cast(haveWidget("category-label")); + TQLabel *categoryLabel = dynamic_cast(haveWidget("category-label")); // qDebug("Update category to %s", id.data()); if(categoryLabel) { @@ -1495,7 +1495,7 @@ void StdTransactionEditor::slotUpdateCategory(const QString& id) updateVAT(false); } -void StdTransactionEditor::slotUpdatePayment(const QString& txt) +void StdTransactionEditor::slotUpdatePayment(const TQString& txt) { MyMoneyMoney val(txt); @@ -1508,7 +1508,7 @@ void StdTransactionEditor::slotUpdatePayment(const QString& txt) updateVAT(); } -void StdTransactionEditor::slotUpdateDeposit(const QString& txt) +void StdTransactionEditor::slotUpdateDeposit(const TQString& txt) { MyMoneyMoney val(txt); if(val.isNegative()) { @@ -1520,7 +1520,7 @@ void StdTransactionEditor::slotUpdateDeposit(const QString& txt) updateVAT(); } -void StdTransactionEditor::slotUpdateAmount(const QString& txt) +void StdTransactionEditor::slotUpdateAmount(const TQString& txt) { // qDebug("Update amount to %s", txt.data()); MyMoneyMoney val(txt); @@ -1530,7 +1530,7 @@ void StdTransactionEditor::slotUpdateAmount(const QString& txt) void StdTransactionEditor::updateAmount(const MyMoneyMoney& val) { - QLabel *categoryLabel = dynamic_cast(haveWidget("category-label")); + TQLabel *categoryLabel = dynamic_cast(haveWidget("category-label")); if(categoryLabel) { KMyMoneyCashFlowCombo* cashflow = dynamic_cast(m_editWidgets["cashflow"]); @@ -1615,8 +1615,8 @@ void StdTransactionEditor::updateVAT(bool amountChanged) // if we made this a split transaction, then move the // focus to the memo field - if(qApp->focusWidget() == haveWidget("category")) { - QWidget* w = haveWidget("memo"); + if(tqApp->tqfocusWidget() == haveWidget("category")) { + TQWidget* w = haveWidget("memo"); if(w) w->setFocus(); } @@ -1658,7 +1658,7 @@ bool StdTransactionEditor::addVatSplit(MyMoneyTransaction& tr, const MyMoneyMone tax.setAccountId(vatAcc.id()); // qDebug("vat amount is '%s'", category.value("VatAmount").latin1()); - if(category.value("VatAmount").lower() != QString("net")) { + if(category.value("VatAmount").lower() != TQString("net")) { // split value is the gross value gv = amount; nv = gv / (MyMoneyMoney(1,1) + vatRate); @@ -1698,7 +1698,7 @@ MyMoneyMoney StdTransactionEditor::removeVatSplit(void) MyMoneySplit t; // tax split bool netValue = false; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = m_splits.begin(); it_s != m_splits.end(); ++it_s) { MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); if(!acc.value("VatAccount").isEmpty()) { @@ -1729,7 +1729,7 @@ MyMoneyMoney StdTransactionEditor::removeVatSplit(void) // block the signals to avoid popping up the split editor dialog // for nothing m_editWidgets["category"]->blockSignals(true); - QString id; + TQString id; setupCategoryWidget(id); m_editWidgets["category"]->blockSignals(false); @@ -1737,20 +1737,20 @@ MyMoneyMoney StdTransactionEditor::removeVatSplit(void) return amount; } -bool StdTransactionEditor::isComplete(QString& reason) const +bool StdTransactionEditor::isComplete(TQString& reason) const { - reason = QString(); - // reason.clear(); // for Qt4 + reason = TQString(); + // reason.clear(); // for TQt4 - QMap::const_iterator it_w; + TQMap::const_iterator it_w; kMyMoneyDateInput* postDate = dynamic_cast(m_editWidgets["postdate"]); if(postDate) { postDate->markAsBadDate(); - QToolTip::remove(postDate); + TQToolTip::remove(postDate); if(postDate->date().isValid() && (postDate->date() < m_account.openingDate())) { postDate->markAsBadDate(true, KMyMoneyGlobalSettings::listNegativeValueColor()); reason = i18n("Cannot enter transaction with postdate prior to account's opening date."); - QToolTip::add(postDate, reason); + TQToolTip::add(postDate, reason); return false; } } @@ -1783,35 +1783,35 @@ bool StdTransactionEditor::isComplete(QString& reason) const return it_w != m_editWidgets.end(); } -void StdTransactionEditor::slotCreateCategory(const QString& name, QString& id) +void StdTransactionEditor::slotCreateCategory(const TQString& name, TQString& id) { - MyMoneyAccount acc, parent; + MyMoneyAccount acc, tqparent; acc.setName(name); KMyMoneyCashFlowCombo* cashflow = dynamic_cast(haveWidget("cashflow")); if(cashflow) { // form based input if(cashflow->direction() == KMyMoneyRegister::Deposit) - parent = MyMoneyFile::instance()->income(); + tqparent = MyMoneyFile::instance()->income(); else - parent = MyMoneyFile::instance()->expense(); + tqparent = MyMoneyFile::instance()->expense(); } else if(haveWidget("deposit")) { // register based input kMyMoneyEdit* deposit = dynamic_cast(m_editWidgets["deposit"]); if(deposit->value().isPositive()) - parent = MyMoneyFile::instance()->income(); + tqparent = MyMoneyFile::instance()->income(); else - parent = MyMoneyFile::instance()->expense(); + tqparent = MyMoneyFile::instance()->expense(); } else - parent = MyMoneyFile::instance()->expense(); + tqparent = MyMoneyFile::instance()->expense(); // TODO extract possible first part of a hierarchy and check if it is one - // of our top categories. If so, remove it and select the parent + // of our top categories. If so, remove it and select the tqparent // according to this information. - emit createCategory(acc, parent); + emit createCategory(acc, tqparent); // return id id = acc.id(); @@ -1819,14 +1819,14 @@ void StdTransactionEditor::slotCreateCategory(const QString& name, QString& id) int StdTransactionEditor::slotEditSplits(void) { - int rc = QDialog::Rejected; + int rc = TQDialog::Rejected; if(!m_openEditSplits) { // only get in here in a single instance m_openEditSplits = true; // force focus change to update all data - QWidget* w = dynamic_cast(m_editWidgets["category"])->splitButton(); + TQWidget* w = dynamic_cast(m_editWidgets["category"])->splitButton(); if(w) w->setFocus(); @@ -1877,10 +1877,10 @@ int StdTransactionEditor::slotEditSplits(void) 0, m_priceInfo, m_regForm); - connect(dlg, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(dlg, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), this, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&))); + connect(dlg, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(dlg, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), this, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&))); - if((rc = dlg->exec()) == QDialog::Accepted) { + if((rc = dlg->exec()) == TQDialog::Accepted) { m_transaction = dlg->transaction(); m_split = m_transaction.splits()[0]; loadEditWidgets(); @@ -1900,7 +1900,7 @@ int StdTransactionEditor::slotEditSplits(void) return rc; } -void StdTransactionEditor::checkPayeeInSplit(MyMoneySplit& s, const QString& payeeId) +void StdTransactionEditor::checkPayeeInSplit(MyMoneySplit& s, const TQString& payeeId) { if(s.accountId().isEmpty()) return; @@ -1957,7 +1957,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone { // extract price info from original transaction m_priceInfo.clear(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; if(!torig.id().isEmpty()) { for(it_s = torig.splits().begin(); it_s != torig.splits().end(); ++it_s) { if((*it_s).id() != sorig.id()) { @@ -2006,7 +2006,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone } KMyMoneyPayeeCombo* payee = dynamic_cast(m_editWidgets["payee"]); - QString payeeId; + TQString payeeId; if(!isMultiSelection() || (isMultiSelection() && !payee->currentText().isEmpty())) { payeeId = payee->selectedItem(); s0.setPayeeId(payeeId); @@ -2029,7 +2029,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone s0.setReconcileFlag(status->state()); if(s0.reconcileFlag() == MyMoneySplit::Reconciled && !s0.reconcileDate().isValid()) - s0.setReconcileDate(QDate::currentDate()); + s0.setReconcileDate(TQDate::tqcurrentDate()); checkPayeeInSplit(s0, payeeId); @@ -2040,7 +2040,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone // if we have none or only one other split, we reconstruct it here // if we have more than one other split, we take them as they are // make sure to perform all those changes on a local copy - QValueList splits = m_splits; + TQValueList splits = m_splits; MyMoneySplit s1; if(splits.count() == 0) { @@ -2056,7 +2056,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone // split or create it if(isMultiSelection()) { if(torig.splitCount() == 2) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = torig.splits().begin(); it_s != torig.splits().end(); ++it_s) { if((*it_s).id() == sorig.id()) continue; @@ -2109,7 +2109,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone return false; } else { MyMoneyAccount cat = MyMoneyFile::instance()->account(s1.accountId()); - if(m_priceInfo.find(cat.currencyId()) != m_priceInfo.end()) { + if(m_priceInfo.tqfind(cat.currencyId()) != m_priceInfo.end()) { shares = (s1.value() * m_priceInfo[cat.currencyId()]).reduce().convert(cat.fraction()); } else @@ -2124,7 +2124,7 @@ bool StdTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyMone t.addSplit(s1); } else { - QValueList::iterator it_s; + TQValueList::iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { s1 = *it_s; s1.clearId(); @@ -2143,7 +2143,7 @@ void StdTransactionEditor::setupFinalWidgets(void) addFinalWidget(haveWidget("status")); } -void StdTransactionEditor::slotUpdateAccount(const QString& id) +void StdTransactionEditor::slotUpdateAccount(const TQString& id) { TransactionEditor::slotUpdateAccount(id); KMyMoneyCategory* category = dynamic_cast(m_editWidgets["category"]); diff --git a/kmymoney2/dialogs/transactioneditor.h b/kmymoney2/dialogs/transactioneditor.h index bf47598..72ecff8 100644 --- a/kmymoney2/dialogs/transactioneditor.h +++ b/kmymoney2/dialogs/transactioneditor.h @@ -21,8 +21,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -38,12 +38,13 @@ class KCurrencyExchange; class KMyMoneyCategory; -class TransactionEditor : public QObject +class TransactionEditor : public TQObject { Q_OBJECT + TQ_OBJECT public: TransactionEditor() {} - TransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate); + TransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate); virtual ~TransactionEditor(); /** @@ -57,12 +58,12 @@ public: * no account so all will be shown. I have no idea anymore, what I * tried to say with the first sentence above. :( Maybe this is crap. * - * @param tabOrderWidgets QWidgetList which will be filled with the pointers + * @param tabOrderWidgets TQWidgetList which will be filled with the pointers * to the editWidgets in their tab order * @param account account that is currently shown in the calling ledger view * @param action default action (defaults to ActionNone). */ - void setup(QWidgetList& tabOrderWidgets, const MyMoneyAccount& account = MyMoneyAccount(), KMyMoneyRegister::Action action = KMyMoneyRegister::ActionNone); + void setup(TQWidgetList& tabOrderWidgets, const MyMoneyAccount& account = MyMoneyAccount(), KMyMoneyRegister::Action action = KMyMoneyRegister::ActionNone); /** * Enter the transactions into the ledger. In case of a newly created @@ -73,7 +74,7 @@ public: * (the default) a warning will be displayed when the balance crosses the minimum * or maximum balance settings for the account. */ - virtual bool enterTransactions(QString& newId, bool askForSchedule = true, bool suppressBalanceWarnings = false); + virtual bool enterTransactions(TQString& newId, bool askForSchedule = true, bool suppressBalanceWarnings = false); /** * This method creates a transaction based on the contents of the current widgets, @@ -110,7 +111,7 @@ public: * * @sa transactionDataSufficient() */ - virtual bool isComplete(QString& reason) const = 0; + virtual bool isComplete(TQString& reason) const = 0; /** * This method returns information if the editor is started with multiple transactions @@ -130,28 +131,28 @@ public: * Returns a pointer to the widget that should receive * the focus after the editor has been started. */ - virtual QWidget* firstWidget(void) const = 0; + virtual TQWidget* firstWidget(void) const = 0; /** * Returns a pointer to a widget by name */ - QWidget* haveWidget(const QString& name) const; + TQWidget* haveWidget(const TQString& name) const; void setTransaction(const MyMoneyTransaction& t, const MyMoneySplit& s); - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); const MyMoneyAccount& account(void) const { return m_account; } void clearFinalWidgets(void); - void addFinalWidget(const QWidget*); + void addFinalWidget(const TQWidget*); public slots: void slotReloadEditWidgets(void); /** - * The default implementation returns QDialog::Rejected + * The default implementation returns TQDialog::Rejected */ virtual int slotEditSplits(void); @@ -161,13 +162,13 @@ public slots: * * @param id of the account to be used */ - void slotUpdateAccount(const QString& id); + void slotUpdateAccount(const TQString& id); protected: virtual void createEditWidgets(void) = 0; virtual void setupFinalWidgets(void) = 0; virtual void loadEditWidgets(KMyMoneyRegister::Action action = KMyMoneyRegister::ActionNone) = 0; - void setupCategoryWidget(KMyMoneyCategory* category, const QValueList& splits, QString& categoryId, const char* splitEditSlot, bool allowObjectCreation = true); + void setupCategoryWidget(KMyMoneyCategory* category, const TQValueList& splits, TQString& categoryId, const char* splitEditSlot, bool allowObjectCreation = true); /** * This method sets the precision of the value widgets to reflect @@ -179,7 +180,7 @@ protected: protected slots: virtual void slotUpdateButtonState(void); virtual void slotUpdateAccount(void); - virtual void slotNumberChanged(const QString&); + virtual void slotNumberChanged(const TQString&); signals: /** @@ -207,17 +208,17 @@ signals: * @param txt The name of the payee to be created * @param id A connected slot should store the id of the created object in this variable */ - void createPayee(const QString& txt, QString& id); + void createPayee(const TQString& txt, TQString& id); /** * This signal is sent out, when a new category needs to be created - * Depending on the setting of either a payment or deposit, the parent + * Depending on the setting of either a payment or deposit, the tqparent * account will be preset to Expense or Income. * * @param account reference to account info. Will be filled by called slot - * @param parent reference to parent account + * @param tqparent reference to tqparent account */ - void createCategory(MyMoneyAccount& account, const MyMoneyAccount& parent); + void createCategory(MyMoneyAccount& account, const MyMoneyAccount& tqparent); /** * This signal is sent out, when a new security (e.g. stock )needs to be created @@ -225,9 +226,9 @@ signals: * will be created. * * @param account reference to account info. Will be filled by called slot - * @param parent reference to parent account + * @param tqparent reference to tqparent account */ - void createSecurity(MyMoneyAccount& account, const MyMoneyAccount& parent); + void createSecurity(MyMoneyAccount& account, const MyMoneyAccount& tqparent); /** * Signal is emitted, if any of the widgets enters (@a state equals @a true) @@ -237,7 +238,7 @@ signals: */ void objectCreation(bool state); - void statusMsg(const QString& txt); + void statusMsg(const TQString& txt); void statusProgress(int cnt, int base); @@ -246,7 +247,7 @@ signals: * * @param date the post date of the newly created transaction */ - void lastPostDateUsed(const QDate& date); + void lastPostDateUsed(const TQDate& date); /** * This signal is sent out, if the user decides to schedule the transaction @a t @@ -273,22 +274,22 @@ signals: /** * This signal is sent out, if any of the balance warning levels * for @p account has been reached. @p msg contains the message text. - * @p parent points to the parent widget to be used for the warning message box. + * @p tqparent points to the tqparent widget to be used for the warning message box. */ - void balanceWarning(QWidget* parent, const MyMoneyAccount& account, const QString& msg); + void balanceWarning(TQWidget* tqparent, const MyMoneyAccount& account, const TQString& msg); protected: - QValueList m_splits; + TQValueList m_splits; KMyMoneyRegister::SelectedTransactions m_transactions; - QValueList m_finalEditWidgets; + TQValueList m_finalEditWidgets; TransactionEditorContainer* m_regForm; KMyMoneyRegister::Transaction* m_item; - KMyMoneyRegister::QWidgetContainer m_editWidgets; + KMyMoneyRegister::TQWidgetContainer m_editWidgets; MyMoneyAccount m_account; MyMoneyTransaction m_transaction; MyMoneySplit m_split; - QDate m_lastPostDate; - QMap m_priceInfo; + TQDate m_lastPostDate; + TQMap m_priceInfo; KMyMoneyRegister::Action m_initialAction; bool m_openEditSplits; }; @@ -297,15 +298,16 @@ protected: class StdTransactionEditor : public TransactionEditor { Q_OBJECT + TQ_OBJECT public: StdTransactionEditor(); - StdTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate); + StdTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::Transaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate); ~StdTransactionEditor(); - bool isComplete(QString& reason) const; - QWidget* firstWidget(void) const; + bool isComplete(TQString& reason) const; + TQWidget* firstWidget(void) const; - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); /** * This method creates a transaction based on the contents of the current widgets, @@ -329,18 +331,18 @@ public: public slots: int slotEditSplits(void); - void slotUpdateAmount(const QString&); + void slotUpdateAmount(const TQString&); protected slots: void slotReloadEditWidgets(void); - void slotUpdatePayment(const QString&); - void slotUpdateDeposit(const QString&); - void slotUpdateCategory(const QString&); - void slotUpdatePayee(const QString&); + void slotUpdatePayment(const TQString&); + void slotUpdateDeposit(const TQString&); + void slotUpdateCategory(const TQString&); + void slotUpdatePayee(const TQString&); void slotUpdateCashFlow(KMyMoneyRegister::CashFlowDirection); - void slotCreateCategory(const QString&, QString&); + void slotCreateCategory(const TQString&, TQString&); void slotUpdateAction(int action); - void slotUpdateAccount(const QString& id); + void slotUpdateAccount(const TQString& id); protected: /** @@ -358,17 +360,17 @@ protected: */ void loadEditWidgets(KMyMoneyRegister::Action action = KMyMoneyRegister::ActionNone); - void setupCategoryWidget(QString&); + void setupCategoryWidget(TQString&); void updateAmount(const MyMoneyMoney& value); - bool isTransfer(const QString& accId1, const QString& accId2) const; + bool isTransfer(const TQString& accId1, const TQString& accId2) const; - void checkPayeeInSplit(MyMoneySplit& s, const QString& payeeId); + void checkPayeeInSplit(MyMoneySplit& s, const TQString& payeeId); /** * This method fills the editor widgets with the last transaction * that can be found for payee @a payeeId in the account @a m_account. */ - void autoFill(const QString& payeeId); + void autoFill(const TQString& payeeId); /** * Extracts the amount of the transaction from the widgets depending diff --git a/kmymoney2/dialogs/transactionmatcher.cpp b/kmymoney2/dialogs/transactionmatcher.cpp index 5b8d4b5..2ed5356 100644 --- a/kmymoney2/dialogs/transactionmatcher.cpp +++ b/kmymoney2/dialogs/transactionmatcher.cpp @@ -80,38 +80,38 @@ void TransactionMatcher::match(MyMoneyTransaction tm, MyMoneySplit sm, MyMoneyTr // verify that the amounts are the same, otherwise we should not be matching! if(sm.shares() != si.shares()) { - throw new MYMONEYEXCEPTION(i18n("Splits for %1 have conflicting values (%2,%3)").arg(m_account.name()).arg(sm.shares().formatMoney(m_account, sec), si.shares().formatMoney(m_account, sec))); + throw new MYMONEYEXCEPTION(i18n("Splits for %1 have conflicting values (%2,%3)").tqarg(m_account.name()).tqarg(sm.shares().formatMoney(m_account, sec), si.shares().formatMoney(m_account, sec))); } // ipwizard: I took over the code to keep the bank id found in the endMatchTransaction - // This might not work for QIF imports as they don't setup this information. It sure + // This might not work for TQIF imports as they don't setup this information. It sure // makes sense for OFX and HBCI. - const QString& bankID = si.bankID(); + const TQString& bankID = si.bankID(); if (!bankID.isEmpty()) { try { if (sm.bankID().isEmpty() ) { sm.setBankID( bankID ); tm.modifySplit(sm); } else if(sm.bankID() != bankID) { - throw new MYMONEYEXCEPTION(i18n("Both of these transactions have been imported into %1. Therefore they cannot be matched. Matching works with one imported transaction and one non-imported transaction.").arg(m_account.name())); + throw new MYMONEYEXCEPTION(i18n("Both of these transactions have been imported into %1. Therefore they cannot be matched. Matching works with one imported transaction and one non-imported transaction.").tqarg(m_account.name())); } } catch(MyMoneyException *e) { - QString estr = e->what(); + TQString estr = e->what(); delete e; - throw new MYMONEYEXCEPTION(i18n("Unable to match all splits (%1)").arg(estr)); + throw new MYMONEYEXCEPTION(i18n("Unable to match all splits (%1)").tqarg(estr)); } } #if 0 // Ace's original code // TODO (Ace) Add in another error to catch the case where a user // tries to match two hand-entered transactions. - QValueList endSplits = endMatchTransaction.splits(); - QValueList::const_iterator it_split = endSplits.begin(); + TQValueList endSplits = endMatchTransaction.splits(); + TQValueList::const_iterator it_split = endSplits.begin(); while (it_split != endSplits.end()) { // find the corresponding split in the start transaction MyMoneySplit startSplit; - QString accountid = (*it_split).accountId(); + TQString accountid = (*it_split).accountId(); try { startSplit = startMatchTransaction.splitByAccount( accountid ); @@ -129,11 +129,11 @@ void TransactionMatcher::match(MyMoneyTransaction tm, MyMoneySplit sm, MyMoneyTr // matching! if ( (*it_split).value() != startSplit.value() ) { - QString accountname = MyMoneyFile::instance()->account(accountid).name(); - throw new MYMONEYEXCEPTION(i18n("Splits for %1 have conflicting values (%2,%3)").arg(accountname).arg((*it_split).value().formatMoney(),startSplit.value().formatMoney())); + TQString accountname = MyMoneyFile::instance()->account(accountid).name(); + throw new MYMONEYEXCEPTION(i18n("Splits for %1 have conflicting values (%2,%3)").tqarg(accountname).tqarg((*it_split).value().formatMoney(),startSplit.value().formatMoney())); } - QString bankID = (*it_split).bankID(); + TQString bankID = (*it_split).bankID(); if ( ! bankID.isEmpty() ) { try @@ -145,15 +145,15 @@ void TransactionMatcher::match(MyMoneyTransaction tm, MyMoneySplit sm, MyMoneyTr } else { - QString accountname = MyMoneyFile::instance()->account(accountid).name(); - throw new MYMONEYEXCEPTION(i18n("Both of these transactions have been imported into %1. Therefore they cannot be matched. Matching works with one imported transaction and one non-imported transaction.").arg(accountname)); + TQString accountname = MyMoneyFile::instance()->account(accountid).name(); + throw new MYMONEYEXCEPTION(i18n("Both of these transactions have been imported into %1. Therefore they cannot be matched. Matching works with one imported transaction and one non-imported transaction.").tqarg(accountname)); } } catch(MyMoneyException *e) { - QString estr = e->what(); + TQString estr = e->what(); delete e; - throw new MYMONEYEXCEPTION(i18n("Unable to match all splits (%1)").arg(estr)); + throw new MYMONEYEXCEPTION(i18n("Unable to match all splits (%1)").tqarg(estr)); } } ++it_split; @@ -179,7 +179,7 @@ void TransactionMatcher::match(MyMoneyTransaction tm, MyMoneySplit sm, MyMoneyTr } // combine the two memos into one - QString memo = sm.memo(); + TQString memo = sm.memo(); if(!si.memo().isEmpty() && si.memo() != memo) { sm.setValue("kmm-orig-memo", memo); if(!memo.isEmpty()) @@ -217,7 +217,7 @@ void TransactionMatcher::unmatch(const MyMoneyTransaction& _t, const MyMoneySpli // restore the postdate if modified if(!sm.value("kmm-orig-postdate").isEmpty()) { - tm.setPostDate(QDate::fromString(sm.value("kmm-orig-postdate"), Qt::ISODate)); + tm.setPostDate(TQDate::fromString(sm.value("kmm-orig-postdate"), Qt::ISODate)); } // restore payee if modified @@ -257,13 +257,13 @@ void TransactionMatcher::accept(const MyMoneyTransaction& _t, const MyMoneySplit } } -void TransactionMatcher::checkTransaction(const MyMoneyTransaction& tm, const MyMoneyTransaction& ti, const MyMoneySplit& si, QPair& lastMatch, TransactionMatcher::autoMatchResultE& result, int variation) const +void TransactionMatcher::checkTransaction(const MyMoneyTransaction& tm, const MyMoneyTransaction& ti, const MyMoneySplit& si, TQPair& lastMatch, TransactionMatcher::autoMatchResultE& result, int variation) const { Q_UNUSED(ti); - const QValueList& splits = tm.splits(); - QValueList::const_iterator it_s; + const TQValueList& splits = tm.splits(); + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneyMoney upper((*it_s).shares()); MyMoneyMoney lower(upper); @@ -277,7 +277,7 @@ void TransactionMatcher::checkTransaction(const MyMoneyTransaction& tm, const My // check for duplicate (we can only do that, if we have a bankID) if(!si.bankID().isEmpty()) { if((*it_s).bankID() == si.bankID()) { - lastMatch = QPair(tm, *it_s); + lastMatch = TQPair(tm, *it_s); result = matchedDuplicate; break; } @@ -292,10 +292,10 @@ void TransactionMatcher::checkTransaction(const MyMoneyTransaction& tm, const My && (si.shares() >= lower) && (si.shares() <= upper) && !(*it_s).isMatched()) { if(tm.postDate() == ti.postDate()) { - lastMatch = QPair(tm, *it_s); + lastMatch = TQPair(tm, *it_s); result = matchedExact; } else if(result != matchedExact) { - lastMatch = QPair(tm, *it_s); + lastMatch = TQPair(tm, *it_s); result = matched; } } @@ -313,12 +313,12 @@ MyMoneyObject const * TransactionMatcher::findMatch(const MyMoneyTransaction& ti filter.setDateFilter(ti.postDate().addDays(-m_days), ti.postDate().addDays(m_days)); filter.setAmountFilter(si.shares(), si.shares()); - QValueList > list; + TQValueList > list; MyMoneyFile::instance()->transactionList(list, filter); // parse list - QValueList >::iterator it_l; - QPair lastMatch; + TQValueList >::iterator it_l; + TQPair lastMatch; for(it_l = list.begin(); (result != matchedDuplicate) && (it_l != list.end()); ++it_l) { // just skip myself @@ -336,13 +336,13 @@ MyMoneyObject const * TransactionMatcher::findMatch(const MyMoneyTransaction& ti } else { // if we did not find anything, we need to scan for scheduled transactions - QValueList list; - QValueList::iterator it_sch; + TQValueList list; + TQValueList::iterator it_sch; // find all schedules that have a reference to the current account list = MyMoneyFile::instance()->scheduleList(m_account.id()); for(it_sch = list.begin(); (result != matched && result != matchedExact) && (it_sch != list.end()); ++it_sch) { // get the next due date adjusted by the weekend switch - QDate nextDueDate = (*it_sch).nextDueDate(); + TQDate nextDueDate = (*it_sch).nextDueDate(); if((*it_sch).isOverdue() || (nextDueDate >= ti.postDate().addDays(-m_days) && nextDueDate <= ti.postDate().addDays(m_days))) { diff --git a/kmymoney2/dialogs/transactionmatcher.h b/kmymoney2/dialogs/transactionmatcher.h index e5e036c..3295da1 100644 --- a/kmymoney2/dialogs/transactionmatcher.h +++ b/kmymoney2/dialogs/transactionmatcher.h @@ -134,7 +134,7 @@ public: void setMatchWindow(int days) { m_days = days; } private: - void checkTransaction(const MyMoneyTransaction& tm, const MyMoneyTransaction& ti, const MyMoneySplit& si, QPair& lastMatch, autoMatchResultE& result, int variation = 0) const; + void checkTransaction(const MyMoneyTransaction& tm, const MyMoneyTransaction& ti, const MyMoneySplit& si, TQPair& lastMatch, autoMatchResultE& result, int variation = 0) const; private: MyMoneyAccount m_account; diff --git a/kmymoney2/kmymoney2.cpp b/kmymoney2/kmymoney2.cpp index 40cc1d6..b423559 100644 --- a/kmymoney2/kmymoney2.cpp +++ b/kmymoney2/kmymoney2.cpp @@ -32,16 +32,16 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include // temp for problem 1105503 -#include // only for performance tests -#include -#include -#include -#include +#include +#include +#include +#include +#include // temp for problem 1105503 +#include // only for performance tests +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -160,8 +160,8 @@ public: m_ft(0), m_moveToAccountSelector(0), statementXMLindex(0), m_collectingStatements(false) {} void unlinkStatementXML(void); - void moveInvestmentTransaction(const QString& fromId, - const QString& toId, + void moveInvestmentTransaction(const TQString& fromId, + const TQString& toId, const MyMoneyTransaction& t); MyMoneyFileTransaction* m_ft; @@ -170,12 +170,12 @@ public: KBalanceWarning* m_balanceWarning; bool m_collectingStatements; - QStringList m_statementResults; + TQStringList m_statementResults; KMyMoneyPlugin::PluginLoader* m_pluginLoader; - QString m_lastPayeeEntered; + TQString m_lastPayeeEntered; }; -KMyMoney2App::KMyMoney2App(QWidget * /*parent*/ , const char* name) : +KMyMoney2App::KMyMoney2App(TQWidget * /*tqparent*/ , const char* name) : KMainWindow(0, name), DCOPObject("kmymoney2app"), d(new Private), @@ -196,10 +196,10 @@ KMyMoney2App::KMyMoney2App(QWidget * /*parent*/ , const char* name) : updateCaption(true); - QFrame* frame = new QFrame(this); - frame->setFrameStyle(QFrame::NoFrame); + TQFrame* frame = new TQFrame(this); + frame->setFrameStyle(TQFrame::NoFrame); // values for margin (11) and spacing(6) taken from KDialog implementation - QBoxLayout* layout = new QBoxLayout(frame, QBoxLayout::TopToBottom, 2, 6); + TQBoxLayout* tqlayout = new TQBoxLayout(frame, TQBoxLayout::TopToBottom, 2, 6); ::timetrace("init statusbar"); initStatusBar(); @@ -210,8 +210,8 @@ KMyMoney2App::KMyMoney2App(QWidget * /*parent*/ , const char* name) : ::timetrace("create view"); myMoneyView = new KMyMoneyView(frame, "KMyMoneyView"); - layout->addWidget(myMoneyView, 10); - connect(myMoneyView, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT(slotResetSelections())); + tqlayout->addWidget(myMoneyView, 10); + connect(myMoneyView, TQT_SIGNAL(aboutToShowPage(TQWidget*)), TQT_TQOBJECT(this), TQT_SLOT(slotResetSelections())); /////////////////////////////////////////////////////////////////// // call inits to invoke all other construction parts @@ -219,8 +219,8 @@ KMyMoney2App::KMyMoney2App(QWidget * /*parent*/ , const char* name) : readOptions(); #if 0 - m_pluginSignalMapper = new QSignalMapper( this ); - connect( m_pluginSignalMapper, SIGNAL( mapped( const QString& ) ), this, SLOT( slotPluginImport( const QString& ) ) ); + m_pluginSignalMapper = new TQSignalMapper( this ); + connect( m_pluginSignalMapper, TQT_SIGNAL( mapped( const TQString& ) ), TQT_TQOBJECT(this), TQT_SLOT( slotPluginImport( const TQString& ) ) ); #endif // now initialize the plugin structure @@ -232,10 +232,10 @@ KMyMoney2App::KMyMoney2App(QWidget * /*parent*/ , const char* name) : ::timetrace("done"); - connect(&proc,SIGNAL(processExited(KProcess *)),this,SLOT(slotProcessExited())); + connect(&proc,TQT_SIGNAL(processExited(KProcess *)),TQT_TQOBJECT(this), TQT_SLOT(slotProcessExited())); // force to show the home page if the file is closed - connect(action("view_show_transaction_detail"), SIGNAL(toggled(bool)), myMoneyView, SLOT(slotShowTransactionDetail(bool))); + connect(action("view_show_transaction_detail"), TQT_SIGNAL(toggled(bool)), myMoneyView, TQT_SLOT(slotShowTransactionDetail(bool))); m_backupState = BACKUP_IDLE; @@ -245,14 +245,14 @@ KMyMoney2App::KMyMoney2App(QWidget * /*parent*/ , const char* name) : m_autoSaveEnabled = KMyMoneyGlobalSettings::autoSaveFile(); m_autoSavePeriod = KMyMoneyGlobalSettings::autoSavePeriod(); - m_autoSaveTimer = new QTimer(this); - connect(m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave())); + m_autoSaveTimer = new TQTimer(this); + connect(m_autoSaveTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(slotAutoSave())); // make sure, we get a note when the engine changes state - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotDataChanged())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotDataChanged())); // make sure we have a balance warning object - d->m_balanceWarning = new KBalanceWarning(this); + d->m_balanceWarning = new KBalanceWarning(TQT_TQOBJECT(this)); // kickstart date change timer slotDateChanged(); @@ -285,15 +285,15 @@ const KURL KMyMoney2App::lastOpenedURL(void) void KMyMoney2App::initDynamicMenus(void) { - QWidget* w = factory()->container("transaction_move_menu", this); - QPopupMenu *menu = dynamic_cast(w); + TQWidget* w = factory()->container("transaction_move_menu", this); + TQPopupMenu *menu = dynamic_cast(w); if(menu) { d->m_moveToAccountSelector = new kMyMoneyAccountSelector(menu, 0, 0, false); menu->insertItem(d->m_moveToAccountSelector); - connect(d->m_moveToAccountSelector, SIGNAL(itemSelected(const QString&)), this, SLOT(slotMoveToAccount(const QString&))); - connect(this, SIGNAL(accountSelected(const MyMoneyAccount&)), this, SLOT(slotUpdateMoveToAccountMenu())); - connect(this, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), this, SLOT(slotUpdateMoveToAccountMenu())); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotUpdateMoveToAccountMenu())); + connect(d->m_moveToAccountSelector, TQT_SIGNAL(itemSelected(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotMoveToAccount(const TQString&))); + connect(TQT_TQOBJECT(this), TQT_SIGNAL(accountSelected(const MyMoneyAccount&)), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateMoveToAccountMenu())); + connect(TQT_TQOBJECT(this), TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateMoveToAccountMenu())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateMoveToAccountMenu())); } } @@ -304,186 +304,186 @@ void KMyMoney2App::initActions(void) // ************* // The File menu // ************* - KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); - KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); - KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); - KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); - KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); - KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); - KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); - KStdAction::print(this, SLOT(slotPrintView()), actionCollection()); - - new KAction(i18n("Open database..."), "",0,this,SLOT(slotOpenDatabase()),actionCollection(),"open_database"); - new KAction(i18n("Save as database..."), "",0,this,SLOT(slotSaveAsDatabase()),actionCollection(),"saveas_database"); - new KAction(i18n("Backup..."), "backup",0,this,SLOT(slotFileBackup()),actionCollection(),"file_backup"); - new KAction(i18n("QIF..."), "", 0, this, SLOT(slotQifImport()), actionCollection(), "file_import_qif"); - new KAction(i18n("Gnucash..."), "", 0, this, SLOT(slotGncImport()), actionCollection(), "file_import_gnc"); - new KAction(i18n("Statement file..."), "", 0, this, SLOT(slotStatementImport()), actionCollection(), "file_import_statement"); - - new KAction(i18n("Account Template..."), "", 0, this, SLOT(slotLoadAccountTemplates()), actionCollection(), "file_import_template"); - new KAction(i18n("Account Template..."), "", 0, this, SLOT(slotSaveAccountTemplates()), actionCollection(), "file_export_template"); - new KAction(i18n("QIF..."), "", 0, this, SLOT(slotQifExport()), actionCollection(), "file_export_qif"); - new KAction(i18n("Personal Data..."), "personal_data", 0, this, SLOT(slotFileViewPersonal()), actionCollection(), "view_personal_data"); + KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotFileNew()), actionCollection()); + KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), actionCollection()); + KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); + KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), actionCollection()); + KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), actionCollection()); + KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(slotFileClose()), actionCollection()); + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection()); + KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotPrintView()), actionCollection()); + + new KAction(i18n("Open database..."), "",0,TQT_TQOBJECT(this), TQT_SLOT(slotOpenDatabase()),actionCollection(),"open_database"); + new KAction(i18n("Save as database..."), "",0,TQT_TQOBJECT(this), TQT_SLOT(slotSaveAsDatabase()),actionCollection(),"saveas_database"); + new KAction(i18n("Backup..."), "backup",0,TQT_TQOBJECT(this), TQT_SLOT(slotFileBackup()),actionCollection(),"file_backup"); + new KAction(i18n("TQIF..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotQifImport()), actionCollection(), "file_import_qif"); + new KAction(i18n("Gnucash..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotGncImport()), actionCollection(), "file_import_gnc"); + new KAction(i18n("Statement file..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotStatementImport()), actionCollection(), "file_import_statement"); + + new KAction(i18n("Account Template..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotLoadAccountTemplates()), actionCollection(), "file_import_template"); + new KAction(i18n("Account Template..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSaveAccountTemplates()), actionCollection(), "file_export_template"); + new KAction(i18n("TQIF..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotQifExport()), actionCollection(), "file_export_qif"); + new KAction(i18n("Personal Data..."), "personal_data", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFileViewPersonal()), actionCollection(), "view_personal_data"); #if KMM_DEBUG - new KAction(i18n("Dump Memory"), "", 0, this, SLOT(slotFileFileInfo()), actionCollection(), "file_dump"); + new KAction(i18n("Dump Memory"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFileFileInfo()), actionCollection(), "file_dump"); #endif - new KAction(i18n("File-Information..."), "info", 0, this, SLOT(slotFileInfoDialog()), actionCollection(), "view_file_info"); + new KAction(i18n("File-Information..."), "info", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFileInfoDialog()), actionCollection(), "view_file_info"); // ************* // The Edit menu // ************* - new KAction(i18n("Find transaction..."), "transaction_find", KShortcut("Ctrl+F"), this, SLOT(slotFindTransaction()), actionCollection(), "edit_find_transaction"); + new KAction(i18n("Find transaction..."), "transaction_tqfind", KShortcut("Ctrl+F"), TQT_TQOBJECT(this), TQT_SLOT(slotFindTransaction()), actionCollection(), "edit_find_transaction"); // ************* // The View menu // ************* new KToggleAction(i18n("Show Transaction Detail"), KShortcut("Ctrl+T"), actionCollection(), "view_show_transaction_detail"); - new KToggleAction(i18n("Hide reconciled transactions"), "hide_reconciled", KShortcut("Ctrl+R"), this, SLOT(slotHideReconciledTransactions()), actionCollection(), "view_hide_reconciled_transactions"); - new KToggleAction(i18n("Hide unused categories"), "hide_categories", KShortcut("Ctrl+U"), this, SLOT(slotHideUnusedCategories()), actionCollection(), "view_hide_unused_categories"); - new KToggleAction(i18n("Show all accounts"), "", KShortcut("Ctrl+Shift+A"), this, SLOT(slotShowAllAccounts()), actionCollection(), "view_show_all_accounts"); + new KToggleAction(i18n("Hide reconciled transactions"), "hide_reconciled", KShortcut("Ctrl+R"), TQT_TQOBJECT(this), TQT_SLOT(slotHideReconciledTransactions()), actionCollection(), "view_hide_reconciled_transactions"); + new KToggleAction(i18n("Hide unused categories"), "hide_categories", KShortcut("Ctrl+U"), TQT_TQOBJECT(this), TQT_SLOT(slotHideUnusedCategories()), actionCollection(), "view_hide_unused_categories"); + new KToggleAction(i18n("Show all accounts"), "", KShortcut("Ctrl+Shift+A"), TQT_TQOBJECT(this), TQT_SLOT(slotShowAllAccounts()), actionCollection(), "view_show_all_accounts"); // ********************* // The institutions menu // ********************* - new KAction(i18n("New institution..."), "institution_add", 0, this, SLOT(slotInstitutionNew()), actionCollection(), "institution_new"); - new KAction(i18n("Edit institution..."), "edit", 0, this, SLOT(slotInstitutionEdit()), actionCollection(), "institution_edit"); - new KAction(i18n("Delete institution..."), "delete", 0, this, SLOT(slotInstitutionDelete()), actionCollection(), "institution_delete"); + new KAction(i18n("New institution..."), "institution_add", 0, TQT_TQOBJECT(this), TQT_SLOT(slotInstitutionNew()), actionCollection(), "institution_new"); + new KAction(i18n("Edit institution..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotInstitutionEdit()), actionCollection(), "institution_edit"); + new KAction(i18n("Delete institution..."), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotInstitutionDelete()), actionCollection(), "institution_delete"); // ***************** // The accounts menu // ***************** - new KAction(i18n("New account..."), "account_add", 0, this, SLOT(slotAccountNew()), actionCollection(), "account_new"); + new KAction(i18n("New account..."), "account_add", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountNew()), actionCollection(), "account_new"); // note : action "category_new" is included in this menu but defined below - new KAction(i18n("Open ledger"), "ledger", 0, this, SLOT(slotAccountOpen()), actionCollection(), "account_open"); - new KAction(i18n("Reconcile..."), "reconcile", KShortcut("Ctrl+Shift+R"), this, SLOT(slotAccountReconcileStart()), actionCollection(), "account_reconcile"); - new KAction(i18n("Finish reconciliation", "Finish"), "player_end", 0, this, SLOT(slotAccountReconcileFinish()), actionCollection(), "account_reconcile_finish"); - new KAction(i18n("Postpone reconciliation", "Postpone"), "player_pause", 0, this, SLOT(slotAccountReconcilePostpone()), actionCollection(), "account_reconcile_postpone"); - new KAction(i18n("Edit account..."), "edit", 0, this, SLOT(slotAccountEdit()), actionCollection(), "account_edit"); - new KAction(i18n("Delete account..."), "delete", 0, this, SLOT(slotAccountDelete()), actionCollection(), "account_delete"); - new KAction(i18n("Close account"), "", 0, this, SLOT(slotAccountClose()), actionCollection(), "account_close"); - new KAction(i18n("Reopen account"), "", 0, this, SLOT(slotAccountReopen()), actionCollection(), "account_reopen"); - new KAction(i18n("Transaction report"), "view_info", 0, this, SLOT(slotAccountTransactionReport()), actionCollection(), "account_transaction_report"); + new KAction(i18n("Open ledger"), "ledger", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountOpen()), actionCollection(), "account_open"); + new KAction(i18n("Reconcile..."), "reconcile", KShortcut("Ctrl+Shift+R"), TQT_TQOBJECT(this), TQT_SLOT(slotAccountReconcileStart()), actionCollection(), "account_reconcile"); + new KAction(i18n("Finish reconciliation", "Finish"), "player_end", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountReconcileFinish()), actionCollection(), "account_reconcile_finish"); + new KAction(i18n("Postpone reconciliation", "Postpone"), "player_pause", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountReconcilePostpone()), actionCollection(), "account_reconcile_postpone"); + new KAction(i18n("Edit account..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountEdit()), actionCollection(), "account_edit"); + new KAction(i18n("Delete account..."), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountDelete()), actionCollection(), "account_delete"); + new KAction(i18n("Close account"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountClose()), actionCollection(), "account_close"); + new KAction(i18n("Reopen account"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountReopen()), actionCollection(), "account_reopen"); + new KAction(i18n("Transaction report"), "view_info", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountTransactionReport()), actionCollection(), "account_transaction_report"); #ifdef HAVE_KDCHART - new KAction(i18n("Show balance chart..."), "kchart_chrt", 0, this, SLOT(slotAccountChart()), actionCollection(), "account_chart"); + new KAction(i18n("Show balance chart..."), "kchart_chrt", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountChart()), actionCollection(), "account_chart"); #endif - new KAction(i18n("Map to online account"), "news_subscribe", 0, this, SLOT(slotAccountMapOnline()), actionCollection(), "account_online_map"); - new KAction(i18n("Unmap account"), "", 0, this, SLOT(slotAccountUnmapOnline()), actionCollection(), "account_online_unmap"); - KActionMenu* menu = new KActionMenu(i18n("Update"), QIconSet(KGlobal::iconLoader()->loadIcon("reload", KIcon::Small, + new KAction(i18n("Map to online account"), "news_subscribe", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountMapOnline()), actionCollection(), "account_online_map"); + new KAction(i18n("Unmap account"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountUnmapOnline()), actionCollection(), "account_online_unmap"); + KActionMenu* menu = new KActionMenu(i18n("Update"), TQIconSet(KGlobal::iconLoader()->loadIcon("reload", KIcon::Small, KIcon::SizeSmall)), actionCollection(), "account_online_update_menu"); // activating the menu button is the same as selecting the current account - connect( menu, SIGNAL( activated() ), this, SLOT(slotAccountUpdateOnline())); - menu->insert(new KAction(i18n("Update account..."), "", 0, this, SLOT(slotAccountUpdateOnline()), actionCollection(), "account_online_update")); - menu->insert(new KAction(i18n("Update all accounts..."), "", 0, this, SLOT(slotAccountUpdateOnlineAll()), actionCollection(), "account_online_update_all")); + connect( menu, TQT_SIGNAL( activated() ), TQT_TQOBJECT(this), TQT_SLOT(slotAccountUpdateOnline())); + menu->insert(new KAction(i18n("Update account..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountUpdateOnline()), actionCollection(), "account_online_update")); + menu->insert(new KAction(i18n("Update all accounts..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountUpdateOnlineAll()), actionCollection(), "account_online_update_all")); // ******************* // The categories menu // ******************* - new KAction(i18n("New category..."), "account_add", 0, this, SLOT(slotCategoryNew()), actionCollection(), "category_new"); - new KAction(i18n("Edit category..."), "edit", 0, this, SLOT(slotAccountEdit()), actionCollection(), "category_edit"); - new KAction(i18n("Delete category..."), "delete", 0, this, SLOT(slotAccountDelete()), actionCollection(), "category_delete"); + new KAction(i18n("New category..."), "account_add", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCategoryNew()), actionCollection(), "category_new"); + new KAction(i18n("Edit category..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountEdit()), actionCollection(), "category_edit"); + new KAction(i18n("Delete category..."), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAccountDelete()), actionCollection(), "category_delete"); // ************** // The tools menu // ************** - new KAction(i18n("QIF Profile Editor..."), "edit", 0, this, SLOT(slotQifProfileEditor()), actionCollection(), "tools_qif_editor"); - new KAction(i18n("Securities..."), "", 0, this, SLOT(slotSecurityEditor()), actionCollection(), "tools_security_editor"); - new KAction(i18n("Currencies..."), "", 0, this, SLOT(slotCurrencyDialog()), actionCollection(), "tools_currency_editor"); - new KAction(i18n("Prices..."), "", 0, this, SLOT(slotPriceDialog()), actionCollection(), "tools_price_editor"); - new KAction(i18n("Update Stock and Currency Prices..."), "", 0, this, SLOT(slotEquityPriceUpdate()), actionCollection(), "tools_update_prices"); - new KAction(i18n("Consistency Check"), "", 0, this, SLOT(slotFileConsitencyCheck()), actionCollection(), "tools_consistency_check"); - new KAction(i18n("Performance-Test"), "fork", 0, this, SLOT(slotPerformanceTest()), actionCollection(), "tools_performancetest"); - new KAction(i18n("KCalc..."), "kcalc", 0, this, SLOT(slotToolsStartKCalc()), actionCollection(), "tools_kcalc"); + new KAction(i18n("TQIF Profile Editor..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotQifProfileEditor()), actionCollection(), "tools_qif_editor"); + new KAction(i18n("Securities..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotSecurityEditor()), actionCollection(), "tools_security_editor"); + new KAction(i18n("Currencies..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCurrencyDialog()), actionCollection(), "tools_currency_editor"); + new KAction(i18n("Prices..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotPriceDialog()), actionCollection(), "tools_price_editor"); + new KAction(i18n("Update Stock and Currency Prices..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotEquityPriceUpdate()), actionCollection(), "tools_update_prices"); + new KAction(i18n("Consistency Check"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotFileConsitencyCheck()), actionCollection(), "tools_consistency_check"); + new KAction(i18n("Performance-Test"), "fork", 0, TQT_TQOBJECT(this), TQT_SLOT(slotPerformanceTest()), actionCollection(), "tools_performancetest"); + new KAction(i18n("KCalc..."), "kcalc", 0, TQT_TQOBJECT(this), TQT_SLOT(slotToolsStartKCalc()), actionCollection(), "tools_kcalc"); // ***************** // The settings menu // ***************** - KStdAction::preferences(this, SLOT( slotSettings() ), actionCollection()); - new KAction(i18n("Enable all messages"), "", 0, this, SLOT(slotEnableMessages()), actionCollection(), "settings_enable_messages"); - new KAction(i18n("KDE language settings..."), "", 0, this, SLOT(slotKDELanguageSettings()), actionCollection(), "settings_language"); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT( slotSettings() ), actionCollection()); + new KAction(i18n("Enable all messages"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotEnableMessages()), actionCollection(), "settings_enable_messages"); + new KAction(i18n("KDE language settings..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotKDELanguageSettings()), actionCollection(), "settings_language"); // ************* // The help menu // ************* - new KAction(i18n("&Show tip of the day"), "idea", 0, this, SLOT(slotShowTipOfTheDay()), actionCollection(), "help_show_tip"); + new KAction(i18n("&Show tip of the day"), "idea", 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowTipOfTheDay()), actionCollection(), "help_show_tip"); // *************************** // Actions w/o main menu entry // *************************** - new KAction(i18n("New transaction button", "New"), "filenew", QKeySequence(Qt::CTRL | Qt::Key_Insert), this, SLOT(slotTransactionsNew()), actionCollection(), "transaction_new"); + new KAction(i18n("New transaction button", "New"), "filenew", TQKeySequence(TQt::CTRL | TQt::Key_Insert), TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsNew()), actionCollection(), "transaction_new"); // we use Return as the same shortcut for Edit and Enter. Therefore, we don't allow // to change them (The standard KDE dialog complains anyway if you want to assign // the same shortcut to two actions) - p = new KAction(i18n("Edit transaction button", "Edit"), "edit", 0, this, SLOT(slotTransactionsEdit()), actionCollection(), "transaction_edit"); + p = new KAction(i18n("Edit transaction button", "Edit"), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsEdit()), actionCollection(), "transaction_edit"); p->setShortcutConfigurable(false); - p = new KAction(i18n("Enter transaction", "Enter"), "button_ok", 0, this, SLOT(slotTransactionsEnter()), actionCollection(), "transaction_enter"); + p = new KAction(i18n("Enter transaction", "Enter"), "button_ok", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsEnter()), actionCollection(), "transaction_enter"); p->setShortcutConfigurable(false); - new KAction(i18n("Edit split button", "Edit splits"), "split_transaction", 0, this, SLOT(slotTransactionsEditSplits()), actionCollection(), "transaction_editsplits"); - new KAction(i18n("Cancel transaction edit", "Cancel"), "button_cancel", 0, this, SLOT(slotTransactionsCancel()), actionCollection(), "transaction_cancel"); - new KAction(i18n("Delete transaction", "Delete"), "delete", 0, this, SLOT(slotTransactionsDelete()), actionCollection(), "transaction_delete"); - new KAction(i18n("Duplicate transaction", "Duplicate"), "editcopy", 0, this, SLOT(slotTransactionDuplicate()), actionCollection(), "transaction_duplicate"); - - new KAction(i18n("Button text for match transaction", "Match"), "stop", 0, this, SLOT(slotTransactionMatch()), actionCollection(), "transaction_match"); - new KAction(i18n("Accept 'imported' and 'matched' transaction", "Accept"), "apply", 0, this, SLOT(slotTransactionsAccept()), actionCollection(), "transaction_accept"); - - new KAction(i18n("Toggle reconciliation flag", "Toggle"), 0, KShortcut("Ctrl+Space"), this, SLOT(slotToggleReconciliationFlag()), actionCollection(), "transaction_mark_toggle"); - new KAction(i18n("Mark transaction cleared", "Cleared"), 0, KShortcut("Ctrl+Alt+Space"), this, SLOT(slotMarkTransactionCleared()), actionCollection(), "transaction_mark_cleared"); - new KAction(i18n("Mark transaction reconciled", "Reconciled"), "", KShortcut("Ctrl+Shift+Space"), this, SLOT(slotMarkTransactionReconciled()), actionCollection(), "transaction_mark_reconciled"); - new KAction(i18n("Mark transaction not reconciled", "Not reconciled"), "", 0, this, SLOT(slotMarkTransactionNotReconciled()), actionCollection(), "transaction_mark_notreconciled"); - new KAction(i18n("Select all transactions", "Select all"), 0, KShortcut("Ctrl+A"), this, SIGNAL(selectAllTransactions()), actionCollection(), "transaction_select_all"); - - new KAction(i18n("Goto account"), "goto", 0, this, SLOT(slotTransactionGotoAccount()), actionCollection(), "transaction_goto_account"); - new KAction(i18n("Goto payee"), "goto", 0, this, SLOT(slotTransactionGotoPayee()), actionCollection(), "transaction_goto_payee"); - new KAction(i18n("Create scheduled transaction..."), "bookmark_add", 0, this, SLOT(slotTransactionCreateSchedule()), actionCollection(), "transaction_create_schedule"); - new KAction(i18n("Assign next number"), "", KShortcut("Ctrl+Shift+N"), this, SLOT(slotTransactionAssignNumber()), actionCollection(), "transaction_assign_number"); - new KAction(i18n("Combine transactions", "Combine"), "", 0, this, SLOT(slotTransactionCombine()), actionCollection(), "transaction_combine"); - - new KAction(i18n("New investment"), "filenew", 0, this, SLOT(slotInvestmentNew()), actionCollection(), "investment_new"); - new KAction(i18n("Edit investment..."), "edit", 0, this, SLOT(slotInvestmentEdit()), actionCollection(), "investment_edit"); - new KAction(i18n("Delete investment..."), "delete", 0, this, SLOT(slotInvestmentDelete()), actionCollection(), "investment_delete"); - new KAction(i18n("Online price update..."), "", 0, this, SLOT(slotOnlinePriceUpdate()), actionCollection(), "investment_online_price_update"); - new KAction(i18n("Manual price update..."), "", 0, this, SLOT(slotManualPriceUpdate()), actionCollection(), "investment_manual_price_update"); - - new KAction(i18n("New scheduled transaction..."), "filenew", 0, this, SLOT(slotScheduleNew()), actionCollection(), "schedule_new"); - new KAction(i18n("Edit scheduled transaction..."), "edit", 0, this, SLOT(slotScheduleEdit()), actionCollection(), "schedule_edit"); - new KAction(i18n("Delete scheduled transaction..."), "delete", 0, this, SLOT(slotScheduleDelete()), actionCollection(), "schedule_delete"); - new KAction(i18n("Duplicate scheduled transaction"), "editcopy", 0, this, SLOT(slotScheduleDuplicate()), actionCollection(), "schedule_duplicate"); - new KAction(i18n("Enter next transaction..."), "key_enter", 0, this, SLOT(slotScheduleEnter()), actionCollection(), "schedule_enter"); - new KAction(i18n("Skip next transaction..."), "player_fwd", 0, this, SLOT(slotScheduleSkip()), actionCollection(), "schedule_skip"); - - new KAction(i18n("New payee"), "filenew", 0, this, SLOT(slotPayeeNew()), actionCollection(), "payee_new"); - new KAction(i18n("Rename payee"), "edit", 0, this, SIGNAL(payeeRename()), actionCollection(), "payee_rename"); - new KAction(i18n("Delete payee"), "delete", 0, this, SLOT(slotPayeeDelete()), actionCollection(), "payee_delete"); - - new KAction(i18n("New budget"), "filenew", 0, this, SLOT(slotBudgetNew()), actionCollection(), "budget_new"); - new KAction(i18n("Rename budget"), "edit", 0, this, SIGNAL(budgetRename()), actionCollection(), "budget_rename"); - new KAction(i18n("Delete budget"), "delete", 0, this, SLOT(slotBudgetDelete()), actionCollection(), "budget_delete"); - new KAction(i18n("Copy budget"), "editcopy", 0, this, SLOT(slotBudgetCopy()), actionCollection(), "budget_copy"); - new KAction(i18n("Change budget year"), "", 0, this, SLOT(slotBudgetChangeYear()), actionCollection(), "budget_change_year"); - new KAction(i18n("Budget based on forecast", "Forecast"), "forcast", 0, this, SLOT(slotBudgetForecast()), actionCollection(), "budget_forecast"); + new KAction(i18n("Edit split button", "Edit splits"), "split_transaction", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsEditSplits()), actionCollection(), "transaction_editsplits"); + new KAction(i18n("Cancel transaction edit", "Cancel"), "button_cancel", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsCancel()), actionCollection(), "transaction_cancel"); + new KAction(i18n("Delete transaction", "Delete"), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsDelete()), actionCollection(), "transaction_delete"); + new KAction(i18n("Duplicate transaction", "Duplicate"), "editcopy", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionDuplicate()), actionCollection(), "transaction_duplicate"); + + new KAction(i18n("Button text for match transaction", "Match"), "stop", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionMatch()), actionCollection(), "transaction_match"); + new KAction(i18n("Accept 'imported' and 'matched' transaction", "Accept"), "apply", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionsAccept()), actionCollection(), "transaction_accept"); + + new KAction(i18n("Toggle reconciliation flag", "Toggle"), 0, KShortcut("Ctrl+Space"), TQT_TQOBJECT(this), TQT_SLOT(slotToggleReconciliationFlag()), actionCollection(), "transaction_mark_toggle"); + new KAction(i18n("Mark transaction cleared", "Cleared"), 0, KShortcut("Ctrl+Alt+Space"), TQT_TQOBJECT(this), TQT_SLOT(slotMarkTransactionCleared()), actionCollection(), "transaction_mark_cleared"); + new KAction(i18n("Mark transaction reconciled", "Reconciled"), "", KShortcut("Ctrl+Shift+Space"), TQT_TQOBJECT(this), TQT_SLOT(slotMarkTransactionReconciled()), actionCollection(), "transaction_mark_reconciled"); + new KAction(i18n("Mark transaction not reconciled", "Not reconciled"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotMarkTransactionNotReconciled()), actionCollection(), "transaction_mark_notreconciled"); + new KAction(i18n("Select all transactions", "Select all"), 0, KShortcut("Ctrl+A"), TQT_TQOBJECT(this), TQT_SIGNAL(selectAllTransactions()), actionCollection(), "transaction_select_all"); + + new KAction(i18n("Goto account"), "goto", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionGotoAccount()), actionCollection(), "transaction_goto_account"); + new KAction(i18n("Goto payee"), "goto", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionGotoPayee()), actionCollection(), "transaction_goto_payee"); + new KAction(i18n("Create scheduled transaction..."), "bookmark_add", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionCreateSchedule()), actionCollection(), "transaction_create_schedule"); + new KAction(i18n("Assign next number"), "", KShortcut("Ctrl+Shift+N"), TQT_TQOBJECT(this), TQT_SLOT(slotTransactionAssignNumber()), actionCollection(), "transaction_assign_number"); + new KAction(i18n("Combine transactions", "Combine"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotTransactionCombine()), actionCollection(), "transaction_combine"); + + new KAction(i18n("New investment"), "filenew", 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvestmentNew()), actionCollection(), "investment_new"); + new KAction(i18n("Edit investment..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvestmentEdit()), actionCollection(), "investment_edit"); + new KAction(i18n("Delete investment..."), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotInvestmentDelete()), actionCollection(), "investment_delete"); + new KAction(i18n("Online price update..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotOnlinePriceUpdate()), actionCollection(), "investment_online_price_update"); + new KAction(i18n("Manual price update..."), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotManualPriceUpdate()), actionCollection(), "investment_manual_price_update"); + + new KAction(i18n("New scheduled transaction..."), "filenew", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScheduleNew()), actionCollection(), "schedule_new"); + new KAction(i18n("Edit scheduled transaction..."), "edit", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScheduleEdit()), actionCollection(), "schedule_edit"); + new KAction(i18n("Delete scheduled transaction..."), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScheduleDelete()), actionCollection(), "schedule_delete"); + new KAction(i18n("Duplicate scheduled transaction"), "editcopy", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScheduleDuplicate()), actionCollection(), "schedule_duplicate"); + new KAction(i18n("Enter next transaction..."), "key_enter", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScheduleEnter()), actionCollection(), "schedule_enter"); + new KAction(i18n("Skip next transaction..."), "player_fwd", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScheduleSkip()), actionCollection(), "schedule_skip"); + + new KAction(i18n("New payee"), "filenew", 0, TQT_TQOBJECT(this), TQT_SLOT(slotPayeeNew()), actionCollection(), "payee_new"); + new KAction(i18n("Rename payee"), "edit", 0, TQT_TQOBJECT(this), TQT_SIGNAL(payeeRename()), actionCollection(), "payee_rename"); + new KAction(i18n("Delete payee"), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotPayeeDelete()), actionCollection(), "payee_delete"); + + new KAction(i18n("New budget"), "filenew", 0, TQT_TQOBJECT(this), TQT_SLOT(slotBudgetNew()), actionCollection(), "budget_new"); + new KAction(i18n("Rename budget"), "edit", 0, TQT_TQOBJECT(this), TQT_SIGNAL(budgetRename()), actionCollection(), "budget_rename"); + new KAction(i18n("Delete budget"), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotBudgetDelete()), actionCollection(), "budget_delete"); + new KAction(i18n("Copy budget"), "editcopy", 0, TQT_TQOBJECT(this), TQT_SLOT(slotBudgetCopy()), actionCollection(), "budget_copy"); + new KAction(i18n("Change budget year"), "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotBudgetChangeYear()), actionCollection(), "budget_change_year"); + new KAction(i18n("Budget based on forecast", "Forecast"), "forcast", 0, TQT_TQOBJECT(this), TQT_SLOT(slotBudgetForecast()), actionCollection(), "budget_forecast"); // ************************ // Currency actions // ************************ - new KAction(i18n("New currency"), "filenew", 0, this, SLOT(slotCurrencyNew()), actionCollection(), "currency_new"); - new KAction(i18n("Rename currency"), "edit", 0, this, SIGNAL(currencyRename()), actionCollection(), "currency_rename"); - new KAction(i18n("Delete currency"), "delete", 0, this, SLOT(slotCurrencyDelete()), actionCollection(), "currency_delete"); - new KAction(i18n("Select as base currency"), "kmymoney2", 0, this, SLOT(slotCurrencySetBase()), actionCollection(), "currency_setbase"); + new KAction(i18n("New currency"), "filenew", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCurrencyNew()), actionCollection(), "currency_new"); + new KAction(i18n("Rename currency"), "edit", 0, TQT_TQOBJECT(this), TQT_SIGNAL(currencyRename()), actionCollection(), "currency_rename"); + new KAction(i18n("Delete currency"), "delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCurrencyDelete()), actionCollection(), "currency_delete"); + new KAction(i18n("Select as base currency"), "kmymoney2", 0, TQT_TQOBJECT(this), TQT_SLOT(slotCurrencySetBase()), actionCollection(), "currency_setbase"); #ifdef KMM_DEBUG - new KAction("Test new feature", "", KShortcut("Ctrl+G"), this, SLOT(slotNewFeature()), actionCollection(), "new_user_wizard"); - new KToggleAction("Debug Traces", "", 0, this, SLOT(slotToggleTraces()), actionCollection(), "debug_traces"); - new KToggleAction("Debug Timers", "", 0, this, SLOT(slotToggleTimers()), actionCollection(), "debug_timers"); + new KAction("Test new feature", "", KShortcut("Ctrl+G"), TQT_TQOBJECT(this), TQT_SLOT(slotNewFeature()), actionCollection(), "new_user_wizard"); + new KToggleAction("Debug Traces", "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotToggleTraces()), actionCollection(), "debug_traces"); + new KToggleAction("Debug Timers", "", 0, TQT_TQOBJECT(this), TQT_SLOT(slotToggleTimers()), actionCollection(), "debug_timers"); #endif // ************************ // Currently unused actions // ************************ #if 0 - new KToolBarPopupAction(i18n("View back"), "back", 0, this, SLOT(slotShowPreviousView()), actionCollection(), "go_back"); - new KToolBarPopupAction(i18n("View forward"), "forward", 0, this, SLOT(slotShowNextView()), actionCollection(), "go_forward"); + new KToolBarPopupAction(i18n("View back"), "back", 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowPreviousView()), actionCollection(), "go_back"); + new KToolBarPopupAction(i18n("View forward"), "forward", 0, TQT_TQOBJECT(this), TQT_SLOT(slotShowNextView()), actionCollection(), "go_forward"); action("go_back")->setEnabled(false); action("go_forward")->setEnabled(false); @@ -496,7 +496,7 @@ void KMyMoney2App::initActions(void) toggleAction("view_show_all_accounts")->setChecked(false); // use the absolute path to your kmymoney2ui.rc file for testing purpose in createGUI(); - // createGUI(QString::null, false); + // createGUI(TQString(), false); setupGUI(); } @@ -509,10 +509,10 @@ void KMyMoney2App::dumpActions(void) const } } -KAction* KMyMoney2App::action(const QString& actionName) const +KAction* KMyMoney2App::action(const TQString& actionName) const { static KShortcut shortcut(""); - static KAction dummyAction(QString("Dummy"), QString(), shortcut, static_cast(this), 0, static_cast(0), ""); + static KAction dummyAction(TQString("Dummy"), TQString(), shortcut, TQT_TQOBJECT_CONST(this), 0, static_cast(0), ""); KAction* p = actionCollection()->action(actionName.latin1()); if(p) @@ -522,10 +522,10 @@ KAction* KMyMoney2App::action(const QString& actionName) const return &dummyAction; } -KToggleAction* KMyMoney2App::toggleAction(const QString& actionName) const +KToggleAction* KMyMoney2App::toggleAction(const TQString& actionName) const { static KShortcut shortcut(""); - static KToggleAction dummyAction(QString("Dummy"), QString(), shortcut, static_cast(this), 0, static_cast(0), ""); + static KToggleAction dummyAction(TQString("Dummy"), TQString(), shortcut, TQT_TQOBJECT_CONST(this), 0, static_cast(0), ""); KAction* q = actionCollection()->action(actionName.latin1()); @@ -553,12 +553,12 @@ void KMyMoney2App::initStatusBar(void) // Initialization of progress bar taken from KDevelop ;-) progressBar = new KProgress(statusBar()); - progressBar->setFrameStyle(QFrame::NoFrame | QFrame::Plain); + progressBar->setFrameStyle(TQFrame::NoFrame | TQFrame::Plain); progressBar->setMargin(0); progressBar->setLineWidth(0); - progressBar->setBackgroundMode(QWidget::PaletteBackground); + progressBar->setBackgroundMode(TQWidget::PaletteBackground); statusBar()->addWidget(progressBar); - progressBar->setFixedHeight(progressBar->sizeHint().height() - 8); + progressBar->setFixedHeight(progressBar->tqsizeHint().height() - 8); // hide the progress bar for now slotStatusProgressBar(-1, -1); @@ -587,8 +587,8 @@ void KMyMoney2App::readOptions(void) if(p) p->loadEntries(config,"Recent Files"); - QSize defaultSize(800, 600); - QSize size=config->readSizeEntry("Geometry", &defaultSize); + TQSize defaultSize(800, 600); + TQSize size=config->readSizeEntry("Geometry", &defaultSize); if(!size.isEmpty()) { resize(size); @@ -601,7 +601,7 @@ void KMyMoney2App::readOptions(void) m_bCheckSchedules = config->readBoolEntry("CheckSchedules", true); } -void KMyMoney2App::resizeEvent(QResizeEvent* ev) +void KMyMoney2App::resizeEvent(TQResizeEvent* ev) { KMainWindow::resizeEvent(ev); updateCaption(true); @@ -632,7 +632,7 @@ bool KMyMoney2App::queryExit(void) } ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// void KMyMoney2App::slotFileInfoDialog(void) { @@ -645,7 +645,7 @@ void KMyMoney2App::slotPerformanceTest(void) // dump performance report to stderr int measurement[2]; - QTime timer; + TQTime timer; MyMoneyAccount acc; qDebug("--- Starting performance tests ---"); @@ -655,7 +655,7 @@ void KMyMoney2App::slotPerformanceTest(void) measurement[0] = measurement[1] = 0; timer.start(); for(int i = 0; i < 1000; ++i) { - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list); measurement[i != 0] = timer.elapsed(); } @@ -722,8 +722,8 @@ void KMyMoney2App::slotPerformanceTest(void) measurement[0] = measurement[1] = 0; if(MyMoneyFile::instance()->asset().accountCount()) { MyMoneyTransactionFilter filter(MyMoneyFile::instance()->asset().accountList()[0]); - filter.setDateFilter(QDate(), QDate::currentDate()); - QValueList list; + filter.setDateFilter(TQDate(), TQDate::tqcurrentDate()); + TQValueList list; timer.start(); for(int i = 0; i < 100; ++i) { @@ -741,8 +741,8 @@ void KMyMoney2App::slotPerformanceTest(void) measurement[0] = measurement[1] = 0; if(MyMoneyFile::instance()->asset().accountCount()) { MyMoneyTransactionFilter filter(MyMoneyFile::instance()->asset().accountList()[0]); - filter.setDateFilter(QDate(), QDate::currentDate()); - QValueList list; + filter.setDateFilter(TQDate(), TQDate::tqcurrentDate()); + TQValueList list; timer.start(); for(int i = 0; i < 100; ++i) { @@ -778,7 +778,7 @@ void KMyMoney2App::slotFileNew(void) NewUserWizard::Wizard *wizard = new NewUserWizard::Wizard(); - if(wizard->exec() == QDialog::Accepted) { + if(wizard->exec() == TQDialog::Accepted) { MyMoneyFile* file = MyMoneyFile::instance(); ft.restart(); try { @@ -808,8 +808,8 @@ void KMyMoney2App::slotFileNew(void) } // import the account templates - QValueList templates = wizard->templates(); - QValueList::iterator it_t; + TQValueList templates = wizard->templates(); + TQValueList::iterator it_t; for(it_t = templates.begin(); it_t != templates.end(); ++it_t) { (*it_t).importTemplate(&progressCallback); } @@ -849,18 +849,18 @@ void KMyMoney2App::slotFileNew(void) } } -KURL KMyMoney2App::selectFile(const QString& title, const QString& _path, const QString& mask, KFile::Mode mode) +KURL KMyMoney2App::selectFile(const TQString& title, const TQString& _path, const TQString& tqmask, KFile::Mode mode) { KURL url; - QString path(_path); + TQString path(_path); if(path.isEmpty()) path = KGlobalSettings::documentPath(); - KFileDialog* dialog = new KFileDialog(path, mask, this, title, true); + KFileDialog* dialog = new KFileDialog(path, tqmask, this, title, true); dialog->setMode(mode); - if(dialog->exec() == QDialog::Accepted) { + if(dialog->exec() == TQDialog::Accepted) { url = dialog->selectedURL(); } delete dialog; @@ -874,11 +874,11 @@ void KMyMoney2App::slotFileOpen(void) KMSTATUS(i18n("Open a file.")); KFileDialog* dialog = new KFileDialog(KGlobalSettings::documentPath(), - i18n("%1|KMyMoney files\n%2|All files (*.*)").arg("*.kmy *.xml").arg("*"), + i18n("%1|KMyMoney files\n%2|All files (*.*)").tqarg("*.kmy *.xml").tqarg("*"), this, i18n("Open File..."), true); dialog->setMode(KFile::File | KFile::ExistingOnly); - if(dialog->exec() == QDialog::Accepted) { + if(dialog->exec() == TQDialog::Accepted) { slotFileOpenRecent(dialog->selectedURL()); } delete dialog; @@ -890,7 +890,7 @@ void KMyMoney2App::slotOpenDatabase(void) KSelectDatabaseDlg dialog; dialog.setMode(IO_ReadWrite); - if(dialog.exec() == QDialog::Accepted) { + if(dialog.exec() == TQDialog::Accepted) { slotFileOpenRecent(dialog.selectedURL()); } } @@ -900,7 +900,7 @@ bool KMyMoney2App::isImportableFile( const KURL& url ) bool result = false; // Iterate through the plugins and see if there's a loaded plugin who can handle it - QMap::const_iterator it_plugin = m_importerPlugins.begin(); + TQMap::const_iterator it_plugin = m_importerPlugins.begin(); while ( it_plugin != m_importerPlugins.end() ) { if ( (*it_plugin)->isMyFormat(url.path()) ) @@ -918,7 +918,7 @@ bool KMyMoney2App::isImportableFile( const KURL& url ) if ( MyMoneyStatement::isStatementFile( url.path() ) ) result = true; - // Place code here to test for QIF and other locally-supported formats + // Place code here to test for TQIF and other locally-supported formats // (i.e. not a plugin). If you add them here, be sure to add it to // the webConnect function. @@ -931,13 +931,13 @@ void KMyMoney2App::slotFileOpenRecent(const KURL& url) KURL lastFile = m_fileName; // check if there are other instances which might have this file open - QValueList list = instanceList(); - QValueList::ConstIterator it; + TQValueList list = instanceList(); + TQValueList::ConstIterator it; bool duplicate = false; for(it = list.begin(); duplicate == false && it != list.end(); ++it) { KMyMoney2App_stub* remoteApp = new KMyMoney2App_stub(kapp->dcopClient(), (*it), "kmymoney2app"); - QString remoteFile = remoteApp->filename(); + TQString remoteFile = remoteApp->filename(); if(!remoteApp->ok()) { qDebug("DCOP error while calling app->filename()"); } else { @@ -961,7 +961,7 @@ void KMyMoney2App::slotFileOpenRecent(const KURL& url) KSelectDatabaseDlg dialog(dburl); dialog.setMode(IO_ReadWrite); - if(dialog.exec() == QDialog::Accepted) dburl = dialog.selectedURL(); + if(dialog.exec() == TQDialog::Accepted) dburl = dialog.selectedURL(); } slotFileClose(); if(!myMoneyView->fileOpen()) { @@ -988,10 +988,10 @@ void KMyMoney2App::slotFileOpenRecent(const KURL& url) } } else { slotFileClose(); - KMessageBox::sorry(this, QString("

")+i18n("%1 is either an invalid filename or the file does not exist. You can open another file or create a new one.").arg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("File not found")); + KMessageBox::sorry(this, TQString("

")+i18n("%1 is either an invalid filename or the file does not exist. You can open another file or create a new one.").tqarg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("File not found")); } } else { - KMessageBox::sorry(this, QString("

")+i18n("File %1 is already opened in another instance of KMyMoney").arg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("Duplicate open")); + KMessageBox::sorry(this, TQString("

")+i18n("File %1 is already opened in another instance of KMyMoney").tqarg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("Duplicate open")); } } @@ -1021,7 +1021,7 @@ bool KMyMoney2App::slotFileSave(void) return rc; } -void KMyMoney2App::slotFileSaveAsFilterChanged(const QString& filter) +void KMyMoney2App::slotFileSaveAsFilterChanged(const TQString& filter) { if(m_saveEncrypted) { if(filter != "*.kmy") { @@ -1037,9 +1037,9 @@ void KMyMoney2App::slotManageGpgKeys(void) { KGpgKeySelectionDlg dlg(this); dlg.setKeys(m_additionalGpgKeys); - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { m_additionalGpgKeys = dlg.keys(); - m_additionalKeyLabel->setText(i18n("Additional encryption key(s) to be used: %1").arg(m_additionalGpgKeys.count())); + m_additionalKeyLabel->setText(i18n("Additional encryption key(s) to be used: %1").tqarg(m_additionalGpgKeys.count())); } } @@ -1051,7 +1051,7 @@ void KMyMoney2App::slotKeySelected(int idx) } m_additionalKeyLabel->setEnabled(idx != 0); m_additionalKeyButton->setEnabled(idx != 0); - m_additionalKeyLabel->setText(i18n("Additional encryption key(s) to be used: %1").arg(cnt)); + m_additionalKeyLabel->setText(i18n("Additional encryption key(s) to be used: %1").tqarg(cnt)); } bool KMyMoney2App::slotFileSaveAs(void) @@ -1061,40 +1061,40 @@ bool KMyMoney2App::slotFileSaveAs(void) if (myMoneyView->isDatabase()) dynamic_cast (MyMoneyFile::instance()->storage())->fillStorage(); KMSTATUS(i18n("Saving file with a new filename...")); - QString prevDir= ""; // don't prompt file name if not a native file + TQString prevDir= ""; // don't prompt file name if not a native file if (myMoneyView->isNativeFile()) prevDir = readLastUsedDir(); // fill the additional key list with the default m_additionalGpgKeys = KMyMoneyGlobalSettings::gpgRecipientList(); - QVBox* vbox = new QVBox(); + TQVBox* vbox = new TQVBox(); if(KGPGFile::GPGAvailable()) { - QHBox* keyBox = new QHBox(vbox); - new QLabel(i18n("Encryption key to be used"), keyBox); + TQHBox* keyBox = new TQHBox(vbox); + new TQLabel(i18n("Encryption key to be used"), keyBox); m_saveEncrypted = new KComboBox(keyBox); - QHBox* labelBox = new QHBox(vbox); - m_additionalKeyLabel = new QLabel(i18n("Additional encryption key(s) to be used: %1").arg(m_additionalGpgKeys.count()), labelBox); + TQHBox* labelBox = new TQHBox(vbox); + m_additionalKeyLabel = new TQLabel(i18n("Additional encryption key(s) to be used: %1").tqarg(m_additionalGpgKeys.count()), labelBox); m_additionalKeyButton = new KPushButton(i18n("Manage additional keys"), labelBox); - connect(m_additionalKeyButton, SIGNAL(clicked()), this, SLOT(slotManageGpgKeys())); - connect(m_saveEncrypted, SIGNAL(activated(int)), this, SLOT(slotKeySelected(int))); + connect(m_additionalKeyButton, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotManageGpgKeys())); + connect(m_saveEncrypted, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(slotKeySelected(int))); // fill the secret key list and combo box - QStringList keyList; + TQStringList keyList; KGPGFile::secretKeyList(keyList); m_saveEncrypted->insertItem(i18n("No encryption")); - for(QStringList::iterator it = keyList.begin(); it != keyList.end(); ++it) { - QStringList fields = QStringList::split(":", *it); + for(TQStringList::iterator it = keyList.begin(); it != keyList.end(); ++it) { + TQStringList fields = TQStringList::split(":", *it); if(fields[0] != RECOVER_KEY_ID) { - // replace parenthesis in name field with brackets - QString name = fields[1]; - name.replace('(', "["); - name.replace(')', "]"); - name = QString("%1 (0x%2)").arg(name).arg(fields[0]); + // replace tqparenthesis in name field with brackets + TQString name = fields[1]; + name.tqreplace('(', "["); + name.tqreplace(')', "]"); + name = TQString("%1 (0x%2)").tqarg(name).tqarg(fields[0]); m_saveEncrypted->insertItem(name); - if(name.contains(KMyMoneyGlobalSettings::gpgRecipient())) { + if(name.tqcontains(KMyMoneyGlobalSettings::gpgRecipient())) { m_saveEncrypted->setCurrentItem(name); } } @@ -1105,13 +1105,13 @@ bool KMyMoney2App::slotFileSaveAs(void) // adjust to our local needs (filetypes etc.) and // enhanced to show the m_saveEncrypted combo box bool specialDir = prevDir.at(0) == ':'; - KFileDialog dlg( specialDir ? prevDir : QString::null, - QString("%1|%2\n").arg("*.kmy").arg(i18n("KMyMoney (Filefilter)", "KMyMoney files")) + - QString("%1|%2\n").arg("*.xml").arg(i18n("XML (Filefilter)", "XML files")) + - QString("%1|%2\n").arg("*.anon.xml").arg(i18n("Anonymous (Filefilter)", "Anonymous files")) + - QString("%1|%2\n").arg("*").arg(i18n("All files")), + KFileDialog dlg( specialDir ? prevDir : TQString(), + TQString("%1|%2\n").tqarg("*.kmy").tqarg(i18n("KMyMoney (Filefilter)", "KMyMoney files")) + + TQString("%1|%2\n").tqarg("*.xml").tqarg(i18n("XML (Filefilter)", "XML files")) + + TQString("%1|%2\n").tqarg("*.anon.xml").tqarg(i18n("Anonymous (Filefilter)", "Anonymous files")) + + TQString("%1|%2\n").tqarg("*").tqarg(i18n("All files")), this, "filedialog", true, vbox); - connect(&dlg, SIGNAL(filterChanged(const QString&)), this, SLOT(slotFileSaveAsFilterChanged(const QString&))); + connect(&dlg, TQT_SIGNAL(filterChanged(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAsFilterChanged(const TQString&))); if ( !specialDir ) dlg.setSelection( prevDir ); // may also be a filename @@ -1119,22 +1119,22 @@ bool KMyMoney2App::slotFileSaveAs(void) dlg.setOperationMode( KFileDialog::Saving ); dlg.setCaption(i18n("Save As")); - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { KURL newURL = dlg.selectedURL(); if (!newURL.isEmpty()) { - QString newName = newURL.prettyURL(0, KURL::StripFileProtocol); + TQString newName = newURL.prettyURL(0, KURL::StripFileProtocol); // end of copy // find last . delimiter - int nLoc = newName.findRev('.'); + int nLoc = newName.tqfindRev('.'); if(nLoc != -1) { - QString strExt, strTemp; + TQString strExt, strTemp; strTemp = newName.left(nLoc + 1); strExt = newName.right(newName.length() - (nLoc + 1)); - if((strExt.find("kmy", 0, FALSE) == -1) && (strExt.find("xml", 0, FALSE) == -1)) + if((strExt.tqfind("kmy", 0, FALSE) == -1) && (strExt.tqfind("xml", 0, FALSE) == -1)) { strTemp.append("kmy"); @@ -1163,9 +1163,9 @@ bool KMyMoney2App::slotFileSaveAs(void) { m_fileName = newName; - QString encryptionKeys; + TQString encryptionKeys; if(m_saveEncrypted && m_saveEncrypted->currentItem() != 0) { - QRegExp keyExp(".* \\((.*)\\)"); + TQRegExp keyExp(".* \\((.*)\\)"); if(keyExp.search(m_saveEncrypted->currentText()) != -1) { encryptionKeys = keyExp.cap(1); } @@ -1203,7 +1203,7 @@ bool KMyMoney2App::slotSaveAsDatabase(void) KURL oldUrl = m_fileName.isEmpty() ? lastOpenedURL() : m_fileName; KURL url = oldUrl; - while (oldUrl == url && dialog.exec() == QDialog::Accepted) { + while (oldUrl == url && dialog.exec() == TQDialog::Accepted) { url = dialog.selectedURL(); // If the protocol is SQL for the old and new, and the hostname and database names match // Let the user know that the current database cannot be saved on top of itself. @@ -1265,8 +1265,8 @@ void KMyMoney2App::slotFileClose(void) slotSelectInvestment(); slotSelectSchedule(); slotSelectCurrency(); - slotSelectBudget(QValueList()); - slotSelectPayees(QValueList()); + slotSelectBudget(TQValueList()); + slotSelectPayees(TQValueList()); slotSelectTransactions(KMyMoneyRegister::SelectedTransactions()); m_reconciliationAccount = MyMoneyAccount(); @@ -1278,7 +1278,7 @@ void KMyMoney2App::slotFileClose(void) // just create a new balance warning object delete d->m_balanceWarning; - d->m_balanceWarning = new KBalanceWarning(this); + d->m_balanceWarning = new KBalanceWarning(TQT_TQOBJECT(this)); emit fileLoaded(m_fileName); } @@ -1335,11 +1335,11 @@ void KMyMoney2App::slotToggleTimers(void) timersOn = toggleAction("debug_timers")->isChecked(); } -const QString KMyMoney2App::slotStatusMsg(const QString &text) +const TQString KMyMoney2App::slotStatusMsg(const TQString &text) { /////////////////////////////////////////////////////////////////// // change status message permanently - QString msg = m_statusMsg; + TQString msg = m_statusMsg; m_statusMsg = text; if(m_statusMsg.isEmpty()) @@ -1351,7 +1351,7 @@ const QString KMyMoney2App::slotStatusMsg(const QString &text) void KMyMoney2App::ready(void) { - slotStatusMsg(QString()); + slotStatusMsg(TQString()); } bool KMyMoney2App::isReady(void) @@ -1384,13 +1384,13 @@ void KMyMoney2App::slotStatusProgressBar(int current, int total) } else { // update if(current > m_nextUpdate) { progressBar->setProgress(current); - QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 10); + TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 10); m_nextUpdate += m_progressUpdate; } } } -void KMyMoney2App::progressCallback(int current, int total, const QString& msg) +void KMyMoney2App::progressCallback(int current, int total, const TQString& msg) { if(!msg.isEmpty()) kmymoney2->slotStatusMsg(msg); @@ -1414,7 +1414,7 @@ void KMyMoney2App::slotFileViewPersonal(void) user.city(), user.state(), user.postcode(), user.telephone(), user.email(), this, "NewFileDlg", i18n("Edit Personal Data")); - if (newFileDlg.exec() == QDialog::Accepted) + if (newFileDlg.exec() == TQDialog::Accepted) { user.setName(newFileDlg.userNameText); user.setAddress(newFileDlg.userStreetText); @@ -1428,7 +1428,7 @@ void KMyMoney2App::slotFileViewPersonal(void) file->setUser(user); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to store user information: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to store user information: %1").tqarg(e->what())); delete e; } } @@ -1441,9 +1441,9 @@ void KMyMoney2App::slotFileFileInfo(void) return; } - QFile g( "kmymoney2.dump" ); + TQFile g( "kmymoney2.dump" ); g.open( IO_WriteOnly ); - QDataStream st(&g); + TQDataStream st(&g); MyMoneyStorageDump dumper; dumper.writeStream(st, dynamic_cast (MyMoneyFile::instance()->storage())); g.close(); @@ -1455,18 +1455,18 @@ void KMyMoney2App::slotLoadAccountTemplates(void) int rc; KLoadTemplateDlg* dlg = new KLoadTemplateDlg(); - if((rc = dlg->exec()) == QDialog::Accepted) { + if((rc = dlg->exec()) == TQDialog::Accepted) { MyMoneyFileTransaction ft; try { // import the account templates - QValueList templates = dlg->templates(); - QValueList::iterator it_t; + TQValueList templates = dlg->templates(); + TQValueList::iterator it_t; for(it_t = templates.begin(); it_t != templates.end(); ++it_t) { (*it_t).importTemplate(&progressCallback); } ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to import template(s): %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to import template(s): %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -1477,7 +1477,7 @@ void KMyMoney2App::slotSaveAccountTemplates(void) { KMSTATUS(i18n("Exporting account templates.")); - QString newName = KFileDialog::getSaveFileName(KGlobalSettings::documentPath(), + TQString newName = KFileDialog::getSaveFileName(KGlobalSettings::documentPath(), i18n("*.kmt|KMyMoney template files\n" "*.*|All files"), this, i18n("Save as...")); // @@ -1487,13 +1487,13 @@ void KMyMoney2App::slotSaveAccountTemplates(void) if(!newName.isEmpty()) { // find last . delimiter - int nLoc = newName.findRev('.'); + int nLoc = newName.tqfindRev('.'); if(nLoc != -1) { - QString strExt, strTemp; + TQString strExt, strTemp; strTemp = newName.left(nLoc + 1); strExt = newName.right(newName.length() - (nLoc + 1)); - if((strExt.find("kmt", 0, FALSE) == -1)) + if((strExt.tqfind("kmt", 0, FALSE) == -1)) { strTemp.append("kmt"); //append to make complete file name @@ -1527,7 +1527,7 @@ void KMyMoney2App::slotQifImport(void) // remove all kmm-statement-#.txt files d->unlinkStatementXML(); - connect(m_qifReader, SIGNAL(importFinished()), this, SLOT(slotQifImportFinished())); + connect(m_qifReader, TQT_SIGNAL(importFinished()), TQT_TQOBJECT(this), TQT_SLOT(slotQifImportFinished())); m_qifReader->setURL(dlg->filename()); @@ -1559,7 +1559,7 @@ void KMyMoney2App::slotQifImportFinished(void) KMessageBox::informationList(this, i18n("The statements have been processed with the following results:"), d->m_statementResults, i18n("Statement stats")); #if 0 - // fixme: re-enable the QIF import menu options + // fixme: re-enable the TQIF import menu options if(m_qifReader->finishImport()) { if(verifyImportedData(m_qifReader->account())) { // keep the new data set, destroy the backup copy @@ -1622,11 +1622,11 @@ void KMyMoney2App::slotGncImport(void) KMSTATUS(i18n("Importing a Gnucash file.")); KFileDialog* dialog = new KFileDialog(KGlobalSettings::documentPath(), - i18n("%1|Gnucash files\n%2|All files (*.*)").arg("*").arg("*"), + i18n("%1|Gnucash files\n%2|All files (*.*)").tqarg("*").tqarg("*"), this, i18n("Import Gnucash file..."), true); dialog->setMode(KFile::File | KFile::ExistingOnly); - if(dialog->exec() == QDialog::Accepted) { + if(dialog->exec() == TQDialog::Accepted) { // slotFileClose(); // if(myMoneyView->fileOpen()) // return; @@ -1665,26 +1665,26 @@ void KMyMoney2App::slotStatementImport(void) KMSTATUS(i18n("Importing an XML Statement.")); KFileDialog* dialog = new KFileDialog(KGlobalSettings::documentPath(), - i18n("%1|XML files\n%2|All files (*.*)").arg("*.xml").arg("*.*"), + i18n("%1|XML files\n%2|All files (*.*)").tqarg("*.xml").tqarg("*.*"), this, i18n("Import XML Statement..."), true); dialog->setMode(KFile::File | KFile::ExistingOnly); - if(dialog->exec() == QDialog::Accepted) + if(dialog->exec() == TQDialog::Accepted) { result = slotStatementImport(dialog->selectedURL().path()); -/* QFile f( dialog->selectedURL().path() ); +/* TQFile f( dialog->selectedURL().path() ); f.open( IO_ReadOnly ); - QString error = "Unable to parse file"; - QDomDocument* doc = new QDomDocument; + TQString error = "Unable to parse file"; + TQDomDocument* doc = new TQDomDocument; if(doc->setContent(&f, FALSE)) { if ( doc->doctype().name() == "KMYMONEY-STATEMENT" ) { - QDomElement rootElement = doc->documentElement(); + TQDomElement rootElement = doc->documentElement(); if(!rootElement.isNull()) { - QDomNode child = rootElement.firstChild(); + TQDomNode child = rootElement.firstChild(); if(!child.isNull() && child.isElement()) { MyMoneyStatement s; @@ -1702,7 +1702,7 @@ void KMyMoney2App::slotStatementImport(void) if ( !result ) { - QMessageBox::critical( this, i18n("Critical Error"), i18n("Unable to read file %1: %2").arg( dialog->selectedURL().path()).arg(error), QMessageBox::Ok, 0 ); + TQMessageBox::critical( this, i18n("Critical Error"), i18n("Unable to read file %1: %2").tqarg( dialog->selectedURL().path()).tqarg(error), TQMessageBox::Ok, 0 ); }*/ } @@ -1715,14 +1715,14 @@ void KMyMoney2App::slotStatementImport(void) } } -bool KMyMoney2App::slotStatementImport(const QString& url) +bool KMyMoney2App::slotStatementImport(const TQString& url) { bool result = false; MyMoneyStatement s; if ( MyMoneyStatement::readXMLFile( s, url ) ) result = slotStatementImport(s); else - KMessageBox::error(this, i18n("Error importing %1: This file is not a valid KMM statement file.").arg(url), i18n("Invalid Statement")); + KMessageBox::error(this, i18n("Error importing %1: This file is not a valid KMM statement file.").tqarg(url), i18n("Invalid Statement")); return result; } @@ -1732,7 +1732,7 @@ bool KMyMoney2App::slotStatementImport(const MyMoneyStatement& s) bool result = false; // keep a copy of the statement - MyMoneyStatement::writeXMLFile(s, QString("/home/thb/kmm-statement-%1.txt").arg(d->statementXMLindex++)); + MyMoneyStatement::writeXMLFile(s, TQString("/home/thb/kmm-statement-%1.txt").tqarg(d->statementXMLindex++)); // we use an object on the heap here, so that we can check the presence // of it during slotUpdateActions() by looking at the pointer. @@ -1743,7 +1743,7 @@ bool KMyMoney2App::slotStatementImport(const MyMoneyStatement& s) // disable all standard widgets during the import setEnabled(false); - QStringList messages; + TQStringList messages; result = m_smtReader->import(s, messages); bool transactionAdded = m_smtReader->anyTransactionAdded(); @@ -1776,7 +1776,7 @@ void KMyMoney2App::slotQifExport(void) if(dlg->exec()) { if(okToWriteFile(dlg->filename())) { MyMoneyQifWriter writer; - connect(&writer, SIGNAL(signalProgress(int, int)), this, SLOT(slotStatusProgressBar(int, int))); + connect(&writer, TQT_SIGNAL(signalProgress(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusProgressBar(int, int))); writer.write(dlg->filename(), dlg->profile(), dlg->accountId(), dlg->accountSelected(), dlg->categorySelected(), @@ -1792,7 +1792,7 @@ bool KMyMoney2App::okToWriteFile(const KURL& url) bool reallySaveFile = true; if(KIO::NetAccess::exists(url, true, this)) { - if(KMessageBox::warningYesNo(this, QString("")+i18n("The file %1 already exists. Do you really want to override it?").arg(url.prettyURL(0, KURL::StripFileProtocol))+QString(""), i18n("File already exists")) != KMessageBox::Yes) + if(KMessageBox::warningYesNo(this, TQString("")+i18n("The file %1 already exists. Do you really want to override it?").tqarg(url.prettyURL(0, KURL::StripFileProtocol))+TQString(""), i18n("File already exists")) != KMessageBox::Yes) reallySaveFile = false; } return reallySaveFile; @@ -1832,9 +1832,9 @@ void KMyMoney2App::slotSettings(void) dlg->addPage(forecastPage, i18n("Forecast"), "forcast"); dlg->addPage(pluginsPage, i18n("Plugins"), "connect_no"); - connect(dlg, SIGNAL(settingsChanged()), this, SLOT(slotUpdateConfiguration())); - connect(dlg, SIGNAL(okClicked()), pluginsPage, SLOT(slotSavePlugins())); - connect(dlg, SIGNAL(defaultClicked()), pluginsPage, SLOT(slotDefaultsPlugins())); + connect(dlg, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateConfiguration())); + connect(dlg, TQT_SIGNAL(okClicked()), pluginsPage, TQT_SLOT(slotSavePlugins())); + connect(dlg, TQT_SIGNAL(defaultClicked()), pluginsPage, TQT_SLOT(slotDefaultsPlugins())); dlg->show(); } @@ -1917,7 +1917,7 @@ void KMyMoney2App::slotFileBackup(void) if(!m_fileName.isLocalFile()) { KMessageBox::sorry(this, i18n("The current implementation of the backup functionality only supports local files as source files! Your current source file is '%1'.") - .arg(m_fileName.url()), + .tqarg(m_fileName.url()), i18n("Local files only")); return; @@ -1934,7 +1934,7 @@ void KMyMoney2App::slotFileBackup(void) m_mountpoint = backupDlg->txtMountPoint->text(); if (m_backupMount) { - progressCallback(0, 300, i18n("Mounting %1").arg(m_mountpoint)); + progressCallback(0, 300, i18n("Mounting %1").tqarg(m_mountpoint)); proc << "mount"; proc << m_mountpoint; proc.start(); @@ -1961,24 +1961,24 @@ void KMyMoney2App::slotProcessExited(void) if(proc.normalExit() && proc.exitStatus() == 0) { proc.clearArguments(); - QString today; + TQString today; today.sprintf("-%04d-%02d-%02d.kmy", - QDate::currentDate().year(), - QDate::currentDate().month(), - QDate::currentDate().day()); - QString backupfile = m_mountpoint + "/" + m_fileName.fileName(false); + TQDate::tqcurrentDate().year(), + TQDate::tqcurrentDate().month(), + TQDate::tqcurrentDate().day()); + TQString backupfile = m_mountpoint + "/" + m_fileName.fileName(false); KMyMoneyUtils::appendCorrectFileExt(backupfile, today); // check if file already exists and ask what to do m_backupResult = 0; - QFile f(backupfile); + TQFile f(backupfile); if (f.exists()) { int answer = KMessageBox::warningContinueCancel(this, i18n("Backup file for today exists on that device. Replace ?"), i18n("Backup"), i18n("&Replace")); if (answer == KMessageBox::Cancel) { m_backupResult = 1; if (m_backupMount) { - progressCallback(250, 0, i18n("Unmounting %1").arg(m_mountpoint)); + progressCallback(250, 0, i18n("Unmounting %1").tqarg(m_mountpoint)); proc.clearArguments(); proc << "umount"; proc << m_mountpoint; @@ -1986,14 +1986,14 @@ void KMyMoney2App::slotProcessExited(void) proc.start(); } else { m_backupState = BACKUP_IDLE; - progressCallback(-1, -1, QString()); + progressCallback(-1, -1, TQString()); ready(); } } } if(m_backupResult == 0) { - progressCallback(50, 0, i18n("Writing %1").arg(backupfile)); + progressCallback(50, 0, i18n("Writing %1").tqarg(backupfile)); proc << "cp" << "-f" << m_fileName.path(0) << backupfile; m_backupState = BACKUP_COPYING; proc.start(); @@ -2003,7 +2003,7 @@ void KMyMoney2App::slotProcessExited(void) KMessageBox::information(this, i18n("Error mounting device"), i18n("Backup")); m_backupResult = 1; if (m_backupMount) { - progressCallback(250, 0, i18n("Unmounting %1").arg(m_mountpoint)); + progressCallback(250, 0, i18n("Unmounting %1").tqarg(m_mountpoint)); proc.clearArguments(); proc << "umount"; proc << m_mountpoint; @@ -2012,7 +2012,7 @@ void KMyMoney2App::slotProcessExited(void) } else { m_backupState = BACKUP_IDLE; - progressCallback(-1, -1, QString()); + progressCallback(-1, -1, TQString()); ready(); } } @@ -2022,7 +2022,7 @@ void KMyMoney2App::slotProcessExited(void) if(proc.normalExit() && proc.exitStatus() == 0) { if (m_backupMount) { - progressCallback(250, 0, i18n("Unmounting %1").arg(m_mountpoint)); + progressCallback(250, 0, i18n("Unmounting %1").tqarg(m_mountpoint)); proc.clearArguments(); proc << "umount"; proc << m_mountpoint; @@ -2032,7 +2032,7 @@ void KMyMoney2App::slotProcessExited(void) progressCallback(300, 0, i18n("Done")); KMessageBox::information(this, i18n("File successfully backed up"), i18n("Backup")); m_backupState = BACKUP_IDLE; - progressCallback(-1, -1, QString()); + progressCallback(-1, -1, TQString()); ready(); } } else { @@ -2041,7 +2041,7 @@ void KMyMoney2App::slotProcessExited(void) KMessageBox::information(this, i18n("Error copying file to device"), i18n("Backup")); if (m_backupMount) { - progressCallback(250, 0, i18n("Unmounting %1").arg(m_mountpoint)); + progressCallback(250, 0, i18n("Unmounting %1").tqarg(m_mountpoint)); proc.clearArguments(); proc << "umount"; proc << m_mountpoint; @@ -2051,7 +2051,7 @@ void KMyMoney2App::slotProcessExited(void) } else { m_backupState = BACKUP_IDLE; - progressCallback(-1, -1, QString()); + progressCallback(-1, -1, TQString()); ready(); } } @@ -2068,13 +2068,13 @@ void KMyMoney2App::slotProcessExited(void) KMessageBox::information(this, i18n("Error unmounting device"), i18n("Backup")); } m_backupState = BACKUP_IDLE; - progressCallback(-1, -1, QString()); + progressCallback(-1, -1, TQString()); ready(); break; default: qWarning("Unknown state for backup operation!"); - progressCallback(-1, -1, QString()); + progressCallback(-1, -1, TQString()); ready(); break; } @@ -2104,7 +2104,7 @@ void KMyMoney2App::slotShowNextView(void) void KMyMoney2App::slotQifProfileEditor(void) { - MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "QIF Profile Editor"); + MyMoneyQifProfileEditor* editor = new MyMoneyQifProfileEditor(true, this, "TQIF Profile Editor"); editor->exec(); @@ -2115,7 +2115,7 @@ void KMyMoney2App::slotQifProfileEditor(void) void KMyMoney2App::slotToolsStartKCalc(void) { - QString cmd = KMyMoneyGlobalSettings::externalCalculator(); + TQString cmd = KMyMoneyGlobalSettings::externalCalculator(); // if none is present, we fall back to the default if(cmd.isEmpty()) cmd = "kcalc"; @@ -2126,9 +2126,9 @@ void KMyMoney2App::slotFindTransaction(void) { if(m_searchDlg == 0) { m_searchDlg = new KFindTransactionDlg(); - connect(m_searchDlg, SIGNAL(destroyed()), this, SLOT(slotCloseSearchDialog())); - connect(m_searchDlg, SIGNAL(transactionSelected(const QString&, const QString&)), - myMoneyView, SLOT(slotLedgerSelected(const QString&, const QString&))); + connect(m_searchDlg, TQT_SIGNAL(destroyed()), TQT_TQOBJECT(this), TQT_SLOT(slotCloseSearchDialog())); + connect(m_searchDlg, TQT_SIGNAL(transactionSelected(const TQString&, const TQString&)), + myMoneyView, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); } m_searchDlg->show(); m_searchDlg->raise(); @@ -2153,7 +2153,7 @@ void KMyMoney2App::createInstitution(MyMoneyInstitution& institution) ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::information(this, i18n("Cannot add institution: %1").arg(e->what())); + KMessageBox::information(this, i18n("Cannot add institution: %1").tqarg(e->what())); delete e; } } @@ -2195,14 +2195,14 @@ void KMyMoney2App::slotInstitutionEdit(const MyMoneyObject& obj) slotSelectInstitution(file->institution(dlg.institution().id())); } catch(MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to store institution: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to store institution: %1").tqarg(e->what())); delete e; } } } catch(MyMoneyException *e) { if(!obj.id().isEmpty()) - KMessageBox::information(this, i18n("Unable to edit institution: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to edit institution: %1").tqarg(e->what())); delete e; } } @@ -2213,7 +2213,7 @@ void KMyMoney2App::slotInstitutionDelete(void) try { MyMoneyInstitution institution = file->institution(m_selectedInstitution.id()); - if ((KMessageBox::questionYesNo(this, QString("

")+i18n("Do you really want to delete institution %1 ?").arg(institution.name()))) == KMessageBox::No) + if ((KMessageBox::questionYesNo(this, TQString("

")+i18n("Do you really want to delete institution %1 ?").tqarg(institution.name()))) == KMessageBox::No) return; MyMoneyFileTransaction ft; @@ -2221,54 +2221,54 @@ void KMyMoney2App::slotInstitutionDelete(void) file->removeInstitution(institution); ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to delete institution: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to delete institution: %1").tqarg(e->what())); delete e; } } catch (MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to delete institution: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to delete institution: %1").tqarg(e->what())); delete e; } } -const MyMoneyAccount& KMyMoney2App::findAccount(const MyMoneyAccount& acc, const MyMoneyAccount& parent) const +const MyMoneyAccount& KMyMoney2App::findAccount(const MyMoneyAccount& acc, const MyMoneyAccount& tqparent) const { static MyMoneyAccount nullAccount; MyMoneyFile* file = MyMoneyFile::instance(); - QValueList parents; + TQValueList tqparents; try { // search by id if(!acc.id().isEmpty()) { return file->account(acc.id()); } - // collect the parents. in case parent does not have an id, we scan the all top-level accounts - if(parent.id().isEmpty()) { - parents << file->asset(); - parents << file->liability(); - parents << file->income(); - parents << file->expense(); - parents << file->equity(); + // collect the tqparents. in case tqparent does not have an id, we scan the all top-level accounts + if(tqparent.id().isEmpty()) { + tqparents << file->asset(); + tqparents << file->liability(); + tqparents << file->income(); + tqparents << file->expense(); + tqparents << file->equity(); } else { - parents << parent; + tqparents << tqparent; } - QValueList::const_iterator it_p; - for(it_p = parents.begin(); it_p != parents.end(); ++it_p) { - MyMoneyAccount parentAccount = *it_p; + TQValueList::const_iterator it_p; + for(it_p = tqparents.begin(); it_p != tqparents.end(); ++it_p) { + MyMoneyAccount tqparentAccount = *it_p; // search by name (allow hierarchy) int pos; // check for ':' in the name and use it as separator for a hierarchy - QString name = acc.name(); - while((pos = name.find(MyMoneyFile::AccountSeperator)) != -1) { - QString part = name.left(pos); - QString remainder = name.mid(pos+1); - const MyMoneyAccount& existingAccount = file->subAccountByName(parentAccount, part); + TQString name = acc.name(); + while((pos = name.tqfind(MyMoneyFile::AccountSeperator)) != -1) { + TQString part = name.left(pos); + TQString remainder = name.mid(pos+1); + const MyMoneyAccount& existingAccount = file->subAccountByName(tqparentAccount, part); if(existingAccount.id().isEmpty()) { return existingAccount; } - parentAccount = existingAccount; + tqparentAccount = existingAccount; name = remainder; } - const MyMoneyAccount& existingAccount = file->subAccountByName(parentAccount, name); + const MyMoneyAccount& existingAccount = file->subAccountByName(tqparentAccount, name); if(!existingAccount.id().isEmpty()) { if(acc.accountType() != MyMoneyAccount::UnknownAccountType) { if(acc.accountType() != existingAccount.accountType()) @@ -2278,13 +2278,13 @@ const MyMoneyAccount& KMyMoney2App::findAccount(const MyMoneyAccount& acc, const } } } catch (MyMoneyException *e) { - KMessageBox::error(0, i18n("Unable to find account: %1").arg(e->what())); + KMessageBox::error(0, i18n("Unable to find account: %1").tqarg(e->what())); delete e; } return nullAccount; } -void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& parentAccount, MyMoneyAccount& brokerageAccount, MyMoneyMoney openingBal) +void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& tqparentAccount, MyMoneyAccount& brokerageAccount, MyMoneyMoney openingBal) { MyMoneyFile* file = MyMoneyFile::instance(); @@ -2297,19 +2297,19 @@ void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& par { int pos; // check for ':' in the name and use it as separator for a hierarchy - while((pos = newAccount.name().find(MyMoneyFile::AccountSeperator)) != -1) { - QString part = newAccount.name().left(pos); - QString remainder = newAccount.name().mid(pos+1); - const MyMoneyAccount& existingAccount = file->subAccountByName(parentAccount, part); + while((pos = newAccount.name().tqfind(MyMoneyFile::AccountSeperator)) != -1) { + TQString part = newAccount.name().left(pos); + TQString remainder = newAccount.name().mid(pos+1); + const MyMoneyAccount& existingAccount = file->subAccountByName(tqparentAccount, part); if(existingAccount.id().isEmpty()) { newAccount.setName(part); - file->addAccount(newAccount, parentAccount); - parentAccount = newAccount; + file->addAccount(newAccount, tqparentAccount); + tqparentAccount = newAccount; } else { - parentAccount = existingAccount; + tqparentAccount = existingAccount; } - newAccount.setParentAccountId(QString()); // make sure, there's no parent + newAccount.setParentAccountId(TQString()); // make sure, there's no tqparent newAccount.clearId(); // and no id set for adding newAccount.removeAccountIds(); // and no sub-account ids newAccount.setName(remainder); @@ -2319,14 +2319,14 @@ void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& par // Check the opening balance if (openingBal.isPositive() && newAccount.accountGroup() == MyMoneyAccount::Liability) { - QString message = i18n("This account is a liability and if the " + TQString message = i18n("This account is a liability and if the " "opening balance represents money owed, then it should be negative. " "Negate the amount?\n\n" "Please click Yes to change the opening balance to %1,\n" "Please click No to leave the amount as %2,\n" "Please click Cancel to abort the account creation.") - .arg((-openingBal).formatMoney(newAccount, sec)) - .arg(openingBal.formatMoney(newAccount, sec)); + .tqarg((-openingBal).formatMoney(newAccount, sec)) + .tqarg(openingBal.formatMoney(newAccount, sec)); int ans = KMessageBox::questionYesNoCancel(this, message); if (ans == KMessageBox::Yes) { @@ -2336,7 +2336,7 @@ void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& par return; } - file->addAccount(newAccount, parentAccount); + file->addAccount(newAccount, tqparentAccount); // in case of a loan account, we add the initial payment if((newAccount.accountType() == MyMoneyAccount::Loan @@ -2357,7 +2357,7 @@ void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& par b.setShares(b.value()); a.setMemo(i18n("Loan payout")); b.setMemo(i18n("Loan payout")); - t.setPostDate(QDate::fromString(acc.value("kmm-loan-payment-date"), Qt::ISODate)); + t.setPostDate(TQDate::fromString(acc.value("kmm-loan-payment-date"), Qt::ISODate)); newAccount.deletePair("kmm-loan-payment-acc"); newAccount.deletePair("kmm-loan-payment-date"); MyMoneyFile::instance()->modifyAccount(newAccount); @@ -2371,7 +2371,7 @@ void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& par // a brokerage account } else if(newAccount.accountType() == MyMoneyAccount::Investment && !brokerageAccount.name().isEmpty()) { - file->addAccount(brokerageAccount, parentAccount); + file->addAccount(brokerageAccount, tqparentAccount); // set a link from the investment account to the brokerage account file->modifyAccount(newAccount); @@ -2384,12 +2384,12 @@ void KMyMoney2App::createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& par } catch (MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to add account: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to add account: %1").tqarg(e->what())); delete e; } } -void KMyMoney2App::slotCategoryNew(const QString& name, QString& id) +void KMyMoney2App::slotCategoryNew(const TQString& name, TQString& id) { MyMoneyAccount account; account.setName(name); @@ -2399,49 +2399,49 @@ void KMyMoney2App::slotCategoryNew(const QString& name, QString& id) id = account.id(); } -void KMyMoney2App::slotCategoryNew(MyMoneyAccount& account, const MyMoneyAccount& parent) +void KMyMoney2App::slotCategoryNew(MyMoneyAccount& account, const MyMoneyAccount& tqparent) { if(KMessageBox::questionYesNo(this, - QString("%1").arg(i18n("The category %1 currently does not exist. Do you want to create it?

The parent account will default to %2 but can be changed in the following dialog.").arg(account.name()).arg(parent.name())), i18n("Create category"), + TQString("%1").tqarg(i18n("The category %1 currently does not exist. Do you want to create it?

The tqparent account will default to %2 but can be changed in the following dialog.").tqarg(account.name()).tqarg(tqparent.name())), i18n("Create category"), KStdGuiItem::yes(), KStdGuiItem::no(), "CreateNewCategories") == KMessageBox::Yes) { - createCategory(account, parent); + createCategory(account, tqparent); } else { // we should not keep the 'no' setting because that can confuse people like // I have seen in some usability tests. So we just delete it right away. KConfig *kconfig = KGlobal::config(); if(kconfig) { - kconfig->setGroup(QString::fromLatin1("Notification Messages")); - kconfig->deleteEntry(QString::fromLatin1("CreateNewCategories")); + kconfig->setGroup(TQString::tqfromLatin1("Notification Messages")); + kconfig->deleteEntry(TQString::tqfromLatin1("CreateNewCategories")); } } } void KMyMoney2App::slotCategoryNew(void) { - MyMoneyAccount parent; + MyMoneyAccount tqparent; MyMoneyAccount account; - // Preselect the parent account by looking at the current selected account/category + // Preselect the tqparent account by looking at the current selected account/category if(!m_selectedAccount.id().isEmpty() && m_selectedAccount.isIncomeExpense()) { MyMoneyFile* file = MyMoneyFile::instance(); try { - parent = file->account(m_selectedAccount.id()); + tqparent = file->account(m_selectedAccount.id()); } catch(MyMoneyException *e) { delete e; } } - createCategory(account, parent); + createCategory(account, tqparent); } -void KMyMoney2App::createCategory(MyMoneyAccount& account, const MyMoneyAccount& parent) +void KMyMoney2App::createCategory(MyMoneyAccount& account, const MyMoneyAccount& tqparent) { - if(!parent.id().isEmpty()) { + if(!tqparent.id().isEmpty()) { try { - // make sure parent account exists - MyMoneyFile::instance()->account(parent.id()); - account.setParentAccountId(parent.id()); - account.setAccountType( parent.accountType() ); + // make sure tqparent account exists + MyMoneyFile::instance()->account(tqparent.id()); + account.setParentAccountId(tqparent.id()); + account.setAccountType( tqparent.accountType() ); } catch(MyMoneyException *e) { delete e; } @@ -2449,19 +2449,19 @@ void KMyMoney2App::createCategory(MyMoneyAccount& account, const MyMoneyAccount& KNewAccountDlg dialog(account, false, true, 0, 0, i18n("Create a new Category")); - if(dialog.exec() == QDialog::Accepted) { - MyMoneyAccount parentAccount, brokerageAccount; + if(dialog.exec() == TQDialog::Accepted) { + MyMoneyAccount tqparentAccount, brokerageAccount; account = dialog.account(); - parentAccount = dialog.parentAccount(); + tqparentAccount = dialog.tqparentAccount(); - createAccount(account, parentAccount, brokerageAccount, MyMoneyMoney(0,1)); + createAccount(account, tqparentAccount, brokerageAccount, MyMoneyMoney(0,1)); } } void KMyMoney2App::slotAccountNew(void) { MyMoneyAccount acc; - acc.setOpeningDate(QDate::currentDate()); + acc.setOpeningDate(TQDate::tqcurrentDate()); slotAccountNew(acc); } @@ -2469,22 +2469,22 @@ void KMyMoney2App::slotAccountNew(void) void KMyMoney2App::slotAccountNew(MyMoneyAccount& account) { NewAccountWizard::Wizard* wizard = new NewAccountWizard::Wizard(); - connect(wizard, SIGNAL(createInstitution(MyMoneyInstitution&)), this, SLOT(slotInstitutionNew(MyMoneyInstitution&))); - connect(wizard, SIGNAL(createAccount(MyMoneyAccount&)), this, SLOT(slotAccountNew(MyMoneyAccount&))); - connect(wizard, SIGNAL(createPayee(const QString&, QString&)), this, SLOT(slotPayeeNew(const QString&, QString&))); - connect(wizard, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), this, SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(wizard, TQT_SIGNAL(createInstitution(MyMoneyInstitution&)), TQT_TQOBJECT(this), TQT_SLOT(slotInstitutionNew(MyMoneyInstitution&))); + connect(wizard, TQT_SIGNAL(createAccount(MyMoneyAccount&)), TQT_TQOBJECT(this), TQT_SLOT(slotAccountNew(MyMoneyAccount&))); + connect(wizard, TQT_SIGNAL(createPayee(const TQString&, TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + connect(wizard, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), TQT_TQOBJECT(this), TQT_SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); wizard->setAccount(account); - if(wizard->exec() == QDialog::Accepted) { + if(wizard->exec() == TQDialog::Accepted) { MyMoneyAccount acc = wizard->account(); if(!(acc == MyMoneyAccount())) { MyMoneyFileTransaction ft; MyMoneyFile* file = MyMoneyFile::instance(); try { // create the account - MyMoneyAccount parent = wizard->parentAccount(); - file->addAccount(acc, parent); + MyMoneyAccount tqparent = wizard->tqparentAccount(); + file->addAccount(acc, tqparent); // tell the wizard about the account id which it // needs to create a possible schedule and transactions @@ -2506,7 +2506,7 @@ void KMyMoney2App::slotAccountNew(MyMoneyAccount& account) // create a brokerage account if selected MyMoneyAccount brokerageAccount = wizard->brokerageAccount(); if(!(brokerageAccount == MyMoneyAccount())) { - file->addAccount(brokerageAccount, parent); + file->addAccount(brokerageAccount, tqparent); } // create a possible schedule @@ -2523,24 +2523,24 @@ void KMyMoney2App::slotAccountNew(MyMoneyAccount& account) ft.commit(); account = acc; } catch (MyMoneyException *e) { - KMessageBox::error(this, i18n("Unable to create account: %1").arg(e->what())); + KMessageBox::error(this, i18n("Unable to create account: %1").tqarg(e->what())); } } } delete wizard; } -void KMyMoney2App::slotInvestmentNew(MyMoneyAccount& account, const MyMoneyAccount& parent) +void KMyMoney2App::slotInvestmentNew(MyMoneyAccount& account, const MyMoneyAccount& tqparent) { - QString dontShowAgain = "CreateNewInvestments"; + TQString dontShowAgain = "CreateNewInvestments"; if(KMessageBox::questionYesNo(this, - QString("")+i18n("The security %1 currently does not exist as sub-account of %2. " - "Do you want to create it?").arg(account.name()).arg(parent.name())+QString(""), i18n("Create security"), + TQString("")+i18n("The security %1 currently does not exist as sub-account of %2. " + "Do you want to create it?").tqarg(account.name()).tqarg(tqparent.name())+TQString(""), i18n("Create security"), KStdGuiItem::yes(), KStdGuiItem::no(), dontShowAgain) == KMessageBox::Yes) { KNewInvestmentWizard dlg; dlg.setName(account.name()); - if(dlg.exec() == QDialog::Accepted) { - dlg.createObjects(parent.id()); + if(dlg.exec() == TQDialog::Accepted) { + dlg.createObjects(tqparent.id()); account = dlg.account(); } } else { @@ -2554,7 +2554,7 @@ void KMyMoney2App::slotInvestmentNew(MyMoneyAccount& account, const MyMoneyAccou void KMyMoney2App::slotInvestmentNew(void) { KNewInvestmentWizard dlg; - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { dlg.createObjects(m_selectedAccount.id()); } } @@ -2562,21 +2562,21 @@ void KMyMoney2App::slotInvestmentNew(void) void KMyMoney2App::slotInvestmentEdit(void) { KNewInvestmentWizard dlg(m_selectedInvestment); - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { dlg.createObjects(m_selectedAccount.id()); } } void KMyMoney2App::slotInvestmentDelete(void) { - if(KMessageBox::questionYesNo(this, QString("

")+i18n("Do you really want to delete the investment %1?").arg(m_selectedInvestment.name()), i18n("Delete investment"), KStdGuiItem::yes(), KStdGuiItem::no(), "DeleteInvestment") == KMessageBox::Yes) { + if(KMessageBox::questionYesNo(this, TQString("

")+i18n("Do you really want to delete the investment %1?").tqarg(m_selectedInvestment.name()), i18n("Delete investment"), KStdGuiItem::yes(), KStdGuiItem::no(), "DeleteInvestment") == KMessageBox::Yes) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyFileTransaction ft; try { file->removeAccount(m_selectedInvestment); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::information(this, i18n("Unable to delete investment: %1").arg(e->what())); + KMessageBox::information(this, i18n("Unable to delete investment: %1").tqarg(e->what())); delete e; } } else { @@ -2584,8 +2584,8 @@ void KMyMoney2App::slotInvestmentDelete(void) // I have seen in some usability tests. So we just delete it right away. KConfig *kconfig = KGlobal::config(); if(kconfig) { - kconfig->setGroup(QString::fromLatin1("Notification Messages")); - kconfig->deleteEntry(QString::fromLatin1("DeleteInvestment")); + kconfig->setGroup(TQString::tqfromLatin1("Notification Messages")); + kconfig->deleteEntry(TQString::tqfromLatin1("DeleteInvestment")); } } } @@ -2594,7 +2594,7 @@ void KMyMoney2App::slotOnlinePriceUpdate(void) { if(!m_selectedInvestment.id().isEmpty()) { KEquityPriceUpdateDlg dlg(0, m_selectedInvestment.currencyId()); - if(dlg.exec() == QDialog::Accepted) + if(dlg.exec() == TQDialog::Accepted) dlg.storePrices(); } } @@ -2641,7 +2641,7 @@ void KMyMoney2App::createSchedule(MyMoneySchedule newSchedule, MyMoneyAccount& n // to the account pool. Note: the schedule code used to leave // this always the first split, but the loan code leaves it as // the second one. So I thought, searching is a good alternative .... - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).accountId().isEmpty()) { MyMoneySplit s = (*it_s); @@ -2678,11 +2678,11 @@ void KMyMoney2App::createSchedule(MyMoneySchedule newSchedule, MyMoneyAccount& n } } -bool KMyMoney2App::exchangeAccountInTransaction(MyMoneyTransaction& _t, const QString& fromId, const QString& toId) +bool KMyMoney2App::exchangeAccountInTransaction(MyMoneyTransaction& _t, const TQString& fromId, const TQString& toId) { bool rc = false; MyMoneyTransaction t(_t); - QValueList::iterator it_s; + TQValueList::iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).accountId() == fromId) { (*it_s).setAccountId(toId); @@ -2740,7 +2740,7 @@ void KMyMoney2App::slotAccountDelete(void) needAskUser = false; KCategoryReassignDlg* dlg = new KCategoryReassignDlg(this); - QString categoryId = dlg->show(m_selectedAccount); + TQString categoryId = dlg->show(m_selectedAccount); delete dlg; // and kill the dialog if (categoryId.isEmpty()) return; // the user aborted the dialog, so let's abort as well @@ -2757,8 +2757,8 @@ void KMyMoney2App::slotAccountDelete(void) // get the list of all transactions that reference the old account MyMoneyTransactionFilter filter(m_selectedAccount.id()); filter.setReportAllSplits(false); - QValueList tlist; - QValueList::iterator it_t; + TQValueList tlist; + TQValueList::iterator it_t; file->transactionList(tlist, filter); slotStatusProgressBar(0, tlist.count()); @@ -2774,8 +2774,8 @@ void KMyMoney2App::slotAccountDelete(void) // now fix all schedules { KMSTATUS(i18n("Adjusting scheduled transactions...")); - QValueList slist = file->scheduleList(m_selectedAccount.id()); - QValueList::iterator it_s; + TQValueList slist = file->scheduleList(m_selectedAccount.id()); + TQValueList::iterator it_s; int cnt = 0; slotStatusProgressBar(0, slist.count()); @@ -2792,8 +2792,8 @@ void KMyMoney2App::slotAccountDelete(void) // now fix all budgets { KMSTATUS(i18n("Adjusting budgets...")); - QValueList blist = file->budgetList(); - QValueList::const_iterator it_b; + TQValueList blist = file->budgetList(); + TQValueList::const_iterator it_b; for(it_b = blist.begin(); it_b != blist.end(); ++it_b) { if((*it_b).hasReferenceTo(m_selectedAccount.id())) { MyMoneyBudget b = (*it_b); @@ -2809,7 +2809,7 @@ void KMyMoney2App::slotAccountDelete(void) slotStatusProgressBar(blist.count(), 0); } } catch(MyMoneyException *e) { - KMessageBox::error( this, i18n("Unable to exchange category %1 with category %2. Reason: %3").arg(m_selectedAccount.name()).arg(newCategory.name()).arg(e->what())); + KMessageBox::error( this, i18n("Unable to exchange category %1 with category %2. Reason: %3").tqarg(m_selectedAccount.name()).tqarg(newCategory.name()).tqarg(e->what())); delete e; exit = true; } @@ -2830,14 +2830,14 @@ void KMyMoney2App::slotAccountDelete(void) // case A - only a single, unused category without subcats selected if (m_selectedAccount.accountList().isEmpty()) { - if (!needAskUser || (KMessageBox::questionYesNo(this, QString("")+i18n("Do you really want to delete category %1?").arg(m_selectedAccount.name())+QString("")) == KMessageBox::Yes)) { + if (!needAskUser || (KMessageBox::questionYesNo(this, TQString("")+i18n("Do you really want to delete category %1?").tqarg(m_selectedAccount.name())+TQString("")) == KMessageBox::Yes)) { try { file->removeAccount(m_selectedAccount); m_selectedAccount.clearId(); slotUpdateActions(); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::error( this, QString("")+i18n("Unable to delete category %1. Cause: %2").arg(m_selectedAccount.name()).arg(e->what())+QString("")); + KMessageBox::error( this, TQString("")+i18n("Unable to delete category %1. Cause: %2").tqarg(m_selectedAccount.name()).tqarg(e->what())+TQString("")); delete e; } } @@ -2845,14 +2845,14 @@ void KMyMoney2App::slotAccountDelete(void) } // case B - we have some subcategories, maybe the user does not want to // delete them all, but just the category itself? - MyMoneyAccount parentAccount = file->account(m_selectedAccount.parentAccountId()); + MyMoneyAccount tqparentAccount = file->account(m_selectedAccount.tqparentAccountId()); - QStringList accountsToReparent; - int result = KMessageBox::questionYesNoCancel(this, QString("")+ + TQStringList accountsToRetqparent; + int result = KMessageBox::questionYesNoCancel(this, TQString("")+ i18n("Do you want to delete category %1 with all its sub-categories or only " "the category itself? If you only delete the category itself, all its sub-categories " - "will be made sub-categories of %2.").arg(m_selectedAccount.name()).arg(parentAccount.name())+QString(""), - QString::null, + "will be made sub-categories of %2.").tqarg(m_selectedAccount.name()).tqarg(tqparentAccount.name())+TQString(""), + TQString(), KGuiItem(i18n("Delete all")), KGuiItem(i18n("Just the category"))); if (result == KMessageBox::Cancel) @@ -2861,40 +2861,40 @@ void KMyMoney2App::slotAccountDelete(void) bool need_confirmation = false; // case C - User only wants to delete the category itself if (result == KMessageBox::No) - accountsToReparent = m_selectedAccount.accountList(); + accountsToRetqparent = m_selectedAccount.accountList(); else { // case D - User wants to delete all subcategories, now check all subcats of // m_selectedAccount and remember all that cannot be deleted and // must be "reparented" - for (QStringList::const_iterator it = m_selectedAccount.accountList().begin(); + for (TQStringList::const_iterator it = m_selectedAccount.accountList().begin(); it != m_selectedAccount.accountList().end(); ++it) { // reparent account if a transaction is assigned if (file->transactionCount(*it)!=0) - accountsToReparent.push_back(*it); + accountsToRetqparent.push_back(*it); else if (!file->account(*it).accountList().isEmpty()) { // or if we have at least one sub-account that is used for transactions if (!file->hasOnlyUnusedAccounts(file->account(*it).accountList())) { - accountsToReparent.push_back(*it); + accountsToRetqparent.push_back(*it); //kdDebug() << "subaccount not empty" << endl; } } } - if (!accountsToReparent.isEmpty()) + if (!accountsToRetqparent.isEmpty()) need_confirmation = true; } - if (!accountsToReparent.isEmpty() && need_confirmation) { - if (KMessageBox::questionYesNo(this, QString("

")+i18n("Some sub-categories of category %1 cannot " - "be deleted, because they are still used. They will be made sub-categories of %2. Proceed?").arg(m_selectedAccount.name()).arg(parentAccount.name())) != KMessageBox::Yes) { + if (!accountsToRetqparent.isEmpty() && need_confirmation) { + if (KMessageBox::questionYesNo(this, TQString("

")+i18n("Some sub-categories of category %1 cannot " + "be deleted, because they are still used. They will be made sub-categories of %2. Proceed?").tqarg(m_selectedAccount.name()).tqarg(tqparentAccount.name())) != KMessageBox::Yes) { return; // user gets wet feet... } } // all good, now first reparent selected sub-categories try { - MyMoneyAccount parent = file->account(m_selectedAccount.parentAccountId()); - for (QStringList::const_iterator it = accountsToReparent.begin(); it != accountsToReparent.end(); ++it) { + MyMoneyAccount tqparent = file->account(m_selectedAccount.tqparentAccountId()); + for (TQStringList::const_iterator it = accountsToRetqparent.begin(); it != accountsToRetqparent.end(); ++it) { MyMoneyAccount child = file->account(*it); - file->reparentAccount(child, parent); + file->reparentAccount(child, tqparent); } // reload the account because the sub-account list might have changed m_selectedAccount = file->account(m_selectedAccount.id()); @@ -2904,7 +2904,7 @@ void KMyMoney2App::slotAccountDelete(void) // the old account list, which is no longer valid m_selectedAccount = file->account(m_selectedAccount.id()); } catch(MyMoneyException* e) { - KMessageBox::error( this, QString("")+i18n("Unable to delete a sub-category of category %1. Reason: %2").arg(m_selectedAccount.name()).arg(e->what())+QString("")); + KMessageBox::error( this, TQString("")+i18n("Unable to delete a sub-category of category %1. Reason: %2").tqarg(m_selectedAccount.name()).tqarg(e->what())+TQString("")); delete e; return; } @@ -2915,8 +2915,8 @@ void KMyMoney2App::slotAccountDelete(void) if (!m_selectedAccount.accountList().isEmpty()) return; // can't delete accounts which still have subaccounts - if (KMessageBox::questionYesNo(this, QString("

")+i18n("Do you really want to " - "delete account %1?").arg(m_selectedAccount.name())) != KMessageBox::Yes) { + if (KMessageBox::questionYesNo(this, TQString("

")+i18n("Do you really want to " + "delete account %1?").tqarg(m_selectedAccount.name())) != KMessageBox::Yes) { return; // ok, you don't want to? why did you click then, hmm? } } // switch; @@ -2927,7 +2927,7 @@ void KMyMoney2App::slotAccountDelete(void) slotUpdateActions(); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::error( this, i18n("Unable to delete account '%1'. Cause: %2").arg(m_selectedAccount.name()).arg(e->what())); + KMessageBox::error( this, i18n("Unable to delete account '%1'. Cause: %2").tqarg(m_selectedAccount.name()).tqarg(e->what())); delete e; } } @@ -2939,20 +2939,20 @@ void KMyMoney2App::slotAccountEdit(void) if(!file->isStandardAccount(m_selectedAccount.id())) { if(m_selectedAccount.accountType() != MyMoneyAccount::Loan && m_selectedAccount.accountType() != MyMoneyAccount::AssetLoan) { - QString caption; + TQString caption; bool category = false; switch(MyMoneyAccount::accountGroup(m_selectedAccount.accountType())) { default: - caption = i18n("Edit account '%1'").arg(m_selectedAccount.name()); + caption = i18n("Edit account '%1'").tqarg(m_selectedAccount.name()); break; case MyMoneyAccount::Expense: case MyMoneyAccount::Income: - caption = i18n("Edit category '%1'").arg(m_selectedAccount.name()); + caption = i18n("Edit category '%1'").tqarg(m_selectedAccount.name()); category = true; break; } - QString tid = file->openingBalanceTransaction(m_selectedAccount); + TQString tid = file->openingBalanceTransaction(m_selectedAccount); MyMoneyTransaction t; MyMoneySplit s0, s1; KNewAccountDlg dlg(m_selectedAccount, true, category, 0, 0, caption); @@ -2971,34 +2971,34 @@ void KMyMoney2App::slotAccountEdit(void) } } catch(MyMoneyException *e) { kdDebug(2) << "Error retrieving opening balance transaction " << tid << ": " << e->what() << "\n"; - tid = QString(); + tid = TQString(); delete e; } } } // check for online modules - QMap::const_iterator it_plugin = m_onlinePlugins.end(); + TQMap::const_iterator it_plugin = m_onlinePlugins.end(); const MyMoneyKeyValueContainer& kvp = m_selectedAccount.onlineBankingSettings(); if(!kvp["provider"].isEmpty()) { // if we have an online provider for this account, we need to check // that we have the corresponding plugin. If that exists, we ask it // to provide an additional tab for the account editor. - it_plugin = m_onlinePlugins.find(kvp["provider"]); + it_plugin = m_onlinePlugins.tqfind(kvp["provider"]); if(it_plugin != m_onlinePlugins.end()) { - QString name; - QWidget *w = 0; + TQString name; + TQWidget *w = 0; w = (*it_plugin)->accountConfigTab(m_selectedAccount, name); dlg.addTab(w, name); } } - if (dlg.exec() == QDialog::Accepted) { + if (dlg.exec() == TQDialog::Accepted) { try { MyMoneyFileTransaction ft; MyMoneyAccount account = dlg.account(); - MyMoneyAccount parent = dlg.parentAccount(); + MyMoneyAccount tqparent = dlg.tqparentAccount(); if(it_plugin != m_onlinePlugins.end()) { account.setOnlineBankingSettings((*it_plugin)->onlineBankingSettings(account.onlineBankingSettings())); } @@ -3009,8 +3009,8 @@ void KMyMoney2App::slotAccountEdit(void) // we need to modify first, as reparent would override all other changes file->modifyAccount(account); - if(account.parentAccountId() != parent.id()) { - file->reparentAccount(account, parent); + if(account.tqparentAccountId() != tqparent.id()) { + file->reparentAccount(account, tqparent); } if(!tid.isEmpty() && dlg.openingBalance().isZero()) { file->removeTransaction(t); @@ -3034,15 +3034,15 @@ void KMyMoney2App::slotAccountEdit(void) slotSelectAccount(file->account(account.id())); } catch(MyMoneyException* e) { - KMessageBox::error( this, i18n("Unable to modify account '%1'. Cause: %2").arg(m_selectedAccount.name()).arg(e->what())); + KMessageBox::error( this, i18n("Unable to modify account '%1'. Cause: %2").tqarg(m_selectedAccount.name()).tqarg(e->what())); delete e; } } } else { KEditLoanWizard* wizard = new KEditLoanWizard(m_selectedAccount); - connect(wizard, SIGNAL(newCategory(MyMoneyAccount&)), this, SLOT(slotCategoryNew(MyMoneyAccount&))); - connect(wizard, SIGNAL(createPayee(const QString&, QString&)), this, SLOT(slotPayeeNew(const QString&, QString&))); - if(wizard->exec() == QDialog::Accepted) { + connect(wizard, TQT_SIGNAL(newCategory(MyMoneyAccount&)), TQT_TQOBJECT(this), TQT_SLOT(slotCategoryNew(MyMoneyAccount&))); + connect(wizard, TQT_SIGNAL(createPayee(const TQString&, TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + if(wizard->exec() == TQDialog::Accepted) { MyMoneySchedule sch = file->schedule(m_selectedAccount.value("schedule").latin1()); if(!(m_selectedAccount == wizard->account()) || !(sch == wizard->schedule())) { @@ -3089,21 +3089,21 @@ void KMyMoney2App::slotAccountReconcileStart(void) try { #if 0 // check if we have overdue schedules for this account - QValueList schedules = file->scheduleList(m_selectedAccount.id(), MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, QDate(), QDate(), true); + TQValueList schedules = file->scheduleList(m_selectedAccount.id(), MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, TQDate(), TQDate(), true); if(schedules.count() > 0) { if(KMessageBox::questionYesNo(this, i18n("KMyMoney has detected some overdue scheduled transactions for this account. Do you want to enter those scheduled transactions now?"), i18n("Scheduled transactions found")) == KMessageBox::Yes) { - QMap skipMap; + TQMap skipMap; bool processedOne; KMyMoneyUtils::EnterScheduleResultCodeE rc = KMyMoneyUtils::Enter; do { processedOne = false; - QValueList::const_iterator it_sch; + TQValueList::const_iterator it_sch; for(it_sch = schedules.begin(); (rc != KMyMoneyUtils::Cancel) && (it_sch != schedules.end()); ++it_sch) { MyMoneySchedule sch(*(it_sch)); // and enter it if it is not on the skip list - if(skipMap.find((*it_sch).id()) == skipMap.end()) { + if(skipMap.tqfind((*it_sch).id()) == skipMap.end()) { rc = enterSchedule(sch, false, true); if(rc == KMyMoneyUtils::Ignore) { skipMap[(*it_sch).id()] = true; @@ -3112,7 +3112,7 @@ void KMyMoney2App::slotAccountReconcileStart(void) } // reload list (maybe this schedule needs to be added again) - schedules = file->scheduleList(m_selectedAccount.id(), MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, QDate(), QDate(), true); + schedules = file->scheduleList(m_selectedAccount.id(), MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, TQDate(), TQDate(), true); } while(processedOne); } } @@ -3124,10 +3124,10 @@ void KMyMoney2App::slotAccountReconcileStart(void) delete m_endingBalanceDlg; m_endingBalanceDlg = new KEndingBalanceDlg(account, this); if(account.isAssetLiability()) { - connect(m_endingBalanceDlg, SIGNAL(createPayee(const QString&, QString&)), this, SLOT(slotPayeeNew(const QString&, QString&))); - connect(m_endingBalanceDlg, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), this, SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_endingBalanceDlg, TQT_SIGNAL(createPayee(const TQString&, TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + connect(m_endingBalanceDlg, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), TQT_TQOBJECT(this), TQT_SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); - if(m_endingBalanceDlg->exec() == QDialog::Accepted) { + if(m_endingBalanceDlg->exec() == TQDialog::Accepted) { if(myMoneyView->startReconciliation(account, m_endingBalanceDlg->statementDate(), m_endingBalanceDlg->endingBalance())) { // check if the user requests us to create interest @@ -3167,11 +3167,11 @@ void KMyMoney2App::slotAccountReconcileFinish(void) if(!m_reconciliationAccount.id().isEmpty()) { // retrieve list of all transactions that are not reconciled or cleared - QValueList > transactionList; + TQValueList > transactionList; MyMoneyTransactionFilter filter(m_reconciliationAccount.id()); filter.addState(MyMoneyTransactionFilter::cleared); filter.addState(MyMoneyTransactionFilter::notReconciled); - filter.setDateFilter(QDate(), m_endingBalanceDlg->statementDate()); + filter.setDateFilter(TQDate(), m_endingBalanceDlg->statementDate()); filter.setConsiderCategory(false); filter.setReportAllSplits(true); file->transactionList(transactionList, filter); @@ -3181,7 +3181,7 @@ void KMyMoney2App::slotAccountReconcileFinish(void) actBalance = clearedBalance = balance; // walk the list of transactions to figure out the balance(s) - QValueList >::const_iterator it; + TQValueList >::const_iterator it; for(it = transactionList.begin(); it != transactionList.end(); ++it) { if((*it).second.reconcileFlag() == MyMoneySplit::NotReconciled) { clearedBalance -= (*it).second.shares(); @@ -3189,7 +3189,7 @@ void KMyMoney2App::slotAccountReconcileFinish(void) } if(m_endingBalanceDlg->endingBalance() != clearedBalance) { - QString message = i18n("You are about to finish the reconciliation of this account with a difference between your bank statement and the transactions marked as cleared.\n" + TQString message = i18n("You are about to finish the reconciliation of this account with a difference between your bank statement and the transactions marked as cleared.\n" "Are you sure you want to finish the reconciliation ?"); if (KMessageBox::questionYesNo(this, message, i18n("Confirm end of reconciliation"), KStdGuiItem::yes(), KStdGuiItem::no()) == KMessageBox::No) return; @@ -3225,7 +3225,7 @@ void KMyMoney2App::slotAccountReconcileFinish(void) */ // walk the list of transactions/splits and mark the cleared ones as reconciled - QValueList >::iterator it; + TQValueList >::iterator it; for(it = transactionList.begin(); it != transactionList.end(); ++it) { MyMoneySplit sp = (*it).second; @@ -3244,7 +3244,7 @@ void KMyMoney2App::slotAccountReconcileFinish(void) file->modifyTransaction(t); // ... and the list - (*it) = qMakePair(t, sp); + (*it) = tqMakePair(t, sp); } ft.commit(); @@ -3302,7 +3302,7 @@ void KMyMoney2App::slotAccountOpen(const MyMoneyObject& obj) return; MyMoneyFile* file = MyMoneyFile::instance(); - QString id = m_selectedAccount.id(); + TQString id = m_selectedAccount.id(); // if the caller passed a non-empty object, we need to select that if(!obj.id().isEmpty()) { @@ -3328,8 +3328,8 @@ bool KMyMoney2App::canCloseAccount(const MyMoneyAccount& acc) const if(!acc.balance().isZero()) return false; - // all children must be already closed - QStringList::const_iterator it_a; + // all tqchildren must be already closed + TQStringList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount a = MyMoneyFile::instance()->account(*it_a); if(!a.isClosed()) { @@ -3338,8 +3338,8 @@ bool KMyMoney2App::canCloseAccount(const MyMoneyAccount& acc) const } // there must be no unfinished schedule referencing the account - QValueList list = MyMoneyFile::instance()->scheduleList(); - QValueList::const_iterator it_l; + TQValueList list = MyMoneyFile::instance()->scheduleList(); + TQValueList::const_iterator it_l; for(it_l = list.begin(); it_l != list.end(); ++it_l) { if((*it_l).isFinished()) continue; @@ -3365,7 +3365,7 @@ void KMyMoney2App::slotAccountClose(void) MyMoneyFile::instance()->modifyAccount(a); ft.commit(); if(KMyMoneyGlobalSettings::hideClosedAccounts()) { - KMessageBox::information(this, QString("")+i18n("You have closed this account. It remains in the system because you have transactions which still refer to it, but is not shown in the views. You can make it visible again by going to the View menu and selecting Show all accounts or by unselecting the Don't show closed accounts setting.")+QString(""), i18n("Information"), "CloseAccountInfo"); + KMessageBox::information(this, TQString("")+i18n("You have closed this account. It remains in the system because you have transactions which still refer to it, but is not shown in the views. You can make it visible again by going to the View menu and selecting Show all accounts or by unselecting the Don't show closed accounts setting.")+TQString(""), i18n("Information"), "CloseAccountInfo"); } } catch(MyMoneyException* e) { delete e; @@ -3388,7 +3388,7 @@ void KMyMoney2App::slotAccountReopen(void) while(a.isClosed()) { a.setClosed(false); file->modifyAccount(a); - a = file->account(a.parentAccountId()); + a = file->account(a.tqparentAccountId()); } ft.commit(); } catch(MyMoneyException* e) { @@ -3396,7 +3396,7 @@ void KMyMoney2App::slotAccountReopen(void) } } -void KMyMoney2App::slotReparentAccount(const MyMoneyAccount& _src, const MyMoneyInstitution& _dst) +void KMyMoney2App::slotRetqparentAccount(const MyMoneyAccount& _src, const MyMoneyInstitution& _dst) { MyMoneyAccount src(_src); src.setInstitutionId(_dst.id()); @@ -3405,12 +3405,12 @@ void KMyMoney2App::slotReparentAccount(const MyMoneyAccount& _src, const MyMoney MyMoneyFile::instance()->modifyAccount(src); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::sorry(this, QString("

")+i18n("%1 cannot be moved to institution %2. Reason: %3").arg(src.name()).arg(_dst.name()).arg(e->what())); + KMessageBox::sorry(this, TQString("

")+i18n("%1 cannot be moved to institution %2. Reason: %3").tqarg(src.name()).tqarg(_dst.name()).tqarg(e->what())); delete e; } } -void KMyMoney2App::slotReparentAccount(const MyMoneyAccount& _src, const MyMoneyAccount& _dst) +void KMyMoney2App::slotRetqparentAccount(const MyMoneyAccount& _src, const MyMoneyAccount& _dst) { MyMoneyAccount src(_src); MyMoneyAccount dst(_dst); @@ -3419,7 +3419,7 @@ void KMyMoney2App::slotReparentAccount(const MyMoneyAccount& _src, const MyMoney MyMoneyFile::instance()->reparentAccount(src, dst); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::sorry(this, QString("

")+i18n("%1 cannot be moved to %2. Reason: %3").arg(src.name()).arg(dst.name()).arg(e->what())); + KMessageBox::sorry(this, TQString("

")+i18n("%1 cannot be moved to %2. Reason: %3").tqarg(src.name()).tqarg(dst.name()).tqarg(e->what())); delete e; } } @@ -3431,10 +3431,10 @@ void KMyMoney2App::slotAccountTransactionReport(void) if(!m_selectedAccount.id().isEmpty()) { MyMoneyReport report( MyMoneyReport::eAccount, - MyMoneyReport::eQCnumber|MyMoneyReport::eQCpayee|MyMoneyReport::eQCcategory, + MyMoneyReport::eTQCnumber|MyMoneyReport::eTQCpayee|MyMoneyReport::eTQCcategory, MyMoneyTransactionFilter::yearToDate, MyMoneyReport::eDetailAll, - i18n("%1 YTD Account Transactions").arg(m_selectedAccount.name()), + i18n("%1 YTD Account Transactions").tqarg(m_selectedAccount.name()), i18n("Generated Report") ); report.setGroup(i18n("Transactions")); @@ -3467,7 +3467,7 @@ void KMyMoney2App::slotScheduleNew(const MyMoneyTransaction& _t, MyMoneySchedule KEditScheduleDlg dlg(schedule, this); TransactionEditor* transactionEditor = dlg.startEdit(); if(transactionEditor) { - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { MyMoneyFileTransaction ft; try { schedule = dlg.schedule(); @@ -3475,7 +3475,7 @@ void KMyMoney2App::slotScheduleNew(const MyMoneyTransaction& _t, MyMoneySchedule ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::error(this, i18n("Unable to add scheduled transaction: %1").arg(e->what()), i18n("Add scheduled transaction")); + KMessageBox::error(this, i18n("Unable to add scheduled transaction: %1").tqarg(e->what()), i18n("Add scheduled transaction")); delete e; } } @@ -3500,7 +3500,7 @@ void KMyMoney2App::slotScheduleEdit(void) sched_dlg = new KEditScheduleDlg(schedule, this); m_transactionEditor = sched_dlg->startEdit(); if(m_transactionEditor) { - if(sched_dlg->exec() == QDialog::Accepted) { + if(sched_dlg->exec() == TQDialog::Accepted) { MyMoneyFileTransaction ft; try { MyMoneySchedule sched = sched_dlg->schedule(); @@ -3508,15 +3508,15 @@ void KMyMoney2App::slotScheduleEdit(void) // is at or before the lastPaymentDate // If it is, ask the user whether to clear the // lastPaymentDate - const QDate& next = sched.nextDueDate(); - const QDate& last = sched.lastPayment(); + const TQDate& next = sched.nextDueDate(); + const TQDate& last = sched.lastPayment(); if ( next.isValid() && last.isValid() && next <= last ) { // Entered a date effectively no later // than previous payment. Date would be // updated automatically so we probably // want to clear it. Let's ask the user. - if(KMessageBox::questionYesNo(this, QString("")+i18n("You have entered a scheduled transaction date of %1. Because the scheduled transaction was last paid on %2, KMyMoney will automatically adjust the scheduled transaction date to the next date unless the last payment date is reset. Do you want to reset the last payment date?").arg(KGlobal::locale()->formatDate(next, true)).arg(KGlobal::locale()->formatDate(last, true))+QString(""),i18n("Reset Last Payment Date" ), KStdGuiItem::yes(), KStdGuiItem::no()) == KMessageBox::Yes) { - sched.setLastPayment( QDate() ); + if(KMessageBox::questionYesNo(this, TQString("")+i18n("You have entered a scheduled transaction date of %1. Because the scheduled transaction was last paid on %2, KMyMoney will automatically adjust the scheduled transaction date to the next date unless the last payment date is reset. Do you want to reset the last payment date?").tqarg(KGlobal::locale()->formatDate(next, true)).tqarg(KGlobal::locale()->formatDate(last, true))+TQString(""),i18n("Reset Last Payment Date" ), KStdGuiItem::yes(), KStdGuiItem::no()) == KMessageBox::Yes) { + sched.setLastPayment( TQDate() ); } } MyMoneyFile::instance()->modifySchedule(sched); @@ -3525,7 +3525,7 @@ void KMyMoney2App::slotScheduleEdit(void) deleteTransactionEditor(); ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unable to modify scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unable to modify scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } } @@ -3536,16 +3536,16 @@ void KMyMoney2App::slotScheduleEdit(void) case MyMoneySchedule::TYPE_LOANPAYMENT: loan_wiz = new KEditLoanWizard(schedule.account(2)); - connect(loan_wiz, SIGNAL(newCategory(MyMoneyAccount&)), this, SLOT(slotCategoryNew(MyMoneyAccount&))); - connect(loan_wiz, SIGNAL(createPayee(const QString&, QString&)), this, SLOT(slotPayeeNew(const QString&, QString&))); - if (loan_wiz->exec() == QDialog::Accepted) { + connect(loan_wiz, TQT_SIGNAL(newCategory(MyMoneyAccount&)), TQT_TQOBJECT(this), TQT_SLOT(slotCategoryNew(MyMoneyAccount&))); + connect(loan_wiz, TQT_SIGNAL(createPayee(const TQString&, TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + if (loan_wiz->exec() == TQDialog::Accepted) { MyMoneyFileTransaction ft; try { MyMoneyFile::instance()->modifySchedule(loan_wiz->schedule()); MyMoneyFile::instance()->modifyAccount(loan_wiz->account()); ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unable to modify scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unable to modify scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } } @@ -3557,7 +3557,7 @@ void KMyMoney2App::slotScheduleEdit(void) } } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unable to modify scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unable to modify scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } } @@ -3569,9 +3569,9 @@ void KMyMoney2App::slotScheduleDelete(void) MyMoneyFileTransaction ft; try { MyMoneySchedule sched = MyMoneyFile::instance()->schedule(m_selectedSchedule.id()); - QString msg = QString("

")+i18n("Are you sure you want to delete the scheduled transaction %1?").arg(m_selectedSchedule.name()); + TQString msg = TQString("

")+i18n("Are you sure you want to delete the scheduled transaction %1?").tqarg(m_selectedSchedule.name()); if(sched.type() == MyMoneySchedule::TYPE_LOANPAYMENT) { - msg += QString(" "); + msg += TQString(" "); msg += i18n("In case of loan payments it is currently not possible to recreate the scheduled transaction."); } if (KMessageBox::questionYesNo(this, msg) == KMessageBox::No) @@ -3581,7 +3581,7 @@ void KMyMoney2App::slotScheduleDelete(void) ft.commit(); } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unable to remove scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unable to remove scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } } @@ -3594,8 +3594,8 @@ void KMyMoney2App::slotScheduleDuplicate(void) if(kmymoney2->action("schedule_duplicate")->isEnabled()) { MyMoneySchedule sch = m_selectedSchedule; sch.clearId(); - sch.setLastPayment(QDate()); - sch.setName(i18n("Copy of scheduled transaction name", "Copy of %1").arg(sch.name())); + sch.setLastPayment(TQDate()); + sch.setName(i18n("Copy of scheduled transaction name", "Copy of %1").tqarg(sch.name())); MyMoneyFileTransaction ft; try { @@ -3607,7 +3607,7 @@ void KMyMoney2App::slotScheduleDuplicate(void) myMoneyView->slotScheduleSelected(sch.id()); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to duplicate transaction(s): %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to duplicate transaction(s): %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -3620,8 +3620,8 @@ void KMyMoney2App::slotScheduleSkip(void) MyMoneySchedule schedule = MyMoneyFile::instance()->schedule(m_selectedSchedule.id()); if(!schedule.isFinished()) { if(schedule.occurence() != MyMoneySchedule::OCCUR_ONCE) { - QDate next = schedule.nextDueDate(); - if(!schedule.isFinished() && (KMessageBox::questionYesNo(this, QString("")+i18n("Do you really want to skip the %1 transaction scheduled for %2?").arg(schedule.name(), KGlobal::locale()->formatDate(next, true))+QString(""))) == KMessageBox::Yes) { + TQDate next = schedule.nextDueDate(); + if(!schedule.isFinished() && (KMessageBox::questionYesNo(this, TQString("")+i18n("Do you really want to skip the %1 transaction scheduled for %2?").tqarg(schedule.name(), KGlobal::locale()->formatDate(next, true))+TQString(""))) == KMessageBox::Yes) { MyMoneyFileTransaction ft; schedule.setLastPayment(next); schedule.setNextDueDate(schedule.nextPayment(next)); @@ -3631,7 +3631,7 @@ void KMyMoney2App::slotScheduleSkip(void) } } } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, QString("")+i18n("Unable to skip scheduled transaction %1.").arg(m_selectedSchedule.name())+QString(""), e->what()); + KMessageBox::detailedSorry(this, TQString("")+i18n("Unable to skip scheduled transaction %1.").tqarg(m_selectedSchedule.name())+TQString(""), e->what()); delete e; } } @@ -3644,7 +3644,7 @@ void KMyMoney2App::slotScheduleEnter(void) MyMoneySchedule schedule = MyMoneyFile::instance()->schedule(m_selectedSchedule.id()); enterSchedule(schedule); } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unknown scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unknown scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } } @@ -3656,7 +3656,7 @@ KMyMoneyUtils::EnterScheduleResultCodeE KMyMoney2App::enterSchedule(MyMoneySched if (!schedule.id().isEmpty()) { try { schedule = MyMoneyFile::instance()->schedule(schedule.id()); - QDate origDueDate = schedule.nextDueDate(); + TQDate origDueDate = schedule.nextDueDate(); KEnterScheduleDlg dlg(this, schedule); dlg.showExtendedKeys(extendedKeys); @@ -3674,7 +3674,7 @@ KMyMoneyUtils::EnterScheduleResultCodeE KMyMoney2App::enterSchedule(MyMoneySched if(!autoEnter || !schedule.isFixed()) { for(;;) { rc = KMyMoneyUtils::Cancel; - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { rc = dlg.resultCode(); if(rc == KMyMoneyUtils::Enter) { m_transactionEditor->createTransaction(taccepted, torig, torig.splits()[0], true); @@ -3683,7 +3683,7 @@ KMyMoneyUtils::EnterScheduleResultCodeE KMyMoney2App::enterSchedule(MyMoneySched if(torig != taccepted) { KConfirmManualEnterDlg cdlg(schedule, this); cdlg.loadTransactions(torig, taccepted); - if(cdlg.exec() == QDialog::Accepted) { + if(cdlg.exec() == TQDialog::Accepted) { action = cdlg.action(); break; } @@ -3734,8 +3734,8 @@ KMyMoneyUtils::EnterScheduleResultCodeE KMyMoney2App::enterSchedule(MyMoneySched break; } - QString newId; - connect(m_transactionEditor, SIGNAL(balanceWarning(QWidget*, const MyMoneyAccount&, const QString&)), d->m_balanceWarning, SLOT(slotShowMessage(QWidget*, const MyMoneyAccount&, const QString&))); + TQString newId; + connect(m_transactionEditor, TQT_SIGNAL(balanceWarning(TQWidget*, const MyMoneyAccount&, const TQString&)), d->m_balanceWarning, TQT_SLOT(slotShowMessage(TQWidget*, const MyMoneyAccount&, const TQString&))); if(m_transactionEditor->enterTransactions(newId, false)) { if(!newId.isEmpty()) { MyMoneyTransaction t = MyMoneyFile::instance()->transaction(newId); @@ -3751,35 +3751,35 @@ KMyMoneyUtils::EnterScheduleResultCodeE KMyMoney2App::enterSchedule(MyMoneySched ft.commit(); } } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unable to enter scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unable to enter scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } deleteTransactionEditor(); } } } catch (MyMoneyException *e) { - KMessageBox::detailedSorry(this, i18n("Unable to enter scheduled transaction '%1'").arg(m_selectedSchedule.name()), e->what()); + KMessageBox::detailedSorry(this, i18n("Unable to enter scheduled transaction '%1'").tqarg(m_selectedSchedule.name()), e->what()); delete e; } } return rc; } -void KMyMoney2App::slotPayeeNew(const QString& newnameBase, QString& id) +void KMyMoney2App::slotPayeeNew(const TQString& newnameBase, TQString& id) { bool doit = true; if(newnameBase != i18n("New Payee")) { // Ask the user if that is what he intended to do? - QString msg = QString("") + i18n("Do you want to add %1 as payer/receiver ?").arg(newnameBase) + QString(""); - const QString dontAskAgain = QString::fromLatin1("NewPayee"); + TQString msg = TQString("") + i18n("Do you want to add %1 as payer/receiver ?").tqarg(newnameBase) + TQString(""); + const TQString dontAskAgain = TQString::tqfromLatin1("NewPayee"); if(KMessageBox::questionYesNo(this, msg, i18n("New payee/receiver"), KStdGuiItem::yes(), KStdGuiItem::no(), dontAskAgain) == KMessageBox::No) { doit = false; // we should not keep the 'no' setting because that can confuse people like // I have seen in some usability tests. So we just delete it right away. KConfig *kconfig = KGlobal::config(); if(kconfig) { - kconfig->setGroup(QString::fromLatin1("Notification Messages")); + kconfig->setGroup(TQString::tqfromLatin1("Notification Messages")); kconfig->deleteEntry(dontAskAgain); } } @@ -3788,13 +3788,13 @@ void KMyMoney2App::slotPayeeNew(const QString& newnameBase, QString& id) if(doit) { MyMoneyFileTransaction ft; try { - QString newname(newnameBase); + TQString newname(newnameBase); // adjust name until a unique name has been created int count = 0; for(;;) { try { MyMoneyFile::instance()->payeeByName(newname); - newname = QString("%1 [%2]").arg(newnameBase).arg(++count); + newname = TQString("%1 [%2]").tqarg(newnameBase).tqarg(++count); } catch(MyMoneyException* e) { delete e; break; @@ -3808,7 +3808,7 @@ void KMyMoney2App::slotPayeeNew(const QString& newnameBase, QString& id) ft.commit(); } catch (MyMoneyException *e) { KMessageBox::detailedSorry(this, i18n("Unable to add payee"), - QString("%1 thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + TQString("%1 thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -3816,7 +3816,7 @@ void KMyMoney2App::slotPayeeNew(const QString& newnameBase, QString& id) void KMyMoney2App::slotPayeeNew(void) { - QString id; + TQString id; slotPayeeNew(i18n("New Payee"), id); // the callbacks should have made sure, that the payees view has been @@ -3825,10 +3825,10 @@ void KMyMoney2App::slotPayeeNew(void) emit payeeCreated(id); } -bool KMyMoney2App::payeeInList(const QValueList& list, const QString& id) const +bool KMyMoney2App::payeeInList(const TQValueList& list, const TQString& id) const { bool rc = false; - QValueList::const_iterator it_p = list.begin(); + TQValueList::const_iterator it_p = list.begin(); while(it_p != list.end()) { if((*it_p).id() == id) { rc = true; @@ -3847,10 +3847,10 @@ void KMyMoney2App::slotPayeeDelete(void) MyMoneyFile * file = MyMoneyFile::instance(); // first create list with all non-selected payees - QValueList remainingPayees = file->payeeList(); - QValueList::iterator it_p; + TQValueList remainingPayees = file->payeeList(); + TQValueList::iterator it_p; for(it_p = remainingPayees.begin(); it_p != remainingPayees.end(); ) { - if(m_selectedPayees.find(*it_p) != m_selectedPayees.end()) { + if(m_selectedPayees.tqfind(*it_p) != m_selectedPayees.end()) { it_p = remainingPayees.erase(it_p); } else { ++it_p; @@ -3858,9 +3858,9 @@ void KMyMoney2App::slotPayeeDelete(void) } // get confirmation from user - QString prompt; + TQString prompt; if (m_selectedPayees.size() == 1) - prompt = QString("

")+i18n("Do you really want to remove the payee %1?").arg(m_selectedPayees.front().name()); + prompt = TQString("

")+i18n("Do you really want to remove the payee %1?").tqarg(m_selectedPayees.front().name()); else prompt = i18n("Do you really want to remove all selected payees?"); @@ -3871,22 +3871,22 @@ void KMyMoney2App::slotPayeeDelete(void) try { // create a transaction filter that contains all payees selected for removal MyMoneyTransactionFilter f = MyMoneyTransactionFilter(); - for (QValueList::const_iterator it = m_selectedPayees.begin(); + for (TQValueList::const_iterator it = m_selectedPayees.begin(); it != m_selectedPayees.end(); ++it) { f.addPayee( (*it).id() ); } // request a list of all transactions that still use the payees in question - QValueList translist = file->transactionList(f); + TQValueList translist = file->transactionList(f); // kdDebug() << "[KPayeesView::slotDeletePayee] " << translist.count() << " transaction still assigned to payees" << endl; // now get a list of all schedules that make use of one of the payees - QValueList all_schedules = file->scheduleList(); - QValueList used_schedules; - for (QValueList::ConstIterator it = all_schedules.begin(); + TQValueList all_schedules = file->scheduleList(); + TQValueList used_schedules; + for (TQValueList::ConstIterator it = all_schedules.begin(); it != all_schedules.end(); ++it) { // loop over all splits in the transaction of the schedule - for (QValueList::ConstIterator s_it = (*it).transaction().splits().begin(); + for (TQValueList::ConstIterator s_it = (*it).transaction().splits().begin(); s_it != (*it).transaction().splits().end(); ++s_it) { // is the payee in the split to be deleted? @@ -3912,7 +3912,7 @@ void KMyMoney2App::slotPayeeDelete(void) // show transaction reassignment dialog KPayeeReassignDlg * dlg = new KPayeeReassignDlg(this); - QString payee_id = dlg->show(remainingPayees); + TQString payee_id = dlg->show(remainingPayees); addToMatchList = dlg->addToMatchList(); delete dlg; // and kill the dialog if (payee_id.isEmpty()) @@ -3923,11 +3923,11 @@ void KMyMoney2App::slotPayeeDelete(void) // TODO : check if we have a report that explicitely uses one of our payees // and issue an appropriate warning try { - QValueList::iterator s_it; + TQValueList::iterator s_it; // now loop over all transactions and reassign payee - for (QValueList::iterator it = translist.begin(); it != translist.end(); ++it) { + for (TQValueList::iterator it = translist.begin(); it != translist.end(); ++it) { // create a copy of the splits list in the transaction - QValueList splits = (*it).splits(); + TQValueList splits = (*it).splits(); // loop over all splits for (s_it = splits.begin(); s_it != splits.end(); ++s_it) { // if the split is assigned to one of the selected payees, we need to modify it @@ -3941,13 +3941,13 @@ void KMyMoney2App::slotPayeeDelete(void) } // for - Transactions // now loop over all schedules and reassign payees - for (QValueList::iterator it = used_schedules.begin(); + for (TQValueList::iterator it = used_schedules.begin(); it != used_schedules.end(); ++it) { // create copy of transaction in current schedule MyMoneyTransaction trans = (*it).transaction(); // create copy of lists of splits - QValueList splits = trans.splits(); + TQValueList splits = trans.splits(); for (s_it = splits.begin(); s_it != splits.end(); ++s_it) { if(payeeInList(m_selectedPayees, (*s_it).payeeId())) { (*s_it).setPayeeId(payee_id); @@ -3960,18 +3960,18 @@ void KMyMoney2App::slotPayeeDelete(void) } // for - Schedules } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to reassign payee of transaction/split"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } // if !translist.isEmpty() bool ignorecase; - QStringList payeeNames; + TQStringList payeeNames; MyMoneyPayee::payeeMatchType matchType = newPayee.matchData(ignorecase, payeeNames); - QStringList deletedPayeeNames; + TQStringList deletedPayeeNames; // now loop over all selected payees and remove them - for (QValueList::iterator it = m_selectedPayees.begin(); + for (TQValueList::iterator it = m_selectedPayees.begin(); it != m_selectedPayees.end(); ++it) { if(addToMatchList) { deletedPayeeNames << (*it).name(); @@ -3989,20 +3989,20 @@ void KMyMoney2App::slotPayeeDelete(void) // TODO: it would be cool to somehow shrink the list to make better use // of regular expressions at this point. For now, we leave this task // to the user himeself. - QStringList::const_iterator it_n; + TQStringList::const_iterator it_n; for(it_n = deletedPayeeNames.begin(); it_n != deletedPayeeNames.end(); ++it_n) { if(matchType == MyMoneyPayee::matchKey) { // make sure we really need it and it is not caught by an existing regexp - QStringList::const_iterator it_k; + TQStringList::const_iterator it_k; for(it_k = payeeNames.begin(); it_k != payeeNames.end(); ++it_k) { - QRegExp exp(*it_k, ignorecase); + TQRegExp exp(*it_k, ignorecase); if(exp.search(*it_n) != -1) break; } if(it_k == payeeNames.end()) - payeeNames << QRegExp::escape(*it_n); - } else if(payeeNames.contains(*it_n) == 0) - payeeNames << QRegExp::escape(*it_n); + payeeNames << TQRegExp::escape(*it_n); + } else if(payeeNames.tqcontains(*it_n) == 0) + payeeNames << TQRegExp::escape(*it_n); } // and update the payee in the engine context @@ -4013,34 +4013,34 @@ void KMyMoney2App::slotPayeeDelete(void) ft.commit(); // If we just deleted the payees, they sure don't exist anymore - slotSelectPayees(QValueList()); + slotSelectPayees(TQValueList()); } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to remove payee(s)"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } void KMyMoney2App::slotCurrencyNew(void) { - QString sid = KInputDialog::getText(i18n("New currency"), i18n("Enter ISO 4217 code for the new currency"), QString::null, 0, 0, 0, 0, ">AAA"); + TQString sid = KInputDialog::getText(i18n("New currency"), i18n("Enter ISO 4217 code for the new currency"), TQString(), 0, 0, 0, 0, ">AAA"); if(!sid.isEmpty()) { - QString id(sid); + TQString id(sid); MyMoneySecurity currency(id, i18n("New currency")); MyMoneyFileTransaction ft; try { MyMoneyFile::instance()->addCurrency(currency); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::sorry(this, i18n("Cannot create new currency. %1").arg(e->what()), i18n("New currency")); + KMessageBox::sorry(this, i18n("Cannot create new currency. %1").tqarg(e->what()), i18n("New currency")); delete e; } emit currencyCreated(id); } } -void KMyMoney2App::slotCurrencyRename(QListViewItem* item, int, const QString& txt) +void KMyMoney2App::slotCurrencyRename(TQListViewItem* item, int, const TQString& txt) { MyMoneyFile* file = MyMoneyFile::instance(); KMyMoneyListViewItem* p = static_cast(item); @@ -4055,12 +4055,12 @@ void KMyMoney2App::slotCurrencyRename(QListViewItem* item, int, const QString& t m_selectedCurrency = currency; ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::sorry(this, i18n("Cannot rename currency. %1").arg(e->what()), i18n("Rename currency")); + KMessageBox::sorry(this, i18n("Cannot rename currency. %1").tqarg(e->what()), i18n("Rename currency")); delete e; } } } catch(MyMoneyException *e) { - KMessageBox::sorry(this, i18n("Cannot rename currency. %1").arg(e->what()), i18n("Rename currency")); + KMessageBox::sorry(this, i18n("Cannot rename currency. %1").tqarg(e->what()), i18n("Rename currency")); delete e; } } @@ -4073,7 +4073,7 @@ void KMyMoney2App::slotCurrencyDelete(void) MyMoneyFile::instance()->removeCurrency(m_selectedCurrency); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::sorry(this, i18n("Cannot delete currency %1. %2").arg(m_selectedCurrency.name()).arg(e->what()), i18n("Delete currency")); + KMessageBox::sorry(this, i18n("Cannot delete currency %1. %2").tqarg(m_selectedCurrency.name()).tqarg(e->what()), i18n("Delete currency")); delete e; } } @@ -4088,7 +4088,7 @@ void KMyMoney2App::slotCurrencySetBase(void) MyMoneyFile::instance()->setBaseCurrency(m_selectedCurrency); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::sorry(this, i18n("Cannot set %1 as base currency: %2").arg(m_selectedCurrency.name()).arg(e->what()), i18n("Set base currency")); + KMessageBox::sorry(this, i18n("Cannot set %1 as base currency: %2").tqarg(m_selectedCurrency.name()).tqarg(e->what()), i18n("Set base currency")); delete e; } } @@ -4097,9 +4097,9 @@ void KMyMoney2App::slotCurrencySetBase(void) void KMyMoney2App::slotBudgetNew(void) { - QDate date = QDate::currentDate(Qt::LocalTime); + TQDate date = TQDate::tqcurrentDate(Qt::LocalTime); date.setYMD(date.year(), 1, 1); - QString newname = i18n("Budget %1").arg(QString::number(date.year())); + TQString newname = i18n("Budget %1").tqarg(TQString::number(date.year())); MyMoneyBudget budget; @@ -4109,7 +4109,7 @@ void KMyMoney2App::slotBudgetNew(void) // Exception thrown when the name is not found while (1) { MyMoneyFile::instance()->budgetByName(newname); - newname = i18n("Budget %1 (%2)").arg(QString::number(date.year()), QString::number(i++)); + newname = i18n("Budget %1 (%2)").tqarg(TQString::number(date.year()), TQString::number(i++)); } } catch(MyMoneyException *e) { // all ok, the name is unique @@ -4124,7 +4124,7 @@ void KMyMoney2App::slotBudgetNew(void) MyMoneyFile::instance()->addBudget(budget); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to add budget: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to add budget: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4137,9 +4137,9 @@ void KMyMoney2App::slotBudgetDelete(void) MyMoneyFile * file = MyMoneyFile::instance(); // get confirmation from user - QString prompt; + TQString prompt; if (m_selectedBudgets.size() == 1) - prompt = QString("

")+i18n("Do you really want to remove the budget %1?").arg(m_selectedBudgets.front().name()); + prompt = TQString("

")+i18n("Do you really want to remove the budget %1?").tqarg(m_selectedBudgets.front().name()); else prompt = i18n("Do you really want to remove all selected budgets?"); @@ -4149,14 +4149,14 @@ void KMyMoney2App::slotBudgetDelete(void) MyMoneyFileTransaction ft; try { // now loop over all selected budgets and remove them - for (QValueList::iterator it = m_selectedBudgets.begin(); + for (TQValueList::iterator it = m_selectedBudgets.begin(); it != m_selectedBudgets.end(); ++it) { file->removeBudget(*it); } ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to remove budget: %1, thrown in %2:%3"). arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to remove budget: %1, thrown in %2:%3"). tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4168,12 +4168,12 @@ void KMyMoney2App::slotBudgetCopy(void) try { MyMoneyBudget budget = m_selectedBudgets[0]; budget.clearId(); - budget.setName(i18n("Copy of %1").arg(budget.name())); + budget.setName(i18n("Copy of %1").tqarg(budget.name())); MyMoneyFile::instance()->addBudget(budget); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to add budget: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to add budget: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4182,12 +4182,12 @@ void KMyMoney2App::slotBudgetCopy(void) void KMyMoney2App::slotBudgetChangeYear(void) { if(m_selectedBudgets.size() == 1) { - QStringList years; + TQStringList years; int current = 0; bool haveCurrent = false; MyMoneyBudget budget = *(m_selectedBudgets.begin()); - for(int i = (QDate::currentDate().year()-3); i < (QDate::currentDate().year()+5); ++i) { - years << QString("%1").arg(i); + for(int i = (TQDate::tqcurrentDate().year()-3); i < (TQDate::tqcurrentDate().year()+5); ++i) { + years << TQString("%1").tqarg(i); if(i == budget.budgetStart().year()) { haveCurrent = true; } @@ -4198,11 +4198,11 @@ void KMyMoney2App::slotBudgetChangeYear(void) current = 0; bool ok = false; - QString yearString = KInputDialog::getItem(i18n("Select year"), i18n("Budget year"), years, current, false, &ok, this); + TQString yearString = KInputDialog::getItem(i18n("Select year"), i18n("Budget year"), years, current, false, &ok, this); if(ok) { int year = yearString.toInt(0, 0); - QDate newYear = QDate(year, 1, 1); + TQDate newYear = TQDate(year, 1, 1); if(newYear != budget.budgetStart()) { MyMoneyFileTransaction ft; try { @@ -4210,7 +4210,7 @@ void KMyMoney2App::slotBudgetChangeYear(void) MyMoneyFile::instance()->modifyBudget(budget); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify budget: %1, thrown in %2:%3"). arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify budget: %1, thrown in %2:%3"). tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4231,10 +4231,10 @@ void KMyMoney2App::slotBudgetForecast(void) } if(calcBudget) { - QDate historyStart; - QDate historyEnd; - QDate budgetStart; - QDate budgetEnd; + TQDate historyStart; + TQDate historyEnd; + TQDate budgetStart; + TQDate budgetEnd; budgetStart = budget.budgetStart(); budgetEnd = budgetStart.addYears(1).addDays(-1); @@ -4248,7 +4248,7 @@ void KMyMoney2App::slotBudgetForecast(void) ft.commit(); } } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify budget: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify budget: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4258,9 +4258,9 @@ void KMyMoney2App::slotKDELanguageSettings(void) { KMessageBox::information(this, i18n("Please be aware that changes made in the following dialog affect all KDE applications not only KMyMoney."), i18n("Warning"), "LanguageSettingsWarning"); - QStringList args; + TQStringList args; args << "language"; - QString error; + TQString error; int pid; KApplication::kdeinitExec("kcmshell", args, &error, &pid); @@ -4289,10 +4289,10 @@ void KMyMoney2App::slotNewFeature(void) } if(calcBudget) { - QDate historyStart; - QDate historyEnd; - QDate budgetStart; - QDate budgetEnd; + TQDate historyStart; + TQDate historyEnd; + TQDate budgetStart; + TQDate budgetEnd; budgetStart = budget.budgetStart(); budgetEnd = budgetStart.addYears(1).addDays(-1); @@ -4308,7 +4308,7 @@ void KMyMoney2App::slotNewFeature(void) ft.commit(); } } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify budget: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify budget: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4333,11 +4333,11 @@ void KMyMoney2App::slotTransactionsDelete(void) "DeleteReconciledTransaction") == KMessageBox::Cancel) return; } - QString msg; + TQString msg; if(m_selectedTransactions.count() == 1) { msg = i18n("Do you really want to delete the selected transaction?"); } else { - msg = i18n("Do you really want to delete all %1 selected transactions?").arg(m_selectedTransactions.count()); + msg = i18n("Do you really want to delete all %1 selected transactions?").tqarg(m_selectedTransactions.count()); } if(KMessageBox::questionYesNo(this, msg, i18n("Delete transaction")) == KMessageBox::Yes) { KMSTATUS(i18n("Deleting transactions")); @@ -4362,18 +4362,18 @@ void KMyMoney2App::slotTransactionDuplicate(void) try { for(it_t = list.begin(); it_t != list.end(); ++it_t) { MyMoneyTransaction t = (*it_t).transaction(); - QValueList::iterator it_s; + TQValueList::iterator it_s; // wipe out any reconciliation information for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { (*it_s).setReconcileFlag(MyMoneySplit::NotReconciled); - (*it_s).setReconcileDate(QDate()); - (*it_s).setBankID(QString()); + (*it_s).setReconcileDate(TQDate()); + (*it_s).setBankID(TQString()); } // clear invalid data - t.setEntryDate(QDate()); + t.setEntryDate(TQDate()); t.clearId(); // and set the post date to today - t.setPostDate(QDate::currentDate()); + t.setPostDate(TQDate::tqcurrentDate()); MyMoneyFile::instance()->addTransaction(t); lt = t; @@ -4386,7 +4386,7 @@ void KMyMoney2App::slotTransactionDuplicate(void) myMoneyView->slotLedgerSelected(m_selectedAccount.id(), lt.id()); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to duplicate transaction(s): %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to duplicate transaction(s): %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } // switch off the progress bar @@ -4412,7 +4412,7 @@ void KMyMoney2App::doDeleteTransactions(void) } ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to delete transaction(s): %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to delete transaction(s): %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } slotStatusProgressBar(-1, -1); @@ -4435,7 +4435,7 @@ void KMyMoney2App::slotTransactionsNew(void) // close the completion list payeeEdit->setCurrentText(d->m_lastPayeeEntered); payeeEdit->completion()->slotMakeCompletion(d->m_lastPayeeEntered); - QStringList payeeId; + TQStringList payeeId; payeeEdit->selector()->selectedItems(payeeId); if(payeeId.count() == 1) { payeeEdit->setSelectedItem(payeeId[0]); @@ -4444,10 +4444,10 @@ void KMyMoney2App::slotTransactionsNew(void) payeeEdit->completion()->hide(); } if(m_transactionEditor) { - connect(m_transactionEditor, SIGNAL(statusProgress(int, int)), this, SLOT(slotStatusProgressBar(int, int))); - connect(m_transactionEditor, SIGNAL(statusMsg(const QString&)), this, SLOT(slotStatusMsg(const QString&))); - connect(m_transactionEditor, SIGNAL(scheduleTransaction(const MyMoneyTransaction&, MyMoneySchedule::occurenceE)), this, SLOT(slotScheduleNew(const MyMoneyTransaction&, MyMoneySchedule::occurenceE))); - connect(m_transactionEditor, SIGNAL(transactionDataSufficient(bool)), this, SLOT(slotUpdateActions())); + connect(m_transactionEditor, TQT_SIGNAL(statusProgress(int, int)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusProgressBar(int, int))); + connect(m_transactionEditor, TQT_SIGNAL(statusMsg(const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotStatusMsg(const TQString&))); + connect(m_transactionEditor, TQT_SIGNAL(scheduleTransaction(const MyMoneyTransaction&, MyMoneySchedule::occurenceE)), TQT_TQOBJECT(this), TQT_SLOT(slotScheduleNew(const MyMoneyTransaction&, MyMoneySchedule::occurenceE))); + connect(m_transactionEditor, TQT_SIGNAL(transactionDataSufficient(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateActions())); } slotUpdateActions(); } @@ -4461,9 +4461,9 @@ void KMyMoney2App::slotTransactionsEdit(void) // if the action is enabled if(kmymoney2->action("transaction_edit")->isEnabled()) { // as soon as we edit a transaction, we don't remember the last payee entered - d->m_lastPayeeEntered = QString(); + d->m_lastPayeeEntered = TQString(); m_transactionEditor = myMoneyView->startEdit(m_selectedTransactions); - connect(m_transactionEditor, SIGNAL(transactionDataSufficient(bool)), this, SLOT(slotUpdateActions())); + connect(m_transactionEditor, TQT_SIGNAL(transactionDataSufficient(bool)), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateActions())); slotUpdateActions(); } } @@ -4483,20 +4483,20 @@ void KMyMoney2App::slotTransactionsEditSplits(void) // if the action is enabled if(kmymoney2->action("transaction_editsplits")->isEnabled()) { // as soon as we edit a transaction, we don't remember the last payee entered - d->m_lastPayeeEntered = QString(); + d->m_lastPayeeEntered = TQString(); m_transactionEditor = myMoneyView->startEdit(m_selectedTransactions); slotUpdateActions(); if(m_transactionEditor) { - if(m_transactionEditor->slotEditSplits() == QDialog::Accepted) { + if(m_transactionEditor->slotEditSplits() == TQDialog::Accepted) { MyMoneyFileTransaction ft; try { - QString id; - connect(m_transactionEditor, SIGNAL(balanceWarning(QWidget*, const MyMoneyAccount&, const QString&)), d->m_balanceWarning, SLOT(slotShowMessage(QWidget*, const MyMoneyAccount&, const QString&))); + TQString id; + connect(m_transactionEditor, TQT_SIGNAL(balanceWarning(TQWidget*, const MyMoneyAccount&, const TQString&)), d->m_balanceWarning, TQT_SLOT(slotShowMessage(TQWidget*, const MyMoneyAccount&, const TQString&))); m_transactionEditor->enterTransactions(id); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify transaction: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify transaction: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4526,9 +4526,9 @@ void KMyMoney2App::slotTransactionsEnter(void) if(kmymoney2->action("transaction_enter")->isEnabled()) { // qDebug("KMyMoney2App::slotTransactionsEnter"); if(m_transactionEditor) { - QString accountId = m_selectedAccount.id(); - QString newId; - connect(m_transactionEditor, SIGNAL(balanceWarning(QWidget*, const MyMoneyAccount&, const QString&)), d->m_balanceWarning, SLOT(slotShowMessage(QWidget*, const MyMoneyAccount&, const QString&))); + TQString accountId = m_selectedAccount.id(); + TQString newId; + connect(m_transactionEditor, TQT_SIGNAL(balanceWarning(TQWidget*, const MyMoneyAccount&, const TQString&)), d->m_balanceWarning, TQT_SLOT(slotShowMessage(TQWidget*, const MyMoneyAccount&, const TQString&))); if(m_transactionEditor->enterTransactions(newId)) { KMyMoneyPayeeCombo* payeeEdit = dynamic_cast(m_transactionEditor->haveWidget("payee")); if(payeeEdit && !newId.isEmpty()) { @@ -4549,7 +4549,7 @@ void KMyMoney2App::slotTransactionsCancelOrEnter(bool& okToSelect) static bool oneTime = false; if(!oneTime) { oneTime = true; - QString dontShowAgain = "CancelOrEditTransaction"; + TQString dontShowAgain = "CancelOrEditTransaction"; // qDebug("KMyMoney2App::slotCancelOrEndEdit"); if(m_transactionEditor) { if(KMyMoneyGlobalSettings::focusChangeIsEnter() && kmymoney2->action("transaction_enter")->isEnabled()) { @@ -4558,10 +4558,10 @@ void KMyMoney2App::slotTransactionsCancelOrEnter(bool& okToSelect) // okToSelect is preset to true if a cancel of the dialog is useful and false if it is not int rc; if(okToSelect == true) { - rc = KMessageBox::warningYesNoCancel(0, QString("

")+i18n("Do you really want to cancel editing this transaction without saving it?

- Yes cancels editing the transaction
- No saves the transaction prior to cancelling and
- Cancel returns to the transaction editor.

You can also select an option to save the transaction automatically when e.g. selecting another transaction."), i18n("Cancel transaction edit"), KStdGuiItem::yes(), KStdGuiItem::no(), dontShowAgain); + rc = KMessageBox::warningYesNoCancel(0, TQString("

")+i18n("Do you really want to cancel editing this transaction without saving it?

- Yes cancels editing the transaction
- No saves the transaction prior to cancelling and
- Cancel returns to the transaction editor.

You can also select an option to save the transaction automatically when e.g. selecting another transaction."), i18n("Cancel transaction edit"), KStdGuiItem::yes(), KStdGuiItem::no(), dontShowAgain); } else { - rc = KMessageBox::warningYesNo(0, QString("

")+i18n("Do you really want to cancel editing this transaction without saving it?

- Yes cancels editing the transaction
- No saves the transaction prior to cancelling.

You can also select an option to save the transaction automatically when e.g. selecting another transaction."), i18n("Cancel transaction edit"), KStdGuiItem::yes(), KStdGuiItem::no(), dontShowAgain); + rc = KMessageBox::warningYesNo(0, TQString("

")+i18n("Do you really want to cancel editing this transaction without saving it?

- Yes cancels editing the transaction
- No saves the transaction prior to cancelling.

You can also select an option to save the transaction automatically when e.g. selecting another transaction."), i18n("Cancel transaction edit"), KStdGuiItem::yes(), KStdGuiItem::no(), dontShowAgain); } switch(rc) { @@ -4666,7 +4666,7 @@ void KMyMoney2App::markTransaction(MyMoneySplit::reconcileFlagE flag) slotStatusProgressBar(-1, -1); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify transaction: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to modify transaction: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4686,8 +4686,8 @@ void KMyMoney2App::slotTransactionsAccept(void) if(t.isImported()) { t.setImported(false); if(!m_selectedAccount.id().isEmpty()) { - QValueList list = t.splits(); - QValueList::const_iterator it_s; + TQValueList list = t.splits(); + TQValueList::const_iterator it_s; for(it_s = list.begin(); it_s != list.end(); ++it_s) { if((*it_s).accountId() == m_selectedAccount.id()) { if((*it_s).reconcileFlag() == MyMoneySplit::NotReconciled) { @@ -4711,7 +4711,7 @@ void KMyMoney2App::slotTransactionsAccept(void) slotStatusProgressBar(-1, -1); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to accept transaction: %1, thrown in %2:%3").arg(e->what()).arg(e->file()).arg(e->line())); + KMessageBox::detailedSorry(0, i18n("Error"), i18n("Unable to accept transaction: %1, thrown in %2:%3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); delete e; } } @@ -4720,13 +4720,13 @@ void KMyMoney2App::slotTransactionGotoAccount(void) { if(!m_accountGoto.isEmpty()) { try { - QString transactionId; + TQString transactionId; if(m_selectedTransactions.count() == 1) { transactionId = m_selectedTransactions[0].transaction().id(); } // make sure to pass a copy, as myMoneyView->slotLedgerSelected() overrides // m_accountGoto while calling slotUpdateActions() - QString accountId = m_accountGoto; + TQString accountId = m_accountGoto; myMoneyView->slotLedgerSelected(accountId, transactionId); } catch(MyMoneyException* e) { delete e; @@ -4738,14 +4738,14 @@ void KMyMoney2App::slotTransactionGotoPayee(void) { if(!m_payeeGoto.isEmpty()) { try { - QString transactionId; + TQString transactionId; if(m_selectedTransactions.count() == 1) { transactionId = m_selectedTransactions[0].transaction().id(); } // make sure to pass copies, as myMoneyView->slotPayeeSelected() overrides // m_payeeGoto and m_selectedAccount while calling slotUpdateActions() - QString payeeId = m_payeeGoto; - QString accountId = m_selectedAccount.id(); + TQString payeeId = m_payeeGoto; + TQString accountId = m_selectedAccount.id(); myMoneyView->slotPayeeSelected(payeeId, accountId, transactionId); } catch(MyMoneyException* e) { delete e; @@ -4759,20 +4759,20 @@ void KMyMoney2App::slotTransactionCreateSchedule(void) // make sure to have the current selected split as first split in the schedule MyMoneyTransaction t = m_selectedTransactions[0].transaction(); MyMoneySplit s = m_selectedTransactions[0].split(); - QString splitId = s.id(); + TQString splitId = s.id(); s.clearId(); s.setReconcileFlag(MyMoneySplit::NotReconciled); - s.setReconcileDate(QDate()); + s.setReconcileDate(TQDate()); t.removeSplits(); t.addSplit(s); - const QValueList& splits = m_selectedTransactions[0].transaction().splits(); - QValueList::const_iterator it_s; + const TQValueList& splits = m_selectedTransactions[0].transaction().splits(); + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { if((*it_s).id() != splitId) { MyMoneySplit s0 = (*it_s); s0.clearId(); s0.setReconcileFlag(MyMoneySplit::NotReconciled); - s0.setReconcileDate(QDate()); + s0.setReconcileDate(TQDate()); t.addSplit(s0); } } @@ -4791,10 +4791,10 @@ void KMyMoney2App::slotTransactionCombine(void) qDebug("slotTransactionCombine() not implemented yet"); } -void KMyMoney2App::slotMoveToAccount(const QString& id) +void KMyMoney2App::slotMoveToAccount(const TQString& id) { // close the menu, if it is still open - QWidget* w = factory()->container("transaction_move_menu", this); + TQWidget* w = factory()->container("transaction_move_menu", this); if(w) { if(w->isVisible()) { w->close(); @@ -4810,7 +4810,7 @@ void KMyMoney2App::slotMoveToAccount(const QString& id) d->moveInvestmentTransaction(m_selectedAccount.id(), id, (*it_t).transaction()); } else { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; bool changed = false; MyMoneyTransaction t = (*it_t).transaction(); for(it_s = (*it_t).transaction().splits().begin(); it_s != (*it_t).transaction().splits().end(); ++it_s) { @@ -4834,17 +4834,17 @@ void KMyMoney2App::slotMoveToAccount(const QString& id) } // move a stock transaction from one investment account to another -void KMyMoney2App::Private::moveInvestmentTransaction(const QString& fromId, - const QString& toId, +void KMyMoney2App::Private::moveInvestmentTransaction(const TQString& fromId, + const TQString& toId, const MyMoneyTransaction& tx) { MyMoneyAccount toInvAcc = MyMoneyFile::instance()->account(toId); MyMoneyTransaction t(tx); // first determine which stock we are dealing with. // fortunately, investment transactions have only one stock involved - QString stockAccountId; - QString stockSecurityId; - QValueList::const_iterator it_s; + TQString stockAccountId; + TQString stockSecurityId; + TQValueList::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { stockAccountId = (*it_s).accountId(); stockSecurityId = @@ -4854,9 +4854,9 @@ void KMyMoney2App::Private::moveInvestmentTransaction(const QString& fromId, } // Now check the target investment account to see if it // contains a stock with this id - QString newStockAccountId = QString(); - QStringList accountList = toInvAcc.accountList(); - QStringList::const_iterator it_a; + TQString newStockAccountId = TQString(); + TQStringList accountList = toInvAcc.accountList(); + TQStringList::const_iterator it_a; for (it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { if (MyMoneyFile::instance()->account((*it_a)).currencyId() == stockSecurityId) { @@ -4915,7 +4915,7 @@ void KMyMoney2App::slotUpdateMoveToAccountMenu(void) // remove those accounts that we currently reference KMyMoneyRegister::SelectedTransactions::const_iterator it_t; for(it_t = m_selectedTransactions.begin(); it_t != m_selectedTransactions.end(); ++it_t) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = (*it_t).transaction().splits().begin(); it_s != (*it_t).transaction().splits().end(); ++it_s) { d->m_moveToAccountSelector->removeItem((*it_s).accountId()); } @@ -4924,8 +4924,8 @@ void KMyMoney2App::slotUpdateMoveToAccountMenu(void) // in a different currency // also remove the selected account itself //(for investments, which will not have been removed above) - QStringList list = d->m_moveToAccountSelector->accountList(); - QValueList::const_iterator it_a; + TQStringList list = d->m_moveToAccountSelector->accountList(); + TQValueList::const_iterator it_a; for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.currencyId() != m_selectedAccount.currencyId()) @@ -4992,7 +4992,7 @@ void KMyMoney2App::transactionMatch(void) KMergeTransactionsDlg dlg(m_selectedAccount); dlg.addTransaction(startMatchTransaction); dlg.addTransaction(endMatchTransaction); - if (dlg.exec() == QDialog::Accepted) + if (dlg.exec() == TQDialog::Accepted) #endif { MyMoneyFileTransaction ft; @@ -5016,12 +5016,12 @@ void KMyMoney2App::transactionMatch(void) } -void KMyMoney2App::showContextMenu(const QString& containerName) +void KMyMoney2App::showContextMenu(const TQString& containerName) { - QWidget* w = factory()->container(containerName, this); - QPopupMenu *menu = dynamic_cast(w); + TQWidget* w = factory()->container(containerName, this); + TQPopupMenu *menu = dynamic_cast(w); if(menu) - menu->exec(QCursor::pos()); + menu->exec(TQCursor::pos()); } void KMyMoney2App::slotShowTransactionContextMenu(void) @@ -5092,7 +5092,7 @@ void KMyMoney2App::slotPrintView(void) void KMyMoney2App::updateCaption(bool skipActions) { - QString caption; + TQString caption; caption = m_fileName.filename(false); @@ -5113,7 +5113,7 @@ void KMyMoney2App::updateCaption(bool skipActions) } #if KMM_DEBUG - caption += QString(" (%1 x %2)").arg(width()).arg(height()); + caption += TQString(" (%1 x %2)").tqarg(width()).tqarg(height()); #endif caption = kapp->makeStdCaption(caption, false, modified); @@ -5133,7 +5133,7 @@ void KMyMoney2App::slotUpdateActions(void) MyMoneyFile* file = MyMoneyFile::instance(); bool fileOpen = myMoneyView->fileOpen(); bool modified = file->dirty(); - QWidget* w; + TQWidget* w; action("open_database")->setEnabled(true); action("saveas_database")->setEnabled(fileOpen); @@ -5211,7 +5211,7 @@ void KMyMoney2App::slotUpdateActions(void) action("budget_copy")->setEnabled(false); action("budget_forecast")->setEnabled(false); - QString tooltip = i18n("Create a new transaction"); + TQString tooltip = i18n("Create a new transaction"); action("transaction_new")->setEnabled(fileOpen && myMoneyView->canCreateTransactions(KMyMoneyRegister::SelectedTransactions(), tooltip)); action("transaction_new")->setToolTip(tooltip); @@ -5348,23 +5348,23 @@ void KMyMoney2App::slotUpdateActions(void) action("transaction_assign_number")->setEnabled(m_transactionEditor->canAssignNumber()); action("transaction_new")->setEnabled(false); action("transaction_delete")->setEnabled(false); - QString reason; + TQString reason; action("transaction_enter")->setEnabled(m_transactionEditor->isComplete(reason)); action("transaction_enter")->setToolTip(reason); action("transaction_cancel")->setEnabled(true); } } - QValueList accList; + TQValueList accList; file->accountList(accList); - QValueList::const_iterator it_a; - QMap::const_iterator it_p = m_onlinePlugins.end(); + TQValueList::const_iterator it_a; + TQMap::const_iterator it_p = m_onlinePlugins.end(); for(it_a = accList.begin(); (it_p == m_onlinePlugins.end()) && (it_a != accList.end()); ++it_a) { if ( !(*it_a).onlineBankingSettings().value("provider").isEmpty() ) { // check if provider is available - it_p = m_onlinePlugins.find((*it_a).onlineBankingSettings().value("provider")); + it_p = m_onlinePlugins.tqfind((*it_a).onlineBankingSettings().value("provider")); if(it_p != m_onlinePlugins.end()) { - QStringList protocols; + TQStringList protocols; (*it_p)->protocols(protocols); if(protocols.count() > 0) { action("account_online_update_all")->setEnabled(true); @@ -5406,10 +5406,10 @@ void KMyMoney2App::slotUpdateActions(void) if ( !m_selectedAccount.onlineBankingSettings().value("provider").isEmpty() ) { action("account_online_unmap")->setEnabled(true); // check if provider is available - QMap::const_iterator it_p; - it_p = m_onlinePlugins.find(m_selectedAccount.onlineBankingSettings().value("provider")); + TQMap::const_iterator it_p; + it_p = m_onlinePlugins.tqfind(m_selectedAccount.onlineBankingSettings().value("provider")); if(it_p != m_onlinePlugins.end()) { - QStringList protocols; + TQStringList protocols; (*it_p)->protocols(protocols); if(protocols.count() > 0) { action("account_online_update")->setEnabled(true); @@ -5516,8 +5516,8 @@ void KMyMoney2App::slotResetSelections(void) slotSelectInvestment(); slotSelectSchedule(); slotSelectCurrency(); - slotSelectPayees(QValueList()); - slotSelectBudget(QValueList()); + slotSelectPayees(TQValueList()); + slotSelectBudget(TQValueList()); slotSelectTransactions(KMyMoneyRegister::SelectedTransactions()); slotUpdateActions(); } @@ -5529,14 +5529,14 @@ void KMyMoney2App::slotSelectCurrency(const MyMoneySecurity& currency) emit currencySelected(m_selectedCurrency); } -void KMyMoney2App::slotSelectBudget(const QValueList& list) +void KMyMoney2App::slotSelectBudget(const TQValueList& list) { m_selectedBudgets = list; slotUpdateActions(); emit budgetSelected(m_selectedBudgets); } -void KMyMoney2App::slotSelectPayees(const QValueList& list) +void KMyMoney2App::slotSelectPayees(const TQValueList& list) { m_selectedPayees = list; slotUpdateActions(); @@ -5554,8 +5554,8 @@ void KMyMoney2App::slotSelectTransactions(const KMyMoneyRegister::SelectedTransa m_selectedTransactions.clear(); m_selectedSchedule = MyMoneySchedule(); - m_accountGoto = QString(); - m_payeeGoto = QString(); + m_accountGoto = TQString(); + m_payeeGoto = TQString(); if(list.count() > 0 && !list.first().isScheduled()) { m_selectedTransactions = list; if(list.count() == 1) { @@ -5565,16 +5565,16 @@ void KMyMoney2App::slotSelectTransactions(const KMyMoneyRegister::SelectedTransa MyMoneyPayee payee = MyMoneyFile::instance()->payee(sp.payeeId()); if(!payee.name().isEmpty()) { m_payeeGoto = payee.id(); - QString name = payee.name(); - name.replace(QRegExp("&(?!&)"), "&&"); - action("transaction_goto_payee")->setText(i18n("Goto '%1'").arg(name)); + TQString name = payee.name(); + name.tqreplace(TQRegExp("&(?!&)"), "&&"); + action("transaction_goto_payee")->setText(i18n("Goto '%1'").tqarg(name)); } } catch(MyMoneyException *e) { delete e; } } try { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; const MyMoneyTransaction& t = m_selectedTransactions[0].transaction(); // search the first non-income/non-expense accunt and use it for the 'goto account' const MyMoneySplit& sp = m_selectedTransactions[0].split(); @@ -5584,12 +5584,12 @@ void KMyMoney2App::slotSelectTransactions(const KMyMoneyRegister::SelectedTransa if(!acc.isIncomeExpense()) { // for stock accounts we show the portfolio account if(acc.isInvest()) { - acc = MyMoneyFile::instance()->account(acc.parentAccountId()); + acc = MyMoneyFile::instance()->account(acc.tqparentAccountId()); } m_accountGoto = acc.id(); - QString name = acc.name(); - name.replace(QRegExp("&(?!&)"), "&&"); - action("transaction_goto_account")->setText(i18n("Goto '%1'").arg(name)); + TQString name = acc.name(); + name.tqreplace(TQRegExp("&(?!&)"), "&&"); + action("transaction_goto_account")->setText(i18n("Goto '%1'").tqarg(name)); break; } } @@ -5678,12 +5678,12 @@ void KMyMoney2App::slotDataChanged(void) void KMyMoney2App::slotCurrencyDialog(void) { KCurrencyEditDlg dlg(this, "Currency Editor"); - connect(&dlg, SIGNAL(selectObject(const MyMoneySecurity&)), this, SLOT(slotSelectCurrency(const MyMoneySecurity&))); - connect(&dlg, SIGNAL(openContextMenu(const MyMoneySecurity&)), this, SLOT(slotShowCurrencyContextMenu())); - connect(this, SIGNAL(currencyRename()), &dlg, SLOT(slotStartRename())); - connect(&dlg, SIGNAL(renameCurrency(QListViewItem*, int, const QString&)), this, SLOT(slotCurrencyRename(QListViewItem*,int,const QString&))); - connect(this, SIGNAL(currencyCreated(const QString&)), &dlg, SLOT(slotSelectCurrency(const QString&))); - connect(&dlg, SIGNAL(selectBaseCurrency(const MyMoneySecurity&)), this, SLOT(slotCurrencySetBase())); + connect(&dlg, TQT_SIGNAL(selectObject(const MyMoneySecurity&)), TQT_TQOBJECT(this), TQT_SLOT(slotSelectCurrency(const MyMoneySecurity&))); + connect(&dlg, TQT_SIGNAL(openContextMenu(const MyMoneySecurity&)), TQT_TQOBJECT(this), TQT_SLOT(slotShowCurrencyContextMenu())); + connect(TQT_TQOBJECT(this), TQT_SIGNAL(currencyRename()), &dlg, TQT_SLOT(slotStartRename())); + connect(&dlg, TQT_SIGNAL(renameCurrency(TQListViewItem*, int, const TQString&)), TQT_TQOBJECT(this), TQT_SLOT(slotCurrencyRename(TQListViewItem*,int,const TQString&))); + connect(TQT_TQOBJECT(this), TQT_SIGNAL(currencyCreated(const TQString&)), &dlg, TQT_SLOT(slotSelectCurrency(const TQString&))); + connect(&dlg, TQT_SIGNAL(selectBaseCurrency(const MyMoneySecurity&)), TQT_TQOBJECT(this), TQT_SLOT(slotCurrencySetBase())); dlg.exec(); @@ -5700,13 +5700,13 @@ void KMyMoney2App::slotFileConsitencyCheck(void) { KMSTATUS(i18n("Running consistency check...")); - QStringList msg; + TQStringList msg; MyMoneyFileTransaction ft; try { msg = MyMoneyFile::instance()->consistencyCheck(); ft.commit(); } catch(MyMoneyException *e) { - msg = i18n("Consistency check failed: %1").arg(e->what()); + msg = i18n("Consistency check failed: %1").tqarg(e->what()); delete e; } @@ -5721,10 +5721,10 @@ void KMyMoney2App::slotCheckSchedules(void) KMSTATUS(i18n("Checking for overdue scheduled transactions...")); MyMoneyFile *file = MyMoneyFile::instance(); - QDate checkDate = QDate::currentDate().addDays(KMyMoneyGlobalSettings::checkSchedulePreview()); + TQDate checkDate = TQDate::tqcurrentDate().addDays(KMyMoneyGlobalSettings::checkSchedulePreview()); - QValueList scheduleList = file->scheduleList(); - QValueList::Iterator it; + TQValueList scheduleList = file->scheduleList(); + TQValueList::Iterator it; KMyMoneyUtils::EnterScheduleResultCodeE rc = KMyMoneyUtils::Enter; for (it=scheduleList.begin(); (it != scheduleList.end()) && (rc != KMyMoneyUtils::Cancel); ++it) { @@ -5748,7 +5748,7 @@ void KMyMoney2App::slotCheckSchedules(void) } } -void KMyMoney2App::writeLastUsedDir(const QString& directory) +void KMyMoney2App::writeLastUsedDir(const TQString& directory) { //get global config object for our app. KConfig *kconfig = KGlobal::config(); @@ -5761,7 +5761,7 @@ void KMyMoney2App::writeLastUsedDir(const QString& directory) } } -void KMyMoney2App::writeLastUsedFile(const QString& fileName) +void KMyMoney2App::writeLastUsedFile(const TQString& fileName) { //get global config object for our app. KConfig *kconfig = KGlobal::config(); @@ -5776,9 +5776,9 @@ void KMyMoney2App::writeLastUsedFile(const QString& fileName) } } -QString KMyMoney2App::readLastUsedDir(void) const +TQString KMyMoney2App::readLastUsedDir(void) const { - QString str; + TQString str; //get global config object for our app. KConfig *kconfig = KGlobal::config(); @@ -5796,9 +5796,9 @@ QString KMyMoney2App::readLastUsedDir(void) const return str; } -QString KMyMoney2App::readLastUsedFile(void) const +TQString KMyMoney2App::readLastUsedFile(void) const { - QString str; + TQString str; // get global config object for our app. KConfig *kconfig = KGlobal::config(); @@ -5813,22 +5813,22 @@ QString KMyMoney2App::readLastUsedFile(void) const return str; } -const QString KMyMoney2App::filename(void) const +const TQString KMyMoney2App::filename(void) const { return m_fileName.url(); } -const QValueList KMyMoney2App::instanceList(void) const +const TQValueList KMyMoney2App::instanceList(void) const { - QValueList list; - QValueList apps = kapp->dcopClient()->registeredApplications(); - QValueList::ConstIterator it; + TQValueList list; + TQValueList apps = kapp->dcopClient()->registeredApplications(); + TQValueList::ConstIterator it; for(it = apps.begin(); it != apps.end(); ++it) { // skip over myself if((*it) == kapp->dcopClient()->appId()) continue; - if((*it).find("kmymoney-") == 0) { + if((*it).tqfind("kmymoney-") == 0) { list += (*it); } } @@ -5838,11 +5838,11 @@ const QValueList KMyMoney2App::instanceList(void) const void KMyMoney2App::slotEquityPriceUpdate(void) { KEquityPriceUpdateDlg dlg(this); - if(dlg.exec() == QDialog::Accepted) + if(dlg.exec() == TQDialog::Accepted) dlg.storePrices(); } -void KMyMoney2App::webConnect(const QString& url, const QCString& asn_id) +void KMyMoney2App::webConnect(const TQString& url, const TQCString& asn_id) { // // Web connect attempts to go through the known importers and see if the file @@ -5867,15 +5867,15 @@ void KMyMoney2App::webConnect(const QString& url, const QCString& asn_id) // remove the statement files d->unlinkStatementXML(); - QMap::const_iterator it_plugin = m_importerPlugins.begin(); + TQMap::const_iterator it_plugin = m_importerPlugins.begin(); while ( it_plugin != m_importerPlugins.end() ) { if ( (*it_plugin)->isMyFormat(url) ) { - QValueList statements; + TQValueList statements; if (!(*it_plugin)->import(url) ) { - KMessageBox::error( this, i18n("Unable to import %1 using %2 plugin. The plugin returned the following error: %3").arg(url,(*it_plugin)->formatName(),(*it_plugin)->lastError()), i18n("Importing error")); + KMessageBox::error( this, i18n("Unable to import %1 using %2 plugin. The plugin returned the following error: %3").tqarg(url,(*it_plugin)->formatName(),(*it_plugin)->lastError()), i18n("Importing error")); } break; @@ -5908,7 +5908,7 @@ void KMyMoney2App::slotSecurityEditor(void) void KMyMoney2App::createInterfaces(void) { // Sets up the plugin interface, and load the plugins - m_pluginInterface = new QObject( this, "_pluginInterface" ); + m_pluginInterface = new TQObject( this, "_pluginInterface" ); new KMyMoneyPlugin::KMMViewInterface(this, myMoneyView, m_pluginInterface, "view interface"); new KMyMoneyPlugin::KMMStatementInterface(this, m_pluginInterface, "statement interface"); @@ -5917,10 +5917,10 @@ void KMyMoney2App::createInterfaces(void) void KMyMoney2App::loadPlugins(void) { - d->m_pluginLoader = new KMyMoneyPlugin::PluginLoader(this); + d->m_pluginLoader = new KMyMoneyPlugin::PluginLoader(TQT_TQOBJECT(this)); - connect( d->m_pluginLoader, SIGNAL( plug(KPluginInfo*) ), this, SLOT( slotPluginPlug(KPluginInfo*) ) ); - connect( d->m_pluginLoader, SIGNAL( unplug(KPluginInfo*) ), this, SLOT( slotPluginUnplug(KPluginInfo*) ) ); + connect( d->m_pluginLoader, TQT_SIGNAL( plug(KPluginInfo*) ), TQT_TQOBJECT(this), TQT_SLOT( slotPluginPlug(KPluginInfo*) ) ); + connect( d->m_pluginLoader, TQT_SIGNAL( unplug(KPluginInfo*) ), TQT_TQOBJECT(this), TQT_SLOT( slotPluginUnplug(KPluginInfo*) ) ); d->m_pluginLoader->loadPlugins(); } @@ -5987,22 +5987,22 @@ void KMyMoney2App::slotAutoSave(void) void KMyMoney2App::slotDateChanged(void) { - QDateTime dt = QDateTime::currentDateTime(); - QDateTime nextDay( QDate(dt.date().addDays(1)), QTime(0, 0, 0) ); + TQDateTime dt = TQDateTime::tqcurrentDateTime(); + TQDateTime nextDay( TQDate(dt.date().addDays(1)), TQTime(0, 0, 0) ); - QTimer::singleShot(dt.secsTo(nextDay)*1000, this, SLOT(slotDateChanged())); + TQTimer::singleShot(dt.secsTo(nextDay)*1000, TQT_TQOBJECT(this), TQT_SLOT(slotDateChanged())); myMoneyView->slotRefreshViews(); } -const MyMoneyAccount& KMyMoney2App::account(const QString& key, const QString& value) const +const MyMoneyAccount& KMyMoney2App::account(const TQString& key, const TQString& value) const { - QValueList list; - QValueList::const_iterator it_a; + TQValueList list; + TQValueList::const_iterator it_a; MyMoneyFile::instance()->accountList(list); - QValueList accList; + TQValueList accList; for(it_a = list.begin(); it_a != list.end(); ++it_a) { - const QString& id = (*it_a).onlineBankingSettings().value(key); - if(id.contains(value)) { + const TQString& id = (*it_a).onlineBankingSettings().value(key); + if(id.tqcontains(value)) { accList << MyMoneyFile::instance()->account((*it_a).id()); } if(id == value) { @@ -6016,7 +6016,7 @@ const MyMoneyAccount& KMyMoney2App::account(const QString& key, const QString& v } // return reference to empty element - return MyMoneyFile::instance()->account(QString()); + return MyMoneyFile::instance()->account(TQString()); } void KMyMoney2App::setAccountOnlineParameters(const MyMoneyAccount& _acc, const MyMoneyKeyValueContainer& kvps) @@ -6029,7 +6029,7 @@ void KMyMoney2App::setAccountOnlineParameters(const MyMoneyAccount& _acc, const ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::detailedSorry(0, i18n("Unable to setup online parameters for account ''%1'").arg(_acc.name()), e->what() ); + KMessageBox::detailedSorry(0, i18n("Unable to setup online parameters for account ''%1'").tqarg(_acc.name()), e->what() ); delete e; } } @@ -6044,7 +6044,7 @@ void KMyMoney2App::slotAccountUnmapOnline(void) if(m_selectedAccount.onlineBankingSettings().value("provider").isEmpty()) return; - if(KMessageBox::warningYesNo(this, QString("%1").arg(i18n("Do you really want to remove the mapping of account %1 to an online account? Depending on the details of the online banking method used, this action cannot be reverted.").arg(m_selectedAccount.name())), i18n("Remove mapping to online account")) == KMessageBox::Yes) { + if(KMessageBox::warningYesNo(this, TQString("%1").tqarg(i18n("Do you really want to remove the mapping of account %1 to an online account? Depending on the details of the online banking method used, this action cannot be reverted.").tqarg(m_selectedAccount.name())), i18n("Remove mapping to online account")) == KMessageBox::Yes) { MyMoneyFileTransaction ft; try { m_selectedAccount.setOnlineBankingSettings(MyMoneyKeyValueContainer()); @@ -6055,7 +6055,7 @@ void KMyMoney2App::slotAccountUnmapOnline(void) MyMoneyFile::instance()->modifyAccount(m_selectedAccount); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::error(this, i18n("Unable to unmap account from online account: %1").arg(e->what())); + KMessageBox::error(this, i18n("Unable to unmap account from online account: %1").tqarg(e->what())); delete e; } } @@ -6072,7 +6072,7 @@ void KMyMoney2App::slotAccountMapOnline(void) return; // check if user tries to map a brokerageAccount - if(m_selectedAccount.name().contains(i18n(" (Brokerage)"))) { + if(m_selectedAccount.name().tqcontains(i18n(" (Brokerage)"))) { if(KMessageBox::warningContinueCancel(this, i18n("You try to map a brokerage account to an online account. This is usually not advisable. In general, the investment account should be mapped to the online account. Please cancel if you intended to map the investment account, continue otherwise"), i18n("Mapping brokerage account")) == KMessageBox::Cancel) { return; } @@ -6082,8 +6082,8 @@ void KMyMoney2App::slotAccountMapOnline(void) KPluginDlg dlg(this); dlg.setCaption(i18n("Select online banking plugin")); dlg.closeButton->hide(); - QString provider; - QMap::const_iterator it_p; + TQString provider; + TQMap::const_iterator it_p; switch(m_onlinePlugins.count()) { case 0: break; @@ -6092,11 +6092,11 @@ void KMyMoney2App::slotAccountMapOnline(void) break; default: for(it_p = m_onlinePlugins.begin(); it_p != m_onlinePlugins.end(); ++it_p) { - QStringList protocolList; + TQStringList protocolList; (*it_p)->protocols(protocolList); new KListViewItem(dlg.m_listView, it_p.key(), "Loaded", protocolList.join(", ")); } - if(dlg.exec() == QDialog::Accepted) { + if(dlg.exec() == TQDialog::Accepted) { if(dlg.m_listView->selectedItem()) { provider = dlg.m_listView->selectedItem()->text(0); } @@ -6108,7 +6108,7 @@ void KMyMoney2App::slotAccountMapOnline(void) return; // find the provider - it_p = m_onlinePlugins.find(provider); + it_p = m_onlinePlugins.tqfind(provider); if(it_p != m_onlinePlugins.end()) { // plugin found, call it MyMoneyKeyValueContainer settings; @@ -6121,7 +6121,7 @@ void KMyMoney2App::slotAccountMapOnline(void) MyMoneyFile::instance()->modifyAccount(acc); ft.commit(); } catch(MyMoneyException* e) { - KMessageBox::error(this, i18n("Unable to map account to online account: %1").arg(e->what())); + KMessageBox::error(this, i18n("Unable to map account to online account: %1").tqarg(e->what())); delete e; } } @@ -6130,10 +6130,10 @@ void KMyMoney2App::slotAccountMapOnline(void) void KMyMoney2App::slotAccountUpdateOnlineAll(void) { - QValueList accList; + TQValueList accList; MyMoneyFile::instance()->accountList(accList); - QValueList::iterator it_a; - QMap::const_iterator it_p; + TQValueList::iterator it_a; + TQMap::const_iterator it_p; d->m_statementResults.clear(); d->m_collectingStatements = true; @@ -6141,7 +6141,7 @@ void KMyMoney2App::slotAccountUpdateOnlineAll(void) // provider is not currently present for(it_a = accList.begin(); it_a != accList.end();) { if ((*it_a).onlineBankingSettings().value("provider").isEmpty() - || m_onlinePlugins.find((*it_a).onlineBankingSettings().value("provider")) == m_onlinePlugins.end() ) { + || m_onlinePlugins.tqfind((*it_a).onlineBankingSettings().value("provider")) == m_onlinePlugins.end() ) { it_a = accList.remove(it_a); } else ++it_a; @@ -6150,7 +6150,7 @@ void KMyMoney2App::slotAccountUpdateOnlineAll(void) // now work on the remaining list of accounts int cnt = accList.count() - 1; for(it_a = accList.begin(); it_a != accList.end(); ++it_a) { - it_p = m_onlinePlugins.find((*it_a).onlineBankingSettings().value("provider")); + it_p = m_onlinePlugins.tqfind((*it_a).onlineBankingSettings().value("provider")); (*it_p)->updateAccount(*it_a, cnt != 0); --cnt; } @@ -6171,8 +6171,8 @@ void KMyMoney2App::slotAccountUpdateOnline(void) return; // find the provider - QMap::const_iterator it_p; - it_p = m_onlinePlugins.find(m_selectedAccount.onlineBankingSettings().value("provider")); + TQMap::const_iterator it_p; + it_p = m_onlinePlugins.tqfind(m_selectedAccount.onlineBankingSettings().value("provider")); if(it_p != m_onlinePlugins.end()) { // plugin found, call it d->m_collectingStatements = true; @@ -6184,22 +6184,22 @@ void KMyMoney2App::slotAccountUpdateOnline(void) } } -KMStatus::KMStatus (const QString &text) +KMtqStatus::KMtqStatus (const TQString &text) { m_prevText = kmymoney2->slotStatusMsg(text); } -KMStatus::~KMStatus() +KMtqStatus::~KMtqStatus() { kmymoney2->slotStatusMsg(m_prevText); } void KMyMoney2App::Private::unlinkStatementXML(void) { - QDir d("/home/thb", "kmm-statement*"); + TQDir d("/home/thb", "kmm-statement*"); for(int i=0; i < d.count(); ++i) { qDebug("Remove %s", d[i].data()); - d.remove(QString("/home/thb/%1").arg(d[i])); + d.remove(TQString("/home/thb/%1").tqarg(d[i])); } statementXMLindex = 0; } diff --git a/kmymoney2/kmymoney2.h b/kmymoney2/kmymoney2.h index 77d5c86..e63d861 100644 --- a/kmymoney2/kmymoney2.h +++ b/kmymoney2/kmymoney2.h @@ -23,9 +23,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QTimer; -class QLabel; +#include +class TQTimer; +class TQLabel; // ---------------------------------------------------------------------------- // KDE Includes @@ -53,7 +53,7 @@ class KPushButton; #include #include -class QSignalMapper; +class TQSignalMapper; class KProgress; class KMyMoneyView; class MyMoneyQifReader; @@ -96,14 +96,15 @@ namespace KMyMoneyPlugin { class ImporterPlugin; } class KMyMoney2App : public KMainWindow, public DCOPObject { Q_OBJECT +// TQ_OBJECT K_DCOP protected slots: - void slotFileSaveAsFilterChanged(const QString& filter); + void slotFileSaveAsFilterChanged(const TQString& filter); /** * This slot is intended to be used as part of auto saving. This is used when the - * QTimer emits the timeout signal and simply checks that the file is dirty (has + * TQTimer emits the timeout signal and simply checks that the file is dirty (has * received modifications to it's contents), and call the apropriate method to * save the file. Furthermore, re-starts the timer (possibly not needed). * @author mvillarino 2005 @@ -149,7 +150,7 @@ protected slots: void slotQifImport(void); /** - * Called when a QIF import is finished. + * Called when a TQIF import is finished. */ void slotQifImportFinished(void); @@ -179,7 +180,7 @@ protected slots: /** * Called when the user wishes to export some transaction to a - * QIF formatted file. An account must be open for this to work. + * TQIF formatted file. An account must be open for this to work. * Uses MyMoneyQifWriter() for the actual output. */ void slotQifExport(void); @@ -229,17 +230,17 @@ protected slots: /** * Brings up the new category editor and saves the information. - * The dialog will be preset with the name. The parent defaults to + * The dialog will be preset with the name. The tqparent defaults to * MyMoneyFile::expense() * * @param name Name of the account to be created. Could include a full hierarchy * @param id reference to storage which will receive the id after successful creation * * @note Typically, this slot can be connected to the - * StdTransactionEditor::createCategory(const QString&, QString&) or - * KMyMoneyCombo::createItem(const QString&, QString&) signal. + * StdTransactionEditor::createCategory(const TQString&, TQString&) or + * KMyMoneyCombo::createItem(const TQString&, TQString&) signal. */ - void slotCategoryNew(const QString& name, QString& id); + void slotCategoryNew(const TQString& name, TQString& id); /** * Calls the print logic for the current view @@ -252,9 +253,9 @@ protected slots: void slotInvestmentNew(void); /** - * Create a new investment in a given @p parent investment account + * Create a new investment in a given @p tqparent investment account */ - void slotInvestmentNew(MyMoneyAccount& account, const MyMoneyAccount& parent); + void slotInvestmentNew(MyMoneyAccount& account, const MyMoneyAccount& tqparent); /** * This slot opens the investment editor to edit the currently @@ -284,7 +285,7 @@ protected slots: /** */ - void slotPayeeNew(const QString& newnameBase, QString& id); + void slotPayeeNew(const TQString& newnameBase, TQString& id); void slotPayeeNew(void); /** @@ -317,7 +318,7 @@ protected slots: /** */ - void slotCurrencyRename(QListViewItem* item, int, const QString& txt); + void slotCurrencyRename(TQListViewItem* item, int, const TQString& txt); /** */ @@ -418,7 +419,7 @@ protected slots: */ void slotDataChanged(void); - void slotMoveToAccount(const QString& id); + void slotMoveToAccount(const TQString& id); void slotUpdateMoveToAccountMenu(void); @@ -463,7 +464,7 @@ public: /** * construtor of KMyMoney2App, calls all init functions to create the application. */ - KMyMoney2App(QWidget* parent=0, const char* name=0); + KMyMoney2App(TQWidget* tqparent=0, const char* name=0); /** * Destructor @@ -473,12 +474,12 @@ public: /** Init wizard dialog */ bool initWizard(void); - static void progressCallback(int current, int total, const QString&); + static void progressCallback(int current, int total, const TQString&); - void writeLastUsedDir(const QString& directory); - QString readLastUsedDir(void) const; - void writeLastUsedFile(const QString& fileName); - QString readLastUsedFile(void) const; + void writeLastUsedDir(const TQString& directory); + TQString readLastUsedDir(void) const; + void writeLastUsedFile(const TQString& fileName); + TQString readLastUsedFile(void) const; /** * Returns whether there is an importer available that can handle this file @@ -499,9 +500,9 @@ public: * This method returns a list of all 'other' dcop registered kmymoney processes. * It's a subset of the return of DCOPclient()->registeredApplications(). * - * @retval QStringList of process ids + * @retval TQStringList of process ids */ - const QValueList instanceList(void) const; + const TQValueList instanceList(void) const; /** * Dump a list of the names of all defined KActions to stdout. @@ -512,21 +513,21 @@ public: * Popup the context menu with the respective @p containerName. * Valid container names are defined in kmymoney2ui.rc */ - void showContextMenu(const QString& containerName); + void showContextMenu(const TQString& containerName); /** * This method opens the category editor with the data found in @a account. The - * parent account is preset to @a parent but can be modified. If the user + * tqparent account is preset to @a tqparent but can be modified. If the user * acknowledges, the category is created. */ - void createCategory(MyMoneyAccount& account, const MyMoneyAccount& parent); + void createCategory(MyMoneyAccount& account, const MyMoneyAccount& tqparent); /** * This method returns the account for a given @a key - @a value pair. * If the account is not found in the list of accounts, MyMoneyAccount() * is returned. */ - const MyMoneyAccount& account(const QString& key, const QString& value) const; + const MyMoneyAccount& account(const TQString& key, const TQString& value) const; /** * This method set the online parameters stored in @a kvps with the @@ -534,18 +535,18 @@ public: */ void setAccountOnlineParameters(const MyMoneyAccount& acc, const MyMoneyKeyValueContainer& kvps); - KURL selectFile(const QString& title, const QString& path, const QString& mask, KFile::Mode mode); + KURL selectFile(const TQString& title, const TQString& path, const TQString& tqmask, KFile::Mode mode); - const MyMoneyAccount& findAccount(const MyMoneyAccount& acc, const MyMoneyAccount& parent) const; + const MyMoneyAccount& findAccount(const MyMoneyAccount& acc, const MyMoneyAccount& tqparent) const; - void createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& parentAccount, MyMoneyAccount& brokerageAccount, MyMoneyMoney openingBal); + void createAccount(MyMoneyAccount& newAccount, MyMoneyAccount& tqparentAccount, MyMoneyAccount& brokerageAccount, MyMoneyMoney openingBal); k_dcop: // Note: Don't use e.g. filename(void) but use filename() because // otherwise the kidl compiler produces uncompilable results. - const QString filename() const; + const TQString filename() const; - void webConnect(const QString&, const QCString& asn_id); + void webConnect(const TQString&, const TQCString& asn_id); /** * Checks if the file with the @a url already exists. If so, @@ -555,10 +556,10 @@ k_dcop: */ bool okToWriteFile(const KURL& url); - // QValueList accountList() const; + // TQValueList accountList() const; protected: - /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration + /** save general Options like all bar positions and status as well as the tqgeometry and the recent file list to the configuration * file */ void saveOptions(void); @@ -607,7 +608,7 @@ protected: void slotCheckSchedules(void); - virtual void resizeEvent(QResizeEvent*); + virtual void resizeEvent(TQResizeEvent*); void createSchedule(MyMoneySchedule newSchedule, MyMoneyAccount& newAccount); @@ -616,7 +617,7 @@ protected: * can be closed if: * * - the balance is zero and - * - all children are already closed and + * - all tqchildren are already closed and * - there is no unfinished schedule referencing the account * * @param acc reference to MyMoneyAccount object in question @@ -634,7 +635,7 @@ protected: * @retval true object has been found * @retval false object is not in list */ - bool payeeInList(const QValueList& list, const QString& id) const; + bool payeeInList(const TQValueList& list, const TQString& id) const; /** * Mark the selected transactions as provided by @a flag. If @@ -774,7 +775,7 @@ public slots: * * @param text the text that is displayed in the statusbar */ - const QString slotStatusMsg(const QString &text); + const TQString slotStatusMsg(const TQString &text); /** * This method changes the progress bar in the status line according @@ -810,7 +811,7 @@ public slots: * Essentially similiar to the above slot, except this will load the file * from disk first, given the URL. */ - bool slotStatementImport(const QString& url); + bool slotStatementImport(const TQString& url); /** * This slot starts the reconciliation of the currently selected account @@ -857,17 +858,17 @@ public slots: * This slot reparents account @p src to be a child of account @p dest * * @param src account to be reparented - * @param dest new parent + * @param dest new tqparent */ - void slotReparentAccount(const MyMoneyAccount& src, const MyMoneyAccount& dest); + void slotRetqparentAccount(const MyMoneyAccount& src, const MyMoneyAccount& dest); /** * This slot reparents account @p src to be a held at institution @p dest * * @param src account to be reparented - * @param dest new parent institution + * @param dest new tqparent institution */ - void slotReparentAccount(const MyMoneyAccount& src, const MyMoneyInstitution& dest); + void slotRetqparentAccount(const MyMoneyAccount& src, const MyMoneyInstitution& dest); /** * This slot creates a transaction report for the selected account @@ -966,9 +967,9 @@ public slots: void slotSelectSchedule(const MyMoneySchedule& schedule = MyMoneySchedule()); - void slotSelectPayees(const QValueList& list); + void slotSelectPayees(const TQValueList& list); - void slotSelectBudget(const QValueList& list); + void slotSelectBudget(const TQValueList& list); void slotSelectTransactions(const KMyMoneyRegister::SelectedTransactions& list); @@ -989,15 +990,15 @@ public slots: /** * Brings up the new category editor and saves the information. - * The dialog will be preset with the name and parent account. + * The dialog will be preset with the name and tqparent account. * * @param account reference of category to be created. The @p name member * should be filled by the caller. The object will be filled * with additional information during the creation process * esp. the @p id member. - * @param parent reference to parent account (defaults to none) + * @param tqparent reference to tqparent account (defaults to none) */ - void slotCategoryNew(MyMoneyAccount& account, const MyMoneyAccount& parent = MyMoneyAccount()); + void slotCategoryNew(MyMoneyAccount& account, const MyMoneyAccount& tqparent = MyMoneyAccount()); /** * This method updates all KAction items to the current state. @@ -1063,7 +1064,7 @@ private: * into references to account @a toId. Returns @a true if at least * one split has been changed, @a false otherwise. */ - bool exchangeAccountInTransaction(MyMoneyTransaction& _t, const QString& fromId, const QString& toId); + bool exchangeAccountInTransaction(MyMoneyTransaction& _t, const TQString& fromId, const TQString& toId); signals: /** @@ -1075,15 +1076,15 @@ signals: /** * This signal is emitted when a payee/list of payees has been selected by * the GUI. If no payee is selected or the selection is removed, - * @p payees is identical to an empty QValueList. This signal is used + * @p payees is identical to an empty TQValueList. This signal is used * by plugins to get information about changes. */ - void payeesSelected(const QValueList& payees); + void payeesSelected(const TQValueList& payees); /** * This signal is emitted when a transaction/list of transactions has been selected by * the GUI. If no transaction is selected or the selection is removed, - * @p transactions is identical to an empty QValueList. This signal is used + * @p transactions is identical to an empty TQValueList. This signal is used * by plugins to get information about changes. */ void transactionsSelected(const KMyMoneyRegister::SelectedTransactions& transactions); @@ -1097,10 +1098,10 @@ signals: /** * This signal is emitted when a list of budgets has been selected by * the GUI. If no budget is selected or the selection is removed, - * @a budget is identical to an empty QValueList. This signal is used + * @a budget is identical to an empty TQValueList. This signal is used * by plugins to get information about changes. */ - void budgetSelected(const QValueList& budget); + void budgetSelected(const TQValueList& budget); void budgetRename(void); /** @@ -1137,10 +1138,10 @@ signals: void currencySelected(const MyMoneySecurity& currency); void payeeRename(void); - void payeeCreated(const QString& id); + void payeeCreated(const TQString& id); void currencyRename(void); - void currencyCreated(const QString& id); + void currencyCreated(const TQString& id); void startMatchTransaction(const MyMoneyTransaction& t); void cancelMatchTransaction(void); @@ -1154,10 +1155,10 @@ signals: * @param date the reconciliation date as provided through the dialog * @param startingBalance the starting balance as provided through the dialog * @param endingBalance the ending balance as provided through the dialog - * @param transactionList reference to QValueList of QPair containing all + * @param transactionList reference to TQValueList of TQPair containing all * transaction/split pairs processed by the reconciliation. */ - void accountReconciled(const MyMoneyAccount& account, const QDate& date, const MyMoneyMoney& startingBalance, const MyMoneyMoney& endingBalance, const QValueList >& transactionList); + void accountReconciled(const MyMoneyAccount& account, const TQDate& date, const MyMoneyMoney& startingBalance, const MyMoneyMoney& endingBalance, const TQValueList >& transactionList); public: /** @@ -1169,7 +1170,7 @@ public: * @param actionName name of the action to be retrieved * @return pointer to KAction object (or derivative) */ - KAction* action(const QString& actionName) const; + KAction* action(const TQString& actionName) const; /** * This method is implemented for convenience. It returns a dynamic_cast-ed @@ -1178,7 +1179,7 @@ public: * is not of type KToggleAction, a pointer to a static non-configured * KToggleAction object is returned and a warning is printed to stderr. */ - KToggleAction* toggleAction(const QString& actionName) const; + KToggleAction* toggleAction(const TQString& actionName) const; private: @@ -1195,9 +1196,9 @@ private: /** the configuration object of the application */ KConfig *config; - QMap m_importerPlugins; + TQMap m_importerPlugins; - QMap m_onlinePlugins; + TQMap m_onlinePlugins; enum backupStateE { BACKUP_IDLE = 0, @@ -1236,11 +1237,11 @@ private: KURL m_fileName; bool m_startDialog; - QString m_mountpoint; + TQString m_mountpoint; KProgress* progressBar; - QString m_statusMsg; + TQString m_statusMsg; int m_progressUpdate; int m_nextUpdate; @@ -1254,7 +1255,7 @@ private: KToolBarPopupAction* m_previousViewButton; KToolBarPopupAction* m_nextViewButton; - QObject* m_pluginInterface; + TQObject* m_pluginInterface; MyMoneyAccount m_selectedAccount; MyMoneyAccount m_reconciliationAccount; @@ -1262,13 +1263,13 @@ private: MyMoneyInstitution m_selectedInstitution; MyMoneySchedule m_selectedSchedule; MyMoneySecurity m_selectedCurrency; - QValueList m_selectedPayees; - QValueList m_selectedBudgets; + TQValueList m_selectedPayees; + TQValueList m_selectedBudgets; KMyMoneyRegister::SelectedTransactions m_selectedTransactions; // This is Auto Saving related bool m_autoSaveEnabled; - QTimer* m_autoSaveTimer; + TQTimer* m_autoSaveTimer; int m_autoSavePeriod; bool m_inAutoSaving; @@ -1283,24 +1284,24 @@ private: KEndingBalanceDlg* m_endingBalanceDlg; // id's that need to be remembered - QString m_accountGoto, m_payeeGoto; + TQString m_accountGoto, m_payeeGoto; - QStringList m_additionalGpgKeys; - QLabel* m_additionalKeyLabel; + TQStringList m_additionalGpgKeys; + TQLabel* m_additionalKeyLabel; KPushButton* m_additionalKeyButton; }; extern KMyMoney2App *kmymoney2; -class KMStatus +class KMtqStatus { public: - KMStatus (const QString &text); - ~KMStatus(); + KMtqStatus (const TQString &text); + ~KMtqStatus(); private: - QString m_prevText; + TQString m_prevText; }; -#define KMSTATUS(msg) KMStatus _thisStatus(msg) +#define KMSTATUS(msg) KMtqStatus _thistqStatus(msg) #endif // KMYMONEY2_H diff --git a/kmymoney2/kmymoneyglobalsettings.cpp b/kmymoney2/kmymoneyglobalsettings.cpp index 2dcd964..8daaa2f 100644 --- a/kmymoney2/kmymoneyglobalsettings.cpp +++ b/kmymoney2/kmymoneyglobalsettings.cpp @@ -17,7 +17,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -29,7 +29,7 @@ #include -QFont KMyMoneyGlobalSettings::listCellFont(void) +TQFont KMyMoneyGlobalSettings::listCellFont(void) { if(useSystemFont()) { return KGlobalSettings::generalFont(); @@ -38,10 +38,10 @@ QFont KMyMoneyGlobalSettings::listCellFont(void) } } -QFont KMyMoneyGlobalSettings::listHeaderFont(void) +TQFont KMyMoneyGlobalSettings::listHeaderFont(void) { if(useSystemFont()) { - QFont font = KGlobalSettings::generalFont(); + TQFont font = KGlobalSettings::generalFont(); font.setBold(true); return font; } else { @@ -49,7 +49,7 @@ QFont KMyMoneyGlobalSettings::listHeaderFont(void) } } -QColor KMyMoneyGlobalSettings::listColor(void) +TQColor KMyMoneyGlobalSettings::listColor(void) { if(useSystemColors()) return KGlobalSettings::baseColor(); @@ -57,7 +57,7 @@ QColor KMyMoneyGlobalSettings::listColor(void) return KMyMoneySettings::listColor(); } -QColor KMyMoneyGlobalSettings::listBGColor(void) +TQColor KMyMoneyGlobalSettings::listBGColor(void) { if(useSystemColors()) return KGlobalSettings::alternateBackgroundColor(); @@ -65,19 +65,19 @@ QColor KMyMoneyGlobalSettings::listBGColor(void) return KMyMoneySettings::listBGColor(); } -QStringList KMyMoneyGlobalSettings::itemList(void) +TQStringList KMyMoneyGlobalSettings::itemList(void) { bool prevValue = self()->useDefaults(true); - QStringList all = QStringList::split(",", KMyMoneySettings::itemList()); + TQStringList all = TQStringList::split(",", KMyMoneySettings::itemList()); self()->useDefaults(prevValue); - QStringList list = QStringList::split(",", KMyMoneySettings::itemList()); + TQStringList list = TQStringList::split(",", KMyMoneySettings::itemList()); // now add all from 'all' that are missing in 'list' - QRegExp exp("-?(\\d+)"); - QStringList::iterator it_s; + TQRegExp exp("-?(\\d+)"); + TQStringList::iterator it_s; for(it_s = all.begin(); it_s != all.end(); ++it_s) { exp.search(*it_s); - if(!list.contains(exp.cap(1)) && !list.contains(QString("-%1").arg(exp.cap(1)))) { + if(!list.tqcontains(exp.cap(1)) && !list.tqcontains(TQString("-%1").tqarg(exp.cap(1)))) { list << *it_s; } } diff --git a/kmymoney2/kmymoneyglobalsettings.h b/kmymoney2/kmymoneyglobalsettings.h index 16ca4a2..6ef9c1b 100644 --- a/kmymoney2/kmymoneyglobalsettings.h +++ b/kmymoney2/kmymoneyglobalsettings.h @@ -35,11 +35,11 @@ class KMyMoneyGlobalSettings : public KMyMoneySettings { public: - static QFont listCellFont(void); - static QFont listHeaderFont(void); - static QColor listColor(void); - static QColor listBGColor(void); - static QStringList itemList(void); + static TQFont listCellFont(void); + static TQFont listHeaderFont(void); + static TQColor listColor(void); + static TQColor listBGColor(void); + static TQStringList itemList(void); static int firstFiscalMonth(void); static int firstFiscalDay(void); }; diff --git a/kmymoney2/kmymoneytest.cpp b/kmymoney2/kmymoneytest.cpp index f3c7222..fd89b69 100644 --- a/kmymoney2/kmymoneytest.cpp +++ b/kmymoney2/kmymoneytest.cpp @@ -21,7 +21,7 @@ #include /* required for Q_UNUSED( ) */ -#include +#include #ifdef HAVE_LIBCPPUNIT @@ -63,7 +63,7 @@ #include "reports/pivottabletest.h" #include "reports/pivotgridtest.h" -#include "reports/querytabletest.h" +#include "reports/tquerytabletest.h" #include "converter/convertertest.h" @@ -72,12 +72,12 @@ class MyProgressListener : public CppUnit::TextTestProgressListener { void startTest(CppUnit::Test *test) { - QString name = test->getName().c_str(); - if(name.find('.') != -1) { // in CPPUNIT 1.8.0 + TQString name = test->getName().c_str(); + if(name.tqfind('.') != -1) { // in CPPUNIT 1.8.0 name = name.mid(2); // cut off first 2 chars - name = name.left(name.find('.')); - } else if(name.find("::") != -1) { // in CPPUNIT 1.9.14 - name = name.left(name.find("::")); + name = name.left(name.tqfind('.')); + } else if(name.tqfind("::") != -1) { // in CPPUNIT 1.9.14 + name = name.left(name.tqfind("::")); } if(m_name != name) { if(m_name != "") @@ -87,7 +87,7 @@ class MyProgressListener : public CppUnit::TextTestProgressListener } } private: - QString m_name; + TQString m_name; }; void unexpectedException(MyMoneyException *e) diff --git a/kmymoney2/kmymoneyutils.cpp b/kmymoney2/kmymoneyutils.cpp index 83cf113..fdff861 100644 --- a/kmymoney2/kmymoneyutils.cpp +++ b/kmymoney2/kmymoneyutils.cpp @@ -51,15 +51,15 @@ KMyMoneyUtils::~KMyMoneyUtils() { } -const QString KMyMoneyUtils::accountTypeToString(const MyMoneyAccount::accountTypeE accountType) +const TQString KMyMoneyUtils::accountTypeToString(const MyMoneyAccount::accountTypeE accountType) { return MyMoneyAccount::accountTypeToString(accountType); } -MyMoneyAccount::accountTypeE KMyMoneyUtils::stringToAccountType(const QString& type) +MyMoneyAccount::accountTypeE KMyMoneyUtils::stringToAccountType(const TQString& type) { MyMoneyAccount::accountTypeE rc = MyMoneyAccount::UnknownAccountType; - QString tmp = type.lower(); + TQString tmp = type.lower(); if(tmp == i18n("Checking").lower()) rc = MyMoneyAccount::Checkings; @@ -97,10 +97,10 @@ MyMoneyAccount::accountTypeE KMyMoneyUtils::stringToAccountType(const QString& t return rc; } -MyMoneySecurity::eSECURITYTYPE KMyMoneyUtils::stringToSecurity(const QString& txt) +MyMoneySecurity::eSECURITYTYPE KMyMoneyUtils::stringToSecurity(const TQString& txt) { MyMoneySecurity::eSECURITYTYPE rc = MyMoneySecurity::SECURITY_NONE; - QString tmp = txt.lower(); + TQString tmp = txt.lower(); if(tmp == i18n("Stock").lower()) rc = MyMoneySecurity::SECURITY_STOCK; @@ -114,27 +114,27 @@ MyMoneySecurity::eSECURITYTYPE KMyMoneyUtils::stringToSecurity(const QString& tx return rc; } -const QString KMyMoneyUtils::securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType) +const TQString KMyMoneyUtils::securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType) { return i18n(MyMoneySecurity::securityTypeToString(securityType)); } -const QString KMyMoneyUtils::occurenceToString(const MyMoneySchedule::occurenceE occurence) +const TQString KMyMoneyUtils::occurenceToString(const MyMoneySchedule::occurenceE occurence) { return i18n(MyMoneySchedule::occurenceToString(occurence)); } -const QString KMyMoneyUtils::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) +const TQString KMyMoneyUtils::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) { return i18n(MyMoneySchedule::paymentMethodToString(paymentType)); } -const QString KMyMoneyUtils::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) +const TQString KMyMoneyUtils::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) { return i18n(MyMoneySchedule::weekendOptionToString(weekendOption)); } -const QString KMyMoneyUtils::scheduleTypeToString(MyMoneySchedule::typeE type) +const TQString KMyMoneyUtils::scheduleTypeToString(MyMoneySchedule::typeE type) { return i18n(MyMoneySchedule::scheduleTypeToString(type)); } @@ -144,7 +144,7 @@ KGuiItem KMyMoneyUtils::scheduleNewGuiItem(void) KIconLoader *ic = KGlobal::iconLoader(); KGuiItem splitGuiItem( i18n("&New Schedule..."), - QIconSet(ic->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(ic->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), i18n("Create a new schedule."), i18n("Use this to create a new schedule.")); @@ -156,32 +156,32 @@ KGuiItem KMyMoneyUtils::accountsFilterGuiItem(void) KIconLoader *ic = KGlobal::iconLoader(); KGuiItem splitGuiItem( i18n("&Filter"), - QIconSet(ic->loadIcon("filter", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(ic->loadIcon("filter", KIcon::Small, KIcon::SizeSmall)), i18n("Filter out accounts"), i18n("Use this to filter out accounts")); return splitGuiItem; } -QPixmap KMyMoneyUtils::billScheduleIcon(int size) +TQPixmap KMyMoneyUtils::billScheduleIcon(int size) { KIconLoader *ic = KGlobal::iconLoader(); return ic->loadIcon("billschedule", KIcon::User, size); } -QPixmap KMyMoneyUtils::depositScheduleIcon(int size) +TQPixmap KMyMoneyUtils::depositScheduleIcon(int size) { KIconLoader *ic = KGlobal::iconLoader(); return ic->loadIcon("depositschedule", KIcon::User, size); } -QPixmap KMyMoneyUtils::transferScheduleIcon(int size) +TQPixmap KMyMoneyUtils::transferScheduleIcon(int size) { KIconLoader *ic = KGlobal::iconLoader(); return ic->loadIcon("transferschedule", KIcon::User, size); } -QPixmap KMyMoneyUtils::scheduleIcon(int size) +TQPixmap KMyMoneyUtils::scheduleIcon(int size) { KIconLoader *ic = KGlobal::iconLoader(); return ic->loadIcon("schedule", KIcon::User, size); @@ -202,16 +202,16 @@ const char* homePageItems[] = { 0 }; -const QString KMyMoneyUtils::homePageItemToString(const int idx) +const TQString KMyMoneyUtils::homePageItemToString(const int idx) { - QString rc; + TQString rc; if(abs(idx) > 0 && abs(idx) < static_cast(sizeof(homePageItems)/sizeof(homePageItems[0]))) { rc = i18n(homePageItems[abs(idx-1)]); } return rc; } -int KMyMoneyUtils::stringToHomePageItem(const QString& txt) +int KMyMoneyUtils::stringToHomePageItem(const TQString& txt) { int idx = 0; for(idx = 0; homePageItems[idx] != 0; ++idx) { @@ -221,20 +221,20 @@ int KMyMoneyUtils::stringToHomePageItem(const QString& txt) return 0; } -bool KMyMoneyUtils::appendCorrectFileExt(QString& str, const QString& strExtToUse) +bool KMyMoneyUtils::appendCorrectFileExt(TQString& str, const TQString& strExtToUse) { bool rc = false; if(!str.isEmpty()) { //find last . delminator - int nLoc = str.findRev('.'); + int nLoc = str.tqfindRev('.'); if(nLoc != -1) { - QString strExt, strTemp; + TQString strExt, strTemp; strTemp = str.left(nLoc + 1); strExt = str.right(str.length() - (nLoc + 1)); - if(strExt.find(strExtToUse, 0, FALSE) == -1) { + if(strExt.tqfind(strExtToUse, 0, FALSE) == -1) { // if the extension given contains a period, we remove our's - if(strExtToUse.find('.') != -1) + if(strExtToUse.tqfind('.') != -1) strTemp = strTemp.left(strTemp.length()-1); //append extension to make complete file name strTemp.append(strExtToUse); @@ -259,45 +259,45 @@ void KMyMoneyUtils::checkConstants(void) Q_ASSERT(static_cast(KLocale::AfterMoney) == static_cast(MyMoneyMoney::AfterMoney)); } -QString KMyMoneyUtils::variableCSS(void) +TQString KMyMoneyUtils::variableCSS(void) { - QColor tcolor = KGlobalSettings::textColor(); + TQColor tcolor = KGlobalSettings::textColor(); - QString css; + TQString css; css += "\n"; return css; } -QString KMyMoneyUtils::findResource(const char* type, const QString& filename) +TQString KMyMoneyUtils::findResource(const char* type, const TQString& filename) { - QString language = KGlobal::locale()->language(); - QString country = KGlobal::locale()->country(); - QString rc, mask; + TQString language = KGlobal::locale()->language(); + TQString country = KGlobal::locale()->country(); + TQString rc, tqmask; // check that the placeholder is present - if(!filename.find("%1")) { + if(!filename.tqfind("%1")) { qWarning("%%1 not found in '%s'", filename.latin1()); return filename; } // search the given resource - mask = filename.arg("_%1.%2"); - rc = KGlobal::dirs()->findResource(type, mask.arg(country).arg(language)); + tqmask = filename.tqarg("_%1.%2"); + rc = KGlobal::dirs()->findResource(type, tqmask.tqarg(country).tqarg(language)); if(rc.isEmpty()) { - mask = filename.arg("_%1"); - rc = KGlobal::dirs()->findResource(type, mask.arg(language)); + tqmask = filename.tqarg("_%1"); + rc = KGlobal::dirs()->findResource(type, tqmask.tqarg(language)); } if(rc.isEmpty()) { - // qDebug(QString("html/home_%1.html not found").arg(country).latin1()); - rc = KGlobal::dirs()->findResource(type, mask.arg(country)); + // qDebug(TQString("html/home_%1.html not found").tqarg(country).latin1()); + rc = KGlobal::dirs()->findResource(type, tqmask.tqarg(country)); } if(rc.isEmpty()) { - rc = KGlobal::dirs()->findResource(type, filename.arg("")); + rc = KGlobal::dirs()->findResource(type, filename.tqarg("")); } if(rc.isEmpty()) { @@ -308,7 +308,7 @@ QString KMyMoneyUtils::findResource(const char* type, const QString& filename) const MyMoneySplit KMyMoneyUtils::stockSplit(const MyMoneyTransaction& t) { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; MyMoneySplit investmentAccountSplit; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if(!(*it_s).accountId().isEmpty()) { @@ -341,7 +341,7 @@ KMyMoneyUtils::transactionTypeE KMyMoneyUtils::transactionType(const MyMoneyTran // FIXME check for loan transaction here return SplitTransaction; } - QString ida, idb; + TQString ida, idb; ida = t.splits()[0].accountId(); idb = t.splits()[1].accountId(); if(ida.isEmpty() || idb.isEmpty()) @@ -358,7 +358,7 @@ KMyMoneyUtils::transactionTypeE KMyMoneyUtils::transactionType(const MyMoneyTran return Normal; } -void KMyMoneyUtils::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap& balances) +void KMyMoneyUtils::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const TQMap& balances) { try { MyMoneyForecast::calculateAutoLoan(schedule, transaction, balances); @@ -368,22 +368,22 @@ void KMyMoneyUtils::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTr } } -QString KMyMoneyUtils::nextCheckNumber(const MyMoneyAccount& acc) +TQString KMyMoneyUtils::nextCheckNumber(const MyMoneyAccount& acc) { // determine next check number - QString number; - QRegExp exp(QString("(.*\\D)?(\\d+)(\\D.*)?")); + TQString number; + TQRegExp exp(TQString("(.*\\D)?(\\d+)(\\D.*)?")); if(exp.search(acc.value("lastNumberUsed")) != -1) { - number = QString("%1%2%3").arg(exp.cap(1)).arg(exp.cap(2).toULongLong() + 1).arg(exp.cap(3)); + number = TQString("%1%2%3").tqarg(exp.cap(1)).tqarg(exp.cap(2).toULongLong() + 1).tqarg(exp.cap(3)); } else { number = "1"; } return number; } -QString KMyMoneyUtils::reconcileStateToString(MyMoneySplit::reconcileFlagE flag, bool text) +TQString KMyMoneyUtils::reconcileStateToString(MyMoneySplit::reconcileFlagE flag, bool text) { - QString txt; + TQString txt; if(text) { switch(flag) { case MyMoneySplit::NotReconciled: @@ -429,7 +429,7 @@ MyMoneyTransaction KMyMoneyUtils::scheduledTransaction(const MyMoneySchedule& sc try { if (schedule.type() == MyMoneySchedule::TYPE_LOANPAYMENT) { - calculateAutoLoan(schedule, t, QMap()); + calculateAutoLoan(schedule, t, TQMap()); } } catch (MyMoneyException* e) { qDebug("Unable to load schedule details for '%s' during transaction match: %s", schedule.name().data(), e->what().data()); @@ -437,13 +437,13 @@ MyMoneyTransaction KMyMoneyUtils::scheduledTransaction(const MyMoneySchedule& sc } t.clearId(); - t.setEntryDate(QDate()); + t.setEntryDate(TQDate()); return t; } -void KMyMoneyUtils::previouslyUsedCategories(const QString& investmentAccount, QString& feesId, QString& interestId) +void KMyMoneyUtils::previouslyUsedCategories(const TQString& investmentAccount, TQString& feesId, TQString& interestId) { - feesId = interestId = QString(); + feesId = interestId = TQString(); MyMoneyFile* file = MyMoneyFile::instance(); try { MyMoneyAccount acc = file->account(investmentAccount); @@ -451,15 +451,15 @@ void KMyMoneyUtils::previouslyUsedCategories(const QString& investmentAccount, Q filter.setReportAllSplits(false); // since we assume an investment account here, we need to collect the stock accounts as well filter.addAccount(acc.accountList()); - QValueList< QPair > list; + TQValueList< TQPair > list; file->transactionList(list, filter); - QValueList< QPair >::const_iterator it_t; + TQValueList< TQPair >::const_iterator it_t; for(it_t = list.begin(); it_t != list.end(); ++it_t) { const MyMoneyTransaction& t = (*it_t).first; const MyMoneySplit&s = (*it_t).second; MyMoneySplit assetAccountSplit; - QValueList feeSplits; - QValueList interestSplits; + TQValueList feeSplits; + TQValueList interestSplits; MyMoneySecurity security; MyMoneySecurity currency; MyMoneySplit::investTransactionTypeE transactionType; diff --git a/kmymoney2/kmymoneyutils.h b/kmymoney2/kmymoneyutils.h index 8acb5c4..c6054e5 100644 --- a/kmymoney2/kmymoneyutils.h +++ b/kmymoney2/kmymoneyutils.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Headers @@ -50,11 +50,11 @@ class KMyMoneyUtils { public: /** - * This enum is used to describe the bits of an account type filter mask. + * This enum is used to describe the bits of an account type filter tqmask. * Each bit is used to define a specific account class. Multiple classes * can be specified by OR'ing multiple entries. The special entry @p last - * marks the left most bit in the mask and is used by scanners of this - * bitmask to determine the end of processing. + * marks the left most bit in the tqmask and is used by scanners of this + * bittqmask to determine the end of processing. */ enum categoryTypeE { none = 0x00, ///< no account class selected @@ -63,7 +63,7 @@ public: expense = 0x04, ///< expense accounts selected income = 0x08, ///< income accounts selected equity = 0x10, ///< equity accounts selected - last = 0x20 ///< the leftmost bit in the mask + last = 0x20 ///< the leftmost bit in the tqmask }; enum transactionTypeE { @@ -126,31 +126,31 @@ public: * * @param accountType numerical representation of the account type. * For possible values, see MyMoneyAccount::accountTypeE - * @return QString representing the human readable form translated according to the language cataglogue + * @return TQString representing the human readable form translated according to the language cataglogue * * @sa MyMoneyAccount::accountTypeToString() */ - static const QString accountTypeToString(const MyMoneyAccount::accountTypeE accountType); + static const TQString accountTypeToString(const MyMoneyAccount::accountTypeE accountType); /** * This method is used to convert an account type from it's * string form to the internal used numeric value. * - * @param type reference to a QString containing the string to convert + * @param type reference to a TQString containing the string to convert * @return accountTypeE containing the internal used numeric value. For possible * values see MyMoneyAccount::accountTypeE */ - static MyMoneyAccount::accountTypeE stringToAccountType(const QString& type); + static MyMoneyAccount::accountTypeE stringToAccountType(const TQString& type); /** * This method is used to convert a security type from it's * string form to the internal used numeric value. * - * @param txt reference to a QString containing the string to convert + * @param txt reference to a TQString containing the string to convert * @return eSECURITYTYPE containing the internal used numeric value. For possible * values see MyMoneySecurity::eSECURITYTYPE */ - static MyMoneySecurity::eSECURITYTYPE stringToSecurity(const QString& txt); + static MyMoneySecurity::eSECURITYTYPE stringToSecurity(const TQString& txt); /** * This method is used to convert the internal representation of @@ -158,11 +158,11 @@ public: * * @param securityType enumerated representation of the security type. * For possible values, see MyMoneySecurity::eSECURITYTYPE - * @return QString representing the human readable form translated according to the language cataglogue + * @return TQString representing the human readable form translated according to the language cataglogue * * @sa MyMoneySecurity::securityTypeToString() */ - static const QString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType); + static const TQString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType); /** * This method is used to convert the occurence type from it's @@ -171,13 +171,13 @@ public: * @param occurence numerical representation of the MyMoneySchedule * occurence type * - * @return QString representing the human readable format translated according to the language cataglogue + * @return TQString representing the human readable format translated according to the language cataglogue * * @sa MyMoneySchedule::occurenceToString() * * @deprecated Use i18n(MyMoneySchedule::occurenceToString(occurence)) instead */ - static const QString occurenceToString(const MyMoneySchedule::occurenceE occurence); + static const TQString occurenceToString(const MyMoneySchedule::occurenceE occurence); /** * This method is used to convert the payment type from it's @@ -186,11 +186,11 @@ public: * @param paymentType numerical representation of the MyMoneySchedule * payment type * - * @return QString representing the human readable format translated according to the language cataglogue + * @return TQString representing the human readable format translated according to the language cataglogue * * @sa MyMoneySchedule::paymentMethodToString() */ - static const QString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType); + static const TQString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType); /** * This method is used to convert the schedule weekend option from it's @@ -199,11 +199,11 @@ public: * @param weekendOption numerical representation of the MyMoneySchedule * weekend option * - * @return QString representing the human readable format translated according to the language cataglogue + * @return TQString representing the human readable format translated according to the language cataglogue * * @sa MyMoneySchedule::weekendOptionToString() */ - static const QString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption); + static const TQString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption); /** * This method is used to convert the schedule type from it's @@ -212,11 +212,11 @@ public: * @param type numerical representation of the MyMoneySchedule * schedule type * - * @return QString representing the human readable format translated according to the language cataglogue + * @return TQString representing the human readable format translated according to the language cataglogue * * @sa MyMoneySchedule::scheduleTypeToString() */ - static const QString scheduleTypeToString(MyMoneySchedule::typeE type); + static const TQString scheduleTypeToString(MyMoneySchedule::typeE type); /** * This method is used to convert a numeric index of an item @@ -224,20 +224,20 @@ public: * * @param idx numeric index of item * - * @return QString with text of this item + * @return TQString with text of this item */ - static const QString homePageItemToString(const int idx); + static const TQString homePageItemToString(const int idx); /** * This method is used to convert the name of a home page item * to it's internal numerical representation * - * @param txt QString reference of the items name + * @param txt TQString reference of the items name * * @retval 0 @p txt is unknown * @retval >0 numeric value for @p txt */ - static int stringToHomePageItem(const QString& txt); + static int stringToHomePageItem(const TQString& txt); /** * Retrieve a KDE KGuiItem for the new schedule button. @@ -264,12 +264,12 @@ public: * @retval true if @p name was changed * @retval false if @p name remained unchanged */ - static bool appendCorrectFileExt(QString& name, const QString& extension); + static bool appendCorrectFileExt(TQString& name, const TQString& extension); - static QPixmap billScheduleIcon(int size); - static QPixmap depositScheduleIcon(int size); - static QPixmap transferScheduleIcon(int size); - static QPixmap scheduleIcon(int size); + static TQPixmap billScheduleIcon(int size); + static TQPixmap depositScheduleIcon(int size); + static TQPixmap transferScheduleIcon(int size); + static TQPixmap scheduleIcon(int size); /** * Check that internal MyMoney engine constants use the same @@ -277,7 +277,7 @@ public: */ static void checkConstants(void); - static QString variableCSS(void); + static TQString variableCSS(void); /** * This method searches a KDE specific resource and applies country and @@ -298,7 +298,7 @@ public: * @code * * : - * QString fname = KMyMoneyUtils::findResource("appdata", "html/home%1.html") + * TQString fname = KMyMoneyUtils::findResource("appdata", "html/home%1.html") * : * * @endcode @@ -313,7 +313,7 @@ public: * * @note See KStandardDirs::findResource() for details on the parameters */ - static QString findResource(const char* type, const QString& filename); + static TQString findResource(const char* type, const TQString& filename); /** * This method returns the split referencing a stock account if @@ -343,22 +343,22 @@ public: * * @param schedule const reference to the schedule the transaction is based on * @param transaction reference to the transaction to be checked and modified - * @param balances QMap of (account-id,balance) pairs to be used as current balance + * @param balances TQMap of (account-id,balance) pairs to be used as current balance * for the calculation of interest. If map is empty, the engine * will be interrogated for current balances. */ - static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap& balances); + static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const TQMap& balances); /** * Return next check number for account @a acc. */ - static QString nextCheckNumber(const MyMoneyAccount& acc); + static TQString nextCheckNumber(const MyMoneyAccount& acc); /** * Returns the text representing the reconcile flag. If @a text is @p true * then the full text will be returned otherwise a short form (usually one character). */ - static QString reconcileStateToString(MyMoneySplit::reconcileFlagE flag, bool text = false); + static TQString reconcileStateToString(MyMoneySplit::reconcileFlagE flag, bool text = false); /** * Returns the transaction for @a schedule. In case of a loan payment the @@ -375,7 +375,7 @@ public: * ids of those categories in @a feesId and @a interestId. The last used category * will be returned. */ - static void previouslyUsedCategories(const QString& investmentAccount, QString& feesId, QString& interestId); + static void previouslyUsedCategories(const TQString& investmentAccount, TQString& feesId, TQString& interestId); }; diff --git a/kmymoney2/kstartuplogo.cpp b/kmymoney2/kstartuplogo.cpp index 566f8ad..a0d8ac6 100644 --- a/kmymoney2/kstartuplogo.cpp +++ b/kmymoney2/kstartuplogo.cpp @@ -19,10 +19,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -41,12 +41,12 @@ class KStartupSplash::Private { public: - QString message; - QColor color; + TQString message; + TQColor color; int align; }; -KStartupSplash::KStartupSplash(const QPixmap &pixmap, WFlags f) : +KStartupSplash::KStartupSplash(const TQPixmap &pixmap, WFlags f) : KSplashScreen(pixmap, f), d(new Private) { @@ -57,39 +57,39 @@ KStartupSplash::~KStartupSplash() delete d; } -void KStartupSplash::message( const QString &message, int alignment, const QColor &color) +void KStartupSplash::message( const TQString &message, int tqalignment, const TQColor &color) { d->message = message; - d->align = alignment; + d->align = tqalignment; d->color = color; // the next line causes the base class signal management to happen - // and also forces a repaint + // and also forces a tqrepaint KSplashScreen::clear(); } -void KStartupSplash::drawContents( QPainter *painter ) +void KStartupSplash::drawContents( TQPainter *painter ) { painter->setPen( d->color ); - QRect r = rect(); + TQRect r = rect(); r.setRect( r.x() + 15, r.y() + r.height() - 28, r.width() - 20, 20 ); painter->drawText( r, d->align, d->message); } KStartupLogo::KStartupLogo() : - QObject(0, 0), + TQObject(0, 0), m_splash(0) { // splash screen setting if(!KMyMoneyGlobalSettings::showSplash()) return; - QString filename = KGlobal::dirs()->findResource("appdata", "pics/startlogo.png"); - QPixmap splashPixmap(filename); + TQString filename = KGlobal::dirs()->findResource("appdata", "pics/startlogo.png"); + TQPixmap splashPixmap(filename); if(!splashPixmap.isNull()) { - QPixmap backGround(splashPixmap); + TQPixmap backGround(splashPixmap); backGround.fill(KGlobalSettings::highlightColor()); - bitBlt ( &backGround, 0, 0, &splashPixmap, 0, 0, splashPixmap.width(), splashPixmap.height(), Qt::CopyROP ); + bitBlt ( &backGround, 0, 0, &splashPixmap, 0, 0, splashPixmap.width(), splashPixmap.height(), TQt::CopyROP ); KStartupSplash* splash = new KStartupSplash(backGround); splash->setFixedSize(backGround.size()); @@ -100,7 +100,7 @@ KStartupLogo::KStartupLogo() : splash->message(i18n("Loading..."), AlignLeft, white); splash->show(); - splash->repaint(); + splash->tqrepaint(); m_splash = splash; } } diff --git a/kmymoney2/kstartuplogo.h b/kmymoney2/kstartuplogo.h index 2d3b305..0f340f9 100644 --- a/kmymoney2/kstartuplogo.h +++ b/kmymoney2/kstartuplogo.h @@ -20,8 +20,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -34,13 +34,14 @@ class KStartupSplash : public KSplashScreen { Q_OBJECT + TQ_OBJECT public: - KStartupSplash(const QPixmap &pixmap, WFlags f = 0); + KStartupSplash(const TQPixmap &pixmap, WFlags f = 0); ~KStartupSplash(); - void message( const QString &message, int alignment = AlignLeft, const QColor &color = black); + void message( const TQString &message, int tqalignment = AlignLeft, const TQColor &color = black); protected: - void drawContents(QPainter *p); + void drawContents(TQPainter *p); private: class Private; @@ -48,15 +49,16 @@ class KStartupSplash : public KSplashScreen }; // Simple class that just shows a picture -class KStartupLogo : public QObject +class KStartupLogo : public TQObject { Q_OBJECT + TQ_OBJECT public: KStartupLogo(); ~KStartupLogo(); private: - QGuardedPtr m_splash; + TQGuardedPtr m_splash; }; #endif diff --git a/kmymoney2/main.cpp b/kmymoney2/main.cpp index 008210d..79d731c 100644 --- a/kmymoney2/main.cpp +++ b/kmymoney2/main.cpp @@ -23,10 +23,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -67,7 +67,7 @@ static KCmdLineOptions options[] = KCmdLineLastOption }; -QTime timer; +TQTime timer; bool timersOn = false; KMyMoney2App* kmymoney2; @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) { timer.start(); - QString feature; + TQString feature; #ifdef _CHECK_MEMORY feature += "\t- " I18N_NOOP("Memory leakage detection") "\n"; @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) MyMoneyMoney::setNegativePrefixCurrencySymbol(KGlobal::locale()->negativePrefixCurrencySymbol()); MyMoneyMoney::setPositivePrefixCurrencySymbol(KGlobal::locale()->positivePrefixCurrencySymbol()); - QCString language = args->getOption("lang"); + TQCString language = args->getOption("lang"); if(!language.isEmpty()) { if(!KGlobal::locale()->setLanguage(language)) { qWarning("Unable to select language '%s'. This has one of two reasons:\n\ta) the standard KDE message catalogue is not installed\n\tb) the KMyMoney message catalogue is not installed", language.data()); @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) // Before we delete the application, we make sure that we destroy all // widgets by running the event loop for some time to catch all those // widgets that are requested to be destroyed using the deleteLater() method. - QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 10); + TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 10); delete kmymoney2; delete splash; @@ -204,20 +204,20 @@ int main(int argc, char *argv[]) if ( kmymoney2->isImportableFile( url.path() ) ) { // if there are multiple instances, we'll send this to the first one - QCString primary = instances[0]; + TQCString primary = instances[0]; // send a message to the primary client to import this file - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << url.path(); arg << kapp->startupId(); - if (!client->send(primary, "kmymoney2app", "webConnect(QString,QCString)",data)) + if (!client->send(primary, "kmymoney2app", "webConnect(TQString,TQCString)",data)) qDebug("Unable to launch WebConnect via DCOP."); // Before we delete the application, we make sure that we destroy all // widgets by running the event loop for some time to catch all those // widgets that are requested to be destroyed using the deleteLater() method. - QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 10); + TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 10); delete kmymoney2; delete splash; @@ -242,9 +242,9 @@ int main(int argc, char *argv[]) delete splash; // force complete paint of widgets - qApp->processEvents(); + tqApp->processEvents(); - QString importfile; + TQString importfile; KURL url; // make sure, we take the file provided on the command // line before we go and open the last one used @@ -287,7 +287,7 @@ int main(int argc, char *argv[]) } while(0); } catch(MyMoneyException *e) { KMessageBox::detailedError(0, i18n("Uncaught error. Please report the details to the developers"), - QString("%1 in file %2 line %3").arg(e->what()).arg(e->file()).arg(e->line())); + TQString("%1 in file %2 line %3").tqarg(e->what()).tqarg(e->file()).tqarg(e->line())); throw e; } diff --git a/kmymoney2/mymoney/mymoneyaccount.cpp b/kmymoney2/mymoney/mymoneyaccount.cpp index 8c304cd..d0d98d1 100644 --- a/kmymoney2/mymoney/mymoneyaccount.cpp +++ b/kmymoney2/mymoney/mymoneyaccount.cpp @@ -19,7 +19,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include #include #include @@ -45,14 +45,14 @@ MyMoneyAccount::~MyMoneyAccount() { } -MyMoneyAccount::MyMoneyAccount(const QString& id, const MyMoneyAccount& right) : +MyMoneyAccount::MyMoneyAccount(const TQString& id, const MyMoneyAccount& right) : MyMoneyObject(id) { *this = right; setId(id); } -MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : +MyMoneyAccount::MyMoneyAccount(const TQDomElement& node) : MyMoneyObject(node), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()), m_fraction(-1) @@ -64,9 +64,9 @@ MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : // qDebug("Reading information for account %s", acc.name().data()); - setParentAccountId(QStringEmpty(node.attribute("parentaccount"))); - setLastModified(stringToDate(QStringEmpty(node.attribute("lastmodified")))); - setLastReconciliationDate(stringToDate(QStringEmpty(node.attribute("lastreconciled")))); + setParentAccountId(TQStringEmpty(node.attribute("tqparentaccount"))); + setLastModified(stringToDate(TQStringEmpty(node.attribute("lastmodified")))); + setLastReconciliationDate(stringToDate(TQStringEmpty(node.attribute("lastreconciled")))); if(!m_lastReconciliationDate.isValid()) { // for some reason, I was unable to access our own kvp at this point through @@ -76,18 +76,18 @@ MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : // // Since we want to get rid of the lastStatementDate record anyway, this seems // to be ok for now. (ipwizard - 2008-08-14) - QString txt = MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()).value("lastStatementDate"); + TQString txt = MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()).value("lastStatementDate"); if(!txt.isEmpty()) { - setLastReconciliationDate(QDate::fromString(txt, Qt::ISODate)); + setLastReconciliationDate(TQDate::fromString(txt, Qt::ISODate)); } } - setInstitutionId(QStringEmpty(node.attribute("institution"))); - setNumber(QStringEmpty(node.attribute("number"))); - setOpeningDate(stringToDate(QStringEmpty(node.attribute("opened")))); - setCurrencyId(QStringEmpty(node.attribute("currency"))); + setInstitutionId(TQStringEmpty(node.attribute("institution"))); + setNumber(TQStringEmpty(node.attribute("number"))); + setOpeningDate(stringToDate(TQStringEmpty(node.attribute("opened")))); + setCurrencyId(TQStringEmpty(node.attribute("currency"))); - QString tmp = QStringEmpty(node.attribute("type")); + TQString tmp = TQStringEmpty(node.attribute("type")); bool bOK = false; int type = tmp.toInt(&bOK); if(bOK) { @@ -98,67 +98,67 @@ MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : if(node.hasAttribute("openingbalance")) { if(!MyMoneyMoney(node.attribute("openingbalance")).isZero()) { - QString msg = i18n("Account %1 contains an opening balance. Please use a KMyMoney version >= 0.8 and < 0.9 to correct the problem.").arg(m_name); + TQString msg = i18n("Account %1 contains an opening balance. Please use a KMyMoney version >= 0.8 and < 0.9 to correct the problem.").tqarg(m_name); throw new MYMONEYEXCEPTION(msg); } } setDescription(node.attribute("description")); - m_id = QStringEmpty(node.attribute("id")); - // qDebug("Account %s has id of %s, type of %d, parent is %s.", acc.name().data(), id.data(), type, acc.parentAccountId().data()); + m_id = TQStringEmpty(node.attribute("id")); + // qDebug("Account %s has id of %s, type of %d, tqparent is %s.", acc.name().data(), id.data(), type, acc.tqparentAccountId().data()); // Process any Sub-Account information found inside the account entry. m_accountList.clear(); - QDomNodeList nodeList = node.elementsByTagName("SUBACCOUNTS"); + TQDomNodeList nodeList = node.elementsByTagName("SUBACCOUNTS"); if(nodeList.count() > 0) { nodeList = nodeList.item(0).toElement().elementsByTagName("SUBACCOUNT"); for(unsigned int i = 0; i < nodeList.count(); ++i) { - addAccountId(QString(nodeList.item(i).toElement().attribute("id"))); + addAccountId(TQString(nodeList.item(i).toElement().attribute("id"))); } } nodeList = node.elementsByTagName("ONLINEBANKING"); if(nodeList.count() > 0) { - QDomNamedNodeMap attributes = nodeList.item(0).toElement().attributes(); + TQDomNamedNodeMap attributes = nodeList.item(0).toElement().attributes(); for(unsigned int i = 0; i < attributes.count(); ++i) { - const QDomAttr& it_attr = attributes.item(i).toAttr(); + const TQDomAttr& it_attr = attributes.item(i).toAttr(); m_onlineBankingSettings.setValue(it_attr.name().utf8(), it_attr.value()); } } } -void MyMoneyAccount::setName(const QString& name) +void MyMoneyAccount::setName(const TQString& name) { m_name = name; } -void MyMoneyAccount::setNumber(const QString& number) +void MyMoneyAccount::setNumber(const TQString& number) { m_number = number; } -void MyMoneyAccount::setDescription(const QString& desc) +void MyMoneyAccount::setDescription(const TQString& desc) { m_description = desc; } -void MyMoneyAccount::setInstitutionId(const QString& id) +void MyMoneyAccount::setInstitutionId(const TQString& id) { m_institution = id; } -void MyMoneyAccount::setLastModified(const QDate& date) +void MyMoneyAccount::setLastModified(const TQDate& date) { m_lastModified = date; } -void MyMoneyAccount::setOpeningDate(const QDate& date) +void MyMoneyAccount::setOpeningDate(const TQDate& date) { m_openingDate = date; } -void MyMoneyAccount::setLastReconciliationDate(const QDate& date) +void MyMoneyAccount::setLastReconciliationDate(const TQDate& date) { // FIXME: for a limited time (maybe until we delivered 1.0) we // keep the last reconciliation date also in the KVP for backward @@ -168,9 +168,9 @@ void MyMoneyAccount::setLastReconciliationDate(const QDate& date) m_lastReconciliationDate = date; } -void MyMoneyAccount::setParentAccountId(const QString& parent) +void MyMoneyAccount::setParentAccountId(const TQString& tqparent) { - m_parentAccount = parent; + m_parentAccount = tqparent; } void MyMoneyAccount::setAccountType(const accountTypeE type) @@ -178,9 +178,9 @@ void MyMoneyAccount::setAccountType(const accountTypeE type) m_accountType = type; } -void MyMoneyAccount::addAccountId(const QString& account) +void MyMoneyAccount::addAccountId(const TQString& account) { - if(!m_accountList.contains(account)) + if(!m_accountList.tqcontains(account)) m_accountList += account; } @@ -189,11 +189,11 @@ void MyMoneyAccount::removeAccountIds(void) m_accountList.clear(); } -void MyMoneyAccount::removeAccountId(const QString& account) +void MyMoneyAccount::removeAccountId(const TQString& account) { - QStringList::Iterator it; + TQStringList::Iterator it; - it = m_accountList.find(account); + it = m_accountList.tqfind(account); if(it != m_accountList.end()) m_accountList.remove(it); } @@ -243,7 +243,7 @@ MyMoneyAccount::accountTypeE MyMoneyAccount::accountGroup(void) const return accountGroup(m_accountType); } -void MyMoneyAccount::setCurrencyId(const QString& id) +void MyMoneyAccount::setCurrencyId(const TQString& id) { m_currencyId = id; } @@ -284,20 +284,20 @@ void MyMoneyAccountLoan::setLoanAmount(const MyMoneyMoney& amount) setValue("loan-amount", amount.toString()); } -const MyMoneyMoney MyMoneyAccountLoan::interestRate(const QDate& date) const +const MyMoneyMoney MyMoneyAccountLoan::interestRate(const TQDate& date) const { MyMoneyMoney rate; - QString key; - QString val; + TQString key; + TQString val; if(!date.isValid()) return rate; key.sprintf("ir-%04d-%02d-%02d", date.year(), date.month(), date.day()); - QRegExp regExp("ir-(\\d{4})-(\\d{2})-(\\d{2})"); + TQRegExp regExp("ir-(\\d{4})-(\\d{2})-(\\d{2})"); - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = pairs().begin(); it != pairs().end(); ++it) { if(regExp.search(it.key()) > -1) { @@ -317,19 +317,19 @@ const MyMoneyMoney MyMoneyAccountLoan::interestRate(const QDate& date) const return rate; } -void MyMoneyAccountLoan::setInterestRate(const QDate& date, const MyMoneyMoney& value) +void MyMoneyAccountLoan::setInterestRate(const TQDate& date, const MyMoneyMoney& value) { if(!date.isValid()) return; - QString key; + TQString key; key.sprintf("ir-%04d-%02d-%02d", date.year(), date.month(), date.day()); setValue(key, value.toString()); } MyMoneyAccountLoan::interestDueE MyMoneyAccountLoan::interestCalculation(void) const { - QString payTime(value("interest-calculation")); + TQString payTime(value("interest-calculation")); if(payTime == "paymentDue") return paymentDue; return paymentReceived; @@ -343,18 +343,18 @@ void MyMoneyAccountLoan::setInterestCalculation(const MyMoneyAccountLoan::intere setValue("interest-calculation", "paymentReceived"); } -const QDate MyMoneyAccountLoan::nextInterestChange(void) const +const TQDate MyMoneyAccountLoan::nextInterestChange(void) const { - QDate rc; + TQDate rc; - QRegExp regExp("(\\d{4})-(\\d{2})-(\\d{2})"); + TQRegExp regExp("(\\d{4})-(\\d{2})-(\\d{2})"); if(regExp.search(value("interest-nextchange")) != -1) { rc.setYMD(regExp.cap(1).toInt(), regExp.cap(2).toInt(), regExp.cap(3).toInt()); } return rc; } -void MyMoneyAccountLoan::setNextInterestChange(const QDate& date) +void MyMoneyAccountLoan::setNextInterestChange(const TQDate& date) { setValue("interest-nextchange", date.toString(Qt::ISODate)); } @@ -366,7 +366,7 @@ int MyMoneyAccountLoan::interestChangeFrequency(int* unit) const if(unit) *unit = 1; - QRegExp regExp("(\\d+)/(\\d{1})"); + TQRegExp regExp("(\\d+)/(\\d{1})"); if(regExp.search(value("interest-changefrequency")) != -1) { rc = regExp.cap(1).toInt(); if(unit != 0) { @@ -378,17 +378,17 @@ int MyMoneyAccountLoan::interestChangeFrequency(int* unit) const void MyMoneyAccountLoan::setInterestChangeFrequency(const int amount, const int unit) { - QString val; + TQString val; val.sprintf("%d/%d", amount, unit); setValue("interest-changeFrequency", val); } -const QString MyMoneyAccountLoan::schedule(void) const +const TQString MyMoneyAccountLoan::schedule(void) const { - return QString(value("schedule").latin1()); + return TQString(value("schedule").latin1()); } -void MyMoneyAccountLoan::setSchedule(const QString& sched) +void MyMoneyAccountLoan::setSchedule(const TQString& sched) { setValue("schedule", sched); } @@ -425,7 +425,7 @@ unsigned int MyMoneyAccountLoan::term(void) const void MyMoneyAccountLoan::setTerm(const unsigned int payments) { - setValue("term", QString::number(payments)); + setValue("term", TQString::number(payments)); } const MyMoneyMoney MyMoneyAccountLoan::periodicPayment(void) const @@ -438,27 +438,27 @@ void MyMoneyAccountLoan::setPeriodicPayment(const MyMoneyMoney& payment) setValue("periodic-payment", payment.toString()); } -const QString MyMoneyAccountLoan::payee(void) const +const TQString MyMoneyAccountLoan::payee(void) const { return value("payee"); } -void MyMoneyAccountLoan::setPayee(const QString& payee) +void MyMoneyAccountLoan::setPayee(const TQString& payee) { setValue("payee", payee); } -const QString MyMoneyAccountLoan::interestAccountId(void) const +const TQString MyMoneyAccountLoan::interestAccountId(void) const { - return QString(); + return TQString(); } -void MyMoneyAccountLoan::setInterestAccountId(const QString& /* id */) +void MyMoneyAccountLoan::setInterestAccountId(const TQString& /* id */) { } -bool MyMoneyAccountLoan::hasReferenceTo(const QString& id) const +bool MyMoneyAccountLoan::hasReferenceTo(const TQString& id) const { return MyMoneyAccount::hasReferenceTo(id) || (id == payee()) @@ -467,7 +467,7 @@ bool MyMoneyAccountLoan::hasReferenceTo(const QString& id) const void MyMoneyAccountLoan::setInterestCompounding(int frequency) { - setValue("compoundingFrequency", QString("%1").arg(frequency)); + setValue("compoundingFrequency", TQString("%1").tqarg(frequency)); } int MyMoneyAccountLoan::interestCompounding(void) const @@ -475,13 +475,13 @@ int MyMoneyAccountLoan::interestCompounding(void) const return value("compoundingFrequency").toInt(); } -void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyAccount::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("ACCOUNT"); + TQDomElement el = document.createElement("ACCOUNT"); writeBaseXML(document, el); - el.setAttribute("parentaccount", parentAccountId()); + el.setAttribute("tqparentaccount", tqparentAccountId()); el.setAttribute("lastreconciled", dateToString(lastReconciliationDate())); el.setAttribute("lastmodified", dateToString(lastModified())); el.setAttribute("institution", institutionId()); @@ -497,11 +497,11 @@ void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const //Add in subaccount information, if this account has subaccounts. if(accountCount()) { - QDomElement subAccounts = document.createElement("SUBACCOUNTS"); - QStringList::ConstIterator it; + TQDomElement subAccounts = document.createElement("SUBACCOUNTS"); + TQStringList::ConstIterator it; for(it = accountList().begin(); it != accountList().end(); ++it) { - QDomElement temp = document.createElement("SUBACCOUNT"); + TQDomElement temp = document.createElement("SUBACCOUNT"); temp.setAttribute("id", (*it)); subAccounts.appendChild(temp); } @@ -511,8 +511,8 @@ void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const // Write online banking settings if(m_onlineBankingSettings.pairs().count()) { - QDomElement onlinesettings = document.createElement("ONLINEBANKING"); - QMap::const_iterator it_key = m_onlineBankingSettings.pairs().begin(); + TQDomElement onlinesettings = document.createElement("ONLINEBANKING"); + TQMap::const_iterator it_key = m_onlineBankingSettings.pairs().begin(); while ( it_key != m_onlineBankingSettings.pairs().end() ) { onlinesettings.setAttribute(it_key.key(), it_key.data()); ++it_key; @@ -529,10 +529,10 @@ void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const //Add in Key-Value Pairs for accounts. MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyAccount::hasReferenceTo(const QString& id) const +bool MyMoneyAccount::hasReferenceTo(const TQString& id) const { return (id == m_institution) || (id == m_parentAccount) || (id == m_currencyId); } @@ -591,10 +591,10 @@ bool MyMoneyAccount::isCategory(void) const return m_accountType == Income || m_accountType == Expense; } -QString MyMoneyAccount::brokerageName(void) const +TQString MyMoneyAccount::brokerageName(void) const { if(m_accountType == Investment) - return QString("%1 (%2)").arg(m_name, i18n("Brokerage (suffix for account names)", "Brokerage")); + return TQString("%1 (%2)").tqarg(m_name, i18n("Brokerage (suffix for account names)", "Brokerage")); return m_name; } @@ -614,9 +614,9 @@ void MyMoneyAccount::adjustBalance(const MyMoneySplit& s, bool reverse) } -QPixmap MyMoneyAccount::accountPixmap(bool reconcileFlag, int size) const +TQPixmap MyMoneyAccount::accountPixmap(bool reconcileFlag, int size) const { - QString icon; + TQString icon; switch(accountType()) { default: if(accountGroup() == MyMoneyAccount::Asset) @@ -669,23 +669,23 @@ QPixmap MyMoneyAccount::accountPixmap(bool reconcileFlag, int size) const break; } - QPixmap result = DesktopIcon(icon, size); + TQPixmap result = DesktopIcon(icon, size); if(isClosed()) { - QPixmap ovly = DesktopIcon("account-types_closed", size); - bitBlt(&result, 0, 0, &ovly, 0, 0, ovly.width(), ovly.height(), Qt::CopyROP, false); + TQPixmap ovly = DesktopIcon("account-types_closed", size); + bitBlt(TQT_TQPAINTDEVICE(&result), 0, 0, TQT_TQPAINTDEVICE(&ovly), 0, 0, ovly.width(), ovly.height(), TQt::CopyROP, false); } else if(reconcileFlag) { - QPixmap ovly = DesktopIcon("account-types_reconcile.png", size); - bitBlt(&result, 0, 0, &ovly, 0, 0, ovly.width(), ovly.height(), Qt::CopyROP, false); + TQPixmap ovly = DesktopIcon("account-types_reconcile.png", size); + bitBlt(TQT_TQPAINTDEVICE(&result), 0, 0, TQT_TQPAINTDEVICE(&ovly), 0, 0, ovly.width(), ovly.height(), TQt::CopyROP, false); } else if(!onlineBankingSettings().value("provider").isEmpty()) { - QPixmap ovly = DesktopIcon("account-types_online.png", size); - bitBlt(&result, 0, 0, &ovly, 0, 0, ovly.width(), ovly.height(), Qt::CopyROP, false); + TQPixmap ovly = DesktopIcon("account-types_online.png", size); + bitBlt(TQT_TQPAINTDEVICE(&result), 0, 0, TQT_TQPAINTDEVICE(&ovly), 0, 0, ovly.width(), ovly.height(), TQt::CopyROP, false); } return result; } -QString MyMoneyAccount::accountTypeToString(const MyMoneyAccount::accountTypeE accountType) +TQString MyMoneyAccount::accountTypeToString(const MyMoneyAccount::accountTypeE accountType) { - QString returnString; + TQString returnString; switch (accountType) { case MyMoneyAccount::Checkings: diff --git a/kmymoney2/mymoney/mymoneyaccount.h b/kmymoney2/mymoney/mymoneyaccount.h index 333c500..30e1185 100644 --- a/kmymoney2/mymoney/mymoneyaccount.h +++ b/kmymoney2/mymoney/mymoneyaccount.h @@ -24,12 +24,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -122,16 +122,16 @@ public: * @param id id assigned to the account * @param right account definition */ - MyMoneyAccount(const QString& id, const MyMoneyAccount& right); + MyMoneyAccount(const TQString& id, const MyMoneyAccount& right); /** * This is the constructor for an account that is described by a - * QDomElement (e.g. from a file). + * TQDomElement (e.g. from a file). * - * @param el const reference to the QDomElement from which to + * @param el const reference to the TQDomElement from which to * create the object */ - MyMoneyAccount(const QDomElement& el); + MyMoneyAccount(const TQDomElement& el); /** * This is the destructor for any MyMoneyAccount object @@ -182,66 +182,66 @@ public: /** * This method returns the id of the MyMoneyInstitution object this account * belongs to. - * @return id of MyMoneyInstitution object. QString() if it is + * @return id of MyMoneyInstitution object. TQString() if it is * an internal account * @see setInstitution */ - const QString& institutionId(void) const { return m_institution; } + const TQString& institutionId(void) const { return m_institution; } /** * This method returns the name of the account * @return name of account * @see setName() */ - const QString& name(void) const { return m_name; } + const TQString& name(void) const { return m_name; } /** * This method returns the number of the account at the institution * @return number of account at the institution * @see setNumber */ - const QString& number(void) const { return m_number; } + const TQString& number(void) const { return m_number; } /** * This method returns the descriptive text of the account. * @return description of account * @see setDescription */ - const QString& description(void) const { return m_description; } + const TQString& description(void) const { return m_description; } /** * This method returns the opening date of this account - * @return date of opening of this account as const QDate value + * @return date of opening of this account as const TQDate value * @see setOpeningDate() */ - const QDate& openingDate(void) const { return m_openingDate; } + const TQDate& openingDate(void) const { return m_openingDate; } /** * This method returns the date of the last reconciliation of this account - * @return date of last reconciliation as const QDate value + * @return date of last reconciliation as const TQDate value * @see setLastReconciliationDate */ - const QDate& lastReconciliationDate(void) const { return m_lastReconciliationDate; } + const TQDate& lastReconciliationDate(void) const { return m_lastReconciliationDate; } /** * This method returns the date the account was last modified - * @return date of last modification as const QDate value + * @return date of last modification as const TQDate value * @see setLastModified */ - const QDate& lastModified(void) const { return m_lastModified; } + const TQDate& lastModified(void) const { return m_lastModified; } /** - * This method is used to return the ID of the parent account - * @return QString with the ID of the parent of this account + * This method is used to return the ID of the tqparent account + * @return TQString with the ID of the tqparent of this account */ - const QString& parentAccountId(void) const { return m_parentAccount; }; + const TQString& tqparentAccountId(void) const { return m_parentAccount; }; /** * This method returns the list of the account id's of * subordinate accounts - * @return QStringList account ids + * @return TQStringList account ids */ - const QStringList& accountList(void) const { return m_accountList; }; + const TQStringList& accountList(void) const { return m_accountList; }; /** * This method returns the number of entries in the m_accountList @@ -251,16 +251,16 @@ public: /** * This method is used to add an account id as sub-ordinate account - * @param account const QString reference to account ID + * @param account const TQString reference to account ID */ - void addAccountId(const QString& account); + void addAccountId(const TQString& account); /** * This method is used to remove an account from the list of * sub-ordinate accounts. - * @param account const QString reference to account ID to be removed + * @param account const TQString reference to account ID to be removed */ - void removeAccountId(const QString& account); + void removeAccountId(const TQString& account); /** * This method is used to remove all accounts from the list of @@ -274,21 +274,21 @@ public: * @param date date of last modification * @see lastModified */ - void setLastModified(const QDate& date); + void setLastModified(const TQDate& date); /** * This method is used to set the name of the account * @param name name of the account * @see name */ - void setName(const QString& name); + void setName(const TQString& name); /** * This method is used to set the number of the account at the institution * @param number number of the account * @see number */ - void setNumber(const QString& number); + void setNumber(const TQString& number); /** * This method is used to set the descriptive text of the account @@ -296,7 +296,7 @@ public: * @param desc text that serves as description * @see setDescription */ - void setDescription(const QString& desc); + void setDescription(const TQString& desc); /** * This method is used to set the id of the institution this account @@ -305,24 +305,24 @@ public: * @param id id of the institution this account belongs to * @see institution */ - void setInstitutionId(const QString& id); + void setInstitutionId(const TQString& id); /** * This method is used to set the opening date information of an * account. * - * @param date QDate of opening date + * @param date TQDate of opening date * @see openingDate */ - void setOpeningDate(const QDate& date); + void setOpeningDate(const TQDate& date); /** * This method is used to set the date of the last reconciliation * of an account. - * @param date QDate of last reconciliation + * @param date TQDate of last reconciliation * @see lastReconciliationDate */ - void setLastReconciliationDate(const QDate& date); + void setLastReconciliationDate(const TQDate& date); /** * This method is used to change the account type @@ -332,15 +332,15 @@ public: void setAccountType(const accountTypeE type); /** - * This method is used to set a new parent account id - * @param parent QString reference to new parent account + * This method is used to set a new tqparent account id + * @param tqparent TQString reference to new tqparent account */ - void setParentAccountId(const QString& parent); + void setParentAccountId(const TQString& tqparent); /** * This method is used to update m_lastModified to the current date */ - void touch(void) { setLastModified(QDate::currentDate()); } + void touch(void) { setLastModified(TQDate::tqcurrentDate()); } /** * This method returns the type of the account. @@ -353,16 +353,16 @@ public: * * @return id of currency */ - const QString& currencyId(void) const { return m_currencyId; }; + const TQString& currencyId(void) const { return m_currencyId; }; /** * This method sets the id of the currency used with this account. * * @param id ID of currency to be associated with this account. */ - void setCurrencyId(const QString& id); + void setCurrencyId(const TQString& id); - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -373,7 +373,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * This member returns the balance of this account based on @@ -514,13 +514,13 @@ public: * the current name. It only works on investment accounts and * returns the name for all other cases. */ - QString brokerageName(void) const; + TQString brokerageName(void) const; /** * @param size is a hint for the size of the icon * @return a pixmap using DesktopIcon for the account type */ - QPixmap accountPixmap(bool reconcileFlag = false, int size = 0) const; + TQPixmap accountPixmap(bool reconcileFlag = false, int size = 0) const; /** * This method is used to convert the internal representation of @@ -528,12 +528,12 @@ public: * * @param accountType numerical representation of the account type. * For possible values, see MyMoneyAccount::accountTypeE - * @return QString representing the human readable form + * @return TQString representing the human readable form */ - static QString accountTypeToString(const MyMoneyAccount::accountTypeE accountType); + static TQString accountTypeToString(const MyMoneyAccount::accountTypeE accountType); - KMYMONEY_EXPORT QDataStream &operator<<( const MyMoneyAccount & ); - KMYMONEY_EXPORT QDataStream &operator>>( MyMoneyAccount & ); + KMYMONEY_EXPORT TQDataStream &operator<<( const MyMoneyAccount & ); + KMYMONEY_EXPORT TQDataStream &operator>>( MyMoneyAccount & ); private: /** @@ -545,61 +545,61 @@ private: * This member variable keeps the ID of the MyMoneyInstitution object * that this object belongs to. */ - QString m_institution; + TQString m_institution; /** * This member variable keeps the name of the account * It is solely for documentation purposes and it's contents is not * used otherwise by the mymoney-engine. */ - QString m_name; + TQString m_name; /** * This member variable keeps the account number at the institution * It is solely for documentation purposes and it's contents is not * used otherwise by the mymoney-engine. */ - QString m_number; + TQString m_number; /** * This member variable is a description of the account. * It is solely for documentation purposes and it's contents is not * used otherwise by the mymoney-engine. */ - QString m_description; + TQString m_description; /** * This member variable keeps the date when the account * was last modified. */ - QDate m_lastModified; + TQDate m_lastModified; /** * This member variable keeps the date when the * account was created as an object in a MyMoneyFile */ - QDate m_openingDate; + TQDate m_openingDate; /** * This member variable keeps the date of the last * reconciliation of this account */ - QDate m_lastReconciliationDate; + TQDate m_lastReconciliationDate; /** * This member holds the ID's of all sub-ordinate accounts */ - QStringList m_accountList; + TQStringList m_accountList; /** - * This member contains the ID of the parent account + * This member contains the ID of the tqparent account */ - QString m_parentAccount; + TQString m_parentAccount; /** * This member contains the ID of the currency associated with this account */ - QString m_currencyId; + TQString m_currencyId; /** * This member holds the balance of all transactions stored in the journal @@ -649,14 +649,14 @@ public: const MyMoneyMoney loanAmount(void) const; void setLoanAmount(const MyMoneyMoney& amount); - const MyMoneyMoney interestRate(const QDate& date) const; - void setInterestRate(const QDate& date, const MyMoneyMoney& rate); + const MyMoneyMoney interestRate(const TQDate& date) const; + void setInterestRate(const TQDate& date, const MyMoneyMoney& rate); interestDueE interestCalculation(void) const; void setInterestCalculation(const interestDueE onReception); - const QDate nextInterestChange(void) const; - void setNextInterestChange(const QDate& date); - const QString schedule(void) const; - void setSchedule(const QString& sched); + const TQDate nextInterestChange(void) const; + void setNextInterestChange(const TQDate& date); + const TQString schedule(void) const; + void setSchedule(const TQString& sched); bool fixedInterestRate(void) const; void setFixedInterestRate(const bool fixed); const MyMoneyMoney finalPayment(void) const; @@ -669,10 +669,10 @@ public: void setPeriodicPayment(const MyMoneyMoney& payment); int interestCompounding(void) const; void setInterestCompounding(int frequency); - const QString payee(void) const; - void setPayee(const QString& payee); - const QString interestAccountId(void) const; - void setInterestAccountId(const QString& id); + const TQString payee(void) const; + void setPayee(const TQString& payee); + const TQString interestAccountId(void) const; + void setInterestAccountId(const TQString& id); /** * This method checks if a reference to the given object exists. It returns, @@ -683,7 +683,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; }; diff --git a/kmymoney2/mymoney/mymoneyaccounttest.cpp b/kmymoney2/mymoney/mymoneyaccounttest.cpp index 1384c5c..0e1fbbf 100644 --- a/kmymoney2/mymoney/mymoneyaccounttest.cpp +++ b/kmymoney2/mymoney/mymoneyaccounttest.cpp @@ -35,26 +35,26 @@ void MyMoneyAccountTest::testEmptyConstructor() { CPPUNIT_ASSERT(a.id().isEmpty()); CPPUNIT_ASSERT(a.name().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::UnknownAccountType); - CPPUNIT_ASSERT(a.openingDate() == QDate()); - CPPUNIT_ASSERT(a.lastModified() == QDate()); - CPPUNIT_ASSERT(a.lastReconciliationDate() == QDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate()); + CPPUNIT_ASSERT(a.lastReconciliationDate() == TQDate()); CPPUNIT_ASSERT(a.accountList().count() == 0); CPPUNIT_ASSERT(a.balance().isZero()); } void MyMoneyAccountTest::testConstructor() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "Parent"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "Parent"; MyMoneyAccount r; MyMoneySplit s; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setDescription("Desc"); r.setNumber("465500"); - r.setParentAccountId(parent); - r.setValue(QString("key"), "value"); + r.setParentAccountId(tqparent); + r.setValue(TQString("key"), "value"); s.setShares(MyMoneyMoney(1,1)); r.adjustBalance(s); CPPUNIT_ASSERT(r.m_kvp.count() == 1); @@ -65,26 +65,26 @@ void MyMoneyAccountTest::testConstructor() { CPPUNIT_ASSERT(a.id() == id); CPPUNIT_ASSERT(a.institutionId().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::Asset); - CPPUNIT_ASSERT(a.openingDate() == QDate::currentDate()); - CPPUNIT_ASSERT(a.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.number() == "465500"); CPPUNIT_ASSERT(a.description() == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 0); - CPPUNIT_ASSERT(a.parentAccountId() == "Parent"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "Parent"); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(1,1)); - QMap copy; + TQMap copy; copy = r.pairs(); CPPUNIT_ASSERT(copy.count() == 1); - CPPUNIT_ASSERT(copy[QString("key")] == "value"); + CPPUNIT_ASSERT(copy[TQString("key")] == "value"); } void MyMoneyAccountTest::testSetFunctions() { MyMoneyAccount a; - QDate today(QDate::currentDate()); + TQDate today(TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.name().isEmpty()); - CPPUNIT_ASSERT(a.lastModified() == QDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate()); CPPUNIT_ASSERT(a.description().isEmpty()); a.setName("Account"); @@ -103,18 +103,18 @@ void MyMoneyAccountTest::testSetFunctions() { } void MyMoneyAccountTest::testCopyConstructor() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "ParentAccount"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "ParentAccount"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Expense); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setName("Account"); r.setInstitutionId("Inst1"); r.setDescription("Desc1"); r.setNumber("Number"); - r.setParentAccountId(parent); + r.setParentAccountId(tqparent); r.setValue("Key", "Value"); MyMoneyAccount a(id, r); @@ -125,11 +125,11 @@ void MyMoneyAccountTest::testCopyConstructor() { CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == institutionid); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Expense); - CPPUNIT_ASSERT(b.lastModified() == QDate::currentDate()); - CPPUNIT_ASSERT(b.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(b.openingDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(b.description() == "Desc1"); CPPUNIT_ASSERT(b.number() == "Number"); - CPPUNIT_ASSERT(b.parentAccountId() == "ParentAccount"); + CPPUNIT_ASSERT(b.tqparentAccountId() == "ParentAccount"); CPPUNIT_ASSERT(b.value("Key") == "Value"); } @@ -146,14 +146,14 @@ void MyMoneyAccountTest::testAssignmentConstructor() { MyMoneyAccount b; - b.setLastModified(QDate::currentDate()); + b.setLastModified(TQDate::tqcurrentDate()); b = a; CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == "Inst1"); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Checkings); - CPPUNIT_ASSERT(b.lastModified() == QDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate()); CPPUNIT_ASSERT(b.openingDate() == a.openingDate()); CPPUNIT_ASSERT(b.description() == "Bla"); CPPUNIT_ASSERT(b.number() == "assigned Number"); @@ -176,7 +176,7 @@ void MyMoneyAccountTest::testAdjustBalance() { a.adjustBalance(s); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-4,1)); s.setShares(MyMoneyMoney(4,1)); - s.setAction(QString()); + s.setAction(TQString()); a.adjustBalance(s); CPPUNIT_ASSERT(a.balance().isZero()); } @@ -199,13 +199,13 @@ void MyMoneyAccountTest::testEquality() { MyMoneyAccount a; - a.setLastModified(QDate::currentDate()); + a.setLastModified(TQDate::tqcurrentDate()); a.setName("Name"); a.setNumber("Number"); a.setDescription("Desc"); a.setInstitutionId("I-ID"); - a.setOpeningDate(QDate::currentDate()); - a.setLastReconciliationDate(QDate::currentDate()); + a.setOpeningDate(TQDate::tqcurrentDate()); + a.setLastReconciliationDate(TQDate::tqcurrentDate()); a.setAccountType(MyMoneyAccount::Asset); a.setParentAccountId("P-ID"); a.setId("A-ID"); @@ -221,7 +221,7 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastModified(QDate::currentDate().addDays(-1)); + a.setLastModified(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -237,11 +237,11 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setOpeningDate(QDate::currentDate().addDays(-1)); + a.setOpeningDate(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastReconciliationDate(QDate::currentDate().addDays(-1)); + a.setLastReconciliationDate(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -272,35 +272,35 @@ void MyMoneyAccountTest::testEquality() } void MyMoneyAccountTest::testWriteXML() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "Parent"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "Parent"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setDescription("Desc"); r.setName("AccountName"); r.setNumber("465500"); - r.setParentAccountId(parent); + r.setParentAccountId(tqparent); r.setInstitutionId(institutionid); - r.setValue(QString("key"), "value"); + r.setValue(TQString("key"), "value"); r.addAccountId("A000002"); // CPPUNIT_ASSERT(r.m_kvp.count() == 1); // CPPUNIT_ASSERT(r.value("key") == "value"); MyMoneyAccount a(id, r); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("ACCOUNT-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("ACCOUNT-CONTAINER"); doc.appendChild(el); a.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "\n" "\n" - " \n" + " \n" " \n" " \n" " \n" @@ -309,17 +309,17 @@ void MyMoneyAccountTest::testWriteXML() { " \n" " \n" "\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } void MyMoneyAccountTest::testReadXML() { MyMoneyAccount a; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" - " \n" + " \n" " \n" " \n" " \n" @@ -330,12 +330,12 @@ void MyMoneyAccountTest::testReadXML() { " \n" " \n" "\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QString ref_false = QString( + TQString ref_false = TQString( "\n" "\n" - " \n" + " \n" " \n" " \n" " \n" @@ -346,10 +346,10 @@ void MyMoneyAccountTest::testReadXML() { " \n" " \n" "\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -371,11 +371,11 @@ void MyMoneyAccountTest::testReadXML() { CPPUNIT_ASSERT(a.id() == "A000001"); CPPUNIT_ASSERT(a.m_name == "AccountName"); CPPUNIT_ASSERT(a.m_parentAccount == "Parent"); - CPPUNIT_ASSERT(a.m_lastModified == QDate::currentDate()); - CPPUNIT_ASSERT(a.m_lastReconciliationDate == QDate()); + CPPUNIT_ASSERT(a.m_lastModified == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.m_lastReconciliationDate == TQDate()); CPPUNIT_ASSERT(a.m_institution == "B000001"); CPPUNIT_ASSERT(a.m_number == "465500"); - CPPUNIT_ASSERT(a.m_openingDate == QDate::currentDate()); + CPPUNIT_ASSERT(a.m_openingDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.m_accountType == MyMoneyAccount::Asset); CPPUNIT_ASSERT(a.m_description == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 2); diff --git a/kmymoney2/mymoney/mymoneybudget.cpp b/kmymoney2/mymoney/mymoneybudget.cpp index 46b8ca8..3cb7793 100644 --- a/kmymoney2/mymoney/mymoneybudget.cpp +++ b/kmymoney2/mymoney/mymoneybudget.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -33,7 +33,7 @@ #include "mymoneybudget.h" -const QStringList MyMoneyBudget::AccountGroup::kBudgetLevelText = QStringList::split(",","none,monthly,monthbymonth,yearly,invalid",true); +const TQStringList MyMoneyBudget::AccountGroup::kBudgetLevelText = TQStringList::split(",","none,monthly,monthbymonth,yearly,invalid",true); const int BUDGET_VERSION = 2; bool MyMoneyBudget::AccountGroup::isZero(void) const @@ -80,7 +80,7 @@ void MyMoneyBudget::AccountGroup::convertToYearly(void) void MyMoneyBudget::AccountGroup::convertToMonthByMonth(void) { MyMoneyBudget::PeriodGroup period; - QDate date; + TQDate date; switch(m_budgetlevel) { case eMonthByMonth: @@ -126,14 +126,14 @@ MyMoneyBudget::AccountGroup MyMoneyBudget::AccountGroup::operator += (const MyMo // now both budgets should be of the same type and we simply need // to iterate over the period list and add the values - QMap periods = m_periods; - QMap rPeriods = r.m_periods; - QMap::const_iterator it_p; - QMap::const_iterator it_pr; + TQMap periods = m_periods; + TQMap rPeriods = r.m_periods; + TQMap::const_iterator it_p; + TQMap::const_iterator it_pr; m_periods.clear(); it_p = periods.begin(); it_pr = rPeriods.begin(); - QDate date = (*it_p).startDate(); + TQDate date = (*it_p).startDate(); while(it_p != periods.end()) { MyMoneyBudget::PeriodGroup period = *it_p; if(it_pr != rPeriods.end()) { @@ -161,19 +161,19 @@ MyMoneyBudget::MyMoneyBudget(void) : { } -MyMoneyBudget::MyMoneyBudget(const QString& _name) : +MyMoneyBudget::MyMoneyBudget(const TQString& _name) : m_name(_name) { } -MyMoneyBudget::MyMoneyBudget(const QDomElement& node) : +MyMoneyBudget::MyMoneyBudget(const TQDomElement& node) : MyMoneyObject(node) { if(!read(node)) clearId(); } -MyMoneyBudget::MyMoneyBudget(const QString& id, const MyMoneyBudget& budget) +MyMoneyBudget::MyMoneyBudget(const TQString& id, const MyMoneyBudget& budget) { *this = budget; m_id = id; @@ -193,7 +193,7 @@ bool MyMoneyBudget::operator == (const MyMoneyBudget& right) const (m_start == right.m_start) ); } -void MyMoneyBudget::write(QDomElement& e, QDomDocument *doc) const +void MyMoneyBudget::write(TQDomElement& e, TQDomDocument *doc) const { writeBaseXML(*doc, e); @@ -201,20 +201,20 @@ void MyMoneyBudget::write(QDomElement& e, QDomDocument *doc) const e.setAttribute("start", m_start.toString(Qt::ISODate) ); e.setAttribute("version", BUDGET_VERSION); - QMap::const_iterator it; + TQMap::const_iterator it; for(it = m_accounts.begin(); it != m_accounts.end(); ++it) { // only add the account if there is a budget entered if(!(*it).balance().isZero()) { - QDomElement domAccount = doc->createElement("ACCOUNT"); + TQDomElement domAccount = doc->createElement("ACCOUNT"); domAccount.setAttribute("id", it.key()); domAccount.setAttribute("budgetlevel", AccountGroup::kBudgetLevelText[it.data().budgetLevel()]); domAccount.setAttribute("budgetsubaccounts", it.data().budgetSubaccounts()); - const QMap periods = it.data().getPeriods(); - QMap::const_iterator it_per; + const TQMap periods = it.data().getPeriods(); + TQMap::const_iterator it_per; for(it_per = periods.begin(); it_per != periods.end(); ++it_per) { if(!(*it_per).amount().isZero()) { - QDomElement domPeriod = doc->createElement("PERIOD"); + TQDomElement domPeriod = doc->createElement("PERIOD"); domPeriod.setAttribute("amount", (*it_per).amount().toString()); domPeriod.setAttribute("start", (*it_per).startDate().toString(Qt::ISODate)); @@ -227,7 +227,7 @@ void MyMoneyBudget::write(QDomElement& e, QDomDocument *doc) const } } -bool MyMoneyBudget::read(const QDomElement& e) +bool MyMoneyBudget::read(const TQDomElement& e) { // The goal of this reading method is 100% backward AND 100% forward // compatability. Any Budget ever created with any version of KMyMoney @@ -240,13 +240,13 @@ bool MyMoneyBudget::read(const QDomElement& e) { result = true; m_name = e.attribute("name"); - m_start = QDate::fromString(e.attribute("start"), Qt::ISODate); + m_start = TQDate::fromString(e.attribute("start"), Qt::ISODate); m_id = e.attribute("id"); - QDomNode child = e.firstChild(); + TQDomNode child = e.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); AccountGroup account; @@ -255,7 +255,7 @@ bool MyMoneyBudget::read(const QDomElement& e) account.setId(c.attribute("id")); if(c.hasAttribute("budgetlevel")) { - int i = AccountGroup::kBudgetLevelText.findIndex(c.attribute("budgetlevel")); + int i = AccountGroup::kBudgetLevelText.tqfindIndex(c.attribute("budgetlevel")); if ( i != -1 ) account.setBudgetLevel(static_cast(i)); } @@ -264,16 +264,16 @@ bool MyMoneyBudget::read(const QDomElement& e) account.setBudgetSubaccounts(c.attribute("budgetsubaccounts").toUInt()); } - QDomNode period = c.firstChild(); + TQDomNode period = c.firstChild(); while(!period.isNull() && period.isElement()) { - QDomElement per = period.toElement(); + TQDomElement per = period.toElement(); PeriodGroup pGroup; if("PERIOD" == per.tagName() && per.hasAttribute("amount") && per.hasAttribute("start")) { pGroup.setAmount( MyMoneyMoney(per.attribute("amount")) ); - pGroup.setStartDate( QDate::fromString(per.attribute("start"), Qt::ISODate) ); + pGroup.setStartDate( TQDate::fromString(per.attribute("start"), Qt::ISODate) ); account.addPeriod(pGroup.startDate(), pGroup); } @@ -289,27 +289,27 @@ bool MyMoneyBudget::read(const QDomElement& e) return result; } -void MyMoneyBudget::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyBudget::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("BUDGET"); + TQDomElement el = document.createElement("BUDGET"); write(el,&document); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyBudget::hasReferenceTo(const QString& id) const +bool MyMoneyBudget::hasReferenceTo(const TQString& id) const { // return true if we have an assignment for this id - return (m_accounts.contains(id)); + return (m_accounts.tqcontains(id)); } -void MyMoneyBudget::removeReference(const QString& id) +void MyMoneyBudget::removeReference(const TQString& id) { - if(m_accounts.contains(id)) { + if(m_accounts.tqcontains(id)) { m_accounts.remove(id); } } -void MyMoneyBudget::setAccount(const AccountGroup &_account, const QString _id) +void MyMoneyBudget::setAccount(const AccountGroup &_account, const TQString _id) { if(_account.isZero()) { m_accounts.remove(_id); @@ -322,25 +322,25 @@ void MyMoneyBudget::setAccount(const AccountGroup &_account, const QString _id) } } -const MyMoneyBudget::AccountGroup& MyMoneyBudget::account(const QString _id) const +const MyMoneyBudget::AccountGroup& MyMoneyBudget::account(const TQString _id) const { static AccountGroup empty; - if ( m_accounts.contains(_id) ) + if ( m_accounts.tqcontains(_id) ) return m_accounts[_id]; return empty; } -void MyMoneyBudget::setBudgetStart(const QDate& _start) +void MyMoneyBudget::setBudgetStart(const TQDate& _start) { - QDate oldDate = QDate(m_start.year(), m_start.month(), 1); - m_start = QDate(_start.year(), _start.month(), 1); + TQDate oldDate = TQDate(m_start.year(), m_start.month(), 1); + m_start = TQDate(_start.year(), _start.month(), 1); if(oldDate.isValid()) { int adjust = ((m_start.year() - oldDate.year())*12) + (m_start.month() - oldDate.month()); - QMap::iterator it; + TQMap::iterator it; for(it = m_accounts.begin(); it != m_accounts.end(); ++it) { - const QMap periods = (*it).getPeriods(); - QMap::const_iterator it_per; + const TQMap periods = (*it).getPeriods(); + TQMap::const_iterator it_per; (*it).clearPeriods(); for(it_per = periods.begin(); it_per != periods.end(); ++it_per) { PeriodGroup pgroup = (*it_per); diff --git a/kmymoney2/mymoney/mymoneybudget.h b/kmymoney2/mymoney/mymoneybudget.h index a2eea02..e7e44b4 100644 --- a/kmymoney2/mymoney/mymoneybudget.h +++ b/kmymoney2/mymoney/mymoneybudget.h @@ -25,11 +25,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -class QDomElement; -class QDomDocument; +#include +#include +#include +class TQDomElement; +class TQDomDocument; // ---------------------------------------------------------------------------- // Project Includes @@ -55,19 +55,19 @@ class KMYMONEY_EXPORT MyMoneyBudget: public MyMoneyObject public: MyMoneyBudget(void); ~MyMoneyBudget(); - MyMoneyBudget(const QString& _name); + MyMoneyBudget(const TQString& _name); /** * This constructor creates an object based on the data found in the - * QDomElement referenced by @p node. If problems arise, the @p id of + * TQDomElement referenced by @p node. If problems arise, the @p id of * the object is cleared (see MyMoneyObject::clearId()). */ - MyMoneyBudget(const QDomElement& node); + MyMoneyBudget(const TQDomElement& node); /** * This constructor creates an object based on the data found in the * MyMoneyBudget budget object. */ - MyMoneyBudget(const QString& id, const MyMoneyBudget& budget); + MyMoneyBudget(const TQString& id, const MyMoneyBudget& budget); /** * Helper class for MyMoneyBudget @@ -80,17 +80,17 @@ public: { public: // get functions - const QDate& startDate ( void ) const { return m_start; } + const TQDate& startDate ( void ) const { return m_start; } const MyMoneyMoney& amount( void ) const { return m_amount; } // set functions - void setStartDate ( const QDate& _start ) { m_start = _start; } + void setStartDate ( const TQDate& _start ) { m_start = _start; } void setAmount( const MyMoneyMoney& _amount ) { m_amount = _amount;} bool operator == (const PeriodGroup &r) const { return (m_start == r.m_start && m_amount == r.m_amount); } private: - QDate m_start; + TQDate m_start; MyMoneyMoney m_amount; }; @@ -113,23 +113,23 @@ public: eMax } eBudgetLevel; - static const QStringList kBudgetLevelText; + static const TQStringList kBudgetLevelText; public: AccountGroup() : m_budgetlevel(eNone), m_budgetsubaccounts(false) {} // get functions - const QString& id( void ) const { return m_id; } + const TQString& id( void ) const { return m_id; } bool budgetSubaccounts( void ) const { return m_budgetsubaccounts; } eBudgetLevel budgetLevel( void ) const { return m_budgetlevel; } - const PeriodGroup& period( const QDate &_date ) const { return m_periods[_date]; } - const QMap& getPeriods( void ) const { return m_periods; } + const PeriodGroup& period( const TQDate &_date ) const { return m_periods[_date]; } + const TQMap& getPeriods( void ) const { return m_periods; } void clearPeriods(void) { m_periods.clear(); } const MyMoneyMoney balance( void ) const { MyMoneyMoney balance; - QMap::const_iterator it; + TQMap::const_iterator it; for(it = m_periods.begin(); it != m_periods.end(); ++it) { balance += (*it).amount(); @@ -151,10 +151,10 @@ public: } // set functions - void setId( QString _id ) { m_id = _id; } + void setId( TQString _id ) { m_id = _id; } void setBudgetLevel( eBudgetLevel _level ) { m_budgetlevel = _level; } void setBudgetSubaccounts( bool _b ) { m_budgetsubaccounts = _b; } - void addPeriod( const QDate& _date, PeriodGroup &period ) { m_periods[_date] = period; } + void addPeriod( const TQDate& _date, PeriodGroup &period ) { m_periods[_date] = period; } // This member adds the value of another account group // m_budgetlevel is adjusted to the larger one of both @@ -171,11 +171,11 @@ public: void convertToMonthByMonth(void); private: - QString m_id; + TQString m_id; eBudgetLevel m_budgetlevel; bool m_budgetsubaccounts; - QMap m_periods; + TQMap m_periods; }; /** @@ -184,17 +184,17 @@ public: bool operator == (const MyMoneyBudget &) const; // Simple get operations - const QString& name(void) const { return m_name; } - const QDate& budgetStart(void) const { return m_start; } - QString id(void) const { return m_id; } - const AccountGroup & account(const QString _id) const; - bool contains(const QString _id) const { return m_accounts.contains(_id); } - QValueList getaccounts(void) const { return m_accounts.values(); } + const TQString& name(void) const { return m_name; } + const TQDate& budgetStart(void) const { return m_start; } + TQString id(void) const { return m_id; } + const AccountGroup & account(const TQString _id) const; + bool tqcontains(const TQString _id) const { return m_accounts.tqcontains(_id); } + TQValueList getaccounts(void) const { return m_accounts.values(); } // Simple set operations - void setName(const QString& _name) { m_name = _name; } - void setBudgetStart(const QDate& _start); - void setAccount(const AccountGroup &_account, const QString _id); + void setName(const TQString& _name) { m_name = _name; } + void setBudgetStart(const TQDate& _start); + void setAccount(const AccountGroup &_account, const TQString _id); /** * This method writes this Budget to the DOM element @p e, @@ -204,7 +204,7 @@ public: * @param doc The document which we can use to create new sub-elements * if needed */ - void write(QDomElement& e, QDomDocument *doc) const; + void write(TQDomElement& e, TQDomDocument *doc) const; /** * This method reads a Budget from the DOM element @p e, and @@ -216,17 +216,17 @@ public: * element @p e. If false is returned, the contents of this Budget * object are undefined. */ - bool read(const QDomElement& e); + bool read(const TQDomElement& e); /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. (This version overwrites the + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. (This version overwrites the * MMObject base class.) * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - virtual void writeXML(QDomDocument& document, QDomElement& parent) const; + virtual void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -238,31 +238,31 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * This member removes all references to object identified by @p id. Used * to remove objects which are about to be removed from the engine. */ - void removeReference(const QString& id); + void removeReference(const TQString& id); private: /** * The user-assigned name of the Budget */ - QString m_name; + TQString m_name; /** * The user-assigned year of the Budget */ - QDate m_start; + TQDate m_start; /** * Map the budgeted accounts * * Each account Id is stored against the AccountGroup information */ - QMap m_accounts; + TQMap m_accounts; }; #endif // MYMONEYBudget_H diff --git a/kmymoney2/mymoney/mymoneycategory.cpp b/kmymoney2/mymoney/mymoneycategory.cpp index 5bf55ab..8717237 100644 --- a/kmymoney2/mymoney/mymoneycategory.cpp +++ b/kmymoney2/mymoney/mymoneycategory.cpp @@ -21,13 +21,13 @@ MyMoneyCategory::MyMoneyCategory() m_income = true; } -MyMoneyCategory::MyMoneyCategory(const bool income, const QString name) +MyMoneyCategory::MyMoneyCategory(const bool income, const TQString name) { m_income = income; m_name = name; } -MyMoneyCategory::MyMoneyCategory(const bool income, const QString name, QStringList minors) +MyMoneyCategory::MyMoneyCategory(const bool income, const TQString name, TQStringList minors) { m_income = income; m_name = name; @@ -39,12 +39,12 @@ MyMoneyCategory::~MyMoneyCategory() } // Functions use the find method to search the list -bool MyMoneyCategory::addMinorCategory(const QString val) +bool MyMoneyCategory::addMinorCategory(const TQString val) { if (val.isEmpty() || val.isNull()) return false; - if (m_minorCategories.find(val) == m_minorCategories.end()) { + if (m_minorCategories.tqfind(val) == m_minorCategories.end()) { m_minorCategories.append(val); return true; } @@ -52,12 +52,12 @@ bool MyMoneyCategory::addMinorCategory(const QString val) return false; } -bool MyMoneyCategory::removeMinorCategory(const QString val) +bool MyMoneyCategory::removeMinorCategory(const TQString val) { if (val.isEmpty() || val.isNull()) return false; - if (m_minorCategories.find(val) != m_minorCategories.end()) { + if (m_minorCategories.tqfind(val) != m_minorCategories.end()) { m_minorCategories.remove(val); return true; } @@ -65,13 +65,13 @@ bool MyMoneyCategory::removeMinorCategory(const QString val) return false; } -bool MyMoneyCategory::renameMinorCategory(const QString oldVal, const QString newVal) +bool MyMoneyCategory::renameMinorCategory(const TQString oldVal, const TQString newVal) { if (oldVal.isEmpty() || oldVal.isNull() || newVal.isEmpty() || newVal.isNull()) return false; - if (m_minorCategories.find(oldVal) != m_minorCategories.end() && - m_minorCategories.find(newVal) == m_minorCategories.end() ) { + if (m_minorCategories.tqfind(oldVal) != m_minorCategories.end() && + m_minorCategories.tqfind(newVal) == m_minorCategories.end() ) { m_minorCategories.remove(oldVal); return addMinorCategory(newVal); @@ -80,16 +80,16 @@ bool MyMoneyCategory::renameMinorCategory(const QString oldVal, const QString ne return false; } -bool MyMoneyCategory::addMinorCategory(QStringList values) +bool MyMoneyCategory::addMinorCategory(TQStringList values) { - for (QStringList::Iterator it = values.begin(); it!=values.end(); ++it) { + for (TQStringList::Iterator it = values.begin(); it!=values.end(); ++it) { addMinorCategory(*it); } return true; } -bool MyMoneyCategory::setMinorCategories(QStringList values) +bool MyMoneyCategory::setMinorCategories(TQStringList values) { m_minorCategories.clear(); return addMinorCategory(values); @@ -101,7 +101,7 @@ bool MyMoneyCategory::removeAllMinors(void) return true; } -QString MyMoneyCategory::firstMinor(void) +TQString MyMoneyCategory::firstMinor(void) { return m_minorCategories.first(); } @@ -123,26 +123,26 @@ MyMoneyCategory& MyMoneyCategory::operator = (const MyMoneyCategory& right) return *this; } -QDataStream &operator<<(QDataStream &s, MyMoneyCategory &category) +TQDataStream &operator<<(TQDataStream &s, MyMoneyCategory &category) { if (category.m_income) - s << (Q_INT32)1; + s << (TQ_INT32)1; else - s << (Q_INT32)0; + s << (TQ_INT32)0; s << category.m_name; - s << (Q_UINT32)category.m_minorCategories.count(); - for (QStringList::Iterator it = category.m_minorCategories.begin(); it!=category.m_minorCategories.end(); ++it) { + s << (TQ_UINT32)category.m_minorCategories.count(); + for (TQStringList::Iterator it = category.m_minorCategories.begin(); it!=category.m_minorCategories.end(); ++it) { s << (*it); } return s; } -QDataStream &operator>>(QDataStream &s, MyMoneyCategory &category) +TQDataStream &operator>>(TQDataStream &s, MyMoneyCategory &category) { - Q_INT32 inc; + TQ_INT32 inc; s >> inc; if (inc==0) category.m_income = false; @@ -151,8 +151,8 @@ QDataStream &operator>>(QDataStream &s, MyMoneyCategory &category) s >> category.m_name; - Q_UINT32 minorCount; - QString buffer; + TQ_UINT32 minorCount; + TQString buffer; s >> minorCount; category.m_minorCategories.clear(); diff --git a/kmymoney2/mymoney/mymoneycategory.h b/kmymoney2/mymoney/mymoneycategory.h index 3f4babc..b642c74 100644 --- a/kmymoney2/mymoney/mymoneycategory.h +++ b/kmymoney2/mymoney/mymoneycategory.h @@ -20,8 +20,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include /** * @deprecated This class represents an Income or Expense category. Please don't @@ -29,34 +29,34 @@ */ class MyMoneyCategory { bool m_income; // if false, m_income == expense - QString m_name; - QStringList m_minorCategories; + TQString m_name; + TQStringList m_minorCategories; - friend QDataStream &operator<<(QDataStream &, MyMoneyCategory &); - friend QDataStream &operator>>(QDataStream &, MyMoneyCategory &); + friend TQDataStream &operator<<(TQDataStream &, MyMoneyCategory &); + friend TQDataStream &operator>>(TQDataStream &, MyMoneyCategory &); public: MyMoneyCategory(); - MyMoneyCategory(const bool income, const QString name); - MyMoneyCategory(const bool income, const QString name, QStringList minors); + MyMoneyCategory(const bool income, const TQString name); + MyMoneyCategory(const bool income, const TQString name, TQStringList minors); ~MyMoneyCategory(); // Simple get operations - QString name(void) { return m_name; } - QStringList& minorCategories(void) { return m_minorCategories; } + TQString name(void) { return m_name; } + TQStringList& minorCategories(void) { return m_minorCategories; } // Simple set operations bool isIncome(void) { return m_income; } void setIncome(const bool val) { m_income = val; } - void setName(const QString val) { m_name = val; } + void setName(const TQString val) { m_name = val; } - bool setMinorCategories(QStringList values); - bool addMinorCategory(const QString val); - bool removeMinorCategory(const QString val); - bool renameMinorCategory(const QString oldVal, const QString newVal); - bool addMinorCategory(QStringList values); + bool setMinorCategories(TQStringList values); + bool addMinorCategory(const TQString val); + bool removeMinorCategory(const TQString val); + bool renameMinorCategory(const TQString oldVal, const TQString newVal); + bool addMinorCategory(TQStringList values); bool removeAllMinors(void); - QString firstMinor(void); + TQString firstMinor(void); void clear(void); diff --git a/kmymoney2/mymoney/mymoneyexception.cpp b/kmymoney2/mymoney/mymoneyexception.cpp index 6b61e67..4ee0970 100644 --- a/kmymoney2/mymoney/mymoneyexception.cpp +++ b/kmymoney2/mymoney/mymoneyexception.cpp @@ -22,7 +22,7 @@ #include "mymoneyexception.h" -MyMoneyException::MyMoneyException(const QString& msg, const QString& file, const unsigned long line) +MyMoneyException::MyMoneyException(const TQString& msg, const TQString& file, const unsigned long line) { // qDebug("MyMoneyException(%s,%s,%d)", msg.data(), file.data(), line); m_msg = msg; diff --git a/kmymoney2/mymoney/mymoneyexception.h b/kmymoney2/mymoney/mymoneyexception.h index 68cf2af..41020b3 100644 --- a/kmymoney2/mymoney/mymoneyexception.h +++ b/kmymoney2/mymoney/mymoneyexception.h @@ -30,7 +30,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include #include /** * @file @@ -57,8 +57,8 @@ public: /** * The constructor to create a new MyMoneyException object. * - * @param msg reference to QString containing the message - * @param file reference to QString containing the name of the sourcefile where + * @param msg reference to TQString containing the message + * @param file reference to TQString containing the name of the sourcefile where * the exception was thrown * @param line unsigned long containing the line number of the line where * the exception was thrown in the file. @@ -67,7 +67,7 @@ public: * MYMONEYEXCEPTION(text) instead. It automatically assigns the file * and line parameter to the correct values. */ - MyMoneyException(const QString& msg, const QString& file, const unsigned long line); + MyMoneyException(const TQString& msg, const TQString& file, const unsigned long line); ~MyMoneyException(); @@ -75,17 +75,17 @@ public: * This method is used to return the message that was passed * during the creation of the exception object. * - * @return reference to QString containing the message + * @return reference to TQString containing the message */ - const QString& what(void) const { return m_msg; }; + const TQString& what(void) const { return m_msg; }; /** * This method is used to return the filename that was passed * during the creation of the exception object. * - * @return reference to QString containing the filename + * @return reference to TQString containing the filename */ - const QString& file(void) const { return m_file; }; + const TQString& file(void) const { return m_file; }; /** * This method is used to return the linenumber that was passed @@ -99,12 +99,12 @@ private: /** * This member variable holds the message */ - QString m_msg; + TQString m_msg; /** * This member variable holds the filename */ - QString m_file; + TQString m_file; /** * This member variable holds the line number diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp index 3245746..8707614 100644 --- a/kmymoney2/mymoney/mymoneyfile.cpp +++ b/kmymoney2/mymoney/mymoneyfile.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -44,8 +44,8 @@ #include "config.h" #endif -const QString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances"); -const QString MyMoneyFile::AccountSeperator = ":"; +const TQString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances"); +const TQString MyMoneyFile::AccountSeperator = ":"; // include the following line to get a 'cout' for debug purposes // #include @@ -71,7 +71,7 @@ public: * false - don't reload the object immediately * true - reload the object immediately */ - QMap m_notificationList; + TQMap m_notificationList; }; @@ -146,7 +146,7 @@ void MyMoneyFile::checkTransaction(const char* txt) const { checkStorage(); if(!d->m_inTransaction) { - throw new MYMONEYEXCEPTION(QString("No transaction started for %1").arg(txt)); + throw new MYMONEYEXCEPTION(TQString("No transaction started for %1").tqarg(txt)); } } @@ -175,7 +175,7 @@ void MyMoneyFile::addInstitution(MyMoneyInstitution& institution) { // perform some checks to see that the institution stuff is OK. For // now we assume that the institution must have a name, the ID is not set - // and it does not have a parent (MyMoneyFile). + // and it does not have a tqparent (MyMoneyFile). if(institution.name().length() == 0 || institution.id().length() != 0) @@ -212,7 +212,7 @@ void MyMoneyFile::modifyTransaction(const MyMoneyTransaction& transaction) // now check the splits bool loanAccountAffected = false; - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist @@ -229,7 +229,7 @@ void MyMoneyFile::modifyTransaction(const MyMoneyTransaction& transaction) // into amortization splits if(loanAccountAffected) { tCopy = transaction; - QValueList list = transaction.splits(); + TQValueList list = transaction.splits(); for(it_s = list.begin(); it_s != list.end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionTransfer) { MyMoneyAccount acc = MyMoneyFile::account((*it_s).accountId()); @@ -318,7 +318,7 @@ void MyMoneyFile::modifyAccount(const MyMoneyAccount& _account) addNotification(account.id()); } -void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) +void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) { checkTransaction(__PRETTY_FUNCTION__); @@ -326,47 +326,47 @@ void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& paren if(isStandardAccount(account.id())) throw new MYMONEYEXCEPTION("Unable to reparent the standard account groups"); - if(account.accountGroup() == parent.accountGroup() - || (account.accountType() == MyMoneyAccount::Income && parent.accountType() == MyMoneyAccount::Expense) - || (account.accountType() == MyMoneyAccount::Expense && parent.accountType() == MyMoneyAccount::Income)) { + if(account.accountGroup() == tqparent.accountGroup() + || (account.accountType() == MyMoneyAccount::Income && tqparent.accountType() == MyMoneyAccount::Expense) + || (account.accountType() == MyMoneyAccount::Expense && tqparent.accountType() == MyMoneyAccount::Income)) { - if(account.isInvest() && parent.accountType() != MyMoneyAccount::Investment) + if(account.isInvest() && tqparent.accountType() != MyMoneyAccount::Investment) throw new MYMONEYEXCEPTION("Unable to reparent Stock to non-investment account"); - if(parent.accountType() == MyMoneyAccount::Investment && !account.isInvest()) + if(tqparent.accountType() == MyMoneyAccount::Investment && !account.isInvest()) throw new MYMONEYEXCEPTION("Unable to reparent non-stock to investment account"); // clear all changed objects from cache MyMoneyNotifier notifier(this); - // keep a notification of the current parent - addNotification(account.parentAccountId()); + // keep a notification of the current tqparent + addNotification(account.tqparentAccountId()); - m_storage->reparentAccount(account, parent); + m_storage->reparentAccount(account, tqparent); - // and also keep one for the account itself and the new parent + // and also keep one for the account itself and the new tqparent addNotification(account.id()); - addNotification(parent.id()); + addNotification(tqparent.id()); } else throw new MYMONEYEXCEPTION("Unable to reparent to different account type"); } -const MyMoneyInstitution& MyMoneyFile::institution(const QString& id) const +const MyMoneyInstitution& MyMoneyFile::institution(const TQString& id) const { return d->m_cache.institution(id); } -const MyMoneyAccount& MyMoneyFile::account(const QString& id) const +const MyMoneyAccount& MyMoneyFile::account(const TQString& id) const { return d->m_cache.account(id); } -const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, const QString& name) const +const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, const TQString& name) const { static MyMoneyAccount nullAccount; - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { const MyMoneyAccount& sacc = account(*it_a); if(sacc.name() == name) @@ -375,7 +375,7 @@ const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, c return nullAccount; } -const MyMoneyAccount& MyMoneyFile::accountByName(const QString& name) const +const MyMoneyAccount& MyMoneyFile::accountByName(const TQString& name) const { return d->m_cache.accountByName(name); } @@ -389,7 +389,7 @@ void MyMoneyFile::removeTransaction(const MyMoneyTransaction& transaction) // get the engine's idea about this transaction MyMoneyTransaction tr = MyMoneyFile::transaction(transaction.id()); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; // scan the splits again to update notification list for(it_s = tr.splits().begin(); it_s != tr.splits().end(); ++it_s) { @@ -404,21 +404,21 @@ void MyMoneyFile::removeTransaction(const MyMoneyTransaction& transaction) } -bool MyMoneyFile::hasActiveSplits(const QString& id) const +bool MyMoneyFile::hasActiveSplits(const TQString& id) const { checkStorage(); return m_storage->hasActiveSplits(id); } -bool MyMoneyFile::isStandardAccount(const QString& id) const +bool MyMoneyFile::isStandardAccount(const TQString& id) const { checkStorage(); return m_storage->isStandardAccount(id); } -void MyMoneyFile::setAccountName(const QString& id, const QString& name) const +void MyMoneyFile::setAccountName(const TQString& id, const TQString& name) const { checkTransaction(__PRETTY_FUNCTION__); @@ -429,14 +429,14 @@ void MyMoneyFile::removeAccount(const MyMoneyAccount& account) { checkTransaction(__PRETTY_FUNCTION__); - MyMoneyAccount parent; + MyMoneyAccount tqparent; MyMoneyAccount acc; MyMoneyInstitution institution; - // check that the account and its parent exist + // check that the account and its tqparent exist // this will throw an exception if the id is unknown acc = MyMoneyFile::account(account.id()); - parent = MyMoneyFile::account(account.parentAccountId()); + tqparent = MyMoneyFile::account(account.tqparentAccountId()); if(!acc.institutionId().isEmpty()) institution = MyMoneyFile::institution(acc.institutionId()); @@ -452,25 +452,25 @@ void MyMoneyFile::removeAccount(const MyMoneyAccount& account) MyMoneyNotifier notifier(this); // collect all sub-ordinate accounts for notification - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it = acc.accountList().begin(); it != acc.accountList().end(); ++it) addNotification(*it); - // don't forget the parent and a possible institution - addNotification(parent.id()); + // don't forget the tqparent and a possible institution + addNotification(tqparent.id()); addNotification(account.institutionId()); if(!institution.id().isEmpty()) { institution.removeAccountId(account.id()); m_storage->modifyInstitution(institution); } - acc.setInstitutionId(QString()); + acc.setInstitutionId(TQString()); m_storage->removeAccount(acc); addNotification(acc.id(), false); d->m_cache.clear(acc.id()); } -void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned int level) { +void MyMoneyFile::removeAccountList(const TQStringList& account_list, unsigned int level) { if (level > 100) throw new MYMONEYEXCEPTION("Too deep recursion in [MyMoneyFile::removeAccountList]!"); @@ -486,7 +486,7 @@ void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned in } // process all accounts in the list and test if they have transactions assigned - for (QStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { + for (TQStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { MyMoneyAccount a = m_storage->account(*it); //kdDebug() << "Deleting account '"<< a.name() << "'" << endl; @@ -503,12 +503,12 @@ void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned in } } -bool MyMoneyFile::hasOnlyUnusedAccounts(const QStringList& account_list, unsigned int level) +bool MyMoneyFile::hasOnlyUnusedAccounts(const TQStringList& account_list, unsigned int level) { if (level > 100) throw new MYMONEYEXCEPTION("Too deep recursion in [MyMoneyFile::hasOnlyUnusedAccounts]!"); // process all accounts in the list and test if they have transactions assigned - for (QStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { + for (TQStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { if (transactionCount(*it) != 0) return false; // the current account has a transaction assigned if (!hasOnlyUnusedAccounts(account(*it).accountList(), level+1)) @@ -525,14 +525,14 @@ void MyMoneyFile::removeInstitution(const MyMoneyInstitution& institution) // clear all changed objects from cache MyMoneyNotifier notifier(this); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; MyMoneyInstitution inst = MyMoneyFile::institution(institution.id()); bool blocked = signalsBlocked(); blockSignals(true); for(it_a = inst.accountList().begin(); it_a != inst.accountList().end(); ++it_a) { MyMoneyAccount acc = account(*it_a); - acc.setInstitutionId(QString()); + acc.setInstitutionId(TQString()); modifyAccount(acc); } blockSignals(blocked); @@ -542,7 +542,7 @@ void MyMoneyFile::removeInstitution(const MyMoneyInstitution& institution) addNotification(institution.id(), false); } -void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) +void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& tqparent) { checkTransaction(__PRETTY_FUNCTION__); @@ -550,7 +550,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) // perform some checks to see that the account stuff is OK. For // now we assume that the account must have a name, has no - // transaction and sub-accounts and parent account + // transaction and sub-accounts and tqparent account // it's own ID is not set and it does not have a pointer to (MyMoneyFile) if(account.name().length() == 0) @@ -562,16 +562,16 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) if(account.accountList().count() != 0) throw new MYMONEYEXCEPTION("New account must have no sub-accounts"); - if(!account.parentAccountId().isEmpty()) - throw new MYMONEYEXCEPTION("New account must have no parent-id"); + if(!account.tqparentAccountId().isEmpty()) + throw new MYMONEYEXCEPTION("New account must have no tqparent-id"); if(account.accountType() == MyMoneyAccount::UnknownAccountType) throw new MYMONEYEXCEPTION("Account has invalid type"); - // make sure, that the parent account exists + // make sure, that the tqparent account exists // if not, an exception is thrown. If it exists, // get a copy of the current data - MyMoneyAccount acc = MyMoneyFile::account(parent.id()); + MyMoneyAccount acc = MyMoneyFile::account(tqparent.id()); #if 0 // TODO: remove the following code as we now can have multiple accounts @@ -579,7 +579,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) // // check if the selected name is currently not among the child accounts // if we find one, then return it as the new account - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount a = MyMoneyFile::account(*it_a); if(account.name() == a.name()) { @@ -589,23 +589,23 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) } #endif - // FIXME: make sure, that the parent has the same type + // FIXME: make sure, that the tqparent has the same type // I left it out here because I don't know, if there is // a tight coupling between e.g. checking accounts and the // class asset. It certainly does not make sense to create an // expense account under an income account. Maybe it does, I don't know. - // We enforce, that a stock account can never be a parent and - // that the parent for a stock account must be an investment. Also, - // an investment cannot have another investment account as it's parent - if(parent.isInvest()) - throw new MYMONEYEXCEPTION("Stock account cannot be parent account"); + // We enforce, that a stock account can never be a tqparent and + // that the tqparent for a stock account must be an investment. Also, + // an investment cannot have another investment account as it's tqparent + if(tqparent.isInvest()) + throw new MYMONEYEXCEPTION("Stock account cannot be tqparent account"); - if(account.isInvest() && parent.accountType() != MyMoneyAccount::Investment) - throw new MYMONEYEXCEPTION("Stock account must have investment account as parent "); + if(account.isInvest() && tqparent.accountType() != MyMoneyAccount::Investment) + throw new MYMONEYEXCEPTION("Stock account must have investment account as tqparent "); - if(!account.isInvest() && parent.accountType() == MyMoneyAccount::Investment) - throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as children"); + if(!account.isInvest() && tqparent.accountType() == MyMoneyAccount::Investment) + throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as tqchildren"); // clear all changed objects from cache MyMoneyNotifier notifier(this); @@ -619,13 +619,13 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) if(!account.openingDate().isValid()) { - account.setOpeningDate(QDate::currentDate()); + account.setOpeningDate(TQDate::tqcurrentDate()); } - account.setParentAccountId(parent.id()); + account.setParentAccountId(tqparent.id()); m_storage->addAccount(account); - m_storage->addAccount(parent, account); + m_storage->addAccount(tqparent, account); if(account.institutionId().length() != 0) { institution.addAccountId(account.id()); @@ -634,7 +634,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) } d->m_cache.preloadAccount(account); - addNotification(parent.id()); + addNotification(tqparent.id()); } MyMoneyTransaction MyMoneyFile::createOpeningBalanceTransaction(const MyMoneyAccount& acc, const MyMoneyMoney& balance) @@ -674,9 +674,9 @@ MyMoneyTransaction MyMoneyFile::createOpeningBalanceTransaction(const MyMoneyAcc return t; } -QString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const +TQString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const { - QString result; + TQString result; MyMoneySecurity currency = security(acc.currencyId()); MyMoneyAccount openAcc; @@ -694,8 +694,8 @@ QString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const // Iterate over all the opening balance transactions for this currency MyMoneyTransactionFilter filter; filter.addAccount(openAcc.id()); - QValueList transactions = transactionList(filter); - QValueList::const_iterator it_t = transactions.begin(); + TQValueList transactions = transactionList(filter); + TQValueList::const_iterator it_t = transactions.begin(); while ( it_t != transactions.end() ) { try @@ -757,10 +757,10 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe throw new MYMONEYEXCEPTION("Opening balance for non currencies not supported"); MyMoneyAccount acc; - QRegExp match(QString("^%1").arg(i18n(MyMoneyFile::OpeningBalancesPrefix))); + TQRegExp match(TQString("^%1").tqarg(i18n(MyMoneyFile::OpeningBalancesPrefix))); - QValueList accounts; - QValueList::Iterator it; + TQValueList accounts; + TQValueList::Iterator it; accountList(accounts, equity().accountList(), true); @@ -774,7 +774,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe } if(acc.id().isEmpty()) { - throw new MYMONEYEXCEPTION(QString("No opening balance account for %1").arg(security.tradingSymbol())); + throw new MYMONEYEXCEPTION(TQString("No opening balance account for %1").tqarg(security.tradingSymbol())); } return acc; @@ -785,16 +785,16 @@ const MyMoneyAccount MyMoneyFile::createOpeningBalanceAccount(const MyMoneySecur checkTransaction(__PRETTY_FUNCTION__); MyMoneyAccount acc; - QString name(i18n(MyMoneyFile::OpeningBalancesPrefix)); + TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix)); if(security.id() != baseCurrency().id()) { - name += QString(" (%1)").arg(security.id()); + name += TQString(" (%1)").tqarg(security.id()); } acc.setName(name); acc.setAccountType(MyMoneyAccount::Equity); acc.setCurrencyId(security.id()); - MyMoneyAccount parent = equity(); - this->addAccount(acc, parent); + MyMoneyAccount tqparent = equity(); + this->addAccount(acc, tqparent); return acc; } @@ -819,7 +819,7 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction) // now check the splits bool loanAccountAffected = false; - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist or is one of the standard accounts @@ -835,7 +835,7 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction) // change transfer splits between asset/liability and loan accounts // into amortization splits if(loanAccountAffected) { - QValueList list = transaction.splits(); + TQValueList list = transaction.splits(); for(it_s = list.begin(); it_s != list.end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionTransfer) { MyMoneyAccount acc = MyMoneyFile::account((*it_s).accountId()); @@ -864,14 +864,14 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction) } } -const MyMoneyTransaction MyMoneyFile::transaction(const QString& id) const +const MyMoneyTransaction MyMoneyFile::transaction(const TQString& id) const { checkStorage(); return m_storage->transaction(id); } -const MyMoneyTransaction MyMoneyFile::transaction(const QString& account, const int idx) const +const MyMoneyTransaction MyMoneyFile::transaction(const TQString& account, const int idx) const { checkStorage(); @@ -890,12 +890,12 @@ void MyMoneyFile::addPayee(MyMoneyPayee& payee) d->m_cache.preloadPayee(payee); } -const MyMoneyPayee& MyMoneyFile::payee(const QString& id) const +const MyMoneyPayee& MyMoneyFile::payee(const TQString& id) const { return d->m_cache.payee(id); } -const MyMoneyPayee& MyMoneyFile::payeeByName(const QString& name) const +const MyMoneyPayee& MyMoneyFile::payeeByName(const TQString& name) const { checkStorage(); @@ -926,7 +926,7 @@ void MyMoneyFile::removePayee(const MyMoneyPayee& payee) addNotification(payee.id(), false); } -void MyMoneyFile::accountList(QValueList& list, const QStringList& idlist, const bool recursive) const +void MyMoneyFile::accountList(TQValueList& list, const TQStringList& idlist, const bool recursive) const { if(idlist.isEmpty()) { d->m_cache.account(list); @@ -940,8 +940,8 @@ void MyMoneyFile::accountList(QValueList& list, const QStringLis } #endif - QValueList::Iterator it; - QValueList::Iterator next; + TQValueList::Iterator it; + TQValueList::Iterator next; for(it = list.begin(); it != list.end(); ) { if(isStandardAccount( (*it).id() )) { it = list.erase(it); @@ -950,13 +950,13 @@ void MyMoneyFile::accountList(QValueList& list, const QStringLis } } } else { - QValueList::ConstIterator it; - QValueList list_a; + TQValueList::ConstIterator it; + TQValueList list_a; d->m_cache.account(list_a); for(it = list_a.begin(); it != list_a.end(); ++it) { if(!isStandardAccount((*it).id())) { - if(idlist.findIndex((*it).id()) != -1) { + if(idlist.tqfindIndex((*it).id()) != -1) { list.append(*it); if(recursive == true) { accountList(list, (*it).accountList(), true); @@ -967,14 +967,14 @@ void MyMoneyFile::accountList(QValueList& list, const QStringLis } } -void MyMoneyFile::institutionList(QValueList& list) const +void MyMoneyFile::institutionList(TQValueList& list) const { d->m_cache.institution(list); } -const QValueList MyMoneyFile::institutionList(void) const +const TQValueList MyMoneyFile::institutionList(void) const { - QValueList list; + TQValueList list; institutionList(list); return list; } @@ -1055,17 +1055,17 @@ const MyMoneyAccount& MyMoneyFile::equity(void) const { checkStorage(); - return d->m_cache.account (STD_ACC_EQUITY); + return d->m_cache.account (STD_ACC_ETQUITY); } -unsigned int MyMoneyFile::transactionCount(const QString& account) const +unsigned int MyMoneyFile::transactionCount(const TQString& account) const { checkStorage(); return m_storage->transactionCount(account); } -const QMap MyMoneyFile::transactionCountMap(void) const +const TQMap MyMoneyFile::transactionCountMap(void) const { checkStorage(); @@ -1079,21 +1079,21 @@ unsigned int MyMoneyFile::institutionCount(void) const return m_storage->institutionCount(); } -const MyMoneyMoney MyMoneyFile::balance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyFile::balance(const TQString& id, const TQDate& date) const { checkStorage(); return m_storage->balance(id, date); } -const MyMoneyMoney MyMoneyFile::totalBalance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyFile::totalBalance(const TQString& id, const TQDate& date) const { checkStorage(); return m_storage->totalBalance(id, date); } -void MyMoneyFile::warningMissingRate(const QString& fromId, const QString& toId) const +void MyMoneyFile::warningMissingRate(const TQString& fromId, const TQString& toId) const { MyMoneySecurity from, to; try { @@ -1109,7 +1109,7 @@ void MyMoneyFile::warningMissingRate(const QString& fromId, const QString& toId) void MyMoneyFile::notify(void) { - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = d->m_notificationList.begin(); it != d->m_notificationList.end(); ++it) { if(*it) d->m_cache.refresh(it.key()); @@ -1119,7 +1119,7 @@ void MyMoneyFile::notify(void) clearNotification(); } -void MyMoneyFile::addNotification(const QString& id, bool reload) +void MyMoneyFile::addNotification(const TQString& id, bool reload) { if(!id.isEmpty()) d->m_notificationList[id] = reload; @@ -1131,36 +1131,36 @@ void MyMoneyFile::clearNotification() d->m_notificationList.clear(); } -void MyMoneyFile::transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const +void MyMoneyFile::transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const { checkStorage(); m_storage->transactionList(list, filter); } -void MyMoneyFile::transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const +void MyMoneyFile::transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const { checkStorage(); m_storage->transactionList(list, filter); } -const QValueList MyMoneyFile::transactionList(MyMoneyTransactionFilter& filter) const +const TQValueList MyMoneyFile::transactionList(MyMoneyTransactionFilter& filter) const { - QValueList list; + TQValueList list; transactionList(list, filter); return list; } -const QValueList MyMoneyFile::payeeList(void) const +const TQValueList MyMoneyFile::payeeList(void) const { - QValueList list; + TQValueList list; d->m_cache.payee(list); return list; } -QString MyMoneyFile::accountToCategory(const QString& accountId, bool includeStandardAccounts) const +TQString MyMoneyFile::accountToCategory(const TQString& accountId, bool includeStandardAccounts) const { MyMoneyAccount acc; - QString rc; + TQString rc; if(!accountId.isEmpty()) { acc = account(accountId); @@ -1168,15 +1168,15 @@ QString MyMoneyFile::accountToCategory(const QString& accountId, bool includeSta if(!rc.isEmpty()) rc = AccountSeperator + rc; rc = acc.name() + rc; - acc = account(acc.parentAccountId()); + acc = account(acc.tqparentAccountId()); } while(!acc.id().isEmpty() && (includeStandardAccounts || !isStandardAccount(acc.id()))); } return rc; } -QString MyMoneyFile::categoryToAccount(const QString& category, MyMoneyAccount::accountTypeE type) const +TQString MyMoneyFile::categoryToAccount(const TQString& category, MyMoneyAccount::accountTypeE type) const { - QString id; + TQString id; // search the category in the expense accounts and if it is not found, try // to locate it in the income accounts @@ -1193,9 +1193,9 @@ QString MyMoneyFile::categoryToAccount(const QString& category, MyMoneyAccount:: return id; } -QString MyMoneyFile::nameToAccount(const QString& name) const +TQString MyMoneyFile::nameToAccount(const TQString& name) const { - QString id; + TQString id; // search the category in the asset accounts and if it is not found, try // to locate it in the liability accounts @@ -1206,20 +1206,20 @@ QString MyMoneyFile::nameToAccount(const QString& name) const return id; } -QString MyMoneyFile::parentName(const QString& name) const +TQString MyMoneyFile::tqparentName(const TQString& name) const { return name.section(AccountSeperator, 0, -2); } -QString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const QString& category) const +TQString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const TQString& category) const { MyMoneyAccount nextBase; - QString level, remainder; + TQString level, remainder; level = category.section(AccountSeperator, 0, 0); remainder = category.section(AccountSeperator, 1); - QStringList list = base.accountList(); - QStringList::ConstIterator it_a; + TQStringList list = base.accountList(); + TQStringList::ConstIterator it_a; for(it_a = list.begin(); it_a != list.end(); ++it_a) { nextBase = account(*it_a); @@ -1230,17 +1230,17 @@ QString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const QString& return locateSubAccount(nextBase, remainder); } } - return QString(); + return TQString(); } -QString MyMoneyFile::value(const QString& key) const +TQString MyMoneyFile::value(const TQString& key) const { checkStorage(); return m_storage->value(key); } -void MyMoneyFile::setValue(const QString& key, const QString& val) +void MyMoneyFile::setValue(const TQString& key, const TQString& val) { checkTransaction(__PRETTY_FUNCTION__); @@ -1250,7 +1250,7 @@ void MyMoneyFile::setValue(const QString& key, const QString& val) m_storage->setValue(key, val); } -void MyMoneyFile::deletePair(const QString& key) +void MyMoneyFile::deletePair(const TQString& key) { checkTransaction(__PRETTY_FUNCTION__); @@ -1265,7 +1265,7 @@ void MyMoneyFile::addSchedule(MyMoneySchedule& sched) checkTransaction(__PRETTY_FUNCTION__); MyMoneyTransaction transaction = sched.transaction(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist or is one of the standard accounts @@ -1287,7 +1287,7 @@ void MyMoneyFile::modifySchedule(const MyMoneySchedule& sched) checkTransaction(__PRETTY_FUNCTION__); MyMoneyTransaction transaction = sched.transaction(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist or is one of the standard accounts @@ -1318,18 +1318,18 @@ void MyMoneyFile::removeSchedule(const MyMoneySchedule& sched) addNotification(sched.id(), false); } -const MyMoneySchedule MyMoneyFile::schedule(const QString& id) const +const MyMoneySchedule MyMoneyFile::schedule(const TQString& id) const { return d->m_cache.schedule(id); } -const QValueList MyMoneyFile::scheduleList( - const QString& accountId, +const TQValueList MyMoneyFile::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 { checkStorage(); @@ -1338,29 +1338,29 @@ const QValueList MyMoneyFile::scheduleList( } -const QStringList MyMoneyFile::consistencyCheck(void) +const TQStringList MyMoneyFile::consistencyCheck(void) { - QValueList list; - QValueList::Iterator it_a; - QValueList::Iterator it_sch; - QValueList::Iterator it_p; - QValueList::Iterator it_t; - QValueList::Iterator it_r; - QStringList accountRebuild; - QStringList::ConstIterator it_c; + TQValueList list; + TQValueList::Iterator it_a; + TQValueList::Iterator it_sch; + TQValueList::Iterator it_p; + TQValueList::Iterator it_t; + TQValueList::Iterator it_r; + TQStringList accountRebuild; + TQStringList::ConstIterator it_c; - QMap interestAccounts; + TQMap interestAccounts; - MyMoneyAccount parent; + MyMoneyAccount tqparent; MyMoneyAccount child; MyMoneyAccount toplevel; - QString parentId; - QStringList rc; + TQString tqparentId; + TQStringList rc; int problemCount = 0; int unfixedCount = 0; - QString problemAccount; + TQString problemAccount; // check that we have a storage object checkTransaction(__PRETTY_FUNCTION__); @@ -1404,27 +1404,27 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // check for loops in the hierarchy - parentId = (*it_a).parentAccountId(); + tqparentId = (*it_a).tqparentAccountId(); try { bool dropOut = false; - while(!isStandardAccount(parentId) && !dropOut) { - parent = account(parentId); - if(parent.id() == (*it_a).id()) { - // parent loops, so we need to re-parent to toplevel account - // find parent account in our list + while(!isStandardAccount(tqparentId) && !dropOut) { + tqparent = account(tqparentId); + if(tqparent.id() == (*it_a).id()) { + // tqparent loops, so we need to re-tqparent to toplevel account + // find tqparent account in our list problemCount++; - QValueList::Iterator it_b; + TQValueList::Iterator it_b; for(it_b = list.begin(); it_b != list.end(); ++it_b) { - if((*it_b).id() == parent.id()) { + if((*it_b).id() == tqparent.id()) { if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); - rc << i18n(" * Loop detected between this account and account '%2'.").arg((*it_b).name()); - rc << i18n(" Reparenting account '%2' to top level account '%1'.").arg(toplevel.name(), (*it_a).name()); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); + rc << i18n(" * Loop detected between this account and account '%2'.").tqarg((*it_b).name()); + rc << i18n(" Retqparenting account '%2' to top level account '%1'.").tqarg(toplevel.name(), (*it_a).name()); (*it_a).setParentAccountId(toplevel.id()); - if(accountRebuild.contains(toplevel.id()) == 0) + if(accountRebuild.tqcontains(toplevel.id()) == 0) accountRebuild << toplevel.id(); - if(accountRebuild.contains((*it_a).id()) == 0) + if(accountRebuild.tqcontains((*it_a).id()) == 0) accountRebuild << (*it_a).id(); dropOut = true; break; @@ -1432,70 +1432,70 @@ const QStringList MyMoneyFile::consistencyCheck(void) } } } - parentId = parent.parentAccountId(); + tqparentId = tqparent.tqparentAccountId(); } } catch(MyMoneyException *e) { - // if we don't know about a parent, we catch it later + // if we don't know about a tqparent, we catch it later delete e; } - // check that the parent exists - parentId = (*it_a).parentAccountId(); + // check that the tqparent exists + tqparentId = (*it_a).tqparentAccountId(); try { - parent = account(parentId); - if((*it_a).accountGroup() != parent.accountGroup()) { + tqparent = account(tqparentId); + if((*it_a).accountGroup() != tqparent.accountGroup()) { problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - // the parent belongs to a different group, so we reconnect to the + // the tqparent belongs to a different group, so we reconnect to the // master group account (asset, liability, etc) to which this account // should belong and update it in the engine. - rc << i18n(" * Parent account '%1' belongs to a different group.").arg(parent.name()); - rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name()); + rc << i18n(" * Parent account '%1' belongs to a different group.").tqarg(tqparent.name()); + rc << i18n(" New tqparent account is the top level account '%1'.").tqarg(toplevel.name()); (*it_a).setParentAccountId(toplevel.id()); // make sure to rebuild the sub-accounts of the top account // and the one we removed this account from - if(accountRebuild.contains(toplevel.id()) == 0) + if(accountRebuild.tqcontains(toplevel.id()) == 0) accountRebuild << toplevel.id(); - if(accountRebuild.contains(parent.id()) == 0) - accountRebuild << parent.id(); - } else if(!parent.accountList().contains((*it_a).id())) { + if(accountRebuild.tqcontains(tqparent.id()) == 0) + accountRebuild << tqparent.id(); + } else if(!tqparent.accountList().tqcontains((*it_a).id())) { problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - // parent exists, but does not have a reference to the account - rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").arg(parent.name(), problemAccount); - if(accountRebuild.contains(parent.id()) == 0) - accountRebuild << parent.id(); + // tqparent exists, but does not have a reference to the account + rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").tqarg(tqparent.name(), problemAccount); + if(accountRebuild.tqcontains(tqparent.id()) == 0) + accountRebuild << tqparent.id(); } } catch(MyMoneyException *e) { delete e; - // apparently, the parent does not exist anymore. we reconnect to the + // aptqparently, the tqparent does not exist anymore. we reconnect to the // master group account (asset, liability, etc) to which this account // should belong and update it in the engine. problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - rc << i18n(" * The parent with id %1 does not exist anymore.").arg(parentId); - rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name()); + rc << i18n(" * The tqparent with id %1 does not exist anymore.").tqarg(tqparentId); + rc << i18n(" New tqparent account is the top level account '%1'.").tqarg(toplevel.name()); (*it_a).setParentAccountId(toplevel.id()); addNotification((*it_a).id()); // make sure to rebuild the sub-accounts of the top account - if(accountRebuild.contains(toplevel.id()) == 0) + if(accountRebuild.tqcontains(toplevel.id()) == 0) accountRebuild << toplevel.id(); } - // now check that all the children exist and have the correct type + // now check that all the tqchildren exist and have the correct type for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end(); ++it_c) { // check that the child exists try { @@ -1504,11 +1504,11 @@ const QStringList MyMoneyFile::consistencyCheck(void) problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - rc << i18n(" * Child account with id %1 does not exist anymore.").arg(*it_c); + rc << i18n(" * Child account with id %1 does not exist anymore.").tqarg(*it_c); rc << i18n(" The child account list will be reconstructed."); - if(accountRebuild.contains((*it_a).id()) == 0) + if(accountRebuild.tqcontains((*it_a).id()) == 0) accountRebuild << (*it_a).id(); } } @@ -1539,8 +1539,8 @@ const QStringList MyMoneyFile::consistencyCheck(void) // clear the affected lists for(it_a = list.begin(); it_a != list.end(); ++it_a) { - if(accountRebuild.contains((*it_a).id())) { - rc << QString(" %1").arg((*it_a).name()); + if(accountRebuild.tqcontains((*it_a).id())) { + rc << TQString(" %1").tqarg((*it_a).name()); // clear the account list for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end();) { (*it_a).removeAccountId(*it_c); @@ -1551,11 +1551,11 @@ const QStringList MyMoneyFile::consistencyCheck(void) // reconstruct the lists for(it_a = list.begin(); it_a != list.end(); ++it_a) { - QValueList::Iterator it; - parentId = (*it_a).parentAccountId(); - if(accountRebuild.contains(parentId)) { + TQValueList::Iterator it; + tqparentId = (*it_a).tqparentAccountId(); + if(accountRebuild.tqcontains(tqparentId)) { for(it = list.begin(); it != list.end(); ++it) { - if((*it).id() == parentId) { + if((*it).id() == tqparentId) { (*it).addAccountId((*it_a).id()); break; } @@ -1565,21 +1565,21 @@ const QStringList MyMoneyFile::consistencyCheck(void) // update the engine objects for(it_a = list.begin(); it_a != list.end(); ++it_a) { - if(accountRebuild.contains((*it_a).id())) { + if(accountRebuild.tqcontains((*it_a).id())) { try { m_storage->modifyAccount(*it_a, true); addNotification((*it_a).id()); } catch (MyMoneyException *e) { delete e; - rc << i18n(" * Unable to update account data for account %1 in engine").arg((*it_a).name()); + rc << i18n(" * Unable to update account data for account %1 in engine").tqarg((*it_a).name()); } } } // For some reason, files exist with invalid ids. This has been found in the payee id // so we fix them here - QValueList pList = payeeList(); - QMappayeeConversionMap; + TQValueList pList = payeeList(); + TQMappayeeConversionMap; for(it_p = pList.begin(); it_p != pList.end(); ++it_p) { if((*it_p).id().length() > 7) { @@ -1589,20 +1589,20 @@ const QStringList MyMoneyFile::consistencyCheck(void) payee.clearId(); m_storage->addPayee(payee); payeeConversionMap[(*it_p).id()] = payee.id(); - rc << i18n(" * Payee %1 recreated with fixed id").arg(payee.name()); + rc << i18n(" * Payee %1 recreated with fixed id").tqarg(payee.name()); ++problemCount; } } // Fix the transactions - QValueList tList; + TQValueList tList; MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); m_storage->transactionList(tList, filter); // Generate the list of interest accounts for(it_t = tList.begin(); it_t != tList.end(); ++it_t) { const MyMoneyTransaction& t = (*it_t); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionInterest) interestAccounts[(*it_s).accountId()] = true; @@ -1610,15 +1610,15 @@ const QStringList MyMoneyFile::consistencyCheck(void) } for(it_t = tList.begin(); it_t != tList.end(); ++it_t) { MyMoneyTransaction t = (*it_t); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; bool tChanged = false; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { bool sChanged = false; MyMoneySplit s = (*it_s); - if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) { + if(payeeConversionMap.tqfind((*it_s).payeeId()) != payeeConversionMap.end()) { s.setPayeeId(payeeConversionMap[s.payeeId()]); sChanged = true; - rc << i18n(" * Payee id updated in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * Payee id updated in split of transaction '%1'.").tqarg(t.id()); ++problemCount; } @@ -1631,27 +1631,27 @@ const QStringList MyMoneyFile::consistencyCheck(void) // use the value as master if the transaction is balanced if(t.splitSum().isZero()) { s.setShares(s.value()); - rc << i18n(" * shares set to value in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * shares set to value in split of transaction '%1'.").tqarg(t.id()); } else { s.setValue(s.shares()); - rc << i18n(" * value set to shares in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * value set to shares in split of transaction '%1'.").tqarg(t.id()); } sChanged = true; ++problemCount; } } catch(MyMoneyException *e) { - rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").arg(t.id(), (*it_s).id(), (*it_s).accountId()); + rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").tqarg(t.id(), (*it_s).id(), (*it_s).accountId()); ++problemCount; ++unfixedCount; delete e; } // make sure the interest splits are marked correct as such - if(interestAccounts.find(s.accountId()) != interestAccounts.end() + if(interestAccounts.tqfind(s.accountId()) != interestAccounts.end() && s.action() != MyMoneySplit::ActionInterest) { s.setAction(MyMoneySplit::ActionInterest); sChanged = true; - rc << i18n(" * action marked as interest in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * action marked as interest in split of transaction '%1'.").tqarg(t.id()); ++problemCount; } @@ -1666,34 +1666,34 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // Fix the schedules - QValueList schList = scheduleList(); + TQValueList schList = scheduleList(); for(it_sch = schList.begin(); it_sch != schList.end(); ++it_sch) { MyMoneySchedule sch = (*it_sch); MyMoneyTransaction t = sch.transaction(); bool tChanged = false; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { MyMoneySplit s = (*it_s); bool sChanged = false; - if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) { + if(payeeConversionMap.tqfind((*it_s).payeeId()) != payeeConversionMap.end()) { s.setPayeeId(payeeConversionMap[s.payeeId()]); sChanged = true; - rc << i18n(" * Payee id updated in split of schedule '%1'.").arg((*it_sch).name()); + rc << i18n(" * Payee id updated in split of schedule '%1'.").tqarg((*it_sch).name()); ++problemCount; } if(!(*it_s).value().isZero() && (*it_s).shares().isZero()) { s.setShares(s.value()); sChanged = true; - rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").arg((*it_sch).name()); + rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").tqarg((*it_sch).name()); rc << i18n(" Shares set to value."); ++problemCount; } // make sure, we don't have a bankid stored with a split in a schedule if(!(*it_s).bankID().isEmpty()) { - s.setBankID(QString()); + s.setBankID(TQString()); sChanged = true; - rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").arg((*it_sch).name()); + rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").tqarg((*it_sch).name()); ++problemCount; } @@ -1706,16 +1706,16 @@ const QStringList MyMoneyFile::consistencyCheck(void) // use the value as master if the transaction is balanced if(t.splitSum().isZero()) { s.setShares(s.value()); - rc << i18n(" * shares set to value in split in schedule '%1'.").arg((*it_sch).name()); + rc << i18n(" * shares set to value in split in schedule '%1'.").tqarg((*it_sch).name()); } else { s.setValue(s.shares()); - rc << i18n(" * value set to shares in split in schedule '%1'.").arg((*it_sch).name()); + rc << i18n(" * value set to shares in split in schedule '%1'.").tqarg((*it_sch).name()); } sChanged = true; ++problemCount; } } catch(MyMoneyException *e) { - rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").arg((*it_sch).name(), (*it_s).id(), (*it_s).accountId()); + rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").tqarg((*it_sch).name(), (*it_s).id(), (*it_s).accountId()); ++problemCount; ++unfixedCount; delete e; @@ -1732,16 +1732,16 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // Fix the reports - QValueList rList = reportList(); + TQValueList rList = reportList(); for(it_r = rList.begin(); it_r != rList.end(); ++it_r) { MyMoneyReport r = *it_r; - QStringList pList; - QStringList::Iterator it_p; + TQStringList pList; + TQStringList::Iterator it_p; (*it_r).payees(pList); bool rChanged = false; for(it_p = pList.begin(); it_p != pList.end(); ++it_p) { - if(payeeConversionMap.find(*it_p) != payeeConversionMap.end()) { - rc << i18n(" * Payee id updated in report '%1'.").arg((*it_r).name()); + if(payeeConversionMap.tqfind(*it_p) != payeeConversionMap.end()) { + rc << i18n(" * Payee id updated in report '%1'.").tqarg((*it_r).name()); ++problemCount; r.removeReference(*it_p); r.addPayee(payeeConversionMap[*it_p]); @@ -1754,11 +1754,11 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // erase old payee ids - QMap::Iterator it_m; + TQMap::Iterator it_m; for(it_m = payeeConversionMap.begin(); it_m != payeeConversionMap.end(); ++it_m) { MyMoneyPayee payee = this->payee(it_m.key()); removePayee(payee); - rc << i18n(" * Payee '%1' removed.").arg(payee.id()); + rc << i18n(" * Payee '%1' removed.").tqarg(payee.id()); ++problemCount; } @@ -1768,23 +1768,23 @@ const QStringList MyMoneyFile::consistencyCheck(void) rc << i18n("Finish! Data is consistent."); else rc << i18n("Finish! %1 problem(s) corrected. %2 problem(s) still present.") - .arg(problemCount).arg(unfixedCount); + .tqarg(problemCount).tqarg(unfixedCount); return rc; } -QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& name) +TQString MyMoneyFile::createCategory(const MyMoneyAccount& base, const TQString& name) { checkTransaction(__PRETTY_FUNCTION__); - MyMoneyAccount parent = base; - QString categoryText; + MyMoneyAccount tqparent = base; + TQString categoryText; if(base.id() != expense().id() && base.id() != income().id()) throw new MYMONEYEXCEPTION("Invalid base category"); - QStringList subAccounts = QStringList::split(AccountSeperator, name); - QStringList::Iterator it; + TQStringList subAccounts = TQStringList::split(AccountSeperator, name); + TQStringList::Iterator it; for (it = subAccounts.begin(); it != subAccounts.end(); ++it) { MyMoneyAccount categoryAccount; @@ -1800,9 +1800,9 @@ QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& n // Only create the account if it doesn't exist try { - QString categoryId = categoryToAccount(categoryText); + TQString categoryId = categoryToAccount(categoryText); if (categoryId.isEmpty()) - addAccount(categoryAccount, parent); + addAccount(categoryAccount, tqparent); else { categoryAccount = account(categoryId); @@ -1812,23 +1812,23 @@ QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& n { qDebug("Unable to add account %s, %s, %s: %s", categoryAccount.name().latin1(), - parent.name().latin1(), + tqparent.name().latin1(), categoryText.latin1(), e->what().latin1()); delete e; } - parent = categoryAccount; + tqparent = categoryAccount; } return categoryToAccount(name); } -const QValueList MyMoneyFile::scheduleListEx( int scheduleTypes, +const TQValueList MyMoneyFile::scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts) const + TQDate startDate, + const TQStringList& accounts) const { checkStorage(); @@ -1871,7 +1871,7 @@ void MyMoneyFile::removeSecurity(const MyMoneySecurity& security) addNotification(security.id(), false); } -const MyMoneySecurity& MyMoneyFile::security(const QString& id) const +const MyMoneySecurity& MyMoneyFile::security(const TQString& id) const { if(id.isEmpty()) return baseCurrency(); @@ -1879,7 +1879,7 @@ const MyMoneySecurity& MyMoneyFile::security(const QString& id) const return d->m_cache.security(id); } -const QValueList MyMoneyFile::securityList(void) const +const TQValueList MyMoneyFile::securityList(void) const { checkStorage(); @@ -1933,7 +1933,7 @@ void MyMoneyFile::removeCurrency(const MyMoneySecurity& currency) addNotification(currency.id(), false); } -const MyMoneySecurity& MyMoneyFile::currency(const QString& id) const +const MyMoneySecurity& MyMoneyFile::currency(const TQString& id) const { if(id.isEmpty()) return baseCurrency(); @@ -1944,14 +1944,14 @@ const MyMoneySecurity& MyMoneyFile::currency(const QString& id) const return curr; } -const QValueList MyMoneyFile::currencyList(void) const +const TQValueList MyMoneyFile::currencyList(void) const { checkStorage(); return m_storage->currencyList(); } -const QString& MyMoneyFile::foreignCurrency(const QString& first, const QString& second) const +const TQString& MyMoneyFile::foreignCurrency(const TQString& first, const TQString& second) const { if(baseCurrency().id() == second) return first; @@ -1961,7 +1961,7 @@ const QString& MyMoneyFile::foreignCurrency(const QString& first, const QString& const MyMoneySecurity& MyMoneyFile::baseCurrency(void) const { if(d->m_baseCurrency.id().isEmpty()) { - QString id = QString(value("kmm-baseCurrency")); + TQString id = TQString(value("kmm-baseCurrency")); if(!id.isEmpty()) d->m_baseCurrency = currency(id); } @@ -1986,7 +1986,7 @@ void MyMoneyFile::setBaseCurrency(const MyMoneySecurity& curr) void MyMoneyFile::addPrice(const MyMoneyPrice& price) { - if(price.rate(QString()).isZero()) + if(price.rate(TQString()).isZero()) return; checkTransaction(__PRETTY_FUNCTION__); @@ -2007,11 +2007,11 @@ void MyMoneyFile::removePrice(const MyMoneyPrice& price) m_storage->removePrice(price); } -const MyMoneyPrice MyMoneyFile::price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const +const MyMoneyPrice MyMoneyFile::price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const { checkStorage(); - QString to(toId); + TQString to(toId); if(to.isEmpty()) to = value("kmm-baseCurrency"); // if some id is missing, we can return an empty price object @@ -2039,11 +2039,11 @@ const MyMoneyPriceList MyMoneyFile::priceList(void) const return m_storage->priceList(); } -bool MyMoneyFile::hasAccount(const QString& id, const QString& name) const +bool MyMoneyFile::hasAccount(const TQString& id, const TQString& name) const { MyMoneyAccount acc = d->m_cache.account(id); - QStringList list = acc.accountList(); - QStringList::ConstIterator it; + TQStringList list = acc.accountList(); + TQStringList::ConstIterator it; bool rc = false; for(it = list.begin(); rc == false && it != list.end(); ++it) { MyMoneyAccount a = d->m_cache.account(*it); @@ -2053,7 +2053,7 @@ bool MyMoneyFile::hasAccount(const QString& id, const QString& name) const return rc; } -const QValueList MyMoneyFile::reportList( void ) const +const TQValueList MyMoneyFile::reportList( void ) const { checkStorage(); @@ -2089,7 +2089,7 @@ unsigned MyMoneyFile::countReports(void) const return m_storage->countReports(); } -const MyMoneyReport MyMoneyFile::report( const QString& id ) const +const MyMoneyReport MyMoneyFile::report( const TQString& id ) const { checkStorage(); @@ -2107,7 +2107,7 @@ void MyMoneyFile::removeReport(const MyMoneyReport& report) } -const QValueList MyMoneyFile::budgetList( void ) const +const TQValueList MyMoneyFile::budgetList( void ) const { checkStorage(); @@ -2124,7 +2124,7 @@ void MyMoneyFile::addBudget( MyMoneyBudget& budget ) m_storage->addBudget( budget ); } -const MyMoneyBudget MyMoneyFile::budgetByName(const QString& name) const +const MyMoneyBudget MyMoneyFile::budgetByName(const TQString& name) const { checkStorage(); @@ -2150,7 +2150,7 @@ unsigned MyMoneyFile::countBudgets(void) const return m_storage->countBudgets(); } -const MyMoneyBudget MyMoneyFile::budget( const QString& id ) const +const MyMoneyBudget MyMoneyFile::budget( const TQString& id ) const { checkStorage(); @@ -2175,17 +2175,17 @@ bool MyMoneyFile::isReferenced(const MyMoneyObject& obj, const MyMoneyFileBitArr return m_storage->isReferenced(obj, skipChecks); } -bool MyMoneyFile::checkNoUsed(const QString& accId, const QString& no) const +bool MyMoneyFile::checkNoUsed(const TQString& accId, const TQString& no) const { // by definition, an empty string or a non-numeric string is not used - QRegExp exp(QString("(.*\\D)?(\\d+)(\\D.*)?")); + TQRegExp exp(TQString("(.*\\D)?(\\d+)(\\D.*)?")); if(no.isEmpty() || exp.search(no) == -1) return false; MyMoneyTransactionFilter filter; filter.addAccount(accId); - QValueList transactions = transactionList(filter); - QValueList::const_iterator it_t = transactions.begin(); + TQValueList transactions = transactionList(filter); + TQValueList::const_iterator it_t = transactions.begin(); while ( it_t != transactions.end() ) { try { MyMoneySplit split; @@ -2202,14 +2202,14 @@ bool MyMoneyFile::checkNoUsed(const QString& accId, const QString& no) const return false; } -QString MyMoneyFile::highestCheckNo(const QString& accId) const +TQString MyMoneyFile::highestCheckNo(const TQString& accId) const { unsigned64 lno = 0, cno; - QString no; + TQString no; MyMoneyTransactionFilter filter; filter.addAccount(accId); - QValueList transactions = transactionList(filter); - QValueList::const_iterator it_t = transactions.begin(); + TQValueList transactions = transactionList(filter); + TQValueList::const_iterator it_t = transactions.begin(); while ( it_t != transactions.end() ) { try { // Test whether the transaction also includes a split into @@ -2243,7 +2243,7 @@ void MyMoneyFile::preloadCache(void) checkStorage(); d->m_cache.clear(); - QValueList a_list; + TQValueList a_list; m_storage->accountList(a_list); d->m_cache.preloadAccount(a_list); d->m_cache.preloadPayee(m_storage->payeeList()); @@ -2256,7 +2256,7 @@ bool MyMoneyFile::isTransfer(const MyMoneyTransaction& t) const { bool rc = false; if(t.splitCount() == 2) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { MyMoneyAccount acc = account((*it_s).accountId()); if(acc.isIncomeExpense()) @@ -2270,8 +2270,8 @@ bool MyMoneyFile::isTransfer(const MyMoneyTransaction& t) const bool MyMoneyFile::referencesClosedAccount(const MyMoneyTransaction& t) const { - QValueList::const_iterator it_s; - const QValueList& list = t.splits(); + TQValueList::const_iterator it_s; + const TQValueList& list = t.splits(); for(it_s = list.begin(); it_s != list.end(); ++it_s) { if(referencesClosedAccount(*it_s)) break; diff --git a/kmymoney2/mymoney/mymoneyfile.h b/kmymoney2/mymoney/mymoneyfile.h index 39552c9..c59f9da 100644 --- a/kmymoney2/mymoney/mymoneyfile.h +++ b/kmymoney2/mymoney/mymoneyfile.h @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -90,22 +90,22 @@ class MyMoneyTransactionFilter; * general account maintenance functions. The method reparentAccount() is * available to move an account from one superordinate account to another. * account() and accountList() are used to retrieve a single instance or a - * QValueList of MyMoneyAccount objects. + * TQValueList of MyMoneyAccount objects. * * The methods addInstitution(), modifyInstitution() and removeInstitution() * implement the general institution maintenance functions. institution() and * institutionList() are used to retrieve a single instance or a - * QValueList of MyMoneyInstitution objects. + * TQValueList of MyMoneyInstitution objects. * * The methods addPayee(), modifyPayee() and removePayee() * implement the general institution maintenance functions. * payee() and payeeList() are used to retrieve a single instance or a - * QValueList of MyMoneyPayee objects. + * TQValueList of MyMoneyPayee objects. * * The methods addTransaction(), modifyTransaction() and removeTransaction() * implement the general transaction maintenance functions. * transaction() and transactionList() are used to retrieve - * a single instance or a QValueList of MyMoneyTransaction objects. + * a single instance or a TQValueList of MyMoneyTransaction objects. * * The methods addSecurity(), modifySecurity() and removeSecurity() * implement the general access to equities held in the engine. @@ -134,9 +134,10 @@ class MyMoneyTransactionFilter; * while the engine code is running. The MyMoneyException:: object * describes the problem. */ -class KMYMONEY_EXPORT MyMoneyFile : public QObject +class KMYMONEY_EXPORT MyMoneyFile : public TQObject { Q_OBJECT + TQ_OBJECT public: class MyMoneyNotifier @@ -329,13 +330,13 @@ public: /** * Retrieve the opening balance transaction for the account @p acc. - * If there is no opening balance transaction, QString() will be returned. + * If there is no opening balance transaction, TQString() will be returned. * * @param acc reference to account for which the opening balance transaction * should be retrieved - * @return QString id for the transaction, or QString() if no transaction exists + * @return TQString id for the transaction, or TQString() if no transaction exists */ - QString openingBalanceTransaction(const MyMoneyAccount& acc) const; + TQString openingBalanceTransaction(const MyMoneyAccount& acc) const; /** * This method returns an indicator if the MyMoneyFile object has been @@ -356,7 +357,7 @@ public: /** * Adds an institution to the file-global institution pool. A * respective institution-ID will be generated for this object. - * 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. * @@ -401,15 +402,15 @@ public: * b) the account must not have an id assigned * c) the transaction list must be empty * d) the account must not have any sub-ordinate accounts - * e) the account must have no parent account + * e) the account must have no tqparent account * f) the account must not have any reference to a MyMoneyFile object * * An exception will be thrown upon error conditions. * * @param account The complete account information in a MyMoneyAccount object - * @param parent The complete account information of the parent account + * @param tqparent The complete account information of the tqparent account */ - void addAccount(MyMoneyAccount& account, MyMoneyAccount& parent); + void addAccount(MyMoneyAccount& account, MyMoneyAccount& tqparent); /** * Modifies an already existing account in the file global account pool. @@ -421,14 +422,14 @@ public: void modifyAccount(const MyMoneyAccount& account); /** - * 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); /** * moves splits from one account to another @@ -438,7 +439,7 @@ public: * * @return the number of modified splits */ - unsigned int moveSplits(const QString& oldAccount, const QString& newAccount); + unsigned int moveSplits(const TQString& oldAccount, const TQString& newAccount); /** * This method is used to determince, if the account with the @@ -447,7 +448,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 check whether a given @@ -458,7 +459,7 @@ 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; /** * Returns @a true, if transaction @p t is a transfer transaction. @@ -472,11 +473,11 @@ public: * 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 * */ - void setAccountName(const QString& id, const QString& name) const; + void setAccountName(const TQString& id, const TQString& name) const; /** * Deletes an existing account from the file global account pool @@ -503,7 +504,7 @@ public: * @param account_list Reference to a list of account IDs to be deleted. * @param level Parameter to keep track of recursion level (do not pass a value here). */ - void removeAccountList(const QStringList& account_list, unsigned int level = 0); + void removeAccountList(const TQStringList& account_list, unsigned int level = 0); /** * This member function checks all accounts identified by account_list @@ -515,17 +516,17 @@ public: * If the recursion level exceeds 100 (some arbitrary number which seems a good * maximum), an exception is thrown. * - * @param account_list A QStringList with account IDs that need to be checked. + * @param account_list A TQStringList with account IDs that need to be checked. * @param level (optional) Optional parameter to indicate recursion level. * @return Returns 'false' if at least one account has been found that * is still referenced by a transaction. */ - bool hasOnlyUnusedAccounts(const QStringList& account_list, unsigned int level = 0); + bool hasOnlyUnusedAccounts(const TQStringList& account_list, unsigned int level = 0); /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated for this object. The ID is stored - * as QString in the object passed as argument. + * as TQString in the object passed as argument. * Splits must reference valid accounts and valid payees. The payee * id can be empty. * @@ -552,20 +553,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 pull a list of transactions from the file @@ -578,13 +579,13 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - const QValueList transactionList(MyMoneyTransactionFilter& filter) const; + const TQValueList transactionList(MyMoneyTransactionFilter& filter) const; - void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const; - void transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const; /** * This method is used to remove a transaction from the transaction @@ -602,10 +603,10 @@ public: * transactions are included in the balance. * * @param id id of the account in question - * @param date return balance for specific date (default = QDate()) + * @param date return balance for specific date (default = TQDate()) * @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 @@ -615,34 +616,34 @@ public: * transactions are included in the balance. * * @param id id of the account in question - * @param date return balance for specific date (default = QDate()) + * @param date return balance for specific date (default = TQDate()) * @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; /** * 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; /** - * 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 */ - const QMap transactionCountMap(void) const; + const TQMap transactionCountMap(void) const; /** * This method returns the number of institutions currently known to file @@ -667,7 +668,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 a list of the institutions @@ -675,16 +676,16 @@ public: * * @param list reference to the list. It will be cleared by this method first */ - void institutionList(QValueList& list) const; + void institutionList(TQValueList& list) const; /** * This method returns a list of the institutions * inside a MyMoneyFile object. This is a convenience method * to the one above * - * @return QValueList containing the institution objects + * @return TQValueList containing the institution objects */ - const QValueList institutionList(void) const; + const TQValueList institutionList(void) const; /** * Returns the account addressed by its id. @@ -693,7 +694,7 @@ public: * @return MyMoneyAccount object carrying the @p id. An exception is thrown * if the id is unknown */ - const MyMoneyAccount& account(const QString& id) const; + const MyMoneyAccount& account(const TQString& id) const; /** * Returns the account addressed by its name. @@ -702,7 +703,7 @@ public: * @return First MyMoneyAccount object found carrying the @p name. * An empty MyMoneyAccount object will be returned if the name is not found. */ - const MyMoneyAccount& accountByName(const QString& name) const; + const MyMoneyAccount& accountByName(const TQString& name) const; /** * Returns the sub-account addressed by its name. @@ -712,7 +713,7 @@ public: * @return First MyMoneyAccount object found carrying the @p name. * An empty MyMoneyAccount object will be returned if the name is not found. */ - const MyMoneyAccount& subAccountByName(const MyMoneyAccount& acc, const QString& name) const; + const MyMoneyAccount& subAccountByName(const MyMoneyAccount& acc, const TQString& name) const; /** * This method returns a list of accounts inside a MyMoneyFile object. @@ -720,14 +721,14 @@ public: * the returned list contains all accounts, otherwise only those referenced * in the id-list. * - * @param list reference to QValueList receiving the account objects - * @param idlist QStringList of account ids of those accounts that + * @param list reference to TQValueList receiving the account objects + * @param idlist TQStringList of account ids of those accounts that * should be returned. If this list is empty, all accounts * currently known will be returned. * * @param recursive if @p true, then recurse in all found accounts. The default is @p false */ - void accountList(QValueList& list, const QStringList& idlist = QStringList(), const bool recursive = false) const; + void accountList(TQValueList& list, const TQStringList& idlist = TQStringList(), const bool recursive = false) const; /** * This method is used to convert an account id to a string representation @@ -735,13 +736,13 @@ public: * is part of a hierarchy, the category name will be the concatenation of * the single account names seperated by MyMoneyAccount::AccountSeperator. * - * @param accountId QString reference of the account's id + * @param accountId TQString reference of the account's id * @param includeStandardAccounts if true, the standard top account will be part * of the name, otherwise it will not be included (default is @c false) * - * @return QString of the constructed name. + * @return TQString of the constructed name. */ - QString accountToCategory(const QString& accountId, bool includeStandardAccounts = false) const; + TQString accountToCategory(const TQString& accountId, bool includeStandardAccounts = false) const; /** * This method is used to convert a string representing a category to @@ -749,13 +750,13 @@ public: * representing a hierarchy of accounts. They have to be seperated by * MyMoneyAccount::AccountSeperator. * - * @param category const reference to QString containing the category + * @param category const reference to TQString containing the category * @param type account type if a specific type is required (defaults to UnknownAccountType) * - * @return QString of the corresponding account. If account was not found + * @return TQString of the corresponding account. If account was not found * the return value will be an empty string. */ - QString categoryToAccount(const QString& category, MyMoneyAccount::accountTypeE type = MyMoneyAccount::UnknownAccountType) const; + TQString categoryToAccount(const TQString& category, MyMoneyAccount::accountTypeE type = MyMoneyAccount::UnknownAccountType) const; /** * This method is used to convert a string representing an asset or @@ -763,21 +764,21 @@ public: * concatenation of multiple accounts representing a hierarchy of * accounts. They have to be seperated by MyMoneyAccount::AccountSeperator. * - * @param name const reference to QString containing the account name + * @param name const reference to TQString containing the account name * - * @return QString of the corresponding account. If account was not found + * @return TQString of the corresponding account. If account was not found * the return value will be an empty string. */ - QString nameToAccount(const QString& name) const; + TQString nameToAccount(const TQString& name) const; /** - * This method is used to extract the parent part of an account hierarchy + * This method is used to extract the tqparent part of an account hierarchy * name who's parts are seperated by MyMoneyAccount::AccountSeperator. * * @param name full account name - * @return parent name (full account name excluding the last part) + * @return tqparent name (full account name excluding the last part) */ - QString parentName(const QString& name) const; + TQString tqparentName(const TQString& name) const; /** * This method is used to create a new payee @@ -792,22 +793,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 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 @@ -833,39 +834,39 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - const QValueList payeeList(void) const; + const TQValueList payeeList(void) const; /** * This method is used to extract a value from the storage's * 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 */ - QString value(const QString& key) const; + TQString value(const TQString& key) const; /** * This method is used to set a value in the storage's * 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 * * @note Keys starting with the leadin @p kmm- are reserved for internal use * by the MyMoneyFile object. */ - 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 * storage's 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); /** * This method is used to add a scheduled transaction to the engine. @@ -905,10 +906,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 extract a list of scheduled transactions @@ -916,7 +917,7 @@ public: * * @param accountId only search for scheduled transactions that reference * account @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 @@ -928,36 +929,36 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - const QValueList scheduleList(const QString& accountId = QString(), + const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - const QStringList consistencyCheck(void); + const TQStringList consistencyCheck(void); /** * MyMoneyFile::OpeningBalancesPrefix is a special string used * to generate the name for opening balances accounts. See openingBalanceAccount() * for details. */ - static const QString OpeningBalancesPrefix; + static const TQString OpeningBalancesPrefix; /** * MyMoneyFile::AccountSeperator is used as the seperator * between account names to form a hierarchy. */ - static const QString AccountSeperator; + static const TQString AccountSeperator; /** * createCategory creates a category from a text name. @@ -966,7 +967,7 @@ public: * already exist. e.g if name = Bills:Credit Card and * base = expense(), Bills will first be checked to see if * it exists and created if not. Credit Card will then - * be created with Bills as it's parent. The Credit Card account + * be created with Bills as it's tqparent. The Credit Card account * will have it's id returned. * * @param base The base account (expense or income) @@ -977,13 +978,13 @@ public: * @exception An exception will be thrown, if @p base is not equal * expense() or income(). **/ - QString createCategory(const MyMoneyAccount& base, const QString& name); + TQString createCategory(const MyMoneyAccount& base, const TQString& name); - const QValueList scheduleListEx( int scheduleTypes, + const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to add a new security object to the engine. @@ -1024,15 +1025,15 @@ 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 */ - const MyMoneySecurity& security(const QString& id) const; + const MyMoneySecurity& security(const TQString& id) const; /** * This method is used to retrieve a list of all MyMoneySecurity objects. */ - const QValueList securityList(void) const; + const TQValueList securityList(void) const; /** * This method is used to add a new currency object to the engine. @@ -1072,10 +1073,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 @@ -1083,9 +1084,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects. + * @return TQValueList of all MyMoneySecurity objects. */ - const QValueList currencyList(void) const; + const TQValueList currencyList(void) const; /** * This method retrieves a MyMoneySecurity object representing @@ -1105,7 +1106,7 @@ public: * currency ids. If second is the base currency id then @a first * is returned otherwise @a second is returned. */ - const QString& foreignCurrency(const QString& first, const QString& second) const; + const TQString& foreignCurrency(const TQString& first, const TQString& second) const; /** * This method allows to select the base currency. It does @@ -1144,7 +1145,7 @@ public: * @return price found as MyMoneyPrice object * @note This throws an exception when the base currency is not set and toId is empty */ - const MyMoneyPrice price(const QString& fromId, const QString& toId = QString(), const QDate& date = QDate::currentDate(), const bool exactDate = false) const; + const MyMoneyPrice price(const TQString& fromId, const TQString& toId = TQString(), const TQDate& date = TQDate::tqcurrentDate(), const bool exactDate = false) const; /** * This method returns a list of all prices. @@ -1162,7 +1163,7 @@ public: * @retval true account with name @p name found as subaccounts * @retval false no subaccount present with that name */ - bool hasAccount(const QString& id, const QString& name) const; + bool hasAccount(const TQString& id, const TQString& name) const; /** * This method is used to retrieve the list of all reports @@ -1170,14 +1171,14 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - const QValueList reportList( void ) const; + const TQValueList reportList( void ) const; /** * Adds a report to the file-global institution pool. A * respective report-ID will be generated for this object. - * 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. * @@ -1210,10 +1211,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 @@ -1231,14 +1232,14 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - const QValueList budgetList( void ) const; + const TQValueList budgetList( void ) const; /** * Adds a budget to the file-global institution pool. A * respective budget-ID will be generated for this object. - * 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. * @@ -1253,11 +1254,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 refernce to object of budget */ - const MyMoneyBudget budgetByName(const QString& budget) const; + const MyMoneyBudget budgetByName(const TQString& budget) const; /** @@ -1284,10 +1285,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 */ - const MyMoneyBudget budget( const QString& id ) const; + const MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -1334,7 +1335,7 @@ public: * @retval false @p no is not in use * @retval true @p no is already assigned */ - bool checkNoUsed(const QString& accId, const QString& no) const; + bool checkNoUsed(const TQString& accId, const TQString& no) const; /** * This method returns the highest assigned check no for @@ -1343,7 +1344,7 @@ public: * @param accId id of account to be scanned * @return highest check no. used */ - QString highestCheckNo(const QString& accId) const; + TQString highestCheckNo(const TQString& accId) const; /** * Clear all internal caches (used internally for performance measurements) @@ -1373,11 +1374,11 @@ private: MyMoneyFile& operator=(MyMoneyFile&); // not allowed for singleton MyMoneyFile(const MyMoneyFile&); // not allowed for singleton - QString locateSubAccount(const MyMoneyAccount& base, const QString& category) const; + TQString locateSubAccount(const MyMoneyAccount& base, const TQString& category) const; void ensureDefaultCurrency(MyMoneyAccount& acc) const; - void warningMissingRate(const QString& fromId, const QString& toId) const; + void warningMissingRate(const TQString& fromId, const TQString& toId) const; /** * This method creates an opening balances account. The name is constructed @@ -1400,7 +1401,7 @@ private: * @param reload reload the object (@c true) or not (@c false). The default is @c true * @see attach, detach */ - void addNotification(const QString& id, bool reload = true); + void addNotification(const TQString& id, bool reload = true); /** * This method is used to clear the notification list diff --git a/kmymoney2/mymoney/mymoneyfiletest.cpp b/kmymoney2/mymoney/mymoneyfiletest.cpp index e081fa0..72dd006 100644 --- a/kmymoney2/mymoney/mymoneyfiletest.cpp +++ b/kmymoney2/mymoney/mymoneyfiletest.cpp @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include MyMoneyFileTest:: MyMoneyFileTest () {} @@ -66,9 +66,9 @@ void MyMoneyFileTest::testAddOneInstitution() { // MyMoneyInstitution institution_file("", institution); MyMoneyInstitution institution_id("I000002", institution); MyMoneyInstitution institution_noname(institution); - institution_noname.setName(QString()); + institution_noname.setName(TQString()); - QString id; + TQString id; CPPUNIT_ASSERT(m->institutionCount() == 0); storage->m_dirty = false; @@ -117,7 +117,7 @@ void MyMoneyFileTest::testAddTwoInstitutions() { institution.setManager("manager"); institution.setSortcode("sortcode"); - QString id; + TQString id; storage->m_dirty = false; MyMoneyFileTransaction ft; @@ -228,7 +228,7 @@ void MyMoneyFileTest::testInstitutionRetrieval () { } void MyMoneyFileTest::testInstitutionListRetrieval () { - QValueList list; + TQValueList list; storage->m_dirty = false; list = m->institutionList(); @@ -242,7 +242,7 @@ void MyMoneyFileTest::testInstitutionListRetrieval () { CPPUNIT_ASSERT(m->dirty() == false); CPPUNIT_ASSERT(list.count() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).name() == "institution1"); @@ -380,11 +380,11 @@ void MyMoneyFileTest::testAddAccounts() { MyMoneyFileTransaction ft; try { - MyMoneyAccount parent = m->asset(); - m->addAccount(a, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(a, tqparent); ft.commit(); CPPUNIT_ASSERT(m->accountCount() == 6); - CPPUNIT_ASSERT(a.parentAccountId() == "AStd::Asset"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "AStd::Asset"); CPPUNIT_ASSERT(a.id() == "A000001"); CPPUNIT_ASSERT(a.institutionId() == "I000001"); CPPUNIT_ASSERT(m->dirty() == true); @@ -403,8 +403,8 @@ void MyMoneyFileTest::testAddAccounts() { // try to add this account again, should not work ft.restart(); try { - MyMoneyAccount parent = m->asset(); - m->addAccount(a, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(a, tqparent); CPPUNIT_FAIL("Expecting exception!"); } catch(MyMoneyException *e) { ft.commit(); @@ -434,12 +434,12 @@ void MyMoneyFileTest::testAddAccounts() { b.setInstitutionId(institution.id()); ft.restart(); try { - MyMoneyAccount parent = m->asset(); - m->addAccount(b, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(b, tqparent); ft.commit(); CPPUNIT_ASSERT(m->dirty() == true); CPPUNIT_ASSERT(b.id() == "A000002"); - CPPUNIT_ASSERT(b.parentAccountId() == "AStd::Asset"); + CPPUNIT_ASSERT(b.tqparentAccountId() == "AStd::Asset"); CPPUNIT_ASSERT(m->accountCount() == 7); institution = m->institution("I000001"); @@ -534,24 +534,24 @@ void MyMoneyFileTest::testModifyAccount() { } } -void MyMoneyFileTest::testReparentAccount() { +void MyMoneyFileTest::testRetqparentAccount() { testAddAccounts(); storage->m_dirty = false; MyMoneyAccount p = m->account("A000001"); MyMoneyAccount q = m->account("A000002"); - MyMoneyAccount o = m->account(p.parentAccountId()); + MyMoneyAccount o = m->account(p.tqparentAccountId()); // make A000001 a child of A000002 MyMoneyFileTransaction ft; try { - CPPUNIT_ASSERT(p.parentAccountId() != q.id()); + CPPUNIT_ASSERT(p.tqparentAccountId() != q.id()); CPPUNIT_ASSERT(o.accountCount() == 2); CPPUNIT_ASSERT(q.accountCount() == 0); m->reparentAccount(p, q); ft.commit(); CPPUNIT_ASSERT(m->dirty() == true); - CPPUNIT_ASSERT(p.parentAccountId() == q.id()); + CPPUNIT_ASSERT(p.tqparentAccountId() == q.id()); CPPUNIT_ASSERT(q.accountCount() == 1); CPPUNIT_ASSERT(q.id() == "A000002"); CPPUNIT_ASSERT(p.id() == "A000001"); @@ -566,7 +566,7 @@ void MyMoneyFileTest::testReparentAccount() { } void MyMoneyFileTest::testRemoveStdAccount(const MyMoneyAccount& acc) { - QString txt("Exception expected while removing account "); + TQString txt("Exception expected while removing account "); txt += acc.id(); MyMoneyFileTransaction ft; try { @@ -585,7 +585,7 @@ void MyMoneyFileTest::testRemoveAccount() { CPPUNIT_ASSERT(m->accountCount() == 7); storage->m_dirty = false; - QString id; + TQString id; MyMoneyAccount p = m->account("A000001"); MyMoneyFileTransaction ft; @@ -624,7 +624,7 @@ void MyMoneyFileTest::testRemoveAccount() { } void MyMoneyFileTest::testRemoveAccountTree() { - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount a = m->account("A000002"); MyMoneyFileTransaction ft; @@ -646,10 +646,10 @@ void MyMoneyFileTest::testRemoveAccountTree() { delete e; } - // make sure that children are re-parented to parent account + // make sure that tqchildren are re-tqparented to tqparent account try { a = m->account("A000001"); - CPPUNIT_ASSERT(a.parentAccountId() == m->asset().id()); + CPPUNIT_ASSERT(a.tqparentAccountId() == m->asset().id()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception!"); @@ -658,7 +658,7 @@ void MyMoneyFileTest::testRemoveAccountTree() { } void MyMoneyFileTest::testAccountListRetrieval () { - QValueList list; + TQValueList list; storage->m_dirty = false; m->accountList(list); @@ -690,9 +690,9 @@ void MyMoneyFileTest::testAddTransaction () { MyMoneyFileTransaction ft; try { - MyMoneyAccount parent = m->expense(); - m->addAccount(exp1, parent); - m->addAccount(exp2, parent); + MyMoneyAccount tqparent = m->expense(); + m->addAccount(exp1, tqparent); + m->addAccount(exp2, tqparent); ft.commit(); } catch(MyMoneyException *e) { delete e; @@ -702,7 +702,7 @@ void MyMoneyFileTest::testAddTransaction () { // fake the last modified flag to check that the // date is updated when we add the transaction MyMoneyAccount a = m->account("A000001"); - a.setLastModified(QDate(1,2,3)); + a.setLastModified(TQDate(1,2,3)); ft.restart(); try { m->modifyAccount(a); @@ -715,10 +715,10 @@ void MyMoneyFileTest::testAddTransaction () { CPPUNIT_ASSERT(m->accountCount() == 9); a = m->account("A000001"); - CPPUNIT_ASSERT(a.lastModified() == QDate(1,2,3)); + CPPUNIT_ASSERT(a.lastModified() == TQDate(1,2,3)); // construct a transaction and add it to the pool - t.setPostDate(QDate(2002,2,1)); + t.setPostDate(TQDate(2002,2,1)); t.setMemo("Memotext"); MyMoneySplit split1; @@ -760,17 +760,17 @@ void MyMoneyFileTest::testAddTransaction () { ft.restart(); CPPUNIT_ASSERT(t.id() == "T000000000000000001"); - CPPUNIT_ASSERT(t.postDate() == QDate(2002,2,1)); - CPPUNIT_ASSERT(t.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(t.postDate() == TQDate(2002,2,1)); + CPPUNIT_ASSERT(t.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(m->dirty() == true); // check the balance of the accounts a = m->account("A000001"); - CPPUNIT_ASSERT(a.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-1000)); MyMoneyAccount b = m->account("A000003"); - CPPUNIT_ASSERT(b.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(b.balance() == MyMoneyMoney(1000)); storage->m_dirty = false; @@ -859,7 +859,7 @@ void MyMoneyFileTest::testModifyTransactionNewPostDate() { testAddTransaction(); MyMoneyTransaction t = m->transaction("T000000000000000001"); - t.setPostDate(QDate(2004,2,1)); + t.setPostDate(TQDate(2004,2,1)); storage->m_dirty = false; MyMoneyFileTransaction ft; @@ -867,7 +867,7 @@ void MyMoneyFileTest::testModifyTransactionNewPostDate() { m->modifyTransaction(t); ft.commit(); t = m->transaction("T000000000000000001"); - CPPUNIT_ASSERT(t.postDate() == QDate(2004,2,1)); + CPPUNIT_ASSERT(t.postDate() == TQDate(2004,2,1)); t = m->transaction("A000001", 0); CPPUNIT_ASSERT(t.id() == "T000000000000000001"); CPPUNIT_ASSERT(m->dirty() == true); @@ -907,7 +907,7 @@ void MyMoneyFileTest::testModifyTransactionNewAccount() { m->modifyTransaction(t); ft.commit(); t = m->transaction("T000000000000000001"); - CPPUNIT_ASSERT(t.postDate() == QDate(2002,2,1)); + CPPUNIT_ASSERT(t.postDate() == TQDate(2002,2,1)); t = m->transaction("A000002", 0); CPPUNIT_ASSERT(m->dirty() == true); /* removed with MyMoneyAccount::Transaction @@ -986,7 +986,7 @@ void MyMoneyFileTest::testBalanceTotal() { MyMoneyTransaction t; // construct a transaction and add it to the pool - t.setPostDate(QDate(2002,2,1)); + t.setPostDate(TQDate(2002,2,1)); t.setMemo("Memotext"); MyMoneySplit split1; @@ -1135,7 +1135,7 @@ void MyMoneyFileTest::testAddTransactionStd() { a = m->account("A000001"); // construct a transaction and add it to the pool - t.setPostDate(QDate(2002,2,1)); + t.setPostDate(TQDate(2002,2,1)); t.setMemo("Memotext"); MyMoneySplit split1; @@ -1219,7 +1219,7 @@ void MyMoneyFileTest::testAttachStorage() { void MyMoneyFileTest::testAccount2Category() { - testReparentAccount(); + testRetqparentAccount(); CPPUNIT_ASSERT(m->accountToCategory("A000001") == "Account2:Account1"); CPPUNIT_ASSERT(m->accountToCategory("A000002") == "Account2"); } @@ -1265,7 +1265,7 @@ void MyMoneyFileTest::testHasAccount() { m->addAccount(a, b); ft.commit(); CPPUNIT_ASSERT(m->accountCount() == 8); - CPPUNIT_ASSERT(a.parentAccountId() == "A000001"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "A000001"); CPPUNIT_ASSERT(m->hasAccount("A000001", "Account3") == true); CPPUNIT_ASSERT(m->hasAccount("A000001", "Account2") == false); CPPUNIT_ASSERT(m->hasAccount("A000002", "Account3") == false); @@ -1281,8 +1281,8 @@ void MyMoneyFileTest::testAddEquityAccount() { MyMoneyFileTransaction ft; try { - MyMoneyAccount parent = m->asset(); - m->addAccount(i, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(i, tqparent); ft.commit(); } catch(MyMoneyException *e) { unexpectedException(e); @@ -1290,10 +1290,10 @@ void MyMoneyFileTest::testAddEquityAccount() { // keep a copy for later use m_inv = i; - // make sure, that only equity accounts can be children to it + // make sure, that only equity accounts can be tqchildren to it MyMoneyAccount a; a.setName("Testaccount"); - QValueList list; + TQValueList list; list << MyMoneyAccount::Checkings; list << MyMoneyAccount::Savings; list << MyMoneyAccount::Cash; @@ -1309,7 +1309,7 @@ void MyMoneyFileTest::testAddEquityAccount() { list << MyMoneyAccount::Expense; list << MyMoneyAccount::AssetLoan; - QValueList::Iterator it; + TQValueList::Iterator it; for(it = list.begin(); it != list.end(); ++it) { a.setAccountType(*it); ft.restart(); @@ -1334,13 +1334,13 @@ void MyMoneyFileTest::testAddEquityAccount() { } } -void MyMoneyFileTest::testReparentEquity() { +void MyMoneyFileTest::testRetqparentEquity() { testAddEquityAccount(); testAddEquityAccount(); - MyMoneyAccount parent; + MyMoneyAccount tqparent; // check the bad cases - QValueList list; + TQValueList list; list << MyMoneyAccount::Checkings; list << MyMoneyAccount::Savings; list << MyMoneyAccount::Cash; @@ -1349,25 +1349,25 @@ void MyMoneyFileTest::testReparentEquity() { list << MyMoneyAccount::Asset; list << MyMoneyAccount::AssetLoan; list << MyMoneyAccount::Currency; - parent = m->asset(); - testReparentEquity(list, parent); + tqparent = m->asset(); + testRetqparentEquity(list, tqparent); list.clear(); list << MyMoneyAccount::CreditCard; list << MyMoneyAccount::Loan; list << MyMoneyAccount::Liability; - parent = m->liability(); - testReparentEquity(list, parent); + tqparent = m->liability(); + testRetqparentEquity(list, tqparent); list.clear(); list << MyMoneyAccount::Income; - parent = m->income(); - testReparentEquity(list, parent); + tqparent = m->income(); + testRetqparentEquity(list, tqparent); list.clear(); list << MyMoneyAccount::Expense; - parent = m->expense(); - testReparentEquity(list, parent); + tqparent = m->expense(); + testRetqparentEquity(list, tqparent); // now check the good case MyMoneyAccount stock = m->account("A000002"); @@ -1381,18 +1381,18 @@ void MyMoneyFileTest::testReparentEquity() { } } -void MyMoneyFileTest::testReparentEquity(QValueList& list, MyMoneyAccount& parent) +void MyMoneyFileTest::testRetqparentEquity(TQValueList& list, MyMoneyAccount& tqparent) { MyMoneyAccount a; MyMoneyAccount stock = m->account("A000002"); - QValueList::Iterator it; + TQValueList::Iterator it; MyMoneyFileTransaction ft; for(it = list.begin(); it != list.end(); ++it) { - a.setName(QString("Testaccount %1").arg(*it)); + a.setName(TQString("Testaccount %1").tqarg(*it)); a.setAccountType(*it); try { - m->addAccount(a, parent); + m->addAccount(a, tqparent); char msg[100]; m->reparentAccount(stock, a); sprintf(msg, "Can reparent stock to non-investment type %d account", *it); @@ -1407,7 +1407,7 @@ void MyMoneyFileTest::testReparentEquity(QValueListbaseCurrency(); CPPUNIT_ASSERT(ref.id() == "EUR"); CPPUNIT_ASSERT(ref.name() == "Euro"); - CPPUNIT_ASSERT(ref.tradingSymbol() == QChar(0x20ac)); + CPPUNIT_ASSERT(ref.tradingSymbol() == TQChar(0x20ac)); } catch(MyMoneyException *e) { unexpectedException(e); } @@ -1463,7 +1463,7 @@ void MyMoneyFileTest::testBaseCurrency(void) ref = m->baseCurrency(); CPPUNIT_ASSERT(ref.id() == "EUR"); CPPUNIT_ASSERT(ref.name() == "Euro"); - CPPUNIT_ASSERT(ref.tradingSymbol() == QChar(0x20ac)); + CPPUNIT_ASSERT(ref.tradingSymbol() == TQChar(0x20ac)); } void MyMoneyFileTest::testOpeningBalanceNoBase(void) @@ -1488,9 +1488,9 @@ void MyMoneyFileTest::testOpeningBalance(void) try { openingAcc = m->openingBalanceAccount(m->baseCurrency()); - CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id()); + CPPUNIT_ASSERT(openingAcc.tqparentAccountId() == m->equity().id()); CPPUNIT_ASSERT(openingAcc.name() == MyMoneyFile::OpeningBalancesPrefix); - CPPUNIT_ASSERT(openingAcc.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { unexpectedException(e); } @@ -1504,12 +1504,12 @@ void MyMoneyFileTest::testOpeningBalance(void) unexpectedException(e); } - QString refName = QString("%1 (%2)").arg(MyMoneyFile::OpeningBalancesPrefix).arg("USD"); + TQString refName = TQString("%1 (%2)").tqarg(MyMoneyFile::OpeningBalancesPrefix).tqarg("USD"); try { openingAcc = m->openingBalanceAccount(second); - CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id()); + CPPUNIT_ASSERT(openingAcc.tqparentAccountId() == m->equity().id()); CPPUNIT_ASSERT(openingAcc.name() == refName); - CPPUNIT_ASSERT(openingAcc.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { unexpectedException(e); } diff --git a/kmymoney2/mymoney/mymoneyfiletest.h b/kmymoney2/mymoney/mymoneyfiletest.h index b54af25..133f047 100644 --- a/kmymoney2/mymoney/mymoneyfiletest.h +++ b/kmymoney2/mymoney/mymoneyfiletest.h @@ -40,7 +40,7 @@ class MyMoneyFileTest : public CppUnit::TestFixture { CPPUNIT_TEST(testAddAccounts); CPPUNIT_TEST(testModifyAccount); CPPUNIT_TEST(testModifyStdAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testRemoveAccount); CPPUNIT_TEST(testRemoveAccountTree); CPPUNIT_TEST(testAccountListRetrieval); @@ -63,7 +63,7 @@ class MyMoneyFileTest : public CppUnit::TestFixture { CPPUNIT_TEST(testAttachedStorage); CPPUNIT_TEST(testHasAccount); CPPUNIT_TEST(testAddEquityAccount); - CPPUNIT_TEST(testReparentEquity); + CPPUNIT_TEST(testRetqparentEquity); CPPUNIT_TEST(testBaseCurrency); CPPUNIT_TEST(testOpeningBalanceNoBase); CPPUNIT_TEST(testOpeningBalance); @@ -92,7 +92,7 @@ public: void testAddAccounts(); void testModifyAccount(); void testModifyStdAccount(); - void testReparentAccount(); + void testRetqparentAccount(); void testRemoveAccount(); void testRemoveAccountTree(); void testAccountListRetrieval (); @@ -115,8 +115,8 @@ public: void testAttachedStorage(); void testHasAccount(); void testAddEquityAccount(); - void testReparentEquity(); - void testReparentEquity(QValueList& list, MyMoneyAccount& parent); + void testRetqparentEquity(); + void testRetqparentEquity(TQValueList& list, MyMoneyAccount& tqparent); void testBaseCurrency(); void testOpeningBalanceNoBase(); void testOpeningBalance(); diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp b/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp index d6686a6..33d5855 100644 --- a/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp +++ b/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp @@ -86,8 +86,8 @@ MyMoneyFinancialCalculator::MyMoneyFinancialCalculator() setPmt(0.0); setFv(0.0); - // clear the mask - m_mask = 0; + // clear the tqmask + m_tqmask = 0; } MyMoneyFinancialCalculator::~MyMoneyFinancialCalculator() @@ -122,38 +122,38 @@ void MyMoneyFinancialCalculator::setDisc(const bool disc) void MyMoneyFinancialCalculator::setIr(const FCALC_DOUBLE ir) { m_ir = ir; - m_mask |= IR_SET; + m_tqmask |= IR_SET; } void MyMoneyFinancialCalculator::setPv(const FCALC_DOUBLE pv) { m_pv = pv; - m_mask |= PV_SET; + m_tqmask |= PV_SET; } void MyMoneyFinancialCalculator::setPmt(const FCALC_DOUBLE pmt) { m_pmt = pmt; - m_mask |= PMT_SET; + m_tqmask |= PMT_SET; } void MyMoneyFinancialCalculator::setNpp(const FCALC_DOUBLE npp) { m_npp = npp; - m_mask |= NPP_SET; + m_tqmask |= NPP_SET; } void MyMoneyFinancialCalculator::setFv(const FCALC_DOUBLE fv) { m_fv = fv; - m_mask |= FV_SET; + m_tqmask |= FV_SET; } FCALC_DOUBLE MyMoneyFinancialCalculator::numPayments(void) { - const unsigned short mask = PV_SET | IR_SET | PMT_SET | FV_SET; + const unsigned short tqmask = PV_SET | IR_SET | PMT_SET | FV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of numPayments"); FCALC_DOUBLE eint = eff_int(); @@ -162,15 +162,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::numPayments(void) CC = (CC - m_fv) / (CC + m_pv); m_npp = (CC > 0.0) ? logl (CC) / logl (eint +1.0) : 0.0; - m_mask |= NPP_SET; + m_tqmask |= NPP_SET; return m_npp; } FCALC_DOUBLE MyMoneyFinancialCalculator::payment(void) { - const unsigned short mask = PV_SET | IR_SET | NPP_SET | FV_SET; + const unsigned short tqmask = PV_SET | IR_SET | NPP_SET | FV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment"); FCALC_DOUBLE eint = eff_int(); @@ -180,15 +180,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::payment(void) m_pmt = -rnd((m_fv + m_pv * (AA + 1.0)) / (AA * BB)); //m_pmt = -floorl((m_fv + m_pv * (AA + 1.0)) / (AA * BB)); - m_mask |= PMT_SET; + m_tqmask |= PMT_SET; return m_pmt; } FCALC_DOUBLE MyMoneyFinancialCalculator::presentValue(void) { - const unsigned short mask = PMT_SET | IR_SET | NPP_SET | FV_SET; + const unsigned short tqmask = PMT_SET | IR_SET | NPP_SET | FV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment"); FCALC_DOUBLE eint = eff_int(); @@ -197,15 +197,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::presentValue(void) m_pv = rnd(-(m_fv + (AA * CC)) / (AA + 1.0)); - m_mask |= PV_SET; + m_tqmask |= PV_SET; return m_pv; } FCALC_DOUBLE MyMoneyFinancialCalculator::futureValue(void) { - const unsigned short mask = PMT_SET | IR_SET | NPP_SET | PV_SET; + const unsigned short tqmask = PMT_SET | IR_SET | NPP_SET | PV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment"); FCALC_DOUBLE eint = eff_int(); @@ -213,7 +213,7 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::futureValue(void) FCALC_DOUBLE CC = _Cx(eint); m_fv = rnd(-(m_pv + AA * (m_pv + CC))); - m_mask |= FV_SET; + m_tqmask |= FV_SET; return m_fv; } @@ -260,7 +260,7 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::interestRate(void) } while (ri); } - m_mask |= IR_SET; + m_tqmask |= IR_SET; m_ir = rnd(nom_int(eint) * 100.0); return m_ir; } diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculator.h b/kmymoney2/mymoney/mymoneyfinancialcalculator.h index c603d12..8bc7033 100644 --- a/kmymoney2/mymoney/mymoneyfinancialcalculator.h +++ b/kmymoney2/mymoney/mymoneyfinancialcalculator.h @@ -306,7 +306,7 @@ private: bool m_bep; // beginning/end of period payment flag bool m_disc; // discrete/continous compounding flag - unsigned short m_mask; // available value mask + unsigned short m_tqmask; // available value tqmask #define PV_SET 0x0001 #define IR_SET 0x0002 #define PMT_SET 0x0004 diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp b/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp index fa5b1a3..aae78ab 100644 --- a/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp +++ b/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp @@ -41,7 +41,7 @@ void MyMoneyFinancialCalculatorTest::testEmptyConstructor() { CPPUNIT_ASSERT(m->m_prec == 2); CPPUNIT_ASSERT(m->m_bep == false); CPPUNIT_ASSERT(m->m_disc == true); - CPPUNIT_ASSERT(m->m_mask == 0); + CPPUNIT_ASSERT(m->m_tqmask == 0); } void MyMoneyFinancialCalculatorTest::testSetPrec() { @@ -52,7 +52,7 @@ void MyMoneyFinancialCalculatorTest::testSetPrec() { void MyMoneyFinancialCalculatorTest::testSetNpp() { m->setNpp(20); CPPUNIT_ASSERT(m->m_npp == 20); - CPPUNIT_ASSERT(m->m_mask == NPP_SET); + CPPUNIT_ASSERT(m->m_tqmask == NPP_SET); } void MyMoneyFinancialCalculatorTest::testSetPF() { @@ -86,25 +86,25 @@ void MyMoneyFinancialCalculatorTest::testSetDisc() { void MyMoneyFinancialCalculatorTest::testSetIr() { m->setIr(12.3); CPPUNIT_ASSERT(m->m_ir == 12.3); - CPPUNIT_ASSERT(m->m_mask == IR_SET); + CPPUNIT_ASSERT(m->m_tqmask == IR_SET); } void MyMoneyFinancialCalculatorTest::testSetPv() { m->setPv(23.4); CPPUNIT_ASSERT(m->m_pv == 23.4); - CPPUNIT_ASSERT(m->m_mask == PV_SET); + CPPUNIT_ASSERT(m->m_tqmask == PV_SET); } void MyMoneyFinancialCalculatorTest::testSetPmt() { m->setPmt(34.5); CPPUNIT_ASSERT(m->m_pmt == 34.5); - CPPUNIT_ASSERT(m->m_mask == PMT_SET); + CPPUNIT_ASSERT(m->m_tqmask == PMT_SET); } void MyMoneyFinancialCalculatorTest::testSetFv() { m->setFv(45.6); CPPUNIT_ASSERT(m->m_fv == 45.6); - CPPUNIT_ASSERT(m->m_mask == FV_SET); + CPPUNIT_ASSERT(m->m_tqmask == FV_SET); } void MyMoneyFinancialCalculatorTest::testCombinedSet() { @@ -114,7 +114,7 @@ void MyMoneyFinancialCalculatorTest::testCombinedSet() { m->setPmt(34.5); m->setFv(45.6); - CPPUNIT_ASSERT(m->m_mask == (NPP_SET | PV_SET | IR_SET | PMT_SET | FV_SET)); + CPPUNIT_ASSERT(m->m_tqmask == (NPP_SET | PV_SET | IR_SET | PMT_SET | FV_SET)); } void MyMoneyFinancialCalculatorTest::testNumPayments() { diff --git a/kmymoney2/mymoney/mymoneyforecast.cpp b/kmymoney2/mymoney/mymoneyforecast.cpp index 56125ea..59a565d 100644 --- a/kmymoney2/mymoney/mymoneyforecast.cpp +++ b/kmymoney2/mymoney/mymoneyforecast.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -47,8 +47,8 @@ MyMoneyForecast::MyMoneyForecast() : { setForecastCycles(KMyMoneyGlobalSettings::forecastCycles()); setAccountsCycle(KMyMoneyGlobalSettings::forecastAccountCycle()); - setHistoryStartDate(QDate::currentDate().addDays(-forecastCycles()*accountsCycle())); - setHistoryEndDate(QDate::currentDate().addDays(-1)); + setHistoryStartDate(TQDate::tqcurrentDate().addDays(-forecastCycles()*accountsCycle())); + setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); setForecastDays(KMyMoneyGlobalSettings::forecastDays()); setBeginForecastDay(KMyMoneyGlobalSettings::beginForecastDay()); setForecastMethod(KMyMoneyGlobalSettings::forecastMethod()); @@ -75,12 +75,12 @@ void MyMoneyForecast::doForecast() //initialize global variables setForecastDays(fDays); - setForecastStartDate(QDate::currentDate().addDays(1)); - setForecastEndDate(QDate::currentDate().addDays(fDays)); + setForecastStartDate(TQDate::tqcurrentDate().addDays(1)); + setForecastEndDate(TQDate::tqcurrentDate().addDays(fDays)); setAccountsCycle(fAccCycle); setForecastCycles(fCycles); setHistoryStartDate(forecastCycles() * accountsCycle()); - setHistoryEndDate(QDate::currentDate().addDays(-1)); //yesterday + setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); //yesterday //clear all data before calculating m_accountListPast.clear(); @@ -120,22 +120,22 @@ void MyMoneyForecast::pastTransactions() filter.setDateFilter(historyStartDate(), historyEndDate()); filter.setReportAllSplits(false); - QValueList transactions = file->transactionList(filter); - QValueList::const_iterator it_t = transactions.begin(); + TQValueList transactions = file->transactionList(filter); + TQValueList::const_iterator it_t = transactions.begin(); //Check past transactions for(; it_t != transactions.end(); ++it_t ) { - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s = splits.begin(); + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s = splits.begin(); for(; it_s != splits.end(); ++it_s ) { if(!(*it_s).shares().isZero()) { MyMoneyAccount acc = file->account((*it_s).accountId()); //workaround for stock accounts which have faulty opening dates - QDate openingDate; + TQDate openingDate; if(acc.accountType() == MyMoneyAccount::Stock) { - MyMoneyAccount parentAccount = file->account(acc.parentAccountId()); - openingDate = parentAccount.openingDate(); + MyMoneyAccount tqparentAccount = file->account(acc.tqparentAccountId()); + openingDate = tqparentAccount.openingDate(); } else { openingDate = acc.openingDate(); } @@ -163,11 +163,11 @@ void MyMoneyForecast::pastTransactions() purgeForecastAccountsList(m_accountListPast); //calculate running sum - QMap::Iterator it_n; + TQMap::Iterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); m_accountListPast[acc.id()][historyStartDate().addDays(-1)] = file->balance(acc.id(), historyStartDate().addDays(-1)); - for(QDate it_date = historyStartDate(); it_date <= historyEndDate(); ) { + for(TQDate it_date = historyStartDate(); it_date <= historyEndDate(); ) { m_accountListPast[acc.id()][it_date] += m_accountListPast[acc.id()][it_date.addDays(-1)]; //Running sum it_date = it_date.addDays(1); } @@ -185,7 +185,7 @@ void MyMoneyForecast::pastTransactions() MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); //set the default value MyMoneyPrice price; - for ( QDate it_date = historyStartDate().addDays(-1) ; it_date <= historyEndDate();) { + for ( TQDate it_date = historyStartDate().addDays(-1) ; it_date <= historyEndDate();) { //get the price for the tradingCurrency that day price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), it_date ); if ( price.isValid() ) @@ -207,7 +207,7 @@ bool MyMoneyForecast::isForecastAccount(const MyMoneyAccount& acc) { setForecastAccountList(); } - QMap::Iterator it_n; + TQMap::Iterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { if(*it_n == acc.id()) { @@ -224,7 +224,7 @@ void MyMoneyForecast::calculateAccountTrendList() int totalWeight = 0; //Calculate account trends - QMap::Iterator it_n; + TQMap::Iterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); m_accountTrendList[acc.id()][0] = MyMoneyMoney(0,1); // for today, the trend is 0 @@ -232,10 +232,10 @@ void MyMoneyForecast::calculateAccountTrendList() auxForecastTerms = forecastCycles(); if(skipOpeningDate()) { - QDate openingDate; + TQDate openingDate; if(acc.accountType() == MyMoneyAccount::Stock) { - MyMoneyAccount parentAccount = file->account(acc.parentAccountId()); - openingDate = parentAccount.openingDate(); + MyMoneyAccount tqparentAccount = file->account(acc.tqparentAccountId()); + openingDate = tqparentAccount.openingDate(); } else { openingDate = acc.openingDate(); } @@ -284,14 +284,14 @@ void MyMoneyForecast::calculateAccountTrendList() } } -QValueList MyMoneyForecast::forecastAccountList(void) +TQValueList MyMoneyForecast::forecastAccountList(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; + TQValueList accList; //Get all accounts from the file and check if they are of the right type to calculate forecast file->accountList(accList); - QValueList::iterator accList_t = accList.begin(); + TQValueList::iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ) { MyMoneyAccount acc = *accList_t; if(acc.isClosed() //check the account is not closed @@ -306,15 +306,15 @@ QValueList MyMoneyForecast::forecastAccountList(void) return accList; } -QValueList MyMoneyForecast::accountList(void) +TQValueList MyMoneyForecast::accountList(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; - QStringList emptyStringList; + TQValueList accList; + TQStringList emptyStringList; //Get all accounts from the file and check if they are present file->accountList(accList, emptyStringList, false); - QValueList::iterator accList_t = accList.begin(); + TQValueList::iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ) { MyMoneyAccount acc = *accList_t; if(!isForecastAccount( acc ) ) { @@ -332,8 +332,8 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyTransactionFilter filter; MyMoneyMoney netIncome; - QDate startDate; - QDate openingDate = acc.openingDate(); + TQDate startDate; + TQDate openingDate = acc.openingDate(); //validate arguments if(trendDays < 1) @@ -343,14 +343,14 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i //If it is a new account, we don't take into account the first day //because it is usually a weird one and it would mess up the trend - if(openingDate.daysTo(QDate::currentDate()) transactions = file->transactionList(filter); - QValueList::const_iterator it_t = transactions.begin(); + TQValueList transactions = file->transactionList(filter); + TQValueList::const_iterator it_t = transactions.begin(); //add all transactions for that account for(; it_t != transactions.end(); ++it_t ) { - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s = splits.begin(); + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s = splits.begin(); for(; it_s != splits.end(); ++it_s ) { if(!(*it_s).shares().isZero()) { if(acc.id()==(*it_s).accountId()) netIncome += (*it_s).value(); @@ -377,8 +377,8 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i MyMoneyMoney accTrend; //don't take into account the first day of the account - if(openingDate.daysTo(QDate::currentDate())::ConstIterator it_n; + TQMap::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); @@ -474,7 +474,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances() case 0: case 1: { - for(QDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { + for(TQDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { for(int t_day = 1; t_day <= accountsCycle(); ++t_day) { MyMoneyMoney balanceDayBefore = m_accountList[acc.id()][(f_day.addDays(-1))];//balance of the day before MyMoneyMoney accountDailyTrend = m_accountTrendList[acc.id()][t_day]; //trend for that day @@ -490,10 +490,10 @@ void MyMoneyForecast::calculateHistoricDailyBalances() break; case 2: { - QDate baseDate = QDate::currentDate().addDays(-accountsCycle()); + TQDate baseDate = TQDate::tqcurrentDate().addDays(-accountsCycle()); for(int t_day = 1; t_day <= accountsCycle(); ++t_day) { int f_day = 1; - QDate fDate = baseDate.addDays(accountsCycle()+1); + TQDate fDate = baseDate.addDays(accountsCycle()+1); while (fDate <= forecastEndDate()) { //the calculation is based on the balance for the last month, that is then multiplied by the trend @@ -509,7 +509,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances() } } -MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, QDate forecastDate) +MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, TQDate forecastDate) { dailyBalances balance; @@ -522,7 +522,7 @@ MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, QDate f } balance = m_accountList[acc.id() ]; - if ( balance.contains ( forecastDate ) ) + if ( balance.tqcontains ( forecastDate ) ) { //if the date is not in the forecast, it returns 0 MM_amount = m_accountList[acc.id() ][forecastDate]; } @@ -536,7 +536,7 @@ MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, QDate f */ MyMoneyMoney MyMoneyForecast::forecastBalance (const MyMoneyAccount& acc, int offset ) { - QDate forecastDate = QDate::currentDate().addDays(offset); + TQDate forecastDate = TQDate::tqcurrentDate().addDays(offset); return forecastBalance(acc, forecastDate); } @@ -555,7 +555,7 @@ void MyMoneyForecast::doFutureScheduledForecast(void) purgeForecastAccountsList(m_accountList); //adjust value of investments to deep currency - QMap::ConstIterator it_n; + TQMap::ConstIterator it_n; for ( it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n ) { MyMoneyAccount acc = file->account ( *it_n ); @@ -570,7 +570,7 @@ void MyMoneyForecast::doFutureScheduledForecast(void) MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); MyMoneyPrice price; - for (QDate it_day = QDate::currentDate(); it_day <= forecastEndDate(); ) { + for (TQDate it_day = TQDate::tqcurrentDate(); it_day <= forecastEndDate(); ) { //get the price for the tradingCurrency that day price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), it_day ); if ( price.isValid() ) @@ -596,12 +596,12 @@ void MyMoneyForecast::addFutureTransactions(void) filter.setDateFilter(forecastStartDate(), forecastEndDate()); filter.setReportAllSplits(false); - QValueList transactions = file->transactionList(filter); - QValueList::const_iterator it_t = transactions.begin(); + TQValueList transactions = file->transactionList(filter); + TQValueList::const_iterator it_t = transactions.begin(); for(; it_t != transactions.end(); ++it_t ) { - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s = splits.begin(); + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s = splits.begin(); for(; it_s != splits.end(); ++it_s ) { if(!(*it_s).shares().isZero()) { MyMoneyAccount acc = file->account((*it_s).accountId()); @@ -621,17 +621,17 @@ void MyMoneyForecast::addFutureTransactions(void) } #if 0 - QFile trcFile("forecast.csv"); + TQFile trcFile("forecast.csv"); trcFile.open(IO_WriteOnly); - QTextStream s(&trcFile); + TQTextStream s(&trcFile); { s << "Already present transactions\n"; - QMap::Iterator it_a; - QMap::ConstIterator it_n; + TQMap::Iterator it_a; + TQMap::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - it_a = m_accountList.find(*it_n); + it_a = m_accountList.tqfind(*it_n); s << "\"" << acc.name() << "\","; for(int i = 0; i < 90; ++i) { s << "\"" << (*it_a)[i].formatMoney("") << "\","; @@ -648,12 +648,12 @@ void MyMoneyForecast::addScheduledTransactions (void) MyMoneyFile* file = MyMoneyFile::instance(); // now process all the schedules that may have an impact - QValueList schedule; + TQValueList schedule; schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate::currentDate(), forecastEndDate()); + TQDate::tqcurrentDate(), forecastEndDate()); if(schedule.count() > 0) { - QValueList::Iterator it; + TQValueList::Iterator it; do { qBubbleSort(schedule); it = schedule.begin(); @@ -665,13 +665,13 @@ void MyMoneyForecast::addScheduledTransactions (void) continue; } - QDate date = (*it).nextPayment((*it).lastPayment()); + TQDate date = (*it).nextPayment((*it).lastPayment()); if(!date.isValid()) { schedule.remove(it); continue; } - QDate nextDate = (*it).adjustedNextPayment((*it).lastPayment()); + TQDate nextDate = (*it).adjustedNextPayment((*it).lastPayment()); if (nextDate > forecastEndDate()) { // We're done with this schedule, let's move on to the next schedule.remove(it); @@ -688,22 +688,22 @@ void MyMoneyForecast::addScheduledTransactions (void) MyMoneyTransaction t = (*it).transaction(); // only process the entry, if it is still active - if(!(*it).isFinished() && nextDate != QDate()) { + if(!(*it).isFinished() && nextDate != TQDate()) { // make sure we have all 'starting balances' so that the autocalc works - QValueList::const_iterator it_s; - QMap balanceMap; + TQValueList::const_iterator it_s; + TQMap balanceMap; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s ) { MyMoneyAccount acc = file->account((*it_s).accountId()); if(isForecastAccount(acc)) { // collect all overdues on the first day - QDate forecastDate = nextDate; - if(QDate::currentDate() >= nextDate) - forecastDate = QDate::currentDate().addDays(1); + TQDate forecastDate = nextDate; + if(TQDate::tqcurrentDate() >= nextDate) + forecastDate = TQDate::tqcurrentDate().addDays(1); dailyBalances balance; balance = m_accountList[acc.id()]; - for(QDate f_day = QDate::currentDate(); f_day < forecastDate; ) { + for(TQDate f_day = TQDate::tqcurrentDate(); f_day < forecastDate; ) { balanceMap[acc.id()] += m_accountList[acc.id()][f_day]; f_day = f_day.addDays(1); } @@ -719,14 +719,14 @@ void MyMoneyForecast::addScheduledTransactions (void) if(isForecastAccount(acc)) { dailyBalances balance; balance = m_accountList[acc.id()]; - //int offset = QDate::currentDate().daysTo(nextDate); + //int offset = TQDate::tqcurrentDate().daysTo(nextDate); //if(offset <= 0) { // collect all overdues on the first day // offset = 1; //} // collect all overdues on the first day - QDate forecastDate = nextDate; - if(QDate::currentDate() >= nextDate) - forecastDate = QDate::currentDate().addDays(1); + TQDate forecastDate = nextDate; + if(TQDate::tqcurrentDate() >= nextDate) + forecastDate = TQDate::tqcurrentDate().addDays(1); if(acc.accountType() == MyMoneyAccount::Income) { balance[forecastDate] += ((*it_s).shares() * MyMoneyMoney(-1, 1)); @@ -757,11 +757,11 @@ void MyMoneyForecast::addScheduledTransactions (void) #if 0 { s << "\n\nAdded scheduled transactions\n"; - QMap::Iterator it_a; - QMap::ConstIterator it_n; + TQMap::Iterator it_a; + TQMap::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - it_a = m_accountList.find(*it_n); + it_a = m_accountList.tqfind(*it_n); s << "\"" << acc.name() << "\","; for(int i = 0; i < 90; ++i) { s << "\"" << (*it_a)[i].formatMoney("") << "\","; @@ -777,14 +777,14 @@ void MyMoneyForecast::calculateScheduledDailyBalances (void) MyMoneyFile* file = MyMoneyFile::instance(); //Calculate account daily balances - QMap::ConstIterator it_n; + TQMap::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); //set the starting balance of the account setStartingBalance(acc); - for(QDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { + for(TQDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { MyMoneyMoney balanceDayBefore = m_accountList[acc.id()][(f_day.addDays(-1))];//balance of the day before m_accountList[acc.id()][f_day] += balanceDayBefore; //running sum f_day = f_day.addDays(1); @@ -796,7 +796,7 @@ void MyMoneyForecast::calculateScheduledDailyBalances (void) int MyMoneyForecast::daysToMinimumBalance(const MyMoneyAccount& acc) { - QString minimumBalance = acc.value("minBalanceAbsolute"); + TQString minimumBalance = acc.value("minBalanceAbsolute"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); dailyBalances balance; @@ -807,9 +807,9 @@ int MyMoneyForecast::daysToMinimumBalance(const MyMoneyAccount& acc) balance = m_accountList[acc.id()]; - for(QDate it_day = QDate::currentDate() ; it_day <= forecastEndDate(); ) { + for(TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { if(minBalance > balance[it_day]) { - return QDate::currentDate().daysTo(it_day); + return TQDate::tqcurrentDate().daysTo(it_day); } it_day = it_day.addDays(1); } @@ -828,20 +828,20 @@ int MyMoneyForecast::daysToZeroBalance(const MyMoneyAccount& acc) balance = m_accountList[acc.id()]; if (acc.accountGroup() == MyMoneyAccount::Asset) { - for (QDate it_day = QDate::currentDate() ; it_day <= forecastEndDate(); ) + for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { if ( balance[it_day] < MyMoneyMoney ( 0, 1 ) ) { - return QDate::currentDate().daysTo(it_day); + return TQDate::tqcurrentDate().daysTo(it_day); } it_day = it_day.addDays(1); } } else if (acc.accountGroup() == MyMoneyAccount::Liability) { - for (QDate it_day = QDate::currentDate() ; it_day <= forecastEndDate(); ) + for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { if ( balance[it_day] > MyMoneyMoney ( 0, 1 ) ) { - return QDate::currentDate().daysTo(it_day); + return TQDate::tqcurrentDate().daysTo(it_day); } it_day = it_day.addDays(1); } @@ -853,10 +853,10 @@ void MyMoneyForecast::setForecastAccountList(void) { //get forecast accounts - QValueList accList; + TQValueList accList; accList = forecastAccountList(); - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; // check if this is a new account for us @@ -882,24 +882,24 @@ MyMoneyMoney MyMoneyForecast::accountTotalVariation(const MyMoneyAccount& acc) { MyMoneyMoney totalVariation; - totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, QDate::currentDate()); + totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, TQDate::tqcurrentDate()); return totalVariation; } -QValueList MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAccount& acc) +TQValueList MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAccount& acc) { - QValueList minBalanceList; + TQValueList minBalanceList; int daysToBeginDay; - daysToBeginDay = QDate::currentDate().daysTo(beginForecastDate()); + daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate()); for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) { MyMoneyMoney minBalance = forecastBalance(acc, (t_cycle * accountsCycle() + daysToBeginDay)); - QDate minDate = QDate::currentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay); + TQDate minDate = TQDate::tqcurrentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay); for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) { if( minBalance > forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) { minBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day ); - minDate = QDate::currentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day); + minDate = TQDate::tqcurrentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day); } } minBalanceList.append(minDate); @@ -907,21 +907,21 @@ QValueList MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAc return minBalanceList; } -QValueList MyMoneyForecast::accountMaximumBalanceDateList(const MyMoneyAccount& acc) +TQValueList MyMoneyForecast::accountMaximumBalanceDateList(const MyMoneyAccount& acc) { - QValueList maxBalanceList; + TQValueList maxBalanceList; int daysToBeginDay; - daysToBeginDay = QDate::currentDate().daysTo(beginForecastDate()); + daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate()); for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) { MyMoneyMoney maxBalance = forecastBalance(acc, ((t_cycle * accountsCycle()) + daysToBeginDay)); - QDate maxDate = QDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay); + TQDate maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay); for(int t_day = 0; t_day < accountsCycle() ; ++t_day) { if( maxBalance < forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) { maxBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day ); - maxDate = QDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day); + maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day); } } maxBalanceList.append(maxDate); @@ -943,53 +943,53 @@ int MyMoneyForecast::calculateBeginForecastDay() int fDays = forecastDays(); int beginDay = beginForecastDay(); int accCycle = accountsCycle(); - QDate beginDate; + TQDate beginDate; //if 0, beginDate is current date and forecastDays remains unchanged if(beginDay == 0) { - setBeginForecastDate(QDate::currentDate()); + setBeginForecastDate(TQDate::tqcurrentDate()); return fDays; } //adjust if beginDay more than days of current month - if(QDate::currentDate().daysInMonth() < beginDay) - beginDay = QDate::currentDate().daysInMonth(); + if(TQDate::tqcurrentDate().daysInMonth() < beginDay) + beginDay = TQDate::tqcurrentDate().daysInMonth(); //if beginDay still to come, calculate and return - if(QDate::currentDate().day() <= beginDay) { - beginDate = QDate( QDate::currentDate().year(), QDate::currentDate().month(), beginDay); - fDays += QDate::currentDate().daysTo(beginDate); + if(TQDate::tqcurrentDate().day() <= beginDay) { + beginDate = TQDate( TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); + fDays += TQDate::tqcurrentDate().daysTo(beginDate); setBeginForecastDate(beginDate); return fDays; } //adjust beginDay for next month - if(QDate::currentDate().addMonths(1).daysInMonth() < beginDay) - beginDay = QDate::currentDate().addMonths(1).daysInMonth(); + if(TQDate::tqcurrentDate().addMonths(1).daysInMonth() < beginDay) + beginDay = TQDate::tqcurrentDate().addMonths(1).daysInMonth(); //if beginDay of next month comes before 1 interval, use beginDay next month - if(QDate::currentDate().addDays(accCycle) >= - (QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) ) + if(TQDate::tqcurrentDate().addDays(accCycle) >= + (TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) ) { - beginDate = QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1); - fDays += QDate::currentDate().daysTo(beginDate); + beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1); + fDays += TQDate::tqcurrentDate().daysTo(beginDate); } else //add intervals to current beginDay and take the first after current date { - beginDay = ((((QDate::currentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay; - beginDate = QDate::currentDate().addDays(beginDay - QDate::currentDate().day()); - fDays += QDate::currentDate().daysTo(beginDate); + beginDay = ((((TQDate::tqcurrentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay; + beginDate = TQDate::tqcurrentDate().addDays(beginDay - TQDate::tqcurrentDate().day()); + fDays += TQDate::tqcurrentDate().daysTo(beginDate); } setBeginForecastDate(beginDate); return fDays; } -void MyMoneyForecast::purgeForecastAccountsList(QMap& accountList) +void MyMoneyForecast::purgeForecastAccountsList(TQMap& accountList) { - QMap::Iterator it_n; + TQMap::Iterator it_n; for ( it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ) { - if(!accountList.contains(*it_n)) { + if(!accountList.tqcontains(*it_n)) { m_nameIdx.remove(it_n); it_n = m_nameIdx.begin(); } else @@ -997,10 +997,10 @@ void MyMoneyForecast::purgeForecastAccountsList(QMap& ac } } -void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, QDate historyEnd, QDate budgetStart, QDate budgetEnd, const bool returnBudget ) +void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, TQDate historyStart, TQDate historyEnd, TQDate budgetStart, TQDate budgetEnd, const bool returnBudget ) { // clear all data except the id and name - QString name = budget.name(); + TQString name = budget.name(); budget = MyMoneyBudget(budget.id(), MyMoneyBudget()); budget.setName(name); @@ -1016,10 +1016,10 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, int fMethod = forecastMethod(); //set start date to 1st of month and end dates to last day of month, since we deal with full months in budget - historyStart = QDate ( historyStart.year(), historyStart.month(), 1 ); - historyEnd = QDate ( historyEnd.year(), historyEnd.month(), historyEnd.daysInMonth() ); - budgetStart = QDate ( budgetStart.year(), budgetStart.month(), 1 ); - budgetEnd = QDate ( budgetEnd.year(), budgetEnd.month(), budgetEnd.daysInMonth() ); + historyStart = TQDate ( historyStart.year(), historyStart.month(), 1 ); + historyEnd = TQDate ( historyEnd.year(), historyEnd.month(), historyEnd.daysInMonth() ); + budgetStart = TQDate ( budgetStart.year(), budgetStart.month(), 1 ); + budgetEnd = TQDate ( budgetEnd.year(), budgetEnd.month(), budgetEnd.daysInMonth() ); //set forecast parameters setHistoryStartDate ( historyStart ); @@ -1069,7 +1069,7 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, budget.setBudgetStart ( budgetStart ); //go through all the accounts and add them to budget - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for ( it_nc = m_nameIdx.begin(); it_nc != m_nameIdx.end(); ++it_nc ) { MyMoneyAccount acc = file->account ( *it_nc ); @@ -1077,7 +1077,7 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, budgetAcc.setId ( acc.id() ); budgetAcc.setBudgetLevel ( MyMoneyBudget::AccountGroup::eMonthByMonth ); - for ( QDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { + for ( TQDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { MyMoneyBudget::PeriodGroup period; //add period to budget account @@ -1097,10 +1097,10 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, void MyMoneyForecast::setBudgetAccountList(void) { //get budget accounts - QValueList accList; + TQValueList accList; accList = budgetAccountList(); - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; // check if this is a new account for us @@ -1110,15 +1110,15 @@ void MyMoneyForecast::setBudgetAccountList(void) } } -QValueList MyMoneyForecast::budgetAccountList(void) +TQValueList MyMoneyForecast::budgetAccountList(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; - QStringList emptyStringList; + TQValueList accList; + TQStringList emptyStringList; //Get all accounts from the file and check if they are of the right type to calculate forecast file->accountList(accList, emptyStringList, false); - QValueList::iterator accList_t = accList.begin(); + TQValueList::iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ) { MyMoneyAccount acc = *accList_t; if(acc.isClosed() //check the account is not closed @@ -1137,17 +1137,17 @@ void MyMoneyForecast::calculateHistoricMonthlyBalances() MyMoneyFile* file = MyMoneyFile::instance(); //Calculate account monthly balances - QMap::ConstIterator it_n; + TQMap::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - for( QDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { + for( TQDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { for(int f_day = 1; f_day <= accountsCycle() && f_date <= forecastEndDate(); ++f_day) { MyMoneyMoney accountDailyTrend = m_accountTrendList[acc.id()][f_day]; //trend for that day //check for leap year if(f_date.month() == 2 && f_date.day() == 29) f_date = f_date.addDays(1); //skip 1 day - m_accountList[acc.id()][QDate(f_date.year(), f_date.month(), 1)] += accountDailyTrend; //movement trend for that particular day + m_accountList[acc.id()][TQDate(f_date.year(), f_date.month(), 1)] += accountDailyTrend; //movement trend for that particular day f_date = f_date.addDays(1); } } @@ -1159,18 +1159,18 @@ void MyMoneyForecast::calculateScheduledMonthlyBalances() MyMoneyFile* file = MyMoneyFile::instance(); //Calculate account monthly balances - QMap::ConstIterator it_n; + TQMap::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - for( QDate f_date = forecastStartDate(); f_date <= forecastEndDate(); f_date = f_date.addDays(1) ) { + for( TQDate f_date = forecastStartDate(); f_date <= forecastEndDate(); f_date = f_date.addDays(1) ) { //get the trend for the day MyMoneyMoney accountDailyBalance = m_accountList[acc.id()][f_date]; //do not add if it is the beginning of the month //otherwise we end up with duplicated values as reported by Marko Käning - if(f_date != QDate(f_date.year(), f_date.month(), 1) ) - m_accountList[acc.id()][QDate(f_date.year(), f_date.month(), 1)] += accountDailyBalance; + if(f_date != TQDate(f_date.year(), f_date.month(), 1) ) + m_accountList[acc.id()][TQDate(f_date.year(), f_date.month(), 1)] += accountDailyBalance; } } } @@ -1190,24 +1190,24 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) //set the default value MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); //get te - MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), QDate::currentDate() ); + MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), TQDate::tqcurrentDate() ); if ( price.isValid() ) { rate = price.rate ( undersecurity.tradingCurrency() ); } - m_accountList[acc.id()][QDate::currentDate()] = file->balance(acc.id(), QDate::currentDate()) * rate; + m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()) * rate; } } else { - m_accountList[acc.id()][QDate::currentDate()] = file->balance(acc.id(), QDate::currentDate()); + m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()); } //if the method is linear regression, we have to add the opening balance to m_accountListPast if(forecastMethod() == eHistoric && historyMethod() == 2) { //FIXME workaround for stock opening dates - QDate openingDate; + TQDate openingDate; if(acc.accountType() == MyMoneyAccount::Stock) { - MyMoneyAccount parentAccount = file->account(acc.parentAccountId()); - openingDate = parentAccount.openingDate(); + MyMoneyAccount tqparentAccount = file->account(acc.tqparentAccountId()); + openingDate = tqparentAccount.openingDate(); } else { openingDate = acc.openingDate(); } @@ -1220,7 +1220,7 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) openingBalance = file->balance(acc.id(), openingDate); //calculate running sum - for(QDate it_date = openingDate; it_date <= historyEndDate(); it_date = it_date.addDays(1) ) { + for(TQDate it_date = openingDate; it_date <= historyEndDate(); it_date = it_date.addDays(1) ) { //investments require special treatment if ( acc.isInvest() ) { //get the security id of that account @@ -1248,7 +1248,7 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) } } -void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap& balances) +void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const TQMap& balances) { if (schedule.type() == MyMoneySchedule::TYPE_LOANPAYMENT) { @@ -1259,7 +1259,7 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney if(!amortizationSplit.id().isEmpty() && !interestSplit.id().isEmpty()) { MyMoneyAccountLoan acc(MyMoneyFile::instance()->account(amortizationSplit.accountId())); MyMoneyFinancialCalculator calc; - QDate dueDate; + TQDate dueDate; // FIXME: setup dueDate according to when the interest should be calculated // current implementation: take the date of the next payment according to @@ -1267,8 +1267,8 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney // the payment is overdue then take the current date dueDate = schedule.nextDueDate(); if(acc.interestCalculation() == MyMoneyAccountLoan::paymentReceived) { - if(dueDate < QDate::currentDate()) - dueDate = QDate::currentDate(); + if(dueDate < TQDate::tqcurrentDate()) + dueDate = TQDate::tqcurrentDate(); } // we need to calculate the balance at the time the payment is due @@ -1280,12 +1280,12 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney balance = balances[acc.id()]; /* - QValueList list; - QValueList::ConstIterator it; + TQValueList list; + TQValueList::ConstIterator it; MyMoneySplit split; MyMoneyTransactionFilter filter(acc.id()); - filter.setDateFilter(QDate(), dueDate.addDays(-1)); + filter.setDateFilter(TQDate(), dueDate.addDays(-1)); list = MyMoneyFile::instance()->transactionList(filter); for(it = list.begin(); it != list.end(); ++it) { diff --git a/kmymoney2/mymoney/mymoneyforecast.h b/kmymoney2/mymoney/mymoneyforecast.h index f69e596..7291b2b 100644 --- a/kmymoney2/mymoney/mymoneyforecast.h +++ b/kmymoney2/mymoney/mymoneyforecast.h @@ -25,9 +25,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -59,7 +59,7 @@ public: /** * Returns the list of accounts to be forecast. */ - QValueList accountList(void); + TQValueList accountList(void); /** * Returns the balance trend for account @a acc based on a number of days @p forecastDays @@ -69,9 +69,9 @@ public: static MyMoneyMoney calculateAccountTrend(const MyMoneyAccount& acc, int forecastDays); /** - * Returns the forecast balance trend for account @a acc for day @p QDate + * Returns the forecast balance trend for account @a acc for day @p TQDate */ - MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, QDate forecastDate); + MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, TQDate forecastDate); /** * Returns the forecast balance trend for account @a acc for offset @p int @@ -111,12 +111,12 @@ public: /** * returns a list of the dates where the account was on its lowest balance in each cycle */ - QValueList accountMinimumBalanceDateList(const MyMoneyAccount& acc); + TQValueList accountMinimumBalanceDateList(const MyMoneyAccount& acc); /** * returns a list of the dates where the account was on its highest balance in each cycle */ - QValueList accountMaximumBalanceDateList(const MyMoneyAccount& acc); + TQValueList accountMaximumBalanceDateList(const MyMoneyAccount& acc); /** * returns the average balance of the account within the forecast period @@ -126,7 +126,7 @@ public: /** * creates a budget based on the history of a given timeframe */ - void createBudget(MyMoneyBudget& budget, QDate historyStart, QDate historyEnd, QDate budgetStart, QDate budgetEnd, const bool returnBudget); + void createBudget(MyMoneyBudget& budget, TQDate historyStart, TQDate historyEnd, TQDate budgetStart, TQDate budgetEnd, const bool returnBudget); /** * number of days to go back in history to calculate forecast @@ -136,15 +136,15 @@ public: void setAccountsCycle(int accountsCycle) { m_accountsCycle = accountsCycle; } void setForecastCycles(int forecastCycles) { m_forecastCycles = forecastCycles; } void setForecastDays(int forecastDays) { m_forecastDays = forecastDays; } - void setBeginForecastDate(QDate beginForecastDate) { m_beginForecastDate = beginForecastDate; } + void setBeginForecastDate(TQDate beginForecastDate) { m_beginForecastDate = beginForecastDate; } void setBeginForecastDay(int beginDay) { m_beginForecastDay = beginDay; } void setForecastMethod(int forecastMethod) { m_forecastMethod = forecastMethod; } - void setHistoryStartDate(QDate historyStartDate) { m_historyStartDate = historyStartDate; } - void setHistoryEndDate(QDate historyEndDate) { m_historyEndDate = historyEndDate; } - void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(QDate::currentDate().addDays(-daysToStartDate)); } - void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(QDate::currentDate().addDays(-daysToEndDate)); } - void setForecastStartDate(QDate _startDate) { m_forecastStartDate = _startDate; } - void setForecastEndDate(QDate _endDate) { m_forecastEndDate = _endDate; } + void setHistoryStartDate(TQDate historyStartDate) { m_historyStartDate = historyStartDate; } + void setHistoryEndDate(TQDate historyEndDate) { m_historyEndDate = historyEndDate; } + void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(TQDate::tqcurrentDate().addDays(-daysToStartDate)); } + void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(TQDate::tqcurrentDate().addDays(-daysToEndDate)); } + void setForecastStartDate(TQDate _startDate) { m_forecastStartDate = _startDate; } + void setForecastEndDate(TQDate _endDate) { m_forecastEndDate = _endDate; } void setSkipOpeningDate(bool _skip) { m_skipOpeningDate = _skip; } void setHistoryMethod(int historyMethod) { m_historyMethod = historyMethod; } void setIncludeUnusedAccounts(bool _bool) { m_includeUnusedAccounts = _bool; } @@ -155,13 +155,13 @@ public: int accountsCycle(void) const { return m_accountsCycle; } int forecastCycles(void) const { return m_forecastCycles; } int forecastDays(void) const { return m_forecastDays; } - QDate beginForecastDate(void) const { return m_beginForecastDate; } + TQDate beginForecastDate(void) const { return m_beginForecastDate; } int beginForecastDay(void) const { return m_beginForecastDay; } int forecastMethod(void) const { return m_forecastMethod; } - QDate historyStartDate(void) const { return m_historyStartDate; } - QDate historyEndDate(void) const { return m_historyEndDate; } - QDate forecastStartDate(void) const { return m_forecastStartDate; } - QDate forecastEndDate(void) const { return m_forecastEndDate; } + TQDate historyStartDate(void) const { return m_historyStartDate; } + TQDate historyEndDate(void) const { return m_historyEndDate; } + TQDate forecastStartDate(void) const { return m_forecastStartDate; } + TQDate forecastEndDate(void) const { return m_forecastEndDate; } bool skipOpeningDate(void) const { return m_skipOpeningDate; } int historyMethod(void) const { return m_historyMethod; } bool isIncludingUnusedAccounts(void) const { return m_includeUnusedAccounts; } @@ -175,11 +175,11 @@ public: * * @param schedule const reference to the schedule the transaction is based on * @param transaction reference to the transaction to be checked and modified - * @param balances QMap of (account-id,balance) pairs to be used as current balance + * @param balances TQMap of (account-id,balance) pairs to be used as current balance * for the calculation of interest. If map is empty, the engine * will be interrogated for current balances. */ - static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap& balances); + static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const TQMap& balances); private: @@ -188,22 +188,22 @@ private: /** * daily balances of an account */ - typedef QMap dailyBalances; + typedef TQMap dailyBalances; /** * map of trends of an account */ - typedef QMap trendBalances; + typedef TQMap trendBalances; /** * Returns the list of accounts to be forecast. Only Asset and Liability are returned. */ - static QValueList forecastAccountList(void); + static TQValueList forecastAccountList(void); /** * Returns the list of accounts to create a budget. Only Income and Expenses are returned. */ - QValueList budgetAccountList(void); + TQValueList budgetAccountList(void); /** * calculate daily forecast balance based on historic transactions @@ -300,27 +300,27 @@ private: * remove accounts from the list if the accounts has no transactions in the forecast timeframe. * Used for scheduled-forecast method. */ - void purgeForecastAccountsList(QMap& accountList); + void purgeForecastAccountsList(TQMap& accountList); /** * daily forecast balance of accounts */ - QMap m_accountList; + TQMap m_accountList; /** * daily past balance of accounts */ - QMap m_accountListPast; + TQMap m_accountListPast; /** * daily forecast trends of accounts */ - QMap m_accountTrendList; + TQMap m_accountTrendList; /** * list of forecast accounts */ - QMap m_nameIdx; + TQMap m_nameIdx; /** * cycle of accounts in days @@ -340,7 +340,7 @@ private: /** * date to start forecast */ - QDate m_beginForecastDate; + TQDate m_beginForecastDate; /** * day to start forecast @@ -360,22 +360,22 @@ private: /** * start date of history */ - QDate m_historyStartDate; + TQDate m_historyStartDate; /** * end date of history */ - QDate m_historyEndDate; + TQDate m_historyEndDate; /** * start date of forecast */ - QDate m_forecastStartDate; + TQDate m_forecastStartDate; /** * end date of forecast */ - QDate m_forecastEndDate; + TQDate m_forecastEndDate; /** * skip opening date when fetching transactions of an account diff --git a/kmymoney2/mymoney/mymoneyforecasttest.cpp b/kmymoney2/mymoney/mymoneyforecasttest.cpp index dbe96ac..c200a1f 100644 --- a/kmymoney2/mymoney/mymoneyforecasttest.cpp +++ b/kmymoney2/mymoney/mymoneyforecasttest.cpp @@ -17,7 +17,7 @@ #include "mymoneyforecasttest.h" #include -#include +#include #include "mymoneybudget.h" @@ -52,7 +52,7 @@ void MyMoneyForecastTest::setUp () { MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -65,20 +65,20 @@ void MyMoneyForecastTest::setUp () { acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset, "USD"); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability, "USD"); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense, "USD"); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense, "USD"); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent, "USD"); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense, "USD"); - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset, "USD"); - - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent, "USD"); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild, "USD"); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild, "USD"); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset, "USD"); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability, "USD"); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense, "USD"); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense, "USD"); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent, "USD"); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense, "USD"); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset, "USD"); + + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent, "USD"); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild, "USD"); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild, "USD"); //this account added to have an account to test opening date calculations - acCash = makeAccount(QString("Cash"),MyMoneyAccount::Cash,moCreditOpen,QDate::currentDate().addDays(-2),acAsset, "USD"); + acCash = makeAccount(TQString("Cash"),MyMoneyAccount::Cash,moCreditOpen,TQDate::tqcurrentDate().addDays(-2),acAsset, "USD"); MyMoneyInstitution i("Bank of the World","","","","","",""); @@ -97,18 +97,18 @@ void MyMoneyForecastTest::testEmptyConstructor() { MyMoneyForecast a; MyMoneyAccount b; - int f = a.forecastBalance(b, QDate::currentDate()); + int f = a.forecastBalance(b, TQDate::tqcurrentDate()); CPPUNIT_ASSERT(f == 0); CPPUNIT_ASSERT(!a.isForecastAccount(b)); - CPPUNIT_ASSERT(a.forecastBalance(b, QDate::currentDate()) == MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(b, TQDate::tqcurrentDate()) == MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.daysToMinimumBalance(b) == -1); CPPUNIT_ASSERT(a.daysToZeroBalance(b) == -2); CPPUNIT_ASSERT(a.forecastDays() == KMyMoneyGlobalSettings::forecastDays()); CPPUNIT_ASSERT(a.accountsCycle() == KMyMoneyGlobalSettings::forecastAccountCycle()); CPPUNIT_ASSERT(a.forecastCycles() == KMyMoneyGlobalSettings::forecastCycles()); - CPPUNIT_ASSERT(a.historyStartDate() == QDate::currentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle())); - CPPUNIT_ASSERT(a.historyEndDate() == QDate::currentDate().addDays(-1)); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle())); + CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(a.historyDays() == KMyMoneyGlobalSettings::forecastAccountCycle() * KMyMoneyGlobalSettings::forecastCycles()); } @@ -177,9 +177,9 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); //this is just to check nothing goes wrong if forecast is run agains an empty template //setup some transactions - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); a.setForecastMethod(1); a.setForecastDays(3); @@ -190,32 +190,32 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); //checking didn't have balance variations, so the forecast should be equal to the current balance - MyMoneyMoney b_checking = file->balance(a_checking.id(), QDate::currentDate()); + MyMoneyMoney b_checking = file->balance(a_checking.id(), TQDate::tqcurrentDate()); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(1))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(2))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(3))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate())==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(1))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(2))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(3))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate())==b_checking); //credit had a variation so the forecast should be different for each day - MyMoneyMoney b_credit = file->balance(a_credit.id(), QDate::currentDate()); + MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); a.setHistoryMethod(1); //weighted moving average a.doForecast(); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); //insert transactions outside the forecast period. The calculation should be the same. - TransactionHelper t4( QDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); - TransactionHelper t5( QDate::currentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); - TransactionHelper t6( QDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t4( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t5( TQDate::tqcurrentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t6( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); a.setForecastMethod(1); a.setForecastDays(3); @@ -225,14 +225,14 @@ void MyMoneyForecastTest::testDoForecast() { a.setHistoryMethod(0); //moving average a.doForecast(); //check forecast - b_credit = file->balance(a_credit.id(), QDate::currentDate()); + b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); MyMoneyMoney b_credit_1_exp = (b_credit+((moT2-moT1))); - MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, QDate::currentDate().addDays(2)); + MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)); MyMoneyMoney b_credit_2_exp = (b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate())==file->balance(a_credit.id(), QDate::currentDate())); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1))==b_credit+(moT2-moT1)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate())); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3)); //test weighted moving average a.setForecastMethod(1); @@ -244,7 +244,7 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1)))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1)))); } @@ -253,19 +253,19 @@ void MyMoneyForecastTest::testGetForecastAccountList() MyMoneyForecast a; MyMoneyAccount a_checking = file->account(acChecking); MyMoneyAccount a_parent = file->account(acParent); - QValueList b; + TQValueList b; b = a.forecastAccountList(); //check that it contains asset account, but not expense accounts - CPPUNIT_ASSERT(b.contains(a_checking)); - CPPUNIT_ASSERT(!b.contains(a_parent)); + CPPUNIT_ASSERT(b.tqcontains(a_checking)); + CPPUNIT_ASSERT(!b.tqcontains(a_parent)); } void MyMoneyForecastTest::testCalculateAccountTrend() { //set up environment - TransactionHelper t1( QDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo ); MyMoneyAccount a_checking = file->account(acChecking); //test invalid arguments @@ -296,8 +296,8 @@ void MyMoneyForecastTest::testCalculateAccountTrend() //test that it does not take into account the transactions of the opening date of the account MyMoneyAccount a_cash = file->account(acCash); - TransactionHelper t2( QDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent ); CPPUNIT_ASSERT(MyMoneyForecast::calculateAccountTrend(a_cash,3) == -moT1); } @@ -307,9 +307,9 @@ void MyMoneyForecastTest::testGetForecastBalance() //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); a.setForecastMethod(1); a.setForecastDays(3); @@ -322,23 +322,23 @@ void MyMoneyForecastTest::testGetForecastBalance() MyMoneyAccount a_credit = file->account(acCredit); //test invalid arguments - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(-1))==MyMoneyMoney(0,1)); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(-10))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-1))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-10))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, -1)==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, -100)==MyMoneyMoney(0,1)); //test a date outside the forecast days - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(4))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(4))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, 4)==MyMoneyMoney(0,1)); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(10))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(10))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, 10)==MyMoneyMoney(0,1)); //test it returns valid results - MyMoneyMoney b_credit = file->balance(a_credit.id(), QDate::currentDate()); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate())==file->balance(a_credit.id(), QDate::currentDate())); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1))==b_credit+(moT2-moT1)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3)); + MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate())); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3)); } void MyMoneyForecastTest::testIsForecastAccount() @@ -364,10 +364,10 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast() MyMoneyForecast a; MyMoneyAccount a_cash = file->account(acCash); - TransactionHelper t1( QDate::currentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); - TransactionHelper t2( QDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent ); - TransactionHelper t3( QDate::currentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent ); - TransactionHelper t4( QDate::currentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent ); + TransactionHelper t4( TQDate::tqcurrentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent ); a.setForecastMethod(0); a.setForecastDays(3); @@ -375,13 +375,13 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast() a.setForecastCycles(1); a.doForecast(); - MyMoneyMoney b_cash = file->balance(a_cash.id(), QDate::currentDate()); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); //test valid results - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(1))==b_cash+moT1); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(2))==b_cash+moT1+moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(3))==b_cash+moT1+moT2+moT3); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash+moT1); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash+moT1+moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash+moT1+moT2+moT3); } void MyMoneyForecastTest::testScheduleForecast() @@ -395,14 +395,14 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate().addDays(1), - QDate(), + TQDate::tqcurrentDate().addDays(1), + TQDate(), true, true); MyMoneyTransaction t; - t.setPostDate(QDate::currentDate().addDays(1)); - t.setEntryDate(QDate::currentDate().addDays(1)); + t.setPostDate(TQDate::tqcurrentDate().addDays(1)); + t.setEntryDate(TQDate::tqcurrentDate().addDays(1)); //t.setId("T000000000000000001"); t.setBankID("BID"); t.setMemo("Wohnung:Miete"); @@ -437,18 +437,18 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate().addDays(5), - QDate(), + TQDate::tqcurrentDate().addDays(5), + TQDate(), true, true); - //sch.setLastPayment(QDate::currentDate()); - //sch.recordPayment(QDate::currentDate().addDays(1)); + //sch.setLastPayment(TQDate::tqcurrentDate()); + //sch.recordPayment(TQDate::tqcurrentDate().addDays(1)); //sch.setId("SCH0001"); MyMoneyTransaction t3; - t3.setPostDate(QDate::currentDate().addDays(5)); - t3.setEntryDate(QDate::currentDate().addDays(5)); + t3.setPostDate(TQDate::tqcurrentDate().addDays(5)); + t3.setEntryDate(TQDate::tqcurrentDate().addDays(5)); //t.setId("T000000000000000001"); t3.setBankID("BID"); t3.setMemo("Wohnung:Miete"); @@ -484,18 +484,18 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate().addDays(2), - QDate(), + TQDate::tqcurrentDate().addDays(2), + TQDate(), true, true); - //sch.setLastPayment(QDate::currentDate()); - //sch.recordPayment(QDate::currentDate().addDays(1)); + //sch.setLastPayment(TQDate::tqcurrentDate()); + //sch.recordPayment(TQDate::tqcurrentDate().addDays(1)); //sch.setId("SCH0001"); MyMoneyTransaction t2; - t2.setPostDate(QDate::currentDate().addDays(2)); - t2.setEntryDate(QDate::currentDate().addDays(2)); + t2.setPostDate(TQDate::tqcurrentDate().addDays(2)); + t2.setEntryDate(TQDate::tqcurrentDate().addDays(2)); //t.setId("T000000000000000001"); t2.setBankID("BID"); t2.setMemo("Wohnung:Miete"); @@ -535,13 +535,13 @@ void MyMoneyForecastTest::testScheduleForecast() a.doForecast(); //check result for single schedule - MyMoneyMoney b_cash = file->balance(a_cash.id(), QDate::currentDate()); - MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, QDate::currentDate().addDays(1)); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); + MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1)); //test valid results - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(1))==b_cash-moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(2))==b_cash-moT2-moT1); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2-moT1); } @@ -555,10 +555,10 @@ void MyMoneyForecastTest::testDaysToMinimumBalance() MyMoneyAccount a_parent = file->account(acParent); a_cash.setValue("minBalanceAbsolute", "50"); a_credit.setValue("minBalanceAbsolute", "50"); - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); - TransactionHelper t2( QDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent ); - TransactionHelper t4( QDate::currentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent ); + TransactionHelper t4( TQDate::tqcurrentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent ); a.setForecastMethod(0); a.setForecastDays(3); @@ -588,9 +588,9 @@ void MyMoneyForecastTest::testDaysToZeroBalance() MyMoneyAccount a_Credit = file->account(acCredit); //MyMoneyFileTransaction ft; - TransactionHelper t1( QDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo ); - TransactionHelper t2( QDate::currentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit ); - TransactionHelper t3( QDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent ); //ft.commit(); MyMoneyForecast a; @@ -618,7 +618,7 @@ void MyMoneyForecastTest::testDaysToZeroBalance() //test it warns when inside the forecast period - MyMoneyMoney fCash = a.forecastBalance(a_Cash, QDate::currentDate().addDays(2)); + MyMoneyMoney fCash = a.forecastBalance(a_Cash, TQDate::tqcurrentDate().addDays(2)); CPPUNIT_ASSERT(a.daysToZeroBalance(a_Cash) == 2); @@ -631,8 +631,8 @@ void MyMoneyForecastTest::testSkipOpeningDate() //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(3); @@ -644,12 +644,12 @@ void MyMoneyForecastTest::testSkipOpeningDate() MyMoneyAccount a_cash = file->account(acCash); //test it has no variation because it skipped the variation of the opening date - MyMoneyMoney b_cash = file->balance(a_cash.id(), QDate::currentDate()); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.skipOpeningDate() == true); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(1))==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(2))==b_cash-moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(3))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash-moT2); } void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { @@ -657,34 +657,34 @@ void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(6); a.setAccountsCycle(2); a.setForecastCycles(3); a.setHistoryMethod(0); - a.setBeginForecastDay(QDate::currentDate().addDays(1).day()); + a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day()); a.doForecast(); MyMoneyAccount a_cash = file->account(acCash); //test - QValueList dateList; + TQValueList dateList; dateList = a.accountMinimumBalanceDateList(a_cash); - QValueList::iterator it = dateList.begin(); + TQValueList::iterator it = dateList.begin(); - QDate minDate = *it; + TQDate minDate = *it; - CPPUNIT_ASSERT(minDate==QDate::currentDate().addDays(2)); + CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(2)); it++; minDate = *it; - CPPUNIT_ASSERT(minDate==QDate::currentDate().addDays(4)); + CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(4)); it++; minDate = *it; - CPPUNIT_ASSERT(minDate==QDate::currentDate().addDays(6)); + CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(6)); } @@ -692,34 +692,34 @@ void MyMoneyForecastTest::testAccountMaximumBalanceDateList() { //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(6); a.setAccountsCycle(2); a.setForecastCycles(3); a.setHistoryMethod(0); - a.setBeginForecastDay(QDate::currentDate().addDays(1).day()); + a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day()); a.doForecast(); MyMoneyAccount a_cash = file->account(acCash); //test - QValueList dateList; + TQValueList dateList; dateList = a.accountMaximumBalanceDateList(a_cash); - QValueList::iterator it = dateList.begin(); + TQValueList::iterator it = dateList.begin(); - QDate maxDate = *it; + TQDate maxDate = *it; - CPPUNIT_ASSERT(maxDate==QDate::currentDate().addDays(1)); + CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(1)); it++; maxDate = *it; - CPPUNIT_ASSERT(maxDate==QDate::currentDate().addDays(3)); + CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(3)); it++; maxDate = *it; - CPPUNIT_ASSERT(maxDate==QDate::currentDate().addDays(5)); + CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(5)); } @@ -728,8 +728,8 @@ void MyMoneyForecastTest::testAccountAverageBalance() { //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(3); @@ -741,9 +741,9 @@ void MyMoneyForecastTest::testAccountAverageBalance() { MyMoneyAccount a_cash = file->account(acCash); //test - MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, QDate::currentDate().addDays(1)); - MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, QDate::currentDate().addDays(2)); - MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, QDate::currentDate().addDays(3)); + MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1)); + MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2)); + MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3)); MyMoneyMoney average = (b_cash1 + b_cash2 +b_cash3)/MyMoneyMoney(3,1); @@ -754,7 +754,7 @@ void MyMoneyForecastTest::testAccountAverageBalance() { void MyMoneyForecastTest::testBeginForecastDate() { //set up environment MyMoneyForecast a; - QDate beginDate; + TQDate beginDate; int beginDay; a.setForecastMethod(1); @@ -765,7 +765,7 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test when using old method without begin day - CPPUNIT_ASSERT(QDate::currentDate() == a.beginForecastDate()); + CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); //setup begin to last day of month a.setBeginForecastDay(31); @@ -773,22 +773,22 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test - if(QDate::currentDate().day() < beginDay) + if(TQDate::tqcurrentDate().day() < beginDay) { - if(QDate::currentDate().daysInMonth() < beginDay) - beginDay = QDate::currentDate().daysInMonth(); + if(TQDate::tqcurrentDate().daysInMonth() < beginDay) + beginDay = TQDate::tqcurrentDate().daysInMonth(); - beginDate = QDate(QDate::currentDate().year(), QDate::currentDate().month(), beginDay); + beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); } //setup begin day to same date - a.setBeginForecastDay(QDate::currentDate().day()); + a.setBeginForecastDay(TQDate::tqcurrentDate().day()); beginDay = a.beginForecastDay(); a.doForecast(); - CPPUNIT_ASSERT(QDate::currentDate() == a.beginForecastDate()); + CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); //setup to first day of month with small interval a.setBeginForecastDay(1); @@ -797,14 +797,14 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test - if(QDate::currentDate() == a.beginForecastDate()) { - CPPUNIT_ASSERT(QDate::currentDate() == a.beginForecastDate()); + if(TQDate::tqcurrentDate() == a.beginForecastDate()) { + CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); } else { - beginDay = ((((QDate::currentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay; - if(beginDay > QDate::currentDate().daysInMonth()) - beginDay = QDate::currentDate().daysInMonth(); - beginDate = QDate(QDate::currentDate().year(), QDate::currentDate().month(), beginDay); - if(QDate::currentDate().day() == QDate::currentDate().daysInMonth() ) { + beginDay = ((((TQDate::tqcurrentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay; + if(beginDay > TQDate::tqcurrentDate().daysInMonth()) + beginDay = TQDate::tqcurrentDate().daysInMonth(); + beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); + if(TQDate::tqcurrentDate().day() == TQDate::tqcurrentDate().daysInMonth() ) { std::cout << std::endl << "testBeginForecastDate(): test of first day of month with small interval skipped because it is the last day of month" << std::endl; } else { CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); @@ -813,9 +813,9 @@ void MyMoneyForecastTest::testBeginForecastDate() { //setup to test when current date plus cycle equals begin day a.setAccountsCycle(14); - beginDay = QDate::currentDate().addDays(14).day(); + beginDay = TQDate::tqcurrentDate().addDays(14).day(); a.setBeginForecastDay(beginDay); - beginDate = QDate::currentDate().addDays(14); + beginDate = TQDate::tqcurrentDate().addDays(14); a.doForecast(); //test @@ -826,10 +826,10 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.setAccountsCycle(40); a.doForecast(); - beginDate = QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1); + beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1); //test - if(QDate::currentDate().day() > 1) { + if(TQDate::tqcurrentDate().day() > 1) { CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); } else { //test is not valid if today is 1st of month @@ -841,8 +841,8 @@ void MyMoneyForecastTest::testBeginForecastDate() { { MyMoneyForecast a; - CPPUNIT_ASSERT(a.historyStartDate() == QDate::currentDate().addDays(-a.forecastCycles()*a.accountsCycle()) ); - CPPUNIT_ASSERT(a.historyEndDate() == QDate::currentDate().addDays(-1) ); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-a.forecastCycles()*a.accountsCycle()) ); + CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1) ); CPPUNIT_ASSERT(a.historyDays() == a.forecastCycles()*a.accountsCycle()); a.setForecastMethod(1); @@ -852,9 +852,9 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.setBeginForecastDay(0); a.doForecast(); - CPPUNIT_ASSERT(a.historyStartDate() == QDate::currentDate().addDays(-14*3) ); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-14*3) ); CPPUNIT_ASSERT(a.historyDays() == (14*3)); - CPPUNIT_ASSERT(a.historyEndDate() == (QDate::currentDate().addDays(-1)) ); + CPPUNIT_ASSERT(a.historyEndDate() == (TQDate::tqcurrentDate().addDays(-1)) ); } void MyMoneyForecastTest::testCreateBudget() @@ -864,43 +864,43 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneyForecast b; MyMoneyBudget budget; - TransactionHelper t1( QDate(2005, 1, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate(2005, 1, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); - TransactionHelper t3( QDate(2005, 1, 30), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); - TransactionHelper t4( QDate(2006, 1, 25), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); - TransactionHelper t5( QDate(2005, 4, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t6( QDate(2006, 5, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); - TransactionHelper t7( QDate(2005, 8, 3), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); - TransactionHelper t8( QDate(2006, 9, 15), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); + TransactionHelper t1( TQDate(2005, 1, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate(2005, 1, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); + TransactionHelper t3( TQDate(2005, 1, 30), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); + TransactionHelper t4( TQDate(2006, 1, 25), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); + TransactionHelper t5( TQDate(2005, 4, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t6( TQDate(2006, 5, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); + TransactionHelper t7( TQDate(2005, 8, 3), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); + TransactionHelper t8( TQDate(2006, 9, 15), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); a.setHistoryMethod(0); a.setForecastMethod(1); - a.createBudget(budget, QDate(2005, 1, 1), QDate(2006, 12, 31), QDate(2007, 1, 1), QDate(2007, 12, 31), true); + a.createBudget(budget, TQDate(2005, 1, 1), TQDate(2006, 12, 31), TQDate(2007, 1, 1), TQDate(2007, 12, 31), true); //test MyMoneyAccount a_solo = file->account(acSolo); MyMoneyAccount a_parent = file->account(acParent); //test it has no variation because it skipped the variation of the opening date - CPPUNIT_ASSERT(a.forecastBalance(a_solo, QDate(2007, 1, 1)) == ((moT1+moT3)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_parent, QDate(2007, 1, 1)) == ((moT2+moT4)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_solo, QDate(2007, 4, 1)) == ((moT1)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_parent, QDate(2007, 5, 1)) == ((moT2)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_solo, QDate(2007, 8, 1)) == ((moT3)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_parent, QDate(2007, 9, 1)) == ((moT4)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_solo, TQDate(2007, 1, 1)) == ((moT1+moT3)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_parent, TQDate(2007, 1, 1)) == ((moT2+moT4)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_solo, TQDate(2007, 4, 1)) == ((moT1)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_parent, TQDate(2007, 5, 1)) == ((moT2)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_solo, TQDate(2007, 8, 1)) == ((moT3)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_parent, TQDate(2007, 9, 1)) == ((moT4)/MyMoneyMoney(2, 1))); //test the budget object returned by the method - CPPUNIT_ASSERT(budget.account(a_parent.id()).period(QDate(2007, 9, 1)).amount() == ((moT4)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(budget.account(a_parent.id()).period(TQDate(2007, 9, 1)).amount() == ((moT4)/MyMoneyMoney(2, 1))); //setup test for a length lower than a year b.setForecastMethod(1); b.setHistoryMethod(0); - b.createBudget(budget, QDate(2005, 1, 1), QDate(2005, 6, 30), QDate(2007, 1, 1), QDate(2007, 6, 30), true); + b.createBudget(budget, TQDate(2005, 1, 1), TQDate(2005, 6, 30), TQDate(2007, 1, 1), TQDate(2007, 6, 30), true); //test - CPPUNIT_ASSERT(b.forecastBalance(a_solo, QDate(2007, 1, 1)) == (moT1+moT3)); - CPPUNIT_ASSERT(b.forecastBalance(a_parent, QDate(2007, 1, 1)) == (moT2)); - CPPUNIT_ASSERT(b.forecastBalance(a_solo, QDate(2007, 4, 1)) == (moT1)); - CPPUNIT_ASSERT(b.forecastBalance(a_parent, QDate(2007, 5, 1)) == (MyMoneyMoney(0, 1))); + CPPUNIT_ASSERT(b.forecastBalance(a_solo, TQDate(2007, 1, 1)) == (moT1+moT3)); + CPPUNIT_ASSERT(b.forecastBalance(a_parent, TQDate(2007, 1, 1)) == (moT2)); + CPPUNIT_ASSERT(b.forecastBalance(a_solo, TQDate(2007, 4, 1)) == (moT1)); + CPPUNIT_ASSERT(b.forecastBalance(a_parent, TQDate(2007, 5, 1)) == (MyMoneyMoney(0, 1))); //set up schedule environment for testing MyMoneyAccount a_cash = file->account(acCash); @@ -910,14 +910,14 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_MONTHLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate(), - QDate(), + TQDate::tqcurrentDate(), + TQDate(), true, true); MyMoneyTransaction t10; - t10.setPostDate(QDate::currentDate().addMonths(1)); - t10.setEntryDate(QDate::currentDate().addMonths(1)); + t10.setPostDate(TQDate::tqcurrentDate().addMonths(1)); + t10.setEntryDate(TQDate::tqcurrentDate().addMonths(1)); //t.setId("T000000000000000001"); t10.setBankID("BID"); t10.setMemo("Wohnung:Miete"); @@ -951,12 +951,12 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneyForecast c; c.setForecastMethod(0); c.setForecastCycles(1); - c.createBudget(budget, QDate::currentDate().addYears(-2), QDate::currentDate().addYears(-1), QDate::currentDate().addMonths(-2), QDate::currentDate().addMonths(6), true); + c.createBudget(budget, TQDate::tqcurrentDate().addYears(-2), TQDate::tqcurrentDate().addYears(-1), TQDate::tqcurrentDate().addMonths(-2), TQDate::tqcurrentDate().addMonths(6), true); - MyMoneyMoney c_parent = c.forecastBalance(a_parent, QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1) ); + MyMoneyMoney c_parent = c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ); //test valid results - CPPUNIT_ASSERT(c.forecastBalance(a_parent, QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1) ) == (moT2)); + CPPUNIT_ASSERT(c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ) == (moT2)); } void MyMoneyForecastTest::testLinearRegression() { @@ -967,9 +967,9 @@ void MyMoneyForecastTest::testLinearRegression() { MyMoneyAccount a_credit = file->account(acCredit); //setup some transactions - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); //TODO Add tests specific for linear regression diff --git a/kmymoney2/mymoney/mymoneyinstitution.cpp b/kmymoney2/mymoney/mymoneyinstitution.cpp index 9969ee7..5b3b19e 100644 --- a/kmymoney2/mymoney/mymoneyinstitution.cpp +++ b/kmymoney2/mymoney/mymoneyinstitution.cpp @@ -34,20 +34,20 @@ MyMoneyInstitution::MyMoneyInstitution() { } -MyMoneyInstitution::MyMoneyInstitution(const QString& id, const MyMoneyInstitution& right) : +MyMoneyInstitution::MyMoneyInstitution(const TQString& id, const MyMoneyInstitution& right) : MyMoneyObject(id) { *this = right; m_id = id; } -MyMoneyInstitution::MyMoneyInstitution(const QString& name, - const QString& town, - const QString& street, - const QString& postcode, - const QString& telephone, - const QString& manager, - const QString& sortcode) +MyMoneyInstitution::MyMoneyInstitution(const TQString& name, + const TQString& town, + const TQString& street, + const TQString& postcode, + const TQString& telephone, + const TQString& manager, + const TQString& sortcode) { clearId(); m_name = name; @@ -59,7 +59,7 @@ MyMoneyInstitution::MyMoneyInstitution(const QString& name, m_sortcode = sortcode; } -MyMoneyInstitution::MyMoneyInstitution(const QDomElement& node) : +MyMoneyInstitution::MyMoneyInstitution(const TQDomElement& node) : MyMoneyObject(node), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()) { @@ -70,13 +70,13 @@ MyMoneyInstitution::MyMoneyInstitution(const QDomElement& node) : m_name = node.attribute("name"); m_manager = node.attribute("manager"); - QDomNodeList nodeList = node.elementsByTagName("ADDRESS"); + TQDomNodeList nodeList = node.elementsByTagName("ADDRESS"); if(nodeList.count() == 0) { - QString msg = QString("No ADDRESS in institution %1").arg(m_name); + TQString msg = TQString("No ADDRESS in institution %1").tqarg(m_name); throw new MYMONEYEXCEPTION(msg); } - QDomElement addrNode = nodeList.item(0).toElement(); + TQDomElement addrNode = nodeList.item(0).toElement(); m_street = addrNode.attribute("street"); m_town = addrNode.attribute("city"); m_postcode = addrNode.attribute("zip"); @@ -97,19 +97,19 @@ MyMoneyInstitution::~MyMoneyInstitution() { } -void MyMoneyInstitution::addAccountId(const QString& account) +void MyMoneyInstitution::addAccountId(const TQString& account) { // only add this account if it is not yet presently in the list - if(m_accountList.contains(account) == 0) + if(m_accountList.tqcontains(account) == 0) m_accountList.append(account); } -QString MyMoneyInstitution::removeAccountId(const QString& account) +TQString MyMoneyInstitution::removeAccountId(const TQString& account) { - QStringList::Iterator pos; - QString rc; + TQStringList::Iterator pos; + TQString rc; - pos = m_accountList.find(account); + pos = m_accountList.tqfind(account); if(pos != m_accountList.end()) { m_accountList.remove(pos); rc = account; @@ -138,9 +138,9 @@ bool MyMoneyInstitution::operator == (const MyMoneyInstitution& right) const return false; } -void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyInstitution::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("INSTITUTION"); + TQDomElement el = document.createElement("INSTITUTION"); writeBaseXML(document, el); @@ -148,7 +148,7 @@ void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) c el.setAttribute("manager", m_manager); el.setAttribute("sortcode", m_sortcode); - QDomElement address = document.createElement("ADDRESS"); + TQDomElement address = document.createElement("ADDRESS"); address.setAttribute("street", m_street); address.setAttribute("city", m_town); address.setAttribute("zip", m_postcode); @@ -156,9 +156,9 @@ void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) c el.appendChild(address); - QDomElement accounts = document.createElement("ACCOUNTIDS"); - for(QStringList::ConstIterator it = accountList().begin(); it != accountList().end(); ++it){ - QDomElement temp = document.createElement("ACCOUNTID"); + TQDomElement accounts = document.createElement("ACCOUNTIDS"); + for(TQStringList::ConstIterator it = accountList().begin(); it != accountList().end(); ++it){ + TQDomElement temp = document.createElement("ACCOUNTID"); temp.setAttribute("id", (*it)); accounts.appendChild(temp); } @@ -167,16 +167,16 @@ void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) c //Add in Key-Value Pairs for institutions. MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyInstitution::hasReferenceTo(const QString& /* id */) const +bool MyMoneyInstitution::hasReferenceTo(const TQString& /* id */) const { bool rc = false; return rc; } -QPixmap MyMoneyInstitution::pixmap() const { - return QPixmap(KGlobal::dirs()->findResource("appdata",QString( "icons/hicolor/22x22/actions/%1.png").arg("bank"))); +TQPixmap MyMoneyInstitution::pixmap() const { + return TQPixmap(KGlobal::dirs()->findResource("appdata",TQString( "icons/hicolor/22x22/actions/%1.png").tqarg("bank"))); } diff --git a/kmymoney2/mymoney/mymoneyinstitution.h b/kmymoney2/mymoney/mymoneyinstitution.h index 35b44c5..47d9321 100644 --- a/kmymoney2/mymoney/mymoneyinstitution.h +++ b/kmymoney2/mymoney/mymoneyinstitution.h @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -58,13 +58,13 @@ public: * values required for a new institution. This object should then be * passed to @see MyMoneyFile::addInstitution */ - MyMoneyInstitution(const QString& name, - const QString& city, - const QString& street, - const QString& postcode, - const QString& telephone, - const QString& manager, - const QString& sortCode); + MyMoneyInstitution(const TQString& name, + const TQString& city, + const TQString& street, + const TQString& postcode, + const TQString& telephone, + const TQString& manager, + const TQString& sortCode); /** * This is the destructor for any MyMoneyInstitution object @@ -77,34 +77,34 @@ public: * @param id id assigned to the new institution object * @param right institution definition */ - MyMoneyInstitution(const QString& id, const MyMoneyInstitution& right); + MyMoneyInstitution(const TQString& id, const MyMoneyInstitution& right); /** * This is the constructor for an institution that is described by a - * QDomElement (e.g. from a file). + * TQDomElement (e.g. from a file). * - * @param el const reference to the QDomElement from which to + * @param el const reference to the TQDomElement from which to * create the object */ - MyMoneyInstitution(const QDomElement& el); + MyMoneyInstitution(const TQDomElement& el); - const QString& manager(void) const { return m_manager; } - const QString& name(void) const { return m_name; } - const QString& postcode(void) const { return m_postcode; } - const QString& street(void) const { return m_street; } - const QString& telephone(void) const { return m_telephone; } - const QString& town(void) const { return m_town; } - const QString& city(void) const { return town(); } - const QString& sortcode(void) const { return m_sortcode; } + const TQString& manager(void) const { return m_manager; } + const TQString& name(void) const { return m_name; } + const TQString& postcode(void) const { return m_postcode; } + const TQString& street(void) const { return m_street; } + const TQString& telephone(void) const { return m_telephone; } + const TQString& town(void) const { return m_town; } + const TQString& city(void) const { return town(); } + const TQString& sortcode(void) const { return m_sortcode; } - void setManager(QString manager) { m_manager = manager; } - void setName(QString name) { m_name = name; } - void setPostcode(QString code) { m_postcode = code; } - void setStreet(QString street) { m_street = street; } - void setTelephone(QString tel) { m_telephone = tel; } - void setTown(QString town) { m_town = town; } - void setCity(QString town) { setTown(town); } - void setSortcode(QString code) { m_sortcode = code; } + void setManager(TQString manager) { m_manager = manager; } + void setName(TQString name) { m_name = name; } + void setPostcode(TQString code) { m_postcode = code; } + void setStreet(TQString street) { m_street = street; } + void setTelephone(TQString tel) { m_telephone = tel; } + void setTown(TQString town) { m_town = town; } + void setCity(TQString town) { setTown(town); } + void setSortcode(TQString code) { m_sortcode = code; } /** * This method adds the id of an account to the account list of @@ -113,7 +113,7 @@ public: * * @param account id of the account to be added */ - void addAccountId(const QString& account); + void addAccountId(const TQString& account); /** * This method deletes the id of an account from the account list @@ -122,14 +122,14 @@ public: * @param account id of the account to be deleted * @return id of account deleted, otherwise empty string */ - QString removeAccountId(const QString& account); + TQString removeAccountId(const TQString& account); /** * This method is used to return the set of accounts known to * this institution - * return QStringList of account ids + * return TQStringList of account ids */ - const QStringList& accountList(void) const { return m_accountList; } + const TQStringList& accountList(void) const { return m_accountList; } /** * This method returns the number of accounts known to @@ -141,7 +141,7 @@ public: bool operator == (const MyMoneyInstitution&) const; bool operator < (const MyMoneyInstitution& right) const; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -152,55 +152,55 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; - QPixmap pixmap() const; + TQPixmap pixmap() const; private: // Bank 'fields' /** * This member variable keeps the name of the institution */ - QString m_name; + TQString m_name; /** * This member variable keeps the city of the institution */ - QString m_town; + TQString m_town; /** * This member variable keeps the street of the institution */ - QString m_street; + TQString m_street; /** * This member variable keeps the zip-code of the institution */ - QString m_postcode; + TQString m_postcode; /** * This member variable keeps the telephone number of the institution */ - QString m_telephone; + TQString m_telephone; /** * This member variable keeps the name of the representative of * the institution */ - QString m_manager; + TQString m_manager; /** * This member variable keeps the sort code of the institution. * FIXME: I have no idea * what it is good for. I keep it because it was in the old engine. */ - QString m_sortcode; + TQString m_sortcode; /** * This member variable keeps the sorted list of the account ids * available at this institution */ - QStringList m_accountList; + TQStringList m_accountList; }; #endif diff --git a/kmymoney2/mymoney/mymoneyinstitutiontest.cpp b/kmymoney2/mymoney/mymoneyinstitutiontest.cpp index ce707ec..bf889b0 100644 --- a/kmymoney2/mymoney/mymoneyinstitutiontest.cpp +++ b/kmymoney2/mymoney/mymoneyinstitutiontest.cpp @@ -161,8 +161,8 @@ void MyMoneyInstitutionTest::testInequality () { void MyMoneyInstitutionTest::testAccountIDList () { MyMoneyInstitution institution; - QStringList list; - QString id; + TQStringList list; + TQString id; // list must be empty list = institution.accountList(); @@ -172,26 +172,26 @@ void MyMoneyInstitutionTest::testAccountIDList () { institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // adding same account shouldn't make a difference institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // now add another account institution.addAccountId("A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 2); - CPPUNIT_ASSERT(list.contains("A000002") == 1); - CPPUNIT_ASSERT(list.contains("A000001") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000001") == 1); id = institution.removeAccountId("A000001"); CPPUNIT_ASSERT(id == "A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); } @@ -200,17 +200,17 @@ void MyMoneyInstitutionTest::testWriteXML() { n->addAccountId("A000001"); n->addAccountId("A000003"); - n->setValue(QString("key"), "value"); + n->setValue(TQString("key"), "value"); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("INSTITUTION-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("INSTITUTION-CONTAINER"); doc.appendChild(el); MyMoneyInstitution i("I00001", *n); i.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "\n" "\n" " \n" @@ -230,7 +230,7 @@ void MyMoneyInstitutionTest::testWriteXML() { void MyMoneyInstitutionTest::testReadXML() { MyMoneyInstitution i; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" " \n" @@ -245,7 +245,7 @@ void MyMoneyInstitutionTest::testReadXML() { " \n" "\n"); - QString ref_false = QString( + TQString ref_false = TQString( "\n" "\n" " \n" @@ -257,8 +257,8 @@ void MyMoneyInstitutionTest::testReadXML() { " \n" "\n"); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -274,7 +274,7 @@ void MyMoneyInstitutionTest::testReadXML() { doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); try { - QStringList alist; + TQStringList alist; alist << "A000001" << "A000003"; i = MyMoneyInstitution(node); @@ -287,7 +287,7 @@ void MyMoneyInstitutionTest::testReadXML() { CPPUNIT_ASSERT(i.city() == "town"); CPPUNIT_ASSERT(i.telephone() == "telephone"); CPPUNIT_ASSERT(i.accountList() == alist); - CPPUNIT_ASSERT(i.value(QString("key")) == "value"); + CPPUNIT_ASSERT(i.value(TQString("key")) == "value"); } catch(MyMoneyException *e) { delete e; diff --git a/kmymoney2/mymoney/mymoneyinvesttransaction.cpp b/kmymoney2/mymoney/mymoneyinvesttransaction.cpp index a7cf082..89bef92 100644 --- a/kmymoney2/mymoney/mymoneyinvesttransaction.cpp +++ b/kmymoney2/mymoney/mymoneyinvesttransaction.cpp @@ -23,10 +23,10 @@ #include "mymoneyinvesttransaction.h" #if 0 -MyMoneyInvestTransaction::MyMoneyInvestTransaction(MyMoneyAccount *parent, const long id, transactionMethod method, const QString& number, const QString& memo, - const MyMoneyMoney& amount, const QDate& date, const QString& categoryMajor, const QString& categoryMinor, const QString& atmName, - const QString& fromTo, const QString& bankFrom, const QString& bankTo, stateE state) - : MyMoneyTransaction(parent, id, method, number, memo, amount, date, categoryMajor, categoryMinor, atmName, fromTo, bankFrom, bankTo, state) +MyMoneyInvestTransaction::MyMoneyInvestTransaction(MyMoneyAccount *tqparent, const long id, transactionMethod method, const TQString& number, const TQString& memo, + const MyMoneyMoney& amount, const TQDate& date, const TQString& categoryMajor, const TQString& categoryMinor, const TQString& atmName, + const TQString& fromTo, const TQString& bankFrom, const TQString& bankTo, stateE state) + : MyMoneyTransaction(tqparent, id, method, number, memo, amount, date, categoryMajor, categoryMinor, atmName, fromTo, bankFrom, bankTo, state) { } diff --git a/kmymoney2/mymoney/mymoneyinvesttransaction.h b/kmymoney2/mymoney/mymoneyinvesttransaction.h index 59f5d5b..e414b3a 100644 --- a/kmymoney2/mymoney/mymoneyinvesttransaction.h +++ b/kmymoney2/mymoney/mymoneyinvesttransaction.h @@ -33,9 +33,9 @@ class MyMoneyInvestTransaction : public MyMoneyTransaction { public: MyMoneyInvestTransaction(); - MyMoneyInvestTransaction(MyMoneyAccount *parent, const long id, transactionMethod method, const QString& number, const QString& memo, - const MyMoneyMoney& amount, const QDate& date, const QString& categoryMajor, const QString& categoryMinor, const QString& atmName, - const QString& fromTo, const QString& bankFrom, const QString& bankTo, stateE state); + MyMoneyInvestTransaction(MyMoneyAccount *tqparent, const long id, transactionMethod method, const TQString& number, const TQString& memo, + const MyMoneyMoney& amount, const TQDate& date, const TQString& categoryMajor, const TQString& categoryMinor, const TQString& atmName, + const TQString& fromTo, const TQString& bankFrom, const TQString& bankTo, stateE state); ~MyMoneyInvestTransaction(); }; #endif diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp b/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp index 4df855b..382893a 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp @@ -28,7 +28,7 @@ MyMoneyKeyValueContainer::MyMoneyKeyValueContainer() { } -MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const QDomElement& node) +MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const TQDomElement& node) { if(!node.isNull()) { if("KEYVALUEPAIRS" != node.tagName()) @@ -36,9 +36,9 @@ MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const QDomElement& node) m_kvp.clear(); - QDomNodeList nodeList = node.elementsByTagName("PAIR"); + TQDomNodeList nodeList = node.elementsByTagName("PAIR"); for(unsigned int i = 0; i < nodeList.count(); ++i) { - const QDomElement& el(nodeList.item(i).toElement()); + const TQDomElement& el(nodeList.item(i).toElement()); m_kvp[el.attribute("key")] = el.attribute("value"); } } @@ -48,32 +48,32 @@ MyMoneyKeyValueContainer::~MyMoneyKeyValueContainer() { } -const QString& MyMoneyKeyValueContainer::value(const QString& key) const +const TQString& MyMoneyKeyValueContainer::value(const TQString& key) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_kvp.find(key); + it = m_kvp.tqfind(key); if(it != m_kvp.end()) return (*it); - return QString::null; + return TQString(); } -void MyMoneyKeyValueContainer::setValue(const QString& key, const QString& value) +void MyMoneyKeyValueContainer::setValue(const TQString& key, const TQString& value) { m_kvp[key] = value; } -void MyMoneyKeyValueContainer::setPairs(const QMap& list) +void MyMoneyKeyValueContainer::setPairs(const TQMap& list) { m_kvp = list; } -void MyMoneyKeyValueContainer::deletePair(const QString& key) +void MyMoneyKeyValueContainer::deletePair(const TQString& key) { - QMap::Iterator it; + TQMap::Iterator it; - it = m_kvp.find(key); + it = m_kvp.tqfind(key); if(it != m_kvp.end()) m_kvp.remove(it); } @@ -85,7 +85,7 @@ void MyMoneyKeyValueContainer::clear(void) bool MyMoneyKeyValueContainer::operator == (const MyMoneyKeyValueContainer& right) const { - QMap::ConstIterator it_a, it_b; + TQMap::ConstIterator it_a, it_b; it_a = m_kvp.begin(); it_b = right.m_kvp.begin(); @@ -101,20 +101,20 @@ bool MyMoneyKeyValueContainer::operator == (const MyMoneyKeyValueContainer& righ return (it_a == m_kvp.end() && it_b == right.m_kvp.end()); } -void MyMoneyKeyValueContainer::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyKeyValueContainer::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { if(m_kvp.count() != 0) { - QDomElement el = document.createElement("KEYVALUEPAIRS"); + TQDomElement el = document.createElement("KEYVALUEPAIRS"); - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = m_kvp.begin(); it != m_kvp.end(); ++it) { - QDomElement pair = document.createElement("PAIR"); + TQDomElement pair = document.createElement("PAIR"); pair.setAttribute("key", it.key()); pair.setAttribute("value", it.data()); el.appendChild(pair); } - parent.appendChild(el); + tqparent.appendChild(el); } } diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainer.h b/kmymoney2/mymoney/mymoneykeyvaluecontainer.h index fa045b9..42169d5 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainer.h +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainer.h @@ -30,9 +30,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include #include // ---------------------------------------------------------------------------- @@ -53,7 +53,7 @@ class KMYMONEY_EXPORT MyMoneyKeyValueContainer { public: MyMoneyKeyValueContainer(); - MyMoneyKeyValueContainer(const QDomElement& node); + MyMoneyKeyValueContainer(const TQDomElement& node); ~MyMoneyKeyValueContainer(); @@ -61,28 +61,28 @@ public: * This method can be used to retrieve the value for a specific @p key. * If the key is unknown in this container, an empty string will be returned. * - * @param key const reference to QString with the key to search for + * @param key const reference to TQString with the key to search for * @return reference to value of this key. If the key does not exist, * an emtpy string is returned. */ - const QString& value(const QString& key) const; + const TQString& value(const TQString& key) const; /** * This method is used to add a key/value pair to the container or * modify an existing pair. * - * @param key const reference to QString with the key to search for - * @param value const reference to QString with the value for this key + * @param key const reference to TQString with the key to search for + * @param value const reference to TQString with the value for this key */ - void setValue(const QString& key, const QString& value); + void setValue(const TQString& key, const TQString& value); /** * This method is used to remove an existing key/value pair from the * container. If the key does not exist, the container is not changed. * - * @param key const reference to QString with the key to remove + * @param key const reference to TQString with the key to remove */ - void deletePair(const QString& key); + void deletePair(const TQString& key); /** * This method clears all pairs currently in the container. @@ -94,46 +94,46 @@ public: * from the container. It is meant to be used for permanent storage * functionality. * - * @return QMap containing all key/value pairs of + * @return TQMap containing all key/value pairs of * this container. */ - const QMap& pairs(void) const { return m_kvp; }; + const TQMap& pairs(void) const { return m_kvp; }; /** * This method is used to initially store a set of key/value pairs * in the container. It is meant to be used for loading functionality * from permanent storage. * - * @param list const QMap containing the set of + * @param list const TQMap containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - void setPairs(const QMap& list); + void setPairs(const TQMap& list); /** * This operator tests for equality of two MyMoneyKeyValueContainer objects */ bool operator == (const MyMoneyKeyValueContainer &) const; - const QString& operator[] ( const QString& k ) const { return value(k); } + const TQString& operator[] ( const TQString& k ) const { return value(k); } - QString& operator[] ( const QString& k) { return m_kvp[k]; } + TQString& operator[] ( const TQString& k) { return m_kvp[k]; } /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; private: /** * This member variable represents the container of key/value pairs. */ - QMap m_kvp; + TQMap m_kvp; }; #endif diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp b/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp index 6d3d1db..bc1757d 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp @@ -70,7 +70,7 @@ void MyMoneyKeyValueContainerTest::testClear() { } void MyMoneyKeyValueContainerTest::testRetrieveList() { - QMap copy; + TQMap copy; copy = m->pairs(); CPPUNIT_ASSERT(copy.count() == 0); @@ -95,12 +95,12 @@ void MyMoneyKeyValueContainerTest::testWriteXML() { m->setValue("Key", "Value"); m->setValue("key", "value"); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("KVP-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("KVP-CONTAINER"); doc.appendChild(el); m->writeXML(doc, el); - QString ref( + TQString ref( "\n" "\n" " \n" @@ -116,7 +116,7 @@ void MyMoneyKeyValueContainerTest::testReadXML() { m->setValue("Key", "Value"); m->setValue("key", "value"); - QString ref_ok( + TQString ref_ok( "\n" "\n" " \n" @@ -125,7 +125,7 @@ void MyMoneyKeyValueContainerTest::testReadXML() { " \n" "\n"); - QString ref_false( + TQString ref_false( "\n" "\n" " \n" @@ -135,14 +135,14 @@ void MyMoneyKeyValueContainerTest::testReadXML() { "\n"); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); // make sure, an empty node does not trigger an exception try { - MyMoneyKeyValueContainer k(QDomNode()); + MyMoneyKeyValueContainer k(TQDomNode()); } catch(MyMoneyException *e) { CPPUNIT_FAIL("Unexpected exception"); delete e; diff --git a/kmymoney2/mymoney/mymoneymoney.cpp b/kmymoney2/mymoney/mymoneymoney.cpp index 993a872..ccf1d80 100644 --- a/kmymoney2/mymoney/mymoneymoney.cpp +++ b/kmymoney2/mymoney/mymoneymoney.cpp @@ -28,7 +28,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -111,7 +111,7 @@ void MyMoneyMoney::setFileVersion(fileVersionE version) _fileVersion = version; } -MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) +MyMoneyMoney::MyMoneyMoney(const TQString& pszAmount) { m_num = 0; m_denom = 1; @@ -122,15 +122,15 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) // take care of prices given in the form "8 5/16" // and our own internal represenation - QRegExp regExp("^((\\d+)\\s+|-)?(\\d+)/(\\d+)"); + TQRegExp regExp("^((\\d+)\\s+|-)?(\\d+)/(\\d+)"); // +-#2-+ +-#3-+ +-#4-+ // +-----#1-----+ if (regExp.search(pszAmount) > -1) { m_num = regExp.cap(3).toLongLong(); m_denom = regExp.cap(4).toLongLong(); - const QString& part1 = regExp.cap(1); + const TQString& part1 = regExp.cap(1); if(!part1.isEmpty()) { - if(part1 == QString("-")) { + if(part1 == TQString("-")) { m_num = -m_num; } else { @@ -140,16 +140,16 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) return; } - QString res = pszAmount; + TQString res = pszAmount; // get rid of anything that is not // a) numeric // b) _decimalSeparator // c) negative indicator - QString validChars = QString("\\d%1").arg(QChar(decimalSeparator())); + TQString validChars = TQString("\\d%1").tqarg(TQChar(decimalSeparator())); // we need to escape the minus sign here, because later on it will be // part of "\d,-()" and that does not work. It needs to be "\d,\-()" // And we need two of them, because we're in C - QString negChars("\\-"); + TQString negChars("\\-"); if(_negativeMonetarySignPosition == ParensAround) { // Since we want to allow '-' as well as '()' for negative entry // we just add the parens here. @@ -158,13 +158,13 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) validChars += negChars; // qDebug("0: '%s'", validChars.data()); - QRegExp invChars(QString("[^%1]").arg(validChars)); + TQRegExp invChars(TQString("[^%1]").tqarg(validChars)); // qDebug("1: '%s'", res.data()); res.remove(invChars); - QRegExp negCharSet(QString("[%1]").arg(negChars)); + TQRegExp negCharSet(TQString("[%1]").tqarg(negChars)); bool isNegative = false; - if(res.find(negCharSet) != -1) { + if(res.tqfind(negCharSet) != -1) { isNegative = true; res.remove(negCharSet); } @@ -172,7 +172,7 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) int pos; // qDebug("3: '%s'", res.data()); - if((pos = res.find(_decimalSeparator)) != -1) { + if((pos = res.tqfind(_decimalSeparator)) != -1) { // make sure, we get the denominator right m_denom = precToDenom(res.length() - pos - 1); @@ -187,25 +187,25 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) m_num = -m_num; } -QString MyMoneyMoney::formatMoney(int denom, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(int denom, bool showThousandSeparator) const { return formatMoney("", denomToPrec(denom), showThousandSeparator); } -QString MyMoneyMoney::formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator) const { return formatMoney(sec.tradingSymbol(), denomToPrec(acc.fraction()), showThousandSeparator); } -QString MyMoneyMoney::formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator) const { return formatMoney(sec.tradingSymbol(), denomToPrec(sec.smallestAccountFraction()), showThousandSeparator); } -QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(const TQString& currency, const int prec, bool showThousandSeparator) const { - QString res; - QString tmpCurrency = currency; + TQString res; + TQString tmpCurrency = currency; int tmpPrec = prec; signed64 denom = 1; signed64 m_64Value; @@ -240,15 +240,15 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool if(left & 0xFFFFFFFF00000000LL) { signed64 tmp = left; - // QString.sprintf("%Ld") did not work :-(, so I had to + // TQString.sprintf("%Ld") did not work :-(, so I had to // do it the old ugly way. while(tmp) { - res.insert(0, QString("%1").arg(static_cast(tmp % 10))); + res.insert(0, TQString("%1").tqarg(static_cast(tmp % 10))); tmp /= 10; } } else - res = QString("%1").arg((long)left); + res = TQString("%1").tqarg((long)left); if(showThousandSeparator) { int pos = res.length(); @@ -262,13 +262,13 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool // using // - // res += QString("%1").arg(right).rightJustify(prec, '0', true); + // res += TQString("%1").tqarg(right).rightJustify(prec, '0', true); // // caused some weird results if right was rather large. Eg: right being // 666600000 should have appended a 0, but instead it prepended a 0. With // res being "2," the result wasn't "2,6666000000" as expected, but rather // "2,0666600000" which was not usable. The code below works for me. - QString rs = QString("%1").arg(right); + TQString rs = TQString("%1").tqarg(right); if(prec != -1) rs = rs.rightJustify(prec, '0', true); else { @@ -276,14 +276,14 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool // no trailing zeroes or decimal separators while(rs.endsWith("0")) rs.truncate(rs.length()-1); - while(rs.endsWith(QChar(decimalSeparator()))) + while(rs.endsWith(TQChar(decimalSeparator()))) rs.truncate(rs.length()-1); } res += rs; } signPosition signpos = bNegative ? _negativeMonetarySignPosition : _positiveMonetarySignPosition; - QString sign = bNegative ? "-" : ""; + TQString sign = bNegative ? "-" : ""; switch(signpos) { case ParensAround: @@ -316,37 +316,37 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool return res; } -const QString MyMoneyMoney::toString(void) const +const TQString MyMoneyMoney::toString(void) const { signed64 tmp = m_num < 0 ? - m_num : m_num; - QString res; - QString resf; + TQString res; + TQString resf; - // QString.sprintf("%Ld") did not work :-(, so I had to + // TQString.sprintf("%Ld") did not work :-(, so I had to // do it the old ugly way. while(tmp) { - res.prepend(QString("%1").arg(static_cast(tmp % 10))); + res.prepend(TQString("%1").tqarg(static_cast(tmp % 10))); tmp /= 10; } if(res.isEmpty()) - res = QString("0"); + res = TQString("0"); if(m_num < 0) res.prepend('-'); tmp = m_denom; while(tmp) { - resf.prepend(QString("%1").arg(static_cast(tmp % 10))); + resf.prepend(TQString("%1").tqarg(static_cast(tmp % 10))); tmp /= 10; } return res + "/" + resf; } -QDataStream &operator<<(QDataStream &s, const MyMoneyMoney &_money) +TQDataStream &operator<<(TQDataStream &s, const MyMoneyMoney &_money) { // We WILL lose data here if the user has more than 2 billion pounds :-( // QT defined it here as long: - // qglobal.h:typedef long Q_INT64; + // qglobal.h:typedef long TQ_INT64; MyMoneyMoney money = _money.convert(100); @@ -355,7 +355,7 @@ QDataStream &operator<<(QDataStream &s, const MyMoneyMoney &_money) if(money.m_num & 0xffffffff00000000LL) qWarning("Lost data while writing out MyMoneyMoney object using deprecated 4 byte writer"); - s << static_cast (money.m_num & 0xffffffff); + s << static_cast (money.m_num & 0xffffffff); break; default: @@ -363,16 +363,16 @@ QDataStream &operator<<(QDataStream &s, const MyMoneyMoney &_money) // tricky fall through here case MyMoneyMoney::FILE_8_BYTE_VALUE: - s << static_cast (money.m_num >> 32); - s << static_cast (money.m_num & 0xffffffff); + s << static_cast (money.m_num >> 32); + s << static_cast (money.m_num & 0xffffffff); break; } return s; } -QDataStream &operator>>(QDataStream &s, MyMoneyMoney &money) +TQDataStream &operator>>(TQDataStream &s, MyMoneyMoney &money) { - Q_INT32 tmp; + TQ_INT32 tmp; switch(MyMoneyMoney::_fileVersion) { case MyMoneyMoney::FILE_4_BYTE_VALUE: s >> tmp; diff --git a/kmymoney2/mymoney/mymoneymoney.h b/kmymoney2/mymoney/mymoneymoney.h index 74235c7..6ff1cae 100644 --- a/kmymoney2/mymoney/mymoneymoney.h +++ b/kmymoney2/mymoney/mymoneymoney.h @@ -39,8 +39,8 @@ #endif // So we can save this object -#include -#include +#include +#include #include #include @@ -98,7 +98,7 @@ public: // construction MyMoneyMoney(); MyMoneyMoney( const int iAmount, const signed64 denom = 100 ); - MyMoneyMoney( const QString& pszAmount ); + MyMoneyMoney( const TQString& pszAmount ); MyMoneyMoney( const signed64 Amount, const signed64 denom = 100 ); MyMoneyMoney( const double dAmount, const signed64 denom = 100 ); #if HAVE_LONG_DOUBLE @@ -123,20 +123,20 @@ public: * @param showThousandSeparator should the thousandSeparator symbol be inserted * (@a true) or not (@a false) (default true) */ - QString formatMoney(const QString& currency, const int prec, bool showThousandSeparator = true) const; + TQString formatMoney(const TQString& currency, const int prec, bool showThousandSeparator = true) const; /** * This is a convenience method. It behaves exactly as the above one, but takes the information * about currency symbol and precision out of the MyMoneySecurity and MyMoneyAccount objects * @a acc and @a sec. */ - QString formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator = true) const; + TQString formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator = true) const; /** * This is a convenience method. It behaves exactly as the above one, but takes the information * about currency symbol and precision out of the MyMoneySecurity object @a sec. */ - QString formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator = true) const; + TQString formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator = true) const; /** * This is a convenience method. It behaves exactly as the above one, but takes the information @@ -146,7 +146,7 @@ public: * * @note denom is often set to account.fraction(security). */ - QString formatMoney(int denom, bool showThousandSeparator = true) const; + TQString formatMoney(int denom, bool showThousandSeparator = true) const; /** * This method is used to convert the smallest fraction information into @@ -157,7 +157,7 @@ public: */ static int denomToPrec(signed64 fract); - const QString toString(void) const; + const TQString toString(void) const; const MyMoneyMoney convert(const signed64 denom = 100, const roundingMethod how = RndRound) const; static signed64 precToDenom(int prec); double toDouble(void) const; @@ -177,7 +177,7 @@ public: // assignment const MyMoneyMoney& operator=( const MyMoneyMoney& Amount ); - const MyMoneyMoney& operator=( const QString& pszAmount ); + const MyMoneyMoney& operator=( const TQString& pszAmount ); // comparison bool operator==( const MyMoneyMoney& Amount ) const; @@ -187,12 +187,12 @@ public: bool operator<=( const MyMoneyMoney& Amount ) const; bool operator>=( const MyMoneyMoney& Amount ) const; - bool operator==( const QString& pszAmount ) const; - bool operator!=( const QString& pszAmount ) const; - bool operator<( const QString& pszAmount ) const; - bool operator>( const QString& pszAmount ) const; - bool operator<=( const QString& pszAmount ) const; - bool operator>=( const QString& pszAmount ) const; + bool operator==( const TQString& pszAmount ) const; + bool operator!=( const TQString& pszAmount ) const; + bool operator<( const TQString& pszAmount ) const; + bool operator>( const TQString& pszAmount ) const; + bool operator<=( const TQString& pszAmount ) const; + bool operator>=( const TQString& pszAmount ) const; // calculation MyMoneyMoney operator+( const MyMoneyMoney& Amount ) const; @@ -230,8 +230,8 @@ private: signed64 getLcd(const MyMoneyMoney& b) const; - KMYMONEY_EXPORT friend QDataStream &operator<<(QDataStream &, const MyMoneyMoney &); - KMYMONEY_EXPORT friend QDataStream &operator>>(QDataStream &, MyMoneyMoney &); + KMYMONEY_EXPORT friend TQDataStream &operator<<(TQDataStream &, const MyMoneyMoney &); + KMYMONEY_EXPORT friend TQDataStream &operator>>(TQDataStream &, MyMoneyMoney &); static unsigned char _thousandSeparator; static unsigned char _decimalSeparator; @@ -371,7 +371,7 @@ inline const MyMoneyMoney& MyMoneyMoney::operator=(const MyMoneyMoney& Amount) // Arguments: pszAmount - NULL terminated string that contains amount // //////////////////////////////////////////////////////////////////////////////// -inline const MyMoneyMoney& MyMoneyMoney::operator=(const QString& pszAmount) +inline const MyMoneyMoney& MyMoneyMoney::operator=(const TQString& pszAmount) { *this = MyMoneyMoney( pszAmount ); return *this; @@ -508,7 +508,7 @@ inline bool MyMoneyMoney::operator>=(const MyMoneyMoney& Amount) const // Arguments: pszAmount - NULL terminated string that contains amount // //////////////////////////////////////////////////////////////////////////////// -inline bool MyMoneyMoney::operator==(const QString& pszAmount) const +inline bool MyMoneyMoney::operator==(const TQString& pszAmount) const { MyMoneyMoney Amount( pszAmount ); return ( *this == Amount ) ; @@ -523,7 +523,7 @@ inline bool MyMoneyMoney::operator==(const QString& pszAmount) const // Arguments: pszAmount - NULL terminated string that contains amount // //////////////////////////////////////////////////////////////////////////////// -inline bool MyMoneyMoney::operator!=(const QString& pszAmount) const +inline bool MyMoneyMoney::operator!=(const TQString& pszAmount) const { MyMoneyMoney Amount( pszAmount ); return ( *this != Amount ) ; diff --git a/kmymoney2/mymoney/mymoneymoneytest.cpp b/kmymoney2/mymoney/mymoneymoneytest.cpp index 64c2961..81967a1 100644 --- a/kmymoney2/mymoney/mymoneymoneytest.cpp +++ b/kmymoney2/mymoney/mymoneymoneytest.cpp @@ -97,15 +97,15 @@ void MyMoneyMoneyTest::testAssignment() CPPUNIT_ASSERT(m->m_num == -5678); CPPUNIT_ASSERT(m->m_denom == 100); - *m = QString("-987"); + *m = TQString("-987"); CPPUNIT_ASSERT(m->m_num == -987); CPPUNIT_ASSERT(m->m_denom == 1); - *m = QString("9998887776665554.44"); + *m = TQString("9998887776665554.44"); CPPUNIT_ASSERT(m->m_num == 999888777666555444LL); CPPUNIT_ASSERT(m->m_denom == 100); - *m = QString("-99988877766655.444"); + *m = TQString("-99988877766655.444"); CPPUNIT_ASSERT(m->m_num == -99988877766655444LL); CPPUNIT_ASSERT(m->m_denom == 1000); @@ -179,22 +179,22 @@ void MyMoneyMoneyTest::testConvert() MyMoneyMoney b = a.convert(100); CPPUNIT_ASSERT(b.m_num == 12346); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("-123.456"); + a = TQString("-123.456"); b = a.convert(100); CPPUNIT_ASSERT(b.m_num == -12346); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("123.1"); + a = TQString("123.1"); b = a.convert(100); CPPUNIT_ASSERT(b.m_num == 12310); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("-73010.28"); - b = QString("1.95583"); - CPPUNIT_ASSERT((a * b).convert(100) == QString("-142795.70")); + a = TQString("-73010.28"); + b = TQString("1.95583"); + CPPUNIT_ASSERT((a * b).convert(100) == TQString("-142795.70")); - a = QString("-142795.69"); - CPPUNIT_ASSERT((a / b).convert(100) == QString("-73010.28")); + a = TQString("-142795.69"); + CPPUNIT_ASSERT((a / b).convert(100) == TQString("-73010.28")); } void MyMoneyMoneyTest::testEquality() @@ -216,7 +216,7 @@ void MyMoneyMoneyTest::testEquality() CPPUNIT_ASSERT(m5 == m6); CPPUNIT_ASSERT(m5 == m7); - CPPUNIT_ASSERT(m5 == QString("369/30")); + CPPUNIT_ASSERT(m5 == TQString("369/30")); CPPUNIT_ASSERT(MyMoneyMoney::autoCalc == MyMoneyMoney::autoCalc); } @@ -234,7 +234,7 @@ void MyMoneyMoneyTest::testInequality() MyMoneyMoney m4(LLCONST(999666555444)); CPPUNIT_ASSERT(m3 != m4); - CPPUNIT_ASSERT(m4 != QString("999666555444")); + CPPUNIT_ASSERT(m4 != TQString("999666555444")); CPPUNIT_ASSERT(MyMoneyMoney::autoCalc != MyMoneyMoney(1,100)); CPPUNIT_ASSERT(MyMoneyMoney(1,100) != MyMoneyMoney::autoCalc); @@ -258,9 +258,9 @@ void MyMoneyMoneyTest::testAddition() // CPPUNIT_ASSERT(m1 == MyMoneyMoney(101)); // CPPUNIT_ASSERT((++m1) == MyMoneyMoney(102)); - m1 = QString("123.20"); + m1 = TQString("123.20"); MyMoneyMoney m2(40, 1000); - CPPUNIT_ASSERT((m1 + m2) == QString("123.24")); + CPPUNIT_ASSERT((m1 + m2) == TQString("123.24")); m1 += m2; CPPUNIT_ASSERT(m1.m_num == 123240); @@ -284,7 +284,7 @@ void MyMoneyMoneyTest::testSubtraction() // CPPUNIT_ASSERT(m1 == MyMoneyMoney(99)); // CPPUNIT_ASSERT((--m1) == MyMoneyMoney(98)); - m1 = QString("123.20"); + m1 = TQString("123.20"); MyMoneyMoney m2(1, 5); CPPUNIT_ASSERT((m1 - m2) == MyMoneyMoney(123,1)); @@ -301,9 +301,9 @@ void MyMoneyMoneyTest::testMultiplication() CPPUNIT_ASSERT((m1 * MyMoneyMoney(10000000,1)) == MyMoneyMoney(1000000000,1)); CPPUNIT_ASSERT((m1 * (*m_0)) == MyMoneyMoney(1200)); - MyMoneyMoney m2 = QString("-73010.28"); - m1 = QString("1.95583"); - CPPUNIT_ASSERT((m1 * m2) == QString("-142795.6959324")); + MyMoneyMoney m2 = TQString("-73010.28"); + m1 = TQString("1.95583"); + CPPUNIT_ASSERT((m1 * m2) == TQString("-142795.6959324")); } void MyMoneyMoneyTest::testDivision() @@ -311,9 +311,9 @@ void MyMoneyMoneyTest::testDivision() MyMoneyMoney m1(100); CPPUNIT_ASSERT((m1 / MyMoneyMoney(50)) == MyMoneyMoney(2,1)); - MyMoneyMoney m2 = QString("-142795.69"); - m1 = QString("1.95583"); - CPPUNIT_ASSERT((m2 / m1).convert(100000000) == QString("-73010.27696681")); + MyMoneyMoney m2 = TQString("-142795.69"); + m1 = TQString("1.95583"); + CPPUNIT_ASSERT((m2 / m1).convert(100000000) == TQString("-73010.27696681")); MyMoneyMoney m3 = MyMoneyMoney(0) / MyMoneyMoney(100); CPPUNIT_ASSERT(m3.m_num == 0); @@ -325,12 +325,12 @@ void MyMoneyMoneyTest::testSetDecimalSeparator() MyMoneyMoney m1(100000); MyMoneyMoney m2(200000); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); CPPUNIT_ASSERT(MyMoneyMoney::decimalSeparator() == '.'); MyMoneyMoney::setDecimalSeparator(':'); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000:00")); - CPPUNIT_ASSERT(m2.formatMoney("", 2) == QString("2,000:00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000:00")); + CPPUNIT_ASSERT(m2.formatMoney("", 2) == TQString("2,000:00")); CPPUNIT_ASSERT(MyMoneyMoney::decimalSeparator() == ':'); } @@ -340,57 +340,57 @@ void MyMoneyMoneyTest::testSetThousandSeparator() MyMoneyMoney m1(100000); MyMoneyMoney m2(200000); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); CPPUNIT_ASSERT(MyMoneyMoney::thousandSeparator() == ','); MyMoneyMoney::setThousandSeparator(':'); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1:000.00")); - CPPUNIT_ASSERT(m2.formatMoney("", 2) == QString("2:000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1:000.00")); + CPPUNIT_ASSERT(m2.formatMoney("", 2) == TQString("2:000.00")); CPPUNIT_ASSERT(MyMoneyMoney::thousandSeparator() == ':'); } void MyMoneyMoneyTest::testFormatMoney() { - CPPUNIT_ASSERT(m_0->formatMoney("", 2) == QString("0.12")); - CPPUNIT_ASSERT(m_1->formatMoney("", 2) == QString("-0.10")); + CPPUNIT_ASSERT(m_0->formatMoney("", 2) == TQString("0.12")); + CPPUNIT_ASSERT(m_1->formatMoney("", 2) == TQString("-0.10")); MyMoneyMoney m1(10099); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("100.99")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("100.99")); m1 = MyMoneyMoney(100,1); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("100.00")); - CPPUNIT_ASSERT(m1.formatMoney("", -1) == QString("100")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("100.00")); + CPPUNIT_ASSERT(m1.formatMoney("", -1) == TQString("100")); m1 = m1 * 10; - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); - CPPUNIT_ASSERT(m1.formatMoney("", -1) == QString("1,000")); - CPPUNIT_ASSERT(m1.formatMoney("", -1, false) == QString("1000")); - CPPUNIT_ASSERT(m1.formatMoney("", 3, false) == QString("1000.000")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", -1) == TQString("1,000")); + CPPUNIT_ASSERT(m1.formatMoney("", -1, false) == TQString("1000")); + CPPUNIT_ASSERT(m1.formatMoney("", 3, false) == TQString("1000.000")); m1 = MyMoneyMoney(INT64_MAX, 100); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("92,233,720,368,547,758.07")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("92,233,720,368,547,758.07")); - CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == QString("92233720368547758.07")); - CPPUNIT_ASSERT(m1.formatMoney(100, false) == QString("92233720368547758.07")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("92,233,720,368,547,758.07")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("92,233,720,368,547,758.07")); + CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == TQString("92233720368547758.07")); + CPPUNIT_ASSERT(m1.formatMoney(100, false) == TQString("92233720368547758.07")); m1 = MyMoneyMoney(INT64_MIN, 100); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("-92,233,720,368,547,758.08")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("-92,233,720,368,547,758.08")); - CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == QString("-92233720368547758.08")); - CPPUNIT_ASSERT(m1.formatMoney(100, false) == QString("-92233720368547758.08")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("-92,233,720,368,547,758.08")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("-92,233,720,368,547,758.08")); + CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == TQString("-92233720368547758.08")); + CPPUNIT_ASSERT(m1.formatMoney(100, false) == TQString("-92233720368547758.08")); m1 = MyMoneyMoney(1,5); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("0.20")); - CPPUNIT_ASSERT(m1.formatMoney(1000) == QString("0.200")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("0.20")); - CPPUNIT_ASSERT(m1.formatMoney(10) == QString("0.2")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("0.20")); + CPPUNIT_ASSERT(m1.formatMoney(1000) == TQString("0.200")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("0.20")); + CPPUNIT_ASSERT(m1.formatMoney(10) == TQString("0.2")); m1 = MyMoneyMoney(13333,5000); - CPPUNIT_ASSERT(m1.formatMoney("", 10) == QString("2.6666000000")); + CPPUNIT_ASSERT(m1.formatMoney("", 10) == TQString("2.6666000000")); m1 = MyMoneyMoney(-1404,100); - CPPUNIT_ASSERT(m1.formatMoney("",-1) == QString("-14.04")); + CPPUNIT_ASSERT(m1.formatMoney("",-1) == TQString("-14.04")); } void MyMoneyMoneyTest::testRelation() @@ -409,17 +409,17 @@ void MyMoneyMoneyTest::testRelation() CPPUNIT_ASSERT(m3 >= m3); // tests with different denominator - m1 = QString("1/8"); - m2 = QString("1/7"); + m1 = TQString("1/8"); + m2 = TQString("1/7"); CPPUNIT_ASSERT(m1 < m2); CPPUNIT_ASSERT(m2 > m1); - m2 = QString("-1/7"); + m2 = TQString("-1/7"); CPPUNIT_ASSERT(m2 < m1); CPPUNIT_ASSERT(m1 > m2); CPPUNIT_ASSERT(m1 >= m2); CPPUNIT_ASSERT(m2 <= m1); - m1 = QString("-2/14"); + m1 = TQString("-2/14"); CPPUNIT_ASSERT(m1 >= m2); CPPUNIT_ASSERT(m1 <= m2); @@ -462,9 +462,9 @@ void MyMoneyMoneyTest::testToString() MyMoneyMoney m2(1234); MyMoneyMoney m3; - CPPUNIT_ASSERT(m1.toString() == QString("-100/100")); - CPPUNIT_ASSERT(m2.toString() == QString("1234/100")); - CPPUNIT_ASSERT(m3.toString() == QString("0/1")); + CPPUNIT_ASSERT(m1.toString() == TQString("-100/100")); + CPPUNIT_ASSERT(m2.toString() == TQString("1234/100")); + CPPUNIT_ASSERT(m3.toString() == TQString("0/1")); } void MyMoneyMoneyTest::testNegativeSignPos(void) diff --git a/kmymoney2/mymoney/mymoneyobject.cpp b/kmymoney2/mymoney/mymoneyobject.cpp index 7939ff0..a415a7c 100644 --- a/kmymoney2/mymoney/mymoneyobject.cpp +++ b/kmymoney2/mymoney/mymoneyobject.cpp @@ -24,16 +24,16 @@ #include "mymoneyutils.h" #include "mymoneyexception.h" -const QString MyMoneyObject::m_emptyId; +const TQString MyMoneyObject::m_emptyId; -MyMoneyObject::MyMoneyObject(const QString& id) +MyMoneyObject::MyMoneyObject(const TQString& id) { m_id = id; } -MyMoneyObject::MyMoneyObject(const QDomElement& el, const bool forceId) +MyMoneyObject::MyMoneyObject(const TQDomElement& el, const bool forceId) { - m_id = QStringEmpty(el.attribute("id")); + m_id = TQStringEmpty(el.attribute("id")); if(m_id.length() == 0 && forceId) throw new MYMONEYEXCEPTION("Node has no ID"); } @@ -46,7 +46,7 @@ MyMoneyObject::~MyMoneyObject() { } -void MyMoneyObject::setId(const QString& id) +void MyMoneyObject::setId(const TQString& id) { m_id = id; } @@ -58,15 +58,15 @@ bool MyMoneyObject::operator == (const MyMoneyObject& right) const void MyMoneyObject::clearId(void) { - m_id = QString(); + m_id = TQString(); } -const QString& MyMoneyObject::emptyId(void) +const TQString& MyMoneyObject::emptyId(void) { return m_emptyId; } -void MyMoneyObject::writeBaseXML(QDomDocument& document, QDomElement& el) const +void MyMoneyObject::writeBaseXML(TQDomDocument& document, TQDomElement& el) const { Q_UNUSED(document); diff --git a/kmymoney2/mymoney/mymoneyobject.h b/kmymoney2/mymoney/mymoneyobject.h index d07296b..854bf4d 100644 --- a/kmymoney2/mymoney/mymoneyobject.h +++ b/kmymoney2/mymoney/mymoneyobject.h @@ -24,9 +24,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -58,7 +58,7 @@ public: * * @return ID of object */ - const QString& id(void) const { return m_id; }; + const TQString& id(void) const { return m_id; }; /** * This method clears the id of the object @@ -74,20 +74,20 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const = 0; + virtual bool hasReferenceTo(const TQString& id) const = 0; /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - virtual void writeXML(QDomDocument& document, QDomElement& parent) const = 0; + virtual void writeXML(TQDomDocument& document, TQDomElement& tqparent) const = 0; bool operator == (const MyMoneyObject& right) const; - static const QString& emptyId(void); + static const TQString& emptyId(void); protected: /** @@ -95,13 +95,13 @@ protected: * * @param id ID of object */ - MyMoneyObject(const QString& id); + MyMoneyObject(const TQString& id); /** * This contructor reads the id from the @p id attribute of the - * QDomElement. + * TQDomElement. * - * @param node const reference to the QDomElement from which to + * @param node const reference to the TQDomElement from which to * obtain the id of the object * @param forceId flag to be able to suppress enforcement of an id * defaults to true which requires the node to have an @@ -111,18 +111,18 @@ protected: * used by objects, which are stored w/o id (eg. splits, * transactions within schedules) */ - MyMoneyObject(const QDomElement& node, const bool forceId = true); + MyMoneyObject(const TQDomElement& node, const bool forceId = true); - void setId(const QString& id) /* __attribute__ ((deprecated)) */; + void setId(const TQString& id) /* __attribute__ ((deprecated)) */; /** * This method writes out the members contained in this object. */ - void writeBaseXML(QDomDocument& document, QDomElement& el) const; + void writeBaseXML(TQDomDocument& document, TQDomElement& el) const; protected: - QString m_id; - static const QString m_emptyId; + TQString m_id; + static const TQString m_emptyId; }; #endif diff --git a/kmymoney2/mymoney/mymoneyobjectcontainer.cpp b/kmymoney2/mymoney/mymoneyobjectcontainer.cpp index 666da3b..c842f0d 100644 --- a/kmymoney2/mymoney/mymoneyobjectcontainer.cpp +++ b/kmymoney2/mymoney/mymoneyobjectcontainer.cpp @@ -34,7 +34,7 @@ MyMoneyObjectContainer::~MyMoneyObjectContainer() void MyMoneyObjectContainer::clear(IMyMoneyStorage* storage) { // delete all objects - QMap::const_iterator it; + TQMap::const_iterator it; for(it = m_map.begin(); it != m_map.end(); ++it) { delete (*it); } @@ -46,10 +46,10 @@ void MyMoneyObjectContainer::clear(IMyMoneyStorage* storage) m_storage = storage; } -void MyMoneyObjectContainer::clear(const QString& id) +void MyMoneyObjectContainer::clear(const TQString& id) { - QMap::iterator it; - it = m_map.find(id); + TQMap::iterator it; + it = m_map.tqfind(id); if(it != m_map.end()) { delete (*it); m_map.erase(it); @@ -57,9 +57,9 @@ void MyMoneyObjectContainer::clear(const QString& id) } #define listMethod(a, T) \ -void MyMoneyObjectContainer::a(QValueList& list) \ +void MyMoneyObjectContainer::a(TQValueList& list) \ { \ - QMap::const_iterator it; \ + TQMap::const_iterator it; \ for(it = m_map.begin(); it != m_map.end(); ++it) { \ const T* node = dynamic_cast(*it); \ if(node) { \ @@ -69,9 +69,9 @@ void MyMoneyObjectContainer::a(QValueList& list) \ } #define preloadListMethod(a, T) \ -void MyMoneyObjectContainer::preload##a(const QValueList& list) \ +void MyMoneyObjectContainer::preload##a(const TQValueList& list) \ { \ - QValueList::const_iterator it; \ + TQValueList::const_iterator it; \ for(it = list.begin(); it != list.end(); ++it) { \ delete m_map[(*it).id()]; \ m_map[(*it).id()] = new T(*it); \ @@ -86,13 +86,13 @@ void MyMoneyObjectContainer::preload##a(const T& obj) \ } #define objectAccessMethod(a, T) \ -const T& MyMoneyObjectContainer::a(const QString& id) \ +const T& MyMoneyObjectContainer::a(const TQString& id) \ { \ static T nullElement; \ if(id.isEmpty()) \ return nullElement; \ - QMap::const_iterator it; \ - it = m_map.find(id); \ + TQMap::const_iterator it; \ + it = m_map.tqfind(id); \ if(it == m_map.end()) { \ /* not found, need to load from engine */ \ T x = m_storage->a(id); \ @@ -102,9 +102,9 @@ const T& MyMoneyObjectContainer::a(const QString& id) \ return dynamic_cast(*(*it)); \ } -void MyMoneyObjectContainer::account(QValueList& list) +void MyMoneyObjectContainer::account(TQValueList& list) { - QMap::const_iterator it; + TQMap::const_iterator it; for(it = m_map.begin(); it != m_map.end(); ++it) { const MyMoneyAccount* node = dynamic_cast(*it); if(node) { @@ -114,13 +114,13 @@ void MyMoneyObjectContainer::account(QValueList& list) } } -const MyMoneyAccount& MyMoneyObjectContainer::account(const QString& id) +const MyMoneyAccount& MyMoneyObjectContainer::account(const TQString& id) { static MyMoneyAccount nullElement; if(id.isEmpty()) return nullElement; - QMap::iterator it; - it = m_map.find(id); + TQMap::iterator it; + it = m_map.tqfind(id); if(it == m_map.end()) { /* not found, need to load from engine */ MyMoneyAccount x = m_storage->account(id); @@ -141,10 +141,10 @@ void MyMoneyObjectContainer::assignFraction(MyMoneyAccount* acc) } } -const MyMoneyAccount& MyMoneyObjectContainer::accountByName(const QString& name) const +const MyMoneyAccount& MyMoneyObjectContainer::accountByName(const TQString& name) const { static MyMoneyAccount nullElement; - QMap::const_iterator it; + TQMap::const_iterator it; for(it = m_map.begin(); it != m_map.end(); ++it) { const MyMoneyAccount* node = dynamic_cast(*it); if(node) { @@ -155,13 +155,13 @@ const MyMoneyAccount& MyMoneyObjectContainer::accountByName(const QString& name) return nullElement; } -void MyMoneyObjectContainer::refresh(const QString& id) +void MyMoneyObjectContainer::refresh(const TQString& id) { if(id.isEmpty()) return; - QMap::const_iterator it; - it = m_map.find(id); + TQMap::const_iterator it; + it = m_map.tqfind(id); if(it != m_map.end()) { const MyMoneyAccount* account = dynamic_cast(*it); const MyMoneyPayee* payee = dynamic_cast(*it); diff --git a/kmymoney2/mymoney/mymoneyobjectcontainer.h b/kmymoney2/mymoney/mymoneyobjectcontainer.h index 1f3b598..715154c 100644 --- a/kmymoney2/mymoney/mymoneyobjectcontainer.h +++ b/kmymoney2/mymoney/mymoneyobjectcontainer.h @@ -24,8 +24,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -46,51 +46,52 @@ /** * This class represents a generic container for all MyMoneyObject derived objects. */ -class KMYMONEY_EXPORT MyMoneyObjectContainer : public QObject +class KMYMONEY_EXPORT MyMoneyObjectContainer : public TQObject { Q_OBJECT + TQ_OBJECT public: MyMoneyObjectContainer(); ~MyMoneyObjectContainer(); - const MyMoneyAccount& account(const QString& id); - const MyMoneyPayee& payee(const QString& id); - const MyMoneySecurity& security(const QString& id); - const MyMoneyInstitution& institution(const QString& id); - const MyMoneySchedule& schedule(const QString& id); + const MyMoneyAccount& account(const TQString& id); + const MyMoneyPayee& payee(const TQString& id); + const MyMoneySecurity& security(const TQString& id); + const MyMoneyInstitution& institution(const TQString& id); + const MyMoneySchedule& schedule(const TQString& id); - void account(QValueList& list); - void payee(QValueList& list); - void institution(QValueList& list); + void account(TQValueList& list); + void payee(TQValueList& list); + void institution(TQValueList& list); - void preloadAccount(const QValueList& list); - void preloadPayee(const QValueList& list); - void preloadInstitution(const QValueList& list); - void preloadSecurity(const QValueList& list); - void preloadSchedule(const QValueList& list); + void preloadAccount(const TQValueList& list); + void preloadPayee(const TQValueList& list); + void preloadInstitution(const TQValueList& list); + void preloadSecurity(const TQValueList& list); + void preloadSchedule(const TQValueList& list); void preloadAccount(const MyMoneyAccount& account); void preloadSecurity(const MyMoneySecurity& security); void preloadPayee(const MyMoneyPayee& payee); void preloadInstitution(const MyMoneyInstitution& institution); - void clear(const QString& id); + void clear(const TQString& id); void clear(IMyMoneyStorage* storage = 0); - const MyMoneyAccount& accountByName(const QString& name) const; + const MyMoneyAccount& accountByName(const TQString& name) const; /** * This method refreshes an already existing object in the container * with a copy from the engine. The object is identified by its @a id. * If the object is unknown or the @a id is empty, nothing is done. */ - void refresh(const QString& id); + void refresh(const TQString& id); private: void assignFraction(MyMoneyAccount* acc); private: - QMap m_map; + TQMap m_map; IMyMoneyStorage* m_storage; }; diff --git a/kmymoney2/mymoney/mymoneyobjecttest.cpp b/kmymoney2/mymoney/mymoneyobjecttest.cpp index f7201a9..b69d63a 100644 --- a/kmymoney2/mymoney/mymoneyobjecttest.cpp +++ b/kmymoney2/mymoney/mymoneyobjecttest.cpp @@ -34,14 +34,14 @@ void MyMoneyObjectTest::testEmptyConstructor() { } void MyMoneyObjectTest::testConstructor() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); CPPUNIT_ASSERT(!a.id().isEmpty()); - CPPUNIT_ASSERT(a.id() == QString("thb")); + CPPUNIT_ASSERT(a.id() == TQString("thb")); } void MyMoneyObjectTest::testClearId() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); CPPUNIT_ASSERT(!a.id().isEmpty()); a.clearId(); @@ -49,23 +49,23 @@ void MyMoneyObjectTest::testClearId() { } void MyMoneyObjectTest::testCopyConstructor() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); MyMoneyAccount b(a); CPPUNIT_ASSERT(a.MyMoneyObject::operator==(b)); } void MyMoneyObjectTest::testAssignmentConstructor() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); MyMoneyAccount b = a; CPPUNIT_ASSERT(a.MyMoneyObject::operator==(b)); } void MyMoneyObjectTest::testEquality() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); - MyMoneyAccount b(QString("thb"), MyMoneyAccount()); - MyMoneyAccount c(QString("ace"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); + MyMoneyAccount b(TQString("thb"), MyMoneyAccount()); + MyMoneyAccount c(TQString("ace"), MyMoneyAccount()); CPPUNIT_ASSERT(a.MyMoneyObject::operator==(b)); CPPUNIT_ASSERT(!(a.MyMoneyObject::operator==(c))); diff --git a/kmymoney2/mymoney/mymoneyobserver.h b/kmymoney2/mymoney/mymoneyobserver.h index 3e6c922..3ec05d0 100644 --- a/kmymoney2/mymoney/mymoneyobserver.h +++ b/kmymoney2/mymoney/mymoneyobserver.h @@ -35,7 +35,7 @@ #include class MyMoneySubject; -class QString; +class TQString; /** * This is the base class to be used to construct an @@ -46,7 +46,7 @@ class QString; class KMYMONEY_EXPORT MyMoneyObserver { public: virtual ~MyMoneyObserver(); - virtual void update(const QString& id) = 0; + virtual void update(const TQString& id) = 0; protected: MyMoneyObserver(); diff --git a/kmymoney2/mymoney/mymoneyobservertest.h b/kmymoney2/mymoney/mymoneyobservertest.h index a806882..51ca900 100644 --- a/kmymoney2/mymoney/mymoneyobservertest.h +++ b/kmymoney2/mymoney/mymoneyobservertest.h @@ -23,11 +23,11 @@ class TestObserver : public MyMoneyObserver { public: TestObserver() { m_updated = ""; } - void update(const QString& id) { m_updated = id; }; - const QString& updated(void) { return m_updated; }; + void update(const TQString& id) { m_updated = id; }; + const TQString& updated(void) { return m_updated; }; void reset(void) { m_updated = ""; }; private: - QString m_updated; + TQString m_updated; }; class TestSubject : public MyMoneySubject diff --git a/kmymoney2/mymoney/mymoneypayee.cpp b/kmymoney2/mymoney/mymoneypayee.cpp index cbfbbb7..7023e51 100644 --- a/kmymoney2/mymoney/mymoneypayee.cpp +++ b/kmymoney2/mymoney/mymoneypayee.cpp @@ -19,7 +19,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -37,7 +37,7 @@ MyMoneyPayee::MyMoneyPayee() : { } -MyMoneyPayee::MyMoneyPayee(const QString& id, const MyMoneyPayee& payee) : +MyMoneyPayee::MyMoneyPayee(const TQString& id, const MyMoneyPayee& payee) : m_matchingEnabled(false), m_usingMatchKey(false), m_matchKeyIgnoreCase(true) @@ -46,9 +46,9 @@ MyMoneyPayee::MyMoneyPayee(const QString& id, const MyMoneyPayee& payee) : m_id = id; } -MyMoneyPayee::MyMoneyPayee(const QString& name, const QString& address, - const QString& city, const QString& state, const QString& postcode, - const QString& telephone, const QString& email) : +MyMoneyPayee::MyMoneyPayee(const TQString& name, const TQString& address, + const TQString& city, const TQString& state, const TQString& postcode, + const TQString& telephone, const TQString& email) : m_matchingEnabled(false), m_usingMatchKey(false), m_matchKeyIgnoreCase(true) @@ -62,7 +62,7 @@ MyMoneyPayee::MyMoneyPayee(const QString& name, const QString& address, m_email = email; } -MyMoneyPayee::MyMoneyPayee(const QDomElement& node) : +MyMoneyPayee::MyMoneyPayee(const TQDomElement& node) : MyMoneyObject(node) { if ("PAYEE" != node.tagName()) { @@ -89,13 +89,13 @@ MyMoneyPayee::MyMoneyPayee(const QDomElement& node) : m_defaultAccountId = node.attribute("defaultaccountid"); } - QDomNodeList nodeList = node.elementsByTagName("ADDRESS"); + TQDomNodeList nodeList = node.elementsByTagName("ADDRESS"); if(nodeList.count() == 0) { - QString msg = QString("No ADDRESS in payee %1").arg(m_name); + TQString msg = TQString("No ADDRESS in payee %1").tqarg(m_name); throw new MYMONEYEXCEPTION(msg); } - QDomElement addrNode = nodeList.item(0).toElement(); + TQDomElement addrNode = nodeList.item(0).toElement(); m_address = addrNode.attribute("street"); m_city = addrNode.attribute("city"); m_postcode = addrNode.attribute("postcode"); @@ -131,9 +131,9 @@ bool MyMoneyPayee::operator == (const MyMoneyPayee& right) const ((m_defaultAccountId.length() == 0 && right.m_defaultAccountId.length() == 0) || m_defaultAccountId == right.m_defaultAccountId) ); } -void MyMoneyPayee::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyPayee::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("PAYEE"); + TQDomElement el = document.createElement("PAYEE"); writeBaseXML(document, el); @@ -155,7 +155,7 @@ void MyMoneyPayee::writeXML(QDomDocument& document, QDomElement& parent) const el.setAttribute("defaultaccountid", m_defaultAccountId); } - QDomElement address = document.createElement("ADDRESS"); + TQDomElement address = document.createElement("ADDRESS"); address.setAttribute("street", m_address); address.setAttribute("city", m_city); address.setAttribute("postcode", m_postcode); @@ -164,16 +164,16 @@ void MyMoneyPayee::writeXML(QDomDocument& document, QDomElement& parent) const el.appendChild(address); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyPayee::hasReferenceTo(const QString& id) const +bool MyMoneyPayee::hasReferenceTo(const TQString& id) const { return id == m_defaultAccountId; } -MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, QStringList& keys) const +MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, TQStringList& keys) const { payeeMatchType type = matchDisabled; keys.clear(); @@ -183,25 +183,25 @@ MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, QStringLi { type = m_usingMatchKey ? matchKey : matchName; if(type == matchKey) - keys = QStringList::split(";", m_matchKey); + keys = TQStringList::split(";", m_matchKey); } return type; } -MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, QString& keyString) const +MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, TQString& keyString) const { - QStringList keys; + TQStringList keys; payeeMatchType type = matchData(ignorecase, keys); keyString = keys.join(";"); return type; } -void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QStringList& keys) +void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const TQStringList& keys) { m_matchingEnabled = (type != matchDisabled); m_matchKeyIgnoreCase = ignorecase; - m_matchKey = QString(); + m_matchKey = TQString(); if ( m_matchingEnabled ) { @@ -212,9 +212,9 @@ void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QStr } } -void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QString& keys) +void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const TQString& keys) { - setMatchData(type, ignorecase, QStringList::split(";", keys)); + setMatchData(type, ignorecase, TQStringList::split(";", keys)); } // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/mymoney/mymoneypayee.h b/kmymoney2/mymoney/mymoneypayee.h index c2c711b..b1d2fce 100644 --- a/kmymoney2/mymoney/mymoneypayee.h +++ b/kmymoney2/mymoney/mymoneypayee.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QStringList; +#include +class TQStringList; // ---------------------------------------------------------------------------- // Project Includes @@ -46,14 +46,14 @@ class KMYMONEY_EXPORT MyMoneyPayee : public MyMoneyObject { private: // Simple fields - QString m_name; - QString m_address; - QString m_city; - QString m_state; - QString m_postcode; - QString m_telephone; - QString m_email; - QString m_notes; + TQString m_name; + TQString m_address; + TQString m_city; + TQString m_state; + TQString m_postcode; + TQString m_telephone; + TQString m_email; + TQString m_notes; // Transaction matching fields bool m_matchingEnabled; //< Whether this payee should be matched at all @@ -64,10 +64,10 @@ private: * Semicolon separated list of matching keys used when trying to find a suitable * payee for imported transactions. */ - QString m_matchKey; + TQString m_matchKey; // Category (account) matching fields - QString m_defaultAccountId; + TQString m_defaultAccountId; /** * This member keeps a reference to an external database @@ -78,7 +78,7 @@ private: * If no external database is available it should be kept * empty by the application. */ - QString m_reference; + TQString m_reference; public: typedef enum { @@ -88,48 +88,48 @@ public: } payeeMatchType; MyMoneyPayee(); - MyMoneyPayee(const QString& id, const MyMoneyPayee& payee); - MyMoneyPayee(const QString& name, - const QString& address=QString::null, - const QString& city=QString::null, - const QString& state=QString::null, - const QString& postcode=QString::null, - const QString& telephone=QString::null, - const QString& email=QString::null); + MyMoneyPayee(const TQString& id, const MyMoneyPayee& payee); + MyMoneyPayee(const TQString& name, + const TQString& address=TQString(), + const TQString& city=TQString(), + const TQString& state=TQString(), + const TQString& postcode=TQString(), + const TQString& telephone=TQString(), + const TQString& email=TQString()); /** * This is the constructor for a payee that is described by a - * QDomElement (e.g. from a file). + * TQDomElement (e.g. from a file). * - * @param el const reference to the QDomElement from which to + * @param el const reference to the TQDomElement from which to * create the object */ - MyMoneyPayee(const QDomElement& el); + MyMoneyPayee(const TQDomElement& el); ~MyMoneyPayee(); // Simple get operations - QString name(void) const { return m_name; } - QString address(void) const { return m_address; } - QString city(void) const { return m_city; } - QString state(void) const { return m_state; } - QString postcode(void) const { return m_postcode; } - QString telephone(void) const { return m_telephone; } - QString email(void) const { return m_email; } - QString notes(void) const { return m_notes; } - - const QString id(void) const { return m_id; }; - const QString reference(void) const { return m_reference; }; + TQString name(void) const { return m_name; } + TQString address(void) const { return m_address; } + TQString city(void) const { return m_city; } + TQString state(void) const { return m_state; } + TQString postcode(void) const { return m_postcode; } + TQString telephone(void) const { return m_telephone; } + TQString email(void) const { return m_email; } + TQString notes(void) const { return m_notes; } + + const TQString id(void) const { return m_id; }; + const TQString reference(void) const { return m_reference; }; // Simple set operations - void setName(const QString& val) { m_name = val; } - void setAddress(const QString& val) { m_address = val; } - void setCity(const QString& val) { m_city = val; } - void setState(const QString& val) { m_state = val; } - void setPostcode(const QString& val) { m_postcode = val; } - void setTelephone(const QString& val) { m_telephone = val; } - void setEmail(const QString& val) { m_email = val; } - void setNotes(const QString& val) { m_notes = val; } - void setReference(const QString& ref) { m_reference = ref; } + void setName(const TQString& val) { m_name = val; } + void setAddress(const TQString& val) { m_address = val; } + void setCity(const TQString& val) { m_city = val; } + void setState(const TQString& val) { m_state = val; } + void setPostcode(const TQString& val) { m_postcode = val; } + void setTelephone(const TQString& val) { m_telephone = val; } + void setEmail(const TQString& val) { m_email = val; } + void setNotes(const TQString& val) { m_notes = val; } + void setReference(const TQString& ref) { m_reference = ref; } /** * Get all match data in one call @@ -140,7 +140,7 @@ public: * * @return the matching type (see payeeMatchType for details) */ - payeeMatchType matchData(bool& ignorecase, QStringList& keys) const; + payeeMatchType matchData(bool& ignorecase, TQStringList& keys) const; /** * Set all match data in one call @@ -149,7 +149,7 @@ public: * @param ignorecase Whether case should be ignored for the key/name match * @param keys A list of keys themselves, if applicable */ - void setMatchData(payeeMatchType type, bool ignorecase, const QStringList& keys); + void setMatchData(payeeMatchType type, bool ignorecase, const TQStringList& keys); /** * Get all match data in one call (overloaded version for database module) @@ -160,7 +160,7 @@ public: * * @return the matching type (see payeeMatchType for details) */ - payeeMatchType matchData(bool& ignorecase, QString& keyString) const; + payeeMatchType matchData(bool& ignorecase, TQString& keyString) const; /** * Set all match data in one call (overloaded version for database module) @@ -169,12 +169,12 @@ public: * @param ignorecase Whether case should be ignored for the key/name match * @param keys A list of keys in single-string format, if applicable */ - void setMatchData(payeeMatchType type, bool ignorecase, const QString& keys); + void setMatchData(payeeMatchType type, bool ignorecase, const TQString& keys); bool defaultAccountEnabled() const { return !m_defaultAccountId.isEmpty(); } - const QString& defaultAccountId() const { return m_defaultAccountId; } - void setDefaultAccountId(const QString& id = QString()) { + const TQString& defaultAccountId() const { return m_defaultAccountId; } + void setDefaultAccountId(const TQString& id = TQString()) { m_defaultAccountId = id; } @@ -184,7 +184,7 @@ public: // Equality operator bool operator == (const MyMoneyPayee &) const; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -195,12 +195,12 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; static MyMoneyPayee null; }; -inline bool operator==(const MyMoneyPayee& lhs, const QString& rhs) { return lhs.id() == rhs; } +inline bool operator==(const MyMoneyPayee& lhs, const TQString& rhs) { return lhs.id() == rhs; } #endif // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/mymoney/mymoneypayeetest.cpp b/kmymoney2/mymoney/mymoneypayeetest.cpp index 601679c..124cc65 100644 --- a/kmymoney2/mymoney/mymoneypayeetest.cpp +++ b/kmymoney2/mymoney/mymoneypayeetest.cpp @@ -26,21 +26,21 @@ void MyMoneyPayeeTest::tearDown () { } void MyMoneyPayeeTest::testXml(){ - QDomDocument doc; - QDomElement parent = doc.createElement("Test"); - doc.appendChild(parent); + TQDomDocument doc; + TQDomElement tqparent = doc.createElement("Test"); + doc.appendChild(tqparent); MyMoneyPayee payee1; payee1.m_id = "some random id";//if the ID isn't set, w ethrow an exception - payee1.writeXML(doc,parent); - QString temp1 = "Account1"; + payee1.writeXML(doc,tqparent); + TQString temp1 = "Account1"; payee1.setDefaultAccountId(temp1); - payee1.writeXML(doc,parent); - QString temp2 = "Account2"; + payee1.writeXML(doc,tqparent); + TQString temp2 = "Account2"; payee1.setDefaultAccountId(temp2); - payee1.writeXML(doc,parent); + payee1.writeXML(doc,tqparent); payee1.setDefaultAccountId(); - payee1.writeXML(doc,parent); - QDomElement el = parent.firstChild().toElement(); + payee1.writeXML(doc,tqparent); + TQDomElement el = tqparent.firstChild().toElement(); CPPUNIT_ASSERT(!el.isNull()); MyMoneyPayee payee2(el); CPPUNIT_ASSERT(!payee2.defaultAccountEnabled()); @@ -66,7 +66,7 @@ void MyMoneyPayeeTest::testDefaultAccount(){ MyMoneyPayee payee; CPPUNIT_ASSERT(!payee.defaultAccountEnabled()); CPPUNIT_ASSERT(payee.defaultAccountId().isEmpty()); - QString temp = "Account1"; + TQString temp = "Account1"; payee.setDefaultAccountId(temp); CPPUNIT_ASSERT(payee.defaultAccountEnabled()); CPPUNIT_ASSERT(payee.defaultAccountId()==temp); diff --git a/kmymoney2/mymoney/mymoneyprice.cpp b/kmymoney2/mymoney/mymoneyprice.cpp index b674776..df43221 100644 --- a/kmymoney2/mymoney/mymoneyprice.cpp +++ b/kmymoney2/mymoney/mymoneyprice.cpp @@ -37,11 +37,11 @@ #include "mymoneyexception.h" MyMoneyPrice::MyMoneyPrice() : - m_date(QDate()) + m_date(TQDate()) { } -MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDomElement& node) +MyMoneyPrice::MyMoneyPrice(const TQString& from, const TQString& to, const TQDomElement& node) { if("PRICE" != node.tagName()) throw new MYMONEYEXCEPTION("Node was not PRICE"); @@ -49,7 +49,7 @@ MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDomEle m_fromSecurity = from; m_toSecurity = to; - m_date = QDate::fromString(node.attribute("date"), Qt::ISODate); + m_date = TQDate::fromString(node.attribute("date"), Qt::ISODate); m_rate = MyMoneyMoney(node.attribute("price")); m_source = node.attribute("source"); @@ -59,7 +59,7 @@ MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDomEle qDebug("Price with zero value loaded"); } -MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDate& date, const MyMoneyMoney& rate, const QString& source) : +MyMoneyPrice::MyMoneyPrice(const TQString& from, const TQString& to, const TQDate& date, const MyMoneyMoney& rate, const TQString& source) : m_fromSecurity(from), m_toSecurity(to), m_date(date), @@ -76,7 +76,7 @@ MyMoneyPrice::~MyMoneyPrice() { } -const MyMoneyMoney MyMoneyPrice::rate(const QString& id) const +const MyMoneyMoney MyMoneyPrice::rate(const TQString& id) const { static MyMoneyMoney dummyPrice(1,1); @@ -88,7 +88,7 @@ const MyMoneyMoney MyMoneyPrice::rate(const QString& id) const if(id == m_fromSecurity) return m_invRate; - QString msg = QString("Unknown security id %1 for price info %2/%3.").arg(id).arg(m_fromSecurity).arg(m_toSecurity); + TQString msg = TQString("Unknown security id %1 for price info %2/%3.").tqarg(id).tqarg(m_fromSecurity).tqarg(m_toSecurity); throw new MYMONEYEXCEPTION(msg); } @@ -107,7 +107,7 @@ bool MyMoneyPrice::operator == (const MyMoneyPrice &right) const ((m_source.length() == 0 && right.m_source.length() == 0) || (m_source == right.m_source))); } -bool MyMoneyPrice::hasReferenceTo(const QString& id) const +bool MyMoneyPrice::hasReferenceTo(const TQString& id) const { return (id == m_fromSecurity) || (id == m_toSecurity); } diff --git a/kmymoney2/mymoney/mymoneyprice.h b/kmymoney2/mymoney/mymoneyprice.h index faf6454..9c4f1c0 100644 --- a/kmymoney2/mymoney/mymoneyprice.h +++ b/kmymoney2/mymoney/mymoneyprice.h @@ -30,11 +30,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -71,8 +71,8 @@ class KMYMONEY_EXPORT MyMoneyPrice { public: MyMoneyPrice(); - MyMoneyPrice(const QString& from, const QString& to, const QDomElement& node); - MyMoneyPrice(const QString& from, const QString& to, const QDate& date, const MyMoneyMoney& rate, const QString& source = QString()); + MyMoneyPrice(const TQString& from, const TQString& to, const TQDomElement& node); + MyMoneyPrice(const TQString& from, const TQString& to, const TQDate& date, const MyMoneyMoney& rate, const TQString& source = TQString()); virtual ~MyMoneyPrice(); /** @@ -96,7 +96,7 @@ public: * * @code * - * MyMoneyPrice price("ADF", "GBP", QDate(2005,9,20), MyMoneyMoney(1,3), "User"); + * MyMoneyPrice price("ADF", "GBP", TQDate(2005,9,20), MyMoneyMoney(1,3), "User"); * MyMoneyMoney valADF, valGBP(100,1); * * valADF = valGBP * price.rate("ADF"); @@ -107,12 +107,12 @@ public: * @p 3/1 even though the price information kept with the object was @p 1/3, but based on the other * conversion direction (from ADF to GBP). */ - const MyMoneyMoney rate(const QString& id) const; + const MyMoneyMoney rate(const TQString& id) const; - const QDate& date(void) const { return m_date; }; - const QString& source(void) const { return m_source; }; - const QString& from(void) const { return m_fromSecurity; }; - const QString& to(void) const { return m_toSecurity; }; + const TQDate& date(void) const { return m_date; }; + const TQString& source(void) const { return m_source; }; + const TQString& from(void) const { return m_fromSecurity; }; + const TQString& to(void) const { return m_toSecurity; }; /** * Check whether the object is valid or not. A MyMoneyPrice object @@ -139,20 +139,20 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - bool hasReferenceTo(const QString& id) const; + bool hasReferenceTo(const TQString& id) const; private: - QString m_fromSecurity; - QString m_toSecurity; - QDate m_date; + TQString m_fromSecurity; + TQString m_toSecurity; + TQDate m_date; MyMoneyMoney m_rate; MyMoneyMoney m_invRate; - QString m_source; + TQString m_source; }; -typedef QPair MyMoneySecurityPair; -typedef QMap MyMoneyPriceEntries; -typedef QMap MyMoneyPriceList; +typedef TQPair MyMoneySecurityPair; +typedef TQMap MyMoneyPriceEntries; +typedef TQMap MyMoneyPriceList; #endif diff --git a/kmymoney2/mymoney/mymoneypricetest.cpp b/kmymoney2/mymoney/mymoneypricetest.cpp index 203e9ca..444754a 100644 --- a/kmymoney2/mymoney/mymoneypricetest.cpp +++ b/kmymoney2/mymoney/mymoneypricetest.cpp @@ -39,23 +39,23 @@ void MyMoneyPriceTest::testDefaultConstructor() void MyMoneyPriceTest::testConstructor() { - MyMoneyPrice n(QString("from"), QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); + MyMoneyPrice n(TQString("from"), TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); CPPUNIT_ASSERT(n.isValid() == true); - CPPUNIT_ASSERT(n.from() == QString("from")); - CPPUNIT_ASSERT(n.to() == QString("to")); - CPPUNIT_ASSERT(n.date() == QDate(2005,9,23)); - CPPUNIT_ASSERT(n.source() == QString("MySource")); + CPPUNIT_ASSERT(n.from() == TQString("from")); + CPPUNIT_ASSERT(n.to() == TQString("to")); + CPPUNIT_ASSERT(n.date() == TQDate(2005,9,23)); + CPPUNIT_ASSERT(n.source() == TQString("MySource")); CPPUNIT_ASSERT(n.rate("to") == MyMoneyMoney(1,3)); } void MyMoneyPriceTest::testValidity() { - QString emptyId; - MyMoneyPrice n1(emptyId, QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n2(QString("from"), emptyId, QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n3(QString("from"), QString("to"), QDate(), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n4(QString("from"), QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); + TQString emptyId; + MyMoneyPrice n1(emptyId, TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n2(TQString("from"), emptyId, TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n3(TQString("from"), TQString("to"), TQDate(), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n4(TQString("from"), TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); CPPUNIT_ASSERT(n1.isValid() == false); CPPUNIT_ASSERT(n2.isValid() == false); @@ -65,13 +65,13 @@ void MyMoneyPriceTest::testValidity() void MyMoneyPriceTest::testRate() { - MyMoneyPrice n1(QString("from"), QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n2(QString("from"), QString("to"), QDate(), MyMoneyMoney(1,3), QString("MySource")); + MyMoneyPrice n1(TQString("from"), TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n2(TQString("from"), TQString("to"), TQDate(), MyMoneyMoney(1,3), TQString("MySource")); try { CPPUNIT_ASSERT(n1.rate("to") == MyMoneyMoney(1,3)); CPPUNIT_ASSERT(n1.rate("from") == MyMoneyMoney(3,1)); - CPPUNIT_ASSERT(n1.rate(QString()) == MyMoneyMoney(1,3)); + CPPUNIT_ASSERT(n1.rate(TQString()) == MyMoneyMoney(1,3)); CPPUNIT_ASSERT(n2.isValid() == false); CPPUNIT_ASSERT(n2.rate("to") == MyMoneyMoney(1,1)); diff --git a/kmymoney2/mymoney/mymoneyreport.cpp b/kmymoney2/mymoney/mymoneyreport.cpp index 63c4ca7..4cd667b 100644 --- a/kmymoney2/mymoney/mymoneyreport.cpp +++ b/kmymoney2/mymoney/mymoneyreport.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -34,22 +34,22 @@ #include "mymoneyfile.h" #include "mymoneyreport.h" -const QStringList MyMoneyReport::kRowTypeText = QStringList::split ( ",", "none,assetliability,expenseincome,category,topcategory,account,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow", true ); -const QStringList MyMoneyReport::kColumnTypeText = QStringList::split ( ",", "none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years", true ); +const TQStringList MyMoneyReport::kRowTypeText = TQStringList::split ( ",", "none,assetliability,expenseincome,category,topcategory,account,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow", true ); +const TQStringList MyMoneyReport::kColumnTypeText = TQStringList::split ( ",", "none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years", true ); // if you add names here, don't forget to update the bitmap for EQueryColumns -// and shift the bit for eQCend one position to the left -const QStringList MyMoneyReport::kQueryColumnsText = QStringList::split ( ",", "none,number,payee,category,memo,account,reconcileflag,action,shares,price,performance,loan,balance", true ); +// and shift the bit for eTQCend one position to the left +const TQStringList MyMoneyReport::kQueryColumnsText = TQStringList::split ( ",", "none,number,payee,category,memo,account,reconcileflag,action,shares,price,performance,loan,balance", true ); const MyMoneyReport::EReportType MyMoneyReport::kTypeArray[] = { eNoReport, ePivotTable, ePivotTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, ePivotTable, ePivotTable, eInfoTable, eInfoTable, eInfoTable, eQueryTable, eQueryTable, eNoReport }; -const QStringList MyMoneyReport::kDetailLevelText = QStringList::split ( ",", "none,all,top,group,total,invalid", true ); -const QStringList MyMoneyReport::kChartTypeText = QStringList::split ( ",", "none,line,bar,pie,ring,stackedbar,invalid", true ); +const TQStringList MyMoneyReport::kDetailLevelText = TQStringList::split ( ",", "none,all,top,group,total,invalid", true ); +const TQStringList MyMoneyReport::kChartTypeText = TQStringList::split ( ",", "none,line,bar,pie,ring,stackedbar,invalid", true ); // This should live in mymoney/mymoneytransactionfilter.h -static const QStringList kTypeText = QStringList::split ( ",", "all,payments,deposits,transfers,none" ); -static const QStringList kStateText = QStringList::split ( ",", "all,notreconciled,cleared,reconciled,frozen,none" ); -static const QStringList kDateLockText = QStringList::split ( ",", "alldates,untiltoday,currentmonth,currentyear,monthtodate,yeartodate,yeartomonth,lastmonth,lastyear,last7days,last30days,last3months,last6months,last12months,next7days,next30days,next3months,next6months,next12months,userdefined,last3tonext3months,last11Months,currentQuarter,lastQuarter,nextQuarter,currentFiscalYear,lastFiscalYear,today" ); -static const QStringList kAccountTypeText = QStringList::split ( ",", "unknown,checkings,savings,cash,creditcard,loan,certificatedep,investment,moneymarket,asset,liability,currency,income,expense,assetloan,stock,equity,invalid" ); +static const TQStringList kTypeText = TQStringList::split ( ",", "all,payments,deposits,transfers,none" ); +static const TQStringList kStateText = TQStringList::split ( ",", "all,notreconciled,cleared,reconciled,frozen,none" ); +static const TQStringList kDateLockText = TQStringList::split ( ",", "alldates,untiltoday,currentmonth,currentyear,monthtodate,yeartodate,yeartomonth,lastmonth,lastyear,last7days,last30days,last3months,last6months,last12months,next7days,next30days,next3months,next6months,next12months,userdefined,last3tonext3months,last11Months,currentQuarter,lastQuarter,nextQuarter,currentFiscalYear,lastFiscalYear,today" ); +static const TQStringList kAccountTypeText = TQStringList::split ( ",", "unknown,checkings,savings,cash,creditcard,loan,certificatedep,investment,moneymarket,asset,liability,currency,income,expense,assetloan,stock,equity,invalid" ); MyMoneyReport::MyMoneyReport() : m_name ( "Unconfigured Pivot Table Report" ), @@ -63,7 +63,7 @@ MyMoneyReport::MyMoneyReport() : m_rowType ( eExpenseIncome ), m_columnType ( eMonths ), m_columnsAreDays ( false ), - m_queryColumns ( eQCnone ), + m_queryColumns ( eTQCnone ), m_dateLock ( userDefined ), m_accountGroupFilter ( false ), m_chartType ( eChartLine ), @@ -83,14 +83,14 @@ MyMoneyReport::MyMoneyReport() : { } -MyMoneyReport::MyMoneyReport ( const QString& id, const MyMoneyReport& right ) : +MyMoneyReport::MyMoneyReport ( const TQString& id, const MyMoneyReport& right ) : MyMoneyObject ( id ) { *this = right; setId ( id ); } -MyMoneyReport::MyMoneyReport ( ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const QString& _name, const QString& _comment ) : +MyMoneyReport::MyMoneyReport ( ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const TQString& _name, const TQString& _comment ) : m_name ( _name ), m_comment ( _comment ), m_detailLevel ( _ss ), @@ -162,7 +162,7 @@ MyMoneyReport::MyMoneyReport ( ERowType _rt, unsigned _ct, dateOptionE _dl, EDet } } -MyMoneyReport::MyMoneyReport ( const QDomElement& node ) : +MyMoneyReport::MyMoneyReport ( const TQDomElement& node ) : MyMoneyObject ( node ) { if ( !read ( node ) ) @@ -177,7 +177,7 @@ void MyMoneyReport::clear ( void ) MyMoneyTransactionFilter::clear(); } -void MyMoneyReport::validDateRange ( QDate& _db, QDate& _de ) +void MyMoneyReport::validDateRange ( TQDate& _db, TQDate& _de ) { _db = fromDate(); _de = toDate(); @@ -193,16 +193,16 @@ void MyMoneyReport::validDateRange ( QDate& _db, QDate& _de ) // year as the filter criteria. if ( !_db.isValid() || !_de.isValid() ) { - QValueList list = MyMoneyFile::instance()->transactionList ( *this ); - QDate tmpBegin, tmpEnd; + TQValueList list = MyMoneyFile::instance()->transactionList ( *this ); + TQDate tmpBegin, tmpEnd; if ( !list.isEmpty() ) { qHeapSort ( list ); tmpBegin = list.front().postDate(); tmpEnd = list.back().postDate(); } else { - tmpBegin = QDate ( QDate::currentDate().year(), 1, 1 ); // the first date in the file - tmpEnd = QDate ( QDate::currentDate().year(), 12, 31 );// the last date in the file + tmpBegin = TQDate ( TQDate::tqcurrentDate().year(), 1, 1 ); // the first date in the file + tmpEnd = TQDate ( TQDate::tqcurrentDate().year(), 12, 31 );// the last date in the file } if ( !_db.isValid() ) _db = tmpBegin; @@ -233,14 +233,14 @@ void MyMoneyReport::setRowType ( ERowType _rt ) } } -bool MyMoneyReport::accountGroups(QValueList& list) const +bool MyMoneyReport::accountGroups(TQValueList& list) const { bool result = m_accountGroupFilter; if ( result ) { - QValueList::const_iterator it_group = m_accountGroups.begin(); + TQValueList::const_iterator it_group = m_accountGroups.begin(); while ( it_group != m_accountGroups.end() ) { list += ( *it_group ); @@ -253,7 +253,7 @@ bool MyMoneyReport::accountGroups(QValueList& list void MyMoneyReport::addAccountGroup ( MyMoneyAccount::accountTypeE type ) { if ( !m_accountGroups.isEmpty() && type != MyMoneyAccount::UnknownAccountType ) { - if ( m_accountGroups.contains ( type ) ) + if ( m_accountGroups.tqcontains ( type ) ) return; } m_accountGroupFilter = true; @@ -265,7 +265,7 @@ bool MyMoneyReport::includesAccountGroup( MyMoneyAccount::accountTypeE type ) co { bool result = ( ! m_accountGroupFilter ) || ( isIncludingTransfers() && m_rowType == MyMoneyReport::eExpenseIncome ) - || m_accountGroups.contains ( type ); + || m_accountGroups.tqcontains ( type ); return result; } @@ -305,7 +305,7 @@ bool MyMoneyReport::includes( const MyMoneyAccount& acc ) const return result; } -void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) const +void MyMoneyReport::write ( TQDomElement& e, TQDomDocument *doc, bool anonymous ) const { // No matter what changes, be sure to have a 'type' attribute. Only change // the major type if it becomes impossible to maintain compatability with @@ -317,7 +317,7 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) if ( anonymous ) { e.setAttribute ( "name", m_id ); - e.setAttribute ( "comment", QString ( m_comment ).fill ( 'x' ) ); + e.setAttribute ( "comment", TQString ( m_comment ).fill ( 'x' ) ); } else { @@ -363,11 +363,11 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) { e.setAttribute ( "type", "querytable 1.14" ); - QStringList columns; + TQStringList columns; unsigned qc = m_queryColumns; - unsigned it_qc = eQCbegin; + unsigned it_qc = eTQCbegin; unsigned index = 1; - while ( it_qc != eQCend ) + while ( it_qc != eTQCend ) { if ( qc & it_qc ) columns += kQueryColumnsText[index]; @@ -387,10 +387,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Text Filter // - QRegExp textfilter; + TQRegExp textfilter; if ( textFilter ( textfilter ) ) { - QDomElement f = doc->createElement ( "TEXT" ); + TQDomElement f = doc->createElement ( "TEXT" ); f.setAttribute ( "pattern", textfilter.pattern() ); f.setAttribute ( "casesensitive", textfilter.caseSensitive() ); f.setAttribute ( "regex", !textfilter.wildcard() ); @@ -401,14 +401,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // // Type & State Filters // - QValueList typelist; + TQValueList typelist; if ( types ( typelist ) && ! typelist.empty() ) { // iterate over payees, and add each one - QValueList::const_iterator it_type = typelist.begin(); + TQValueList::const_iterator it_type = typelist.begin(); while ( it_type != typelist.end() ) { - QDomElement p = doc->createElement ( "TYPE" ); + TQDomElement p = doc->createElement ( "TYPE" ); p.setAttribute ( "type", kTypeText[*it_type] ); e.appendChild ( p ); @@ -416,14 +416,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) } } - QValueList statelist; + TQValueList statelist; if ( states ( statelist ) && ! statelist.empty() ) { // iterate over payees, and add each one - QValueList::const_iterator it_state = statelist.begin(); + TQValueList::const_iterator it_state = statelist.begin(); while ( it_state != statelist.end() ) { - QDomElement p = doc->createElement ( "STATE" ); + TQDomElement p = doc->createElement ( "STATE" ); p.setAttribute ( "state", kStateText[*it_state] ); e.appendChild ( p ); @@ -434,10 +434,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Number Filter // - QString nrFrom, nrTo; + TQString nrFrom, nrTo; if ( numberFilter ( nrFrom, nrTo ) ) { - QDomElement f = doc->createElement ( "NUMBER" ); + TQDomElement f = doc->createElement ( "NUMBER" ); f.setAttribute ( "from", nrFrom ); f.setAttribute ( "to", nrTo ); e.appendChild ( f ); @@ -450,7 +450,7 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) MyMoneyMoney from, to; if ( amountFilter ( from, to ) ) // bool getAmountFilter(MyMoneyMoney&,MyMoneyMoney&); { - QDomElement f = doc->createElement ( "AMOUNT" ); + TQDomElement f = doc->createElement ( "AMOUNT" ); f.setAttribute ( "from", from.toString() ); f.setAttribute ( "to", to.toString() ); e.appendChild ( f ); @@ -460,21 +460,21 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Payees Filter // - QStringList payeelist; + TQStringList payeelist; if ( payees ( payeelist ) ) { if ( payeelist.empty() ) { - QDomElement p = doc->createElement ( "PAYEE" ); + TQDomElement p = doc->createElement ( "PAYEE" ); e.appendChild ( p ); } else { // iterate over payees, and add each one - QStringList::const_iterator it_payee = payeelist.begin(); + TQStringList::const_iterator it_payee = payeelist.begin(); while ( it_payee != payeelist.end() ) { - QDomElement p = doc->createElement ( "PAYEE" ); + TQDomElement p = doc->createElement ( "PAYEE" ); p.setAttribute ( "id", *it_payee ); e.appendChild ( p ); @@ -487,14 +487,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Account Groups Filter // - QValueList accountgrouplist; + TQValueList accountgrouplist; if ( accountGroups ( accountgrouplist ) ) { // iterate over accounts, and add each one - QValueList::const_iterator it_group = accountgrouplist.begin(); + TQValueList::const_iterator it_group = accountgrouplist.begin(); while ( it_group != accountgrouplist.end() ) { - QDomElement p = doc->createElement ( "ACCOUNTGROUP" ); + TQDomElement p = doc->createElement ( "ACCOUNTGROUP" ); p.setAttribute ( "group", kAccountTypeText[*it_group] ); e.appendChild ( p ); @@ -506,14 +506,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Accounts Filter // - QStringList accountlist; + TQStringList accountlist; if ( accounts ( accountlist ) ) { // iterate over accounts, and add each one - QStringList::const_iterator it_account = accountlist.begin(); + TQStringList::const_iterator it_account = accountlist.begin(); while ( it_account != accountlist.end() ) { - QDomElement p = doc->createElement ( "ACCOUNT" ); + TQDomElement p = doc->createElement ( "ACCOUNT" ); p.setAttribute ( "id", *it_account ); e.appendChild ( p ); @@ -529,10 +529,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) if ( categories ( accountlist ) ) { // iterate over accounts, and add each one - QStringList::const_iterator it_account = accountlist.begin(); + TQStringList::const_iterator it_account = accountlist.begin(); while ( it_account != accountlist.end() ) { - QDomElement p = doc->createElement ( "CATEGORY" ); + TQDomElement p = doc->createElement ( "CATEGORY" ); p.setAttribute ( "id", *it_account ); e.appendChild ( p ); @@ -546,10 +546,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) if ( m_dateLock == userDefined ) { - QDate dateFrom, dateTo; + TQDate dateFrom, dateTo; if ( dateFilter ( dateFrom, dateTo ) ) { - QDomElement f = doc->createElement ( "DATES" ); + TQDomElement f = doc->createElement ( "DATES" ); if ( dateFrom.isValid() ) f.setAttribute ( "from", dateFrom.toString ( Qt::ISODate ) ); if ( dateTo.isValid() ) @@ -559,7 +559,7 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) } } -bool MyMoneyReport::read ( const QDomElement& e ) +bool MyMoneyReport::read ( const TQDomElement& e ) { // The goal of this reading method is 100% backward AND 100% forward // compatability. Any report ever created with any version of KMyMoney @@ -572,11 +572,11 @@ bool MyMoneyReport::read ( const QDomElement& e ) "REPORT" == e.tagName() && ( - ( e.attribute ( "type" ).find ( "pivottable 1." ) == 0 ) + ( e.attribute ( "type" ).tqfind ( "pivottable 1." ) == 0 ) || - ( e.attribute ( "type" ).find ( "querytable 1." ) == 0 ) + ( e.attribute ( "type" ).tqfind ( "querytable 1." ) == 0 ) || - ( e.attribute ( "type" ).find ( "infotable 1." ) == 0 ) + ( e.attribute ( "type" ).tqfind ( "infotable 1." ) == 0 ) ) ) { @@ -588,11 +588,11 @@ bool MyMoneyReport::read ( const QDomElement& e ) m_comment = e.attribute ( "comment", "Extremely old report" ); //set report type - if(!e.attribute ( "type" ).find ( "pivottable" )) { + if(!e.attribute ( "type" ).tqfind ( "pivottable" )) { m_reportType = MyMoneyReport::ePivotTable; - } else if(!e.attribute ( "type" ).find ( "querytable" )) { + } else if(!e.attribute ( "type" ).tqfind ( "querytable" )) { m_reportType = MyMoneyReport::eQueryTable; - } else if(!e.attribute ( "type" ).find ( "infotable" )) { + } else if(!e.attribute ( "type" ).tqfind ( "infotable" )) { m_reportType = MyMoneyReport::eInfoTable; } else { m_reportType = MyMoneyReport::eNoReport; @@ -607,7 +607,7 @@ bool MyMoneyReport::read ( const QDomElement& e ) //check for reports with older settings which didn't have the detail attribute if ( e.hasAttribute ( "detail" ) ) { - i = kDetailLevelText.findIndex ( e.attribute ( "detail", "all" ) ); + i = kDetailLevelText.tqfindIndex ( e.attribute ( "detail", "all" ) ); if ( i != -1 ) m_detailLevel = static_cast ( i ); } else if ( e.attribute ( "showsubaccounts", "0" ).toUInt() ) { @@ -639,7 +639,7 @@ bool MyMoneyReport::read ( const QDomElement& e ) //only load chart data if it is a pivot table if ( m_reportType == ePivotTable ) { - i = kChartTypeText.findIndex ( e.attribute ( "charttype" ) ); + i = kChartTypeText.tqfindIndex ( e.attribute ( "charttype" ) ); if ( i != -1 ) m_chartType = static_cast ( i ); @@ -660,20 +660,20 @@ bool MyMoneyReport::read ( const QDomElement& e ) m_chartLineWidth = 1; } - QString datelockstr = e.attribute ( "datelock", "userdefined" ); + TQString datelockstr = e.attribute ( "datelock", "userdefined" ); // Handle the pivot 1.2/query 1.1 case where the values were saved as // numbers bool ok = false; i = datelockstr.toUInt ( &ok ); if ( !ok ) { - i = kDateLockText.findIndex ( datelockstr ); + i = kDateLockText.tqfindIndex ( datelockstr ); if ( i == -1 ) i = userDefined; } setDateFilter ( static_cast ( i ) ); - i = kRowTypeText.findIndex ( e.attribute ( "rowtype", "expenseincome" ) ); + i = kRowTypeText.tqfindIndex ( e.attribute ( "rowtype", "expenseincome" ) ); if ( i != -1 ) { setRowType ( static_cast ( i ) ); @@ -687,16 +687,16 @@ bool MyMoneyReport::read ( const QDomElement& e ) if ( e.hasAttribute ( "showrowtotals" ) ) m_showRowTotals = e.attribute ( "showrowtotals" ).toUInt(); - i = kColumnTypeText.findIndex ( e.attribute ( "columntype", "months" ) ); + i = kColumnTypeText.tqfindIndex ( e.attribute ( "columntype", "months" ) ); if ( i != -1 ) setColumnType ( static_cast ( i ) ); unsigned qc = 0; - QStringList columns = QStringList::split ( ",", e.attribute ( "querycolumns", "none" ) ); - QStringList::const_iterator it_column = columns.begin(); + TQStringList columns = TQStringList::split ( ",", e.attribute ( "querycolumns", "none" ) ); + TQStringList::const_iterator it_column = columns.begin(); while ( it_column != columns.end() ) { - i = kQueryColumnsText.findIndex ( *it_column ); + i = kQueryColumnsText.tqfindIndex ( *it_column ); if ( i > 0 ) qc |= ( 1 << ( i - 1 ) ); @@ -704,23 +704,23 @@ bool MyMoneyReport::read ( const QDomElement& e ) } setQueryColumns ( static_cast ( qc ) ); - QDomNode child = e.firstChild(); + TQDomNode child = e.firstChild(); while ( !child.isNull() && child.isElement() ) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if ( "TEXT" == c.tagName() && c.hasAttribute ( "pattern" ) ) { - setTextFilter ( QRegExp ( c.attribute ( "pattern" ), c.attribute ( "casesensitive", "1" ).toUInt(), !c.attribute ( "regex", "1" ).toUInt() ), c.attribute ( "inverttext", "0" ).toUInt() ); + setTextFilter ( TQRegExp ( c.attribute ( "pattern" ), c.attribute ( "casesensitive", "1" ).toUInt(), !c.attribute ( "regex", "1" ).toUInt() ), c.attribute ( "inverttext", "0" ).toUInt() ); } if ( "TYPE" == c.tagName() && c.hasAttribute ( "type" ) ) { - i = kTypeText.findIndex ( c.attribute ( "type" ) ); + i = kTypeText.tqfindIndex ( c.attribute ( "type" ) ); if ( i != -1 ) addType ( i ); } if ( "STATE" == c.tagName() && c.hasAttribute ( "state" ) ) { - i = kStateText.findIndex ( c.attribute ( "state" ) ); + i = kStateText.tqfindIndex ( c.attribute ( "state" ) ); if ( i != -1 ) addState ( i ); } @@ -734,11 +734,11 @@ bool MyMoneyReport::read ( const QDomElement& e ) } if ( "DATES" == c.tagName() ) { - QDate from, to; + TQDate from, to; if ( c.hasAttribute ( "from" ) ) - from = QDate::fromString ( c.attribute ( "from" ), Qt::ISODate ); + from = TQDate::fromString ( c.attribute ( "from" ), Qt::ISODate ); if ( c.hasAttribute ( "to" ) ) - to = QDate::fromString ( c.attribute ( "to" ), Qt::ISODate ); + to = TQDate::fromString ( c.attribute ( "to" ), Qt::ISODate ); MyMoneyTransactionFilter::setDateFilter ( from, to ); } if ( "PAYEE" == c.tagName() ) @@ -755,7 +755,7 @@ bool MyMoneyReport::read ( const QDomElement& e ) } if ( "ACCOUNTGROUP" == c.tagName() && c.hasAttribute ( "group" ) ) { - i = kAccountTypeText.findIndex ( c.attribute ( "group" ) ); + i = kAccountTypeText.tqfindIndex ( c.attribute ( "group" ) ); if ( i != -1 ) addAccountGroup ( static_cast ( i ) ); } @@ -765,23 +765,23 @@ bool MyMoneyReport::read ( const QDomElement& e ) return result; } -void MyMoneyReport::writeXML ( QDomDocument& document, QDomElement& parent ) const +void MyMoneyReport::writeXML ( TQDomDocument& document, TQDomElement& tqparent ) const { - QDomElement el = document.createElement ( "REPORT" ); + TQDomElement el = document.createElement ( "REPORT" ); write ( el, &document, false ); - parent.appendChild ( el ); + tqparent.appendChild ( el ); } -bool MyMoneyReport::hasReferenceTo ( const QString& id ) const +bool MyMoneyReport::hasReferenceTo ( const TQString& id ) const { - QStringList list; + TQStringList list; // collect all ids accounts ( list ); categories ( list ); payees ( list ); - return ( list.contains ( id ) > 0 ); + return ( list.tqcontains ( id ) > 0 ); } // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/mymoney/mymoneyreport.h b/kmymoney2/mymoney/mymoneyreport.h index e467179..a541042 100644 --- a/kmymoney2/mymoney/mymoneyreport.h +++ b/kmymoney2/mymoney/mymoneyreport.h @@ -24,11 +24,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -class QDomElement; -class QDomDocument; +#include +#include +#include +class TQDomElement; +class TQDomDocument; // ---------------------------------------------------------------------------- // Project Includes @@ -45,8 +45,8 @@ class QDomDocument; * A report is a transactionfilter, so any report can specify which * transactions it's interested down to the most minute level of detail. * It extends the transactionfilter by providing identification (name, - * comments, group type, etc) as well as layout information (what kind - * of layout should be used, how the rows & columns should be presented, + * comments, group type, etc) as well as tqlayout information (what kind + * of tqlayout should be used, how the rows & columns should be presented, * currency converted, etc.) * * As noted above, this class only provides a report DEFINITION. The @@ -64,34 +64,34 @@ public: enum EReportType { eNoReport = 0, ePivotTable, eQueryTable, eInfoTable }; enum EColumnType { eNoColumns = 0, eDays = 1, eMonths = 1, eBiMonths = 2, eQuarters = 3, eWeeks = 7, eYears = 12 }; - // if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards + // if you add bits to this bittqmask, start with the value currently assigned to eTQCend and update its value afterwards // also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp - enum EQueryColumns { eQCnone = 0x0, eQCbegin = 0x1, eQCnumber = 0x1, eQCpayee = 0x2, eQCcategory = 0x4, eQCmemo = 0x8, eQCaccount = 0x10, eQCreconciled = 0x20, eQCaction = 0x40, eQCshares = 0x80, eQCprice = 0x100, eQCperformance = 0x200, eQCloan = 0x400, eQCbalance = 0x800, eQCend = 0x1000 }; + enum EQueryColumns { eTQCnone = 0x0, eTQCbegin = 0x1, eTQCnumber = 0x1, eTQCpayee = 0x2, eTQCcategory = 0x4, eTQCmemo = 0x8, eTQCaccount = 0x10, eTQCreconciled = 0x20, eTQCaction = 0x40, eTQCshares = 0x80, eTQCprice = 0x100, eTQCperformance = 0x200, eTQCloan = 0x400, eTQCbalance = 0x800, eTQCend = 0x1000 }; enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; - static const QStringList kRowTypeText; - static const QStringList kColumnTypeText; - static const QStringList kQueryColumnsText; - static const QStringList kDetailLevelText; - static const QStringList kChartTypeText; + static const TQStringList kRowTypeText; + static const TQStringList kColumnTypeText; + static const TQStringList kQueryColumnsText; + static const TQStringList kDetailLevelText; + static const TQStringList kChartTypeText; static const EReportType kTypeArray[]; public: MyMoneyReport(void); - MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const QString& _name, const QString& _comment ); - MyMoneyReport(const QString& id, const MyMoneyReport& right); + MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const TQString& _name, const TQString& _comment ); + MyMoneyReport(const TQString& id, const MyMoneyReport& right); /** * This constructor creates an object based on the data found in the - * QDomElement referenced by @p node. If problems arise, the @p id of + * TQDomElement referenced by @p node. If problems arise, the @p id of * the object is cleared (see MyMoneyObject::clearId()). */ - MyMoneyReport(const QDomElement& node); + MyMoneyReport(const TQDomElement& node); // Simple get operations - const QString& name(void) const { return m_name; } + const TQString& name(void) const { return m_name; } bool isShowingRowTotals(void) const { return (m_showRowTotals); } EReportType reportType(void) const { return m_reportType; } ERowType rowType(void) const { return m_rowType; } @@ -100,9 +100,9 @@ public: bool isConvertCurrency(void) const { return m_convertCurrency; } unsigned columnPitch(void) const { return static_cast(m_columnType); } bool isShowingColumnTotals(void) const { return m_convertCurrency; } - const QString& comment( void ) const { return m_comment; } + const TQString& comment( void ) const { return m_comment; } EQueryColumns queryColumns(void) const { return m_queryColumns; } - const QString& group( void ) const { return m_group; } + const TQString& group( void ) const { return m_group; } bool isFavorite(void) const { return m_favorite; } bool isTax(void) const { return m_tax; } bool isInvestmentsOnly(void) const { return m_investments; } @@ -118,7 +118,7 @@ public: bool isIncludingTransfers(void) const { return m_includeTransfers; } bool isIncludingUnusedAccounts(void) const { return m_includeUnusedAccounts; } bool hasBudget(void) const { return !m_budgetId.isEmpty(); } - const QString& budget(void) const { return m_budgetId; } + const TQString& budget(void) const { return m_budgetId; } bool isIncludingBudgetActuals(void) const { return m_includeBudgetActuals; } bool isIncludingForecast(void) const { return m_includeForecast; } bool isIncludingMovingAverage(void) const { return m_includeMovingAverage; } @@ -128,12 +128,12 @@ public: bool isUserDefined(void) const { return m_dateLock == userDefined; } // Simple set operations - void setName(const QString& _s) { m_name = _s; } + void setName(const TQString& _s) { m_name = _s; } void setConvertCurrency(bool _f) { m_convertCurrency = _f; } void setRowType(ERowType _rt); void setColumnType(EColumnType _ct) { m_columnType = _ct; } - void setComment( const QString& _comment ) { m_comment = _comment; } - void setGroup( const QString& _group ) { m_group = _group; } + void setComment( const TQString& _comment ) { m_comment = _comment; } + void setGroup( const TQString& _group ) { m_group = _group; } void setFavorite(bool _f) { m_favorite = _f; } void setQueryColumns( EQueryColumns _qc ) { m_queryColumns = _qc; } void setTax(bool _f) { m_tax = _f; } @@ -168,7 +168,7 @@ public: * simply checked for any non-empty string, and if so, hasBudget() * will return true. */ - void setBudget( const QString& _budget, bool _fa = true ) { m_budgetId = _budget; m_includeBudgetActuals=_fa; } + void setBudget( const TQString& _budget, bool _fa = true ) { m_budgetId = _budget; m_includeBudgetActuals=_fa; } /** * This method allows you to clear the underlying transaction filter @@ -212,7 +212,7 @@ public: * @param _de The inclusive end date of the date range */ - void setDateFilter(const QDate& _db,const QDate& _de) { MyMoneyTransactionFilter::setDateFilter( _db,_de ); } + void setDateFilter(const TQDate& _db,const TQDate& _de) { MyMoneyTransactionFilter::setDateFilter( _db,_de ); } /** * Set the underlying date filter using the 'date lock' property. @@ -230,19 +230,19 @@ public: /** * Retrieves a VALID beginning & ending date for this report. * - * The underlying date filter can return en empty QDate() for either the + * The underlying date filter can return en empty TQDate() for either the * begin or end date or both. This is typically unacceptable for reports, * which need the REAL begin and end date. * * This function gets the underlying date filter range, and if either is - * an empty QDate(), it determines the missing date from looking at all + * an empty TQDate(), it determines the missing date from looking at all * the transactions which match the underlying filter, and returning the * date of the first or last transaction (as appropriate). * * @param _db The inclusive begin date of the date range * @param _de The inclusive end date of the date range */ - void validDateRange(QDate& _db, QDate& _de); + void validDateRange(TQDate& _db, TQDate& _de); /** * This method turns on the account group filter and adds the @@ -251,7 +251,7 @@ public: * Note that account group filtering is handled differently * than all the filters of the underlying class. This filter * is meant to be applied to individual splits of matched - * transactions AFTER the underlying filter is used to find + * transactions AFTER the underlying filter is used to tqfind * the matching transactions. * * @param type the account group to add to the allowed groups list @@ -265,7 +265,7 @@ public: * @param list list to append account groups into * @return return true if an account group filter has been set */ - bool accountGroups(QValueList& list) const; + bool accountGroups(TQValueList& list) const; /** * This method returns whether the specified account group @@ -296,9 +296,9 @@ public: * @param doc The document which we can use to create new sub-elements * if needed * @param anonymous Whether the sensitive parts of the report should be - * masked + * tqmasked */ - void write(QDomElement& e, QDomDocument *doc, bool anonymous=false) const; + void write(TQDomElement& e, TQDomDocument *doc, bool anonymous=false) const; /** * This method reads a report from the DOM element @p e, and @@ -310,17 +310,17 @@ public: * element @p e. If false is returned, the contents of this report * object are undefined. */ - bool read(const QDomElement& e); + bool read(const TQDomElement& e); /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. (This version overwrites the + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. (This version overwrites the * MMObject base class.) * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - virtual void writeXML(QDomDocument& document, QDomElement& parent) const; + virtual void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -331,23 +331,23 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; private: /** * The user-assigned name of the report */ - QString m_name; + TQString m_name; /** * The user-assigned comment for the report, in case they want to make * additional notes for themselves about the report. */ - QString m_comment; + TQString m_comment; /** * Where to group this report amongst the others in the UI view. This * should be assigned by the UI system. */ - QString m_group; + TQString m_group; /** * How much detail to show in the accounts */ @@ -417,7 +417,7 @@ private: * is applied to the individual splits AFTER a transaction has been * matched using the underlying filter. */ - QValueList m_accountGroups; + TQValueList m_accountGroups; /** * Whether an account group filter has been set (see m_accountGroups) */ @@ -454,7 +454,7 @@ private: /** * The id of the budget associated with this report. */ - QString m_budgetId; + TQString m_budgetId; /** * Whether this report should print the actual data to go along with * the budget. This is only valid if the report has a budget. diff --git a/kmymoney2/mymoney/mymoneyscheduled.cpp b/kmymoney2/mymoney/mymoneyscheduled.cpp index 88b4c7b..ef8264c 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.cpp +++ b/kmymoney2/mymoney/mymoneyscheduled.cpp @@ -40,17 +40,17 @@ MyMoneySchedule::MyMoneySchedule() : m_paymentType = STYPE_ANY; m_fixed = false; m_autoEnter = false; - m_startDate = QDate(); - m_endDate = QDate(); - m_lastPayment = QDate(); + m_startDate = TQDate(); + m_endDate = TQDate(); + m_lastPayment = TQDate(); m_weekendOption = MoveNothing; } -MyMoneySchedule::MyMoneySchedule(const QString& name, typeE type, +MyMoneySchedule::MyMoneySchedule(const TQString& name, typeE type, occurenceE occurence, int occurenceMultiplier, paymentTypeE paymentType, - const QDate& /* startDate */, - const QDate& endDate, + const TQDate& /* startDate */, + const TQDate& endDate, bool fixed, bool autoEnter) : MyMoneyObject() { @@ -63,13 +63,13 @@ MyMoneySchedule::MyMoneySchedule(const QString& name, typeE type, m_paymentType = paymentType; m_fixed = fixed; m_autoEnter = autoEnter; - m_startDate = QDate(); + m_startDate = TQDate(); m_endDate = endDate; - m_lastPayment = QDate(); + m_lastPayment = TQDate(); m_weekendOption = MoveNothing; } -MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : +MyMoneySchedule::MyMoneySchedule(const TQDomElement& node) : MyMoneyObject(node) { if("SCHEDULED_TX" != node.tagName()) @@ -91,7 +91,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : m_weekendOption = static_cast(node.attribute("weekendOption").toInt()); // read in the associated transaction - QDomNodeList nodeList = node.elementsByTagName("TRANSACTION"); + TQDomNodeList nodeList = node.elementsByTagName("TRANSACTION"); if(nodeList.count() == 0) throw new MYMONEYEXCEPTION("SCHEDULED_TX has no TRANSACTION node"); @@ -101,8 +101,8 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : // in the schedule. So if this is the case, we deal with a very old transaction // and can't use the post date field as next due date. Hence, we wipe it out here if(m_transaction.entryDate().isValid()) { - m_transaction.setPostDate(QDate()); - m_transaction.setEntryDate(QDate()); + m_transaction.setPostDate(TQDate()); + m_transaction.setEntryDate(TQDate()); } // readin the recorded payments @@ -119,7 +119,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : if(!nextDueDate().isValid() && !m_lastPayment.isValid()) { m_transaction.setPostDate(m_startDate); // clear it, because the schedule has never been used - m_startDate = QDate(); + m_startDate = TQDate(); } // There are reports that lastPayment and nextDueDate are identical or @@ -127,7 +127,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : // be caused by older versions of the application. In this case, we just // clear out the nextDueDate and let it calculate from the lastPayment. if(nextDueDate().isValid() && nextDueDate() <= m_lastPayment) { - m_transaction.setPostDate(QDate()); + m_transaction.setPostDate(TQDate()); } if(!nextDueDate().isValid()) { @@ -136,7 +136,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : } } -MyMoneySchedule::MyMoneySchedule(const QString& id, const MyMoneySchedule& right) : +MyMoneySchedule::MyMoneySchedule(const TQString& id, const MyMoneySchedule& right) : MyMoneyObject(id) { *this = right; @@ -151,7 +151,7 @@ MyMoneySchedule::occurenceE MyMoneySchedule::occurence(void) const return occ; } -void MyMoneySchedule::setStartDate(const QDate& date) +void MyMoneySchedule::setStartDate(const TQDate& date) { m_startDate = date; } @@ -190,14 +190,14 @@ void MyMoneySchedule::setTransaction(const MyMoneyTransaction& transaction, bool // make sure to clear out some unused information in scheduled transactions // we need to do this for the case that the transaction passed as argument // is a matched or imported transaction. - QValueList splits = t.splits(); + TQValueList splits = t.splits(); if(splits.count() > 0) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneySplit s = *it_s; // clear out the bankID if(!(*it_s).bankID().isEmpty()) { - s.setBankID(QString()); + s.setBankID(TQString()); t.modifySplit(s); } @@ -212,10 +212,10 @@ void MyMoneySchedule::setTransaction(const MyMoneyTransaction& transaction, bool // simply skip the test // Don't check for accounts with an id of 'Phony-ID' which is used // internally for non-existing accounts (during creation of accounts) - if(file->storageAttached() && s.accountId() != QString("Phony-ID")) { + if(file->storageAttached() && s.accountId() != TQString("Phony-ID")) { MyMoneyAccount acc = file->account(s.accountId()); if(acc.isIncomeExpense()) { - s.setPayeeId(QString()); + s.setPayeeId(TQString()); t.modifySplit(s); } } @@ -229,7 +229,7 @@ void MyMoneySchedule::setTransaction(const MyMoneyTransaction& transaction, bool m_transaction.clearId(); } -void MyMoneySchedule::setEndDate(const QDate& date) +void MyMoneySchedule::setEndDate(const TQDate& date) { m_endDate = date; } @@ -239,27 +239,27 @@ void MyMoneySchedule::setAutoEnter(bool autoenter) m_autoEnter = autoenter; } -const QDate& MyMoneySchedule::startDate(void) const +const TQDate& MyMoneySchedule::startDate(void) const { if(m_startDate.isValid()) return m_startDate; return nextDueDate(); } -const QDate& MyMoneySchedule::nextDueDate(void) const +const TQDate& MyMoneySchedule::nextDueDate(void) const { return m_transaction.postDate(); } -QDate MyMoneySchedule::adjustedNextDueDate(void) const +TQDate MyMoneySchedule::adjustedNextDueDate(void) const { if(isFinished()) - return QDate(); + return TQDate(); return adjustedDate(nextDueDate(), weekendOption()); } -QDate MyMoneySchedule::adjustedDate(QDate date, weekendOptionE option) const +TQDate MyMoneySchedule::adjustedDate(TQDate date, weekendOptionE option) const { if (option == MyMoneySchedule::MoveNothing) return date; @@ -274,7 +274,7 @@ QDate MyMoneySchedule::adjustedDate(QDate date, weekendOptionE option) const return date; } -void MyMoneySchedule::setNextDueDate(const QDate& date) +void MyMoneySchedule::setNextDueDate(const TQDate& date) { if(date.isValid()) { m_transaction.setPostDate(date); @@ -282,11 +282,11 @@ void MyMoneySchedule::setNextDueDate(const QDate& date) } } -void MyMoneySchedule::setLastPayment(const QDate& date) +void MyMoneySchedule::setLastPayment(const TQDate& date) { // Delete all payments older than date - QValueList::Iterator it; - QValueList delList; + TQValueList::Iterator it; + TQValueList delList; for (it=m_recordedPayments.begin(); it!=m_recordedPayments.end(); ++it) { @@ -304,7 +304,7 @@ void MyMoneySchedule::setLastPayment(const QDate& date) m_startDate = date; } -void MyMoneySchedule::setName(const QString& nm) +void MyMoneySchedule::setName(const TQString& nm) { m_name = nm; } @@ -373,7 +373,7 @@ void MyMoneySchedule::validate(bool id_check) const break; case TYPE_DEPOSIT: - if (m_paymentType == STYPE_DIRECTDEBIT || m_paymentType == STYPE_WRITECHEQUE) + if (m_paymentType == STYPE_DIRECTDEBIT || m_paymentType == STYPE_WRITECHETQUE) throw new MYMONEYEXCEPTION("Invalid payment type for deposits"); break; @@ -391,21 +391,21 @@ void MyMoneySchedule::validate(bool id_check) const } } -QDate MyMoneySchedule::adjustedNextPayment(const QDate& refDate) const +TQDate MyMoneySchedule::adjustedNextPayment(const TQDate& refDate) const { - QDate date(nextPayment(refDate)); + TQDate date(nextPayment(refDate)); return date.isValid() ? adjustedDate(date, weekendOption()) : date; } -QDate MyMoneySchedule::nextPayment(const QDate& refDate) const +TQDate MyMoneySchedule::nextPayment(const TQDate& refDate) const { // if the enddate is valid and it is before the reference date, // then there will be no more payments. if(m_endDate.isValid() && m_endDate < refDate) { - return QDate(); + return TQDate(); } - QDate paymentDate(nextDueDate()); + TQDate paymentDate(nextDueDate()); if(refDate >= paymentDate) { switch (m_occurence) @@ -414,11 +414,11 @@ QDate MyMoneySchedule::nextPayment(const QDate& refDate) const // if the lastPayment is already set, then there will be no more payments // otherwise, the start date is the payment date if(m_lastPayment.isValid()) - return QDate(); + return TQDate(); // if the only payment should have been prior to the reference date, // then don't show it if(paymentDate < refDate) - return QDate(); + return TQDate(); break; case OCCUR_DAILY: @@ -461,39 +461,39 @@ QDate MyMoneySchedule::nextPayment(const QDate& refDate) const case OCCUR_ANY: default: - paymentDate = QDate(); + paymentDate = TQDate(); break; } } if(paymentDate.isValid()) { if(m_endDate.isValid() && paymentDate > m_endDate) - paymentDate = QDate(); + paymentDate = TQDate(); } - if (paymentDate.isValid() && m_recordedPayments.contains(paymentDate)) + if (paymentDate.isValid() && m_recordedPayments.tqcontains(paymentDate)) paymentDate = nextPayment(paymentDate); return paymentDate; } -QValueList MyMoneySchedule::paymentDates(const QDate& _startDate, const QDate& _endDate) const +TQValueList MyMoneySchedule::paymentDates(const TQDate& _startDate, const TQDate& _endDate) const { - QDate paymentDate(nextDueDate()); - QValueList theDates; + TQDate paymentDate(nextDueDate()); + TQValueList theDates; - QDate endDate(_endDate); + TQDate endDate(_endDate); if ( willEnd() && m_endDate < endDate ) endDate = m_endDate; weekendOptionE option(weekendOption()); - QDate start_date(adjustedDate(startDate(), option)); + TQDate start_date(adjustedDate(startDate(), option)); // if the period specified by the parameters and the period // defined for this schedule don't overlap, then the list remains empty if ((willEnd() && m_endDate < _startDate) || start_date > endDate) return theDates; - QDate date(adjustedDate(paymentDate, option)); + TQDate date(adjustedDate(paymentDate, option)); switch (m_occurence) { @@ -594,7 +594,7 @@ int MyMoneySchedule::transactionsRemaining(void) const if (m_endDate.isValid()) { - QValueList dates = paymentDates(m_lastPayment, m_endDate); + TQValueList dates = paymentDates(m_lastPayment, m_endDate); // Dont include the last payment so -1 counter = dates.count(); } @@ -603,8 +603,8 @@ int MyMoneySchedule::transactionsRemaining(void) const MyMoneyAccount MyMoneySchedule::account(int cnt) const { - QValueList splits = m_transaction.splits(); - QValueList::ConstIterator it; + TQValueList splits = m_transaction.splits(); + TQValueList::ConstIterator it; MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount acc; @@ -627,10 +627,10 @@ MyMoneyAccount MyMoneySchedule::account(int cnt) const return MyMoneyAccount(); } -QDate MyMoneySchedule::dateAfter(int transactions) const +TQDate MyMoneySchedule::dateAfter(int transactions) const { int counter=1; - QDate paymentDate(startDate()); + TQDate paymentDate(startDate()); if (transactions<=0) return paymentDate; @@ -680,7 +680,7 @@ bool MyMoneySchedule::isOverdue() const if (isFinished()) return false; - if(adjustedNextDueDate() >= QDate::currentDate()) + if(adjustedNextDueDate() >= TQDate::tqcurrentDate()) return false; return true; @@ -705,19 +705,19 @@ bool MyMoneySchedule::isFinished() const return false; } -bool MyMoneySchedule::hasRecordedPayment(const QDate& date) const +bool MyMoneySchedule::hasRecordedPayment(const TQDate& date) const { // m_lastPayment should always be > recordedPayments() if (m_lastPayment.isValid() && m_lastPayment >= date) return true; - if (m_recordedPayments.contains(date)) + if (m_recordedPayments.tqcontains(date)) return true; return false; } -void MyMoneySchedule::recordPayment(const QDate& date) +void MyMoneySchedule::recordPayment(const TQDate& date) { m_recordedPayments.append(date); } @@ -737,19 +737,19 @@ void MyMoneySchedule::setWeekendOption(const weekendOptionE option) } } -void MyMoneySchedule::fixDate(QDate& date) const +void MyMoneySchedule::fixDate(TQDate& date) const { - QDate fixDate(m_startDate); + TQDate fixDate(m_startDate); if(fixDate.isValid() && date.day() != fixDate.day() - && QDate::isValid(date.year(), date.month(), fixDate.day())) { + && TQDate::isValid(date.year(), date.month(), fixDate.day())) { date.setYMD(date.year(), date.month(), fixDate.day()); } } -void MyMoneySchedule::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneySchedule::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("SCHEDULED_TX"); + TQDomElement el = document.createElement("SCHEDULED_TX"); writeBaseXML(document, el); @@ -766,11 +766,11 @@ void MyMoneySchedule::writeXML(QDomDocument& document, QDomElement& parent) cons el.setAttribute("weekendOption", m_weekendOption); //store the payment history for this scheduled task. - QValueList payments = recordedPayments(); - QValueList::ConstIterator it; - QDomElement paymentsElement = document.createElement("PAYMENTS"); + TQValueList payments = recordedPayments(); + TQValueList::ConstIterator it; + TQDomElement paymentsElement = document.createElement("PAYMENTS"); for (it=payments.begin(); it!=payments.end(); ++it) { - QDomElement paymentEntry = document.createElement("PAYMENT"); + TQDomElement paymentEntry = document.createElement("PAYMENT"); paymentEntry.setAttribute("date", dateToString(*it)); paymentsElement.appendChild(paymentEntry); } @@ -779,22 +779,22 @@ void MyMoneySchedule::writeXML(QDomDocument& document, QDomElement& parent) cons //store the transaction data for this task. m_transaction.writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneySchedule::hasReferenceTo(const QString& id) const +bool MyMoneySchedule::hasReferenceTo(const TQString& id) const { return m_transaction.hasReferenceTo(id); } -QString MyMoneySchedule::occurenceToString() const +TQString MyMoneySchedule::occurenceToString() const { return occurenceToString( occurenceMultiplier(), occurencePeriod() ); } -QString MyMoneySchedule::occurenceToString(occurenceE occurence) +TQString MyMoneySchedule::occurenceToString(occurenceE occurence) { - QString occurenceString = I18N_NOOP("Any"); + TQString occurenceString = I18N_NOOP("Any"); if(occurence == MyMoneySchedule::OCCUR_ONCE) occurenceString = I18N_NOOP("Once"); @@ -822,7 +822,7 @@ QString MyMoneySchedule::occurenceToString(occurenceE occurence) occurenceString = I18N_NOOP("Every two months"); else if(occurence == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) occurenceString = I18N_NOOP("Every three months"); - else if(occurence == MyMoneySchedule::OCCUR_QUARTERLY) + else if(occurence == MyMoneySchedule::OCCUR_TQUARTERLY) occurenceString = I18N_NOOP("Quarterly"); else if(occurence == MyMoneySchedule::OCCUR_EVERYFOURMONTHS) occurenceString = I18N_NOOP("Every four months"); @@ -835,22 +835,22 @@ QString MyMoneySchedule::occurenceToString(occurenceE occurence) return occurenceString; } -QString MyMoneySchedule::occurenceToString(int mult, occurenceE type) +TQString MyMoneySchedule::occurenceToString(int mult, occurenceE type) { - QString occurenceString = I18N_NOOP("Any"); + TQString occurenceString = I18N_NOOP("Any"); if (type == MyMoneySchedule::OCCUR_ONCE) switch (mult) { case 1: occurenceString = I18N_NOOP("Once"); break; - default: occurenceString = I18N_NOOP(static_cast("%1 times").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast("%1 times").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_DAILY) switch (mult) { case 1: occurenceString = I18N_NOOP("Daily"); break; case 30: occurenceString = I18N_NOOP("Every thirty days"); break; - default: occurenceString = I18N_NOOP(static_cast("Every %1 days").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast("Every %1 days").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_WEEKLY) switch (mult) @@ -860,13 +860,13 @@ QString MyMoneySchedule::occurenceToString(int mult, occurenceE type) case 3: occurenceString = I18N_NOOP("Every three weeks"); break; case 4: occurenceString = I18N_NOOP("Every four weeks"); break; case 8: occurenceString = I18N_NOOP("Every eight weeks"); break; - default: occurenceString = I18N_NOOP(static_cast("Every %1 weeks").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast("Every %1 weeks").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_EVERYHALFMONTH) switch (mult) { case 1: occurenceString = I18N_NOOP("Every half month"); break; - default: occurenceString = I18N_NOOP(static_cast("Every %1 half months").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast("Every %1 half months").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_MONTHLY) switch (mult) @@ -876,21 +876,21 @@ QString MyMoneySchedule::occurenceToString(int mult, occurenceE type) case 3: occurenceString = I18N_NOOP("Every three months"); break; case 4: occurenceString = I18N_NOOP("Every four months"); break; case 6: occurenceString = I18N_NOOP("Twice yearly"); break; - default: occurenceString = I18N_NOOP(static_cast("Every %1 months").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast("Every %1 months").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_YEARLY) switch (mult) { case 1: occurenceString = I18N_NOOP("Yearly"); break; case 2: occurenceString = I18N_NOOP("Every other year"); break; - default: occurenceString = I18N_NOOP(static_cast("Every %1 years").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast("Every %1 years").tqarg(mult)); } return occurenceString; } -QString MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::occurenceE type) +TQString MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::occurenceE type) { - QString occurenceString = I18N_NOOP("Any"); + TQString occurenceString = I18N_NOOP("Any"); if(type == MyMoneySchedule::OCCUR_ONCE) occurenceString = I18N_NOOP("Once"); @@ -907,9 +907,9 @@ QString MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::occurenceE typ return occurenceString; } -QString MyMoneySchedule::scheduleTypeToString(MyMoneySchedule::typeE type) +TQString MyMoneySchedule::scheduleTypeToString(MyMoneySchedule::typeE type) { - QString text; + TQString text; switch (type) { case MyMoneySchedule::TYPE_BILL: @@ -932,9 +932,9 @@ QString MyMoneySchedule::scheduleTypeToString(MyMoneySchedule::typeE type) } -QString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) +TQString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) { - QString text; + TQString text; switch (paymentType) { case MyMoneySchedule::STYPE_DIRECTDEBIT: @@ -949,7 +949,7 @@ QString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE pay case MyMoneySchedule::STYPE_OTHER: text = I18N_NOOP("Other"); break; - case MyMoneySchedule::STYPE_WRITECHEQUE: + case MyMoneySchedule::STYPE_WRITECHETQUE: text = I18N_NOOP("Write check"); break; case MyMoneySchedule::STYPE_STANDINGORDER: @@ -965,9 +965,9 @@ QString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE pay return text; } -QString MyMoneySchedule::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) +TQString MyMoneySchedule::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) { - QString text; + TQString text; switch (weekendOption) { case MyMoneySchedule::MoveFriday: @@ -995,7 +995,7 @@ int MyMoneySchedule::variation(void) const if(!isFixed()) { rc = 10; #if 0 - QString var = value("kmm-variation"); + TQString var = value("kmm-variation"); if(!var.isEmpty()) rc = var.toInt(); #endif @@ -1008,7 +1008,7 @@ void MyMoneySchedule::setVariation(int var) #if 0 deletePair("kmm-variation"); if(var != 0) - setValue("kmm-variation", QString("%1").arg(var)); + setValue("kmm-variation", TQString("%1").tqarg(var)); #endif } @@ -1049,7 +1049,7 @@ int MyMoneySchedule::eventsPerYear(MyMoneySchedule::occurenceE occurence) rc = 6; break; case MyMoneySchedule::OCCUR_EVERYTHREEMONTHS: - case MyMoneySchedule::OCCUR_QUARTERLY: + case MyMoneySchedule::OCCUR_TQUARTERLY: rc = 4; break; case MyMoneySchedule::OCCUR_EVERYFOURMONTHS: @@ -1107,7 +1107,7 @@ int MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::occurenceE occurence) rc = 60; break; case MyMoneySchedule::OCCUR_EVERYTHREEMONTHS: - case MyMoneySchedule::OCCUR_QUARTERLY: + case MyMoneySchedule::OCCUR_TQUARTERLY: rc = 90; break; case MyMoneySchedule::OCCUR_EVERYFOURMONTHS: @@ -1126,9 +1126,9 @@ int MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::occurenceE occurence) return rc; } -QDate MyMoneySchedule::addHalfMonths( QDate date, int mult ) const +TQDate MyMoneySchedule::addHalfMonths( TQDate date, int mult ) const { - QDate newdate = date; + TQDate newdate = date; int d, dm; if ( mult > 0 ) { @@ -1184,10 +1184,10 @@ QDate MyMoneySchedule::addHalfMonths( QDate date, int mult ) const return newdate; } -MyMoneySchedule::occurenceE MyMoneySchedule::stringToOccurence(const QString& text) +MyMoneySchedule::occurenceE MyMoneySchedule::stringToOccurence(const TQString& text) { MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY; - QString tmp = text.lower(); + TQString tmp = text.lower(); if(tmp == i18n("Once").lower()) occurence = MyMoneySchedule::OCCUR_ONCE; @@ -1216,7 +1216,7 @@ MyMoneySchedule::occurenceE MyMoneySchedule::stringToOccurence(const QString& te else if(tmp == i18n("Every three months").lower()) occurence = MyMoneySchedule::OCCUR_EVERYTHREEMONTHS; else if(tmp == i18n("Quarterly").lower()) - occurence = MyMoneySchedule::OCCUR_QUARTERLY; + occurence = MyMoneySchedule::OCCUR_TQUARTERLY; else if(tmp == i18n("Every four months").lower()) occurence = MyMoneySchedule::OCCUR_EVERYFOURMONTHS; else if(tmp == i18n("Twice yearly").lower()) @@ -1279,7 +1279,7 @@ void MyMoneySchedule::simpleToCompoundOccurence(int& multiplier,occurenceE& occu newMulti = 2; } else if(occurence == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS || - occurence == MyMoneySchedule::OCCUR_QUARTERLY ) + occurence == MyMoneySchedule::OCCUR_TQUARTERLY ) { newOcc = MyMoneySchedule::OCCUR_MONTHLY; newMulti = 3; diff --git a/kmymoney2/mymoney/mymoneyscheduled.h b/kmymoney2/mymoney/mymoneyscheduled.h index 46303b2..cc92b1d 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.h +++ b/kmymoney2/mymoney/mymoneyscheduled.h @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- @@ -68,7 +68,7 @@ public: OCCUR_MONTHLY=32, OCCUR_EVERYFOURWEEKS=64, OCCUR_EVERYEIGHTWEEKS=126, OCCUR_EVERYOTHERMONTH=128, OCCUR_EVERYTHREEMONTHS=256, - OCCUR_TWICEYEARLY=1024, OCCUR_EVERYOTHERYEAR=2048, OCCUR_QUARTERLY=4096, + OCCUR_TWICEYEARLY=1024, OCCUR_EVERYOTHERYEAR=2048, OCCUR_TQUARTERLY=4096, OCCUR_EVERYFOURMONTHS=8192, OCCUR_YEARLY=16384 }; @@ -82,7 +82,7 @@ public: */ enum paymentTypeE { STYPE_ANY=0, STYPE_DIRECTDEBIT=1, STYPE_DIRECTDEPOSIT=2, STYPE_MANUALDEPOSIT=4, STYPE_OTHER=8, - STYPE_WRITECHEQUE=16, + STYPE_WRITECHETQUE=16, STYPE_STANDINGORDER=32, STYPE_BANKTRANSFER=64 }; @@ -105,14 +105,14 @@ public: * Please note that the optional fields are not set and the transaction * MUST be set before it can be used. * - * @a startDate is not used anymore and internally set to QDate() + * @a startDate is not used anymore and internally set to TQDate() */ - MyMoneySchedule(const QString& name, typeE type, occurenceE occurence, int occurenceMultiplier, - paymentTypeE paymentType, const QDate& startDate, const QDate& endDate, bool fixed, bool autoEnter); + MyMoneySchedule(const TQString& name, typeE type, occurenceE occurence, int occurenceMultiplier, + paymentTypeE paymentType, const TQDate& startDate, const TQDate& endDate, bool fixed, bool autoEnter); - MyMoneySchedule(const QDomElement& node); + MyMoneySchedule(const TQDomElement& node); - MyMoneySchedule(const QString& id, const MyMoneySchedule& right); + MyMoneySchedule(const TQString& id, const MyMoneySchedule& right); /** * Standard destructor @@ -155,9 +155,9 @@ public: * execution is returned. Otherwise, the next due date is * returned. * - * @return reference to QDate containing the start date. + * @return reference to TQDate containing the start date. */ - const QDate& startDate(void) const; + const TQDate& startDate(void) const; /** * Simple get method that returns the schedule paymentType. @@ -191,9 +191,9 @@ public: /** * Simple get method that returns the schedule end date. * - * @return QDate The end date for the instance. + * @return TQDate The end date for the instance. */ - const QDate& endDate(void) const { return m_endDate; } + const TQDate& endDate(void) const { return m_endDate; } /** * Simple get method that returns true if the transaction should be @@ -212,43 +212,43 @@ public: /** * Simple method that returns the schedules last payment. If the - * schedule has never been executed, QDate() will be returned. + * schedule has never been executed, TQDate() will be returned. * - * @return QDate The last payment for the schedule. + * @return TQDate The last payment for the schedule. */ - const QDate& lastPayment(void) const { return m_lastPayment; } + const TQDate& lastPayment(void) const { return m_lastPayment; } /** * Simple method that returns the next due date for the schedule. * - * @return reference to QDate containing the next due date. + * @return reference to TQDate containing the next due date. * * @note The date returned can represent a value that is past * a possible end of the schedule. Make sure to consider * the return value of isFinished() when using the value returned. */ - const QDate& nextDueDate(void) const; + const TQDate& nextDueDate(void) const; /** * This method adjusts returns the next due date adjusted * according to the rules specified by the schedule's weekend option. * - * @return QDate containing the adjusted next due date. If the + * @return TQDate containing the adjusted next due date. If the * schedule is finished (@sa isFinished()) then the method - * returns an invalid QDate. + * returns an invalid TQDate. * * @sa weekendOption() * @sa adjustedDate() */ - QDate adjustedNextDueDate(void) const; + TQDate adjustedNextDueDate(void) const; /** * This method adjusts returns the date adjusted according to the * rules specified by the schedule's weekend option. * - * @return QDate containing the adjusted date. + * @return TQDate containing the adjusted date. */ - QDate adjustedDate(QDate date, weekendOptionE option) const; + TQDate adjustedDate(TQDate date, weekendOptionE option) const; /** * Get the weekendOption that determines how the schedule check code @@ -296,7 +296,7 @@ public: * @param date The new start date. * @return none */ - void setStartDate(const QDate& date); + void setStartDate(const TQDate& date); /** * Simple method that sets the payment type for the schedule. @@ -330,7 +330,7 @@ public: * @param date The new end date. * @return none */ - void setEndDate(const QDate& date); + void setEndDate(const TQDate& date); /** * Simple set method to set whether this transaction should be automatically @@ -348,7 +348,7 @@ public: * @param date The next payment date. * @return none */ - void setNextDueDate(const QDate& date); + void setNextDueDate(const TQDate& date); /** * Simple set method to set the schedule's last payment. If @@ -360,7 +360,7 @@ public: * @param date The last payment date. * @return none */ - void setLastPayment(const QDate& date); + void setLastPayment(const TQDate& date); /** * Set the weekendOption that determines how the schedule check code @@ -404,12 +404,12 @@ public: * @param refDate The reference date from which the next payment * date will be calculated (defaults to current date) * - * @return QDate The adjusted date the next payment is due. This date is + * @return TQDate The adjusted date the next payment is due. This date is * always past @a refDate. In case of an error or if there - * are no more payments then an empty/invalid QDate() will + * are no more payments then an empty/invalid TQDate() will * be returned. */ - QDate adjustedNextPayment(const QDate& refDate = QDate::currentDate()) const; + TQDate adjustedNextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const; /** * Calculates the date of the next payment. @@ -417,12 +417,12 @@ public: * @param refDate The reference date from which the next payment * date will be calculated (defaults to current date) * - * @return QDate The date the next payment is due. This date is + * @return TQDate The date the next payment is due. This date is * always past @a refDate. In case of an error or - * if there is no more payments then an empty/invalid QDate() + * if there is no more payments then an empty/invalid TQDate() * will be returned. */ - QDate nextPayment(const QDate& refDate = QDate::currentDate()) const; + TQDate nextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const; /** * Calculates the dates of the payment over a certain period of time. @@ -431,16 +431,16 @@ public: * * @param startDate The start date for the range calculations * @param endDate The end date for the range calculations. - * @return QValueList The dates on which the payments are due. + * @return TQValueList The dates on which the payments are due. */ - QValueList paymentDates(const QDate& startDate, const QDate& endDate) const; + TQValueList paymentDates(const TQDate& startDate, const TQDate& endDate) const; /** * Returns the instances name * * @return The name */ - const QString& name(void) const { return m_name; } + const TQString& name(void) const { return m_name; } /** * Changes the instance name @@ -448,7 +448,7 @@ public: * @param nm The new name * @return none */ - void setName(const QString& nm); + void setName(const TQString& nm); bool operator ==(const MyMoneySchedule& right) const; bool operator !=(const MyMoneySchedule& right) const { return ! operator==(right); } @@ -457,15 +457,15 @@ public: MyMoneyAccount account(int cnt = 1) const; MyMoneyAccount transferAccount(void) const { return account(2); }; - QDate dateAfter(int transactions) const; + TQDate dateAfter(int transactions) const; bool isOverdue() const; bool isFinished() const; - bool hasRecordedPayment(const QDate&) const; - void recordPayment(const QDate&); - QValueList recordedPayments(void) const { return m_recordedPayments; } + bool hasRecordedPayment(const TQDate&) const; + void recordPayment(const TQDate&); + TQValueList recordedPayments(void) const { return m_recordedPayments; } - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -476,14 +476,14 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * Returns the human-readable format of Schedule's occurence * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - QString occurenceToString() const; + TQString occurenceToString() const; /** * This method is used to convert the occurence type from it's @@ -492,9 +492,9 @@ public: * @param type numerical representation of the MyMoneySchedule * occurence type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString occurenceToString(occurenceE type); + static TQString occurenceToString(occurenceE type); /** * This method is used to convert a multiplier and base occurence type @@ -505,9 +505,9 @@ public: * @param mult occurence multiplier * @param type occurence period * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString occurenceToString(int mult, occurenceE type); + static TQString occurenceToString(int mult, occurenceE type); /** * This method is used to convert an occurence period from @@ -516,9 +516,9 @@ public: * @param type numerical representation of the MyMoneySchedule * occurence type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString occurencePeriodToString(occurenceE type); + static TQString occurencePeriodToString(occurenceE type); /** * This method is used to convert the payment type from it's @@ -527,9 +527,9 @@ public: * @param paymentType numerical representation of the MyMoneySchedule * payment type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType); + static TQString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType); /** * This method is used to convert the schedule weekend option from it's @@ -538,9 +538,9 @@ public: * @param weekendOption numerical representation of the MyMoneySchedule * weekend option * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption); + static TQString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption); /** * This method is used to convert the schedule type from it's @@ -549,9 +549,9 @@ public: * @param type numerical representation of the MyMoneySchedule * schedule type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString scheduleTypeToString(MyMoneySchedule::typeE type); + static TQString scheduleTypeToString(MyMoneySchedule::typeE type); int variation(void) const; void setVariation(int var); @@ -600,10 +600,10 @@ public: * This method is used to convert the occurence type from the * human readable form into it's internal representation. * - * @param text reference to QString representing the human readable format + * @param text reference to TQString representing the human readable format * @return numerical representation of the occurence */ - static MyMoneySchedule::occurenceE stringToOccurence(const QString& text); + static MyMoneySchedule::occurenceE stringToOccurence(const TQString& text); private: /** @@ -612,9 +612,9 @@ private: * in m_startDate. It is internally used when calculating * the payment dates over several periods. * - * @param date reference to QDate object to be checked and adjusted + * @param date reference to TQDate object to be checked and adjusted */ - void fixDate(QDate& date) const; + void fixDate(TQDate& date) const; /** * Simple method that sets the transaction for the schedule. @@ -648,9 +648,9 @@ private: * @param date The date * @param mult The number of half months to add. Default is 1. * - * @return QDate date with mult half months added + * @return TQDate date with mult half months added */ - QDate addHalfMonths( QDate date, int mult = 1 ) const; + TQDate addHalfMonths( TQDate date, int mult = 1 ) const; private: /// Its occurence @@ -663,7 +663,7 @@ private: typeE m_type; /// The date the schedule commences - QDate m_startDate; + TQDate m_startDate; /// The payment type paymentTypeE m_paymentType; @@ -675,19 +675,19 @@ private: MyMoneyTransaction m_transaction; /// The last transaction date if the schedule does end at a fixed date - QDate m_endDate; + TQDate m_endDate; /// Enter the transaction into the register automatically bool m_autoEnter; /// Internal date used for calculations - QDate m_lastPayment; + TQDate m_lastPayment; /// The name - QString m_name; + TQString m_name; /// The recorded payments - QValueList m_recordedPayments; + TQValueList m_recordedPayments; /// The weekend option weekendOptionE m_weekendOption; diff --git a/kmymoney2/mymoney/mymoneyscheduletest.cpp b/kmymoney2/mymoney/mymoneyscheduletest.cpp index 0a4a380..07b3cc6 100644 --- a/kmymoney2/mymoney/mymoneyscheduletest.cpp +++ b/kmymoney2/mymoney/mymoneyscheduletest.cpp @@ -55,8 +55,8 @@ void MyMoneyScheduleTest::testConstructor() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate(), - QDate(), + TQDate::tqcurrentDate(), + TQDate(), true, true); @@ -64,7 +64,7 @@ void MyMoneyScheduleTest::testConstructor() { CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_WEEKLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 1 ); CPPUNIT_ASSERT(s.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); - CPPUNIT_ASSERT(s.startDate() == QDate()); + CPPUNIT_ASSERT(s.startDate() == TQDate()); CPPUNIT_ASSERT(s.willEnd() == false); CPPUNIT_ASSERT(s.isFixed() == true); CPPUNIT_ASSERT(s.autoEnter() == true); @@ -82,8 +82,8 @@ void MyMoneyScheduleTest::testSetFunctions() { s.setType(MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(s.type() == MyMoneySchedule::TYPE_BILL); - s.setEndDate(QDate::currentDate()); - CPPUNIT_ASSERT(s.endDate() == QDate::currentDate()); + s.setEndDate(TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(s.endDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(s.willEnd() == true); } @@ -151,7 +151,7 @@ void MyMoneyScheduleTest::testAddSchedule() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(2001, 1, 1), + TQDate(2001, 1, 1), false, true, true); @@ -160,7 +160,7 @@ void MyMoneyScheduleTest::testAddSchedule() MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_MONTHLY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(2001, 2, 1), + TQDate(2001, 2, 1), false, true, true); @@ -168,8 +168,8 @@ void MyMoneyScheduleTest::testAddSchedule() MyMoneySchedule s3( "s3", MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_YEARLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(2001, 3, 1), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(2001, 3, 1), false, true, true); @@ -216,7 +216,7 @@ void MyMoneyScheduleTest::testAnyScheduled() MyMoneySchedule::STYPE_MANUALDEPOSIT)); CPPUNIT_ASSERT(m->anyScheduled("A000001", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, - MyMoneySchedule::STYPE_WRITECHEQUE)); + MyMoneySchedule::STYPE_WRITECHETQUE)); // Failures CPPUNIT_ASSERT(m->anyScheduled("A000001", MyMoneySchedule::TYPE_BILL, @@ -229,18 +229,18 @@ void MyMoneyScheduleTest::testOverdue() MyMoneySchedule sch_overdue; MyMoneySchedule sch_intime; - // the following checks only work correctly, if currentDate() is + // the following checks only work correctly, if tqcurrentDate() is // between the 1st and 27th. If it is between 28th and 31st // we don't perform them. Note: this should be fixed. - if(QDate::currentDate().day() > 27 || QDate::currentDate().day() == 1) { + if(TQDate::tqcurrentDate().day() > 27 || TQDate::tqcurrentDate().day() == 1) { std::cout << std::endl << "testOverdue() skipped because current day is between 28th and 2nd" << std::endl; return; } - QDate startDate = QDate::currentDate().addDays(-1).addMonths(-23); - QDate lastPaymentDate = QDate::currentDate().addDays(-1).addMonths(-1); + TQDate startDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-23); + TQDate lastPaymentDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-1); - QString ref = QString( + TQString ref = TQString( "\n" "\n" " \n" @@ -258,16 +258,16 @@ void MyMoneyScheduleTest::testOverdue() " \n" " \n" "\n"); - QString ref_overdue = ref.arg(startDate.toString(Qt::ISODate)) - .arg(lastPaymentDate.toString(Qt::ISODate)) - .arg(lastPaymentDate.toString(Qt::ISODate)); + TQString ref_overdue = ref.tqarg(startDate.toString(Qt::ISODate)) + .tqarg(lastPaymentDate.toString(Qt::ISODate)) + .tqarg(lastPaymentDate.toString(Qt::ISODate)); - QString ref_intime = ref.arg(startDate.addDays(1).toString(Qt::ISODate)) - .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate)) - .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate)); + TQString ref_intime = ref.tqarg(startDate.addDays(1).toString(Qt::ISODate)) + .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate)) + .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; // std::cout << ref_intime << std::endl; try { @@ -318,7 +318,7 @@ void MyMoneyScheduleTest::testGetSchedule() CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_MONTHLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 1); CPPUNIT_ASSERT(s.paymentType() == MyMoneySchedule::STYPE_MANUALDEPOSIT); - CPPUNIT_ASSERT(s.startDate() == QDate(2001, 2, 1)); + CPPUNIT_ASSERT(s.startDate() == TQDate(2001, 2, 1)); CPPUNIT_ASSERT(s.willEnd() == false); CPPUNIT_ASSERT(s.isFixed() == true); CPPUNIT_ASSERT(s.autoEnter() == true); @@ -344,7 +344,7 @@ void MyMoneyScheduleTest::testGetScheduled() try { - QValueList testList; + TQValueList testList; testList = m->getScheduled("A000001"); CPPUNIT_ASSERT(testList.size() == 3); @@ -370,7 +370,7 @@ void MyMoneyScheduleTest::testGetScheduled() CPPUNIT_ASSERT(testList.size() == 1); CPPUNIT_ASSERT(testList[0] == "SCHED00002"); - testList = m->getScheduled("A000001", QDate(2001, 1, 1), QDate(2001, 2, 1)); + testList = m->getScheduled("A000001", TQDate(2001, 1, 1), TQDate(2001, 2, 1)); CPPUNIT_ASSERT(testList.size() == 2); CPPUNIT_ASSERT(testList[0] == "SCHED00001"); CPPUNIT_ASSERT(testList[1] == "SCHED00002"); @@ -392,7 +392,7 @@ void MyMoneyScheduleTest::testGetOverdue() try { - QValueList testList; + TQValueList testList; testList = m->getOverdue("A000001"); CPPUNIT_ASSERT(testList.size() == 3); @@ -433,7 +433,7 @@ void MyMoneyScheduleTest::testNextPayment() */ { MyMoneySchedule sch; - QString future_sched = QString( + TQString future_sched = TQString( "\n" "\n" "\n" @@ -449,16 +449,16 @@ void MyMoneyScheduleTest::testNextPayment() "\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(future_sched); node = doc.documentElement().firstChild().toElement(); try { sch = MyMoneySchedule(node); - CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,14)) == QDate(2007,2,17)); - CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,17)) == QDate(2008,2,17)); - CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,18)) == QDate(2008,2,17)); + CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,14)) == TQDate(2007,2,17)); + CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,17)) == TQDate(2008,2,17)); + CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,18)) == TQDate(2008,2,17)); } catch(MyMoneyException *e) { delete e; @@ -474,9 +474,9 @@ void MyMoneyScheduleTest::testNextPayment() MyMoneySchedule s2 = m->getSchedule("A000001", "SCHED00002"); MyMoneySchedule s3 = m->getSchedule("A000001", "SCHED00003"); - QDate nextPayment1 = s1.nextPayment(); - QDate nextPayment2 = s2.nextPayment(); - QDate nextPayment3 = s3.nextPayment(); + TQDate nextPayment1 = s1.nextPayment(); + TQDate nextPayment2 = s2.nextPayment(); + TQDate nextPayment3 = s3.nextPayment(); CPPUNIT_ASSERT(nextPayment1.year() != 1900); CPPUNIT_ASSERT(nextPayment2.year() != 1900); @@ -494,148 +494,148 @@ void MyMoneyScheduleTest::testAddHalfMonths() // addHalfMonths is private // Test a Schedule with occurence OCCUR_EVERYHALFMONTH using nextPayment MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setOccurence(MyMoneySchedule::OCCUR_EVERYHALFMONTH); s.setNextDueDate(s.startDate()); s.setLastPayment(s.startDate()); - QString format("yyyy-MM-dd"); + TQString format("yyyy-MM-dd"); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-16" ); - s.setNextDueDate(QDate(2007, 1, 2)); + s.setNextDueDate(TQDate(2007, 1, 2)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-17" ); - s.setNextDueDate(QDate(2007, 1, 3)); + s.setNextDueDate(TQDate(2007, 1, 3)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-18" ); - s.setNextDueDate(QDate(2007, 1, 4)); + s.setNextDueDate(TQDate(2007, 1, 4)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-19" ); - s.setNextDueDate(QDate(2007, 1, 5)); + s.setNextDueDate(TQDate(2007, 1, 5)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-20" ); - s.setNextDueDate(QDate(2007, 1, 6)); + s.setNextDueDate(TQDate(2007, 1, 6)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-21" ); - s.setNextDueDate(QDate(2007, 1, 7)); + s.setNextDueDate(TQDate(2007, 1, 7)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-22" ); - s.setNextDueDate(QDate(2007, 1, 8)); + s.setNextDueDate(TQDate(2007, 1, 8)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-23" ); - s.setNextDueDate(QDate(2007, 1, 9)); + s.setNextDueDate(TQDate(2007, 1, 9)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-24" ); - s.setNextDueDate(QDate(2007, 1, 10)); + s.setNextDueDate(TQDate(2007, 1, 10)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-25" ); - s.setNextDueDate(QDate(2007, 1, 11)); + s.setNextDueDate(TQDate(2007, 1, 11)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-26" ); - s.setNextDueDate(QDate(2007, 1, 12)); + s.setNextDueDate(TQDate(2007, 1, 12)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-27" ); - s.setNextDueDate(QDate(2007, 1, 13)); + s.setNextDueDate(TQDate(2007, 1, 13)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-28" ); - s.setNextDueDate(QDate(2007, 1, 14)); + s.setNextDueDate(TQDate(2007, 1, 14)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-29" ); // 15 -> Last Day - s.setNextDueDate(QDate(2007, 1, 15)); + s.setNextDueDate(TQDate(2007, 1, 15)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-31" ); - s.setNextDueDate(QDate(2007, 1, 16)); + s.setNextDueDate(TQDate(2007, 1, 16)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-01" ); - s.setNextDueDate(QDate(2007, 1, 17)); + s.setNextDueDate(TQDate(2007, 1, 17)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-02" ); - s.setNextDueDate(QDate(2007, 1, 18)); + s.setNextDueDate(TQDate(2007, 1, 18)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-03" ); - s.setNextDueDate(QDate(2007, 1, 19)); + s.setNextDueDate(TQDate(2007, 1, 19)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-04" ); - s.setNextDueDate(QDate(2007, 1, 20)); + s.setNextDueDate(TQDate(2007, 1, 20)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-05" ); - s.setNextDueDate(QDate(2007, 1, 21)); + s.setNextDueDate(TQDate(2007, 1, 21)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-06" ); - s.setNextDueDate(QDate(2007, 1, 22)); + s.setNextDueDate(TQDate(2007, 1, 22)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-07" ); - s.setNextDueDate(QDate(2007, 1, 23)); + s.setNextDueDate(TQDate(2007, 1, 23)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-08" ); - s.setNextDueDate(QDate(2007, 1, 24)); + s.setNextDueDate(TQDate(2007, 1, 24)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-09" ); - s.setNextDueDate(QDate(2007, 1, 25)); + s.setNextDueDate(TQDate(2007, 1, 25)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-10" ); - s.setNextDueDate(QDate(2007, 1, 26)); + s.setNextDueDate(TQDate(2007, 1, 26)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-11" ); - s.setNextDueDate(QDate(2007, 1, 27)); + s.setNextDueDate(TQDate(2007, 1, 27)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-12" ); - s.setNextDueDate(QDate(2007, 1, 28)); + s.setNextDueDate(TQDate(2007, 1, 28)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-13" ); - s.setNextDueDate(QDate(2007, 1, 29)); + s.setNextDueDate(TQDate(2007, 1, 29)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-14" ); // 30th,31st -> 15th - s.setNextDueDate(QDate(2007, 1, 30)); + s.setNextDueDate(TQDate(2007, 1, 30)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-15" ); - s.setNextDueDate(QDate(2007, 1, 31)); + s.setNextDueDate(TQDate(2007, 1, 31)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-15" ); // 30th (last day) - s.setNextDueDate(QDate(2007, 4, 30)); + s.setNextDueDate(TQDate(2007, 4, 30)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-05-15" ); // 28th of February (Last day): to 15th - s.setNextDueDate(QDate(1900, 2, 28)); + s.setNextDueDate(TQDate(1900, 2, 28)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "1900-03-15" ); // 28th of February (Leap year): to 13th - s.setNextDueDate(QDate(2000, 2, 28)); + s.setNextDueDate(TQDate(2000, 2, 28)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2000-03-13" ); // 29th of February (Leap year) - s.setNextDueDate(QDate(2000, 2, 29)); + s.setNextDueDate(TQDate(2000, 2, 29)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2000-03-15" ); // Add multiple transactions - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-16" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-01" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-16" ); - s.setStartDate(QDate(2007, 1, 12)); + s.setStartDate(TQDate(2007, 1, 12)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-27" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-12" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-27" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-12" ); - s.setStartDate(QDate(2007, 1, 13)); + s.setStartDate(TQDate(2007, 1, 13)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-28" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-13" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" ); - s.setStartDate(QDate(2007, 1, 14)); + s.setStartDate(TQDate(2007, 1, 14)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-29" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-14" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" ); - s.setStartDate(QDate(2007, 1, 15)); + s.setStartDate(TQDate(2007, 1, 15)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-31" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-15" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" ); - s.setStartDate(QDate(2007, 1, 16)); + s.setStartDate(TQDate(2007, 1, 16)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-01" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-16" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-01" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-16" ); - s.setStartDate(QDate(2007, 1, 27)); + s.setStartDate(TQDate(2007, 1, 27)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-12" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-27" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-12" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-27" ); - s.setStartDate(QDate(2007, 1, 28)); + s.setStartDate(TQDate(2007, 1, 28)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-13" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 1, 29)); + s.setStartDate(TQDate(2007, 1, 29)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-14" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 1, 30)); + s.setStartDate(TQDate(2007, 1, 30)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-15" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 1, 31)); + s.setStartDate(TQDate(2007, 1, 31)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-15" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 4, 29)); + s.setStartDate(TQDate(2007, 4, 29)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-05-14" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-05-29" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-06-14" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-06-29" ); - s.setStartDate(QDate(2007, 4, 30)); + s.setStartDate(TQDate(2007, 4, 30)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-05-15" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-05-31" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-06-15" ); @@ -645,7 +645,7 @@ void MyMoneyScheduleTest::testAddHalfMonths() void MyMoneyScheduleTest::testPaymentDates() { MyMoneySchedule sch; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" @@ -663,23 +663,23 @@ void MyMoneyScheduleTest::testPaymentDates() "\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); - QDate startDate(2006,1,28); - QDate endDate(2006,5,30); + TQDate startDate(2006,1,28); + TQDate endDate(2006,5,30); try { sch = MyMoneySchedule(node); - QDate nextPayment = sch.nextPayment(startDate); - QValueList list = sch.paymentDates(nextPayment, endDate); + TQDate nextPayment = sch.nextPayment(startDate); + TQValueList list = sch.paymentDates(nextPayment, endDate); CPPUNIT_ASSERT(list.count() == 3); - CPPUNIT_ASSERT(list[0] == QDate(2006,2,28)); - CPPUNIT_ASSERT(list[1] == QDate(2006,3,31)); + CPPUNIT_ASSERT(list[0] == TQDate(2006,2,28)); + CPPUNIT_ASSERT(list[1] == TQDate(2006,3,31)); // Would fall on a Sunday so gets moved back to 28th. - CPPUNIT_ASSERT(list[2] == QDate(2006,4,28)); + CPPUNIT_ASSERT(list[2] == TQDate(2006,4,28)); // Add tests for each possible occurence. // Check how paymentDates is meant to work @@ -692,7 +692,7 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list[0] == QDate(2009,1,1)); + CPPUNIT_ASSERT(list[0] == TQDate(2009,1,1)); // MyMoneySchedule::OCCUR_DAILY sch.setOccurence(MyMoneySchedule::OCCUR_DAILY); startDate.setYMD(2009,1,1); @@ -701,20 +701,20 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 1)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 1)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 1, 2)); // Would fall on Saturday so gets moved to 2nd. - CPPUNIT_ASSERT(list[2] == QDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 1, 2)); // Would fall on Sunday so gets moved to 2nd. - CPPUNIT_ASSERT(list[3] == QDate(2009, 1, 2)); - CPPUNIT_ASSERT(list[4] == QDate(2009, 1, 5)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 1, 5)); // MyMoneySchedule::OCCUR_DAILY with multiplier 2 sch.setOccurenceMultiplier(2); list = sch.paymentDates(startDate.addDays(1),endDate); CPPUNIT_ASSERT(list.count() == 2); // Would fall on Sunday so gets moved to 2nd. - CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 2)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 1, 5)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 1, 5)); sch.setOccurenceMultiplier(1); // MyMoneySchedule::OCCUR_WEEKLY sch.setOccurence(MyMoneySchedule::OCCUR_WEEKLY); @@ -724,11 +724,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 6)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 1,13)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 1,20)); - CPPUNIT_ASSERT(list[3] == QDate(2009, 1,27)); - CPPUNIT_ASSERT(list[4] == QDate(2009, 2, 3)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 6)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 1,13)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 1,20)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 1,27)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 2, 3)); // MyMoneySchedule::OCCUR_EVERYOTHERWEEK sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERWEEK); startDate.setYMD(2009,2,5); @@ -737,11 +737,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 2, 5)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 2,19)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 3, 5)); - CPPUNIT_ASSERT(list[3] == QDate(2009, 3,19)); - CPPUNIT_ASSERT(list[4] == QDate(2009, 4, 2)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 2, 5)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 2,19)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 3, 5)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 3,19)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 4, 2)); // MyMoneySchedule::OCCUR_FORTNIGHTLY sch.setOccurence(MyMoneySchedule::OCCUR_FORTNIGHTLY); startDate.setYMD(2009,4,4); @@ -753,13 +753,13 @@ void MyMoneyScheduleTest::testPaymentDates() // First one would fall on a Saturday and would get moved // to 3rd which is before start date so is not in list. // Would fall on a Saturday so gets moved to 17th. - CPPUNIT_ASSERT(list[0] == QDate(2009, 4,17)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 4,17)); // Would fall on a Saturday so gets moved to 1st. - CPPUNIT_ASSERT(list[1] == QDate(2009, 5, 1)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 5, 1)); // Would fall on a Saturday so gets moved to 15th. - CPPUNIT_ASSERT(list[2] == QDate(2009, 5,15)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 5,15)); // Would fall on a Saturday so gets moved to 29th. - CPPUNIT_ASSERT(list[3] == QDate(2009, 5,29)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 5,29)); // MyMoneySchedule::OCCUR_EVERYHALFMONTH sch.setOccurence(MyMoneySchedule::OCCUR_EVERYHALFMONTH); startDate.setYMD(2009,6,1); @@ -768,12 +768,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 6, 1)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 6,16)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 7, 1)); - CPPUNIT_ASSERT(list[3] == QDate(2009, 7,16)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 6, 1)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 6,16)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 7, 1)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 7,16)); // Would fall on a Saturday so gets moved to 31st. - CPPUNIT_ASSERT(list[4] == QDate(2009, 7, 31)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 7, 31)); // MyMoneySchedule::OCCUR_EVERYTHREEWEEKS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS); startDate.setYMD(2009,8,12); @@ -782,11 +782,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 8,12)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 9, 2)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 9,23)); - CPPUNIT_ASSERT(list[3] == QDate(2009,10,14)); - CPPUNIT_ASSERT(list[4] == QDate(2009,11, 4)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 8,12)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 9, 2)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 9,23)); + CPPUNIT_ASSERT(list[3] == TQDate(2009,10,14)); + CPPUNIT_ASSERT(list[4] == TQDate(2009,11, 4)); // MyMoneySchedule::OCCUR_EVERYFOURWEEKS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURWEEKS); startDate.setYMD(2009,11,13); @@ -795,11 +795,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009,11,13)); - CPPUNIT_ASSERT(list[1] == QDate(2009,12,11)); - CPPUNIT_ASSERT(list[2] == QDate(2010, 1, 8)); - CPPUNIT_ASSERT(list[3] == QDate(2010, 2, 5)); - CPPUNIT_ASSERT(list[4] == QDate(2010, 3, 5)); + CPPUNIT_ASSERT(list[0] == TQDate(2009,11,13)); + CPPUNIT_ASSERT(list[1] == TQDate(2009,12,11)); + CPPUNIT_ASSERT(list[2] == TQDate(2010, 1, 8)); + CPPUNIT_ASSERT(list[3] == TQDate(2010, 2, 5)); + CPPUNIT_ASSERT(list[4] == TQDate(2010, 3, 5)); // MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS); startDate.setYMD(2010,3,19); @@ -808,13 +808,13 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2010, 3,19)); + CPPUNIT_ASSERT(list[0] == TQDate(2010, 3,19)); // Would fall on a Sunday so gets moved to 16th. - CPPUNIT_ASSERT(list[1] == QDate(2010, 4,16)); - CPPUNIT_ASSERT(list[2] == QDate(2010, 5,18)); - CPPUNIT_ASSERT(list[3] == QDate(2010, 6,17)); + CPPUNIT_ASSERT(list[1] == TQDate(2010, 4,16)); + CPPUNIT_ASSERT(list[2] == TQDate(2010, 5,18)); + CPPUNIT_ASSERT(list[3] == TQDate(2010, 6,17)); // Would fall on a Saturday so gets moved to 16th. - CPPUNIT_ASSERT(list[4] == QDate(2010, 7,16)); + CPPUNIT_ASSERT(list[4] == TQDate(2010, 7,16)); // MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS); startDate.setYMD(2010,7,26); @@ -823,11 +823,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2010, 7,26)); - CPPUNIT_ASSERT(list[1] == QDate(2010, 9,20)); - CPPUNIT_ASSERT(list[2] == QDate(2010,11,15)); - CPPUNIT_ASSERT(list[3] == QDate(2011, 1,10)); - CPPUNIT_ASSERT(list[4] == QDate(2011, 3, 7)); + CPPUNIT_ASSERT(list[0] == TQDate(2010, 7,26)); + CPPUNIT_ASSERT(list[1] == TQDate(2010, 9,20)); + CPPUNIT_ASSERT(list[2] == TQDate(2010,11,15)); + CPPUNIT_ASSERT(list[3] == TQDate(2011, 1,10)); + CPPUNIT_ASSERT(list[4] == TQDate(2011, 3, 7)); // MyMoneySchedule::OCCUR_EVERYOTHERMONTH sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERMONTH); startDate.setYMD(2011,3,14); @@ -836,12 +836,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2011, 3,14)); + CPPUNIT_ASSERT(list[0] == TQDate(2011, 3,14)); // Would fall on a Saturday so gets moved to 13th. - CPPUNIT_ASSERT(list[1] == QDate(2011, 5,13)); - CPPUNIT_ASSERT(list[2] == QDate(2011, 7,14)); - CPPUNIT_ASSERT(list[3] == QDate(2011, 9,14)); - CPPUNIT_ASSERT(list[4] == QDate(2011,11,14)); + CPPUNIT_ASSERT(list[1] == TQDate(2011, 5,13)); + CPPUNIT_ASSERT(list[2] == TQDate(2011, 7,14)); + CPPUNIT_ASSERT(list[3] == TQDate(2011, 9,14)); + CPPUNIT_ASSERT(list[4] == TQDate(2011,11,14)); // MyMoneySchedule::OCCUR_EVERYTHREEMONTHS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); startDate.setYMD(2011,11,15); @@ -850,24 +850,24 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2011,11,15)); - CPPUNIT_ASSERT(list[1] == QDate(2012, 2,15)); - CPPUNIT_ASSERT(list[2] == QDate(2012, 5,15)); - CPPUNIT_ASSERT(list[3] == QDate(2012, 8,15)); - CPPUNIT_ASSERT(list[4] == QDate(2012,11,15)); - // MyMoneySchedule::OCCUR_QUARTERLY - sch.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); + CPPUNIT_ASSERT(list[0] == TQDate(2011,11,15)); + CPPUNIT_ASSERT(list[1] == TQDate(2012, 2,15)); + CPPUNIT_ASSERT(list[2] == TQDate(2012, 5,15)); + CPPUNIT_ASSERT(list[3] == TQDate(2012, 8,15)); + CPPUNIT_ASSERT(list[4] == TQDate(2012,11,15)); + // MyMoneySchedule::OCCUR_TQUARTERLY + sch.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); startDate.setYMD(2012,11,20); endDate.setYMD(2013,11,23); sch.setStartDate(startDate); sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2012,11,20)); - CPPUNIT_ASSERT(list[1] == QDate(2013, 2,20)); - CPPUNIT_ASSERT(list[2] == QDate(2013, 5,20)); - CPPUNIT_ASSERT(list[3] == QDate(2013, 8,20)); - CPPUNIT_ASSERT(list[4] == QDate(2013,11,20)); + CPPUNIT_ASSERT(list[0] == TQDate(2012,11,20)); + CPPUNIT_ASSERT(list[1] == TQDate(2013, 2,20)); + CPPUNIT_ASSERT(list[2] == TQDate(2013, 5,20)); + CPPUNIT_ASSERT(list[3] == TQDate(2013, 8,20)); + CPPUNIT_ASSERT(list[4] == TQDate(2013,11,20)); // MyMoneySchedule::OCCUR_EVERYFOURMONTHS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURMONTHS); startDate.setYMD(2013,11,21); @@ -876,12 +876,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2013,11,21)); - CPPUNIT_ASSERT(list[1] == QDate(2014, 3,21)); - CPPUNIT_ASSERT(list[2] == QDate(2014, 7,21)); - CPPUNIT_ASSERT(list[3] == QDate(2014,11,21)); + CPPUNIT_ASSERT(list[0] == TQDate(2013,11,21)); + CPPUNIT_ASSERT(list[1] == TQDate(2014, 3,21)); + CPPUNIT_ASSERT(list[2] == TQDate(2014, 7,21)); + CPPUNIT_ASSERT(list[3] == TQDate(2014,11,21)); // Would fall on a Saturday so gets moved to 20th. - CPPUNIT_ASSERT(list[4] == QDate(2015, 3,20)); + CPPUNIT_ASSERT(list[4] == TQDate(2015, 3,20)); // MyMoneySchedule::OCCUR_TWICEYEARLY sch.setOccurence(MyMoneySchedule::OCCUR_TWICEYEARLY); startDate.setYMD(2015, 3,22); @@ -892,10 +892,10 @@ void MyMoneyScheduleTest::testPaymentDates() CPPUNIT_ASSERT(list.count() == 4); // First date would fall on a Sunday which would get moved // to 20th which is before start date so not in list. - CPPUNIT_ASSERT(list[0] == QDate(2015, 9,22)); - CPPUNIT_ASSERT(list[1] == QDate(2016, 3,22)); - CPPUNIT_ASSERT(list[2] == QDate(2016, 9,22)); - CPPUNIT_ASSERT(list[3] == QDate(2017, 3,22)); + CPPUNIT_ASSERT(list[0] == TQDate(2015, 9,22)); + CPPUNIT_ASSERT(list[1] == TQDate(2016, 3,22)); + CPPUNIT_ASSERT(list[2] == TQDate(2016, 9,22)); + CPPUNIT_ASSERT(list[3] == TQDate(2017, 3,22)); // MyMoneySchedule::OCCUR_YEARLY sch.setOccurence(MyMoneySchedule::OCCUR_YEARLY); startDate.setYMD(2017, 3,23); @@ -904,12 +904,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2017, 3,23)); - CPPUNIT_ASSERT(list[1] == QDate(2018, 3,23)); + CPPUNIT_ASSERT(list[0] == TQDate(2017, 3,23)); + CPPUNIT_ASSERT(list[1] == TQDate(2018, 3,23)); // Would fall on a Saturday so gets moved to 22nd. - CPPUNIT_ASSERT(list[2] == QDate(2019, 3,22)); - CPPUNIT_ASSERT(list[3] == QDate(2020, 3,23)); - CPPUNIT_ASSERT(list[4] == QDate(2021, 3,23)); + CPPUNIT_ASSERT(list[2] == TQDate(2019, 3,22)); + CPPUNIT_ASSERT(list[3] == TQDate(2020, 3,23)); + CPPUNIT_ASSERT(list[4] == TQDate(2021, 3,23)); // MyMoneySchedule::OCCUR_EVERYOTHERYEAR sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERYEAR); startDate.setYMD(2021, 3,24); @@ -918,12 +918,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2021, 3,24)); - CPPUNIT_ASSERT(list[1] == QDate(2023, 3,24)); - CPPUNIT_ASSERT(list[2] == QDate(2025, 3,24)); - CPPUNIT_ASSERT(list[3] == QDate(2027, 3,24)); + CPPUNIT_ASSERT(list[0] == TQDate(2021, 3,24)); + CPPUNIT_ASSERT(list[1] == TQDate(2023, 3,24)); + CPPUNIT_ASSERT(list[2] == TQDate(2025, 3,24)); + CPPUNIT_ASSERT(list[3] == TQDate(2027, 3,24)); // Would fall on a Saturday so gets moved to 23rd. - CPPUNIT_ASSERT(list[4] == QDate(2029, 3,23)); + CPPUNIT_ASSERT(list[4] == TQDate(2029, 3,23)); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -938,9 +938,9 @@ void MyMoneyScheduleTest::testPaymentDates() MyMoneySchedule s2 = m->getSchedule("A000001", "SCHED00002"); MyMoneySchedule s3 = m->getSchedule("A000001", "SCHED00003"); - QValueList payments1 = s1.paymentDates(QDate(2001, 1, 1), QDate(2001, 2, 1)); - QValueList payments2 = s2.paymentDates(QDate(2001, 2, 1), QDate(2001, 6, 1)); - QValueList payments3 = s3.paymentDates(QDate(2001, 3, 1), QDate(2005, 3, 1)); + TQValueList payments1 = s1.paymentDates(TQDate(2001, 1, 1), TQDate(2001, 2, 1)); + TQValueList payments2 = s2.paymentDates(TQDate(2001, 2, 1), TQDate(2001, 6, 1)); + TQValueList payments3 = s3.paymentDates(TQDate(2001, 3, 1), TQDate(2005, 3, 1)); CPPUNIT_ASSERT(payments1.size() == 5); CPPUNIT_ASSERT(payments2.size() == 5); @@ -985,7 +985,7 @@ void MyMoneyScheduleTest::testRemoveSchedule() try { - QValueList testList; + TQValueList testList; testList = m->getScheduled("A000001"); CPPUNIT_ASSERT(testList.size() == 3); @@ -1010,18 +1010,18 @@ void MyMoneyScheduleTest::testWriteXML() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 123, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate(), - QDate(), + TQDate::tqcurrentDate(), + TQDate(), true, true); - sch.setLastPayment(QDate::currentDate()); - sch.recordPayment(QDate::currentDate()); + sch.setLastPayment(TQDate::tqcurrentDate()); + sch.recordPayment(TQDate::tqcurrentDate()); sch.setId("SCH0001"); MyMoneyTransaction t; - t.setPostDate(QDate(2001,12,28)); - t.setEntryDate(QDate(2003,9,29)); + t.setPostDate(TQDate(2001,12,28)); + t.setEntryDate(TQDate(2003,9,29)); t.setId("T000000000000000001"); t.setMemo("Wohnung:Miete"); t.setCommodity("EUR"); @@ -1047,12 +1047,12 @@ void MyMoneyScheduleTest::testWriteXML() { sch.setTransaction(t); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("SCHEDULE-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("SCHEDULE-CONTAINER"); doc.appendChild(el); sch.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "\n" "\n" " \n" @@ -1070,9 +1070,9 @@ void MyMoneyScheduleTest::testWriteXML() { " \n" " \n" "\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } @@ -1080,7 +1080,7 @@ void MyMoneyScheduleTest::testWriteXML() { void MyMoneyScheduleTest::testReadXML() { MyMoneySchedule sch; - QString ref_ok1 = QString( + TQString ref_ok1 = TQString( "\n" "\n" " \n" @@ -1098,13 +1098,13 @@ void MyMoneyScheduleTest::testReadXML() { " \n" " \n" "\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); // diff to ref_ok1 is that we now have an empty entrydate // in the transaction parameters - QString ref_ok2 = QString( + TQString ref_ok2 = TQString( "\n" "\n" " \n" @@ -1122,11 +1122,11 @@ void MyMoneyScheduleTest::testReadXML() { " \n" " \n" "\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QString ref_false = QString( + TQString ref_false = TQString( "\n" "\n" " \n" @@ -1144,12 +1144,12 @@ void MyMoneyScheduleTest::testReadXML() { " \n" " \n" "\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -1167,13 +1167,13 @@ void MyMoneyScheduleTest::testReadXML() { try { sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.id() == "SCH0002"); - CPPUNIT_ASSERT(sch.nextDueDate() == QDate::currentDate().addDays(7)); - CPPUNIT_ASSERT(sch.startDate() == QDate::currentDate()); - CPPUNIT_ASSERT(sch.endDate() == QDate()); + CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7)); + CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.endDate() == TQDate()); CPPUNIT_ASSERT(sch.autoEnter() == true); CPPUNIT_ASSERT(sch.isFixed() == true); CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing); - CPPUNIT_ASSERT(sch.lastPayment() == QDate::currentDate()); + CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(sch.name() == "A Name"); @@ -1181,7 +1181,7 @@ void MyMoneyScheduleTest::testReadXML() { CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1); CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7)); CPPUNIT_ASSERT(sch.recordedPayments().count() == 1); - CPPUNIT_ASSERT(sch.recordedPayments()[0] == QDate::currentDate()); + CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -1194,13 +1194,13 @@ void MyMoneyScheduleTest::testReadXML() { try { sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.id() == "SCH0002"); - CPPUNIT_ASSERT(sch.nextDueDate() == QDate::currentDate().addDays(7)); - CPPUNIT_ASSERT(sch.startDate() == QDate::currentDate()); - CPPUNIT_ASSERT(sch.endDate() == QDate()); + CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7)); + CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.endDate() == TQDate()); CPPUNIT_ASSERT(sch.autoEnter() == true); CPPUNIT_ASSERT(sch.isFixed() == true); CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing); - CPPUNIT_ASSERT(sch.lastPayment() == QDate::currentDate()); + CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(sch.name() == "A Name"); @@ -1208,7 +1208,7 @@ void MyMoneyScheduleTest::testReadXML() { CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1); CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7)); CPPUNIT_ASSERT(sch.recordedPayments().count() == 1); - CPPUNIT_ASSERT(sch.recordedPayments()[0] == QDate::currentDate()); + CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -1218,7 +1218,7 @@ void MyMoneyScheduleTest::testReadXML() { void MyMoneyScheduleTest::testHasReferenceTo() { MyMoneySchedule sch; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" " \n" @@ -1236,12 +1236,12 @@ void MyMoneyScheduleTest::testHasReferenceTo() " \n" " \n" "\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); @@ -1263,7 +1263,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() { MyMoneySchedule s; - QDate dueDate(2007,9,3); // start on a monday + TQDate dueDate(2007,9,3); // start on a monday for(int i = 0; i < 7; ++i) { s.setNextDueDate(dueDate); s.setWeekendOption(MyMoneySchedule::MoveNothing); @@ -1274,7 +1274,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() case 5: // saturday case 6: // sunday break; - CPPUNIT_ASSERT(s.adjustedNextDueDate() == QDate(2007,9,7)); + CPPUNIT_ASSERT(s.adjustedNextDueDate() == TQDate(2007,9,7)); default: CPPUNIT_ASSERT(s.adjustedNextDueDate() == dueDate); break; @@ -1284,7 +1284,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() switch(i) { case 5: // saturday case 6: // sunday - CPPUNIT_ASSERT(s.adjustedNextDueDate() == QDate(2007,9,10)); + CPPUNIT_ASSERT(s.adjustedNextDueDate() == TQDate(2007,9,10)); break; default: CPPUNIT_ASSERT(s.adjustedNextDueDate() == dueDate); @@ -1297,30 +1297,30 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() void MyMoneyScheduleTest::testModifyNextDueDate(void) { MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setOccurence(MyMoneySchedule::OCCUR_MONTHLY); s.setNextDueDate(s.startDate().addMonths(1)); s.setLastPayment(s.startDate()); - QValueList dates; - dates = s.paymentDates(QDate(2007,2,1), QDate(2007,2,1)); - CPPUNIT_ASSERT(s.nextDueDate() == QDate(2007,2,1)); + TQValueList dates; + dates = s.paymentDates(TQDate(2007,2,1), TQDate(2007,2,1)); + CPPUNIT_ASSERT(s.nextDueDate() == TQDate(2007,2,1)); CPPUNIT_ASSERT(dates.count() == 1); - CPPUNIT_ASSERT(dates[0] == QDate(2007,2,1)); + CPPUNIT_ASSERT(dates[0] == TQDate(2007,2,1)); - s.setNextDueDate(QDate(2007,1,24)); + s.setNextDueDate(TQDate(2007,1,24)); - dates = s.paymentDates(QDate(2007,2,1), QDate(2007,2,1)); - CPPUNIT_ASSERT(s.nextDueDate() == QDate(2007,1,24)); + dates = s.paymentDates(TQDate(2007,2,1), TQDate(2007,2,1)); + CPPUNIT_ASSERT(s.nextDueDate() == TQDate(2007,1,24)); CPPUNIT_ASSERT(dates.count() == 0); - dates = s.paymentDates(QDate(2007,1,24), QDate(2007,1,24)); + dates = s.paymentDates(TQDate(2007,1,24), TQDate(2007,1,24)); CPPUNIT_ASSERT(dates.count() == 1); - dates = s.paymentDates(QDate(2007,1,24), QDate(2007,2,24)); + dates = s.paymentDates(TQDate(2007,1,24), TQDate(2007,2,24)); CPPUNIT_ASSERT(dates.count() == 2); - CPPUNIT_ASSERT(dates[0] == QDate(2007,1,24)); - CPPUNIT_ASSERT(dates[1] == QDate(2007,2,24)); + CPPUNIT_ASSERT(dates[0] == TQDate(2007,1,24)); + CPPUNIT_ASSERT(dates[1] == TQDate(2007,2,24)); } @@ -1339,7 +1339,7 @@ void MyMoneyScheduleTest::testDaysBetweenEvents() CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == 56); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == 60); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == 90); - CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_QUARTERLY) == 90); + CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_TQUARTERLY) == 90); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == 120); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_TWICEYEARLY) == 180); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_YEARLY) == 360); @@ -1349,7 +1349,7 @@ void MyMoneyScheduleTest::testDaysBetweenEvents() void MyMoneyScheduleTest::testStringToOccurence() { // For each occurenceE: - // test MyMoneySchedule::stringToOccurence(QString) == occurence + // test MyMoneySchedule::stringToOccurence(TQString) == occurence CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Once")) == MyMoneySchedule::OCCUR_ONCE ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Daily")) == MyMoneySchedule::OCCUR_DAILY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Weekly")) == MyMoneySchedule::OCCUR_WEEKLY ); @@ -1361,7 +1361,7 @@ void MyMoneyScheduleTest::testStringToOccurence() CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every eight weeks")) == MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every two months")) == MyMoneySchedule::OCCUR_EVERYOTHERMONTH ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every three months")) == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS ); - CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Quarterly")) == MyMoneySchedule::OCCUR_QUARTERLY ); + CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Quarterly")) == MyMoneySchedule::OCCUR_TQUARTERLY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every four months")) == MyMoneySchedule::OCCUR_EVERYFOURMONTHS ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Twice yearly")) == MyMoneySchedule::OCCUR_TWICEYEARLY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Yearly")) == MyMoneySchedule::OCCUR_YEARLY ); @@ -1382,7 +1382,7 @@ void MyMoneyScheduleTest::testStringToOccurence() CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS))) ); - CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))) ); + CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TQUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))) ); @@ -1403,7 +1403,7 @@ void MyMoneyScheduleTest::testEventsPerYear() CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == 6); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == 6); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == 4); - CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_QUARTERLY) == 4); + CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_TQUARTERLY) == 4); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == 3); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_TWICEYEARLY) == 2); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_YEARLY) == 1); @@ -1426,14 +1426,14 @@ void MyMoneyScheduleTest::testOccurenceToString() CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == "Every eight weeks" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == "Every two months" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == "Every three months" ); - CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY) == "Quarterly" ); + CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY) == "Quarterly" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == "Every four months" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == "Twice yearly" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY) == "Yearly" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR) == "Every other year" ); // For each occurenceE set occurence and compare occurenceToString() with oTS(occurence()) MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setNextDueDate(s.startDate()); s.setLastPayment(s.startDate()); s.setOccurence(MyMoneySchedule::OCCUR_ONCE); CPPUNIT_ASSERT(s.occurenceToString() == "Once" ); @@ -1451,7 +1451,7 @@ void MyMoneyScheduleTest::testOccurenceToString() s.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERMONTH); CPPUNIT_ASSERT(s.occurenceToString() == "Every two months" ); s.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" ); // Quarterly no longer used. Every three months used instead - s.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" ); + s.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" ); s.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURMONTHS); CPPUNIT_ASSERT(s.occurenceToString() == "Every four months" ); s.setOccurence(MyMoneySchedule::OCCUR_TWICEYEARLY); CPPUNIT_ASSERT(s.occurenceToString() == "Twice yearly" ); s.setOccurence(MyMoneySchedule::OCCUR_YEARLY); CPPUNIT_ASSERT(s.occurenceToString() == "Yearly" ); @@ -1471,7 +1471,7 @@ void MyMoneyScheduleTest::testOccurenceToString() CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == MyMoneySchedule::occurenceToString(8,MyMoneySchedule::OCCUR_WEEKLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == MyMoneySchedule::occurenceToString(2,MyMoneySchedule::OCCUR_MONTHLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == MyMoneySchedule::occurenceToString(3,MyMoneySchedule::OCCUR_MONTHLY) ); - // OCCUR_QUARTERLY will no longer be used: only Every Three Months + // OCCUR_TQUARTERLY will no longer be used: only Every Three Months CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == MyMoneySchedule::occurenceToString(4,MyMoneySchedule::OCCUR_MONTHLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == MyMoneySchedule::occurenceToString(6,MyMoneySchedule::OCCUR_MONTHLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY) == MyMoneySchedule::occurenceToString(1,MyMoneySchedule::OCCUR_YEARLY) ); @@ -1545,7 +1545,7 @@ void MyMoneyScheduleTest::testOccurencePeriodToString() CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == "Any" ); - CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_QUARTERLY) == "Any" ); + CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_TQUARTERLY) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR) == "Any" ); @@ -1561,7 +1561,7 @@ void MyMoneyScheduleTest::testOccurencePeriod() // Once occurence() and setOccurence() are converting between compound and simple occurences // we need to change the occurence() check and add an occurenceMultiplier() check MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setNextDueDate(s.startDate()); s.setLastPayment(s.startDate()); // Set all base occurences @@ -1730,7 +1730,7 @@ void MyMoneyScheduleTest::testOccurencePeriod() CPPUNIT_ASSERT(s.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 3); // Quarterly no longer used. Every three months used instead - s.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); + s.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); CPPUNIT_ASSERT(s.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 3); @@ -1798,7 +1798,7 @@ void MyMoneyScheduleTest::testSimpleToFromCompoundOccurence() occ = MyMoneySchedule::OCCUR_EVERYTHREEMONTHS; mult = 1; MyMoneySchedule::simpleToCompoundOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_MONTHLY && mult == 3 ); - occ = MyMoneySchedule::OCCUR_QUARTERLY; mult = 1; + occ = MyMoneySchedule::OCCUR_TQUARTERLY; mult = 1; MyMoneySchedule::simpleToCompoundOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_MONTHLY && mult == 3 ); occ = MyMoneySchedule::OCCUR_EVERYFOURMONTHS; mult = 1; @@ -1851,7 +1851,7 @@ void MyMoneyScheduleTest::testSimpleToFromCompoundOccurence() occ = MyMoneySchedule::OCCUR_MONTHLY; mult = 3; MyMoneySchedule::compoundToSimpleOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS && mult == 1 ); - // MyMoneySchedule::OCCUR_QUARTERLY not converted back + // MyMoneySchedule::OCCUR_TQUARTERLY not converted back occ = MyMoneySchedule::OCCUR_MONTHLY; mult = 4; MyMoneySchedule::compoundToSimpleOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_EVERYFOURMONTHS && mult == 1 ); @@ -1872,9 +1872,9 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() // https://bugs.kde.org/show_bug.cgi?id=231029 MyMoneySchedule sch; - QDate paymentInFuture = QDate::currentDate().addDays(7); + TQDate paymentInFuture = TQDate::tqcurrentDate().addDays(7); - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" " \n" @@ -1887,12 +1887,12 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() " \n" " \n" "\n" - ).arg(paymentInFuture.toString(Qt::ISODate)) - .arg(paymentInFuture.toString(Qt::ISODate)) - .arg(paymentInFuture.toString(Qt::ISODate)); + ).tqarg(paymentInFuture.toString(Qt::ISODate)) + .tqarg(paymentInFuture.toString(Qt::ISODate)) + .tqarg(paymentInFuture.toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); @@ -1900,7 +1900,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.isFinished() == true); CPPUNIT_ASSERT(sch.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); - CPPUNIT_ASSERT(sch.paymentDates(QDate::currentDate(), QDate::currentDate().addDays(21)).count() == 0); + CPPUNIT_ASSERT(sch.paymentDates(TQDate::tqcurrentDate(), TQDate::tqcurrentDate().addDays(21)).count() == 0); } catch (MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); diff --git a/kmymoney2/mymoney/mymoneysecurity.cpp b/kmymoney2/mymoney/mymoneysecurity.cpp index 73edbdb..27a1352 100644 --- a/kmymoney2/mymoney/mymoneysecurity.cpp +++ b/kmymoney2/mymoney/mymoneysecurity.cpp @@ -42,7 +42,7 @@ MyMoneySecurity::MyMoneySecurity() : { } -MyMoneySecurity::MyMoneySecurity(const QString& id, const QString& name, const QString& symbol, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) : +MyMoneySecurity::MyMoneySecurity(const TQString& id, const TQString& name, const TQString& symbol, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) : MyMoneyObject(id), m_name(name), m_securityType(SECURITY_CURRENCY) @@ -60,24 +60,24 @@ MyMoneySecurity::MyMoneySecurity(const QString& id, const QString& name, const Q m_smallestAccountFraction = smallestCashFraction; } -MyMoneySecurity::MyMoneySecurity(const QString& id, const MyMoneySecurity& equity) : +MyMoneySecurity::MyMoneySecurity(const TQString& id, const MyMoneySecurity& equity) : MyMoneyObject(id) { *this = equity; m_id = id; } -MyMoneySecurity::MyMoneySecurity(const QDomElement& node) : +MyMoneySecurity::MyMoneySecurity(const TQDomElement& node) : MyMoneyObject(node), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()) { if(("SECURITY" != node.tagName()) - && ("EQUITY" != node.tagName()) + && ("ETQUITY" != node.tagName()) && ("CURRENCY" != node.tagName())) throw new MYMONEYEXCEPTION("Node was not SECURITY or CURRENCY"); - setName(QStringEmpty(node.attribute("name"))); - setTradingSymbol(QStringEmpty(node.attribute("symbol"))); + setName(TQStringEmpty(node.attribute("name"))); + setTradingSymbol(TQStringEmpty(node.attribute("symbol"))); setSecurityType(static_cast(node.attribute("type").toInt())); setSmallestAccountFraction(node.attribute("saf").toInt()); @@ -85,8 +85,8 @@ MyMoneySecurity::MyMoneySecurity(const QDomElement& node) : setPartsPerUnit(node.attribute("ppu").toInt()); setSmallestCashFraction(node.attribute("scf").toInt()); } else { - setTradingCurrency(QStringEmpty(node.attribute("trading-currency"))); - setTradingMarket(QStringEmpty(node.attribute("trading-market"))); + setTradingCurrency(TQStringEmpty(node.attribute("trading-currency"))); + setTradingMarket(TQStringEmpty(node.attribute("trading-market"))); } } @@ -118,14 +118,14 @@ bool MyMoneySecurity::operator < (const MyMoneySecurity& right) const } -bool MyMoneySecurity::hasReferenceTo(const QString& id) const +bool MyMoneySecurity::hasReferenceTo(const TQString& id) const { return (id == m_tradingCurrency); } -void MyMoneySecurity::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneySecurity::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el; + TQDomElement el; if(isCurrency()) el = document.createElement("CURRENCY"); else @@ -148,12 +148,12 @@ void MyMoneySecurity::writeXML(QDomDocument& document, QDomElement& parent) cons //Add in Key-Value Pairs for securities. MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -QString MyMoneySecurity::securityTypeToString(const eSECURITYTYPE securityType) +TQString MyMoneySecurity::securityTypeToString(const eSECURITYTYPE securityType) { - QString returnString; + TQString returnString; switch (securityType) { case MyMoneySecurity::SECURITY_STOCK: diff --git a/kmymoney2/mymoney/mymoneysecurity.h b/kmymoney2/mymoney/mymoneysecurity.h index 666398e..fa49cb8 100644 --- a/kmymoney2/mymoney/mymoneysecurity.h +++ b/kmymoney2/mymoney/mymoneysecurity.h @@ -30,8 +30,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -57,9 +57,9 @@ class KMYMONEY_EXPORT MyMoneySecurity : public MyMoneyObject, public MyMoneyKeyV { public: MyMoneySecurity(); - MyMoneySecurity(const QString& id, const MyMoneySecurity& equity); - MyMoneySecurity(const QString& id, const QString& name, const QString& symbol = QString(), const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); - MyMoneySecurity(const QDomElement& node); + MyMoneySecurity(const TQString& id, const MyMoneySecurity& equity); + MyMoneySecurity(const TQString& id, const TQString& name, const TQString& symbol = TQString(), const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); + MyMoneySecurity(const TQDomElement& node); virtual ~MyMoneySecurity(); bool operator < (const MyMoneySecurity&) const; @@ -86,21 +86,21 @@ public: SECURITY_NONE } eSECURITYTYPE; - const QString& name() const { return m_name; } + const TQString& name() const { return m_name; } void setName(const String& str) { m_name = str; } - const QString& tradingSymbol() const { return m_tradingSymbol; } + const TQString& tradingSymbol() const { return m_tradingSymbol; } void setTradingSymbol(const String& str) { m_tradingSymbol = str; } eSECURITYTYPE securityType() const { return m_securityType; } void setSecurityType(const eSECURITYTYPE& s) { m_securityType = s; } bool isCurrency(void) const { return m_securityType == SECURITY_CURRENCY; }; - const QString& tradingMarket() const { return m_tradingMarket; } - void setTradingMarket(const QString& str) { m_tradingMarket = str; } + const TQString& tradingMarket() const { return m_tradingMarket; } + void setTradingMarket(const TQString& str) { m_tradingMarket = str; } - const QString& tradingCurrency(void) const { return m_tradingCurrency; }; - void setTradingCurrency(const QString& str) { m_tradingCurrency = str; }; + const TQString& tradingCurrency(void) const { return m_tradingCurrency; }; + void setTradingCurrency(const TQString& str) { m_tradingCurrency = str; }; int smallestAccountFraction(void) const { return m_smallestAccountFraction; }; void setSmallestAccountFraction(const int sf) { m_smallestAccountFraction = sf; }; @@ -111,7 +111,7 @@ public: void setPartsPerUnit(const int ppu) { m_partsPerUnit = ppu; }; void setSmallestCashFraction(const int sf) { m_smallestCashFraction = sf; }; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -122,7 +122,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - bool hasReferenceTo(const QString& id) const; + bool hasReferenceTo(const TQString& id) const; /** * This method is used to convert the internal representation of @@ -131,16 +131,16 @@ public: * @param securityType enumerated representation of the security type. * For possible values, see MyMoneySecurity::eSECURITYTYPE * - * @return QString representing the human readable form + * @return TQString representing the human readable form */ - static QString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType); + static TQString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType); protected: - QString m_name; - QString m_tradingSymbol; - QString m_tradingMarket; - QString m_tradingCurrency; + TQString m_name; + TQString m_tradingSymbol; + TQString m_tradingMarket; + TQString m_tradingCurrency; eSECURITYTYPE m_securityType; int m_smallestAccountFraction; int m_smallestCashFraction; diff --git a/kmymoney2/mymoney/mymoneysecuritytest.cpp b/kmymoney2/mymoney/mymoneysecuritytest.cpp index 77b6764..72911db 100644 --- a/kmymoney2/mymoney/mymoneysecuritytest.cpp +++ b/kmymoney2/mymoney/mymoneysecuritytest.cpp @@ -51,7 +51,7 @@ void MyMoneySecurityTest::testCopyConstructor() { } void MyMoneySecurityTest::testNonemptyConstructor() { - QDate date(2004,4,1); + TQDate date(2004,4,1); MyMoneyMoney val("1234/100"); m->setName("name"); @@ -61,8 +61,8 @@ void MyMoneySecurityTest::testNonemptyConstructor() { MyMoneySecurity n("id", *m); - CPPUNIT_ASSERT(n.id() == QString("id")); - CPPUNIT_ASSERT(n.tradingSymbol() == QString("symbol")); + CPPUNIT_ASSERT(n.id() == TQString("id")); + CPPUNIT_ASSERT(n.tradingSymbol() == TQString("symbol")); CPPUNIT_ASSERT(n.securityType() == MyMoneySecurity::SECURITY_CURRENCY); // CPPUNIT_ASSERT(n.priceHistory().count() == 1); } @@ -173,8 +173,8 @@ void MyMoneySecurityTest::testInequality () { /* void MyMoneySecurityTest::testAccountIDList () { MyMoneySecurity equity; - QStringList list; - QString id; + TQStringList list; + TQString id; // list must be empty list = institution.accountList(); @@ -184,26 +184,26 @@ void MyMoneySecurityTest::testAccountIDList () { institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // adding same account shouldn't make a difference institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // now add another account institution.addAccountId("A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 2); - CPPUNIT_ASSERT(list.contains("A000002") == 1); - CPPUNIT_ASSERT(list.contains("A000001") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000001") == 1); id = institution.removeAccountId("A000001"); CPPUNIT_ASSERT(id == "A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); } */ diff --git a/kmymoney2/mymoney/mymoneysplit.cpp b/kmymoney2/mymoney/mymoneysplit.cpp index a19ff43..4af052d 100644 --- a/kmymoney2/mymoney/mymoneysplit.cpp +++ b/kmymoney2/mymoney/mymoneysplit.cpp @@ -44,7 +44,7 @@ MyMoneySplit::MyMoneySplit() m_reconcileFlag = NotReconciled; } -MyMoneySplit::MyMoneySplit(const QDomElement& node) : +MyMoneySplit::MyMoneySplit(const TQDomElement& node) : MyMoneyObject(node, false), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()) { @@ -53,20 +53,20 @@ MyMoneySplit::MyMoneySplit(const QDomElement& node) : clearId(); - m_payee = QStringEmpty(node.attribute("payee")); - m_reconcileDate = stringToDate(QStringEmpty(node.attribute("reconciledate"))); - m_action = QStringEmpty(node.attribute("action")); + m_payee = TQStringEmpty(node.attribute("payee")); + m_reconcileDate = stringToDate(TQStringEmpty(node.attribute("reconciledate"))); + m_action = TQStringEmpty(node.attribute("action")); m_reconcileFlag = static_cast(node.attribute("reconcileflag").toInt()); - m_memo = QStringEmpty(node.attribute("memo")); - m_value = MyMoneyMoney(QStringEmpty(node.attribute("value"))); - m_shares = MyMoneyMoney(QStringEmpty(node.attribute("shares"))); - m_price = MyMoneyMoney(QStringEmpty(node.attribute("price"))); - m_account = QStringEmpty(node.attribute("account")); - m_number = QStringEmpty(node.attribute("number")); - m_bankID = QStringEmpty(node.attribute("bankid")); + m_memo = TQStringEmpty(node.attribute("memo")); + m_value = MyMoneyMoney(TQStringEmpty(node.attribute("value"))); + m_shares = MyMoneyMoney(TQStringEmpty(node.attribute("shares"))); + m_price = MyMoneyMoney(TQStringEmpty(node.attribute("price"))); + m_account = TQStringEmpty(node.attribute("account")); + m_number = TQStringEmpty(node.attribute("number")); + m_bankID = TQStringEmpty(node.attribute("bankid")); } -MyMoneySplit::MyMoneySplit(const QString& id, const MyMoneySplit& right) : +MyMoneySplit::MyMoneySplit(const TQString& id, const MyMoneySplit& right) : MyMoneyObject(id) { *this = right; @@ -94,17 +94,17 @@ bool MyMoneySplit::operator == (const MyMoneySplit& right) const m_transactionId == right.m_transactionId; } -void MyMoneySplit::setAccountId(const QString& account) +void MyMoneySplit::setAccountId(const TQString& account) { m_account = account; } -void MyMoneySplit::setMemo(const QString& memo) +void MyMoneySplit::setMemo(const TQString& memo) { m_memo = memo; } -void MyMoneySplit::setReconcileDate(const QDate& date) +void MyMoneySplit::setReconcileDate(const TQDate& date) { m_reconcileDate = date; } @@ -124,7 +124,7 @@ void MyMoneySplit::setValue(const MyMoneyMoney& value) m_value = value; } -void MyMoneySplit::setValue(const MyMoneyMoney& value, const QString& transactionCurrencyId, const QString& splitCurrencyId) +void MyMoneySplit::setValue(const MyMoneyMoney& value, const TQString& transactionCurrencyId, const TQString& splitCurrencyId) { if(transactionCurrencyId == splitCurrencyId) setValue(value); @@ -132,7 +132,7 @@ void MyMoneySplit::setValue(const MyMoneyMoney& value, const QString& transactio setShares(value); } -void MyMoneySplit::setPayeeId(const QString& payee) +void MyMoneySplit::setPayeeId(const TQString& payee) { m_payee = payee; } @@ -165,17 +165,17 @@ void MyMoneySplit::setAction(investTransactionTypeE type) } } -void MyMoneySplit::setAction(const QString& action) +void MyMoneySplit::setAction(const TQString& action) { m_action = action; } -void MyMoneySplit::setNumber(const QString& number) +void MyMoneySplit::setNumber(const TQString& number) { m_number = number; } -const MyMoneyMoney MyMoneySplit::value(const QString& transactionCurrencyId, const QString& splitCurrencyId) const +const MyMoneyMoney MyMoneySplit::value(const TQString& transactionCurrencyId, const TQString& splitCurrencyId) const { return (transactionCurrencyId == splitCurrencyId) ? m_value : m_shares; } @@ -194,9 +194,9 @@ MyMoneyMoney MyMoneySplit::price(void) const return MyMoneyMoney(1,1); } -void MyMoneySplit::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneySplit::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("SPLIT"); + TQDomElement el = document.createElement("SPLIT"); writeBaseXML(document, el); @@ -217,10 +217,10 @@ void MyMoneySplit::writeXML(QDomDocument& document, QDomElement& parent) const MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneySplit::hasReferenceTo(const QString& id) const +bool MyMoneySplit::hasReferenceTo(const TQString& id) const { bool rc = false; if(isMatched()) { @@ -239,12 +239,12 @@ void MyMoneySplit::addMatch(const MyMoneyTransaction& _t) if(_t.isImported() && !isMatched()) { MyMoneyTransaction t(_t); t.clearId(); - QDomDocument doc("MATCH"); - QDomElement el = doc.createElement("CONTAINER"); + TQDomDocument doc("MATCH"); + TQDomElement el = doc.createElement("CONTAINER"); doc.appendChild(el); t.writeXML(doc, el); - QString xml = doc.toString(); - xml.replace("<", "<"); + TQString xml = doc.toString(); + xml.tqreplace("<", "<"); setValue("kmm-matched-tx", xml); } } @@ -256,11 +256,11 @@ void MyMoneySplit::removeMatch(void) MyMoneyTransaction MyMoneySplit::matchedTransaction(void) const { - QString xml = value("kmm-matched-tx"); + TQString xml = value("kmm-matched-tx"); if(!xml.isEmpty()) { - xml.replace("<", "<"); - QDomDocument doc; - QDomElement node; + xml.tqreplace("<", "<"); + TQDomDocument doc; + TQDomElement node; doc.setContent(xml); node = doc.documentElement().firstChild().toElement(); MyMoneyTransaction t(node, false); diff --git a/kmymoney2/mymoney/mymoneysplit.h b/kmymoney2/mymoney/mymoneysplit.h index 3408a6a..de7c849 100644 --- a/kmymoney2/mymoney/mymoneysplit.h +++ b/kmymoney2/mymoney/mymoneysplit.h @@ -30,8 +30,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -92,13 +92,13 @@ public: } investTransactionTypeE; MyMoneySplit(); - MyMoneySplit(const QDomElement& node); - MyMoneySplit(const QString& id, const MyMoneySplit& right); + MyMoneySplit(const TQDomElement& node); + MyMoneySplit(const TQString& id, const MyMoneySplit& right); ~MyMoneySplit(); bool operator == (const MyMoneySplit&) const; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -109,7 +109,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; const MyMoneyMoney& shares(void) const { return m_shares; } const MyMoneyMoney& value(void) const { return m_value; } @@ -126,30 +126,30 @@ public: */ MyMoneyMoney actualPrice(void) const { return m_price; } - const MyMoneyMoney value(const QString& transactionCurrencyId, const QString& splitCurrencyId) const; + const MyMoneyMoney value(const TQString& transactionCurrencyId, const TQString& splitCurrencyId) const; /** * Required to have (direct) access to the MyMoneyKeyValueContainer::value() method. */ - const QString& value(const QString& key) const { return MyMoneyKeyValueContainer::value(key); } + const TQString& value(const TQString& key) const { return MyMoneyKeyValueContainer::value(key); } /** * Required to have (direct) access to the MyMoneyKeyValueContainer::setValue() method. */ - void setValue(const QString& key, const QString& value) { MyMoneyKeyValueContainer::setValue(key, value); } + void setValue(const TQString& key, const TQString& value) { MyMoneyKeyValueContainer::setValue(key, value); } - const QString& accountId(void) const { return m_account; } - const QString& memo(void) const { return m_memo; } + const TQString& accountId(void) const { return m_account; } + const TQString& memo(void) const { return m_memo; } reconcileFlagE reconcileFlag(void) const { return m_reconcileFlag; } - const QDate& reconcileDate(void) const { return m_reconcileDate; } - const QString& payeeId(void) const { return m_payee; } - const QString& action(void) const { return m_action; } - const QString& number(void) const { return m_number; } + const TQDate& reconcileDate(void) const { return m_reconcileDate; } + const TQString& payeeId(void) const { return m_payee; } + const TQString& action(void) const { return m_action; } + const TQString& number(void) const { return m_number; } bool isAmortizationSplit(void) const { return m_action == ActionAmortization; } bool isInterestSplit(void) const { return m_action == ActionInterest; } bool isAutoCalc(void) const { return (m_shares == MyMoneyMoney::autoCalc) || (m_value == MyMoneyMoney::autoCalc); } - const QString& bankID(void) const { return m_bankID; } - const QString& transactionId(void) const { return m_transactionId; } + const TQString& bankID(void) const { return m_bankID; } + const TQString& transactionId(void) const { return m_transactionId; } void setShares(const MyMoneyMoney& shares); void setValue(const MyMoneyMoney& value); @@ -168,18 +168,18 @@ public: * the id of the currency assigned to the account that is * referenced by the split) */ - void setValue(const MyMoneyMoney& value, const QString& transactionCurrencyId, const QString& splitCurrencyId); + void setValue(const MyMoneyMoney& value, const TQString& transactionCurrencyId, const TQString& splitCurrencyId); - void setAccountId(const QString& account); - void setMemo(const QString& memo); + void setAccountId(const TQString& account); + void setMemo(const TQString& memo); void setReconcileFlag(const reconcileFlagE flag); - void setReconcileDate(const QDate& date); - void setPayeeId(const QString& payee); - void setAction(const QString& action); + void setReconcileDate(const TQDate& date); + void setPayeeId(const TQString& payee); + void setAction(const TQString& action); void setAction(investTransactionTypeE type); - void setNumber(const QString& number); - void setBankID(const QString& bankID) { m_bankID = bankID; }; - void setTransactionId(const QString& id) { m_transactionId = id; } + void setNumber(const TQString& number); + void setBankID(const TQString& bankID) { m_bankID = bankID; }; + void setTransactionId(const TQString& id) { m_transactionId = id; } /** * returns @a true if this its a transaction matched against an imported @@ -226,17 +226,17 @@ private: /** * This member contains the ID of the transaction */ - QString m_id; + TQString m_id; /** * This member contains the ID of the payee */ - QString m_payee; + TQString m_payee; /** * This member contains the ID of the account */ - QString m_account; + TQString m_account; /** */ @@ -254,7 +254,7 @@ private: */ MyMoneyMoney m_price; - QString m_memo; + TQString m_memo; /** * This member contains information about the reconciliation @@ -272,20 +272,20 @@ private: * In case the reconciliation flag is set to Reconciled or Frozen * this member contains the date of the reconciliation. */ - QDate m_reconcileDate; + TQDate m_reconcileDate; /** * The m_action member is an arbitrary string, but is intended to * be conveniently limited to a menu of selections such as * "Buy", "Sell", "Interest", etc. */ - QString m_action; + TQString m_action; /** * The m_number member is used to store a reference number to * the split supplied by the user (e.g. check number, etc.). */ - QString m_number; + TQString m_number; /** * This member keeps the bank's unique ID for the split, so we can @@ -294,14 +294,14 @@ private: * This should only be set on the split which refers to the account * that was downloaded. */ - QString m_bankID; + TQString m_bankID; /** * This member keeps a backward id to the transaction that this * split can be found in. It is the purpose of the MyMoneyTransaction * object to maintain this member variable. */ - QString m_transactionId; + TQString m_transactionId; }; #endif diff --git a/kmymoney2/mymoney/mymoneysplittest.cpp b/kmymoney2/mymoney/mymoneysplittest.cpp index a592e1a..806b556 100644 --- a/kmymoney2/mymoney/mymoneysplittest.cpp +++ b/kmymoney2/mymoney/mymoneysplittest.cpp @@ -38,14 +38,14 @@ void MyMoneySplitTest::testEmptyConstructor() { CPPUNIT_ASSERT(m->shares().isZero()); CPPUNIT_ASSERT(m->value().isZero()); CPPUNIT_ASSERT(m->reconcileFlag() == MyMoneySplit::NotReconciled); - CPPUNIT_ASSERT(m->reconcileDate() == QDate()); + CPPUNIT_ASSERT(m->reconcileDate() == TQDate()); CPPUNIT_ASSERT(m->transactionId().isEmpty()); } void MyMoneySplitTest::testSetFunctions() { m->setAccountId("Account"); m->setMemo("Memo"); - m->setReconcileDate(QDate(1,2,3)); + m->setReconcileDate(TQDate(1,2,3)); m->setReconcileFlag(MyMoneySplit::Cleared); m->setShares(1234); m->setValue(3456); @@ -57,7 +57,7 @@ void MyMoneySplitTest::testSetFunctions() { CPPUNIT_ASSERT(m->accountId() == "Account"); CPPUNIT_ASSERT(m->memo() == "Memo"); - CPPUNIT_ASSERT(m->reconcileDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(m->reconcileDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(m->reconcileFlag() == MyMoneySplit::Cleared); CPPUNIT_ASSERT(m->shares() == MyMoneyMoney(1234)); CPPUNIT_ASSERT(m->value() == MyMoneyMoney(3456)); @@ -76,7 +76,7 @@ void MyMoneySplitTest::testCopyConstructor() { CPPUNIT_ASSERT(n.accountId() == "Account"); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.reconcileDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.reconcileDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.reconcileFlag() == MyMoneySplit::Cleared); CPPUNIT_ASSERT(n.shares() == MyMoneyMoney(1234)); CPPUNIT_ASSERT(n.value() == MyMoneyMoney(3456)); @@ -96,7 +96,7 @@ void MyMoneySplitTest::testAssignmentConstructor() { CPPUNIT_ASSERT(n.accountId() == "Account"); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.reconcileDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.reconcileDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.reconcileFlag() == MyMoneySplit::Cleared); CPPUNIT_ASSERT(n.shares() == MyMoneyMoney(1234)); CPPUNIT_ASSERT(n.value() == MyMoneyMoney(3456)); @@ -148,7 +148,7 @@ void MyMoneySplitTest::testInequality() { CPPUNIT_ASSERT(!(n == *m)); n = *m; - n.setReconcileDate(QDate(3,4,5)); + n.setReconcileDate(TQDate(3,4,5)); CPPUNIT_ASSERT(!(n == *m)); n = *m; @@ -200,7 +200,7 @@ void MyMoneySplitTest::testSetValue() { } void MyMoneySplitTest::testSetAction() { - CPPUNIT_ASSERT(m->action() == QString()); + CPPUNIT_ASSERT(m->action() == TQString()); m->setAction(MyMoneySplit::BuyShares); CPPUNIT_ASSERT(m->action() == MyMoneySplit::ActionBuyShares); m->setAction(MyMoneySplit::SellShares); @@ -243,12 +243,12 @@ void MyMoneySplitTest::testWriteXML() { s.setAction(MyMoneySplit::ActionDeposit); s.setReconcileFlag(MyMoneySplit::Reconciled); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("SPLIT-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("SPLIT-CONTAINER"); doc.appendChild(el); s.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "\n" "\n" " \n" @@ -259,20 +259,20 @@ void MyMoneySplitTest::testWriteXML() { void MyMoneySplitTest::testReadXML() { MyMoneySplit s; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" " \n" "\n"); - QString ref_false = QString( + TQString ref_false = TQString( "\n" "\n" " \n" "\n"); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -290,7 +290,7 @@ void MyMoneySplitTest::testReadXML() { s = MyMoneySplit(node); CPPUNIT_ASSERT(s.id().isEmpty()); CPPUNIT_ASSERT(s.payeeId() == "P000001"); - CPPUNIT_ASSERT(s.reconcileDate() == QDate()); + CPPUNIT_ASSERT(s.reconcileDate() == TQDate()); CPPUNIT_ASSERT(s.shares() == MyMoneyMoney(96379, 100)); CPPUNIT_ASSERT(s.value() == MyMoneyMoney(96379, 1000)); CPPUNIT_ASSERT(s.number() == "124"); diff --git a/kmymoney2/mymoney/mymoneystatement.cpp b/kmymoney2/mymoney/mymoneystatement.cpp index 0373863..3756520 100644 --- a/kmymoney2/mymoney/mymoneystatement.cpp +++ b/kmymoney2/mymoney/mymoneystatement.cpp @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -35,12 +35,12 @@ #include "../../kdecompat.h" #include "mymoneystatement.h" -const QStringList kAccountTypeTxt = QStringList::split(",","none,checkings,savings,investment,creditcard,invalid"); -const QStringList kActionText = QStringList::split(",","none,buy,sell,reinvestdividend,cashdividend,add,remove,stocksplit,fees,interest,invalid"); +const TQStringList kAccountTypeTxt = TQStringList::split(",","none,checkings,savings,investment,creditcard,invalid"); +const TQStringList kActionText = TQStringList::split(",","none,buy,sell,reinvestdividend,cashdividend,add,remove,stocksplit,fees,interest,invalid"); -void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const +void MyMoneyStatement::write(TQDomElement& _root,TQDomDocument* _doc) const { - QDomElement e = _doc->createElement("STATEMENT"); + TQDomElement e = _doc->createElement("STATEMENT"); _root.appendChild(e); e.setAttribute("version","1.1"); @@ -56,10 +56,10 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const e.setAttribute("skipCategoryMatching", m_skipCategoryMatching); // iterate over transactions, and add each one - QValueList::const_iterator it_t = m_listTransactions.begin(); + TQValueList::const_iterator it_t = m_listTransactions.begin(); while ( it_t != m_listTransactions.end() ) { - QDomElement p = _doc->createElement("TRANSACTION"); + TQDomElement p = _doc->createElement("TRANSACTION"); p.setAttribute("dateposted", (*it_t).m_datePosted.toString(Qt::ISODate)); p.setAttribute("payee", (*it_t).m_strPayee); p.setAttribute("memo", (*it_t).m_strMemo); @@ -77,9 +77,9 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } // add all the splits we know of (might be empty) - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = (*it_t).m_listSplits.begin(); it_s != (*it_t).m_listSplits.end(); ++it_s) { - QDomElement split = _doc->createElement("SPLIT"); + TQDomElement split = _doc->createElement("SPLIT"); split.setAttribute("accountid", (*it_s).m_accountId); split.setAttribute("amount", (*it_s).m_amount.toString()); split.setAttribute("reconcile", (*it_s).m_reconcile); @@ -95,10 +95,10 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } // iterate over prices, and add each one - QValueList::const_iterator it_p = m_listPrices.begin(); + TQValueList::const_iterator it_p = m_listPrices.begin(); while ( it_p != m_listPrices.end() ) { - QDomElement p = _doc->createElement("PRICE"); + TQDomElement p = _doc->createElement("PRICE"); p.setAttribute("dateposted", (*it_p).m_date.toString(Qt::ISODate)); p.setAttribute("security", (*it_p).m_strSecurity); p.setAttribute("amount", (*it_p).m_amount.toString()); @@ -109,10 +109,10 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } // iterate over securities, and add each one - QValueList::const_iterator it_s = m_listSecurities.begin(); + TQValueList::const_iterator it_s = m_listSecurities.begin(); while ( it_s != m_listSecurities.end() ) { - QDomElement p = _doc->createElement("SECURITY"); + TQDomElement p = _doc->createElement("SECURITY"); p.setAttribute("name", (*it_s).m_strName); p.setAttribute("symbol", (*it_s).m_strSymbol); p.setAttribute("id", (*it_s).m_strId); @@ -124,7 +124,7 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } -bool MyMoneyStatement::read(const QDomElement& _e) +bool MyMoneyStatement::read(const TQDomElement& _e) { bool result = false; @@ -136,33 +136,33 @@ bool MyMoneyStatement::read(const QDomElement& _e) m_strAccountNumber = _e.attribute("accountnumber"); m_strRoutingNumber = _e.attribute("routingnumber"); m_strCurrency = _e.attribute("currency"); - m_dateBegin = QDate::fromString(_e.attribute("begindate"),Qt::ISODate); - m_dateEnd = QDate::fromString(_e.attribute("enddate"),Qt::ISODate); + m_dateBegin = TQDate::fromString(_e.attribute("begindate"),Qt::ISODate); + m_dateEnd = TQDate::fromString(_e.attribute("enddate"),Qt::ISODate); m_closingBalance = MyMoneyMoney(_e.attribute("closingbalance")); m_accountId = _e.attribute("accountid"); m_skipCategoryMatching = _e.attribute("skipCategoryMatching"); - int i = kAccountTypeTxt.findIndex(_e.attribute("type",kAccountTypeTxt[1])); + int i = kAccountTypeTxt.tqfindIndex(_e.attribute("type",kAccountTypeTxt[1])); if ( i != -1 ) m_eType = static_cast(i); - QDomNode child = _e.firstChild(); + TQDomNode child = _e.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if ( c.tagName() == "TRANSACTION" ) { MyMoneyStatement::Transaction t; - t.m_datePosted = QDate::fromString(c.attribute("dateposted"),Qt::ISODate); + t.m_datePosted = TQDate::fromString(c.attribute("dateposted"),Qt::ISODate); t.m_amount = MyMoneyMoney(c.attribute("amount")); t.m_strMemo = c.attribute("memo"); t.m_strNumber = c.attribute("number"); t.m_strPayee = c.attribute("payee"); t.m_strBankID = c.attribute("bankid"); t.m_reconcile = static_cast(c.attribute("reconcile").toInt()); - int i = kActionText.findIndex(c.attribute("action",kActionText[1])); + int i = kActionText.tqfindIndex(c.attribute("action",kActionText[1])); if ( i != -1 ) t.m_eAction = static_cast(i); @@ -174,9 +174,9 @@ bool MyMoneyStatement::read(const QDomElement& _e) } // process splits (if any) - QDomNode child = c.firstChild(); + TQDomNode child = c.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if(c.tagName() == "SPLIT") { MyMoneyStatement::Split s; s.m_accountId = c.attribute("accountid"); @@ -194,7 +194,7 @@ bool MyMoneyStatement::read(const QDomElement& _e) { MyMoneyStatement::Price p; - p.m_date = QDate::fromString(c.attribute("dateposted"), Qt::ISODate); + p.m_date = TQDate::fromString(c.attribute("dateposted"), Qt::ISODate); p.m_strSecurity = c.attribute("security"); p.m_amount = MyMoneyMoney(c.attribute("amount")); @@ -217,20 +217,20 @@ bool MyMoneyStatement::read(const QDomElement& _e) return result; } -bool MyMoneyStatement::isStatementFile(const QString& _filename) +bool MyMoneyStatement::isStatementFile(const TQString& _filename) { - // filename is considered a statement file if it contains + // filename is considered a statement file if it tqcontains // the tag "" in the first 20 lines. bool result = false; - QFile f( _filename ); + TQFile f( _filename ); if ( f.open( IO_ReadOnly ) ) { - QTextStream ts( &f ); + TQTextStream ts( &f ); int lineCount = 20; while ( !ts.atEnd() && !result && lineCount != 0) { - if ( ts.readLine().contains("",false) ) + if ( ts.readLine().tqcontains("",false) ) result = true; --lineCount; } @@ -240,29 +240,29 @@ bool MyMoneyStatement::isStatementFile(const QString& _filename) return result; } -void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const QString& _filename ) +void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const TQString& _filename ) { static unsigned filenum = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("statement-%1%2.xml").arg((filenum<10)?"0":"").arg(filenum); + filename = TQString("statement-%1%2.xml").tqarg((filenum<10)?"0":"").tqarg(filenum); filenum++; } - QDomDocument* doc = new QDomDocument("KMYMONEY-STATEMENT"); + TQDomDocument* doc = new TQDomDocument("KMYMONEY-STATEMENT"); Q_CHECK_PTR(doc); //writeStatementtoXMLDoc(_s,doc); - QDomProcessingInstruction instruct = doc->createProcessingInstruction(QString("xml"), QString("version=\"1.0\" encoding=\"utf-8\"")); + TQDomProcessingInstruction instruct = doc->createProcessingInstruction(TQString("xml"), TQString("version=\"1.0\" encoding=\"utf-8\"")); doc->appendChild(instruct); - QDomElement eroot = doc->createElement("KMYMONEY-STATEMENT"); + TQDomElement eroot = doc->createElement("KMYMONEY-STATEMENT"); doc->appendChild(eroot); _s.write(eroot,doc); - QFile g( filename ); + TQFile g( filename ); if(g.open( IO_WriteOnly )) { - QTextStream stream(&g); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&g); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << doc->toString(); g.close(); } @@ -270,22 +270,22 @@ void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const QString& delete doc; } -bool MyMoneyStatement::readXMLFile( MyMoneyStatement& _s, const QString& _filename ) +bool MyMoneyStatement::readXMLFile( MyMoneyStatement& _s, const TQString& _filename ) { bool result = false; - QFile f( _filename ); + TQFile f( _filename ); f.open( IO_ReadOnly ); - QDomDocument* doc = new QDomDocument; + TQDomDocument* doc = new TQDomDocument; if(doc->setContent(&f, false)) { - QDomElement rootElement = doc->documentElement(); + TQDomElement rootElement = doc->documentElement(); if(!rootElement.isNull()) { - QDomNode child = rootElement.firstChild(); + TQDomNode child = rootElement.firstChild(); while(!child.isNull() && child.isElement()) { result = true; - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); _s.read(childElement); child = child.nextSibling(); diff --git a/kmymoney2/mymoney/mymoneystatement.h b/kmymoney2/mymoney/mymoneystatement.h index 0bea510..a7f8bfe 100644 --- a/kmymoney2/mymoney/mymoneystatement.h +++ b/kmymoney2/mymoney/mymoneystatement.h @@ -31,9 +31,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -42,8 +42,8 @@ #include #include -class QDomElement; -class QDomDocument; +class TQDomElement; +class TQDomDocument; /** Represents the electronic analog of the paper bank statement just like we used to get in the regular mail. This class is designed to be easy to extend and easy to create with minimal dependencies. So the header file should include as few project files as possible (preferrably NONE). @@ -60,9 +60,9 @@ public: class Split { public: Split() : m_reconcile(MyMoneySplit::NotReconciled) {} - QString m_strCategoryName; - QString m_strMemo; - QString m_accountId; + TQString m_strCategoryName; + TQString m_strMemo; + TQString m_accountId; MyMoneySplit::reconcileFlagE m_reconcile; MyMoneyMoney m_amount; @@ -71,11 +71,11 @@ public: class Transaction { public: Transaction() : m_reconcile(MyMoneySplit::NotReconciled), m_eAction(eaNone) {} - QDate m_datePosted; - QString m_strPayee; - QString m_strMemo; - QString m_strNumber; - QString m_strBankID; + TQDate m_datePosted; + TQString m_strPayee; + TQString m_strMemo; + TQString m_strNumber; + TQString m_strBankID; MyMoneyMoney m_amount; MyMoneySplit::reconcileFlagE m_reconcile; @@ -86,30 +86,30 @@ public: MyMoneyMoney m_shares; MyMoneyMoney m_fees; MyMoneyMoney m_price; - QString m_strInterestCategory; - QString m_strBrokerageAccount; - QString m_strSymbol; - QString m_strSecurity; - QValueList m_listSplits; + TQString m_strInterestCategory; + TQString m_strBrokerageAccount; + TQString m_strSymbol; + TQString m_strSecurity; + TQValueList m_listSplits; }; struct Price { - QDate m_date; - QString m_strSecurity; + TQDate m_date; + TQString m_strSecurity; MyMoneyMoney m_amount; }; struct Security { - QString m_strName; - QString m_strSymbol; - QString m_strId; + TQString m_strName; + TQString m_strSymbol; + TQString m_strId; }; - QString m_strAccountName; - QString m_strAccountNumber; - QString m_strRoutingNumber; + TQString m_strAccountName; + TQString m_strAccountNumber; + TQString m_strRoutingNumber; /** * The statement provider's information for the statement reader how to find the @@ -119,26 +119,26 @@ public: * MyMoneyAccount object for this key. The account id of that account should be returned * here. If no id is available, leave it empty. */ - QString m_accountId; + TQString m_accountId; - QString m_strCurrency; - QDate m_dateBegin; - QDate m_dateEnd; + TQString m_strCurrency; + TQDate m_dateBegin; + TQDate m_dateEnd; MyMoneyMoney m_closingBalance; EType m_eType; - QValueList m_listTransactions; - QValueList m_listPrices; - QValueList m_listSecurities; + TQValueList m_listTransactions; + TQValueList m_listPrices; + TQValueList m_listSecurities; bool m_skipCategoryMatching; - void write(QDomElement&,QDomDocument*) const; - bool read(const QDomElement&); + void write(TQDomElement&,TQDomDocument*) const; + bool read(const TQDomElement&); - KMYMONEY_EXPORT static bool isStatementFile(const QString&); - KMYMONEY_EXPORT static bool readXMLFile( MyMoneyStatement&, const QString& ); - KMYMONEY_EXPORT static void writeXMLFile( const MyMoneyStatement&, const QString& ); + KMYMONEY_EXPORT static bool isStatementFile(const TQString&); + KMYMONEY_EXPORT static bool readXMLFile( MyMoneyStatement&, const TQString& ); + KMYMONEY_EXPORT static void writeXMLFile( const MyMoneyStatement&, const TQString& ); }; #endif diff --git a/kmymoney2/mymoney/mymoneysubject.cpp b/kmymoney2/mymoney/mymoneysubject.cpp index c54d738..8391570 100644 --- a/kmymoney2/mymoney/mymoneysubject.cpp +++ b/kmymoney2/mymoney/mymoneysubject.cpp @@ -22,7 +22,7 @@ #include "mymoneysubject.h" #include "mymoneyobserver.h" -#include +#include MyMoneySubject::MyMoneySubject() { @@ -42,14 +42,14 @@ void MyMoneySubject::detach (MyMoneyObserver* o) m_observers.remove(o); } -void MyMoneySubject::notify(const QString& id) +void MyMoneySubject::notify(const TQString& id) { - QPtrList ptrList = m_observers; + TQPtrList ptrList = m_observers; MyMoneyObserver* i; for (i = ptrList.first(); i != 0; i = ptrList.next()) { // only call the observer if it did not detach in the meantime - if(m_observers.findRef(i) != -1) { + if(m_observers.tqfindRef(i) != -1) { // qDebug("call observer @ 0x%08lX with '%s'", (unsigned long)i, id.data()); i->update(id); } diff --git a/kmymoney2/mymoney/mymoneysubject.h b/kmymoney2/mymoney/mymoneysubject.h index 74b8290..5b051e4 100644 --- a/kmymoney2/mymoney/mymoneysubject.h +++ b/kmymoney2/mymoney/mymoneysubject.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -34,7 +34,7 @@ #include class MyMoneyObserver; -class QString; +class TQString; /** * This is the base class to be used to construct a @@ -47,13 +47,13 @@ public: virtual ~MyMoneySubject(); virtual void attach(MyMoneyObserver*); virtual void detach(MyMoneyObserver*); - virtual void notify(const QString& id); + virtual void notify(const TQString& id); protected: MyMoneySubject(); private: - QPtrList m_observers; + TQPtrList m_observers; }; #endif diff --git a/kmymoney2/mymoney/mymoneytransaction.cpp b/kmymoney2/mymoney/mymoneytransaction.cpp index 10b4c08..662a9c8 100644 --- a/kmymoney2/mymoney/mymoneytransaction.cpp +++ b/kmymoney2/mymoney/mymoneytransaction.cpp @@ -29,25 +29,25 @@ MyMoneyTransaction::MyMoneyTransaction() : MyMoneyObject() { m_nextSplitID = 1; - m_entryDate = QDate(); - m_postDate = QDate(); + m_entryDate = TQDate(); + m_postDate = TQDate(); } -MyMoneyTransaction::MyMoneyTransaction(const QString id, const MyMoneyTransaction& transaction) : +MyMoneyTransaction::MyMoneyTransaction(const TQString id, const MyMoneyTransaction& transaction) : MyMoneyObject(id) { *this = transaction; m_id = id; - if(m_entryDate == QDate()) - m_entryDate = QDate::currentDate(); + if(m_entryDate == TQDate()) + m_entryDate = TQDate::tqcurrentDate(); - QValueList::Iterator it; + TQValueList::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { (*it).setTransactionId(id); } } -MyMoneyTransaction::MyMoneyTransaction(const QDomElement& node, const bool forceId) : +MyMoneyTransaction::MyMoneyTransaction(const TQDomElement& node, const bool forceId) : MyMoneyObject(node, forceId) { if("TRANSACTION" != node.tagName()) @@ -57,17 +57,17 @@ MyMoneyTransaction::MyMoneyTransaction(const QDomElement& node, const bool force m_postDate = stringToDate(node.attribute("postdate")); m_entryDate = stringToDate(node.attribute("entrydate")); - m_bankID = QStringEmpty(node.attribute("bankid")); - m_memo = QStringEmpty(node.attribute("memo")); - m_commodity = QStringEmpty(node.attribute("commodity")); + m_bankID = TQStringEmpty(node.attribute("bankid")); + m_memo = TQStringEmpty(node.attribute("memo")); + m_commodity = TQStringEmpty(node.attribute("commodity")); - QDomNode child = node.firstChild(); + TQDomNode child = node.firstChild(); while ( !child.isNull() && child.isElement() ) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if(c.tagName() == "SPLITS") { // Process any split information found inside the transaction entry. - QDomNodeList nodeList = c.elementsByTagName("SPLIT"); + TQDomNodeList nodeList = c.elementsByTagName("SPLIT"); for(unsigned int i = 0; i < nodeList.count(); ++i) { MyMoneySplit s(nodeList.item(i).toElement()); if(!m_bankID.isEmpty()) @@ -84,7 +84,7 @@ MyMoneyTransaction::MyMoneyTransaction(const QDomElement& node, const bool force } child = child.nextSibling(); } - m_bankID = QString(); + m_bankID = TQString(); } MyMoneyTransaction::~MyMoneyTransaction() @@ -102,9 +102,9 @@ bool MyMoneyTransaction::operator == (const MyMoneyTransaction& right) const (m_postDate == right.m_postDate) ); } -bool MyMoneyTransaction::accountReferenced(const QString& id) const +bool MyMoneyTransaction::accountReferenced(const TQString& id) const { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).accountId() == id) @@ -119,7 +119,7 @@ void MyMoneyTransaction::addSplit(MyMoneySplit& split) throw new MYMONEYEXCEPTION("Cannot add split with assigned id (" + split.id() + ")"); /* - QValueList::Iterator it; + TQValueList::Iterator it; // if the account referenced in this split is already // referenced in another split, we add the amount of @@ -151,9 +151,9 @@ void MyMoneyTransaction::modifySplit(MyMoneySplit& split) // by another split, the values will be added and the // duplicate removed. /* - QValueList::Iterator it; - QValueList::Iterator self = m_splits.end(); - QValueList::Iterator dup = self; + TQValueList::Iterator it; + TQValueList::Iterator self = m_splits.end(); + TQValueList::Iterator dup = self; bool duplicateAccount = false; for(it = m_splits.begin(); it != m_splits.end(); ++it) { @@ -181,19 +181,19 @@ void MyMoneyTransaction::modifySplit(MyMoneySplit& split) if(split.accountId().isEmpty()) throw new MYMONEYEXCEPTION("Cannot modify split that does not contain an account reference"); - QValueList::Iterator it; + TQValueList::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if(split.id() == (*it).id()) { *it = split; return; } } - throw new MYMONEYEXCEPTION(QString("Invalid split id '%1'").arg(split.id())); + throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").tqarg(split.id())); } void MyMoneyTransaction::removeSplit(const MyMoneySplit& split) { - QValueList::Iterator it; + TQValueList::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if(split.id() == (*it).id()) { @@ -202,7 +202,7 @@ void MyMoneyTransaction::removeSplit(const MyMoneySplit& split) } } if(it == m_splits.end()) - throw new MYMONEYEXCEPTION(QString("Invalid split id '%1'").arg(split.id())); + throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").tqarg(split.id())); } void MyMoneyTransaction::removeSplits(void) @@ -211,20 +211,20 @@ void MyMoneyTransaction::removeSplits(void) m_nextSplitID = 1; } -const MyMoneySplit& MyMoneyTransaction::splitByPayee(const QString& payeeId) const +const MyMoneySplit& MyMoneyTransaction::splitByPayee(const TQString& payeeId) const { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).payeeId() == payeeId) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for payee '%1'").arg(QString(payeeId))); + throw new MYMONEYEXCEPTION(TQString("Split not found for payee '%1'").tqarg(TQString(payeeId))); } -const MyMoneySplit& MyMoneyTransaction::splitByAccount(const QString& accountId, const bool match) const +const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQString& accountId, const bool match) const { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if(match == true && (*it).accountId() == accountId) @@ -232,51 +232,51 @@ const MyMoneySplit& MyMoneyTransaction::splitByAccount(const QString& accountId, if(match == false && (*it).accountId() != accountId) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for account %1%2").arg(match?"":"!").arg(QString(accountId))); + throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%2").tqarg(match?"":"!").tqarg(TQString(accountId))); } -const MyMoneySplit& MyMoneyTransaction::splitByAccount(const QStringList& accountIds, const bool match) const +const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQStringList& accountIds, const bool match) const { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { - if(match == true && accountIds.contains((*it).accountId()) ) + if(match == true && accountIds.tqcontains((*it).accountId()) ) return *it; - if(match == false && !accountIds.contains((*it).accountId())) + if(match == false && !accountIds.tqcontains((*it).accountId())) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for account %1%1...%2").arg(match?"":"!").arg(accountIds.front(),accountIds.back())); + throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%1...%2").tqarg(match?"":"!").tqarg(accountIds.front(),accountIds.back())); } -const MyMoneySplit& MyMoneyTransaction::splitById(const QString& splitId) const +const MyMoneySplit& MyMoneyTransaction::splitById(const TQString& splitId) const { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).id() == splitId) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for id '%1'").arg(QString(splitId))); + throw new MYMONEYEXCEPTION(TQString("Split not found for id '%1'").tqarg(TQString(splitId))); } -const QString MyMoneyTransaction::nextSplitID() +const TQString MyMoneyTransaction::nextSplitID() { - QString id; - id = "S" + id.setNum(m_nextSplitID++).rightJustify(SPLIT_ID_SIZE, '0'); + TQString id; + id = "S" + TQString(id.setNum(m_nextSplitID++)).rightJustify(SPLIT_ID_SIZE, '0'); return id; } -const QString MyMoneyTransaction::firstSplitID() +const TQString MyMoneyTransaction::firstSplitID() { - QString id; - id = "S" + id.setNum(1).rightJustify(SPLIT_ID_SIZE, '0'); + TQString id; + id = "S" + TQString(id.setNum(1)).rightJustify(SPLIT_ID_SIZE, '0'); return id; } const MyMoneyMoney MyMoneyTransaction::splitSum(void) const { MyMoneyMoney result(0); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { result += (*it).value(); @@ -284,14 +284,14 @@ const MyMoneyMoney MyMoneyTransaction::splitSum(void) const return result; } -void MyMoneyTransaction::setPostDate(const QDate& date) { m_postDate = date; } -void MyMoneyTransaction::setEntryDate(const QDate& date) { m_entryDate = date; } -void MyMoneyTransaction::setMemo(const QString& memo) { m_memo = memo; } +void MyMoneyTransaction::setPostDate(const TQDate& date) { m_postDate = date; } +void MyMoneyTransaction::setEntryDate(const TQDate& date) { m_entryDate = date; } +void MyMoneyTransaction::setMemo(const TQString& memo) { m_memo = memo; } bool MyMoneyTransaction::isLoanPayment(void) const { try { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isAmortizationSplit()) @@ -307,7 +307,7 @@ const MyMoneySplit& MyMoneyTransaction::amortizationSplit(void) const { static MyMoneySplit nullSplit; - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isAmortizationSplit() && (*it).isAutoCalc()) @@ -320,7 +320,7 @@ const MyMoneySplit& MyMoneyTransaction::interestSplit(void) const { static MyMoneySplit nullSplit; - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isInterestSplit() && (*it).isAutoCalc()) @@ -329,12 +329,12 @@ const MyMoneySplit& MyMoneyTransaction::interestSplit(void) const return nullSplit; } -unsigned long MyMoneyTransaction::hash(const QString& txt, unsigned long h) +unsigned long MyMoneyTransaction::hash(const TQString& txt, unsigned long h) { unsigned long g; for(unsigned i=0; i < txt.length(); ++i) { - unsigned short uc = txt[i].unicode(); + unsigned short uc = txt[i].tqunicode(); for(unsigned j = 0; j < 2; ++j) { unsigned char c = uc & 0xff; // if either the cell or the row of the Unicode char is 0, stop processing @@ -358,7 +358,7 @@ bool MyMoneyTransaction::isStockSplit(void) const bool MyMoneyTransaction::isImported(void) const { - return value("Imported").lower() == QString("true"); + return value("Imported").lower() == TQString("true"); } void MyMoneyTransaction::setImported(bool state) @@ -384,7 +384,7 @@ bool MyMoneyTransaction::isDuplicate(const MyMoneyTransaction& r) const for(int i = 0; i < 2; ++i) accHash[i] = valHash[i] = numHash[i] = 0; - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = splits().begin(); it != splits().end(); ++it) { accHash[0] += hash((*it).accountId()); valHash[0] += hash((*it).value().formatMoney("", 4)); @@ -408,9 +408,9 @@ bool MyMoneyTransaction::isDuplicate(const MyMoneyTransaction& r) const return rc; } -void MyMoneyTransaction::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyTransaction::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("TRANSACTION"); + TQDomElement el = document.createElement("TRANSACTION"); writeBaseXML(document, el); @@ -419,8 +419,8 @@ void MyMoneyTransaction::writeXML(QDomDocument& document, QDomElement& parent) c el.setAttribute("entrydate", dateToString(m_entryDate)); el.setAttribute("commodity", m_commodity); - QDomElement splits = document.createElement("SPLITS"); - QValueList::ConstIterator it; + TQDomElement splits = document.createElement("SPLITS"); + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { (*it).writeXML(document, splits); } @@ -428,12 +428,12 @@ void MyMoneyTransaction::writeXML(QDomDocument& document, QDomElement& parent) c MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyTransaction::hasReferenceTo(const QString& id) const +bool MyMoneyTransaction::hasReferenceTo(const TQString& id) const { - QValueList::const_iterator it; + TQValueList::const_iterator it; bool rc = (id == m_commodity); for(it = m_splits.begin(); rc == false && it != m_splits.end(); ++it) { rc = (*it).hasReferenceTo(id); @@ -443,7 +443,7 @@ bool MyMoneyTransaction::hasReferenceTo(const QString& id) const bool MyMoneyTransaction::hasAutoCalcSplit(void) const { - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isAutoCalc()) @@ -452,33 +452,33 @@ bool MyMoneyTransaction::hasAutoCalcSplit(void) const return false; } -QString MyMoneyTransaction::accountSignature(bool includeSplitCount) const +TQString MyMoneyTransaction::accountSignature(bool includeSplitCount) const { - QMap accountList; - QValueList::const_iterator it_s; + TQMap accountList; + TQValueList::const_iterator it_s; for(it_s = m_splits.begin(); it_s != m_splits.end(); ++it_s) { accountList[(*it_s).accountId()] += 1; } - QMap::const_iterator it_a; - QString rc; + TQMap::const_iterator it_a; + TQString rc; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { if(it_a != accountList.begin()) rc += "-"; rc += it_a.key(); if(includeSplitCount) - rc += QString("*%1").arg(*it_a); + rc += TQString("*%1").tqarg(*it_a); } return rc; } -QString MyMoneyTransaction::uniqueSortKey(void) const +TQString MyMoneyTransaction::uniqueSortKey(void) const { - QString year, month, day, key; - const QDate& postdate = postDate(); - year = year.setNum(postdate.year()).rightJustify(YEAR_SIZE, '0'); - month = month.setNum(postdate.month()).rightJustify(MONTH_SIZE, '0'); - day = day.setNum(postdate.day()).rightJustify(DAY_SIZE, '0'); + TQString year, month, day, key; + const TQDate& postdate = postDate(); + year = TQString(year.setNum(postdate.year())).rightJustify(YEAR_SIZE, '0'); + month = TQString(month.setNum(postdate.month())).rightJustify(MONTH_SIZE, '0'); + day = TQString(day.setNum(postdate.day())).rightJustify(DAY_SIZE, '0'); key = year + "-" + month + "-" + day + "-" + m_id; return key; } diff --git a/kmymoney2/mymoney/mymoneytransaction.h b/kmymoney2/mymoney/mymoneytransaction.h index ce52779..21c28ea 100644 --- a/kmymoney2/mymoney/mymoneytransaction.h +++ b/kmymoney2/mymoney/mymoneytransaction.h @@ -26,10 +26,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -43,7 +43,7 @@ /** * This class represents a transaction within the MyMoneyEngine. A transaction * contains none, one or more splits of type MyMoneySplit. They are stored in - * a QValueList within this object. A transaction containing only + * a TQValueList within this object. A transaction containing only * a single split with an amount not equal to 0 is an unbalanced transaction. It * is tolerated by the engine, but in general not a good idea as it is financially * wrong. @@ -52,35 +52,35 @@ class KMYMONEY_EXPORT MyMoneyTransaction : public MyMoneyObject, public MyMoneyK { public: MyMoneyTransaction(); - MyMoneyTransaction(const QString id, + MyMoneyTransaction(const TQString id, const MyMoneyTransaction& transaction); /** - * @param node reference to QDomNode - * @param forceId see MyMoneyObject(const QDomElement&, const bool) + * @param node reference to TQDomNode + * @param forceId see MyMoneyObject(const TQDomElement&, const bool) */ - MyMoneyTransaction(const QDomElement& node, const bool forceId = true); + MyMoneyTransaction(const TQDomElement& node, const bool forceId = true); ~MyMoneyTransaction(); public: - friend QDataStream &operator<<(QDataStream &, MyMoneyTransaction &); - friend QDataStream &operator>>(QDataStream &, MyMoneyTransaction &); + friend TQDataStream &operator<<(TQDataStream &, MyMoneyTransaction &); + friend TQDataStream &operator>>(TQDataStream &, MyMoneyTransaction &); // Simple get operations - const QDate& entryDate(void) const { return m_entryDate; }; - const QDate& postDate(void) const { return m_postDate; }; - const QString& memo(void) const { return m_memo; }; - const QValueList& splits(void) const { return m_splits; }; - QValueList& splits(void) { return m_splits; }; + const TQDate& entryDate(void) const { return m_entryDate; }; + const TQDate& postDate(void) const { return m_postDate; }; + const TQString& memo(void) const { return m_memo; }; + const TQValueList& splits(void) const { return m_splits; }; + TQValueList& splits(void) { return m_splits; }; unsigned int splitCount(void) const { return m_splits.count(); }; - const QString& commodity(void) const { return m_commodity; }; - const QString& bankID(void) const /*__attribute__ ((deprecated))*/ { return m_bankID; }; + const TQString& commodity(void) const { return m_commodity; }; + const TQString& bankID(void) const /*__attribute__ ((deprecated))*/ { return m_bankID; }; // Simple set operations - void setPostDate(const QDate& date); - void setEntryDate(const QDate& date); - void setMemo(const QString& memo); - void setCommodity(const QString& commodityId) { m_commodity = commodityId; }; - void setBankID(const QString& bankID) /*__attribute__ ((deprecated))*/ { m_bankID = bankID; }; + void setPostDate(const TQDate& date); + void setEntryDate(const TQDate& date); + void setMemo(const TQString& memo); + void setCommodity(const TQString& commodityId) { m_commodity = commodityId; }; + void setBankID(const TQString& bankID) /*__attribute__ ((deprecated))*/ { m_bankID = bankID; }; bool operator == (const MyMoneyTransaction&) const; inline bool operator != (const MyMoneyTransaction& r) const { return !(*this == r); }; @@ -100,7 +100,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitByAccount(const QString& accountId, const bool match = true) const; + const MyMoneySplit& splitByAccount(const TQString& accountId, const bool match = true) const; /** * This method is essentially the same as the previous method, except that @@ -112,7 +112,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitByAccount(const QStringList& accountIds, const bool match = true) const; + const MyMoneySplit& splitByAccount(const TQStringList& accountIds, const bool match = true) const; /** * This method is used to extract a split from a transaction. @@ -121,7 +121,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitById(const QString& splitId) const; + const MyMoneySplit& splitById(const TQString& splitId) const; /** * This method is used to extract a split for a given payeeId @@ -131,7 +131,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitByPayee(const QString& payeeId) const; + const MyMoneySplit& splitByPayee(const TQString& payeeId) const; /** * This method is used to check if the given account is used @@ -139,7 +139,7 @@ public: * * @param id account id that should be checked for usage */ - bool accountReferenced(const QString& id) const; + bool accountReferenced(const TQString& id) const; /** * This method is used to add a split to the transaction. The split @@ -237,11 +237,11 @@ public: * out the split that references the account through which a transaction * was entered. * - * @return QString with ID of the first split of transactions + * @return TQString with ID of the first split of transactions */ - static const QString firstSplitID(void); + static const TQString firstSplitID(void); - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -252,7 +252,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * Checks whether any split contains an autocalc split. @@ -277,9 +277,9 @@ public: * the number of splits referencing this account. The default for * this parameter is @p false. */ - QString accountSignature(bool includeSplitCount = false) const; + TQString accountSignature(bool includeSplitCount = false) const; - QString uniqueSortKey(void) const; + TQString uniqueSortKey(void) const; /** * This module implements an algorithm used by P.J. Weinberger @@ -293,13 +293,13 @@ public: * @param h initial hash value (default 0) * @return non-unique hash value of the text @p txt */ - static unsigned long hash(const QString& txt, unsigned long h = 0); + static unsigned long hash(const TQString& txt, unsigned long h = 0); private: /** * This method returns the next id to be used for a split */ - const QString nextSplitID(void); + const TQString nextSplitID(void); private: static const int SPLIT_ID_SIZE = 4; @@ -308,22 +308,22 @@ private: * This member contains the date when the transaction was entered * into the engine */ - QDate m_entryDate; + TQDate m_entryDate; /** * This member contains the date the transaction was posted */ - QDate m_postDate; + TQDate m_postDate; /** * This member keeps the memo text associated with this transaction */ - QString m_memo; + TQString m_memo; /** * This member contains the splits for this transaction */ - QValueList m_splits; + TQValueList m_splits; /** * This member keeps the unique numbers of splits within this @@ -335,7 +335,7 @@ private: /** * This member keeps the base commodity (e.g. currency) for this transaction */ - QString m_commodity; + TQString m_commodity; /** * This member keeps the bank's unique ID for the transaction, so we can @@ -343,7 +343,7 @@ private: * * Note this is now deprecated! Bank ID's should be set on splits, not transactions. */ - QString m_bankID; + TQString m_bankID; /** constants for unique sort key */ static const int YEAR_SIZE = 4; diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.cpp b/kmymoney2/mymoney/mymoneytransactionfilter.cpp index 317400d..d6f4b6a 100644 --- a/kmymoney2/mymoney/mymoneytransactionfilter.cpp +++ b/kmymoney2/mymoney/mymoneytransactionfilter.cpp @@ -40,7 +40,7 @@ MyMoneyTransactionFilter::MyMoneyTransactionFilter() m_invertText = false; } -MyMoneyTransactionFilter::MyMoneyTransactionFilter(const QString& id) +MyMoneyTransactionFilter::MyMoneyTransactionFilter(const TQString& id) { m_filterSet.allFilter = 0; m_reportAllSplits = false; @@ -66,8 +66,8 @@ void MyMoneyTransactionFilter::clear(void) m_states.clear(); m_validity.clear(); m_matchingSplits.clear(); - m_fromDate = QDate(); - m_toDate = QDate(); + m_fromDate = TQDate(); + m_toDate = TQDate(); } void MyMoneyTransactionFilter::clearAccountFilter(void) @@ -76,26 +76,26 @@ void MyMoneyTransactionFilter::clearAccountFilter(void) m_accounts.clear(); } -void MyMoneyTransactionFilter::setTextFilter(const QRegExp& text, bool invert) +void MyMoneyTransactionFilter::setTextFilter(const TQRegExp& text, bool invert) { m_filterSet.singleFilter.textFilter = 1; m_invertText = invert; m_text = text; } -void MyMoneyTransactionFilter::addAccount(const QStringList& ids) +void MyMoneyTransactionFilter::addAccount(const TQStringList& ids) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; m_filterSet.singleFilter.accountFilter = 1; for(it = ids.begin(); it != ids.end(); ++it) addAccount(*it); } -void MyMoneyTransactionFilter::addAccount(const QString& id) +void MyMoneyTransactionFilter::addAccount(const TQString& id) { if(!m_accounts.isEmpty() && !id.isEmpty()) { - if(m_accounts.find(id) != 0) + if(m_accounts.tqfind(id) != 0) return; } if(m_accounts.count() >= m_accounts.size()*2) { @@ -106,19 +106,19 @@ void MyMoneyTransactionFilter::addAccount(const QString& id) m_accounts.insert(id, ""); } -void MyMoneyTransactionFilter::addCategory(const QStringList& ids) +void MyMoneyTransactionFilter::addCategory(const TQStringList& ids) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; m_filterSet.singleFilter.categoryFilter = 1; for(it = ids.begin(); it != ids.end(); ++it) addCategory(*it); } -void MyMoneyTransactionFilter::addCategory(const QString& id) +void MyMoneyTransactionFilter::addCategory(const TQString& id) { if(!m_categories.isEmpty() && !id.isEmpty()) { - if(m_categories.find(id) != 0) + if(m_categories.tqfind(id) != 0) return; } if(m_categories.count() >= m_categories.size()*2) { @@ -129,7 +129,7 @@ void MyMoneyTransactionFilter::addCategory(const QString& id) m_categories.insert(id, ""); } -void MyMoneyTransactionFilter::setDateFilter(const QDate& from, const QDate& to) +void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to) { m_filterSet.singleFilter.dateFilter = from.isValid() | to.isValid(); m_fromDate = from; @@ -150,10 +150,10 @@ void MyMoneyTransactionFilter::setAmountFilter(const MyMoneyMoney& from, const M } } -void MyMoneyTransactionFilter::addPayee(const QString& id) +void MyMoneyTransactionFilter::addPayee(const TQString& id) { if(!m_payees.isEmpty() && !id.isEmpty()) { - if(m_payees.find(id) != 0) + if(m_payees.tqfind(id) != 0) return; } if(m_payees.count() >= m_payees.size()*2) { @@ -167,11 +167,11 @@ void MyMoneyTransactionFilter::addPayee(const QString& id) void MyMoneyTransactionFilter::addType(const int type) { if(!m_types.isEmpty()) { - if(m_types.find(type) != 0) + if(m_types.tqfind(type) != 0) return; } // we don't have more than 4 or 5 types, so we don't worry about - // the size of the QIntDict object. + // the size of the TQIntDict object. m_filterSet.singleFilter.typeFilter = 1; m_types.insert(type, ""); } @@ -179,11 +179,11 @@ void MyMoneyTransactionFilter::addType(const int type) void MyMoneyTransactionFilter::addState(const int state) { if(!m_states.isEmpty()) { - if(m_states.find(state) != 0) + if(m_states.tqfind(state) != 0) return; } // we don't have more than 4 or 5 states, so we don't worry about - // the size of the QIntDict object. + // the size of the TQIntDict object. m_filterSet.singleFilter.stateFilter = 1; m_states.insert(state, ""); } @@ -191,16 +191,16 @@ void MyMoneyTransactionFilter::addState(const int state) void MyMoneyTransactionFilter::addValidity(const int type) { if(!m_validity.isEmpty()) { - if(m_validity.find(type) != 0) + if(m_validity.tqfind(type) != 0) return; } // we don't have more than 4 or 5 states, so we don't worry about - // the size of the QIntDict object. + // the size of the TQIntDict object. m_filterSet.singleFilter.validityFilter = 1; m_validity.insert(type, ""); } -void MyMoneyTransactionFilter::setNumberFilter(const QString& from, const QString& to) +void MyMoneyTransactionFilter::setNumberFilter(const TQString& from, const TQString& to) { m_filterSet.singleFilter.nrFilter = 1; m_fromNr = from; @@ -217,7 +217,7 @@ void MyMoneyTransactionFilter::setConsiderCategory(const bool check) m_considerCategory = check; } -const QValueList& MyMoneyTransactionFilter::matchingSplits(void) const +const TQValueList& MyMoneyTransactionFilter::matchingSplits(void) const { return m_matchingSplits; } @@ -230,18 +230,18 @@ bool MyMoneyTransactionFilter::matchText(const MyMoneySplit * const sp) const MyMoneyFile* file = MyMoneyFile::instance(); const MyMoneyAccount& acc = file->account(sp->accountId()); const MyMoneySecurity& sec = file->security(acc.currencyId()); - if(sp->memo().contains(m_text) - || sp->shares().formatMoney(acc.fraction(sec)).contains(m_text) - || sp->value().formatMoney(acc.fraction(sec)).contains(m_text) - || sp->number().contains(m_text)) + if(sp->memo().tqcontains(m_text) + || sp->shares().formatMoney(acc.fraction(sec)).tqcontains(m_text) + || sp->value().formatMoney(acc.fraction(sec)).tqcontains(m_text) + || sp->number().tqcontains(m_text)) return !m_invertText; - if(acc.name().contains(m_text)) + if(acc.name().tqcontains(m_text)) return !m_invertText; if(!sp->payeeId().isEmpty()) { const MyMoneyPayee& payee = file->payee(sp->payeeId()); - if(payee.name().contains(m_text)) + if(payee.name().tqcontains(m_text)) return !m_invertText; } return m_invertText; @@ -268,7 +268,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneySplit * const sp) const bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; m_matchingSplits.clear(); @@ -286,12 +286,12 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the date range if(m_filterSet.singleFilter.dateFilter) { - if(m_fromDate != QDate()) { + if(m_fromDate != TQDate()) { if(transaction.postDate() < m_fromDate) return false; } - if(m_toDate != QDate()) { + if(m_toDate != TQDate()) { if(transaction.postDate() > m_toDate) return false; } @@ -300,7 +300,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // construct a local list of pointers to all splits and // remove the ones that do not match account and/or categories. - QPtrList matchingSplits; + TQPtrList matchingSplits; for(it = transaction.splits().begin(); it != transaction.splits().end(); ++it) { matchingSplits.append(&(*it)); } @@ -312,7 +312,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the transaction's validity if(m_filterSet.singleFilter.validityFilter) { if(m_validity.count() > 0) { - if(!m_validity.find(validTransaction(transaction))) + if(!m_validity.tqfind(validTransaction(transaction))) return false; } } @@ -332,7 +332,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check if the split references one of the categories in the list if(m_filterSet.singleFilter.categoryFilter) { if(m_categories.count() > 0) { - if(m_categories.find(sp->accountId())) { + if(m_categories.tqfind(sp->accountId())) { categoryMatched = true; removeSplit = 0; } @@ -347,7 +347,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check if the split references one of the accounts in the list if(m_filterSet.singleFilter.accountFilter) { if(m_accounts.count() > 0) { - if(m_accounts.find(sp->accountId())) { + if(m_accounts.tqfind(sp->accountId())) { accountMatched = true; removeSplit = 0; } @@ -361,7 +361,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) } else { if(m_filterSet.singleFilter.accountFilter) { if(m_accounts.count() > 0) { - if(m_accounts.find(sp->accountId())) { + if(m_accounts.tqfind(sp->accountId())) { accountMatched = true; removeSplit = 0; } @@ -420,7 +420,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the payee list if(!removeSplit && m_filterSet.singleFilter.payeeFilter) { if(m_payees.count() > 0) { - if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId())) + if(sp->payeeId().isEmpty() || !m_payees.tqfind(sp->payeeId())) removeSplit = sp; } else if(!sp->payeeId().isEmpty()) removeSplit = sp; @@ -429,7 +429,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the type list if(!removeSplit && m_filterSet.singleFilter.typeFilter) { if(m_types.count() > 0) { - if(!m_types.find(splitType(transaction, *sp))) + if(!m_types.tqfind(splitType(transaction, *sp))) removeSplit = sp; } } @@ -437,7 +437,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the state list if(!removeSplit && m_filterSet.singleFilter.stateFilter) { if(m_states.count() > 0) { - if(!m_states.find(splitState(*sp))) + if(!m_states.tqfind(splitState(*sp))) removeSplit = sp; } } @@ -512,7 +512,7 @@ int MyMoneyTransactionFilter::splitType(const MyMoneyTransaction& t, const MyMon return allTypes; if(t.splitCount() == 2) { - QString ida, idb; + TQString ida, idb; ida = t.splits()[0].accountId(); idb = t.splits()[1].accountId(); @@ -533,7 +533,7 @@ int MyMoneyTransactionFilter::splitType(const MyMoneyTransaction& t, const MyMon MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransaction(const MyMoneyTransaction& t) const { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; MyMoneyMoney val; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { @@ -542,22 +542,22 @@ MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransac return (val == MyMoneyMoney(0,1)) ? valid : invalid; } -bool MyMoneyTransactionFilter::includesCategory( const QString& cat ) const +bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const { - return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat ); + return (! m_filterSet.singleFilter.categoryFilter) || m_categories.tqfind( cat ); } -bool MyMoneyTransactionFilter::includesAccount( const QString& acc ) const +bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const { - return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc ); + return (! m_filterSet.singleFilter.accountFilter) || m_accounts.tqfind( acc ); } -bool MyMoneyTransactionFilter::includesPayee( const QString& pye ) const +bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const { - return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye ); + return (! m_filterSet.singleFilter.payeeFilter) || m_payees.tqfind( pye ); } -bool MyMoneyTransactionFilter::dateFilter( QDate& from, QDate& to ) const +bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const { from = m_fromDate; to = m_toDate; @@ -571,20 +571,20 @@ bool MyMoneyTransactionFilter::amountFilter( MyMoneyMoney& from, MyMoneyMoney& t return m_filterSet.singleFilter.amountFilter==1; } -bool MyMoneyTransactionFilter::numberFilter( QString& from, QString& to ) const +bool MyMoneyTransactionFilter::numberFilter( TQString& from, TQString& to ) const { from = m_fromNr; to = m_toNr; return m_filterSet.singleFilter.nrFilter==1; } -bool MyMoneyTransactionFilter::payees(QStringList& list) const +bool MyMoneyTransactionFilter::payees(TQStringList& list) const { bool result = m_filterSet.singleFilter.payeeFilter; if ( result ) { - QAsciiDictIterator it_payee( m_payees ); + TQAsciiDictIterator it_payee( m_payees ); while ( it_payee.current() ) { list += it_payee.currentKey(); @@ -594,16 +594,16 @@ bool MyMoneyTransactionFilter::payees(QStringList& list) const return result; } -bool MyMoneyTransactionFilter::accounts(QStringList& list) const +bool MyMoneyTransactionFilter::accounts(TQStringList& list) const { bool result = m_filterSet.singleFilter.accountFilter; if ( result ) { - QAsciiDictIterator it_account( m_accounts ); + TQAsciiDictIterator it_account( m_accounts ); while ( it_account.current() ) { - QString account = it_account.currentKey(); + TQString account = it_account.currentKey(); list += account; ++it_account; } @@ -611,13 +611,13 @@ bool MyMoneyTransactionFilter::accounts(QStringList& list) const return result; } -bool MyMoneyTransactionFilter::categories(QStringList& list) const +bool MyMoneyTransactionFilter::categories(TQStringList& list) const { bool result = m_filterSet.singleFilter.categoryFilter; if ( result ) { - QAsciiDictIterator it_category( m_categories ); + TQAsciiDictIterator it_category( m_categories ); while ( it_category.current() ) { list += it_category.currentKey(); @@ -627,13 +627,13 @@ bool MyMoneyTransactionFilter::categories(QStringList& list) const return result; } -bool MyMoneyTransactionFilter::types(QValueList& list) const +bool MyMoneyTransactionFilter::types(TQValueList& list) const { bool result = m_filterSet.singleFilter.typeFilter; if ( result ) { - QIntDictIterator it_type( m_types ); + TQIntDictIterator it_type( m_types ); while ( it_type.current() ) { list += it_type.currentKey(); @@ -643,13 +643,13 @@ bool MyMoneyTransactionFilter::types(QValueList& list) const return result; } -bool MyMoneyTransactionFilter::states(QValueList& list) const +bool MyMoneyTransactionFilter::states(TQValueList& list) const { bool result = m_filterSet.singleFilter.stateFilter; if ( result ) { - QIntDictIterator it_state( m_states ); + TQIntDictIterator it_state( m_states ); while ( it_state.current() ) { list += it_state.currentKey(); @@ -665,7 +665,7 @@ bool MyMoneyTransactionFilter::firstType(int&i) const if ( result ) { - QIntDictIterator it_type( m_types ); + TQIntDictIterator it_type( m_types ); if ( it_type.current() ) i = it_type.currentKey(); } @@ -678,14 +678,14 @@ bool MyMoneyTransactionFilter::firstState(int&i) const if ( result ) { - QIntDictIterator it_state( m_states ); + TQIntDictIterator it_state( m_states ); if ( it_state.current() ) i = it_state.currentKey(); } return result; } -bool MyMoneyTransactionFilter::textFilter(QRegExp& exp) const +bool MyMoneyTransactionFilter::textFilter(TQRegExp& exp) const { exp = m_text; return m_filterSet.singleFilter.textFilter == 1; @@ -693,7 +693,7 @@ bool MyMoneyTransactionFilter::textFilter(QRegExp& exp) const void MyMoneyTransactionFilter::setDateFilter(dateOptionE range) { - QDate from, to; + TQDate from, to; if ( translateDateRange(range,from,to) ) setDateFilter(from,to); } @@ -707,132 +707,132 @@ void MyMoneyTransactionFilter::setFiscalYearStart(int firstMonth, int firstDay) fiscalYearStartDay = firstDay; } -bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, QDate& start, QDate& end) +bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, TQDate& end) { bool rc = true; int yr, mon, day; - yr = QDate::currentDate().year(); - mon = QDate::currentDate().month(); - day = QDate::currentDate().day(); - QDate tmp; + yr = TQDate::tqcurrentDate().year(); + mon = TQDate::tqcurrentDate().month(); + day = TQDate::tqcurrentDate().day(); + TQDate tmp; switch(id) { case MyMoneyTransactionFilter::allDates: - start = QDate(); - end = QDate(); + start = TQDate(); + end = TQDate(); break; case MyMoneyTransactionFilter::asOfToday: - start = QDate(); - end = QDate::currentDate(); + start = TQDate(); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::currentMonth: - start = QDate(yr,mon,1); - end = QDate(yr,mon,1).addMonths(1).addDays(-1); + start = TQDate(yr,mon,1); + end = TQDate(yr,mon,1).addMonths(1).addDays(-1); break; case MyMoneyTransactionFilter::currentYear: - start = QDate(yr,1,1); - end = QDate(yr,12,31); + start = TQDate(yr,1,1); + end = TQDate(yr,12,31); break; case MyMoneyTransactionFilter::monthToDate: - start = QDate(yr,mon,1); - end = QDate::currentDate(); + start = TQDate(yr,mon,1); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::yearToDate: - start = QDate(yr,1,1); - end = QDate::currentDate(); + start = TQDate(yr,1,1); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::yearToMonth: - start = QDate(yr,1,1); - end = QDate(yr,mon,1).addDays(-1); + start = TQDate(yr,1,1); + end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::lastMonth: - start = QDate(yr,mon,1).addMonths(-1); - end = QDate(yr,mon,1).addDays(-1); + start = TQDate(yr,mon,1).addMonths(-1); + end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::lastYear: - start = QDate(yr,1,1).addYears(-1); - end = QDate(yr,12,31).addYears(-1); + start = TQDate(yr,1,1).addYears(-1); + end = TQDate(yr,12,31).addYears(-1); break; case MyMoneyTransactionFilter::last7Days: - start = QDate::currentDate().addDays(-7); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addDays(-7); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last30Days: - start = QDate::currentDate().addDays(-30); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addDays(-30); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last3Months: - start = QDate::currentDate().addMonths(-3); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addMonths(-3); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last6Months: - start = QDate::currentDate().addMonths(-6); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addMonths(-6); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last11Months: - start = QDate(yr,mon,1).addMonths(-12); - end = QDate(yr,mon,1).addDays(-1); + start = TQDate(yr,mon,1).addMonths(-12); + end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::last12Months: - start = QDate::currentDate().addMonths(-12); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addMonths(-12); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::next7Days: - start = QDate::currentDate(); - end = QDate::currentDate().addDays(7); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addDays(7); break; case MyMoneyTransactionFilter::next30Days: - start = QDate::currentDate(); - end = QDate::currentDate().addDays(30); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addDays(30); break; case MyMoneyTransactionFilter::next3Months: - start = QDate::currentDate(); - end = QDate::currentDate().addMonths(3); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addMonths(3); break; case MyMoneyTransactionFilter::next6Months: - start = QDate::currentDate(); - end = QDate::currentDate().addMonths(6); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addMonths(6); break; case MyMoneyTransactionFilter::next12Months: - start = QDate::currentDate(); - end = QDate::currentDate().addMonths(12); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addMonths(12); break; case MyMoneyTransactionFilter::userDefined: - start = QDate(); - end = QDate(); + start = TQDate(); + end = TQDate(); break; case MyMoneyTransactionFilter::last3ToNext3Months: - start = QDate::currentDate().addMonths(-3); - end = QDate::currentDate().addMonths(3); + start = TQDate::tqcurrentDate().addMonths(-3); + end = TQDate::tqcurrentDate().addMonths(3); break; case MyMoneyTransactionFilter::currentQuarter: - start = QDate(yr, mon - ((mon-1) % 3), 1); + start = TQDate(yr, mon - ((mon-1) % 3), 1); end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::lastQuarter: - start = QDate(yr, mon - ((mon-1) % 3), 1).addMonths(-3); + start = TQDate(yr, mon - ((mon-1) % 3), 1).addMonths(-3); end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::nextQuarter: - start = QDate(yr, mon - ((mon-1) % 3), 1).addMonths(3); + start = TQDate(yr, mon - ((mon-1) % 3), 1).addMonths(3); end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::currentFiscalYear: - start = QDate(QDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); - if(QDate::currentDate() < start) + start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); + if(TQDate::tqcurrentDate() < start) start = start.addYears(-1); end = start.addYears(1).addDays(-1); break; case MyMoneyTransactionFilter::lastFiscalYear: - start = QDate(QDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); - if(QDate::currentDate() < start) + start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); + if(TQDate::tqcurrentDate() < start) start = start.addYears(-1); start = start.addYears(-1); end = start.addYears(1).addDays(-1); break; case MyMoneyTransactionFilter::today: - start = QDate::currentDate(); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate(); break; default: qFatal("Unknown date identifier %d in MyMoneyTransactionFilter::translateDateRange()", id); @@ -842,16 +842,16 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, QDate& start, return rc; } -void MyMoneyTransactionFilter::removeReference(const QString& id) +void MyMoneyTransactionFilter::removeReference(const TQString& id) { - if(m_accounts.find(id)) { - qDebug("%s", (QString("Remove account '%1' from report").arg(id)).data()); + if(m_accounts.tqfind(id)) { + qDebug("%s", (TQString("Remove account '%1' from report").tqarg(id)).data()); m_accounts.remove(id); - } else if(m_categories.find(id)) { - qDebug("%s", (QString("Remove category '%1' from report").arg(id)).data()); + } else if(m_categories.tqfind(id)) { + qDebug("%s", (TQString("Remove category '%1' from report").tqarg(id)).data()); m_categories.remove(id); - } else if(m_payees.find(id)) { - qDebug("%s", (QString("Remove payee '%1' from report").arg(id)).data()); + } else if(m_payees.tqfind(id)) { + qDebug("%s", (TQString("Remove payee '%1' from report").tqarg(id)).data()); m_payees.remove(id); } } diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.h b/kmymoney2/mymoney/mymoneytransactionfilter.h index edad9cc..50226cf 100644 --- a/kmymoney2/mymoney/mymoneytransactionfilter.h +++ b/kmymoney2/mymoney/mymoneytransactionfilter.h @@ -30,12 +30,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -160,7 +160,7 @@ public: * * @param id reference to account id */ - MyMoneyTransactionFilter(const QString& id); + MyMoneyTransactionFilter(const TQString& id); ~MyMoneyTransactionFilter(); @@ -190,7 +190,7 @@ public: * @param invert If true, value must not be contained in any of the above mentioned fields * */ - void setTextFilter(const QRegExp& exp, bool invert = false); + void setTextFilter(const TQRegExp& exp, bool invert = false); /** * This method will add the account with id @p id to the list of matching accounts. @@ -198,13 +198,13 @@ public: * * @param id internal ID of the account */ - void addAccount(const QString& id); + void addAccount(const TQString& id); /** * This is a convenience method and behaves exactly like the above * method but for a list of id's. */ - void addAccount(const QStringList& ids); + void addAccount(const TQStringList& ids); /** * This method will add the category with id @p id to the list of matching categories. @@ -212,25 +212,25 @@ public: * * @param id internal ID of the account */ - void addCategory(const QString& id); + void addCategory(const TQString& id); /** * This is a convenience method and behaves exactly like the above * method but for a list of id's. */ - void addCategory(const QStringList& ids); + void addCategory(const TQStringList& ids); /** * This method sets the date filter to match only transactions with posting dates in - * the date range specified by @p from and @p to. If @p from equal QDate() - * all transactions with dates prior to @p to match. If @p to equals QDate() + * the date range specified by @p from and @p to. If @p from equal TQDate() + * all transactions with dates prior to @p to match. If @p to equals TQDate() * all transactions with posting dates past @p from match. If @p from and @p to - * are equal QDate() the filter is not activated and all transactions match. + * are equal TQDate() the filter is not activated and all transactions match. * * @param from from date * @param to to date */ - void setDateFilter(const QDate& from, const QDate& to); + void setDateFilter(const TQDate& from, const TQDate& to); void setDateFilter(dateOptionE range); @@ -251,7 +251,7 @@ public: * * @param id internal id of the payee */ - void addPayee(const QString& id); + void addPayee(const TQString& id); /** */ @@ -276,7 +276,7 @@ public: * * @note @p from and @p to can contain alphanumeric text */ - void setNumberFilter(const QString& from, const QString& to); + void setNumberFilter(const TQString& from, const TQString& to); /** * This method is used to check a specific transaction against the filter. @@ -355,27 +355,27 @@ public: * * @note The constructors set m_reportAllSplits differently. Please * see the documentation of the constructors MyMoneyTransactionFilter() - * and MyMoneyTransactionFilter(const QString&) for details. + * and MyMoneyTransactionFilter(const TQString&) for details. */ - const QValueList& matchingSplits(void) const; + const TQValueList& matchingSplits(void) const; /** * This method returns the from date set in the filter. If - * no value has been set up for this filter, then QDate() is + * no value has been set up for this filter, then TQDate() is * returned. * * @return returns m_fromDate */ - const QDate fromDate(void) const { return m_fromDate; }; + const TQDate fromDate(void) const { return m_fromDate; }; /** * This method returns the to date set in the filter. If - * no value has been set up for this filter, then QDate() is + * no value has been set up for this filter, then TQDate() is * returned. * * @return returns m_toDate */ - const QDate toDate(void) const { return m_toDate; }; + const TQDate toDate(void) const { return m_toDate; }; /** * This method is used to return information about the @@ -386,7 +386,7 @@ public: * @param cat id of category in question * @return true if category is in filter set, false otherwise */ - bool includesCategory( const QString& cat ) const; + bool includesCategory( const TQString& cat ) const; /** * This method is used to return information about the @@ -397,7 +397,7 @@ public: * @param acc id of account in question * @return true if account is in filter set, false otherwise */ - bool includesAccount( const QString& acc ) const; + bool includesAccount( const TQString& acc ) const; /** * This method is used to return information about the @@ -408,7 +408,7 @@ public: * @param pye id of payee in question * @return true if payee is in filter set, false otherwise */ - bool includesPayee( const QString& pye ) const; + bool includesPayee( const TQString& pye ) const; /** * This method is used to return information about the @@ -418,7 +418,7 @@ public: * @param to result value for the end of the date range * @return true if an amount filter is set */ - bool dateFilter( QDate& from, QDate& to ) const; + bool dateFilter( TQDate& from, TQDate& to ) const; /** * This method is used to return information about the @@ -438,7 +438,7 @@ public: * @param to result value for the high end of the number range * @return true if a number filter is set */ - bool numberFilter( QString& from, QString& to ) const; + bool numberFilter( TQString& from, TQString& to ) const; /** * This method returns whether a payee filter has been set, @@ -447,7 +447,7 @@ public: * @param list list to append payees into * @return return true if a payee filter has been set */ - bool payees(QStringList& list) const; + bool payees(TQStringList& list) const; /** * This method returns whether an account filter has been set, @@ -456,7 +456,7 @@ public: * @param list list to append accounts into * @return return true if an account filter has been set */ - bool accounts(QStringList& list) const; + bool accounts(TQStringList& list) const; /** * This method returns whether a category filter has been set, @@ -465,7 +465,7 @@ public: * @param list list to append categories into * @return return true if a category filter has been set */ - bool categories(QStringList& list) const; + bool categories(TQStringList& list) const; /** * This method returns whether a type filter has been set, @@ -476,7 +476,7 @@ public: */ bool firstType(int& i) const; - bool types(QValueList& list) const; + bool types(TQValueList& list) const; /** * This method returns whether a state filter has been set, @@ -487,7 +487,7 @@ public: */ bool firstState(int& i) const; - bool states(QValueList& list) const; + bool states(TQValueList& list) const; /** * This method returns whether a text filter has been set, * and if so, it returns the text filter. @@ -495,7 +495,7 @@ public: * @param text regexp to replace with text filter, or blank if none set * @return return true if a text filter has been set */ - bool textFilter(QRegExp& text) const; + bool textFilter(TQRegExp& text) const; /** * This method returns whether the text filter should return @@ -504,15 +504,15 @@ public: bool isInvertingText(void) const {return m_invertText;}; /** - * This method translates a plain-language date range into QDate + * This method translates a plain-language date range into TQDate * start & end * * @param range Plain-language range of dates, e.g. 'CurrentYear' - * @param start QDate will be set to corresponding to the first date in @p range - * @param end QDate will be set to corresponding to the last date in @p range + * @param start TQDate will be set to corresponding to the first date in @p range + * @param end TQDate will be set to corresponding to the last date in @p range * @return return true if a range was successfully set, or false if @p range was invalid */ - static bool translateDateRange(dateOptionE range, QDate& start, QDate& end); + static bool translateDateRange(dateOptionE range, TQDate& start, TQDate& end); static void setFiscalYearStart(int firstMonth, int firstDay); @@ -522,7 +522,7 @@ public: * This member removes all references to object identified by @p id. Used * to remove objects which are about to be removed from the engine. */ - void removeReference(const QString& id); + void removeReference(const TQString& id); private: /** @@ -561,18 +561,18 @@ protected: bool m_reportAllSplits; bool m_considerCategory; - QRegExp m_text; + TQRegExp m_text; bool m_invertText; - QAsciiDict m_accounts; - QAsciiDict m_payees; - QAsciiDict m_categories; - QIntDict m_states; - QIntDict m_types; - QIntDict m_validity; - QString m_fromNr, m_toNr; - QDate m_fromDate, m_toDate; + TQAsciiDict m_accounts; + TQAsciiDict m_payees; + TQAsciiDict m_categories; + TQIntDict m_states; + TQIntDict m_types; + TQIntDict m_validity; + TQString m_fromNr, m_toNr; + TQDate m_fromDate, m_toDate; MyMoneyMoney m_fromAmount, m_toAmount; - QValueList m_matchingSplits; + TQValueList m_matchingSplits; }; #endif diff --git a/kmymoney2/mymoney/mymoneytransactiontest.cpp b/kmymoney2/mymoney/mymoneytransactiontest.cpp index 11af6b3..155dfe0 100644 --- a/kmymoney2/mymoney/mymoneytransactiontest.cpp +++ b/kmymoney2/mymoney/mymoneytransactiontest.cpp @@ -31,16 +31,16 @@ void MyMoneyTransactionTest::tearDown () { void MyMoneyTransactionTest::testEmptyConstructor() { CPPUNIT_ASSERT(m->id().isEmpty()); - CPPUNIT_ASSERT(m->entryDate() == QDate()); + CPPUNIT_ASSERT(m->entryDate() == TQDate()); CPPUNIT_ASSERT(m->memo().isEmpty()); CPPUNIT_ASSERT(m->splits().count() == 0); } void MyMoneyTransactionTest::testSetFunctions() { m->setMemo("Memo"); - m->setPostDate(QDate(1,2,3)); + m->setPostDate(TQDate(1,2,3)); - CPPUNIT_ASSERT(m->postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(m->postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(m->memo() == "Memo"); } @@ -49,9 +49,9 @@ void MyMoneyTransactionTest::testConstructor() { MyMoneyTransaction a("ID", *m); CPPUNIT_ASSERT(a.id() == "ID"); - CPPUNIT_ASSERT(a.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(a.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.memo() == "Memo"); - CPPUNIT_ASSERT(a.postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(a.postDate() == TQDate(1,2,3)); } void MyMoneyTransactionTest::testCopyConstructor() { @@ -62,9 +62,9 @@ void MyMoneyTransactionTest::testCopyConstructor() { MyMoneyTransaction n(a); CPPUNIT_ASSERT(n.id() == "ID"); - CPPUNIT_ASSERT(n.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.value("Key") == "Value"); } @@ -78,9 +78,9 @@ void MyMoneyTransactionTest::testAssignmentConstructor() { n = a; CPPUNIT_ASSERT(n.id() == "ID"); - CPPUNIT_ASSERT(n.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.value("Key") == "Value"); } @@ -98,7 +98,7 @@ void MyMoneyTransactionTest::testInequality() { MyMoneyTransaction n(*m); - n.setPostDate(QDate(1,1,1)); + n.setPostDate(TQDate(1,1,1)); CPPUNIT_ASSERT(!(n == *m)); CPPUNIT_ASSERT(n != *m); @@ -259,7 +259,7 @@ void MyMoneyTransactionTest::testExtractSplit() { // this one should fail, as the account is not referenced by // any split in the transaction try { - split = m->splitByAccount(QString("A000003")); + split = m->splitByAccount(TQString("A000003")); CPPUNIT_FAIL("Exception expected"); } catch(MyMoneyException *e) { delete e; @@ -267,7 +267,7 @@ void MyMoneyTransactionTest::testExtractSplit() { // this one should be found try { - split = m->splitByAccount(QString("A000002")); + split = m->splitByAccount(TQString("A000002")); CPPUNIT_ASSERT(split.id() == "S0002"); } catch(MyMoneyException *e) { @@ -277,7 +277,7 @@ void MyMoneyTransactionTest::testExtractSplit() { // this one should be found also try { - split = m->splitByAccount(QString("A000002"), false); + split = m->splitByAccount(TQString("A000002"), false); CPPUNIT_ASSERT(split.id() == "S0001"); } catch(MyMoneyException *e) { CPPUNIT_FAIL("Unexpected exception!"); @@ -373,7 +373,7 @@ void MyMoneyTransactionTest::testModifyDuplicateAccount() { testAddSplits(); MyMoneySplit split; - split = m->splitByAccount(QString("A000002")); + split = m->splitByAccount(TQString("A000002")); split.setAccountId("A000001"); try { m->modifySplit(split); @@ -387,8 +387,8 @@ void MyMoneyTransactionTest::testModifyDuplicateAccount() { } void MyMoneyTransactionTest::testWriteXML() { MyMoneyTransaction t; - t.setPostDate(QDate(2001,12,28)); - t.setEntryDate(QDate(2003,9,29)); + t.setPostDate(TQDate(2001,12,28)); + t.setEntryDate(TQDate(2003,9,29)); t.setId("T000000000000000001"); t.setMemo("Wohnung:Miete"); t.setCommodity("EUR"); @@ -404,12 +404,12 @@ void MyMoneyTransactionTest::testWriteXML() { s.setBankID("SPID"); t.addSplit(s); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("TRANSACTION-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("TRANSACTION-CONTAINER"); doc.appendChild(el); t.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "\n" "\n" " \n" @@ -430,7 +430,7 @@ void MyMoneyTransactionTest::testWriteXML() { void MyMoneyTransactionTest::testReadXML() { MyMoneyTransaction t; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" " \n" @@ -444,7 +444,7 @@ void MyMoneyTransactionTest::testReadXML() { "\n" ); - QString ref_false = QString( + TQString ref_false = TQString( "\n" "\n" " \n" @@ -458,8 +458,8 @@ void MyMoneyTransactionTest::testReadXML() { "\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -476,8 +476,8 @@ void MyMoneyTransactionTest::testReadXML() { t.setValue("key", "VALUE"); try { t = MyMoneyTransaction(node); - CPPUNIT_ASSERT(t.m_postDate == QDate(2001,12,28)); - CPPUNIT_ASSERT(t.m_entryDate == QDate(2003,9,29)); + CPPUNIT_ASSERT(t.m_postDate == TQDate(2001,12,28)); + CPPUNIT_ASSERT(t.m_entryDate == TQDate(2003,9,29)); CPPUNIT_ASSERT(t.id() == "T000000000000000001"); CPPUNIT_ASSERT(t.m_memo == "Wohnung:Miete"); CPPUNIT_ASSERT(t.m_commodity == "EUR"); @@ -494,7 +494,7 @@ void MyMoneyTransactionTest::testReadXMLEx() { MyMoneyTransaction t; - QString ref_ok = QString( + TQString ref_ok = TQString( "\n" "\n" "\n" @@ -523,8 +523,8 @@ void MyMoneyTransactionTest::testReadXMLEx() "\n" "\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); @@ -550,8 +550,8 @@ void MyMoneyTransactionTest::testReadXMLEx() void MyMoneyTransactionTest::testHasReferenceTo() { MyMoneyTransaction t; - t.setPostDate(QDate(2001,12,28)); - t.setEntryDate(QDate(2003,9,29)); + t.setPostDate(TQDate(2001,12,28)); + t.setEntryDate(TQDate(2003,9,29)); t.setId("T000000000000000001"); t.setMemo("Wohnung:Miete"); t.setCommodity("EUR"); @@ -616,7 +616,7 @@ void MyMoneyTransactionTest::testModifyMissingAccountId() { testAddSplits(); MyMoneySplit s = m->splits()[0]; - s.setAccountId(QString()); + s.setAccountId(TQString()); try { m->modifySplit(s); diff --git a/kmymoney2/mymoney/mymoneyutils.cpp b/kmymoney2/mymoney/mymoneyutils.cpp index 3739f9a..b55c485 100644 --- a/kmymoney2/mymoney/mymoneyutils.cpp +++ b/kmymoney2/mymoney/mymoneyutils.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #ifdef _CHECK_MEMORY @@ -189,7 +189,7 @@ void operator delete(void *p) throw() { if(enable==true) { CheckMemoryTable::Iterator it; - it = chkmem.table.find(p); + it = chkmem.table.tqfind(p); if(it != chkmem.table.end()) { chkmem.table.remove(it); } @@ -201,7 +201,7 @@ void operator delete [] (void *p) throw() { if(enable==true) { CheckMemoryTable::Iterator it; - it = chkmem.table.find(p); + it = chkmem.table.tqfind(p); if(it != chkmem.table.end()) { chkmem.table.remove(it); } @@ -211,13 +211,13 @@ void operator delete [] (void *p) throw() #endif // _CHECK_MEMORY -QString MyMoneyUtils::getFileExtension(QString strFileName) +TQString MyMoneyUtils::getFileExtension(TQString strFileName) { - QString strTemp; + TQString strTemp; if(!strFileName.isEmpty()) { //find last . delminator - int nLoc = strFileName.findRev('.'); + int nLoc = strFileName.tqfindRev('.'); if(nLoc != -1) { strTemp = strFileName.right(strFileName.length() - (nLoc + 1)); @@ -233,27 +233,27 @@ int MyMoneyTracer::m_onoff = 0; MyMoneyTracer::MyMoneyTracer(const char* name) { if(m_onoff) { - QRegExp exp("(.*)::(.*)"); + TQRegExp exp("(.*)::(.*)"); if(exp.search(name) != -1) { m_className = exp.cap(1); m_memberName = exp.cap(2); } else { - m_className = QString(name); - m_memberName = QString(); + m_className = TQString(name); + m_memberName = TQString(); } - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1() << "ENTER: " << m_className.latin1() << "::" << m_memberName.latin1() << std::endl; } m_indentLevel += 2; } -MyMoneyTracer::MyMoneyTracer(const QString& className, const QString& memberName) : +MyMoneyTracer::MyMoneyTracer(const TQString& className, const TQString& memberName) : m_className(className), m_memberName(memberName) { if(m_onoff) { - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1() << "ENTER: " << m_className.latin1() << "::" << m_memberName.latin1() << std::endl; } @@ -264,7 +264,7 @@ MyMoneyTracer::~MyMoneyTracer() { m_indentLevel -= 2; if(m_onoff) { - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1() << "LEAVE: " << m_className.latin1() << "::" << m_memberName.latin1() << std::endl; } @@ -275,7 +275,7 @@ void MyMoneyTracer::printf(const char *format, ...) const if(m_onoff) { va_list args; va_start(args, format); - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1(); @@ -300,38 +300,38 @@ void MyMoneyTracer::off(void) m_onoff = 0; } -QString dateToString(const QDate& date) +TQString dateToString(const TQDate& date) { if(!date.isNull() && date.isValid()) return date.toString(Qt::ISODate); - return QString(); + return TQString(); } -QDate stringToDate(const QString& str) +TQDate stringToDate(const TQString& str) { if(str.length()) { - QDate date = QDate::fromString(str, Qt::ISODate); + TQDate date = TQDate::fromString(str, Qt::ISODate); if(!date.isNull() && date.isValid()) return date; } - return QDate(); + return TQDate(); } -QString QStringEmpty(const QString& val) +TQString TQStringEmpty(const TQString& val) { if(!val.isEmpty()) - return QString(val); + return TQString(val); - return QString(); + return TQString(); } -unsigned long extractId(const QString& txt) +unsigned long extractId(const TQString& txt) { int pos; unsigned long rc = 0; - pos = txt.find(QRegExp("\\d+"), 0); + pos = txt.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { rc = atol(txt.mid(pos)); } diff --git a/kmymoney2/mymoney/mymoneyutils.h b/kmymoney2/mymoney/mymoneyutils.h index 12bb95e..ce0eb42 100644 --- a/kmymoney2/mymoney/mymoneyutils.h +++ b/kmymoney2/mymoney/mymoneyutils.h @@ -27,9 +27,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #include #if 0 @@ -51,7 +51,7 @@ typedef std::string String; //typedef for data type to store currency with. typedef long long DLONG; -typedef QString String; +typedef TQString String; #endif // 0 void timetrace(const char *); @@ -65,7 +65,7 @@ public: ~MyMoneyUtils() {} //static function to add the correct file extension at the end of the file name - static QString getFileExtension(QString strFileName); + static TQString getFileExtension(TQString strFileName); }; @@ -75,13 +75,13 @@ public: MyMoneyTracer(const char* prettyName); #define MYMONEYTRACER(a) MyMoneyTracer a(__PRETTY_FUNCTION__) - MyMoneyTracer(const QString& className, const QString& methodName); + MyMoneyTracer(const TQString& className, const TQString& methodName); ~MyMoneyTracer(); /** * This method allows to trace a printf like formatted text * - * @param format format mask + * @param format format tqmask */ void printf(const char *format, ...) const __attribute__ ((format (__printf__, 2, 3))); @@ -90,8 +90,8 @@ public: static void onOff(int onOff); private: - QString m_className; - QString m_memberName; + TQString m_className; + TQString m_memberName; static int m_indentLevel; static int m_onoff; @@ -100,7 +100,7 @@ private: #ifdef _CHECK_MEMORY #include -#include +#include class _CheckMemoryEntry { public: @@ -117,10 +117,10 @@ private: void *m_p; int m_line; size_t m_size; - QString m_file; + TQString m_file; }; -typedef QMap CheckMemoryTable; +typedef TQMap CheckMemoryTable; typedef void _CheckMemoryOutFunc(const char *); @@ -170,23 +170,23 @@ KMYMONEY_EXPORT void _CheckMemory_End(); * If the @p date is invalid an empty string will be returned. * * @param date const reference to date to be converted - * @return QString containing the converted date + * @return TQString containing the converted date */ -KMYMONEY_EXPORT QString dateToString(const QDate& date); +KMYMONEY_EXPORT TQString dateToString(const TQDate& date); /** - * This function returns a date as QDate object as specified by + * This function returns a date as TQDate object as specified by * the parameter @p str. @p str must be in Qt::ISODate format. - * If @p str is empty or contains an invalid date, QDate() is + * If @p str is empty or contains an invalid date, TQDate() is * returned. * * @param str date in Qt::ISODate format - * @return QDate object + * @return TQDate object */ -KMYMONEY_EXPORT QDate stringToDate(const QString& str); +KMYMONEY_EXPORT TQDate stringToDate(const TQString& str); -KMYMONEY_EXPORT QString QStringEmpty(const QString&); +KMYMONEY_EXPORT TQString TQStringEmpty(const TQString&); -KMYMONEY_EXPORT unsigned long extractId(const QString& txt); +KMYMONEY_EXPORT unsigned long extractId(const TQString& txt); #endif diff --git a/kmymoney2/mymoney/storage/imymoneyserialize.h b/kmymoney2/mymoney/storage/imymoneyserialize.h index a0c12ca..c900687 100644 --- a/kmymoney2/mymoney/storage/imymoneyserialize.h +++ b/kmymoney2/mymoney/storage/imymoneyserialize.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -59,14 +59,14 @@ public: // general get functions virtual const MyMoneyPayee user(void) const = 0; - virtual const QDate creationDate(void) const = 0; - virtual const QDate lastModificationDate(void) const = 0; + virtual const TQDate creationDate(void) const = 0; + virtual const TQDate lastModificationDate(void) const = 0; virtual unsigned int currentFixVersion(void) const = 0; virtual unsigned int fileFixVersion(void) const = 0; // general set functions virtual void setUser(const MyMoneyPayee& val) = 0; - virtual void setCreationDate(const QDate& val) = 0; + virtual void setCreationDate(const TQDate& val) = 0; virtual void setFileFixVersion(const unsigned int v) = 0; /** * This method is used to get a SQL reader for subsequent database access @@ -86,26 +86,26 @@ public: * therefor be called as last operation when loading from a * file. * - * @param val QDate of last modification + * @param val TQDate of last modification */ - virtual void setLastModificationDate(const QDate& val) = 0; + virtual void setLastModificationDate(const TQDate& val) = 0; /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList& list) const = 0; + virtual void accountList(TQValueList& list) const = 0; /** * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QMap containing the institution information + * @return TQMap containing the institution information */ - virtual const QValueList institutionList(void) const = 0; + virtual const TQValueList institutionList(void) const = 0; /** * This method is used to pull a list of transactions from the file @@ -113,25 +113,25 @@ public: * that match the filter passed as argument. If the filter is empty, * the whole journal will be returned. * - * @param list reference to QValueList receiving + * @param list reference to TQValueList receiving * the set of transactions * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const = 0; /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - virtual bool isDuplicateTransaction(const QString&) const = 0; + virtual bool isDuplicateTransaction(const TQString&) const = 0; /** * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - virtual const QValueList payeeList(void) const = 0; + virtual const TQValueList payeeList(void) const = 0; /** * This method returns a list of the scheduled transactions @@ -139,19 +139,19 @@ public: * list of the transactions, all arguments should be used with their * default arguments. */ - virtual const QValueList scheduleList(const QString& = QString(), + virtual const TQValueList scheduleList(const TQString& = TQString(), const MyMoneySchedule::typeE = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE = MyMoneySchedule::STYPE_ANY, - const QDate& = QDate(), - const QDate& = QDate(), + const TQDate& = TQDate(), + const TQDate& = TQDate(), const bool = false) const = 0; /** * This method returns a list of security objects that the engine has * knowledge of. */ - virtual const QValueList securityList(void) const = 0; + virtual const TQValueList securityList(void) const = 0; /** * This method is used to return the standard liability account @@ -194,12 +194,12 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added * * @deprecated This method is only provided as long as we provide @@ -207,7 +207,7 @@ public: * this compatability mode this method will disappear from * this interface! */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) = 0; + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) = 0; /** * This method is used to create a new payee @@ -227,7 +227,7 @@ public: /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -244,7 +244,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * as QString with the object. + * as TQString with the object. * * An exception will be thrown upon error conditions. * @@ -262,15 +262,15 @@ public: */ virtual void addTransaction(MyMoneyTransaction& transaction, const bool skipAccountUpdate = false) = 0; - virtual void loadAccounts(const QMap& map) = 0; - virtual void loadTransactions(const QMap& map) = 0; - virtual void loadInstitutions(const QMap& map) = 0; - virtual void loadPayees(const QMap& map) = 0; - virtual void loadSchedules(const QMap& map) = 0; - virtual void loadSecurities(const QMap& map) = 0; - virtual void loadCurrencies(const QMap& map) = 0; - virtual void loadReports( const QMap& reports ) = 0; - virtual void loadBudgets( const QMap& budgets ) = 0; + virtual void loadAccounts(const TQMap& map) = 0; + virtual void loadTransactions(const TQMap& map) = 0; + virtual void loadInstitutions(const TQMap& map) = 0; + virtual void loadPayees(const TQMap& map) = 0; + virtual void loadSchedules(const TQMap& map) = 0; + virtual void loadSecurities(const TQMap& map) = 0; + virtual void loadCurrencies(const TQMap& map) = 0; + virtual void loadReports( const TQMap& reports ) = 0; + virtual void loadBudgets( const TQMap& budgets ) = 0; virtual void loadPrices(const MyMoneyPriceList& list) = 0; virtual unsigned long accountId(void) const = 0; @@ -296,10 +296,10 @@ public: * from the container. It is meant to be used for permanent storage * functionality. See MyMoneyKeyValueContainer::pairs() for details. * - * @return QMap containing all key/value pairs of + * @return TQMap containing all key/value pairs of * this container. */ - virtual const QMap pairs(void) const = 0; + virtual const TQMap pairs(void) const = 0; /** * This method is used to initially store a set of key/value pairs @@ -307,18 +307,18 @@ public: * from permanent storage. See MyMoneyKeyValueContainer::setPairs() * for details * - * @param list const QMap containing the set of + * @param list const TQMap containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - virtual void setPairs(const QMap& list) = 0; + virtual void setPairs(const TQMap& list) = 0; - virtual const QValueList scheduleListEx( int scheduleTypes, + virtual const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const = 0; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const = 0; /** * This method is used to retrieve the list of all currencies @@ -326,9 +326,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList currencyList(void) const = 0; + virtual const TQValueList currencyList(void) const = 0; /** * This method is used to retrieve the list of all reports @@ -336,9 +336,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList reportList( void ) const = 0; + virtual const TQValueList reportList( void ) const = 0; /** * This method is used to retrieve the list of all budgets @@ -346,9 +346,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList budgetList( void ) const = 0; + virtual const TQValueList budgetList( void ) const = 0; /** diff --git a/kmymoney2/mymoney/storage/imymoneystorage.cpp b/kmymoney2/mymoney/storage/imymoneystorage.cpp index dc67726..f70de9c 100644 --- a/kmymoney2/mymoney/storage/imymoneystorage.cpp +++ b/kmymoney2/mymoney/storage/imymoneystorage.cpp @@ -25,7 +25,7 @@ bool MyMoneyFileBitArray::testBit(uint index) const { if(index < size()) - return QBitArray::testBit(index); + return TQBitArray::testBit(index); return false; } diff --git a/kmymoney2/mymoney/storage/imymoneystorage.h b/kmymoney2/mymoney/storage/imymoneystorage.h index a4e55dd..a4ff2af 100644 --- a/kmymoney2/mymoney/storage/imymoneystorage.h +++ b/kmymoney2/mymoney/storage/imymoneystorage.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -48,15 +48,15 @@ /** * @author Thomas Baumgart * - * A simple replacement for QBitArray that does not bark if testBit() + * A simple replacement for TQBitArray that does not bark if testBit() * is called with an index out of bounds. It silently returns false * in that case, otherwise calls the base classes implementation. */ -class MyMoneyFileBitArray : public QBitArray +class MyMoneyFileBitArray : public TQBitArray { public: - MyMoneyFileBitArray() : QBitArray() {} - MyMoneyFileBitArray(int size) : QBitArray(size) {} + MyMoneyFileBitArray() : TQBitArray() {} + MyMoneyFileBitArray(int size) : TQBitArray(size) {} bool testBit(uint index) const; bool operator[](int index) const { return testBit(index); } bool at(uint index) const { return testBit(index); } @@ -96,15 +96,15 @@ public: #define STD_ACC_ASSET "AStd::Asset" #define STD_ACC_EXPENSE "AStd::Expense" #define STD_ACC_INCOME "AStd::Income" -#define STD_ACC_EQUITY "AStd::Equity" +#define STD_ACC_ETQUITY "AStd::Equity" IMyMoneyStorage(); virtual ~IMyMoneyStorage(); // general get functions virtual const MyMoneyPayee user(void) const = 0; - virtual const QDate creationDate(void) const = 0; - virtual const QDate lastModificationDate(void) const = 0; + virtual const TQDate creationDate(void) const = 0; + virtual const TQDate lastModificationDate(void) const = 0; virtual unsigned int currentFixVersion(void) const = 0; virtual unsigned int fileFixVersion(void) const = 0; @@ -113,9 +113,9 @@ public: virtual void setFileFixVersion(const unsigned int v) = 0; // methods provided by MyMoneyKeyValueContainer - virtual void setValue(const QString& key, const QString& value) = 0; - virtual const QString value(const QString& key) const = 0; - virtual void deletePair(const QString& key) = 0; + virtual void setValue(const TQString& key, const TQString& value) = 0; + virtual const TQString value(const TQString& key) const = 0; + virtual void deletePair(const TQString& key) = 0; /** * This method is used to duplicate an IMyMoneyStorage object and return @@ -135,15 +135,15 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) = 0; + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) = 0; /** * This method is used to create a new payee @@ -158,22 +158,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payee(const QString& id) const = 0; + virtual const MyMoneyPayee payee(const TQString& id) const = 0; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payeeByName(const QString& payee) const = 0; + virtual const MyMoneyPayee payeeByName(const TQString& payee) const = 0; /** * This method is used to modify an existing payee @@ -197,9 +197,9 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - virtual const QValueList payeeList(void) const = 0; + virtual const TQValueList payeeList(void) const = 0; /** * Returns the account addressed by it's id. @@ -210,7 +210,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - virtual const MyMoneyAccount account(const QString& id) const = 0; + virtual const MyMoneyAccount account(const TQString& id) const = 0; /** * This method is used to check whether a given @@ -221,23 +221,23 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - virtual bool isStandardAccount(const QString& id) const = 0; + virtual bool isStandardAccount(const TQString& id) const = 0; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - virtual void setAccountName(const QString& id, const QString& name) = 0; + virtual void setAccountName(const TQString& id, const TQString& name) = 0; /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -249,7 +249,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * QString with the object. + * TQString with the object. * * An exception will be thrown upon error conditions. * @@ -269,7 +269,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - virtual bool hasActiveSplits(const QString& id) const = 0; + virtual bool hasActiveSplits(const TQString& id) const = 0; /** * This method is used to return the actual balance of an account @@ -282,7 +282,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney balance(const QString& id, const QDate& date) const= 0; + virtual const MyMoneyMoney balance(const TQString& id, const TQDate& date) const= 0; /** * This method is used to return the actual balance of an account @@ -295,7 +295,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney totalBalance(const QString& id, const QDate& date) const = 0; + virtual const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date) const = 0; /** * Returns the institution of a given ID @@ -304,7 +304,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - virtual const MyMoneyInstitution institution(const QString& id) const = 0; + virtual const MyMoneyInstitution institution(const TQString& id) const = 0; /** * This method returns an indicator if the storage object has been @@ -334,10 +334,10 @@ public: * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QValueList containing the + * @return TQValueList containing the * institution information */ - virtual const QValueList institutionList(void) const = 0; + virtual const TQValueList institutionList(void) const = 0; /** * Modifies an already existing account in the file global account pool. @@ -370,14 +370,14 @@ public: virtual void modifyTransaction(const MyMoneyTransaction& transaction) = 0; /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) = 0; + virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) = 0; /** * This method is used to remove a transaction from the transaction @@ -393,25 +393,25 @@ public: * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - virtual unsigned int transactionCount(const QString& account = QString()) const = 0; + virtual unsigned int transactionCount(const TQString& account = TQString()) const = 0; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - virtual const QMap transactionCountMap(void) const = 0; + virtual const TQMap transactionCountMap(void) const = 0; /** * This method is used to pull a list of transactions from the file @@ -424,13 +424,13 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - virtual const QValueList transactionList(MyMoneyTransactionFilter& filter) const = 0; + virtual const TQValueList transactionList(MyMoneyTransactionFilter& filter) const = 0; - virtual void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const = 0; - virtual void transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const = 0; /** * Deletes an existing account from the file global account pool @@ -459,20 +459,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - virtual const MyMoneyTransaction transaction(const QString& id) const = 0; + virtual const MyMoneyTransaction transaction(const TQString& id) const = 0; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - virtual const MyMoneyTransaction transaction(const QString& account, const int idx) const = 0; + virtual const MyMoneyTransaction transaction(const TQString& account, const int idx) const = 0; /** * This method returns the number of institutions currently known to file @@ -485,11 +485,11 @@ public: /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList& list) const = 0; + virtual void accountList(TQValueList& list) const = 0; /** * This method is used to return the standard liability account @@ -558,22 +558,22 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - virtual const MyMoneySecurity security(const QString& id) const = 0; + virtual const MyMoneySecurity security(const TQString& id) const = 0; /** * This method returns a list of the security objects * inside a MyMoneyStorage object * - * @return QValueList containing objects + * @return TQValueList containing objects */ - virtual const QValueList securityList(void) const = 0; + virtual const TQValueList securityList(void) const = 0; virtual void addPrice(const MyMoneyPrice& price) = 0; virtual void removePrice(const MyMoneyPrice& price) = 0; - virtual const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const = 0; + virtual const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const = 0; /** * This method returns a list of all prices. @@ -620,10 +620,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - virtual const MyMoneySchedule schedule(const QString& id) const = 0; + virtual const MyMoneySchedule schedule(const TQString& id) const = 0; /** * This method is used to extract a list of scheduled transactions @@ -631,7 +631,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -643,27 +643,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - virtual const QValueList scheduleList(const QString& accountId = QString(), + virtual const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const = 0; - virtual const QValueList scheduleListEx( int scheduleTypes, + virtual const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const = 0; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const = 0; /** * This method is used to add a new currency object to the engine. @@ -702,10 +702,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneyCurrency object */ - virtual const MyMoneySecurity currency(const QString& id) const = 0; + virtual const MyMoneySecurity currency(const TQString& id) const = 0; /** * This method is used to retrieve the list of all currencies @@ -713,9 +713,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList currencyList(void) const = 0; + virtual const TQValueList currencyList(void) const = 0; /** * This method is used to retrieve the list of all reports @@ -723,9 +723,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList reportList( void ) const = 0; + virtual const TQValueList reportList( void ) const = 0; /** * This method is used to add a new report to the engine. @@ -763,10 +763,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - virtual const MyMoneyReport report( const QString& id ) const = 0; + virtual const MyMoneyReport report( const TQString& id ) const = 0; /** * This method is used to remove an existing MyMoneyReport object @@ -784,9 +784,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList budgetList( void ) const = 0; + virtual const TQValueList budgetList( void ) const = 0; /** * This method is used to add a new budget to the engine. @@ -805,11 +805,11 @@ public: * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget object of budget */ - virtual const MyMoneyBudget budgetByName(const QString& budget) const = 0; + virtual const MyMoneyBudget budgetByName(const TQString& budget) const = 0; /** * This method is used to modify an existing MyMoneyBudget @@ -835,10 +835,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - virtual MyMoneyBudget budget( const QString& id ) const = 0; + virtual MyMoneyBudget budget( const TQString& id ) const = 0; /** * This method is used to remove an existing MyMoneyBudget object diff --git a/kmymoney2/mymoney/storage/imymoneystorageformat.h b/kmymoney2/mymoney/storage/imymoneystorageformat.h index b045898..6a7046f 100644 --- a/kmymoney2/mymoney/storage/imymoneystorageformat.h +++ b/kmymoney2/mymoney/storage/imymoneystorageformat.h @@ -31,9 +31,9 @@ // ---------------------------------------------------------------------------- // QT Includes -class QString; -class QIODevice; -class QProgressDialog; +class TQString; +class TQIODevice; +class TQProgressDialog; // ---------------------------------------------------------------------------- // Project Includes @@ -52,13 +52,13 @@ public: Writing = 1 /**< version to be used when writing a file */ }; - virtual void readFile(QIODevice* qf, IMyMoneySerialize* storage) = 0; - // virtual void readStream(QDataStream& s, IMyMoneySerialize* storage) = 0; + virtual void readFile(TQIODevice* qf, IMyMoneySerialize* storage) = 0; + // virtual void readStream(TQDataStream& s, IMyMoneySerialize* storage) = 0; - virtual void writeFile(QIODevice* qf, IMyMoneySerialize* storage) = 0; - //virtual void writeStream(QDataStream& s, IMyMoneySerialize* storage) = 0; + virtual void writeFile(TQIODevice* qf, IMyMoneySerialize* storage) = 0; + //virtual void writeStream(TQDataStream& s, IMyMoneySerialize* storage) = 0; - virtual void setProgressCallback(void(*callback)(int, int, const QString&)) = 0; + virtual void setProgressCallback(void(*callback)(int, int, const TQString&)) = 0; /** * This member is used to store the file version information * obtained while reading a file. diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp index e845094..e80feaf 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp @@ -26,8 +26,8 @@ #define PASS } catch (MyMoneyException *e) { throw; } MyMoneyDatabaseMgr::MyMoneyDatabaseMgr() : -m_creationDate (QDate::currentDate ()), -m_lastModificationDate (QDate::currentDate ()), +m_creationDate (TQDate::tqcurrentDate ()), +m_lastModificationDate (TQDate::tqcurrentDate ()), m_sql (0) { } @@ -38,10 +38,10 @@ MyMoneyDatabaseMgr::~MyMoneyDatabaseMgr() const MyMoneyPayee MyMoneyDatabaseMgr::user(void) const { return m_user; } -const QDate MyMoneyDatabaseMgr::creationDate(void) const +const TQDate MyMoneyDatabaseMgr::creationDate(void) const { return m_creationDate; } -const QDate MyMoneyDatabaseMgr::lastModificationDate(void) const +const TQDate MyMoneyDatabaseMgr::lastModificationDate(void) const { return m_lastModificationDate; } unsigned int MyMoneyDatabaseMgr::currentFixVersion(void) const @@ -61,27 +61,27 @@ void MyMoneyDatabaseMgr::setFileFixVersion(const unsigned int v) { m_fileFixVersion = v; } // methods provided by MyMoneyKeyValueContainer -const QString MyMoneyDatabaseMgr::value(const QString& key) const +const TQString MyMoneyDatabaseMgr::value(const TQString& key) const { return MyMoneyKeyValueContainer::value(key); } -void MyMoneyDatabaseMgr::setValue(const QString& key, const QString& val) +void MyMoneyDatabaseMgr::setValue(const TQString& key, const TQString& val) { MyMoneyKeyValueContainer::setValue(key, val); } -void MyMoneyDatabaseMgr::deletePair(const QString& key) +void MyMoneyDatabaseMgr::deletePair(const TQString& key) { MyMoneyKeyValueContainer::deletePair(key); } -const QMap MyMoneyDatabaseMgr::pairs(void) const +const TQMap MyMoneyDatabaseMgr::pairs(void) const { return MyMoneyKeyValueContainer::pairs(); } -void MyMoneyDatabaseMgr::setPairs(const QMap& list) +void MyMoneyDatabaseMgr::setPairs(const TQMap& list) { MyMoneyKeyValueContainer::setPairs(list); } @@ -104,43 +104,43 @@ void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& account) } } -void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) +void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) { - QMap accountList; - QStringList accountIdList; - QMap::ConstIterator theParent; - QMap::ConstIterator theChild; + TQMap accountList; + TQStringList accountIdList; + TQMap::ConstIterator theParent; + TQMap::ConstIterator theChild; - accountIdList << parent.id() << account.id(); + accountIdList << tqparent.id() << account.id(); startTransaction(); accountList = m_sql->fetchAccounts(accountIdList, true); - theParent = accountList.find(parent.id()); + theParent = accountList.tqfind(tqparent.id()); if(theParent == accountList.end()) { - QString msg = "Unknown parent account '"; - msg += parent.id() + "'"; + TQString msg = "Unknown tqparent account '"; + msg += tqparent.id() + "'"; throw new MYMONEYEXCEPTION(msg); } - theChild = accountList.find(account.id()); + theChild = accountList.tqfind(account.id()); if(theChild == accountList.end()) { - QString msg = "Unknown child account '"; + TQString msg = "Unknown child account '"; msg += account.id() + "'"; throw new MYMONEYEXCEPTION(msg); } MyMoneyAccount acc = *theParent; acc.addAccountId(account.id()); - parent = acc; + tqparent = acc; acc = *theChild; - acc.setParentAccountId(parent.id()); + acc.setParentAccountId(tqparent.id()); account = acc; //FIXME: MyMoneyBalanceCacheItem balance; //FIXME: m_balanceCache[account.id()] = balance; - m_sql->modifyAccount(parent); + m_sql->modifyAccount(tqparent); m_sql->modifyAccount(account); commitTransaction(); } @@ -156,29 +156,29 @@ void MyMoneyDatabaseMgr::addPayee(MyMoneyPayee& payee) } } -const MyMoneyPayee MyMoneyDatabaseMgr::payee(const QString& id) const +const MyMoneyPayee MyMoneyDatabaseMgr::payee(const TQString& id) const { - QMap::ConstIterator it; - QMap payeeList = m_sql->fetchPayees(QString(id)); - it = payeeList.find(id); + TQMap::ConstIterator it; + TQMap payeeList = m_sql->fetchPayees(TQString(id)); + it = payeeList.tqfind(id); if(it == payeeList.end()) throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'"); return *it; } -const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const QString& payee) const +const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const TQString& payee) const { if(payee.isEmpty()) return MyMoneyPayee::null; - QMap payeeList; + TQMap payeeList; TRY payeeList = m_sql->fetchPayees(); PASS - QMap::ConstIterator it_p; + TQMap::ConstIterator it_p; for(it_p = payeeList.begin(); it_p != payeeList.end(); ++it_p) { if((*it_p).name() == payee) { @@ -191,12 +191,12 @@ const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const QString& payee) const void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee) { - QMap payeeList = m_sql->fetchPayees(QString(payee.id()), true); - QMap::ConstIterator it; + TQMap payeeList = m_sql->fetchPayees(TQString(payee.id()), true); + TQMap::ConstIterator it; - it = payeeList.find(payee.id()); + it = payeeList.tqfind(payee.id()); if(it == payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -205,30 +205,30 @@ void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee) void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) { - QMap::ConstIterator it_t; - QMap::ConstIterator it_s; - QMap payeeList = m_sql->fetchPayees(QString(payee.id())); - QMap::ConstIterator it_p; + TQMap::ConstIterator it_t; + TQMap::ConstIterator it_s; + TQMap payeeList = m_sql->fetchPayees(TQString(payee.id())); + TQMap::ConstIterator it_p; - it_p = payeeList.find(payee.id()); + it_p = payeeList.tqfind(payee.id()); if(it_p == payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } // scan all transactions to check if the payee is still referenced - QMap transactionList = m_sql->fetchTransactions(); // make sure they're all here + TQMap transactionList = m_sql->fetchTransactions(); // make sure they're all here for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { if((*it_t).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); } } // check referential integrity in schedules - QMap scheduleList = m_sql->fetchSchedules(); // make sure they're all here + TQMap scheduleList = m_sql->fetchSchedules(); // make sure they're all here for(it_s = scheduleList.begin(); it_s != scheduleList.end(); ++it_s) { if((*it_s).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); } } // remove any reference to report and/or budget @@ -237,20 +237,20 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee) m_sql->removePayee(payee); } -const QValueList MyMoneyDatabaseMgr::payeeList(void) const +const TQValueList MyMoneyDatabaseMgr::payeeList(void) const { if (m_sql) return m_sql->fetchPayees().values(); else - return QValueList (); + return TQValueList (); } -const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const +const MyMoneyAccount MyMoneyDatabaseMgr::account(const TQString& id) const { if (m_sql) { - QMap accountList = m_sql->fetchAccounts(QString(id)); - QMap ::ConstIterator pos = accountList.find(id); + TQMap accountList = m_sql->fetchAccounts(TQString(id)); + TQMap ::ConstIterator pos = accountList.tqfind(id); // locate the account and if present, return it's data if(pos != accountList.end()) @@ -258,27 +258,27 @@ const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const } // throw an exception, if it does not exist - QString msg = "Unknown account id '" + id + "'"; + TQString msg = "Unknown account id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -bool MyMoneyDatabaseMgr::isStandardAccount(const QString& id) const +bool MyMoneyDatabaseMgr::isStandardAccount(const TQString& id) const { return id == STD_ACC_LIABILITY || id == STD_ACC_ASSET || id == STD_ACC_EXPENSE || id == STD_ACC_INCOME - || id == STD_ACC_EQUITY; + || id == STD_ACC_ETQUITY; } -void MyMoneyDatabaseMgr::setAccountName(const QString& id, const QString& name) +void MyMoneyDatabaseMgr::setAccountName(const TQString& id, const TQString& name) { if(!isStandardAccount(id)) throw new MYMONEYEXCEPTION("Only standard accounts can be modified using setAccountName()"); if (m_sql) { startTransaction(); - MyMoneyAccount acc = m_sql->fetchAccounts(QString(id), true) [id]; + MyMoneyAccount acc = m_sql->fetchAccounts(TQString(id), true) [id]; acc.setName(name); m_sql->modifyAccount(acc); commitTransaction(); @@ -298,9 +298,9 @@ void MyMoneyDatabaseMgr::addInstitution(MyMoneyInstitution& institution) } } -const QString MyMoneyDatabaseMgr::nextPayeeID(void) +const TQString MyMoneyDatabaseMgr::nextPayeeID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementPayeeId())); id = "P" + id.rightJustify(PAYEE_ID_SIZE, '0'); @@ -308,9 +308,9 @@ const QString MyMoneyDatabaseMgr::nextPayeeID(void) return id; } -const QString MyMoneyDatabaseMgr::nextInstitutionID(void) +const TQString MyMoneyDatabaseMgr::nextInstitutionID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementInstitutionId())); id = "I" + id.rightJustify(INSTITUTION_ID_SIZE, '0'); @@ -318,9 +318,9 @@ const QString MyMoneyDatabaseMgr::nextInstitutionID(void) return id; } -const QString MyMoneyDatabaseMgr::nextAccountID(void) +const TQString MyMoneyDatabaseMgr::nextAccountID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementAccountId())); id = "A" + id.rightJustify(ACCOUNT_ID_SIZE, '0'); @@ -328,9 +328,9 @@ const QString MyMoneyDatabaseMgr::nextAccountID(void) return id; } -const QString MyMoneyDatabaseMgr::nextBudgetID(void) +const TQString MyMoneyDatabaseMgr::nextBudgetID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementBudgetId())); id = "B" + id.rightJustify(BUDGET_ID_SIZE, '0'); @@ -338,9 +338,9 @@ const QString MyMoneyDatabaseMgr::nextBudgetID(void) return id; } -const QString MyMoneyDatabaseMgr::nextReportID(void) +const TQString MyMoneyDatabaseMgr::nextReportID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementReportId())); id = "R" + id.rightJustify(REPORT_ID_SIZE, '0'); @@ -348,9 +348,9 @@ const QString MyMoneyDatabaseMgr::nextReportID(void) return id; } -const QString MyMoneyDatabaseMgr::nextTransactionID(void) +const TQString MyMoneyDatabaseMgr::nextTransactionID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementTransactionId())); id = "T" + id.rightJustify(TRANSACTION_ID_SIZE, '0'); @@ -358,9 +358,9 @@ const QString MyMoneyDatabaseMgr::nextTransactionID(void) return id; } -const QString MyMoneyDatabaseMgr::nextScheduleID(void) +const TQString MyMoneyDatabaseMgr::nextScheduleID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementScheduleId())); id = "SCH" + id.rightJustify(SCHEDULE_ID_SIZE, '0'); @@ -368,9 +368,9 @@ const QString MyMoneyDatabaseMgr::nextScheduleID(void) return id; } -const QString MyMoneyDatabaseMgr::nextSecurityID(void) +const TQString MyMoneyDatabaseMgr::nextSecurityID(void) { - QString id; + TQString id; if (m_sql) { id.setNum(ulong(m_sql->incrementSecurityId())); id = "E" + id.rightJustify(SECURITY_ID_SIZE, '0'); @@ -393,7 +393,7 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b throw new MYMONEYEXCEPTION("invalid post date"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -403,7 +403,7 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b } MyMoneyTransaction newTransaction(nextTransactionID(), transaction); - QString key = newTransaction.uniqueSortKey(); + TQString key = newTransaction.uniqueSortKey(); m_sql->addTransaction(newTransaction); @@ -415,18 +415,18 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b acc.adjustBalance((*it_s)); if(!skipAccountUpdate) { acc.touch(); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); } m_sql->modifyAccount(acc); } } -bool MyMoneyDatabaseMgr::hasActiveSplits(const QString& id) const +bool MyMoneyDatabaseMgr::hasActiveSplits(const TQString& id) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; MyMoneyTransactionFilter f(id); - QMap transactionList = m_sql->fetchTransactions(f); + TQMap transactionList = m_sql->fetchTransactions(f); for(it = transactionList.begin(); it != transactionList.end(); ++it) { if((*it).accountReferenced(id)) { @@ -447,12 +447,12 @@ bool MyMoneyDatabaseMgr::hasActiveSplits(const QString& id) const * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ -//const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& date); +//const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& date); -const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const TQString& id, const TQDate& date) const { - QStringList accounts; - QStringList::ConstIterator it_a; + TQStringList accounts; + TQStringList::ConstIterator it_a; MyMoneyMoney result; //(balance(id, date)); @@ -460,26 +460,26 @@ const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const QString& id, const QDa for (it_a = accounts.begin(); it_a != accounts.end(); ++it_a) { accounts += MyMoneyFile::instance()->account(*it_a).accountList(); } - std::list tempList (accounts.begin(), accounts.end()); + std::list tempList (accounts.begin(), accounts.end()); tempList.sort();; tempList.unique(); - accounts = QStringList(tempList); + accounts = TQStringList(tempList); - QMap balanceMap = m_sql->fetchBalance(accounts, date); - for (QMap::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) { + TQMap balanceMap = m_sql->fetchBalance(accounts, date); + for (TQMap::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) { result += it_b.data(); } return result; } -const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const QString& id) const +const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const TQString& id) const { - QMap::ConstIterator pos; - QMap institutionList = m_sql->fetchInstitutions(QString(id)); + TQMap::ConstIterator pos; + TQMap institutionList = m_sql->fetchInstitutions(TQString(id)); - pos = institutionList.find(id); + pos = institutionList.tqfind(id); if(pos != institutionList.end()) return *pos; throw new MYMONEYEXCEPTION("unknown institution"); @@ -496,35 +496,35 @@ unsigned int MyMoneyDatabaseMgr::accountCount(void) const return m_sql->getRecCount("kmmAccounts"); } -const QValueList MyMoneyDatabaseMgr::institutionList(void) const +const TQValueList MyMoneyDatabaseMgr::institutionList(void) const { if (m_sql) { return m_sql->fetchInstitutions().values(); } else { - return QValueList (); + return TQValueList (); } } void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck) { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the account in the file global pool startTransaction(); - QMap accountList = m_sql->fetchAccounts (QString(account.id()), true); - pos = accountList.find(account.id()); + TQMap accountList = m_sql->fetchAccounts (TQString(account.id()), true); + pos = accountList.tqfind(account.id()); if(pos != accountList.end()) { // check if the new info is based on the old one. // this is the case, when the file and the id // as well as the type are equal. - if(((*pos).parentAccountId() == account.parentAccountId() + if(((*pos).tqparentAccountId() == account.tqparentAccountId() && (*pos).accountType() == account.accountType()) || skipCheck == true) { // make sure that all the referenced objects exist if(!account.institutionId().isEmpty()) institution(account.institutionId()); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) { this->account(*it_a); } @@ -532,8 +532,8 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool // update information in account list //m_accountList.modify(account.id(), account); - // invalidate cached balance -//FIXME: invalidateBalanceCache(account.id()); + // tqinvalidate cached balance +//FIXME: tqinvalidateBalanceCache(account.id()); // mark file as changed m_sql->modifyAccount(account); @@ -551,11 +551,11 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution) { - QMap institutionList = m_sql->fetchInstitutions(QString(institution.id())); - QMap::ConstIterator pos; + TQMap institutionList = m_sql->fetchInstitutions(TQString(institution.id())); + TQMap::ConstIterator pos; // locate the institution in the file global pool - pos = institutionList.find(institution.id()); + pos = institutionList.tqfind(institution.id()); if(pos != institutionList.end()) { m_sql->modifyInstitution(institution); } else @@ -572,7 +572,7 @@ void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution */ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction) { - QMap modifiedAccounts; + TQMap modifiedAccounts; // perform some checks to see that the transaction stuff is OK. For // now we assume that @@ -588,7 +588,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction throw new MYMONEYEXCEPTION("invalid transaction to be modified"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -599,29 +599,29 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction // new data seems to be ok. find old version of transaction // in our pool. Throw exception if unknown. -// if(!m_transactionKeys.contains(transaction.id())) +// if(!m_transactionKeys.tqcontains(transaction.id())) // throw new MYMONEYEXCEPTION("invalid transaction id"); -// QString oldKey = m_transactionKeys[transaction.id()]; - QMap transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')"); +// TQString oldKey = m_transactionKeys[transaction.id()]; + TQMap transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')"); // if(transactionList.size() != 1) // throw new MYMONEYEXCEPTION("invalid transaction key"); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; -// it_t = transactionList.find(oldKey); +// it_t = transactionList.tqfind(oldKey); it_t = transactionList.begin(); if(it_t == transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); // mark all accounts referenced in old and new transaction data // as modified - QMap accountList = m_sql->fetchAccounts(); + TQMap accountList = m_sql->fetchAccounts(); for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = accountList[(*it_s).accountId()]; acc.adjustBalance((*it_s), true); acc.touch(); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); //m_accountList.modify(acc.id(), acc); m_sql->modifyAccount(acc); //modifiedAccounts[(*it_s).accountId()] = true; @@ -630,7 +630,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction MyMoneyAccount acc = accountList[(*it_s).accountId()]; acc.adjustBalance((*it_s)); acc.touch(); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); //m_accountList.modify(acc.id(), acc); m_sql->modifyAccount(acc); //modifiedAccounts[(*it_s).accountId()] = true; @@ -640,7 +640,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction // m_sql->removeTransaction(oldKey); // add new transaction to lists - // QString newKey = transaction.uniqueSortKey(); + // TQString newKey = transaction.uniqueSortKey(); // m_sql->insertTransaction(newKey, transaction); //m_transactionKeys.modify(transaction.id(), newKey); @@ -648,88 +648,88 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction m_sql->modifyTransaction(transaction); } -void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) +void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) { - if(account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment) + if(account.accountType() == MyMoneyAccount::Stock && tqparent.accountType() != MyMoneyAccount::Investment) throw new MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); - QStringList accountIdList; - QMap::ConstIterator oldParent; - QMap::ConstIterator newParent; - QMap::ConstIterator childAccount; + TQStringList accountIdList; + TQMap::ConstIterator oldParent; + TQMap::ConstIterator newParent; + TQMap::ConstIterator childAccount; // verify that accounts exist. If one does not, // an exception is thrown - accountIdList << account.id() << parent.id(); + accountIdList << account.id() << tqparent.id(); MyMoneyDatabaseMgr::account(account.id()); - MyMoneyDatabaseMgr::account(parent.id()); + MyMoneyDatabaseMgr::account(tqparent.id()); - if(!account.parentAccountId().isEmpty()) { - accountIdList << account.parentAccountId(); + if(!account.tqparentAccountId().isEmpty()) { + accountIdList << account.tqparentAccountId(); } startTransaction(); - QMap accountList = m_sql->fetchAccounts(accountIdList, true); + TQMap accountList = m_sql->fetchAccounts(accountIdList, true); - if(!account.parentAccountId().isEmpty()) { - MyMoneyDatabaseMgr::account(account.parentAccountId()); - oldParent = accountList.find(account.parentAccountId()); + if(!account.tqparentAccountId().isEmpty()) { + MyMoneyDatabaseMgr::account(account.tqparentAccountId()); + oldParent = accountList.tqfind(account.tqparentAccountId()); } - newParent = accountList.find(parent.id()); - childAccount = accountList.find(account.id()); + newParent = accountList.tqfind(tqparent.id()); + childAccount = accountList.tqfind(account.id()); MyMoneyAccount acc; - if(!account.parentAccountId().isEmpty()) { + if(!account.tqparentAccountId().isEmpty()) { acc = (*oldParent); acc.removeAccountId(account.id()); m_sql->modifyAccount(acc); } - parent = (*newParent); - parent.addAccountId(account.id()); + tqparent = (*newParent); + tqparent.addAccountId(account.id()); account = (*childAccount); - account.setParentAccountId(parent.id()); + account.setParentAccountId(tqparent.id()); - m_sql->modifyAccount(parent); + m_sql->modifyAccount(tqparent); m_sql->modifyAccount(account); commitTransaction(); } void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction) { - QMap modifiedAccounts; + TQMap modifiedAccounts; // first perform all the checks if(transaction.id().isEmpty()) throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; -// it_k = m_transactionKeys.find(transaction.id()); +// it_k = m_transactionKeys.tqfind(transaction.id()); // if(it_k == m_transactionKeys.end()) // throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - QMap transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')"); -// it_t = transactionList.find(*it_k); + TQMap transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')"); +// it_t = transactionList.tqfind(*it_k); it_t = transactionList.begin(); if(it_t == transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; // scan the splits and collect all accounts that need // to be updated after the removal of this transaction - QMap accountList = m_sql->fetchAccounts(); + TQMap accountList = m_sql->fetchAccounts(); for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = accountList[(*it_s).accountId()]; // modifiedAccounts[(*it_s).accountId()] = true; acc.adjustBalance((*it_s), true); acc.touch(); m_sql->modifyAccount(acc); -//FIXME: invalidateBalanceCache(acc.id()); +//FIXME: tqinvalidateBalanceCache(acc.id()); } // FIXME: check if any split is frozen and throw exception @@ -742,20 +742,20 @@ void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction m_sql->removeTransaction(transaction); } -unsigned int MyMoneyDatabaseMgr::transactionCount(const QString& account) const +unsigned int MyMoneyDatabaseMgr::transactionCount(const TQString& account) const { return (m_sql->transactionCount(account)); } -const QMap MyMoneyDatabaseMgr::transactionCountMap(void) const +const TQMap MyMoneyDatabaseMgr::transactionCountMap(void) const { return (m_sql->transactionCountMap()); } -const QValueList MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const +const TQValueList MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const { - QValueList list; + TQValueList list; transactionList(list, filter); return list; } -void MyMoneyDatabaseMgr::transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const +void MyMoneyDatabaseMgr::transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const { list.clear(); @@ -764,22 +764,22 @@ void MyMoneyDatabaseMgr::transactionList(QValueList& list, M PASS } -void MyMoneyDatabaseMgr::transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const +void MyMoneyDatabaseMgr::transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const { list.clear(); - MyMoneyMap transactionList; + MyMoneyMap transactionList; TRY if (m_sql) transactionList = m_sql->fetchTransactions(filter); PASS - QMap::ConstIterator it_t; - QMap::ConstIterator txEnd = transactionList.end(); + TQMap::ConstIterator it_t; + TQMap::ConstIterator txEnd = transactionList.end(); for(it_t = transactionList.begin(); it_t != txEnd; ++it_t) { if(filter.match(*it_t)) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = filter.matchingSplits().begin(); it_s != filter.matchingSplits().end(); ++it_s) { - list.append(qMakePair(*it_t, *it_s)); + list.append(tqMakePair(*it_t, *it_s)); } } } @@ -787,12 +787,12 @@ void MyMoneyDatabaseMgr::transactionList(QValueList accountList = m_sql->fetchAccounts(accountIdList, true); + TQMap accountList = m_sql->fetchAccounts(accountIdList, true); - QMap::ConstIterator it_a; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_a; + TQMap::ConstIterator it_p; // locate the account in the file global pool - it_a = accountList.find(account.id()); + it_a = accountList.tqfind(account.id()); if(it_a == accountList.end()) throw new MYMONEYEXCEPTION("Internal error: account not found in list"); - it_p = accountList.find(parent.id()); + it_p = accountList.tqfind(tqparent.id()); if(it_p == accountList.end()) - throw new MYMONEYEXCEPTION("Internal error: parent account not found in list"); + throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list"); if(!account.institutionId().isEmpty()) throw new MYMONEYEXCEPTION("Cannot remove account still attached to an institution"); @@ -842,25 +842,25 @@ void MyMoneyDatabaseMgr::removeAccount(const MyMoneyAccount& account) if((*it_a).id() == account.id() && (*it_a).accountType() == account.accountType()) { - // second round over sub-ordinate accounts: do re-parenting + // second round over sub-ordinate accounts: do re-tqparenting // but only if the list contains at least one entry // FIXME: move this logic to MyMoneyFile if((*it_a).accountList().count() > 0) { for(it = (*it_a).accountList().begin(); it != (*it_a).accountList().end(); ++it) { MyMoneyAccount acc(MyMoneyDatabaseMgr::account(*it)); - reparentAccount(acc, parent);//, false); + reparentAccount(acc, tqparent);//, false); } } - // remove account from parent's list - parent.removeAccountId(account.id()); - m_sql->modifyAccount(parent); + // remove account from tqparent's list + tqparent.removeAccountId(account.id()); + m_sql->modifyAccount(tqparent); // remove account from the global account pool //m_accountList.remove(account.id()); // remove from balance list //FIXME: m_balanceCache.remove(account.id()); -//FIXME: invalidateBalanceCache(parent.id()); +//FIXME: tqinvalidateBalanceCache(tqparent.id()); m_sql->removeAccount(account); } @@ -869,10 +869,10 @@ void MyMoneyDatabaseMgr::removeAccount(const MyMoneyAccount& account) void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution) { - QMap institutionList = m_sql->fetchInstitutions(QString(institution.id())); - QMap::ConstIterator it_i; + TQMap institutionList = m_sql->fetchInstitutions(TQString(institution.id())); + TQMap::ConstIterator it_i; - it_i = institutionList.find(institution.id()); + it_i = institutionList.tqfind(institution.id()); if(it_i != institutionList.end()) { // mark file as changed m_sql->removeInstitution(institution); @@ -880,31 +880,31 @@ void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution throw new MYMONEYEXCEPTION("invalid institution"); } -const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& id) const +const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& id) const { // get the full key of this transaction, throw exception // if it's invalid (unknown) - //if(!m_transactionKeys.contains(id)) + //if(!m_transactionKeys.tqcontains(id)) // throw new MYMONEYEXCEPTION("invalid transaction id"); // check if this key is in the list, throw exception if not - //QString key = m_transactionKeys[id]; - QMap transactionList = m_sql->fetchTransactions("('" + QString(id) + "')"); + //TQString key = m_transactionKeys[id]; + TQMap transactionList = m_sql->fetchTransactions("('" + TQString(id) + "')"); //there should only be one transaction in the map, if it was found, so check the size of the map //return the first element. - //if(!transactionList.contains(key)) + //if(!transactionList.tqcontains(key)) if(!transactionList.size()) throw new MYMONEYEXCEPTION("invalid transaction key"); return transactionList.begin().data(); } -const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& date) const { - QStringList idList; + TQStringList idList; idList.append(id); - QMap tempMap = m_sql->fetchBalance(idList, date); + TQMap tempMap = m_sql->fetchBalance(idList, date); MyMoneyMoney returnValue = tempMap[id]; if (returnValue != MyMoneyMoney()) { @@ -912,42 +912,42 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d } //DEBUG - QDate date_ (date); - //if (date_ == QDate()) date_ = QDate::currentDate(); + TQDate date_ (date); + //if (date_ == TQDate()) date_ = TQDate::tqcurrentDate(); // END DEBUG MyMoneyMoney result(0); MyMoneyAccount acc; - QMap accountList = m_sql->fetchAccounts(/*QString(id)*/); - //QMap::const_iterator accpos = accountList.find(id); - if (date_ != QDate()) qDebug ("request balance for %s at %s", id.data(), date_.toString(Qt::ISODate).latin1()); + TQMap accountList = m_sql->fetchAccounts(/*TQString(id)*/); + //TQMap::const_iterator accpos = accountList.tqfind(id); + if (date_ != TQDate()) qDebug ("request balance for %s at %s", id.data(), TQString(date_.toString(Qt::ISODate)).latin1()); // if(!date_.isValid() && MyMoneyFile::instance()->account(id).accountType() != MyMoneyAccount::Stock) { -// if(accountList.find(id) != accountList.end()) +// if(accountList.tqfind(id) != accountList.end()) // return accountList[id].balance(); // return MyMoneyMoney(0); // } if(/*m_balanceCache[id].valid == false || date != m_balanceCacheDate) || */ m_sql != 0) { - QMap balances; - QMap::ConstIterator it_b; + TQMap balances; + TQMap::ConstIterator it_b; //FIXME: if (date != m_balanceCacheDate) { //FIXME: m_balanceCache.clear(); //FIXME: m_balanceCacheDate = date; //FIXME: } - QValueList::ConstIterator it_t; - QValueList::ConstIterator txEnd; - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_t; + TQValueList::ConstIterator txEnd; + TQValueList::ConstIterator it_s; MyMoneyTransactionFilter filter; filter.addAccount(id); - filter.setDateFilter(QDate(), date_); + filter.setDateFilter(TQDate(), date_); filter.setReportAllSplits(false); - QValueList list = transactionList(filter); + TQValueList list = transactionList(filter); txEnd = list.end(); for(it_t = list.begin(); it_t != txEnd; ++it_t) { for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s){ - const QString aid = (*it_s).accountId(); + const TQString aid = (*it_s).accountId(); if((*it_s).action() == MyMoneySplit::ActionSplitShares) { balances[aid] = balances[aid] * (*it_s).shares(); } else { @@ -964,7 +964,7 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d // fill all accounts w/o transactions to zero // if (m_sql != 0) { -// QMap::ConstIterator it_a; +// TQMap::ConstIterator it_a; // for(it_a = m_accountList.begin(); it_a != m_accountList.end(); ++it_a) { //FIXME: if(m_balanceCache[(*it_a).id()].valid == false) { //FIXME: MyMoneyBalanceCacheItem balance(MyMoneyMoney(0,1)); @@ -985,13 +985,13 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d return result; } -const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& account, const int idx) const +const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& account, const int idx) const { /* removed with MyMoneyAccount::Transaction - QMap::ConstIterator acc; + TQMap::ConstIterator acc; // find account object in list, throw exception if unknown - acc = m_accountList.find(account); + acc = m_accountList.tqfind(account); if(acc == m_accountList.end()) throw new MYMONEYEXCEPTION("unknown account id"); @@ -1003,9 +1003,9 @@ const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& account, */ // new implementation if the above code does not work anymore - QValueList list; + TQValueList list; //MyMoneyAccount acc = m_accountList[account]; - MyMoneyAccount acc = m_sql->fetchAccounts(QString(account)) [account]; + MyMoneyAccount acc = m_sql->fetchAccounts(TQString(account)) [account]; MyMoneyTransactionFilter filter; if(acc.accountGroup() == MyMoneyAccount::Income @@ -1026,12 +1026,12 @@ unsigned int MyMoneyDatabaseMgr::institutionCount(void) const return m_sql->getRecCount("kmmInstitutions"); } -void MyMoneyDatabaseMgr::accountList(QValueList& list) const +void MyMoneyDatabaseMgr::accountList(TQValueList& list) const { - QMap accountList; + TQMap accountList; if (m_sql) accountList = m_sql->fetchAccounts(); - QMap::ConstIterator it; - QMap::ConstIterator accEnd = accountList.end(); + TQMap::ConstIterator it; + TQMap::ConstIterator accEnd = accountList.end(); for(it = accountList.begin(); it != accEnd; ++it) { if(!isStandardAccount((*it).id())) { list.append(*it); @@ -1052,7 +1052,7 @@ const MyMoneyAccount MyMoneyDatabaseMgr::income(void) const { return MyMoneyFile::instance()->account(STD_ACC_INCOME); } const MyMoneyAccount MyMoneyDatabaseMgr::equity(void) const -{ return MyMoneyFile::instance()->account(STD_ACC_EQUITY); } +{ return MyMoneyFile::instance()->account(STD_ACC_ETQUITY); } void MyMoneyDatabaseMgr::addSecurity(MyMoneySecurity& security) { @@ -1065,13 +1065,13 @@ void MyMoneyDatabaseMgr::addSecurity(MyMoneySecurity& security) void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security) { - QMap securitiesList = m_sql->fetchSecurities(QString(security.id()), true); - QMap::ConstIterator it; + TQMap securitiesList = m_sql->fetchSecurities(TQString(security.id()), true); + TQMap::ConstIterator it; - it = securitiesList.find(security.id()); + it = securitiesList.tqfind(security.id()); if(it == securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during modifySecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1081,15 +1081,15 @@ void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security) void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security) { - QMap securitiesList = m_sql->fetchSecurities(QString(security.id())); - QMap::ConstIterator it; + TQMap securitiesList = m_sql->fetchSecurities(TQString(security.id())); + TQMap::ConstIterator it; // FIXME: check referential integrity - it = securitiesList.find(security.id()); + it = securitiesList.tqfind(security.id()); if(it == securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during removeSecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1097,10 +1097,10 @@ void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security) m_sql->removeSecurity(security); } -const MyMoneySecurity MyMoneyDatabaseMgr::security(const QString& id) const +const MyMoneySecurity MyMoneyDatabaseMgr::security(const TQString& id) const { - QMap securitiesList = m_sql->fetchSecurities(QString(id)); - QMap::ConstIterator it = securitiesList.find(id); + TQMap securitiesList = m_sql->fetchSecurities(TQString(id)); + TQMap::ConstIterator it = securitiesList.tqfind(id); if(it != securitiesList.end()) { return it.data(); @@ -1109,15 +1109,15 @@ const MyMoneySecurity MyMoneyDatabaseMgr::security(const QString& id) const return MyMoneySecurity(); } -const QValueList MyMoneyDatabaseMgr::securityList(void) const +const TQValueList MyMoneyDatabaseMgr::securityList(void) const { return m_sql->fetchSecurities().values(); } void MyMoneyDatabaseMgr::addPrice(const MyMoneyPrice& price) { MyMoneyPriceEntries::ConstIterator it; MyMoneyPriceList priceList = m_sql->fetchPrices(); - it = priceList[MyMoneySecurityPair(price.from(), price.to())].find(price.date()); - // do not replace, if the information did not change. + it = priceList[MyMoneySecurityPair(price.from(), price.to())].tqfind(price.date()); + // do not tqreplace, if the information did not change. if(it != priceList[MyMoneySecurityPair(price.from(), price.to())].end()) { if((*it).rate((*it).to()) == price.rate(price.to()) && (*it).source() == price.source()) @@ -1132,7 +1132,7 @@ void MyMoneyDatabaseMgr::removePrice(const MyMoneyPrice& price) m_sql->removePrice(price); } -const MyMoneyPrice MyMoneyDatabaseMgr::price(const QString& fromId, const QString& toId, const QDate& _date, const bool exactDate) const +const MyMoneyPrice MyMoneyDatabaseMgr::price(const TQString& fromId, const TQString& toId, const TQDate& _date, const bool exactDate) const { return m_sql->fetchSinglePrice(fromId, toId, _date, exactDate); } @@ -1160,12 +1160,12 @@ void MyMoneyDatabaseMgr::addSchedule(MyMoneySchedule& sched) void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched) { - QMap scheduleList = m_sql->fetchSchedules(QString(sched.id())); - QMap::ConstIterator it; + TQMap scheduleList = m_sql->fetchSchedules(TQString(sched.id())); + TQMap::ConstIterator it; - it = scheduleList.find(sched.id()); + it = scheduleList.tqfind(sched.id()); if(it == scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1174,12 +1174,12 @@ void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched) void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched) { - QMap scheduleList = m_sql->fetchSchedules(QString(sched.id())); - QMap::ConstIterator it; + TQMap scheduleList = m_sql->fetchSchedules(TQString(sched.id())); + TQMap::ConstIterator it; - it = scheduleList.find(sched.id()); + it = scheduleList.tqfind(sched.id()); if(it == scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1188,33 +1188,33 @@ void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched) m_sql->removeSchedule(sched); } -const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const QString& id) const +const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const TQString& id) const { - QMap scheduleList = m_sql->fetchSchedules(QString(id)); - QMap::ConstIterator pos; + TQMap scheduleList = m_sql->fetchSchedules(TQString(id)); + TQMap::ConstIterator pos; // locate the schedule and if present, return it's data - pos = scheduleList.find(id); + pos = scheduleList.tqfind(id); if(pos != scheduleList.end()) return (*pos); // throw an exception, if it does not exist - QString msg = "Unknown schedule id '" + id + "'"; + TQString msg = "Unknown schedule id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -const QValueList MyMoneyDatabaseMgr::scheduleList(const QString& accountId, +const TQValueList MyMoneyDatabaseMgr::scheduleList(const TQString& accountId, const MyMoneySchedule::typeE type, const MyMoneySchedule::occurenceE occurence, const MyMoneySchedule::paymentTypeE paymentType, - const QDate& startDate, - const QDate& endDate, + const TQDate& startDate, + const TQDate& endDate, const bool overdue) const { - QMap scheduleList; + TQMap scheduleList; if (m_sql) scheduleList = m_sql->fetchSchedules(); - QMap::ConstIterator pos; - QValueList list; + TQMap::ConstIterator pos; + TQValueList list; // qDebug("scheduleList()"); @@ -1241,8 +1241,8 @@ const QValueList MyMoneyDatabaseMgr::scheduleList(const QString if(!accountId.isEmpty()) { MyMoneyTransaction t = (*pos).transaction(); - QValueList::ConstIterator it; - QValueList splits; + TQValueList::ConstIterator it; + TQValueList splits; splits = t.splits(); for(it = splits.begin(); it != splits.end(); ++it) { if((*it).accountId() == accountId) @@ -1275,10 +1275,10 @@ const QValueList MyMoneyDatabaseMgr::scheduleList(const QString if (!(*pos).isOverdue()) continue; /* - QDate nextPayment = (*pos).nextPayment((*pos).lastPayment()); + TQDate nextPayment = (*pos).nextPayment((*pos).lastPayment()); if(!nextPayment.isValid()) continue; - if(nextPayment >= QDate::currentDate()) + if(nextPayment >= TQDate::tqcurrentDate()) continue; */ } @@ -1289,16 +1289,16 @@ const QValueList MyMoneyDatabaseMgr::scheduleList(const QString return list; } -const QValueList MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes, +const TQValueList MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts) const + TQDate startDate, + const TQStringList& accounts) const { // qDebug("scheduleListEx"); - QMap scheduleList = m_sql->fetchSchedules(); - QMap::ConstIterator pos; - QValueList list; + TQMap scheduleList = m_sql->fetchSchedules(); + TQMap::ConstIterator pos; + TQValueList list; if (!startDate.isValid()) return list; @@ -1325,7 +1325,7 @@ const QValueList MyMoneyDatabaseMgr::scheduleListEx( int schedu if (accounts.count() > 0) { - if (accounts.contains((*pos).account().id())) + if (accounts.tqcontains((*pos).account().id())) continue; } @@ -1339,12 +1339,12 @@ const QValueList MyMoneyDatabaseMgr::scheduleListEx( int schedu void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency) { if (m_sql) { - QMap currencyList = m_sql->fetchCurrencies(QString(currency.id())); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(currency.id())); + TQMap::ConstIterator it; - it = currencyList.find(currency.id()); + it = currencyList.tqfind(currency.id()); if(it != currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot add currency with existing id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id())); } m_sql->addCurrency(currency); @@ -1353,12 +1353,12 @@ void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency) void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency) { - QMap currencyList = m_sql->fetchCurrencies(QString(currency.id())); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(currency.id())); + TQMap::ConstIterator it; - it = currencyList.find(currency.id()); + it = currencyList.tqfind(currency.id()); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot modify currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id())); } m_sql->modifyCurrency(currency); @@ -1366,50 +1366,50 @@ void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency) void MyMoneyDatabaseMgr::removeCurrency(const MyMoneySecurity& currency) { - QMap currencyList = m_sql->fetchCurrencies(QString(currency.id())); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(currency.id())); + TQMap::ConstIterator it; // FIXME: check referential integrity - it = currencyList.find(currency.id()); + it = currencyList.tqfind(currency.id()); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot remove currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id())); } m_sql->removeCurrency(currency); } -const MyMoneySecurity MyMoneyDatabaseMgr::currency(const QString& id) const +const MyMoneySecurity MyMoneyDatabaseMgr::currency(const TQString& id) const { if(id.isEmpty()) { } - QMap currencyList = m_sql->fetchCurrencies(QString(id)); - QMap::ConstIterator it; + TQMap currencyList = m_sql->fetchCurrencies(TQString(id)); + TQMap::ConstIterator it; - it = currencyList.find(id); + it = currencyList.tqfind(id); if(it == currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot retrieve currency with unknown id '%1'").arg(id.data())); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); } return *it; } -const QValueList MyMoneyDatabaseMgr::currencyList(void) const +const TQValueList MyMoneyDatabaseMgr::currencyList(void) const { if (m_sql) { return m_sql->fetchCurrencies().values(); } else { - return QValueList (); + return TQValueList (); } } -const QValueList MyMoneyDatabaseMgr::reportList( void ) const +const TQValueList MyMoneyDatabaseMgr::reportList( void ) const { if (m_sql) { return m_sql->fetchReports().values(); } else { - return QValueList (); + return TQValueList (); } } @@ -1426,12 +1426,12 @@ void MyMoneyDatabaseMgr::addReport( MyMoneyReport& report ) void MyMoneyDatabaseMgr::modifyReport( const MyMoneyReport& report ) { - QMap reportList = m_sql->fetchReports(QString(report.id())); - QMap::ConstIterator it; + TQMap reportList = m_sql->fetchReports(TQString(report.id())); + TQMap::ConstIterator it; - it = reportList.find(report.id()); + it = reportList.tqfind(report.id()); if(it == reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1443,26 +1443,26 @@ unsigned MyMoneyDatabaseMgr::countReports( void ) const return m_sql->getRecCount("kmmReports"); } -const MyMoneyReport MyMoneyDatabaseMgr::report( const QString& id ) const +const MyMoneyReport MyMoneyDatabaseMgr::report( const TQString& id ) const { - return m_sql->fetchReports(QString(id))[id]; + return m_sql->fetchReports(TQString(id))[id]; } void MyMoneyDatabaseMgr::removeReport(const MyMoneyReport& report) { - QMap reportList = m_sql->fetchReports(QString(report.id())); - QMap::ConstIterator it; + TQMap reportList = m_sql->fetchReports(TQString(report.id())); + TQMap::ConstIterator it; - it = reportList.find(report.id()); + it = reportList.tqfind(report.id()); if(it == reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_sql->removeReport(report); } -const QValueList MyMoneyDatabaseMgr::budgetList( void ) const +const TQValueList MyMoneyDatabaseMgr::budgetList( void ) const { return m_sql->fetchBudgets().values(); } @@ -1473,10 +1473,10 @@ void MyMoneyDatabaseMgr::addBudget( MyMoneyBudget& budget ) m_sql->addBudget(newBudget); } -const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const QString& budget) const +const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const TQString& budget) const { - QMap budgets = m_sql->fetchBudgets(); - QMap::ConstIterator it_p; + TQMap budgets = m_sql->fetchBudgets(); + TQMap::ConstIterator it_p; for(it_p = budgets.begin(); it_p != budgets.end(); ++it_p) { if((*it_p).name() == budget) { @@ -1489,18 +1489,18 @@ const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const QString& budget) cons void MyMoneyDatabaseMgr::modifyBudget( const MyMoneyBudget& budget ) { - //QMap::ConstIterator it; + //TQMap::ConstIterator it; - //it = m_budgetList.find(budget.id()); + //it = m_budgetList.tqfind(budget.id()); //if(it == m_budgetList.end()) { - // QString msg = "Unknown budget '" + budget.id() + "'"; + // TQString msg = "Unknown budget '" + budget.id() + "'"; // throw new MYMONEYEXCEPTION(msg); //} //m_budgetList.modify(budget.id(), budget); startTransaction(); - if (m_sql->fetchBudgets(QString(budget.id()), true).empty()) { - QString msg = "Unknown budget '" + budget.id() + "'"; + if (m_sql->fetchBudgets(TQString(budget.id()), true).empty()) { + TQString msg = "Unknown budget '" + budget.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_sql->modifyBudget(budget); @@ -1512,18 +1512,18 @@ unsigned MyMoneyDatabaseMgr::countBudgets( void ) const return m_sql->getRecCount("kmmBudgetConfig"); } -MyMoneyBudget MyMoneyDatabaseMgr::budget( const QString& id ) const +MyMoneyBudget MyMoneyDatabaseMgr::budget( const TQString& id ) const { - return m_sql->fetchBudgets(QString(id)) [id]; + return m_sql->fetchBudgets(TQString(id)) [id]; } void MyMoneyDatabaseMgr::removeBudget(const MyMoneyBudget& budget) { -// QMap::ConstIterator it; +// TQMap::ConstIterator it; // -// it = m_budgetList.find(budget.id()); +// it = m_budgetList.tqfind(budget.id()); // if(it == m_budgetList.end()) { -// QString msg = "Unknown budget '" + budget.id() + "'"; +// TQString msg = "Unknown budget '" + budget.id() + "'"; // throw new MYMONEYEXCEPTION(msg); // } // @@ -1537,7 +1537,7 @@ void MyMoneyDatabaseMgr::clearCache(void) class isReferencedHelper { public: - isReferencedHelper(const QString& id) + isReferencedHelper(const TQString& id) : m_id (id) {} @@ -1545,13 +1545,13 @@ class isReferencedHelper { { return obj.hasReferenceTo(m_id); } private: - QString m_id; + TQString m_id; }; bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFileBitArray& skipCheck) const { bool rc = false; - const QString& id = obj.id(); + const TQString& id = obj.id(); MyMoneyPriceList::const_iterator it_pr; @@ -1578,7 +1578,7 @@ bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFil skipTransactions = true; } if (! skipTransactions) { - //QMap transactionList = m_sql->fetchTransactions(f); + //TQMap transactionList = m_sql->fetchTransactions(f); //rc = (transactionList.end() != std::find_if(transactionList.begin(), transactionList.end(), isReferencedHelper(id))); //if (rc != m_sql->isReferencedByTransaction(obj.id())) // qDebug ("Transaction match inconsistency."); @@ -1587,40 +1587,40 @@ bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFil } if(!skipCheck[RefCheckAccount] && !rc) { - QValueList accountList; + TQValueList accountList; MyMoneyFile::instance()->accountList(accountList); rc = (accountList.end() != std::find_if(accountList.begin(), accountList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckInstitution] && !rc) { - QValueList institutionList; + TQValueList institutionList; MyMoneyFile::instance()->institutionList(institutionList); rc = (institutionList.end() != std::find_if(institutionList.begin(), institutionList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckPayee] && !rc) { - QValueList payeeList = MyMoneyFile::instance()->payeeList(); + TQValueList payeeList = MyMoneyFile::instance()->payeeList(); rc = (payeeList.end() != std::find_if(payeeList.begin(), payeeList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckReport] && !rc) { - QMap reportList = m_sql->fetchReports(); + TQMap reportList = m_sql->fetchReports(); rc = (reportList.end() != std::find_if(reportList.begin(), reportList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckBudget] && !rc) { - QMap budgets = m_sql->fetchBudgets(); + TQMap budgets = m_sql->fetchBudgets(); rc = (budgets.end() != std::find_if(budgets.begin(), budgets.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckSchedule] && !rc) { - QMap scheduleList = m_sql->fetchSchedules(); + TQMap scheduleList = m_sql->fetchSchedules(); rc = (scheduleList.end() != std::find_if(scheduleList.begin(), scheduleList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckSecurity] && !rc) { - QValueList securitiesList = MyMoneyFile::instance()->securityList(); + TQValueList securitiesList = MyMoneyFile::instance()->securityList(); rc = (securitiesList.end() != std::find_if(securitiesList.begin(), securitiesList.end(), isReferencedHelper(id))); } if(!skipCheck[RefCheckCurrency] && !rc) { - QValueList currencyList = m_sql->fetchCurrencies().values(); + TQValueList currencyList = m_sql->fetchCurrencies().values(); rc = (currencyList.end() != std::find_if(currencyList.begin(), currencyList.end(), isReferencedHelper(id))); } - // within the pricelist we don't have to scan each entry. Checking the QPair + // within the pricelist we don't have to scan each entry. Checking the TQPair // members of the MyMoneySecurityPair is enough as they are identical to the // two security ids if(!skipCheck[RefCheckPrice] && !rc) { @@ -1653,7 +1653,7 @@ bool MyMoneyDatabaseMgr::commitTransaction(void) void MyMoneyDatabaseMgr::rollbackTransaction(void) { if (m_sql) m_sql->cancelCommitUnit ("databasetransaction"); } -void MyMoneyDatabaseMgr::setCreationDate(const QDate& val) +void MyMoneyDatabaseMgr::setCreationDate(const TQDate& val) { m_creationDate = val; } KSharedPtr MyMoneyDatabaseMgr::connectToDatabase(const KURL& url) { @@ -1664,17 +1664,17 @@ KSharedPtr MyMoneyDatabaseMgr::connectToDatabase(const KURL& void MyMoneyDatabaseMgr::fillStorage() { m_sql->fillStorage(); } -void MyMoneyDatabaseMgr::setLastModificationDate(const QDate& val) +void MyMoneyDatabaseMgr::setLastModificationDate(const TQDate& val) { m_lastModificationDate = val; } -bool MyMoneyDatabaseMgr::isDuplicateTransaction(const QString& /*id*/) const +bool MyMoneyDatabaseMgr::isDuplicateTransaction(const TQString& /*id*/) const { //FIXME: figure out the real id from the key and check the DB. -//return m_transactionKeys.contains(id); +//return m_transactionKeys.tqcontains(id); return false; } -void MyMoneyDatabaseMgr::loadAccounts(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadAccounts(const TQMap& /*map*/) { // m_accountList = map; //FIXME: update the database. @@ -1686,50 +1686,50 @@ void MyMoneyDatabaseMgr::loadAccounts(const QMap& /*map // on error, rollbackTransaction } -void MyMoneyDatabaseMgr::loadTransactions(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadTransactions(const TQMap& /*map*/) { // m_transactionList = map; //FIXME: update the database. // // now fill the key map -// QMap keys; -// QMap::ConstIterator it_t; +// TQMap keys; +// TQMap::ConstIterator it_t; // for(it_t = map.begin(); it_t != map.end(); ++it_t) { // keys[(*it_t).id()] = it_t.key(); // } // m_transactionKeys = keys; } -void MyMoneyDatabaseMgr::loadInstitutions(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadInstitutions(const TQMap& /*map*/) { // m_institutionList = map; //FIXME: update the database. // // now fill the key map -// QMap keys; -// QMap::ConstIterator it_t; +// TQMap keys; +// TQMap::ConstIterator it_t; // for(it_t = map.begin(); it_t != map.end(); ++it_t) { // keys[(*it_t).id()] = it_t.key(); // } // m_transactionKeys = keys; } -void MyMoneyDatabaseMgr::loadPayees(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadPayees(const TQMap& /*map*/) { // m_payeeList = map; } -void MyMoneyDatabaseMgr::loadSchedules(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadSchedules(const TQMap& /*map*/) { // m_scheduleList = map; } -void MyMoneyDatabaseMgr::loadSecurities(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadSecurities(const TQMap& /*map*/) { // m_securitiesList = map; } -void MyMoneyDatabaseMgr::loadCurrencies(const QMap& /*map*/) +void MyMoneyDatabaseMgr::loadCurrencies(const TQMap& /*map*/) { // m_currencyList = map; //FIXME: update the database. @@ -1741,7 +1741,7 @@ void MyMoneyDatabaseMgr::loadCurrencies(const QMap& /* // on error, rollbackTransaction } -void MyMoneyDatabaseMgr::loadReports( const QMap& /*reports*/ ) +void MyMoneyDatabaseMgr::loadReports( const TQMap& /*reports*/ ) { // m_reportList = reports; //FIXME: update the database. @@ -1753,7 +1753,7 @@ void MyMoneyDatabaseMgr::loadReports( const QMap& /*repo // on error, rollbackTransaction } -void MyMoneyDatabaseMgr::loadBudgets( const QMap& /*budgets*/ ) +void MyMoneyDatabaseMgr::loadBudgets( const TQMap& /*budgets*/ ) { // m_budgetList = budgets; //FIXME: update the database. @@ -1837,29 +1837,29 @@ void MyMoneyDatabaseMgr::loadBudgetId(const unsigned long id) void MyMoneyDatabaseMgr::rebuildAccountBalances(void) { startTransaction(); - QMap accountMap = m_sql->fetchAccounts(QStringList(), true); + TQMap accountMap = m_sql->fetchAccounts(TQStringList(), true); - QMap balanceMap = m_sql->fetchBalance(accountMap.keys(), QDate()); + TQMap balanceMap = m_sql->fetchBalance(accountMap.keys(), TQDate()); - for (QMap::const_iterator it_b = balanceMap.begin(); + for (TQMap::const_iterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) { accountMap[it_b.key()].setBalance(it_b.data()); } - for (QMap::const_iterator it_a = accountMap.begin(); + for (TQMap::const_iterator it_a = accountMap.begin(); it_a != accountMap.end(); ++it_a) { m_sql->modifyAccount(it_a.data()); } commitTransaction(); } -void MyMoneyDatabaseMgr::removeReferences(const QString& id) +void MyMoneyDatabaseMgr::removeReferences(const TQString& id) { - QMap::const_iterator it_r; - QMap::const_iterator it_b; + TQMap::const_iterator it_r; + TQMap::const_iterator it_b; // remove from reports - QMap reportList = m_sql->fetchReports(); + TQMap reportList = m_sql->fetchReports(); for(it_r = reportList.begin(); it_r != reportList.end(); ++it_r) { MyMoneyReport r = *it_r; r.removeReference(id); @@ -1867,7 +1867,7 @@ void MyMoneyDatabaseMgr::removeReferences(const QString& id) } // remove from budgets - QMap budgetList = m_sql->fetchBudgets(); + TQMap budgetList = m_sql->fetchBudgets(); for(it_b = budgetList.begin(); it_b != budgetList.end(); ++it_b) { MyMoneyBudget b = *it_b; b.removeReference(id); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.h b/kmymoney2/mymoney/storage/mymoneydatabasemgr.h index 21bf8d6..1511915 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.h +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.h @@ -50,8 +50,8 @@ public: // general get functions virtual const MyMoneyPayee user(void) const; - virtual const QDate creationDate(void) const; - virtual const QDate lastModificationDate(void) const; + virtual const TQDate creationDate(void) const; + virtual const TQDate lastModificationDate(void) const; virtual unsigned int currentFixVersion(void) const; virtual unsigned int fileFixVersion(void) const; @@ -60,9 +60,9 @@ public: virtual void setFileFixVersion(const unsigned int v); // methods provided by MyMoneyKeyValueContainer - virtual void setValue(const QString& key, const QString& value); - virtual const QString value(const QString& key) const; - virtual void deletePair(const QString& key); + virtual void setValue(const TQString& key, const TQString& value); + virtual const TQString value(const TQString& key) const; + virtual void deletePair(const TQString& key); /** * This method is used to duplicate an IMyMoneyStorage object and return @@ -82,15 +82,15 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account); + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account); /** * This method is used to create a new payee @@ -105,22 +105,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payee(const QString& id) const; + virtual const MyMoneyPayee payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payeeByName(const QString& payee) const; + virtual const MyMoneyPayee payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -144,9 +144,9 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - virtual const QValueList payeeList(void) const; + virtual const TQValueList payeeList(void) const; /** * Returns the account addressed by it's id. @@ -157,7 +157,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - virtual const MyMoneyAccount account(const QString& id) const; + virtual const MyMoneyAccount account(const TQString& id) const; /** * This method is used to check whether a given @@ -168,23 +168,23 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - virtual bool isStandardAccount(const QString& id) const; + virtual bool isStandardAccount(const TQString& id) const; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - virtual void setAccountName(const QString& id, const QString& name); + virtual void setAccountName(const TQString& id, const TQString& name); /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -196,7 +196,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * QString with the object. + * TQString with the object. * * An exception will be thrown upon error conditions. * @@ -216,7 +216,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - virtual bool hasActiveSplits(const QString& id) const; + virtual bool hasActiveSplits(const TQString& id) const; /** * This method is used to return the actual balance of an account @@ -229,7 +229,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney balance(const QString& id, const QDate& date) const; + virtual const MyMoneyMoney balance(const TQString& id, const TQDate& date) const; /** * This method is used to return the actual balance of an account @@ -242,7 +242,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney totalBalance(const QString& id, const QDate& date) const; + virtual const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date) const; /** * Returns the institution of a given ID @@ -251,7 +251,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - virtual const MyMoneyInstitution institution(const QString& id) const; + virtual const MyMoneyInstitution institution(const TQString& id) const; /** * This method returns an indicator if the storage object has been @@ -284,10 +284,10 @@ public: * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QValueList containing the + * @return TQValueList containing the * institution information */ - virtual const QValueList institutionList(void) const; + virtual const TQValueList institutionList(void) const; /** * Modifies an already existing account in the file global account pool. @@ -320,14 +320,14 @@ public: virtual void modifyTransaction(const MyMoneyTransaction& transaction); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * This method is used to remove a transaction from the transaction @@ -343,25 +343,25 @@ public: * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - virtual unsigned int transactionCount(const QString& account = QString()) const; + virtual unsigned int transactionCount(const TQString& account = TQString()) const; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - virtual const QMap transactionCountMap(void) const; + virtual const TQMap transactionCountMap(void) const; /** * This method is used to pull a list of transactions from the file @@ -374,9 +374,9 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - virtual const QValueList transactionList(MyMoneyTransactionFilter& filter) const; + virtual const TQValueList transactionList(MyMoneyTransactionFilter& filter) const; /** * This method is the same as above, but instead of a return value, a @@ -386,7 +386,7 @@ public: * be cleared before filling with results. * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const; + virtual void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const; /** * This method is the same as above, but the list contains pairs of @@ -396,7 +396,7 @@ public: * be cleared before filling with results. * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList >& list, MyMoneyTransactionFilter& filter) const; + virtual void transactionList(TQValueList >& list, MyMoneyTransactionFilter& filter) const; /** * Deletes an existing account from the file global account pool @@ -425,20 +425,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return the requested transaction */ - virtual const MyMoneyTransaction transaction(const QString& id) const; + virtual const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return MyMoneyTransaction object */ - virtual const MyMoneyTransaction transaction(const QString& account, const int idx) const; + virtual const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method returns the number of institutions currently known to file @@ -451,11 +451,11 @@ public: /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList& list) const; + virtual void accountList(TQValueList& list) const; /** * This method is used to return the standard liability account @@ -524,22 +524,22 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - virtual const MyMoneySecurity security(const QString& id) const; + virtual const MyMoneySecurity security(const TQString& id) const; /** * This method returns a list of the security objects * inside a MyMoneyStorage object * - * @return QValueList containing objects + * @return TQValueList containing objects */ - virtual const QValueList securityList(void) const; + virtual const TQValueList securityList(void) const; virtual void addPrice(const MyMoneyPrice& price); virtual void removePrice(const MyMoneyPrice& price); - virtual const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const; + virtual const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; /** * This method returns a list of all prices. @@ -586,10 +586,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - virtual const MyMoneySchedule schedule(const QString& id) const; + virtual const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to extract a list of scheduled transactions @@ -597,7 +597,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -609,27 +609,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - virtual const QValueList scheduleList(const QString& accountId = QString(), + virtual const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - virtual const QValueList scheduleListEx( int scheduleTypes, + virtual const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to add a new currency object to the engine. @@ -668,10 +668,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneyCurrency object */ - virtual const MyMoneySecurity currency(const QString& id) const; + virtual const MyMoneySecurity currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -679,9 +679,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList currencyList(void) const; + virtual const TQValueList currencyList(void) const; /** * This method is used to retrieve the list of all reports @@ -689,9 +689,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList reportList( void ) const; + virtual const TQValueList reportList( void ) const; /** * This method is used to add a new report to the engine. @@ -729,10 +729,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - virtual const MyMoneyReport report( const QString& id ) const; + virtual const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -750,9 +750,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList budgetList( void ) const; + virtual const TQValueList budgetList( void ) const; /** * This method is used to add a new budget to the engine. @@ -771,11 +771,11 @@ public: * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget object of budget */ - virtual const MyMoneyBudget budgetByName(const QString& budget) const; + virtual const MyMoneyBudget budgetByName(const TQString& budget) const; /** * This method is used to modify an existing MyMoneyBudget @@ -801,10 +801,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - virtual MyMoneyBudget budget( const QString& id ) const; + virtual MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -849,7 +849,7 @@ public: virtual void rollbackTransaction(void); // general set functions - virtual void setCreationDate(const QDate& val); + virtual void setCreationDate(const TQDate& val); /** * This method is used to get a SQL reader for subsequent database access @@ -869,25 +869,25 @@ public: * therefor be called as last operation when loading from a * file. * - * @param val QDate of last modification + * @param val TQDate of last modification */ - virtual void setLastModificationDate(const QDate& val); + virtual void setLastModificationDate(const TQDate& val); /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - virtual bool isDuplicateTransaction(const QString&) const; - - virtual void loadAccounts(const QMap& map); - virtual void loadTransactions(const QMap& map); - virtual void loadInstitutions(const QMap& map); - virtual void loadPayees(const QMap& map); - virtual void loadSchedules(const QMap& map); - virtual void loadSecurities(const QMap& map); - virtual void loadCurrencies(const QMap& map); - virtual void loadReports( const QMap& reports ); - virtual void loadBudgets( const QMap& budgets ); + virtual bool isDuplicateTransaction(const TQString&) const; + + virtual void loadAccounts(const TQMap& map); + virtual void loadTransactions(const TQMap& map); + virtual void loadInstitutions(const TQMap& map); + virtual void loadPayees(const TQMap& map); + virtual void loadSchedules(const TQMap& map); + virtual void loadSecurities(const TQMap& map); + virtual void loadCurrencies(const TQMap& map); + virtual void loadReports( const TQMap& reports ); + virtual void loadBudgets( const TQMap& budgets ); virtual void loadPrices(const MyMoneyPriceList& list); virtual unsigned long accountId(void) const; @@ -913,10 +913,10 @@ public: * from the container. It is meant to be used for permanent storage * functionality. See MyMoneyKeyValueContainer::pairs() for details. * - * @return QMap containing all key/value pairs of + * @return TQMap containing all key/value pairs of * this container. */ - virtual const QMap pairs(void) const; + virtual const TQMap pairs(void) const; /** * This method is used to initially store a set of key/value pairs @@ -924,12 +924,12 @@ public: * from permanent storage. See MyMoneyKeyValueContainer::setPairs() * for details * - * @param list const QMap containing the set of + * @param list const TQMap containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - virtual void setPairs(const QMap& list); + virtual void setPairs(const TQMap& list); /** * This method recalculates the balances of all accounts @@ -943,7 +943,7 @@ private: * object. It is set during the constructor and can only be modified using * the stream read operator. */ - QDate m_creationDate; + TQDate m_creationDate; /** * This member variable contains the current fix level of application @@ -961,7 +961,7 @@ private: * This member variable keeps the date of the last modification of * the MyMoneySeqAccessMgr object. */ - QDate m_lastModificationDate; + TQDate m_lastModificationDate; /** * This contains the interface with SQL reader for database access @@ -978,47 +978,47 @@ private: * This method is used to get the next valid ID for a institution * @return id for a institution */ - const QString nextInstitutionID(void); + const TQString nextInstitutionID(void); /** * This method is used to get the next valid ID for an account * @return id for an account */ - const QString nextAccountID(void); + const TQString nextAccountID(void); /** * This method is used to get the next valid ID for a transaction * @return id for a transaction */ - const QString nextTransactionID(void); + const TQString nextTransactionID(void); /** * This method is used to get the next valid ID for a payee * @return id for a payee */ - const QString nextPayeeID(void); + const TQString nextPayeeID(void); /** * This method is used to get the next valid ID for a scheduled transaction * @return id for a scheduled transaction */ - const QString nextScheduleID(void); + const TQString nextScheduleID(void); /** * This method is used to get the next valid ID for an security object. * @return id for an security object */ - const QString nextSecurityID(void); + const TQString nextSecurityID(void); - const QString nextReportID(void); + const TQString nextReportID(void); /** * This method is used to get the next valid ID for a budget object. * @return id for an budget object */ - const QString nextBudgetID(void); + const TQString nextBudgetID(void); - void removeReferences(const QString& id); + void removeReferences(const TQString& id); static const int INSTITUTION_ID_SIZE = 6; static const int ACCOUNT_ID_SIZE = 6; diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp index f6a2bba..ae589cd 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp @@ -60,7 +60,7 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->nextReportID() == 0); CPPUNIT_ASSERT(m->institutionList().count() == 0); - QValueList accList; + TQValueList accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 0); @@ -70,31 +70,31 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->payeeList().count() == 0); CPPUNIT_ASSERT(m->scheduleList().count() == 0); - CPPUNIT_ASSERT(m->m_creationDate == QDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); } void MyMoneyDatabaseMgrTest::testCreateDb() { m->commitTransaction(); // Fetch the list of available drivers - QStringList list = QSqlDatabase::drivers(); - QStringList::Iterator it = list.begin(); + TQStringList list = TQSqlDatabase::drivers(); + TQStringList::Iterator it = list.begin(); if (it == list.end()) { m_canOpen = false; } else { struct passwd * pwd = getpwuid(geteuid()); - QString userName; + TQString userName; if (pwd != 0) { - userName = QString(pwd->pw_name); + userName = TQString(pwd->pw_name); } - //"QMYSQL3" - //"QPSQL7" - //"QSQLITE3" + //"TQMYSQL3" + //"TQPSQL7" + //"TQSQLITE3" m_url = "sql://" + userName + "@localhost/kmm_test_driver?driver=" - //"QPSQL7&mode=single"; - //"QSQLITE3&mode=single"; - //"QMYSQL3&mode=single"; + //"TQPSQL7&mode=single"; + //"TQSQLITE3&mode=single"; + //"TQMYSQL3&mode=single"; + *it + "&mode=single"; KSharedPtr sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(0 != sql); @@ -118,8 +118,8 @@ void MyMoneyDatabaseMgrTest::testAttachDb() { MyMoneyFile::instance()->detachStorage(); KSharedPtr sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(sql); - int openStatus = sql->open(m_url, IO_ReadWrite); - CPPUNIT_ASSERT(0 == openStatus); + int opentqStatus = sql->open(m_url, IO_ReadWrite); + CPPUNIT_ASSERT(0 == opentqStatus); MyMoneyFile::instance()->attachStorage(m); m->startTransaction(); m_dbAttached = true; @@ -202,7 +202,7 @@ void MyMoneyDatabaseMgrTest::testIsStandardAccount() CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_ASSET) == true); CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_EXPENSE) == true); CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_INCOME) == true); - CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_EQUITY) == true); + CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_ETQUITY) == true); CPPUNIT_ASSERT(m->isStandardAccount("A0002") == false); } @@ -221,7 +221,7 @@ void MyMoneyDatabaseMgrTest::testNewAccount() { m->addAccount(a); CPPUNIT_ASSERT(m->accountId() == 1); - QValueList accList; + TQValueList accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 1); CPPUNIT_ASSERT((*(accList.begin())).name() == "AccountName"); @@ -274,7 +274,7 @@ void MyMoneyDatabaseMgrTest::testAddNewAccount() { m->setDirty(); CPPUNIT_ASSERT(m->accountId() == 2); - QValueList accList; + TQValueList accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 2); @@ -421,7 +421,7 @@ void MyMoneyDatabaseMgrTest::testModifyAccount() { try { m->modifyAccount(a); MyMoneyAccount b = m->account("A000001"); - CPPUNIT_ASSERT(b.parentAccountId() == a.parentAccountId()); + CPPUNIT_ASSERT(b.tqparentAccountId() == a.tqparentAccountId()); CPPUNIT_ASSERT(b.name() == "New account name"); } catch (MyMoneyException *e) { delete e; @@ -449,7 +449,7 @@ void MyMoneyDatabaseMgrTest::testModifyAccount() { delete e; } - // use different parent + // use different tqparent a.setParentAccountId("A000002"); try { m->modifyAccount(c); @@ -490,7 +490,7 @@ void MyMoneyDatabaseMgrTest::testModifyInstitution() { } } -void MyMoneyDatabaseMgrTest::testReparentAccount() { +void MyMoneyDatabaseMgrTest::testRetqparentAccount() { testAttachDb(); if (!m_canOpen) { @@ -535,23 +535,23 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() { CPPUNIT_ASSERT(in.id() == "A000005"); CPPUNIT_ASSERT(ch.id() == "A000006"); - MyMoneyAccount parent = m->expense(); + MyMoneyAccount tqparent = m->expense(); - m->addAccount(parent, ex1); + m->addAccount(tqparent, ex1); m->addAccount(ex1, ex2); - m->addAccount(parent, ex3); - m->addAccount(parent, ex4); + m->addAccount(tqparent, ex3); + m->addAccount(tqparent, ex4); - parent = m->income(); - m->addAccount(parent, in); + tqparent = m->income(); + m->addAccount(tqparent, in); - parent = m->asset(); - m->addAccount(parent, ch); + tqparent = m->asset(); + m->addAccount(tqparent, ch); MyMoneyFile::instance()->preloadCache(); CPPUNIT_ASSERT(m->expense().accountCount() == 3); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 1); - CPPUNIT_ASSERT(ex3.parentAccountId() == STD_ACC_EXPENSE); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == STD_ACC_EXPENSE); //for (int i = 0; i < 100; ++i) { m->reparentAccount(ex3, ex1); @@ -559,7 +559,7 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() { MyMoneyFile::instance()->preloadCache(); CPPUNIT_ASSERT(m->expense().accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); - CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == ex1.id()); } catch (MyMoneyException *e) { std::cout << std::endl << e->what() << std::endl; delete e; @@ -575,7 +575,7 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { return; } - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount ch; MyMoneyTransaction t1, t2; @@ -589,14 +589,14 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000005"); // Salary s.setShares(-100000); s.setValue(-100000); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2002,5,10)); + t1.setPostDate(TQDate(2002,5,10)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -613,35 +613,35 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { try { // I spent some money, not so great - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000004"); // Grosseries s.setShares(10000); s.setValue(10000); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); // 16% sales tax s.setShares(1200); s.setValue(1200); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000003"); // 7% sales tax s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000006"); // Checkings account s.setShares(-11600); s.setValue(-11600); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - t2.setPostDate(QDate(2002,5,9)); + t2.setPostDate(TQDate(2002,5,9)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -652,10 +652,10 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { CPPUNIT_ASSERT(t2.splitCount() == 4); CPPUNIT_ASSERT(m->transactionCount() == 2); - //QMap::ConstIterator it_k; + //TQMap::ConstIterator it_k; MyMoneyTransactionFilter f; - QValueList transactionList (m->transactionList(f)); - QValueList::ConstIterator it_t (transactionList.begin()); + TQValueList transactionList (m->transactionList(f)); + TQValueList::ConstIterator it_t (transactionList.begin()); //CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); CPPUNIT_ASSERT((*it_t).id() == "T000000000000000002"); @@ -671,12 +671,12 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000002"); ++it; @@ -717,7 +717,7 @@ void MyMoneyDatabaseMgrTest::testAddBudget() { MyMoneyBudget budget; budget.setName("TestBudget"); - budget.setBudgetStart(QDate::currentDate(Qt::LocalTime)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime)); m->addBudget(budget); @@ -742,7 +742,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { MyMoneyBudget newBudget = oldBudget; newBudget.clearId(); - newBudget.setName(QString("Copy of %1").arg(oldBudget.name())); + newBudget.setName(TQString("Copy of %1").tqarg(oldBudget.name())); m->addBudget(newBudget); CPPUNIT_ASSERT(m->budgetList().count() == 2); @@ -757,7 +757,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { CPPUNIT_ASSERT(testBudget.budgetStart() == newBudget.budgetStart()); CPPUNIT_ASSERT(testBudget.name() == newBudget.name()); - } catch (QString& s) { + } catch (TQString& s) { std::cout << "Error in testCopyBudget(): " << s << std::endl; CPPUNIT_ASSERT(false); } @@ -773,7 +773,7 @@ void MyMoneyDatabaseMgrTest::testModifyBudget() { MyMoneyBudget budget = m->budgetByName("TestBudget"); - budget.setBudgetStart(QDate::currentDate(Qt::LocalTime).addDays(-1)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime).addDays(-1)); m->modifyBudget(budget); @@ -815,9 +815,9 @@ void MyMoneyDatabaseMgrTest::testBalance() { testAddTransactions(); - CPPUNIT_ASSERT(m->balance("A000001", QDate()).isZero()); - CPPUNIT_ASSERT(m->balance("A000002", QDate()) == MyMoneyMoney(1200)); - CPPUNIT_ASSERT(m->balance("A000003", QDate()) == MyMoneyMoney(400)); + CPPUNIT_ASSERT(m->balance("A000001", TQDate()).isZero()); + CPPUNIT_ASSERT(m->balance("A000002", TQDate()) == MyMoneyMoney(1200)); + CPPUNIT_ASSERT(m->balance("A000003", TQDate()) == MyMoneyMoney(400)); //Add a transaction to zero account A000003 MyMoneyTransaction t1; MyMoneySplit s; @@ -828,31 +828,31 @@ void MyMoneyDatabaseMgrTest::testBalance() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2007,5,10)); + t1.setPostDate(TQDate(2007,5,10)); m->addTransaction(t1); - //qDebug ("Balance of A000003 is 0 = %s", m->balance("A000003", QDate()).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000003", QDate()).isZero()); + //qDebug ("Balance of A000003 is 0 = %s", m->balance("A000003", TQDate()).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000003", TQDate()).isZero()); - //qDebug ("Balance of A000001 is 1600 = %s", m->balance("A000001", QDate()).toString().ascii()); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + //qDebug ("Balance of A000001 is 1600 = %s", m->balance("A000001", TQDate()).toString().ascii()); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); - //qDebug ("Balance of A000006 is -11600 = %s", m->balance("A000006", QDate(2002,5,9)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,9)) == MyMoneyMoney(-11600)); + //qDebug ("Balance of A000006 is -11600 = %s", m->balance("A000006", TQDate(2002,5,9)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,9)) == MyMoneyMoney(-11600)); - //qDebug ("Balance of A000005 is -100000 = %s", m->balance("A000005", QDate(2002,5,10)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000005", QDate(2002,5,10)) == MyMoneyMoney(-100000)); + //qDebug ("Balance of A000005 is -100000 = %s", m->balance("A000005", TQDate(2002,5,10)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000005", TQDate(2002,5,10)) == MyMoneyMoney(-100000)); - //qDebug ("Balance of A000006 is 88400 = %s", m->balance("A000006", QDate(2002,5,10)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,10)) == MyMoneyMoney(88400)); + //qDebug ("Balance of A000006 is 88400 = %s", m->balance("A000006", TQDate(2002,5,10)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,10)) == MyMoneyMoney(88400)); } void MyMoneyDatabaseMgrTest::testModifyTransaction() { @@ -884,30 +884,30 @@ void MyMoneyDatabaseMgrTest::testModifyTransaction() { t.modifySplit(s); try { - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(10000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-11600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(10000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-11600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); m->modifyTransaction(t); - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(11000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-12600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(11000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-12600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); } catch (MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); } // now modify the date - t.setPostDate(QDate(2002,5,11)); + t.setPostDate(TQDate(2002,5,11)); try { m->modifyTransaction(t); - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(11000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-12600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(11000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-12600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); - //QMap::ConstIterator it_k; + //TQMap::ConstIterator it_k; MyMoneyTransactionFilter f; - QValueList transactionList (m->transactionList(f)); - QValueList::ConstIterator it_t (transactionList.begin()); + TQValueList transactionList (m->transactionList(f)); + TQValueList::ConstIterator it_t (transactionList.begin()); //it_k = m->m_transactionKeys.begin(); //CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); CPPUNIT_ASSERT((*it_t).id() == "T000000000000000001"); @@ -923,12 +923,12 @@ void MyMoneyDatabaseMgrTest::testModifyTransaction() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000001"); ++it; @@ -1004,7 +1004,7 @@ void MyMoneyDatabaseMgrTest::testRemoveUnusedAccount() { CPPUNIT_ASSERT(i.accountCount() == 1); CPPUNIT_ASSERT(m->accountCount() == 7); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->removeAccount(a); CPPUNIT_ASSERT(m->accountCount() == 6); @@ -1045,7 +1045,7 @@ void MyMoneyDatabaseMgrTest::testRemoveInstitution() { } testModifyInstitution(); - testReparentAccount(); + testRetqparentAccount(); MyMoneyInstitution i; MyMoneyAccount a; @@ -1066,7 +1066,7 @@ void MyMoneyDatabaseMgrTest::testRemoveInstitution() { // now remove the institution and see if the account survived ;-) try { m->removeInstitution(i); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); a = m->account("A000006"); CPPUNIT_ASSERT(a.institutionId().isEmpty()); @@ -1109,7 +1109,7 @@ void MyMoneyDatabaseMgrTest::testTransactionList() { testAddTransactions(); - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 2); @@ -1117,7 +1117,7 @@ void MyMoneyDatabaseMgrTest::testTransactionList() { CPPUNIT_ASSERT((*(list.at(1))).id() == "T000000000000000001"); filter.clear(); - filter.addAccount(QString("A000003")); + filter.addAccount(TQString("A000003")); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT((*(list.at(0))).id() == "T000000000000000002"); @@ -1355,7 +1355,7 @@ void MyMoneyDatabaseMgrTest::testPayeeName() { testAddPayee(); MyMoneyPayee p; - QString name("THB"); + TQString name("THB"); // OK case try { @@ -1474,7 +1474,7 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { } // put some accounts in the db, so the tests don't break - testReparentAccount(); + testRetqparentAccount(); try { CPPUNIT_ASSERT(m->scheduleList().count() == 0); @@ -1488,11 +1488,11 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); - t1.setPostDate(QDate(2003,7,10)); + t1.setPostDate(TQDate(2003,7,10)); schedule.setTransaction(t1); m->addSchedule(schedule); @@ -1511,8 +1511,8 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); m->addSchedule(schedule); @@ -1534,11 +1534,11 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { // MyMoneySchedule::TYPE_DEPOSIT, // MyMoneySchedule::OCCUR_DAILY, 1, // MyMoneySchedule::STYPE_MANUALDEPOSIT, -// QDate(), -// QDate(), +// TQDate(), +// TQDate(), // true, // false); -// t1.setPostDate(QDate(2003,7,10)); +// t1.setPostDate(TQDate(2003,7,10)); // schedule.setTransaction(t1); // m->addSchedule(schedule); @@ -1648,11 +1648,11 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { } // put some accounts in the db, so the tests don't break - testReparentAccount(); + testRetqparentAccount(); - QDate testDate = QDate::currentDate(); - QDate notOverdue = testDate.addDays(2); - QDate overdue = testDate.addDays(-2); + TQDate testDate = TQDate::tqcurrentDate(); + TQDate notOverdue = testDate.addDays(2); + TQDate overdue = testDate.addDays(-2); MyMoneyTransaction t1; MyMoneySplit s1, s2; @@ -1664,8 +1664,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_ONCE, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t1.setPostDate(notOverdue); @@ -1682,8 +1682,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_DIRECTDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t2.setPostDate(notOverdue.addDays(1)); @@ -1700,8 +1700,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t3.setPostDate(notOverdue.addDays(2)); @@ -1717,8 +1717,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule schedule4("Schedule 4", MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(), notOverdue.addDays(31), false, false); @@ -1736,7 +1736,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { CPPUNIT_FAIL("Unexpected exception"); } - QValueList list; + TQValueList list; // no filter list = m->scheduleList(); @@ -1783,7 +1783,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), notOverdue.addDays(1)); CPPUNIT_ASSERT(list.count() == 3); CPPUNIT_ASSERT(list[0].name() == "Schedule 1"); @@ -1804,8 +1804,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), - QDate(), + TQDate(), + TQDate(), true); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT(list[0].name() == "Schedule 4"); @@ -1978,7 +1978,7 @@ void MyMoneyDatabaseMgrTest::testAccountList() return; } - QValueList accounts; + TQValueList accounts; m->accountList(accounts); CPPUNIT_ASSERT(accounts.count() == 0); testAddNewAccount(); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h index 8ab4b64..d883032 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h @@ -40,7 +40,7 @@ class MyMoneyDatabaseMgrTest : public CppUnit::TestFixture { CPPUNIT_TEST(testIsStandardAccount); CPPUNIT_TEST(testNewAccount); CPPUNIT_TEST(testAddNewAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testAddInstitution); CPPUNIT_TEST(testInstitution); CPPUNIT_TEST(testAccount2Institution); @@ -103,7 +103,7 @@ public: void testAccount2Institution(); void testModifyAccount(); void testModifyInstitution(); - void testReparentAccount(); + void testRetqparentAccount(); void testAddTransactions(); void testTransactionCount(); void testAddBudget(); diff --git a/kmymoney2/mymoney/storage/mymoneymap.h b/kmymoney2/mymoney/storage/mymoneymap.h index fa5cda8..7582112 100644 --- a/kmymoney2/mymoney/storage/mymoneymap.h +++ b/kmymoney2/mymoney/storage/mymoneymap.h @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #ifndef MYMONEYMAP_H @@ -11,7 +11,7 @@ /** * @author Thomas Baumgart * - * This template class adds transaction security to the QMap<> class. + * This template class adds transaction security to the TQMap<> class. * The interface is very simple. Before you perform any changes, * you have to call the startTransaction() method. Then you can use * the insert(), modify() and remove() methods to modify the map. @@ -25,12 +25,12 @@ * someone is interested. */ template -class MyMoneyMap : protected QMap +class MyMoneyMap : protected TQMap { public: - // typedef QMapConstIterator const_iterator; + // typedef TQMapConstIterator const_iterator; - MyMoneyMap() : QMap() {} + MyMoneyMap() : TQMap() {} virtual ~MyMoneyMap() {} void startTransaction(unsigned long* id = 0) @@ -78,7 +78,7 @@ public: throw new MYMONEYEXCEPTION("No transaction started to modify element in container"); #if 0 - // had to take this out, because we use QPair in one instance as key + // had to take this out, because we use TQPair in one instance as key if(key.isEmpty()) throw new MYMONEYEXCEPTION("No key to update object"); #endif @@ -92,7 +92,7 @@ public: throw new MYMONEYEXCEPTION("No transaction started to remove element from container"); #if 0 - // had to take this out, because we use QPair in one instance as key + // had to take this out, because we use TQPair in one instance as key if(key.isEmpty()) throw new MYMONEYEXCEPTION("No key to remove object"); #endif @@ -100,59 +100,59 @@ public: m_stack.push(new MyMoneyMapRemove(this, key)); } - MyMoneyMap& operator= (const QMap& m) + MyMoneyMap& operator= (const TQMap& m) { if(m_stack.count() != 0) { throw new MYMONEYEXCEPTION("Cannot assign whole container during transaction"); } - QMap::operator=(m); + TQMap::operator=(m); return *this; } - inline QValueList values(void) const + inline TQValueList values(void) const { - return QMap::values(); + return TQMap::values(); } - inline QValueList keys(void) const + inline TQValueList keys(void) const { - return QMap::keys(); + return TQMap::keys(); } const T& operator[] ( const Key& k ) const - { QT_CHECK_INVALID_MAP_ELEMENT; return QMap::operator[](k); } + { TQT_CHECK_INVALID_MAP_ELEMENT; return TQMap::operator[](k); } - inline Q_TYPENAME QMap::const_iterator find(const Key& k) const + inline TQ_TYPENAME TQMap::const_iterator tqfind(const Key& k) const { - return QMap::find(k); + return TQMap::tqfind(k); } - inline Q_TYPENAME QMap::const_iterator begin(void) const + inline TQ_TYPENAME TQMap::const_iterator begin(void) const { - return QMap::begin(); + return TQMap::begin(); } - inline Q_TYPENAME QMap::const_iterator end(void) const + inline TQ_TYPENAME TQMap::const_iterator end(void) const { - return QMap::end(); + return TQMap::end(); } - inline bool contains(const Key& k) const + inline bool tqcontains(const Key& k) const { - return find(k) != end(); + return tqfind(k) != end(); } - inline void map(QMap& that) const + inline void map(TQMap& that) const { - //QMap* ptr = dynamic_cast* >(this); + //TQMap* ptr = dynamic_cast* >(this); //that = *ptr; - that = *(dynamic_cast* >(const_cast* >(this))); + that = *(dynamic_cast* >(const_cast* >(this))); } inline size_t count(void) const { - return QMap::count(); + return TQMap::count(); } #if MY_OWN_DEBUG @@ -173,10 +173,10 @@ private: class MyMoneyMapAction { public: - MyMoneyMapAction(QMap* container) : + MyMoneyMapAction(TQMap* container) : m_container(container) {} - MyMoneyMapAction(QMap* container, const Key& key, const T& obj) : + MyMoneyMapAction(TQMap* container, const Key& key, const T& obj) : m_container(container), m_obj(obj), m_key(key) {} @@ -185,7 +185,7 @@ private: virtual void undo(void) = 0; protected: - QMap* m_container; + TQMap* m_container; T m_obj; Key m_key; }; @@ -193,7 +193,7 @@ private: class MyMoneyMapStart : public MyMoneyMapAction { public: - MyMoneyMapStart(QMap* container, unsigned long* id) : + MyMoneyMapStart(TQMap* container, unsigned long* id) : MyMoneyMapAction(container), m_idPtr(id) { @@ -215,7 +215,7 @@ private: class MyMoneyMapInsert : public MyMoneyMapAction { public: - MyMoneyMapInsert(QMap* container, const Key& key, const T& obj) : + MyMoneyMapInsert(TQMap* container, const Key& key, const T& obj) : MyMoneyMapAction(container, key, obj) { (*container)[key] = obj; @@ -233,7 +233,7 @@ private: class MyMoneyMapRemove : public MyMoneyMapAction { public: - MyMoneyMapRemove(QMap* container, const Key& key) : + MyMoneyMapRemove(TQMap* container, const Key& key) : MyMoneyMapAction(container, key, (*container)[key]) { container->remove(key); @@ -249,7 +249,7 @@ private: class MyMoneyMapModify : public MyMoneyMapAction { public: - MyMoneyMapModify(QMap* container, const Key& key, const T& obj) : + MyMoneyMapModify(TQMap* container, const Key& key, const T& obj) : MyMoneyMapAction(container, key, (*container)[key]) { (*container)[key] = obj; @@ -263,7 +263,7 @@ private: }; protected: - QPtrStack m_stack; + TQPtrStack m_stack; }; #if MY_OWN_DEBUG @@ -271,15 +271,15 @@ protected: #include main() { - MyMoneyMap container; - MyMoneyMap ct; + MyMoneyMap container; + MyMoneyMap ct; MyMoneyAccount acc; acc.setName("Test"); // this should not be possible // container["a"] = acc; - QValueList list; + TQValueList list; list = container.values(); MyMoneyAccount b; @@ -298,7 +298,7 @@ main() container.dump(); container.startTransaction(); - container.remove(QString("001")); + container.remove(TQString("001")); container.dump(); container.rollbackTransaction(); container.dump(); @@ -306,8 +306,8 @@ main() b = container["001"]; printf("b.name() = %s\n", b.name().data()); - QMap::ConstIterator it; - it = container.find("001"); + TQMap::ConstIterator it; + it = container.tqfind("001"); it = container.begin(); } catch(MyMoneyException *e) { @@ -315,7 +315,7 @@ main() delete e; } - QMap map; + TQMap map; map["005"] = b; container = map; diff --git a/kmymoney2/mymoney/storage/mymoneymaptest.cpp b/kmymoney2/mymoney/storage/mymoneymaptest.cpp index 5104fad..123fcc8 100644 --- a/kmymoney2/mymoney/storage/mymoneymaptest.cpp +++ b/kmymoney2/mymoney/storage/mymoneymaptest.cpp @@ -24,7 +24,7 @@ MyMoneyMapTest::MyMoneyMapTest() void MyMoneyMapTest::setUp() { - m = new MyMoneyMap; + m = new MyMoneyMap; } void MyMoneyMapTest::tearDown() diff --git a/kmymoney2/mymoney/storage/mymoneymaptest.h b/kmymoney2/mymoney/storage/mymoneymaptest.h index c089a3f..af2389c 100644 --- a/kmymoney2/mymoney/storage/mymoneymaptest.h +++ b/kmymoney2/mymoney/storage/mymoneymaptest.h @@ -34,7 +34,7 @@ class MyMoneyMapTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); protected: - MyMoneyMap *m; + MyMoneyMap *m; public: MyMoneyMapTest(); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp index 7341ec1..5c9abed 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp @@ -44,7 +44,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() m_nextBudgetID = 0; m_user = MyMoneyPayee(); m_dirty = false; - m_creationDate = QDate::currentDate(); + m_creationDate = TQDate::tqcurrentDate(); // setup standard accounts MyMoneyAccount acc_l; @@ -70,14 +70,14 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() MyMoneyAccount acc_q; acc_q.setAccountType(MyMoneyAccount::Equity); acc_q.setName("Equity"); - MyMoneyAccount equity(STD_ACC_EQUITY, acc_q); + MyMoneyAccount equity(STD_ACC_ETQUITY, acc_q); - QMap map; + TQMap map; map[STD_ACC_ASSET] = asset; map[STD_ACC_LIABILITY] = liability; map[STD_ACC_INCOME] = income; map[STD_ACC_EXPENSE] = expense; - map[STD_ACC_EQUITY] = equity; + map[STD_ACC_ETQUITY] = equity; // load account list with inital accounts m_accountList = map; @@ -89,7 +89,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr() m_balanceCache[STD_ACC_ASSET] = balance; m_balanceCache[STD_ACC_EXPENSE] = balance; m_balanceCache[STD_ACC_INCOME] = balance; - m_balanceCache[STD_ACC_EQUITY] = balance; + m_balanceCache[STD_ACC_ETQUITY] = balance; // initialize for file fixes (see kmymoneyview.cpp) m_currentFixVersion = 2; @@ -115,16 +115,16 @@ KSharedPtr MyMoneySeqAccessMgr::connectToDatabase return 0; } -bool MyMoneySeqAccessMgr::isStandardAccount(const QString& id) const +bool MyMoneySeqAccessMgr::isStandardAccount(const TQString& id) const { return id == STD_ACC_LIABILITY || id == STD_ACC_ASSET || id == STD_ACC_EXPENSE || id == STD_ACC_INCOME - || id == STD_ACC_EQUITY; + || id == STD_ACC_ETQUITY; } -void MyMoneySeqAccessMgr::setAccountName(const QString& id, const QString& name) +void MyMoneySeqAccessMgr::setAccountName(const TQString& id, const TQString& name) { if(!isStandardAccount(id)) throw new MYMONEYEXCEPTION("Only standard accounts can be modified using setAccountName()"); @@ -134,20 +134,20 @@ void MyMoneySeqAccessMgr::setAccountName(const QString& id, const QString& name) m_accountList.modify(acc.id(), acc); } -const MyMoneyAccount MyMoneySeqAccessMgr::account(const QString& id) const +const MyMoneyAccount MyMoneySeqAccessMgr::account(const TQString& id) const { // locate the account and if present, return it's data - if(m_accountList.find(id) != m_accountList.end()) + if(m_accountList.tqfind(id) != m_accountList.end()) return m_accountList[id]; // throw an exception, if it does not exist - QString msg = "Unknown account id '" + id + "'"; + TQString msg = "Unknown account id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -void MyMoneySeqAccessMgr::accountList(QValueList& list) const +void MyMoneySeqAccessMgr::accountList(TQValueList& list) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = m_accountList.begin(); it != m_accountList.end(); ++it) { if(!isStandardAccount((*it).id())) { list.append(*it); @@ -172,22 +172,22 @@ void MyMoneySeqAccessMgr::addPayee(MyMoneyPayee& payee) payee = newPayee; } -const MyMoneyPayee MyMoneySeqAccessMgr::payee(const QString& id) const +const MyMoneyPayee MyMoneySeqAccessMgr::payee(const TQString& id) const { - QMap::ConstIterator it; - it = m_payeeList.find(id); + TQMap::ConstIterator it; + it = m_payeeList.tqfind(id); if(it == m_payeeList.end()) throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'"); return *it; } -const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const QString& payee) const +const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const TQString& payee) const { if(payee.isEmpty()) return MyMoneyPayee::null; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_p; for(it_p = m_payeeList.begin(); it_p != m_payeeList.end(); ++it_p) { if((*it_p).name() == payee) { @@ -200,11 +200,11 @@ const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const QString& payee) const void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_payeeList.find(payee.id()); + it = m_payeeList.tqfind(payee.id()); if(it == m_payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_payeeList.modify((*it).id(), payee); @@ -212,27 +212,27 @@ void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee) void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee) { - QMap::ConstIterator it_t; - QMap::ConstIterator it_s; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_t; + TQMap::ConstIterator it_s; + TQMap::ConstIterator it_p; - it_p = m_payeeList.find(payee.id()); + it_p = m_payeeList.tqfind(payee.id()); if(it_p == m_payeeList.end()) { - QString msg = "Unknown payee '" + payee.id() + "'"; + TQString msg = "Unknown payee '" + payee.id() + "'"; throw new MYMONEYEXCEPTION(msg); } // scan all transactions to check if the payee is still referenced for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { if((*it_t).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("transaction")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction")); } } // check referential integrity in schedules for(it_s = m_scheduleList.begin(); it_s != m_scheduleList.end(); ++it_s) { if((*it_s).hasReferenceTo(payee.id())) { - throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("schedule")); + throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule")); } } @@ -242,27 +242,27 @@ void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee) m_payeeList.remove((*it_p).id()); } -const QValueList MyMoneySeqAccessMgr::payeeList(void) const +const TQValueList MyMoneySeqAccessMgr::payeeList(void) const { return m_payeeList.values(); } -void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) +void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) { - QMap::ConstIterator theParent; - QMap::ConstIterator theChild; + TQMap::ConstIterator theParent; + TQMap::ConstIterator theChild; - theParent = m_accountList.find(parent.id()); + theParent = m_accountList.tqfind(tqparent.id()); if(theParent == m_accountList.end()) { - QString msg = "Unknown parent account '"; - msg += parent.id() + "'"; + TQString msg = "Unknown tqparent account '"; + msg += tqparent.id() + "'"; throw new MYMONEYEXCEPTION(msg); } - theChild = m_accountList.find(account.id()); + theChild = m_accountList.tqfind(account.id()); if(theChild == m_accountList.end()) { - QString msg = "Unknown child account '"; + TQString msg = "Unknown child account '"; msg += account.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -270,10 +270,10 @@ void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& acc MyMoneyAccount acc = *theParent; acc.addAccountId(account.id()); m_accountList.modify(acc.id(), acc); - parent = acc; + tqparent = acc; acc = *theChild; - acc.setParentAccountId(parent.id()); + acc.setParentAccountId(tqparent.id()); m_accountList.modify(acc.id(), acc); account = acc; @@ -291,7 +291,7 @@ void MyMoneySeqAccessMgr::addInstitution(MyMoneyInstitution& institution) institution = newInstitution; } -unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const +unsigned int MyMoneySeqAccessMgr::transactionCount(const TQString& account) const { unsigned int cnt = 0; @@ -299,8 +299,8 @@ unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const cnt = m_transactionList.count(); } else { - QMap::ConstIterator it_t; - QValueList::ConstIterator it_s; + TQMap::ConstIterator it_t; + TQValueList::ConstIterator it_s; // scan all transactions for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { @@ -326,11 +326,11 @@ unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const return cnt; } -const QMap MyMoneySeqAccessMgr::transactionCountMap(void) const +const TQMap MyMoneySeqAccessMgr::transactionCountMap(void) const { - QMap map; - QMap::ConstIterator it_t; - QValueList::ConstIterator it_s; + TQMap map; + TQMap::ConstIterator it_t; + TQValueList::ConstIterator it_s; // scan all transactions for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { @@ -352,49 +352,49 @@ unsigned int MyMoneySeqAccessMgr::accountCount(void) const return m_accountList.count(); } -QString MyMoneySeqAccessMgr::nextPayeeID(void) +TQString MyMoneySeqAccessMgr::nextPayeeID(void) { - QString id; + TQString id; id.setNum(++m_nextPayeeID); id = "P" + id.rightJustify(PAYEE_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextInstitutionID(void) +TQString MyMoneySeqAccessMgr::nextInstitutionID(void) { - QString id; + TQString id; id.setNum(++m_nextInstitutionID); id = "I" + id.rightJustify(INSTITUTION_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextAccountID(void) +TQString MyMoneySeqAccessMgr::nextAccountID(void) { - QString id; + TQString id; id.setNum(++m_nextAccountID); id = "A" + id.rightJustify(ACCOUNT_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextTransactionID(void) +TQString MyMoneySeqAccessMgr::nextTransactionID(void) { - QString id; + TQString id; id.setNum(++m_nextTransactionID); id = "T" + id.rightJustify(TRANSACTION_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextScheduleID(void) +TQString MyMoneySeqAccessMgr::nextScheduleID(void) { - QString id; + TQString id; id.setNum(++m_nextScheduleID); id = "SCH" + id.rightJustify(SCHEDULE_ID_SIZE, '0'); return id; } -QString MyMoneySeqAccessMgr::nextSecurityID(void) +TQString MyMoneySeqAccessMgr::nextSecurityID(void) { - QString id; + TQString id; id.setNum(++m_nextSecurityID); id = "E" + id.rightJustify(SECURITY_ID_SIZE, '0'); return id; @@ -416,7 +416,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const throw new MYMONEYEXCEPTION("invalid post date"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -426,7 +426,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const } MyMoneyTransaction newTransaction(nextTransactionID(), transaction); - QString key = newTransaction.uniqueSortKey(); + TQString key = newTransaction.uniqueSortKey(); m_transactionList.insert(key, newTransaction); m_transactionKeys.insert(newTransaction.id(), key); @@ -439,7 +439,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const acc.adjustBalance(*it_s); if(!skipAccountUpdate) { acc.touch(); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); } m_accountList.modify(acc.id(), acc); } @@ -448,12 +448,12 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const void MyMoneySeqAccessMgr::touch(void) { m_dirty = true; - m_lastModificationDate = QDate::currentDate(); + m_lastModificationDate = TQDate::tqcurrentDate(); } -bool MyMoneySeqAccessMgr::hasActiveSplits(const QString& id) const +bool MyMoneySeqAccessMgr::hasActiveSplits(const TQString& id) const { - QMap::ConstIterator it; + TQMap::ConstIterator it; for(it = m_transactionList.begin(); it != m_transactionList.end(); ++it) { if((*it).accountReferenced(id)) { @@ -463,39 +463,39 @@ bool MyMoneySeqAccessMgr::hasActiveSplits(const QString& id) const return false; } -const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const QString& id) const +const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const TQString& id) const { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; - pos = m_institutionList.find(id); + pos = m_institutionList.tqfind(id); if(pos != m_institutionList.end()) return *pos; throw new MYMONEYEXCEPTION("unknown institution"); } -const QValueList MyMoneySeqAccessMgr::institutionList(void) const +const TQValueList MyMoneySeqAccessMgr::institutionList(void) const { return m_institutionList.values(); } void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck) { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the account in the file global pool - pos = m_accountList.find(account.id()); + pos = m_accountList.tqfind(account.id()); if(pos != m_accountList.end()) { // check if the new info is based on the old one. // this is the case, when the file and the id // as well as the type are equal. - if((((*pos).parentAccountId() == account.parentAccountId()) + if((((*pos).tqparentAccountId() == account.tqparentAccountId()) && ((*pos).accountType() == account.accountType())) || (skipCheck == true)) { // make sure that all the referenced objects exist if(!account.institutionId().isEmpty()) institution(account.institutionId()); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) { this->account(*it_a); } @@ -503,8 +503,8 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo // update information in account list m_accountList.modify(account.id(), account); - // invalidate cached balance - invalidateBalanceCache(account.id()); + // tqinvalidate cached balance + tqinvalidateBalanceCache(account.id()); } else throw new MYMONEYEXCEPTION("Invalid information for update"); @@ -515,10 +515,10 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo void MyMoneySeqAccessMgr::modifyInstitution(const MyMoneyInstitution& institution) { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the institution in the file global pool - pos = m_institutionList.find(institution.id()); + pos = m_institutionList.tqfind(institution.id()); if(pos != m_institutionList.end()) { m_institutionList.modify(institution.id(), institution); @@ -542,7 +542,7 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio throw new MYMONEYEXCEPTION("invalid transaction to be modified"); // now check the splits - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following lines will throw an exception if the // account or payee do not exist @@ -553,16 +553,16 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio // new data seems to be ok. find old version of transaction // in our pool. Throw exception if unknown. - if(!m_transactionKeys.contains(transaction.id())) + if(!m_transactionKeys.tqcontains(transaction.id())) throw new MYMONEYEXCEPTION("invalid transaction id"); - QString oldKey = m_transactionKeys[transaction.id()]; - if(!m_transactionList.contains(oldKey)) + TQString oldKey = m_transactionKeys[transaction.id()]; + if(!m_transactionList.tqcontains(oldKey)) throw new MYMONEYEXCEPTION("invalid transaction key"); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; - it_t = m_transactionList.find(oldKey); + it_t = m_transactionList.tqfind(oldKey); if(it_t == m_transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); @@ -571,14 +571,14 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio MyMoneyAccount acc = m_accountList[(*it_s).accountId()]; acc.adjustBalance(*it_s, true); // reverse the adjust operation (reverse = true) acc.touch(); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); m_accountList.modify(acc.id(), acc); } for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { MyMoneyAccount acc = m_accountList[(*it_s).accountId()]; acc.adjustBalance(*it_s); acc.touch(); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); m_accountList.modify(acc.id(), acc); } @@ -586,54 +586,54 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio m_transactionList.remove(oldKey); // add new transaction to lists - QString newKey = transaction.uniqueSortKey(); + TQString newKey = transaction.uniqueSortKey(); m_transactionList.insert(newKey, transaction); m_transactionKeys.modify(transaction.id(), newKey); } -void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) +void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) { - reparentAccount(account, parent, true); + reparentAccount(account, tqparent, true); } -void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent, const bool /* sendNotification */) +void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent, const bool /* sendNotification */) { - QMap::ConstIterator oldParent; - QMap::ConstIterator newParent; - QMap::ConstIterator childAccount; + TQMap::ConstIterator oldParent; + TQMap::ConstIterator newParent; + TQMap::ConstIterator childAccount; // verify that accounts exist. If one does not, // an exception is thrown MyMoneySeqAccessMgr::account(account.id()); - MyMoneySeqAccessMgr::account(parent.id()); - if(!account.parentAccountId().isEmpty()) { - MyMoneySeqAccessMgr::account(account.parentAccountId()); - oldParent = m_accountList.find(account.parentAccountId()); + MyMoneySeqAccessMgr::account(tqparent.id()); + if(!account.tqparentAccountId().isEmpty()) { + MyMoneySeqAccessMgr::account(account.tqparentAccountId()); + oldParent = m_accountList.tqfind(account.tqparentAccountId()); } - if(account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment) + if(account.accountType() == MyMoneyAccount::Stock && tqparent.accountType() != MyMoneyAccount::Investment) throw new MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); - newParent = m_accountList.find(parent.id()); - childAccount = m_accountList.find(account.id()); + newParent = m_accountList.tqfind(tqparent.id()); + childAccount = m_accountList.tqfind(account.id()); MyMoneyAccount acc; - if(!account.parentAccountId().isEmpty()) { + if(!account.tqparentAccountId().isEmpty()) { acc = (*oldParent); acc.removeAccountId(account.id()); m_accountList.modify(acc.id(), acc); } - parent = (*newParent); - parent.addAccountId(account.id()); - m_accountList.modify(parent.id(), parent); + tqparent = (*newParent); + tqparent.addAccountId(account.id()); + m_accountList.modify(tqparent.id(), tqparent); account = (*childAccount); - account.setParentAccountId(parent.id()); + account.setParentAccountId(tqparent.id()); m_accountList.modify(account.id(), account); #if 0 - // make sure the type is the same as the new parent. This does not work for stock and investment + // make sure the type is the same as the new tqparent. This does not work for stock and investment if(account.accountType() != MyMoneyAccount::Stock && account.accountType() != MyMoneyAccount::Investment) (*childAccount).setAccountType((*newParent).accountType()); #endif @@ -645,18 +645,18 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio if(transaction.id().isEmpty()) throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; - it_k = m_transactionKeys.find(transaction.id()); + it_k = m_transactionKeys.tqfind(transaction.id()); if(it_k == m_transactionKeys.end()) throw new MYMONEYEXCEPTION("invalid transaction to be deleted"); - it_t = m_transactionList.find(*it_k); + it_t = m_transactionList.tqfind(*it_k); if(it_t == m_transactionList.end()) throw new MYMONEYEXCEPTION("invalid transaction key"); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; // scan the splits and collect all accounts that need // to be updated after the removal of this transaction @@ -665,7 +665,7 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio acc.adjustBalance(*it_s, true); // reverse = true acc.touch(); m_accountList.modify(acc.id(), acc); - invalidateBalanceCache(acc.id()); + tqinvalidateBalanceCache(acc.id()); } // FIXME: check if any split is frozen and throw exception @@ -677,12 +677,12 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) { - MyMoneyAccount parent; + MyMoneyAccount tqparent; - // check that the account and it's parent exist + // check that the account and it's tqparent exist // this will throw an exception if the id is unknown MyMoneySeqAccessMgr::account(account.id()); - parent = MyMoneySeqAccessMgr::account(account.parentAccountId()); + tqparent = MyMoneySeqAccessMgr::account(account.tqparentAccountId()); // check that it's not one of the standard account groups if(isStandardAccount(account.id())) @@ -692,10 +692,10 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) throw new MYMONEYEXCEPTION("Unable to remove account with active splits"); } - // re-parent all sub-ordinate accounts to the parent of the account + // re-tqparent all sub-ordinate accounts to the tqparent of the account // to be deleted. First round check that all accounts exist, second - // round do the re-parenting. - QStringList::ConstIterator it; + // round do the re-tqparenting. + TQStringList::ConstIterator it; for(it = account.accountList().begin(); it != account.accountList().end(); ++it) { MyMoneySeqAccessMgr::account(*it); } @@ -703,18 +703,18 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) // if one of the accounts did not exist, an exception had been // thrown and we would not make it until here. - QMap::ConstIterator it_a; - QMap::ConstIterator it_p; + TQMap::ConstIterator it_a; + TQMap::ConstIterator it_p; // locate the account in the file global pool - it_a = m_accountList.find(account.id()); + it_a = m_accountList.tqfind(account.id()); if(it_a == m_accountList.end()) throw new MYMONEYEXCEPTION("Internal error: account not found in list"); - it_p = m_accountList.find(parent.id()); + it_p = m_accountList.tqfind(tqparent.id()); if(it_p == m_accountList.end()) - throw new MYMONEYEXCEPTION("Internal error: parent account not found in list"); + throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list"); if(!account.institutionId().isEmpty()) throw new MYMONEYEXCEPTION("Cannot remove account still attached to an institution"); @@ -729,34 +729,34 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account) if((*it_a).id() == account.id() && (*it_a).accountType() == account.accountType()) { - // second round over sub-ordinate accounts: do re-parenting + // second round over sub-ordinate accounts: do re-tqparenting // but only if the list contains at least one entry // FIXME: move this logic to MyMoneyFile if((*it_a).accountList().count() > 0) { while((*it_a).accountList().count() > 0) { it = (*it_a).accountList().begin(); MyMoneyAccount acc(MyMoneySeqAccessMgr::account(*it)); - reparentAccount(acc, parent, false); + reparentAccount(acc, tqparent, false); } } - // remove account from parent's list - parent.removeAccountId(account.id()); - m_accountList.modify(parent.id(), parent); + // remove account from tqparent's list + tqparent.removeAccountId(account.id()); + m_accountList.modify(tqparent.id(), tqparent); // remove account from the global account pool m_accountList.remove(account.id()); // remove from balance list m_balanceCache.remove(account.id()); - invalidateBalanceCache(parent.id()); + tqinvalidateBalanceCache(tqparent.id()); } } void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institution) { - QMap::ConstIterator it_i; + TQMap::ConstIterator it_i; - it_i = m_institutionList.find(institution.id()); + it_i = m_institutionList.tqfind(institution.id()); if(it_i != m_institutionList.end()) { m_institutionList.remove(institution.id()); @@ -764,11 +764,11 @@ void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institutio throw new MYMONEYEXCEPTION("invalid institution"); } -void MyMoneySeqAccessMgr::transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const +void MyMoneySeqAccessMgr::transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const { list.clear(); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { // This code is used now. It adds the transaction to the list for @@ -789,55 +789,55 @@ void MyMoneySeqAccessMgr::transactionList(QValueList& list, } } -void MyMoneySeqAccessMgr::transactionList(QValueList< QPair >& list, MyMoneyTransactionFilter& filter) const +void MyMoneySeqAccessMgr::transactionList(TQValueList< TQPair >& list, MyMoneyTransactionFilter& filter) const { list.clear(); - QMap::ConstIterator it_t; + TQMap::ConstIterator it_t; for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { if(filter.match(*it_t)) { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = filter.matchingSplits().begin(); it_s != filter.matchingSplits().end(); ++it_s) { - list.append(qMakePair(*it_t, *it_s)); + list.append(tqMakePair(*it_t, *it_s)); } } } } -const QValueList MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const +const TQValueList MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const { - QValueList list; + TQValueList list; transactionList(list, filter); return list; } -const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& id) const +const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& id) const { // get the full key of this transaction, throw exception // if it's invalid (unknown) - if(!m_transactionKeys.contains(id)) { - QString msg = QString("Invalid transaction id '%1'").arg(id); + if(!m_transactionKeys.tqcontains(id)) { + TQString msg = TQString("Invalid transaction id '%1'").tqarg(id); throw new MYMONEYEXCEPTION(msg); } // check if this key is in the list, throw exception if not - QString key = m_transactionKeys[id]; - if(!m_transactionList.contains(key)) { - QString msg = QString("Invalid transaction key '%1'").arg(key); + TQString key = m_transactionKeys[id]; + if(!m_transactionList.tqcontains(key)) { + TQString msg = TQString("Invalid transaction key '%1'").tqarg(key); throw new MYMONEYEXCEPTION(msg); } return m_transactionList[key]; } -const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account, const int idx) const +const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& account, const int idx) const { /* removed with MyMoneyAccount::Transaction - QMap::ConstIterator acc; + TQMap::ConstIterator acc; // find account object in list, throw exception if unknown - acc = m_accountList.find(account); + acc = m_accountList.tqfind(account); if(acc == m_accountList.end()) throw new MYMONEYEXCEPTION("unknown account id"); @@ -849,7 +849,7 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account */ // new implementation if the above code does not work anymore - QValueList list; + TQValueList list; MyMoneyAccount acc = m_accountList[account]; MyMoneyTransactionFilter filter; @@ -866,36 +866,36 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account return transaction(list[idx].id()); } -const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneySeqAccessMgr::balance(const TQString& id, const TQDate& date) const { MyMoneyMoney result(0); MyMoneyAccount acc; - // if (date != QDate()) qDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1()); + // if (date != TQDate()) qDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1()); if(!date.isValid() && account(id).accountType() != MyMoneyAccount::Stock) { - if(m_accountList.find(id) != m_accountList.end()) + if(m_accountList.tqfind(id) != m_accountList.end()) return m_accountList[id].balance(); return MyMoneyMoney(0); } if(m_balanceCache[id].valid == false || date != m_balanceCacheDate) { - QMap balances; - QMap::ConstIterator it_b; + TQMap balances; + TQMap::ConstIterator it_b; if (date != m_balanceCacheDate) { m_balanceCache.clear(); m_balanceCacheDate = date; } - QValueList list; - QValueList::ConstIterator it_t; - QValueList::ConstIterator it_s; + TQValueList list; + TQValueList::ConstIterator it_t; + TQValueList::ConstIterator it_s; MyMoneyTransactionFilter filter; - filter.setDateFilter(QDate(), date); + filter.setDateFilter(TQDate(), date); filter.setReportAllSplits(false); transactionList(list, filter); for(it_t = list.begin(); it_t != list.end(); ++it_t) { for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s){ - const QString& aid = (*it_s).accountId(); + const TQString& aid = (*it_s).accountId(); if((*it_s).action() == MyMoneySplit::ActionSplitShares) { balances[aid] = balances[aid] * (*it_s).shares(); } else { @@ -911,7 +911,7 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& } // fill all accounts w/o transactions to zero - QMap::ConstIterator it_a; + TQMap::ConstIterator it_a; for(it_a = m_accountList.begin(); it_a != m_accountList.end(); ++it_a) { if(m_balanceCache[(*it_a).id()].valid == false) { MyMoneyBalanceCacheItem balance(MyMoneyMoney(0,1)); @@ -928,10 +928,10 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& return result; } -const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const TQString& id, const TQDate& date) const { - QStringList accounts; - QStringList::ConstIterator it_a; + TQStringList accounts; + TQStringList::ConstIterator it_a; MyMoneyMoney result(balance(id, date)); @@ -952,10 +952,10 @@ const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QD * the functionality, we can turn it back on. BTW: the stuff is untested ;-) */ /* -const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QString& newAccount) +const unsigned int MyMoneyFile::moveSplits(const TQString& oldAccount, const TQString& newAccount) { - QMap::Iterator it_t; - QValueList::ConstIterator it_s; + TQMap::Iterator it_t; + TQValueList::ConstIterator it_s; unsigned int cnt = 0; // scan all transactions @@ -974,13 +974,13 @@ const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QStr if(cnt != 0) { // now update all the accounts that were referenced - QMap::Iterator acc; - acc = m_accountList.find(oldAccount); + TQMap::Iterator acc; + acc = m_accountList.tqfind(oldAccount); if(acc != m_accountList.end()) { (*acc).touch(); refreshAccountTransactionList(acc); } - acc = m_accountList.find(newAccount); + acc = m_accountList.tqfind(newAccount); if(acc != m_accountList.end()) { (*acc).touch(); refreshAccountTransactionList(acc); @@ -993,13 +993,13 @@ const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QStr } */ -void MyMoneySeqAccessMgr::invalidateBalanceCache(const QString& id) +void MyMoneySeqAccessMgr::tqinvalidateBalanceCache(const TQString& id) { if(!id.isEmpty()) { try { m_balanceCache[id].valid = false; if(!isStandardAccount(id)) { - invalidateBalanceCache(account(id).parentAccountId()); + tqinvalidateBalanceCache(account(id).tqparentAccountId()); } } catch (MyMoneyException *e) { delete e; @@ -1007,33 +1007,33 @@ void MyMoneySeqAccessMgr::invalidateBalanceCache(const QString& id) } } -void MyMoneySeqAccessMgr::loadAccounts(const QMap& map) +void MyMoneySeqAccessMgr::loadAccounts(const TQMap& map) { m_accountList = map; // scan the map to identify the last used id - QMap::const_iterator it_a; - QString lastId(""); + TQMap::const_iterator it_a; + TQString lastId(""); for(it_a = map.begin(); it_a != map.end(); ++it_a) { if(!isStandardAccount((*it_a).id()) && ((*it_a).id() > lastId)) lastId = (*it_a).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextAccountID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadTransactions(const QMap& map) +void MyMoneySeqAccessMgr::loadTransactions(const TQMap& map) { m_transactionList = map; // now fill the key map and // identify the last used id - QString lastId(""); - QMap keys; - QMap::ConstIterator it_t; + TQString lastId(""); + TQMap keys; + TQMap::ConstIterator it_t; for(it_t = map.begin(); it_t != map.end(); ++it_t) { keys[(*it_t).id()] = it_t.key(); if((*it_t).id() > lastId) @@ -1042,37 +1042,37 @@ void MyMoneySeqAccessMgr::loadTransactions(const QMap& map) +void MyMoneySeqAccessMgr::loadInstitutions(const TQMap& map) { m_institutionList = map; // scan the map to identify the last used id - QMap::const_iterator it_i; - QString lastId(""); + TQMap::const_iterator it_i; + TQString lastId(""); for(it_i = map.begin(); it_i != map.end(); ++it_i) { if((*it_i).id() > lastId) lastId = (*it_i).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextInstitutionID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadPayees(const QMap& map) +void MyMoneySeqAccessMgr::loadPayees(const TQMap& map) { m_payeeList = map; // scan the map to identify the last used id - QMap::const_iterator it_p; - QString lastId(""); + TQMap::const_iterator it_p; + TQString lastId(""); for(it_p = map.begin(); it_p != map.end(); ++it_p) { if((*it_p).id().length() <= PAYEE_ID_SIZE+1) { if((*it_p).id() > lastId) @@ -1081,31 +1081,31 @@ void MyMoneySeqAccessMgr::loadPayees(const QMap& map) } } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextPayeeID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadSecurities(const QMap& map) +void MyMoneySeqAccessMgr::loadSecurities(const TQMap& map) { m_securitiesList = map; // scan the map to identify the last used id - QMap::const_iterator it_s; - QString lastId(""); + TQMap::const_iterator it_s; + TQString lastId(""); for(it_s = map.begin(); it_s != map.end(); ++it_s) { if((*it_s).id() > lastId) lastId = (*it_s).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextSecurityID = atol(lastId.mid(pos)); } } -void MyMoneySeqAccessMgr::loadCurrencies(const QMap& map) +void MyMoneySeqAccessMgr::loadCurrencies(const TQMap& map) { m_currencyList = map; } @@ -1150,29 +1150,29 @@ void MyMoneySeqAccessMgr::loadBudgetId(const unsigned long id) m_nextBudgetID = id; } -const QString MyMoneySeqAccessMgr::value(const QString& key) const +const TQString MyMoneySeqAccessMgr::value(const TQString& key) const { return MyMoneyKeyValueContainer::value(key); } -void MyMoneySeqAccessMgr::setValue(const QString& key, const QString& val) +void MyMoneySeqAccessMgr::setValue(const TQString& key, const TQString& val) { MyMoneyKeyValueContainer::setValue(key, val); touch(); } -void MyMoneySeqAccessMgr::deletePair(const QString& key) +void MyMoneySeqAccessMgr::deletePair(const TQString& key) { MyMoneyKeyValueContainer::deletePair(key); touch(); } -const QMap MyMoneySeqAccessMgr::pairs(void) const +const TQMap MyMoneySeqAccessMgr::pairs(void) const { return MyMoneyKeyValueContainer::pairs(); } -void MyMoneySeqAccessMgr::setPairs(const QMap& list) +void MyMoneySeqAccessMgr::setPairs(const TQMap& list) { MyMoneyKeyValueContainer::setPairs(list); touch(); @@ -1194,11 +1194,11 @@ void MyMoneySeqAccessMgr::addSchedule(MyMoneySchedule& sched) void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_scheduleList.find(sched.id()); + it = m_scheduleList.tqfind(sched.id()); if(it == m_scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1207,11 +1207,11 @@ void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched) void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_scheduleList.find(sched.id()); + it = m_scheduleList.tqfind(sched.id()); if(it == m_scheduleList.end()) { - QString msg = "Unknown schedule '" + sched.id() + "'"; + TQString msg = "Unknown schedule '" + sched.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1219,31 +1219,31 @@ void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched) m_scheduleList.remove(sched.id()); } -const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const QString& id) const +const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const TQString& id) const { - QMap::ConstIterator pos; + TQMap::ConstIterator pos; // locate the schedule and if present, return it's data - pos = m_scheduleList.find(id); + pos = m_scheduleList.tqfind(id); if(pos != m_scheduleList.end()) return (*pos); // throw an exception, if it does not exist - QString msg = "Unknown schedule id '" + id + "'"; + TQString msg = "Unknown schedule id '" + id + "'"; throw new MYMONEYEXCEPTION(msg); } -const QValueList MyMoneySeqAccessMgr::scheduleList( - const QString& accountId, +const TQValueList MyMoneySeqAccessMgr::scheduleList( + const TQString& accountId, const MyMoneySchedule::typeE type, const MyMoneySchedule::occurenceE occurence, const MyMoneySchedule::paymentTypeE paymentType, - const QDate& startDate, - const QDate& endDate, + const TQDate& startDate, + const TQDate& endDate, const bool overdue) const { - QMap::ConstIterator pos; - QValueList list; + TQMap::ConstIterator pos; + TQValueList list; // qDebug("scheduleList()"); @@ -1270,8 +1270,8 @@ const QValueList MyMoneySeqAccessMgr::scheduleList( if(!accountId.isEmpty()) { MyMoneyTransaction t = (*pos).transaction(); - QValueList::ConstIterator it; - QValueList splits; + TQValueList::ConstIterator it; + TQValueList splits; splits = t.splits(); for(it = splits.begin(); it != splits.end(); ++it) { if((*it).accountId() == accountId) @@ -1311,19 +1311,19 @@ const QValueList MyMoneySeqAccessMgr::scheduleList( return list; } -void MyMoneySeqAccessMgr::loadSchedules(const QMap& map) +void MyMoneySeqAccessMgr::loadSchedules(const TQMap& map) { m_scheduleList = map; // scan the map to identify the last used id - QMap::const_iterator it_s; - QString lastId(""); + TQMap::const_iterator it_s; + TQString lastId(""); for(it_s = map.begin(); it_s != map.end(); ++it_s) { if((*it_s).id() > lastId) lastId = (*it_s).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextScheduleID = atol(lastId.mid(pos)); } @@ -1334,16 +1334,16 @@ void MyMoneySeqAccessMgr::loadScheduleId(const unsigned long id) m_nextScheduleID = id; } -const QValueList MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes, +const TQValueList MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate date, - const QStringList& accounts) const + TQDate date, + const TQStringList& accounts) const { // qDebug("scheduleListEx"); - QMap::ConstIterator pos; - QValueList list; + TQMap::ConstIterator pos; + TQValueList list; if (!date.isValid()) return list; @@ -1370,7 +1370,7 @@ const QValueList MyMoneySeqAccessMgr::scheduleListEx(int schedu if (accounts.count() > 0) { - if (accounts.contains((*pos).account().id())) + if (accounts.tqcontains((*pos).account().id())) continue; } @@ -1393,12 +1393,12 @@ void MyMoneySeqAccessMgr::addSecurity(MyMoneySecurity& security) void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_securitiesList.find(security.id()); + it = m_securitiesList.tqfind(security.id()); if(it == m_securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during modifySecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1408,14 +1408,14 @@ void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security) void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security) { - QMap::ConstIterator it; + TQMap::ConstIterator it; // FIXME: check referential integrity - it = m_securitiesList.find(security.id()); + it = m_securitiesList.tqfind(security.id()); if(it == m_securitiesList.end()) { - QString msg = "Unknown security '"; + TQString msg = "Unknown security '"; msg += security.id() + "' during removeSecurity()"; throw new MYMONEYEXCEPTION(msg); } @@ -1423,9 +1423,9 @@ void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security) m_securitiesList.remove(security.id()); } -const MyMoneySecurity MyMoneySeqAccessMgr::security(const QString& id) const +const MyMoneySecurity MyMoneySeqAccessMgr::security(const TQString& id) const { - QMap::ConstIterator it = m_securitiesList.find(id); + TQMap::ConstIterator it = m_securitiesList.tqfind(id); if(it != m_securitiesList.end()) { return it.data(); @@ -1434,7 +1434,7 @@ const MyMoneySecurity MyMoneySeqAccessMgr::security(const QString& id) const return MyMoneySecurity(); } -const QValueList MyMoneySeqAccessMgr::securityList(void) const +const TQValueList MyMoneySeqAccessMgr::securityList(void) const { //qDebug("securityList: Security list size is %d, this=%8p", m_equitiesList.size(), (void*)this); return m_securitiesList.values(); @@ -1442,11 +1442,11 @@ const QValueList MyMoneySeqAccessMgr::securityList(void) const void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_currencyList.find(currency.id()); + it = m_currencyList.tqfind(currency.id()); if(it != m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot add currency with existing id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id())); } m_currencyList.insert(currency.id(), currency); @@ -1454,11 +1454,11 @@ void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency) void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_currencyList.find(currency.id()); + it = m_currencyList.tqfind(currency.id()); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot modify currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id())); } m_currencyList.modify(currency.id(), currency); @@ -1466,39 +1466,39 @@ void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency) void MyMoneySeqAccessMgr::removeCurrency(const MyMoneySecurity& currency) { - QMap::ConstIterator it; + TQMap::ConstIterator it; // FIXME: check referential integrity - it = m_currencyList.find(currency.id()); + it = m_currencyList.tqfind(currency.id()); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot remove currency with unknown id %1").arg(currency.id().data())); + throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id())); } m_currencyList.remove(currency.id()); } -const MyMoneySecurity MyMoneySeqAccessMgr::currency(const QString& id) const +const MyMoneySecurity MyMoneySeqAccessMgr::currency(const TQString& id) const { if(id.isEmpty()) { } - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_currencyList.find(id); + it = m_currencyList.tqfind(id); if(it == m_currencyList.end()) { - throw new MYMONEYEXCEPTION(QString("Cannot retrieve currency with unknown id '%1'").arg(id.data())); + throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id)); } return *it; } -const QValueList MyMoneySeqAccessMgr::currencyList(void) const +const TQValueList MyMoneySeqAccessMgr::currencyList(void) const { return m_currencyList.values(); } -const QValueList MyMoneySeqAccessMgr::reportList(void) const +const TQValueList MyMoneySeqAccessMgr::reportList(void) const { return m_reportList.values(); } @@ -1513,19 +1513,19 @@ void MyMoneySeqAccessMgr::addReport( MyMoneyReport& report ) report = newReport; } -void MyMoneySeqAccessMgr::loadReports(const QMap& map) +void MyMoneySeqAccessMgr::loadReports(const TQMap& map) { m_reportList = map; // scan the map to identify the last used id - QMap::const_iterator it_r; - QString lastId(""); + TQMap::const_iterator it_r; + TQString lastId(""); for(it_r = map.begin(); it_r != map.end(); ++it_r) { if((*it_r).id() > lastId) lastId = (*it_r).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextReportID = atol(lastId.mid(pos)); } @@ -1533,19 +1533,19 @@ void MyMoneySeqAccessMgr::loadReports(const QMap& map) void MyMoneySeqAccessMgr::modifyReport( const MyMoneyReport& report ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_reportList.find(report.id()); + it = m_reportList.tqfind(report.id()); if(it == m_reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_reportList.modify(report.id(), report); } -QString MyMoneySeqAccessMgr::nextReportID(void) +TQString MyMoneySeqAccessMgr::nextReportID(void) { - QString id; + TQString id; id.setNum(++m_nextReportID); id = "R" + id.rightJustify(REPORT_ID_SIZE, '0'); return id; @@ -1556,25 +1556,25 @@ unsigned MyMoneySeqAccessMgr::countReports(void) const return m_reportList.count(); } -const MyMoneyReport MyMoneySeqAccessMgr::report( const QString& _id ) const +const MyMoneyReport MyMoneySeqAccessMgr::report( const TQString& _id ) const { return m_reportList[_id]; } void MyMoneySeqAccessMgr::removeReport( const MyMoneyReport& report ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_reportList.find(report.id()); + it = m_reportList.tqfind(report.id()); if(it == m_reportList.end()) { - QString msg = "Unknown report '" + report.id() + "'"; + TQString msg = "Unknown report '" + report.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_reportList.remove(report.id()); } -const QValueList MyMoneySeqAccessMgr::budgetList(void) const +const TQValueList MyMoneySeqAccessMgr::budgetList(void) const { return m_budgetList.values(); } @@ -1587,27 +1587,27 @@ void MyMoneySeqAccessMgr::addBudget( MyMoneyBudget& budget ) budget = newBudget; } -void MyMoneySeqAccessMgr::loadBudgets(const QMap& map) +void MyMoneySeqAccessMgr::loadBudgets(const TQMap& map) { m_budgetList = map; // scan the map to identify the last used id - QMap::const_iterator it_b; - QString lastId(""); + TQMap::const_iterator it_b; + TQString lastId(""); for(it_b = map.begin(); it_b != map.end(); ++it_b) { if((*it_b).id() > lastId) lastId = (*it_b).id(); } - int pos = lastId.find(QRegExp("\\d+"), 0); + int pos = lastId.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { m_nextBudgetID = atol(lastId.mid(pos)); } } -const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const QString& budget) const +const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const TQString& budget) const { - QMap::ConstIterator it_p; + TQMap::ConstIterator it_p; for(it_p = m_budgetList.begin(); it_p != m_budgetList.end(); ++it_p) { if((*it_p).name() == budget) { @@ -1620,19 +1620,19 @@ const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const QString& budget) con void MyMoneySeqAccessMgr::modifyBudget( const MyMoneyBudget& budget ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_budgetList.find(budget.id()); + it = m_budgetList.tqfind(budget.id()); if(it == m_budgetList.end()) { - QString msg = "Unknown budget '" + budget.id() + "'"; + TQString msg = "Unknown budget '" + budget.id() + "'"; throw new MYMONEYEXCEPTION(msg); } m_budgetList.modify(budget.id(), budget); } -QString MyMoneySeqAccessMgr::nextBudgetID(void) +TQString MyMoneySeqAccessMgr::nextBudgetID(void) { - QString id; + TQString id; id.setNum(++m_nextBudgetID); id = "B" + id.rightJustify(BUDGET_ID_SIZE, '0'); return id; @@ -1643,18 +1643,18 @@ unsigned MyMoneySeqAccessMgr::countBudgets(void) const return m_budgetList.count(); } -MyMoneyBudget MyMoneySeqAccessMgr::budget( const QString& _id ) const +MyMoneyBudget MyMoneySeqAccessMgr::budget( const TQString& _id ) const { return m_budgetList[_id]; } void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget ) { - QMap::ConstIterator it; + TQMap::ConstIterator it; - it = m_budgetList.find(budget.id()); + it = m_budgetList.tqfind(budget.id()); if(it == m_budgetList.end()) { - QString msg = "Unknown budget '" + budget.id() + "'"; + TQString msg = "Unknown budget '" + budget.id() + "'"; throw new MYMONEYEXCEPTION(msg); } @@ -1664,8 +1664,8 @@ void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget ) void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price) { MyMoneySecurityPair pricePair(price.from(), price.to()); - QMap::ConstIterator it_m; - it_m = m_priceList.find(pricePair); + TQMap::ConstIterator it_m; + it_m = m_priceList.tqfind(pricePair); MyMoneyPriceEntries entries; if(it_m != m_priceList.end()) { @@ -1677,9 +1677,9 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price) // an existing one. MyMoneyPriceEntries::ConstIterator it; - it = entries.find(price.date()); + it = entries.tqfind(price.date()); if(it != entries.end()) { - if((*it).rate(QString()) == price.rate(QString()) + if((*it).rate(TQString()) == price.rate(TQString()) && (*it).source() == price.source()) // in case the information did not change, we don't do anything return; @@ -1698,8 +1698,8 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price) void MyMoneySeqAccessMgr::removePrice(const MyMoneyPrice& price) { MyMoneySecurityPair pricePair(price.from(), price.to()); - QMap::ConstIterator it_m; - it_m = m_priceList.find(pricePair); + TQMap::ConstIterator it_m; + it_m = m_priceList.tqfind(pricePair); MyMoneyPriceEntries entries; if(it_m != m_priceList.end()) { @@ -1723,20 +1723,20 @@ const MyMoneyPriceList MyMoneySeqAccessMgr::priceList(void) const return list; } -const MyMoneyPrice MyMoneySeqAccessMgr::price(const QString& fromId, const QString& toId, const QDate& _date, const bool exactDate) const +const MyMoneyPrice MyMoneySeqAccessMgr::price(const TQString& fromId, const TQString& toId, const TQDate& _date, const bool exactDate) const { MyMoneyPrice rc; MyMoneyPriceEntries::ConstIterator it; - QDate date(_date); + TQDate date(_date); // If no valid date is passed, we use today's date. if(!date.isValid()) - date = QDate::currentDate(); + date = TQDate::tqcurrentDate(); // If the caller selected an exact entry, we can search for // it using the date as the key if(exactDate) { - it = m_priceList[MyMoneySecurityPair(fromId, toId)].find(date); + it = m_priceList[MyMoneySecurityPair(fromId, toId)].tqfind(date); if(it != m_priceList[MyMoneySecurityPair(fromId, toId)].end()) rc = *it; @@ -1761,24 +1761,24 @@ void MyMoneySeqAccessMgr::clearCache(void) void MyMoneySeqAccessMgr::rebuildAccountBalances(void) { // reset the balance of all accounts to 0 - QMap map; + TQMap map; m_accountList.map(map); - QMap::iterator it_a; + TQMap::iterator it_a; for(it_a = map.begin(); it_a != map.end(); ++it_a) { (*it_a).setBalance(MyMoneyMoney(0)); } // now scan over all transactions and all splits and setup the balances - QMap::const_iterator it_t; + TQMap::const_iterator it_t; for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) { - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s = splits.begin(); + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s = splits.begin(); for(; it_s != splits.end(); ++it_s ) { if(!(*it_s).shares().isZero()) { - const QString& id = (*it_s).accountId(); + const TQString& id = (*it_s).accountId(); // locate the account and if present, update data - if(map.find(id) != map.end()) { + if(map.tqfind(id) != map.end()) { map[id].adjustBalance(*it_s); } } @@ -1796,14 +1796,14 @@ bool MyMoneySeqAccessMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFi // you miss the report checks in the following lines ;) bool rc = false; - const QString& id = obj.id(); - QMap::const_iterator it_t; - QMap::const_iterator it_a; - QMap::const_iterator it_i; - QMap::const_iterator it_p; - QMap::const_iterator it_b; - QMap::const_iterator it_sch; - QMap::const_iterator it_sec; + const TQString& id = obj.id(); + TQMap::const_iterator it_t; + TQMap::const_iterator it_a; + TQMap::const_iterator it_i; + TQMap::const_iterator it_p; + TQMap::const_iterator it_b; + TQMap::const_iterator it_sch; + TQMap::const_iterator it_sec; MyMoneyPriceList::const_iterator it_pr; // FIXME optimize the list of objects we have to checks @@ -1853,7 +1853,7 @@ bool MyMoneySeqAccessMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFi rc = (*it_sec).hasReferenceTo(id); } } - // within the pricelist we don't have to scan each entry. Checking the QPair + // within the pricelist we don't have to scan each entry. Checking the TQPair // members of the MyMoneySecurityPair is enough as they are identical to the // two security ids if(!skipCheck[RefCheckPrice]) { @@ -1917,10 +1917,10 @@ void MyMoneySeqAccessMgr::rollbackTransaction(void) m_priceList.rollbackTransaction(); } -void MyMoneySeqAccessMgr::removeReferences(const QString& id) +void MyMoneySeqAccessMgr::removeReferences(const TQString& id) { - QMap::const_iterator it_r; - QMap::const_iterator it_b; + TQMap::const_iterator it_r; + TQMap::const_iterator it_b; // remove from reports for(it_r = m_reportList.begin(); it_r != m_reportList.end(); ++it_r) { diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h index f200bef..ddc2030 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h @@ -20,8 +20,8 @@ * * ***************************************************************************/ -#ifndef MYMONEYSEQACCESSMGR_H -#define MYMONEYSEQACCESSMGR_H +#ifndef MYMONEYSETQACCESSMGR_H +#define MYMONEYSETQACCESSMGR_H // ---------------------------------------------------------------------------- // QT Includes @@ -50,7 +50,7 @@ * will be created containing the new balance value. * * @see MyMoneySeqAccessMgr::balance() and - * MyMoneySeqAccessMgr::invalidateBalanceCache() for a usage example + * MyMoneySeqAccessMgr::tqinvalidateBalanceCache() for a usage example */ class MyMoneyBalanceCacheItem { public: @@ -85,8 +85,8 @@ public: // general get functions const MyMoneyPayee user(void) const { return m_user; }; - const QDate creationDate(void) const { return m_creationDate; }; - const QDate lastModificationDate(void) const { return m_lastModificationDate; }; + const TQDate creationDate(void) const { return m_creationDate; }; + const TQDate lastModificationDate(void) const { return m_lastModificationDate; }; unsigned int currentFixVersion(void) const { return m_currentFixVersion; }; unsigned int fileFixVersion(void) const { return m_fileFixVersion; }; @@ -94,8 +94,8 @@ public: // general set functions void setUser(const MyMoneyPayee& user) { m_user = user; touch(); }; - void setCreationDate(const QDate& val) { m_creationDate = val; touch(); }; - void setLastModificationDate(const QDate& val) { m_lastModificationDate = val; m_dirty = false; }; + void setCreationDate(const TQDate& val) { m_creationDate = val; touch(); }; + void setLastModificationDate(const TQDate& val) { m_lastModificationDate = val; m_dirty = false; }; void setFileFixVersion(const unsigned int v) { m_fileFixVersion = v; }; /** * This method is used to get a SQL reader for subsequent database access @@ -122,7 +122,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - const MyMoneyAccount account(const QString& id) const; + const MyMoneyAccount account(const TQString& id) const; /** * This method is used to check whether a given @@ -131,26 +131,26 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - bool isStandardAccount(const QString& id) const; + bool isStandardAccount(const TQString& id) const; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. Possible + * @param id TQString reference to one of the standard accounts. Possible * values are: * * @li STD_ACC_LIABILITY * @li STD_ACC_ASSET * @li STD_ACC_EXPENSE * @li STD_ACC_INCOME - * @li STD_ACC_EQUITY + * @li STD_ACC_ETQUITY * - * @param name QString reference to the name to be set + * @param name TQString reference to the name to be set * */ - void setAccountName(const QString& id, const QString& name); + void setAccountName(const TQString& id, const TQString& name); /** * This method is used to create a new account @@ -174,22 +174,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - const MyMoneyPayee payee(const QString& id) const; + const MyMoneyPayee payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee reference to object of payee */ - const MyMoneyPayee payeeByName(const QString& payee) const; + const MyMoneyPayee payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -213,24 +213,24 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList containing the payee information + * @return TQValueList containing the payee information */ - const QValueList payeeList(void) const; + const TQValueList payeeList(void) const; /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects passed as arguments will be modified + * (tqparent) account. The objects passed as arguments will be modified * accordingly. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account); + void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account); /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * An exception will be thrown upon error conditions. * * @param institution The complete institution information in a @@ -241,7 +241,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * as QString in the transaction object. The accounts of the referenced splits + * as TQString in the transaction object. The accounts of the referenced splits * will be updated to have a reference to the transaction just added. * * @param transaction reference to the transaction @@ -286,14 +286,14 @@ public: void modifyTransaction(const MyMoneyTransaction& transaction); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * This method is used to remove a transaction from the transaction @@ -328,20 +328,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - const MyMoneyTransaction transaction(const QString& id) const; + const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - const MyMoneyTransaction transaction(const QString& account, const int idx) const; + const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method is used to determince, if the account with the @@ -350,7 +350,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - bool hasActiveSplits(const QString& id) const; + bool hasActiveSplits(const TQString& id) const; /** * This method is used to return the actual balance of an account @@ -363,7 +363,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney balance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney balance(const TQString& id, const TQDate& date = TQDate()) const; /** * This method is used to return the actual balance of an account @@ -376,7 +376,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney totalBalance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date = TQDate()) const; /** * Returns the institution of a given ID @@ -385,7 +385,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - const MyMoneyInstitution institution(const QString& id) const; + const MyMoneyInstitution institution(const TQString& id) const; /** * This method returns an indicator if the storage object has been @@ -407,18 +407,18 @@ public: * This method returns a list of the institutions * inside a MyMoneyFile object * - * @return QMap containing the institution information + * @return TQMap containing the institution information */ - const QValueList institutionList(void) const; + const TQValueList institutionList(void) const; /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - void accountList(QValueList& list) const; + void accountList(TQValueList& list) const; /** * This method is used to pull a list of transactions from the file @@ -434,9 +434,9 @@ public: * @param list reference to list * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList + * @return set of transactions in form of a TQValueList */ - void transactionList(QValueList& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList& list, MyMoneyTransactionFilter& filter) const; /** * This method is used to pull a list of transactions from the file @@ -452,35 +452,35 @@ public: * @param list reference to list * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList > + * @return set of transactions in form of a TQValueList > */ - void transactionList(QValueList< QPair >& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList< TQPair >& list, MyMoneyTransactionFilter& filter) const; /** * Compatibility interface for the previous method. */ - const QValueList transactionList(MyMoneyTransactionFilter& filter) const; + const TQValueList transactionList(MyMoneyTransactionFilter& filter) const; /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - bool isDuplicateTransaction(const QString& id) const { return m_transactionKeys.contains(id); } + bool isDuplicateTransaction(const TQString& id) const { return m_transactionKeys.tqcontains(id); } /** * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - unsigned int transactionCount(const QString& account = QString()) const; + unsigned int transactionCount(const TQString& account = TQString()) const; - const QMap transactionCountMap(void) const; + const TQMap transactionCountMap(void) const; /** * This method returns the number of institutions currently known to file @@ -526,15 +526,15 @@ public: * This method is used to return the standard equity account * @return MyMoneyAccount equity account(group) */ - const MyMoneyAccount equity(void) const { return account(STD_ACC_EQUITY); }; + const MyMoneyAccount equity(void) const { return account(STD_ACC_ETQUITY); }; - virtual void loadAccounts(const QMap& acc); - virtual void loadTransactions(const QMap& map); - virtual void loadInstitutions(const QMap& map); - virtual void loadPayees(const QMap& map); - virtual void loadSchedules(const QMap& map); - virtual void loadSecurities(const QMap& map); - virtual void loadCurrencies(const QMap& map); + virtual void loadAccounts(const TQMap& acc); + virtual void loadTransactions(const TQMap& map); + virtual void loadInstitutions(const TQMap& map); + virtual void loadPayees(const TQMap& map); + virtual void loadSchedules(const TQMap& map); + virtual void loadSecurities(const TQMap& map); + virtual void loadCurrencies(const TQMap& map); virtual void loadPrices(const MyMoneyPriceList& list); virtual void loadAccountId(const unsigned long id); @@ -560,34 +560,34 @@ public: * This method is used to extract a value from * KeyValueContainer. For details see MyMoneyKeyValueContainer::value(). * - * @param key const reference to QString containing the key - * @return QString containing the value + * @param key const reference to TQString containing the key + * @return TQString containing the value */ - const QString value(const QString& key) const; + const TQString value(const TQString& key) const; /** * This method is used to set a value in the * KeyValueContainer. For details see MyMoneyKeyValueContainer::setValue(). * - * @param key const reference to QString containing the key - * @param val const reference to QString containing the value + * @param key const reference to TQString containing the key + * @param val const reference to TQString containing the value */ - void setValue(const QString& key, const QString& val); + void setValue(const TQString& key, const TQString& val); /** * This method is used to delete a key-value-pair from the * KeyValueContainer identified by the parameter * @p key. For details see MyMoneyKeyValueContainer::deletePair(). * - * @param key const reference to QString containing the key + * @param key const reference to TQString containing the key */ - void deletePair(const QString& key); + void deletePair(const TQString& key); // documented in IMyMoneySerialize base class - const QMap pairs(void) const; + const TQMap pairs(void) const; // documented in IMyMoneySerialize base class - void setPairs(const QMap& list); + void setPairs(const TQMap& list); /** * This method is used to add a scheduled transaction to the engine. @@ -627,10 +627,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySchedule schedule(const QString& id) const; + const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to create a new security object. The ID will be created @@ -669,17 +669,17 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity security(const QString& id) const; + const MyMoneySecurity security(const TQString& id) const; /** * This method returns a list of security objects that the engine has * knowledge of. */ - const QValueList securityList(void) const; + const TQValueList securityList(void) const; /** * This method is used to add a new currency object to the engine. @@ -718,10 +718,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity currency(const QString& id) const; + const MyMoneySecurity currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -729,9 +729,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyCurrency objects. + * @return TQValueList of all MyMoneyCurrency objects. */ - const QValueList currencyList(void) const; + const TQValueList currencyList(void) const; /** * This method is used to extract a list of scheduled transactions @@ -739,7 +739,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -751,27 +751,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList list of schedule objects. + * @return const TQValueList list of schedule objects. */ - const QValueList scheduleList(const QString& accountId = QString(), + const TQValueList scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - const QValueList scheduleListEx( int scheduleTypes, + const TQValueList scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to retrieve the list of all reports @@ -779,9 +779,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - const QValueList reportList( void ) const; + const TQValueList reportList( void ) const; /** * This method is used to add a new report to the engine. @@ -803,7 +803,7 @@ public: * * @param reports reference to the map of MyMoneyReport objects */ - void loadReports( const QMap& reports ); + void loadReports( const TQMap& reports ); /** * This method is used to modify an existing MyMoneyReport @@ -829,10 +829,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - const MyMoneyReport report( const QString& id ) const; + const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -850,9 +850,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - const QValueList budgetList( void ) const; + const TQValueList budgetList( void ) const; /** * This method is used to add a new budget to the engine. @@ -874,18 +874,18 @@ public: * * @param budgets reference to the map of MyMoneyBudget object */ - void loadBudgets(const QMap& budgets); + void loadBudgets(const TQMap& budgets); /** * This method is used to retrieve the id to a corresponding * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget reference to object of budget */ - const MyMoneyBudget budgetByName(const QString& budget) const; + const MyMoneyBudget budgetByName(const TQString& budget) const; /** * This method is used to modify an existing MyMoneyBudget @@ -911,10 +911,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - MyMoneyBudget budget( const QString& id ) const; + MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -939,9 +939,9 @@ public: /** * This method retrieves a price from the price list. - * If @p date is inValid, QDate::currentDate() is assumed. + * If @p date is inValid, TQDate::tqcurrentDate() is assumed. */ - const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const; + const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; /** * This method returns a list of all price entries. @@ -958,7 +958,7 @@ public: * by another engine object. * * @param obj const reference to object to be checked - * @param skipCheck QBitArray with ReferenceCheckBits set for which + * @param skipCheck TQBitArray with ReferenceCheckBits set for which * the check should be skipped * * @retval false @p object is not referenced @@ -977,7 +977,7 @@ public: virtual void rollbackTransaction(void); protected: - void removeReferences(const QString& id); + void removeReferences(const TQString& id); private: @@ -997,12 +997,12 @@ private: void touch(void); /** - * This method is used to invalidate the cached balance for - * the selected account and all it's parents. + * This method is used to tqinvalidate the cached balance for + * the selected account and all it's tqparents. * * @param id id of the account in question */ - void invalidateBalanceCache(const QString& id); + void tqinvalidateBalanceCache(const TQString& id); /** * This member variable keeps the User information. @@ -1065,50 +1065,50 @@ private: * The member variable m_institutionList is the container for the * institutions known within this file. */ - MyMoneyMap m_institutionList; + MyMoneyMap m_institutionList; /** * The member variable m_accountList is the container for the accounts * known within this file. */ - MyMoneyMap m_accountList; + MyMoneyMap m_accountList; /** * The member variable m_balanceCache is the container for the * accounts actual balance */ - mutable QMap m_balanceCache; + mutable TQMap m_balanceCache; /** * This member keeps the date for which the m_balanceCache member * is valid. In case the whole cache is invalid it is set to - * QDate(). + * TQDate(). */ - mutable QDate m_balanceCacheDate; + mutable TQDate m_balanceCacheDate; /** * The member variable m_transactionList is the container for all * transactions within this file. * @see m_transactionKeys */ - MyMoneyMap m_transactionList; + MyMoneyMap m_transactionList; /** * The member variable m_transactionKeys is used to convert * transaction id's into the corresponding key used in m_transactionList. * @see m_transactionList; */ - MyMoneyMap m_transactionKeys; + MyMoneyMap m_transactionKeys; /** * A list containing all the payees that have been used */ - MyMoneyMap m_payeeList; + MyMoneyMap m_payeeList; /** * A list containing all the scheduled transactions */ - MyMoneyMap m_scheduleList; + MyMoneyMap m_scheduleList; /** * A list containing all the security information objects. Each object @@ -1117,19 +1117,19 @@ private: * to determine the cost basis for sales, as well as the source of * information for reports in a security account. */ - MyMoneyMap m_securitiesList; + MyMoneyMap m_securitiesList; /** * A list containing all the currency information objects. */ - MyMoneyMap m_currencyList; + MyMoneyMap m_currencyList; - MyMoneyMap m_reportList; + MyMoneyMap m_reportList; /** * A list containing all the budget information objects. */ - MyMoneyMap m_budgetList; + MyMoneyMap m_budgetList; MyMoneyMap m_priceList; @@ -1143,13 +1143,13 @@ private: * object. It is set during the constructor and can only be modified using * the stream read operator. */ - QDate m_creationDate; + TQDate m_creationDate; /** * This member variable keeps the date of the last modification of * the MyMoneySeqAccessMgr object. */ - QDate m_lastModificationDate; + TQDate m_lastModificationDate; /** * This member variable contains the current fix level of application @@ -1165,58 +1165,58 @@ private: * This method is used to get the next valid ID for a institution * @return id for a institution */ - QString nextInstitutionID(void); + TQString nextInstitutionID(void); /** * This method is used to get the next valid ID for an account * @return id for an account */ - QString nextAccountID(void); + TQString nextAccountID(void); /** * This method is used to get the next valid ID for a transaction * @return id for a transaction */ - QString nextTransactionID(void); + TQString nextTransactionID(void); /** * This method is used to get the next valid ID for a payee * @return id for a payee */ - QString nextPayeeID(void); + TQString nextPayeeID(void); /** * This method is used to get the next valid ID for a scheduled transaction * @return id for a scheduled transaction */ - QString nextScheduleID(void); + TQString nextScheduleID(void); /** * This method is used to get the next valid ID for an security object. * @return id for an security object */ - QString nextSecurityID(void); + TQString nextSecurityID(void); - QString nextReportID(void); + TQString nextReportID(void); /** * This method is used to get the next valid ID for a budget object. * @return id for an budget object */ - QString nextBudgetID(void); + TQString nextBudgetID(void); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account * @param sendNotification if true, notifications with the ids * of all modified objects are send */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent, const bool sendNotification); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent, const bool sendNotification); /** * This method will close a database and log the use roff */ diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp index 09bf791..9decdce 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp @@ -63,7 +63,7 @@ void MyMoneySeqAccessMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->m_scheduleList.count() == 0); CPPUNIT_ASSERT(m->m_dirty == false); - CPPUNIT_ASSERT(m->m_creationDate == QDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(m->liability().name() == "Liability"); CPPUNIT_ASSERT(m->asset().name() == "Asset"); @@ -354,7 +354,7 @@ void MyMoneySeqAccessMgrTest::testModifyAccount() { m->commitTransaction(); m->startTransaction(); MyMoneyAccount b = m->account("A000001"); - CPPUNIT_ASSERT(b.parentAccountId() == a.parentAccountId()); + CPPUNIT_ASSERT(b.tqparentAccountId() == a.tqparentAccountId()); CPPUNIT_ASSERT(b.name() == "New account name"); CPPUNIT_ASSERT(m->dirty() == true); } catch (MyMoneyException *e) { @@ -383,7 +383,7 @@ void MyMoneySeqAccessMgrTest::testModifyAccount() { delete e; } - // use different parent + // use different tqparent a.setParentAccountId("A000002"); try { m->modifyAccount(c); @@ -422,7 +422,7 @@ void MyMoneySeqAccessMgrTest::testModifyInstitution() { } } -void MyMoneySeqAccessMgrTest::testReparentAccount() { +void MyMoneySeqAccessMgrTest::testRetqparentAccount() { // this one adds some accounts to the database MyMoneyAccount ex1; ex1.setAccountType(MyMoneyAccount::Expense); @@ -460,27 +460,27 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() { CPPUNIT_ASSERT(in.id() == "A000005"); CPPUNIT_ASSERT(ch.id() == "A000006"); - MyMoneyAccount parent = m->expense(); + MyMoneyAccount tqparent = m->expense(); - m->addAccount(parent, ex1); + m->addAccount(tqparent, ex1); m->addAccount(ex1, ex2); - m->addAccount(parent, ex3); - m->addAccount(parent, ex4); + m->addAccount(tqparent, ex3); + m->addAccount(tqparent, ex4); - parent = m->income(); - m->addAccount(parent, in); + tqparent = m->income(); + m->addAccount(tqparent, in); - parent = m->asset(); - m->addAccount(parent, ch); + tqparent = m->asset(); + m->addAccount(tqparent, ch); CPPUNIT_ASSERT(m->expense().accountCount() == 3); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 1); - CPPUNIT_ASSERT(ex3.parentAccountId() == STD_ACC_EXPENSE); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == STD_ACC_EXPENSE); m->reparentAccount(ex3, ex1); CPPUNIT_ASSERT(m->expense().accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); - CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == ex1.id()); } catch (MyMoneyException *e) { std::cout << std::endl << e->what() << std::endl; delete e; @@ -489,7 +489,7 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() { } void MyMoneySeqAccessMgrTest::testAddTransactions() { - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount ch; MyMoneyTransaction t1, t2; @@ -503,14 +503,14 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000005"); // Salary s.setShares(-100000); s.setValue(-100000); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2002,5,10)); + t1.setPostDate(TQDate(2002,5,10)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -530,35 +530,35 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { try { // I spent some money, not so great - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000004"); // Grosseries s.setShares(10000); s.setValue(10000); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); // 16% sales tax s.setShares(1200); s.setValue(1200); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000003"); // 7% sales tax s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000006"); // Checkings account s.setShares(-11600); s.setValue(-11600); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - t2.setPostDate(QDate(2002,5,9)); + t2.setPostDate(TQDate(2002,5,9)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -572,8 +572,8 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { CPPUNIT_ASSERT(t2.splitCount() == 4); CPPUNIT_ASSERT(m->transactionCount() == 2); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; it_k = m->m_transactionKeys.begin(); it_t = m->m_transactionList.begin(); @@ -591,12 +591,12 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000002"); ++it; @@ -607,7 +607,7 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { /* removed with MyMoneyAccount::Transaction CPPUNIT_ASSERT(ch.transactionCount() == 2); - QValueList::ConstIterator it_l; + TQValueList::ConstIterator it_l; it_l = ch.transactionList().begin(); CPPUNIT_ASSERT((*it_l).transactionID() == "T000000000000000002"); CPPUNIT_ASSERT((*it_l).balance() == -11600); @@ -642,9 +642,9 @@ void MyMoneySeqAccessMgrTest::testBalance() { CPPUNIT_ASSERT(m->balance("A000002") == MyMoneyMoney(1200)); CPPUNIT_ASSERT(m->balance("A000003") == MyMoneyMoney(400)); CPPUNIT_ASSERT(m->totalBalance("A000001") == MyMoneyMoney(1600)); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,9)) == MyMoneyMoney(-11600)); - CPPUNIT_ASSERT(m->balance("A000005", QDate(2002,5,10)) == MyMoneyMoney(-100000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,10)) == MyMoneyMoney(88400)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,9)) == MyMoneyMoney(-11600)); + CPPUNIT_ASSERT(m->balance("A000005", TQDate(2002,5,10)) == MyMoneyMoney(-100000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,10)) == MyMoneyMoney(88400)); } void MyMoneySeqAccessMgrTest::testModifyTransaction() { @@ -682,15 +682,15 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { } // now modify the date - t.setPostDate(QDate(2002,5,11)); + t.setPostDate(TQDate(2002,5,11)); try { m->modifyTransaction(t); CPPUNIT_ASSERT(m->balance("A000004") == MyMoneyMoney(11000)); CPPUNIT_ASSERT(m->balance("A000006") == MyMoneyMoney(100000-12600)); CPPUNIT_ASSERT(m->totalBalance("A000001") == MyMoneyMoney(1600)); - QMap::ConstIterator it_k; - QMap::ConstIterator it_t; + TQMap::ConstIterator it_k; + TQMap::ConstIterator it_t; it_k = m->m_transactionKeys.begin(); it_t = m->m_transactionList.begin(); CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); @@ -707,12 +707,12 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000001"); ++it; @@ -723,7 +723,7 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { /* removed with MyMoneyAccount::Transaction // CPPUNIT_ASSERT(ch.transactionCount() == 2); - QValueList::ConstIterator it_l; + TQValueList::ConstIterator it_l; it_l = ch.transactionList().begin(); CPPUNIT_ASSERT((*it_l).transactionID() == "T000000000000000001"); CPPUNIT_ASSERT((*it_l).balance() == 100000); @@ -792,7 +792,7 @@ void MyMoneySeqAccessMgrTest::testRemoveUnusedAccount() { CPPUNIT_ASSERT(i.accountCount() == 0); CPPUNIT_ASSERT(m->accountCount() == 7); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->removeAccount(a); m->commitTransaction(); @@ -822,7 +822,7 @@ void MyMoneySeqAccessMgrTest::testRemoveUsedAccount() { void MyMoneySeqAccessMgrTest::testRemoveInstitution() { testModifyInstitution(); - testReparentAccount(); + testRetqparentAccount(); MyMoneyInstitution i; MyMoneyAccount a; @@ -843,7 +843,7 @@ void MyMoneySeqAccessMgrTest::testRemoveInstitution() { // now remove the institution and see if the account survived ;-) try { m->removeInstitution(i); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->commitTransaction(); m->startTransaction(); @@ -881,7 +881,7 @@ void MyMoneySeqAccessMgrTest::testRemoveTransaction() { void MyMoneySeqAccessMgrTest::testTransactionList() { testAddTransactions(); - QValueList list; + TQValueList list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 2); @@ -889,7 +889,7 @@ void MyMoneySeqAccessMgrTest::testTransactionList() { CPPUNIT_ASSERT((*(list.at(1))).id() == "T000000000000000001"); filter.clear(); - filter.addAccount(QString("A000003")); + filter.addAccount(TQString("A000003")); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT((*(list.at(0))).id() == "T000000000000000002"); @@ -1091,7 +1091,7 @@ void MyMoneySeqAccessMgrTest::testPayeeName() { testAddPayee(); MyMoneyPayee p; - QString name("THB"); + TQString name("THB"); // OK case try { @@ -1193,11 +1193,11 @@ void MyMoneySeqAccessMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); - t1.setPostDate(QDate(2003,7,10)); + t1.setPostDate(TQDate(2003,7,10)); schedule.setTransaction(t1); m->addSchedule(schedule); @@ -1215,8 +1215,8 @@ void MyMoneySeqAccessMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); m->addSchedule(schedule); @@ -1302,9 +1302,9 @@ void MyMoneySeqAccessMgrTest::testRemoveSchedule() { } void MyMoneySeqAccessMgrTest::testScheduleList() { - QDate testDate = QDate::currentDate(); - QDate notOverdue = testDate.addDays(2); - QDate overdue = testDate.addDays(-2); + TQDate testDate = TQDate::tqcurrentDate(); + TQDate notOverdue = testDate.addDays(2); + TQDate overdue = testDate.addDays(-2); MyMoneyTransaction t1; @@ -1317,8 +1317,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_ONCE, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t1.setPostDate(notOverdue); @@ -1335,8 +1335,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_DIRECTDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t2.setPostDate(notOverdue.addDays(1)); @@ -1353,8 +1353,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t3.setPostDate(notOverdue.addDays(2)); @@ -1370,8 +1370,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule schedule4("Schedule 4", MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(), notOverdue.addDays(31), false, false); @@ -1389,7 +1389,7 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { CPPUNIT_FAIL("Unexpected exception"); } - QValueList list; + TQValueList list; // no filter list = m->scheduleList(); @@ -1436,7 +1436,7 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), notOverdue.addDays(1)); CPPUNIT_ASSERT(list.count() == 3); CPPUNIT_ASSERT(list[0].name() == "Schedule 1"); @@ -1457,8 +1457,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), - QDate(), + TQDate(), + TQDate(), true); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT(list[0].name() == "Schedule 4"); @@ -1606,7 +1606,7 @@ void MyMoneySeqAccessMgrTest::testCurrencyList() void MyMoneySeqAccessMgrTest::testAccountList() { - QValueList accounts; + TQValueList accounts; m->accountList(accounts); CPPUNIT_ASSERT(accounts.count() == 0); testAddNewAccount(); @@ -1628,7 +1628,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() m->rollbackTransaction(); // account loader - QMap amap; + TQMap amap; MyMoneyAccount acc("A0000176", MyMoneyAccount()); amap[acc.id()] = acc; m->loadAccounts(amap); @@ -1637,7 +1637,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextAccountID == 176); // transaction loader - QMap tmap; + TQMap tmap; MyMoneyTransaction t("T000000108", MyMoneyTransaction()); tmap[t.id()] = t; m->loadTransactions(tmap); @@ -1646,7 +1646,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextTransactionID == 108); // institution loader - QMap imap; + TQMap imap; MyMoneyInstitution inst("I000028", MyMoneyInstitution()); imap[inst.id()] = inst; m->loadInstitutions(imap); @@ -1655,7 +1655,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextInstitutionID == 28); // payee loader - QMap pmap; + TQMap pmap; MyMoneyPayee p("P1234", MyMoneyPayee()); pmap[p.id()] = p; m->loadPayees(pmap); @@ -1664,7 +1664,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextPayeeID == 1234); // security loader - QMap smap; + TQMap smap; MyMoneySecurity s("S54321", MyMoneySecurity()); smap[s.id()] = s; m->loadSecurities(smap); @@ -1673,7 +1673,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextSecurityID == 54321); // schedule loader - QMap schmap; + TQMap schmap; MyMoneySchedule sch("SCH6789", MyMoneySchedule()); schmap[sch.id()] = sch; m->loadSchedules(schmap); @@ -1682,7 +1682,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextScheduleID == 6789); // report loader - QMap rmap; + TQMap rmap; MyMoneyReport r("R1298", MyMoneyReport()); rmap[r.id()] = r; m->loadReports(rmap); @@ -1691,7 +1691,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextReportID == 1298); // budget loader - QMap bmap; + TQMap bmap; MyMoneyBudget b("B89765", MyMoneyBudget()); bmap[b.id()] = b; m->loadBudgets(bmap); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h index b9fa763..57f1cd6 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#ifndef __MYMONEYSEQACCESSMGRTEST_H__ -#define __MYMONEYSEQACCESSMGRTEST_H__ +#ifndef __MYMONEYSETQACCESSMGRTEST_H__ +#define __MYMONEYSETQACCESSMGRTEST_H__ #include #include @@ -38,7 +38,7 @@ class MyMoneySeqAccessMgrTest : public CppUnit::TestFixture { CPPUNIT_TEST(testIsStandardAccount); CPPUNIT_TEST(testNewAccount); CPPUNIT_TEST(testAddNewAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testAddInstitution); CPPUNIT_TEST(testInstitution); CPPUNIT_TEST(testAccount2Institution); @@ -94,7 +94,7 @@ public: void testAccount2Institution(); void testModifyAccount(); void testModifyInstitution(); - void testReparentAccount(); + void testRetqparentAccount(); void testAddTransactions(); void testTransactionCount(); void testBalance(); diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp index 31f051e..bb0ab60 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -42,8 +42,8 @@ #include "../mymoneyreport.h" #include "../mymoneyinstitution.h" -QStringList MyMoneyStorageANON::zKvpNoModify = QStringList::split(",","kmm-baseCurrency,PreferredAccount,Tax,fixed-interest,interest-calculation,payee,schedule,term,kmm-online-source,kmm-brokerage-account,lastStatementDate,kmm-sort-reconcile,kmm-sort-std,kmm-iconpos,mm-closed,payee,schedule,term,lastImportedTransactionDate,VatAccount,VatRate,kmm-matched-tx,Imported"); -QStringList MyMoneyStorageANON::zKvpXNumber = QStringList::split(",","final-payment,loan-amount,periodic-payment,lastStatementBalance"); +TQStringList MyMoneyStorageANON::zKvpNoModify = TQStringList::split(",","kmm-baseCurrency,PreferredAccount,Tax,fixed-interest,interest-calculation,payee,schedule,term,kmm-online-source,kmm-brokerage-account,lastStatementDate,kmm-sort-reconcile,kmm-sort-std,kmm-iconpos,mm-closed,payee,schedule,term,lastImportedTransactionDate,VatAccount,VatRate,kmm-matched-tx,Imported"); +TQStringList MyMoneyStorageANON::zKvpXNumber = TQStringList::split(",","final-payment,loan-amount,periodic-payment,lastStatementBalance"); MyMoneyStorageANON::MyMoneyStorageANON() : @@ -54,7 +54,7 @@ MyMoneyStorageANON::MyMoneyStorageANON() : int msec; do { - msec = QTime::currentTime().msec(); + msec = TQTime::currentTime().msec(); } while(msec == 0); m_factor = MyMoneyMoney(msec, 10).reduce(); } @@ -63,29 +63,29 @@ MyMoneyStorageANON::~MyMoneyStorageANON() { } -void MyMoneyStorageANON::readFile(QIODevice* , IMyMoneySerialize* ) +void MyMoneyStorageANON::readFile(TQIODevice* , IMyMoneySerialize* ) { throw new MYMONEYEXCEPTION("Cannot read a file through MyMoneyStorageANON!!"); } -void MyMoneyStorageANON::writeUserInformation(QDomElement& userInfo) +void MyMoneyStorageANON::writeUserInformation(TQDomElement& userInfo) { MyMoneyPayee user = m_storage->user(); - userInfo.setAttribute(QString("name"), hideString(user.name())); - userInfo.setAttribute(QString("email"), hideString(user.email())); + userInfo.setAttribute(TQString("name"), hideString(user.name())); + userInfo.setAttribute(TQString("email"), hideString(user.email())); - QDomElement address = m_doc->createElement("ADDRESS"); - address.setAttribute(QString("street"), hideString(user.address())); - address.setAttribute(QString("city"), hideString(user.city())); - address.setAttribute(QString("county"), hideString(user.state())); - address.setAttribute(QString("zipcode"), hideString(user.postcode())); - address.setAttribute(QString("telephone"), hideString(user.telephone())); + TQDomElement address = m_doc->createElement("ADDRESS"); + address.setAttribute(TQString("street"), hideString(user.address())); + address.setAttribute(TQString("city"), hideString(user.city())); + address.setAttribute(TQString("county"), hideString(user.state())); + address.setAttribute(TQString("zipcode"), hideString(user.postcode())); + address.setAttribute(TQString("telephone"), hideString(user.telephone())); userInfo.appendChild(address); } -void MyMoneyStorageANON::writeInstitution(QDomElement& institution, const MyMoneyInstitution& _i) +void MyMoneyStorageANON::writeInstitution(TQDomElement& institution, const MyMoneyInstitution& _i) { MyMoneyInstitution i(_i); @@ -103,7 +103,7 @@ void MyMoneyStorageANON::writeInstitution(QDomElement& institution, const MyMone } -void MyMoneyStorageANON::writePayee(QDomElement& payee, const MyMoneyPayee& _p) +void MyMoneyStorageANON::writePayee(TQDomElement& payee, const MyMoneyPayee& _p) { MyMoneyPayee p(_p); @@ -117,15 +117,15 @@ void MyMoneyStorageANON::writePayee(QDomElement& payee, const MyMoneyPayee& _p) p.setTelephone(hideString(p.telephone())); p.setNotes(hideString(p.notes())); bool ignoreCase; - QStringList keys; + TQStringList keys; MyMoneyPayee::payeeMatchType matchType = p.matchData(ignoreCase, keys); - QRegExp exp("[A-Za-z]"); - p.setMatchData(matchType, ignoreCase, QStringList::split(";", keys.join(";").replace(exp, "x"))); + TQRegExp exp("[A-Za-z]"); + p.setMatchData(matchType, ignoreCase, TQStringList::split(";", keys.join(";").tqreplace(exp, "x"))); MyMoneyStorageXML::writePayee(payee, p); } -void MyMoneyStorageANON::writeAccount(QDomElement& account, const MyMoneyAccount& _p) +void MyMoneyStorageANON::writeAccount(TQDomElement& account, const MyMoneyAccount& _p) { MyMoneyAccount p(_p); @@ -149,10 +149,10 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) tn.setBankID(hideString(tx.bankID())); // hide split data - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneySplit s = (*it_s); - s.setMemo(QString("%1/%2").arg(tn.id()).arg(s.id())); + s.setMemo(TQString("%1/%2").tqarg(tn.id()).tqarg(s.id())); if(s.value() != MyMoneyMoney::autoCalc) { s.setValue((s.value() * m_factor)); @@ -175,14 +175,14 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp) { - QMap pairs; - QMap::const_iterator it; + TQMap pairs; + TQMap::const_iterator it; for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it) { - if ( zKvpXNumber.contains( it.key() ) || it.key().left(3)=="ir-" ) + if ( zKvpXNumber.tqcontains( it.key() ) || it.key().left(3)=="ir-" ) pairs[it.key()] = hideNumber(MyMoneyMoney(it.data())).toString(); - else if ( zKvpNoModify.contains( it.key() ) ) + else if ( zKvpNoModify.tqcontains( it.key() ) ) pairs[it.key()] = it.data(); else pairs[it.key()] = hideString(it.data()); @@ -190,7 +190,7 @@ void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp) kvp.setPairs(pairs); } -void MyMoneyStorageANON::writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx) +void MyMoneyStorageANON::writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx) { MyMoneyTransaction tn = tx; @@ -199,7 +199,7 @@ void MyMoneyStorageANON::writeTransaction(QDomElement& transactions, const MyMon MyMoneyStorageXML::writeTransaction(transactions, tn); } -void MyMoneyStorageANON::writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& sx) +void MyMoneyStorageANON::writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& sx) { MyMoneySchedule sn = sx; MyMoneyTransaction tn = sn.transaction(); @@ -212,7 +212,7 @@ void MyMoneyStorageANON::writeSchedule(QDomElement& scheduledTx, const MyMoneySc MyMoneyStorageXML::writeSchedule(scheduledTx, sn); } -void MyMoneyStorageANON::writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security) +void MyMoneyStorageANON::writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security) { MyMoneySecurity s = security; s.setName(security.id()); @@ -221,9 +221,9 @@ void MyMoneyStorageANON::writeSecurity(QDomElement& securityElement, const MyMon MyMoneyStorageXML::writeSecurity(securityElement, s); } -QString MyMoneyStorageANON::hideString(const QString& _in) const +TQString MyMoneyStorageANON::hideString(const TQString& _in) const { - return QString(_in).fill('x'); + return TQString(_in).fill('x'); } MyMoneyMoney MyMoneyStorageANON::hideNumber(const MyMoneyMoney& _in) const @@ -257,8 +257,8 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) bn.setBudgetStart(bx.budgetStart()); bn = MyMoneyBudget(bx.id(), bn); - QValueList list = bx.getaccounts(); - QValueList::iterator it; + TQValueList list = bx.getaccounts(); + TQValueList::iterator it; for(it = list.begin(); it != list.end(); ++it) { // only add the account if there is a budget entered if(!(*it).balance().isZero()) { @@ -266,8 +266,8 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) account.setId((*it).id()); account.setBudgetLevel((*it).budgetLevel()); account.setBudgetSubaccounts((*it).budgetSubaccounts()); - QMap plist = (*it).getPeriods(); - QMap::const_iterator it_p; + TQMap plist = (*it).getPeriods(); + TQMap::const_iterator it_p; for(it_p = plist.begin(); it_p != plist.end(); ++it_p) { MyMoneyBudget::PeriodGroup pGroup; pGroup.setAmount((*it_p).amount() * m_factor ); @@ -281,7 +281,7 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) bx = bn; } -void MyMoneyStorageANON::writeBudget(QDomElement& budgets, const MyMoneyBudget& b) +void MyMoneyStorageANON::writeBudget(TQDomElement& budgets, const MyMoneyBudget& b) { MyMoneyBudget bn = b; diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.h b/kmymoney2/mymoney/storage/mymoneystorageanon.h index 4b7ab95..5919220 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.h +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.h @@ -27,9 +27,9 @@ // ---------------------------------------------------------------------------- // QT Includes -// #include -// #include -// class QIODevice; +// #include +// #include +// class TQIODevice; // ---------------------------------------------------------------------------- // Project Includes @@ -70,38 +70,38 @@ public: virtual ~MyMoneyStorageANON(); protected: - void writeUserInformation(QDomElement& userInfo); + void writeUserInformation(TQDomElement& userInfo); - void writeInstitution(QDomElement& institutions, const MyMoneyInstitution& i); + void writeInstitution(TQDomElement& institutions, const MyMoneyInstitution& i); - void writePayee(QDomElement& payees, const MyMoneyPayee& p); + void writePayee(TQDomElement& payees, const MyMoneyPayee& p); - void writeAccount(QDomElement& accounts, const MyMoneyAccount& p); + void writeAccount(TQDomElement& accounts, const MyMoneyAccount& p); - void writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx); + void writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx); - void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx); + void writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx); - void writeBudget(QDomElement& budgets, const MyMoneyBudget& b); + void writeBudget(TQDomElement& budgets, const MyMoneyBudget& b); - void readFile(QIODevice* s, IMyMoneySerialize* storage); + void readFile(TQIODevice* s, IMyMoneySerialize* storage); - void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security); + void writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security); - QDomElement findChildElement(const QString& name, const QDomElement& root); + TQDomElement findChildElement(const TQString& name, const TQDomElement& root); private: /** * The list of key-value pairs to not modify */ - static QStringList zKvpNoModify; + static TQStringList zKvpNoModify; /** * The list of key-value pairs which are numbers to be hidden */ - static QStringList zKvpXNumber; + static TQStringList zKvpXNumber; - QString hideString(const QString&) const; + TQString hideString(const TQString&) const; MyMoneyMoney hideNumber(const MyMoneyMoney&) const; void fakeTransaction(MyMoneyTransaction& tn); void fakeBudget(MyMoneyBudget& bn); diff --git a/kmymoney2/mymoney/storage/mymoneystoragedump.cpp b/kmymoney2/mymoney/storage/mymoneystoragedump.cpp index e0d0083..77fa395 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragedump.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragedump.cpp @@ -23,10 +23,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -45,14 +45,14 @@ MyMoneyStorageDump::~MyMoneyStorageDump() { } -void MyMoneyStorageDump::readStream(QDataStream& /* s */, IMyMoneySerialize* /* storage */) +void MyMoneyStorageDump::readStream(TQDataStream& /* s */, IMyMoneySerialize* /* storage */) { qDebug("Reading not supported by MyMoneyStorageDump!!"); } -void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storage) +void MyMoneyStorageDump::writeStream(TQDataStream& _s, IMyMoneySerialize* _storage) { - QTextStream s(_s.device()); + TQTextStream s(_s.device()); IMyMoneyStorage* storage = dynamic_cast (_storage); MyMoneyPayee user = storage->user(); @@ -72,18 +72,18 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Internal-Info\n"; s << "-------------\n"; - QValueList list_a; + TQValueList list_a; storage->accountList(list_a); s << "accounts = " << list_a.count() <<", next id = " << _storage->accountId() << "\n"; MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList list_t; + TQValueList list_t; storage->transactionList(list_t, filter); - QValueList::ConstIterator it_t; + TQValueList::ConstIterator it_t; s << "transactions = " << list_t.count() << ", next id = " << _storage->transactionId() << "\n"; - QMap xferCount; + TQMap xferCount; for(it_t = list_t.begin(); it_t != list_t.end(); ++it_t) { - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; int accountCount = 0; for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = storage->account((*it_s).accountId()); @@ -94,7 +94,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag if(accountCount > 1) xferCount[accountCount] = xferCount[accountCount] + 1; } - QMap::ConstIterator it_cnt; + TQMap::ConstIterator it_cnt; for(it_cnt = xferCount.begin(); it_cnt != xferCount.end(); ++it_cnt) { s << " " << *it_cnt << " of them references " << it_cnt.key() << " accounts\n"; } @@ -107,8 +107,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Institutions\n"; s << "------------\n"; - QValueList list_i = storage->institutionList(); - QValueList::ConstIterator it_i; + TQValueList list_i = storage->institutionList(); + TQValueList::ConstIterator it_i; for(it_i = list_i.begin(); it_i != list_i.end(); ++it_i) { s << " ID = " << (*it_i).id() << "\n"; s << " Name = " << (*it_i).name() << "\n"; @@ -119,8 +119,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Payees" << "\n"; s << "------" << "\n"; - QValueList list_p = storage->payeeList(); - QValueList::ConstIterator it_p; + TQValueList list_p = storage->payeeList(); + TQValueList::ConstIterator it_p; for(it_p = list_p.begin(); it_p != list_p.end(); ++it_p) { s << " ID = " << (*it_p).id() << "\n"; s << " Name = " << (*it_p).name() << "\n"; @@ -144,7 +144,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag list_a.push_front(storage->income()); list_a.push_front(storage->liability()); list_a.push_front(storage->asset()); - QValueList::ConstIterator it_a; + TQValueList::ConstIterator it_a; for(it_a = list_a.begin(); it_a != list_a.end(); ++it_a) { s << " ID = " << (*it_a).id() << "\n"; s << " Name = " << (*it_a).name() << "\n"; @@ -160,10 +160,10 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " Currency = " << storage->currency((*it_a).currencyId()).name() << "\n"; } } - s << " Parent = " << (*it_a).parentAccountId(); - if(!(*it_a).parentAccountId().isEmpty()) { - MyMoneyAccount parent = storage->account((*it_a).parentAccountId()); - s << " (" << parent.name() << ")"; + s << " Parent = " << (*it_a).tqparentAccountId(); + if(!(*it_a).tqparentAccountId().isEmpty()) { + MyMoneyAccount tqparent = storage->account((*it_a).tqparentAccountId()); + s << " (" << tqparent.name() << ")"; } else { s << "n/a"; } @@ -186,8 +186,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag dumpKVP(" KVP: ", s, *it_a); dumpKVP(" OnlineBankingSettings: ", s, (*it_a).onlineBankingSettings()); - QStringList list_s = (*it_a).accountList(); - QStringList::ConstIterator it_s; + TQStringList list_s = (*it_a).accountList(); + TQStringList::ConstIterator it_s; if(list_s.count() > 0) { s << " Children =" << "\n"; } @@ -203,8 +203,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Currencies" << "\n"; s << "----------" << "\n"; - QValueList list_c = storage->currencyList(); - QValueList::ConstIterator it_c; + TQValueList list_c = storage->currencyList(); + TQValueList::ConstIterator it_c; for(it_c = list_c.begin(); it_c != list_c.end(); ++it_c) { s << " Name = " << (*it_c).name() << "\n"; s << " ID = " << (*it_c).id() << "\n"; @@ -221,8 +221,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Securities" << "\n"; s << "----------" << "\n"; - QValueList list_e = storage->securityList(); - QValueList::ConstIterator it_e; + TQValueList list_e = storage->securityList(); + TQValueList::ConstIterator it_e; for(it_e = list_e.begin(); it_e != list_e.end(); ++it_e) { s << " Name = " << (*it_e).name() << "\n"; s << " ID = " << (*it_e).id() << "\n"; @@ -244,8 +244,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " smallest account fraction = " << (*it_e).smallestAccountFraction() << "\n"; s << " KVP: " << "\n"; - QMapkvp = (*it_e).pairs(); - QMap::Iterator it; + TQMapkvp = (*it_e).pairs(); + TQMap::Iterator it; for(it = kvp.begin(); it != kvp.end(); ++it) { s << " '" << it.key() << "' = '" << it.data() << "'\n"; } @@ -264,7 +264,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag MyMoneyPriceEntries::ConstIterator it_pre; for(it_pre = (*it_pr).begin(); it_pre != (*it_pr).end(); ++it_pre) { s << " Date = " << (*it_pre).date().toString() << "\n"; - s << " Price = " << (*it_pre).rate(QString()).formatMoney("", 8) << "\n"; + s << " Price = " << (*it_pre).rate(TQString()).formatMoney("", 8) << "\n"; s << " Source = " << (*it_pre).source() << "\n"; s << " From = " << (*it_pre).from() << "\n"; s << " To = " << (*it_pre).to() << "\n"; @@ -285,8 +285,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Schedules" << "\n"; s << "---------" << "\n"; - QValueList list_s = storage->scheduleList(); - QValueList::ConstIterator it_s; + TQValueList list_s = storage->scheduleList(); + TQValueList::ConstIterator it_s; for(it_s = list_s.begin(); it_s != list_s.end(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Name = " << (*it_s).name() << "\n"; @@ -314,8 +314,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " = overdue!" << "\n"; } - QValueList list_d; - QValueList::ConstIterator it_d; + TQValueList list_d; + TQValueList::ConstIterator it_d; list_d = (*it_s).recordedPayments(); if(list_d.count() > 0) { @@ -332,26 +332,26 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Reports" << "\n"; s << "-------" << "\n"; - QValueList list_r = storage->reportList(); - QValueList::ConstIterator it_r; + TQValueList list_r = storage->reportList(); + TQValueList::ConstIterator it_r; for(it_r = list_r.begin(); it_r != list_r.end(); ++it_r) { s << " ID = " << (*it_r).id() << "\n"; s << " Name = " << (*it_r).name() << "\n"; } } -void MyMoneyStorageDump::dumpKVP(const QString& headline, QTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent) +void MyMoneyStorageDump::dumpKVP(const TQString& headline, TQTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent) { - QString ind; + TQString ind; ind.fill(' ', indent); s << ind << headline << "\n"; - QMap::const_iterator it; + TQMap::const_iterator it; for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it) { s << ind << " '" << it.key() << "' = '" << it.data() << "'\n"; } } -void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) +void MyMoneyStorageDump::dumpTransaction(TQTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) { s << " ID = " << it_t.id() << "\n"; s << " Postdate = " << it_t.postDate().toString(Qt::ISODate) << "\n"; @@ -363,7 +363,7 @@ void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storag s << " Splits\n"; s << " ------\n"; - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = it_t.splits().begin(); it_s != it_t.splits().end(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Transaction = " << (*it_s).transactionId() << "\n"; @@ -403,11 +403,11 @@ void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storag s << "\n"; } -#define i18n QString +#define i18n TQString -const QString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE flag) const +const TQString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE flag) const { - QString rc; + TQString rc; switch(flag) { case MyMoneySplit::NotReconciled: @@ -430,7 +430,7 @@ const QString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE } #if 0 -void MyMoneyStorageDump::dumpPriceHistory(QTextStream& s, const equity_price_history history) +void MyMoneyStorageDump::dumpPriceHistory(TQTextStream& s, const equity_price_history history) { if(history.count() != 0) { s << " Price History:\n"; diff --git a/kmymoney2/mymoney/storage/mymoneystoragedump.h b/kmymoney2/mymoney/storage/mymoneystoragedump.h index e399cde..3f7f33a 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragedump.h +++ b/kmymoney2/mymoney/storage/mymoneystoragedump.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // Project Includes @@ -44,13 +44,13 @@ public: MyMoneyStorageDump(); ~MyMoneyStorageDump(); - void readStream(QDataStream& s, IMyMoneySerialize* storage); - void writeStream(QDataStream& s, IMyMoneySerialize* storage); + void readStream(TQDataStream& s, IMyMoneySerialize* storage); + void writeStream(TQDataStream& s, IMyMoneySerialize* storage); private: - void dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t); - void dumpKVP(const QString& headline, QTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent = 0); - const QString reconcileToString(MyMoneySplit::reconcileFlagE flag) const; + void dumpTransaction(TQTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t); + void dumpKVP(const TQString& headline, TQTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent = 0); + const TQString reconcileToString(MyMoneySplit::reconcileFlagE flag) const; }; #endif diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp index 97b4c55..34c9573 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp @@ -22,12 +22,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -52,60 +52,52 @@ //***************** THE CURRENT VERSION OF THE DATABASE LAYOUT **************** unsigned int MyMoneyDbDef::m_currentVersion = 6; -// subclass QSqlQuery for performance tracing +// subclass TQSqlQuery for performance tracing MyMoneySqlQuery::MyMoneySqlQuery (MyMoneyStorageSql* db) - : QSqlQuery (static_cast(db)) { + : TQSqlQuery (static_cast(db)) { m_db = db; } bool MyMoneySqlQuery::exec () { - TRACE(QString("start sql - %1").arg(lastQuery())); - bool rc = QSqlQuery::exec(); - QString msg("end sql\n%1\n***Query returned %2, row count %3"); - TRACE (msg.arg(QSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected())); - //DBG (QString("%1\n***Query returned %2, row count %3").arg(QSqlQuery::executedQuery()).arg(rc).arg(size())); + TRACE(TQString("start sql - %1").tqarg(lastQuery())); + bool rc = TQSqlQuery::exec(); + TQString msg("end sql\n%1\n***Query returned %2, row count %3"); + TRACE (msg.tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(numRowsAffected())); + //DBG (TQString("%1\n***Query returned %2, row count %3").tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(size())); return (rc); } -bool MyMoneySqlQuery::prepare ( const QString & query ) { +bool MyMoneySqlQuery::prepare ( const TQString & query ) { if (m_db->isSqlite3()) { - QString newQuery = query; - return (QSqlQuery::prepare (newQuery.replace("FOR UPDATE", ""))); + TQString newQuery = query; + return (TQSqlQuery::prepare (newQuery.tqreplace("FOR UPDATE", ""))); } - return (QSqlQuery::prepare (query)); + return (TQSqlQuery::prepare (query)); } //***************************************************************************** MyMoneyDbDrivers::MyMoneyDbDrivers () { - m_driverMap["QDB2"] = QString("IBM DB2"); - m_driverMap["QIBASE"] = QString("Borland Interbase"); - m_driverMap["QMYSQL3"] = QString("MySQL"); - m_driverMap["QOCI8"] = QString("Oracle Call Interface, version 8 and 9"); - m_driverMap["QODBC3"] = QString("Open Database Connectivity"); - m_driverMap["QPSQL7"] = QString("PostgreSQL v6.x and v7.x"); - m_driverMap["QTDS7"] = QString("Sybase Adaptive Server and Microsoft SQL Server"); -#if QT_VERSION < 0x040000 - m_driverMap["QSQLITE3"] = QString("SQLite Version 3"); -#else - m_driverMap["QSQLITE"] = QString("SQLite Version 3"); -#endif -} - -databaseTypeE MyMoneyDbDrivers::driverToType (const QString& driver) const { - if (driver == "QDB2") return(Db2); - else if (driver == "QIBASE") return(Interbase); - else if (driver == "QMYSQL3") return(Mysql); - else if (driver == "QOCI8") return(Oracle8); - else if (driver == "QODBC3") return(ODBC3); - else if (driver == "QPSQL7") return(Postgresql); - else if (driver == "QTDS7") return(Sybase); -#if QT_VERSION < 0x040000 - else if (driver == "QSQLITE3") return(Sqlite3); -#else - else if (driver == "QSQLITE") return(Sqlite3); -#endif - else throw new MYMONEYEXCEPTION (QString("Unknown database driver type").arg(driver)); + m_driverMap["TQDB2"] = TQString("IBM DB2"); + m_driverMap["TQIBASE"] = TQString("Borland Interbase"); + m_driverMap["TQMYSQL3"] = TQString("MySQL"); + m_driverMap["TQOCI8"] = TQString("Oracle Call Interface, version 8 and 9"); + m_driverMap["TQODBC3"] = TQString("Open Database Connectivity"); + m_driverMap["TQPSQL7"] = TQString("PostgreSQL v6.x and v7.x"); + m_driverMap["TQTDS7"] = TQString("Sybase Adaptive Server and Microsoft SQL Server"); + m_driverMap["TQSQLITE3"] = TQString("SQLite Version 3"); +} + +databaseTypeE MyMoneyDbDrivers::driverToType (const TQString& driver) const { + if (driver == "TQDB2") return(Db2); + else if (driver == "TQIBASE") return(Interbase); + else if (driver == "TQMYSQL3") return(Mysql); + else if (driver == "TQOCI8") return(Oracle8); + else if (driver == "TQODBC3") return(ODBC3); + else if (driver == "TQPSQL7") return(Postgresql); + else if (driver == "TQTDS7") return(Sybase); + else if (driver == "TQSQLITE3") return(Sqlite3); + else throw new MYMONEYEXCEPTION (TQString("Unknown database driver type").tqarg(driver)); } bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { @@ -122,11 +114,11 @@ bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { //************************ Constructor/Destructor ***************************** MyMoneyStorageSql::MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& url) - : QSqlDatabase (url.queryItem("driver"), QString("kmmdatabase")) { + : TQSqlDatabase (url.queryItem("driver"), TQString("kmmdatabase")) { DBG("*** Entering MyMoneyStorageSql::MyMoneyStorageSql"); m_dbVersion = 0; m_progressCallback = 0; - m_displayStatus = false; + m_displaytqStatus = false; m_storage = storage; m_storagePtr = dynamic_cast(storage); m_newDatabase = false; @@ -140,15 +132,15 @@ int MyMoneyStorageSql::open(const KURL& url, int openMode, bool clear) { DBG("*** Entering MyMoneyStorageSql::open"); try { int rc = 0; - QString driverName = url.queryItem("driver"); + TQString driverName = url.queryItem("driver"); m_dbType = m_drivers.driverToType(driverName); //get the input options - QStringList options = QStringList::split(',', url.queryItem("options")); - m_loadAll = options.contains("loadAll")/*|| m_mode == 0*/; - m_override = options.contains("override"); + TQStringList options = TQStringList::split(',', url.queryItem("options")); + m_loadAll = options.tqcontains("loadAll")/*|| m_mode == 0*/; + m_override = options.tqcontains("override"); // create the database connection - QString dbName = url.path().right(url.path().length() - 1); // remove separator slash + TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash setDatabaseName(dbName); setHostName(url.host()); setUserName(url.user()); @@ -156,7 +148,7 @@ try { switch (openMode) { case IO_ReadOnly: // OpenDatabase menu entry (or open last file) case IO_ReadWrite: // Save menu entry with database open - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { buildError(MyMoneySqlQuery(), __func__, "opening database"); rc = 1; } else { @@ -167,11 +159,11 @@ try { // Try to open the database. // If that fails, try to create the database, then try to open it again. m_newDatabase = true; - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { if (createDatabase(url) != 0) { rc = 1; } else { - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { buildError(MyMoneySqlQuery(), __func__, "opening new database"); rc = 1; } else { @@ -190,7 +182,7 @@ try { } break; default: - qFatal("%s", QString("%1 - unknown open mode %2").arg(__func__).arg(openMode).data()); + qFatal("%s", TQString("%1 - unknown open mode %2").tqarg(__func__).tqarg(openMode).data()); } if (rc != 0) return (rc); // bypass logon check if we are creating a database @@ -198,21 +190,21 @@ try { // check if the database is locked, if not lock it readFileInfo(); if (!m_logonUser.isEmpty() && (!m_override)) { - m_error = QString - (i18n("Database apparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) - .arg(m_logonUser) - .arg(m_logonAt.date().toString(Qt::ISODate)) - .arg(m_logonAt.time().toString("hh.mm.ss")); + m_error = TQString + (i18n("Database aptqparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) + .tqarg(m_logonUser) + .tqarg(m_logonAt.date().toString(Qt::ISODate)) + .tqarg(m_logonAt.time().toString("hh.mm.ss")); qDebug("%s", m_error.data()); close(false); rc = -1; } else { m_logonUser = url.user() + "@" + url.host(); - m_logonAt = QDateTime::currentDateTime(); + m_logonAt = TQDateTime::tqcurrentDateTime(); writeFileInfo(); } return(rc); -} catch (QString& s) { +} catch (TQString& s) { qDebug("%s",s.data()); return (1); } @@ -220,15 +212,15 @@ try { void MyMoneyStorageSql::close(bool logoff) { DBG("*** Entering MyMoneyStorageSql::close"); - if (QSqlDatabase::open()) { + if (TQSqlDatabase::open()) { if (logoff) { startCommitUnit(__func__); - m_logonUser = QString(); + m_logonUser = TQString(); writeFileInfo(); endCommitUnit(__func__); } - QSqlDatabase::close(); - QSqlDatabase::removeDatabase(this); + TQSqlDatabase::close(); + TQSqlDatabase::removeDatabase(this); } } @@ -237,32 +229,32 @@ int MyMoneyStorageSql::createDatabase (const KURL& url) { if (m_dbType == Sqlite3) return(0); // not needed for sqlite if (!m_dbType == Mysql) { m_error = - QString(i18n("Cannot currently create database for driver %1; please create manually")).arg(driverName()); + TQString(i18n("Cannot currently create database for driver %1; please create manually")).tqarg(driverName()); return (1); } // create the database (only works for mysql at present) - QString dbName = url.path().right(url.path().length() - 1); // remove separator slash - QSqlDatabase *maindb = QSqlDatabase::addDatabase(driverName()); + TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash + TQSqlDatabase *maindb = TQSqlDatabase::addDatabase(driverName()); maindb->setDatabaseName ("mysql"); maindb->setHostName (url.host()); maindb->setUserName (url.user()); maindb->setPassword (url.pass()); maindb->open(); - QSqlQuery qm(maindb); - QString qs = QString("CREATE DATABASE %1;").arg(dbName); + TQSqlQuery qm(maindb); + TQString qs = TQString("CREATE DATABASE %1;").tqarg(dbName); qm.prepare (qs); if (!qm.exec()) { - buildError (qm, __func__, QString(i18n("Error in create database %1; do you have create permissions?")).arg(dbName)); + buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).tqarg(dbName)); return (1); } - QSqlDatabase::removeDatabase (maindb); + TQSqlDatabase::removeDatabase (maindb); return (0); } int MyMoneyStorageSql::upgradeDb() { DBG("*** Entering MyMoneyStorageSql::upgradeDb"); - //signalProgress(0, 1, QObject::tr("Upgrading database...")); + //signalProgress(0, 1, TQObject::tr("Upgrading database...")); MyMoneySqlQuery q(this); q.prepare ("SELECT version FROM kmmFileInfo;"); if (!q.exec() || !q.next()) { @@ -272,7 +264,7 @@ int MyMoneyStorageSql::upgradeDb() { } else { m_dbVersion = m_db.currentVersion(); m_storage->setFileFixVersion(m_storage->currentFixVersion()); - QSqlQuery q(this); + TQSqlQuery q(this); q.prepare("UPDATE kmmFileInfo SET version = :version, \ fixLevel = :fixLevel;"); q.bindValue(":version", m_dbVersion); @@ -286,8 +278,8 @@ int MyMoneyStorageSql::upgradeDb() { } // prior to dbv6, 'version' format was 'dbversion.fixLevel+1' // as of dbv6, these are separate fields - QString version = q.value(0).toString(); - if (version.contains('.')) { + TQString version = q.value(0).toString(); + if (version.tqcontains('.')) { m_dbVersion = q.value(0).toString().section('.', 0, 0).toUInt(); m_storage->setFileFixVersion(q.value(0).toString().section('.', 1, 1).toUInt() - 1); } else { @@ -333,8 +325,8 @@ int MyMoneyStorageSql::upgradeDb() { } } // write updated version to DB - //setVersion(QString("%1.%2").arg(m_dbVersion).arg(m_minorVersion)); - q.prepare (QString("UPDATE kmmFileInfo SET version = :version;")); + //setVersion(TQString("%1.%2").tqarg(m_dbVersion).tqarg(m_minorVersion)); + q.prepare (TQString("UPDATE kmmFileInfo SET version = :version;")); q.bindValue(":version", m_dbVersion); if (!q.exec()) { buildError (q, __func__, "Error updating db version"); @@ -346,8 +338,8 @@ int MyMoneyStorageSql::upgradeDb() { // SF bug 2779291 // check whether a column appears in a table already; if not, add it bool MyMoneyStorageSql::addColumn - (const QString& table, const QString& col, - const QString& after) + (const TQString& table, const TQString& col, + const TQString& after) { MyMoneyDbTable t = m_db.m_tables[table]; MyMoneyDbTable::field_iterator ft; @@ -363,20 +355,20 @@ bool MyMoneyStorageSql::addColumn bool MyMoneyStorageSql::addColumn (const MyMoneyDbTable& t, const MyMoneyDbColumn& c, - const QString& after){ + const TQString& after){ if ((m_dbType == Sqlite3) && (!after.isEmpty())) qFatal("sqlite doesn't support 'AFTER'; use sqliteAlterTable"); - if (record(t.name()).contains(c.name())) + if (record(t.name()).tqcontains(c.name())) return (true); - QSqlQuery q(this); - QString afterString = ";"; + TQSqlQuery q(this); + TQString afterString = ";"; if (!after.isEmpty()) - afterString = QString("AFTER %1;").arg(after); + afterString = TQString("AFTER %1;").tqarg(after); q.prepare("ALTER TABLE " + t.name() + " ADD COLUMN " + c.generateDDL(m_dbType) + afterString); if (!q.exec()) { buildError (q, __func__, - QString("Error adding column %1 to table %2").arg(c.name()).arg(t.name())); + TQString("Error adding column %1 to table %2").tqarg(c.name()).tqarg(t.name())); return (false); } return (true); @@ -384,23 +376,23 @@ bool MyMoneyStorageSql::addColumn // analogous to above bool MyMoneyStorageSql::dropColumn - (const QString& table, const QString& col) + (const TQString& table, const TQString& col) { return (dropColumn(m_db.m_tables[table], col)); } bool MyMoneyStorageSql::dropColumn - (const MyMoneyDbTable& t, const QString& col){ + (const MyMoneyDbTable& t, const TQString& col){ if (m_dbType == Sqlite3) qFatal("sqlite doesn't support 'DROP COLUMN'; use sqliteAlterTable"); - if (!record(t.name()).contains(col)) + if (!record(t.name()).tqcontains(col)) return (true); - QSqlQuery q(this); + TQSqlQuery q(this); q.prepare("ALTER TABLE " + t.name() + " DROP COLUMN " + col + ";"); if (!q.exec()) { buildError (q, __func__, - QString("Error dropping column %1 from table %2").arg(col).arg(t.name())); + TQString("Error dropping column %1 from table %2").tqarg(col).tqarg(t.name())); return (false); } return (true); @@ -434,9 +426,9 @@ int MyMoneyStorageSql::upgradeToV1() { buildError (q, __func__, "Error priming kmmSplits.postDate"); return (1); } - QMap tids; + TQMap tids; while (q.next()) tids[q.value(0).toString()] = q.value(1).toDateTime(); - QMap::ConstIterator it; + TQMap::ConstIterator it; for (it = tids.begin(); it != tids.end(); ++it) { q.prepare ("UPDATE kmmSplits SET postDate=:postDate WHERE transactionId = :id;"); q.bindValue(":postDate", it.data().toString(Qt::ISODate)); @@ -447,7 +439,7 @@ int MyMoneyStorageSql::upgradeToV1() { } } // add index to kmmKeyValuePairs to (kvpType,kvpId) - QStringList list; + TQStringList list; list << "kvpType" << "kvpId"; q.prepare (MyMoneyDbIndex("kmmKeyValuePairs", "kmmKVPtype_id", list, false).generateDDL(m_dbType) + ";"); if (!q.exec()) { @@ -519,18 +511,18 @@ int MyMoneyStorageSql::upgradeToV1() { buildError (q, __func__, "Error retrieving splits for transaction counting"); return(1); } - QString lastAcc, lastTx; + TQString lastAcc, lastTx; while (q.next()) { - QString thisAcc = q.value(0).toCString(); - QString thisTx = q.value(1).toCString(); + TQString thisAcc = q.value(0).toCString(); + TQString thisTx = q.value(1).toCString(); if ((thisAcc != lastAcc) || (thisTx != lastTx)) ++m_transactionCountMap[thisAcc]; lastAcc = thisAcc; lastTx = thisTx; } - QMap::ConstIterator itm; + TQMap::ConstIterator itm; q.prepare("UPDATE kmmAccounts SET transactionCount = :txCount WHERE id = :id;"); for (itm = m_transactionCountMap.begin(); itm != m_transactionCountMap.end(); ++itm) { - q.bindValue (":txCount", QString::number(itm.data())); + q.bindValue (":txCount", TQString::number(itm.data())); q.bindValue (":id", itm.key()); if (!q.exec()) { buildError(q, __func__, "Error updating transaction count"); @@ -606,7 +598,7 @@ int MyMoneyStorageSql::upgradeToV4() { DBG("*** Entering MyMoneyStorageSql::upgradeToV4"); startCommitUnit(__func__); MyMoneySqlQuery q(this); - QStringList list; + TQStringList list; list << "transactionId" << "splitId"; q.prepare (MyMoneyDbIndex("kmmSplits", "kmmTx_Split", list, false).generateDDL(m_dbType) + ";"); if (!q.exec()) { @@ -664,8 +656,8 @@ int MyMoneyStorageSql::upgradeToV6() { return (1); // upgrade Mysql to InnoDB transaction-safe engine if (m_dbType == Mysql) { - for (QMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { - q.prepare(QString("ALTER TABLE %1 ENGINE = InnoDB;").arg(tt.data().name())); + for (TQMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { + q.prepare(TQString("ALTER TABLE %1 ENGINE = InnoDB;").tqarg(tt.data().name())); if (!q.exec()) { buildError (q, __func__, "Error updating to InnoDB"); return (1); @@ -678,7 +670,7 @@ int MyMoneyStorageSql::upgradeToV6() { return(1); // read and write reports to get ids inserted readFileInfo(); - QMap reportList = + TQMap reportList = fetchReports(); // the V5 database allowed lots of duplicate reports with no // way to distinguish between them. The fetchReports call @@ -690,7 +682,7 @@ int MyMoneyStorageSql::upgradeToV6() { return (1); } unsigned long long hiReportId = 0; - QMap::const_iterator it_r; + TQMap::const_iterator it_r; for(it_r = reportList.begin(); it_r != reportList.end(); ++it_r) { MyMoneyReport r = *it_r; hiReportId = calcHighId(hiReportId, r.id()); @@ -719,22 +711,22 @@ int MyMoneyStorageSql::upgradeToV6() { statement. It should enable us to drop a primary key, and drop columns */ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) { DBG("*** Entering MyMoneyStorageSql::sqliteAlterTable"); - QString tempTableName = t.name(); - tempTableName.replace("kmm", "tmp"); - QSqlQuery q(this); - q.prepare (QString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";")); + TQString tempTableName = t.name(); + tempTableName.tqreplace("kmm", "tmp"); + TQSqlQuery q(this); + q.prepare (TQString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error renaming table"); return false; } createTable(t); - q.prepare (QString("INSERT INTO " + t.name() + " (" + t.columnList() + + q.prepare (TQString("INSERT INTO " + t.name() + " (" + t.columnList() + ") SELECT " + t.columnList() + " FROM " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error inserting into new table"); return false; } - q.prepare (QString("DROP TABLE " + tempTableName + ";")); + q.prepare (TQString("DROP TABLE " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error dropping old table"); return false; @@ -742,10 +734,10 @@ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) { return true; } -long unsigned MyMoneyStorageSql::getRecCount (const QString& table) const { +long unsigned MyMoneyStorageSql::getRecCount (const TQString& table) const { DBG("*** Entering MyMoneyStorageSql::getRecCount"); MyMoneySqlQuery q(const_cast (this)); - q.prepare(QString("SELECT COUNT(*) FROM %1;").arg(table)); + q.prepare(TQString("SELECT COUNT(*) FROM %1;").tqarg(table)); if ((!q.exec()) || (!q.next())) { buildError (q, __func__, "error retrieving record count"); qFatal("Error retrieving record count"); // definitely shouldn't happen @@ -758,20 +750,20 @@ int MyMoneyStorageSql::createTables () { // check tables, create if required // convert everything to lower case, since SQL standard is case insensitive // table and column names (when not delimited), but some DBMSs disagree. - QStringList lowerTables = tables(QSql::AllTables); - for (QStringList::iterator i = lowerTables.begin(); i != lowerTables.end(); ++i) { + TQStringList lowerTables = tables(TQSql::AllTables); + for (TQStringList::iterator i = lowerTables.begin(); i != lowerTables.end(); ++i) { (*i) = (*i).lower(); } - for (QMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { - if (!lowerTables.contains(tt.key().lower())) createTable (tt.data()); + for (TQMapConstIterator tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { + if (!lowerTables.tqcontains(tt.key().lower())) createTable (tt.data()); } MyMoneySqlQuery q(this); - for (QMapConstIterator tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) { - if (!lowerTables.contains(tt.key().lower())) { + for (TQMapConstIterator tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) { + if (!lowerTables.tqcontains(tt.key().lower())) { q.prepare (tt.data().createString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("creating view %1").arg(tt.key()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").tqarg(tt.key()))); } } @@ -784,22 +776,22 @@ int MyMoneyStorageSql::createTables () { void MyMoneyStorageSql::createTable (const MyMoneyDbTable& t) { DBG("*** Entering MyMoneyStorageSql::createTable"); // create the tables - QStringList ql = QStringList::split('\n', t.generateCreateSQL(m_dbType)); + TQStringList ql = TQStringList::split('\n', t.generateCreateSQL(m_dbType)); MyMoneySqlQuery q(this); for (unsigned int i = 0; i < ql.count(); ++i) { q.prepare (ql[i]); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("creating table/index %1").arg(t.name()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating table/index %1").tqarg(t.name()))); } } int MyMoneyStorageSql::isEmpty () { DBG("*** Entering MyMoneyStorageSql::isEmpty"); // check all tables are empty - QMapConstIterator tt = m_db.tableBegin(); + TQMapConstIterator tt = m_db.tableBegin(); int recordCount = 0; MyMoneySqlQuery q(this); while ((tt != m_db.tableEnd()) && (recordCount == 0)) { - q.prepare (QString("select count(*) from %1;").arg((*tt).name())); + q.prepare (TQString("select count(*) from %1;").tqarg((*tt).name())); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "getting record count")); if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving record count")); recordCount += q.value(0).toInt(); @@ -816,11 +808,11 @@ int MyMoneyStorageSql::isEmpty () { void MyMoneyStorageSql::clean() { DBG("*** Entering MyMoneyStorageSql::clean"); // delete all existing records - QMapConstIterator it = m_db.tableBegin(); + TQMapConstIterator it = m_db.tableBegin(); MyMoneySqlQuery q(this); while (it != m_db.tableEnd()) { - q.prepare(QString("DELETE from %1;").arg(it.key())); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("cleaning database"))); + q.prepare(TQString("DELETE from %1;").tqarg(it.key())); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("cleaning database"))); ++it; } } @@ -829,15 +821,15 @@ void MyMoneyStorageSql::clean() { bool MyMoneyStorageSql::readFile(void) { DBG("*** Entering MyMoneyStorageSql::readFile"); - m_displayStatus = true; + m_displaytqStatus = true; try { readFileInfo(); readInstitutions(); if (m_loadAll) { readPayees(); } else { - QValueList user; - user.append(QString("USER")); + TQValueList user; + user.append(TQString("USER")); readPayees(user); } //TRACE("done payees"); @@ -868,10 +860,10 @@ bool MyMoneyStorageSql::readFile(void) { // FIXME?? if (m_mode == 0) m_storage = NULL; // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displayStatus = false; + m_displaytqStatus = false; //MyMoneySqlQuery::traceOn(); return true; - } catch (QString& s) { + } catch (TQString& s) { return false; } } @@ -884,7 +876,7 @@ bool MyMoneyStorageSql::writeFile(void) { = m_securities = m_prices = m_currencies = m_schedules = m_reports = m_kvps = m_budgets = 0; m_hiIdInstitutions = m_hiIdPayees = m_hiIdAccounts = m_hiIdTransactions = m_hiIdSchedules = m_hiIdSecurities = m_hiIdReports = m_hiIdBudgets = 0; - m_displayStatus = true; + m_displaytqStatus = true; try{ startCommitUnit(__func__); writeInstitutions (); @@ -905,14 +897,14 @@ bool MyMoneyStorageSql::writeFile(void) { endCommitUnit(__func__); // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displayStatus = false; + m_displaytqStatus = false; return true; -} catch (QString& s) { +} catch (TQString& s) { return false; } } // --------------- SQL Transaction (commit unit) handling ----------------------------------- -void MyMoneyStorageSql::startCommitUnit (const QString& callingFunction) { +void MyMoneyStorageSql::startCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::startCommitUnit"); if (m_commitUnitStack.isEmpty()) { if (!transaction()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "starting commit unit")); @@ -920,16 +912,16 @@ void MyMoneyStorageSql::startCommitUnit (const QString& callingFunction) { m_commitUnitStack.push(callingFunction); } -bool MyMoneyStorageSql::endCommitUnit (const QString& callingFunction) { +bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::endCommitUnit"); // for now, we don't know if there were any changes made to the data so // we expect the data to have changed. This assumption causes some unnecessary - // repaints of the UI here and there, but for now it's ok. If we can determine + // tqrepaints of the UI here and there, but for now it's ok. If we can determine // that the commit() really changes the data, we can return that information // as value of this method. bool rc = true; if (callingFunction != m_commitUnitStack.top()) - qDebug("%s", QString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); m_commitUnitStack.pop(); if (m_commitUnitStack.isEmpty()) { if (!commit()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "ending commit unit")); @@ -937,10 +929,10 @@ bool MyMoneyStorageSql::endCommitUnit (const QString& callingFunction) { return rc; } -void MyMoneyStorageSql::cancelCommitUnit (const QString& callingFunction) { +void MyMoneyStorageSql::cancelCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::cancelCommitUnit"); if (callingFunction != m_commitUnitStack.top()) - qDebug("%s", QString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); if (m_commitUnitStack.isEmpty()) return; m_commitUnitStack.clear(); if (!rollback()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "cancelling commit unit")); @@ -967,20 +959,20 @@ void MyMoneyStorageSql::writeInstitutions() { // one way would be to build the lists when reading the db // unfortunately this object does not persist between read and write // it would also be nice if we could tell which objects had been updated since we read them in - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmInstitutions;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Institution list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList list = m_storage->institutionList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->institutionList(); + TQValueList::ConstIterator it; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmInstitutions"].updateString()); q2.prepare (m_db.m_tables["kmmInstitutions"].insertString()); signalProgress(0, list.count(), "Writing Institutions..."); for(it = list.begin(); it != list.end(); ++it) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeInstitution(*it, q); } else { @@ -990,7 +982,7 @@ void MyMoneyStorageSql::writeInstitutions() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); q.prepare("DELETE FROM kmmInstitutions WHERE id = :id"); while (it != dbList.end()) { q.bindValue(":id", (*it)); @@ -1030,7 +1022,7 @@ void MyMoneyStorageSql::removeInstitution(const MyMoneyInstitution& inst) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmInstitutions"].deleteString()); q.bindValue(":id", inst.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Institution"))); --m_institutions; writeFileInfo(); endCommitUnit(__func__); @@ -1046,7 +1038,7 @@ void MyMoneyStorageSql::writeInstitution(const MyMoneyInstitution& i, MyMoneySql q.bindValue(":addressCity", i.city()); q.bindValue(":addressZipcode", i.postcode()); q.bindValue(":telephone", i.telephone()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Institution"))); writeKeyValuePairs("OFXSETTINGS", i.id(), i.pairs()); m_hiIdInstitutions = calcHighId(m_hiIdInstitutions, i.id()); } @@ -1055,22 +1047,22 @@ void MyMoneyStorageSql::writeInstitution(const MyMoneyInstitution& i, MyMoneySql void MyMoneyStorageSql::writePayees() { DBG("*** Entering MyMoneyStorageSql::writePayees"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmPayees;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Payee list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list = m_storage->payeeList(); - MyMoneyPayee user(QString("USER"), m_storage->user()); + TQValueList list = m_storage->payeeList(); + MyMoneyPayee user(TQString("USER"), m_storage->user()); list.prepend(user); signalProgress(0, list.count(), "Writing Payees..."); MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmPayees"].updateString()); q2.prepare (m_db.m_tables["kmmPayees"].insertString()); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; for(it = list.begin(); it != list.end(); ++it) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writePayee(*it, q); } else { @@ -1080,7 +1072,7 @@ void MyMoneyStorageSql::writePayees() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); q.prepare(m_db.m_tables["kmmPayees"].deleteString()); while (it != dbList.end()) { q.bindValue(":id", (*it)); @@ -1128,7 +1120,7 @@ void MyMoneyStorageSql::removePayee(const MyMoneyPayee& payee) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmPayees"].deleteString()); q.bindValue(":id", payee.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Payee"))); --m_payees; writeFileInfo(); endCommitUnit(__func__); @@ -1152,13 +1144,13 @@ void MyMoneyStorageSql::writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bo q.bindValue(":notes", p.notes()); q.bindValue(":defaultAccountId", p.defaultAccountId()); bool ignoreCase; - QString matchKeys; + TQString matchKeys; MyMoneyPayee::payeeMatchType type = p.matchData(ignoreCase, matchKeys); q.bindValue(":matchData", static_cast(type)); if (ignoreCase) q.bindValue(":matchIgnoreCase", "Y"); else q.bindValue(":matchIgnoreCase", "N"); q.bindValue(":matchKeys", matchKeys); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("writing Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("writing Payee"))); if (!isUserInfo) m_hiIdPayees = calcHighId(m_hiIdPayees, p.id()); } @@ -1166,15 +1158,15 @@ void MyMoneyStorageSql::writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bo void MyMoneyStorageSql::writeAccounts() { DBG("*** Entering MyMoneyStorageSql::writeAccounts"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmAccounts;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Account list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list; + TQValueList list; m_storage->accountList(list); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; signalProgress(0, list.count(), "Writing Accounts..."); if (dbList.isEmpty()) { // new table, insert standard accounts q.prepare (m_db.m_tables["kmmAccounts"].insertString()); @@ -1216,7 +1208,7 @@ void MyMoneyStorageSql::writeAccounts() { MyMoneyAccount acc_q; acc_q.setAccountType(MyMoneyAccount::Equity); acc_q.setName("Equity"); - MyMoneyAccount equity(STD_ACC_EQUITY, acc_q); + MyMoneyAccount equity(STD_ACC_ETQUITY, acc_q); writeAccount(asset, q); ++m_accounts; writeAccount(expense, q); ++m_accounts; @@ -1232,7 +1224,7 @@ void MyMoneyStorageSql::writeAccounts() { // Update the accounts that exist; insert the ones that do not. for(it = list.begin(); it != list.end(); ++it, ++i) { m_transactionCountMap[(*it).id()] = m_storagePtr->transactionCount((*it).id()); - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeAccount(*it, q); } else { @@ -1243,7 +1235,7 @@ void MyMoneyStorageSql::writeAccounts() { // Delete the accounts that are in the db but no longer in memory. if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); q.prepare("DELETE FROM kmmAccounts WHERE id = :id"); while (it != dbList.end()) { if (!m_storagePtr->isStandardAccount(*it)) { @@ -1288,7 +1280,7 @@ void MyMoneyStorageSql::removeAccount(const MyMoneyAccount& acc) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmAccounts"].deleteString()); q.bindValue(":id", acc.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Account"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Account"))); --m_accounts; writeFileInfo(); endCommitUnit(__func__); @@ -1296,20 +1288,20 @@ void MyMoneyStorageSql::removeAccount(const MyMoneyAccount& acc) { void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeAccount"); - //MyMoneyMoney balance = m_storagePtr->balance(acc.id(), QDate()); + //MyMoneyMoney balance = m_storagePtr->balance(acc.id(), TQDate()); q.bindValue(":id", acc.id()); q.bindValue(":institutionId", acc.institutionId()); - q.bindValue(":parentId", acc.parentAccountId()); - if (acc.lastReconciliationDate() == QDate()) + q.bindValue(":tqparentId", acc.tqparentAccountId()); + if (acc.lastReconciliationDate() == TQDate()) q.bindValue(":lastReconciled", acc.lastReconciliationDate()); else - q.bindValue(":lastReconciled", acc.lastReconciliationDate().toString(Qt::ISODate)); + q.bindValue(":lastReconciled", TQString(acc.lastReconciliationDate().toString(Qt::ISODate))); q.bindValue(":lastModified", acc.lastModified()); - if (acc.openingDate() == QDate()) + if (acc.openingDate() == TQDate()) q.bindValue(":openingDate", acc.openingDate()); else - q.bindValue(":openingDate", acc.openingDate().toString(Qt::ISODate)); + q.bindValue(":openingDate", TQString(acc.openingDate().toString(Qt::ISODate))); q.bindValue(":accountNumber", acc.number()); q.bindValue(":accountType", acc.accountType()); @@ -1330,7 +1322,7 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& //FIXME: Using exceptions for branching always feels like a kludge. // Look for a better way. TRY - MyMoneyMoney bal = m_storagePtr->balance(acc.id(), QDate()); + MyMoneyMoney bal = m_storagePtr->balance(acc.id(), TQDate()); q.bindValue(":balance", bal.toString()); q.bindValue(":balanceFormatted", bal.formatMoney("", -1, false)); @@ -1341,8 +1333,8 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& acc.balance().formatMoney("", -1, false)); ECATCH - q.bindValue(":transactionCount", Q_ULLONG(m_transactionCountMap[acc.id()])); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Account"))); + q.bindValue(":transactionCount", TQ_ULLONG(m_transactionCountMap[acc.id()])); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Account"))); //Add in Key-Value Pairs for accounts. //MMAccount inherits from KVPContainer AND has a KVPContainer member @@ -1356,7 +1348,7 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& void MyMoneyStorageSql::writeTransactions() { DBG("*** Entering MyMoneyStorageSql::writeTransactions"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmTransactions WHERE txType = 'N';"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Transaction list")); @@ -1364,16 +1356,16 @@ void MyMoneyStorageSql::writeTransactions() { MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList list; + TQValueList list; m_storage->transactionList(list, filter); signalProgress(0, list.count(), "Writing Transactions..."); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; int i = 0; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmTransactions"].updateString()); q2.prepare (m_db.m_tables["kmmTransactions"].insertString()); for(it = list.begin(); it != list.end(); ++it, ++i) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeTransaction((*it).id(), *it, q, "N"); } else { @@ -1383,7 +1375,7 @@ void MyMoneyStorageSql::writeTransactions() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { deleteTransaction(*it); ++it; @@ -1400,7 +1392,7 @@ void MyMoneyStorageSql::addTransaction (const MyMoneyTransaction& tx) { writeTransaction(tx.id(), tx, q, "N"); ++m_transactions; // for each split account, update lastMod date, balance, txCount - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { //MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); @@ -1421,14 +1413,14 @@ void MyMoneyStorageSql::modifyTransaction (const MyMoneyTransaction& tx) { q.bindValue(":txId", tx.id()); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving old splits")); while (q.next()) { - QString id = q.value(0).toCString(); + TQString id = q.value(0).toCString(); --m_transactionCountMap[id]; } // add the transaction and splits q.prepare (m_db.m_tables["kmmTransactions"].updateString()); writeTransaction(tx.id(), tx, q, "N"); // for each split account, update lastMod date, balance, txCount - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { //MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); @@ -1448,7 +1440,7 @@ void MyMoneyStorageSql::removeTransaction(const MyMoneyTransaction& tx) { --m_transactions; // for each split account, update lastMod date, balance, txCount - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); --m_transactionCountMap[acc.id()]; @@ -1459,7 +1451,7 @@ void MyMoneyStorageSql::removeTransaction(const MyMoneyTransaction& tx) { endCommitUnit(__func__); } -void MyMoneyStorageSql::deleteTransaction(const QString& id) { +void MyMoneyStorageSql::deleteTransaction(const TQString& id) { DBG("*** Entering MyMoneyStorageSql::deleteTransaction"); MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmSplits WHERE transactionId = :transactionId;"); @@ -1477,19 +1469,19 @@ void MyMoneyStorageSql::deleteTransaction(const QString& id) { if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Transaction")); } -void MyMoneyStorageSql::writeTransaction(const QString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const QString& type) { +void MyMoneyStorageSql::writeTransaction(const TQString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const TQString& type) { DBG("*** Entering MyMoneyStorageSql::writeTransaction"); q.bindValue(":id", txId); q.bindValue(":txType", type); - q.bindValue(":postDate", tx.postDate().toString(Qt::ISODate)); + q.bindValue(":postDate", TQString(tx.postDate().toString(Qt::ISODate))); q.bindValue(":memo", tx.memo()); - q.bindValue(":entryDate", tx.entryDate().toString(Qt::ISODate)); + q.bindValue(":entryDate", TQString(tx.entryDate().toString(Qt::ISODate))); q.bindValue(":currencyId", tx.commodity()); q.bindValue(":bankId", tx.bankID()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Transaction"))); m_txPostDate = tx.postDate(); // FIXME: TEMP till Tom puts date in split object - QValueList splitList = tx.splits(); + TQValueList splitList = tx.splits(); writeSplits(txId, type, splitList); //Add in Key-Value Pairs for transactions. @@ -1498,23 +1490,23 @@ void MyMoneyStorageSql::writeTransaction(const QString& txId, const MyMoneyTrans m_hiIdTransactions = calcHighId(m_hiIdTransactions, tx.id()); } -void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, const QValueList& splitList) { +void MyMoneyStorageSql::writeSplits(const TQString& txId, const TQString& type, const TQValueList& splitList) { DBG("*** Entering MyMoneyStorageSql::writeSplits"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT splitId FROM kmmSplits where transactionId = :id;"); q.bindValue(":id", txId); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Split list")); while (q.next()) dbList.append(q.value(0).toUInt()); - QValueList::const_iterator it; + TQValueList::const_iterator it; unsigned int i; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmSplits"].updateString()); q2.prepare (m_db.m_tables["kmmSplits"].insertString()); for(it = splitList.begin(), i = 0; it != splitList.end(); ++it, ++i) { - if (dbList.contains(i)) { + if (dbList.tqcontains(i)) { dbList.remove (i); writeSplit(txId, (*it), type, i, q); } else { @@ -1525,7 +1517,7 @@ void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, co if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmSplits WHERE transactionId = :txId AND splitId = :splitId"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":txId", txId); q.bindValue(":splitId", *it); @@ -1535,62 +1527,62 @@ void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, co } } -void MyMoneyStorageSql::writeSplit(const QString& txId, const MyMoneySplit& split, - const QString& type, const int splitId, MyMoneySqlQuery& q) { +void MyMoneyStorageSql::writeSplit(const TQString& txId, const MyMoneySplit& split, + const TQString& type, const int splitId, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeSplit"); q.bindValue(":transactionId", txId); q.bindValue(":txType", type); q.bindValue(":splitId", splitId); q.bindValue(":payeeId", split.payeeId()); - if (split.reconcileDate() == QDate()) + if (split.reconcileDate() == TQDate()) q.bindValue(":reconcileDate", split.reconcileDate()); else - q.bindValue(":reconcileDate", split.reconcileDate().toString(Qt::ISODate)); + q.bindValue(":reconcileDate", TQString(split.reconcileDate().toString(Qt::ISODate))); q.bindValue(":action", split.action()); q.bindValue(":reconcileFlag", split.reconcileFlag()); q.bindValue(":value", split.value().toString()); q.bindValue(":valueFormatted", split.value() .formatMoney("", -1, false) - .replace(QChar(','), QChar('.'))); + .tqreplace(TQChar(','), TQChar('.'))); q.bindValue(":shares", split.shares().toString()); MyMoneyAccount acc = m_storagePtr->account(split.accountId()); MyMoneySecurity sec = m_storagePtr->security(acc.currencyId()); q.bindValue(":sharesFormatted", split.shares(). formatMoney("", MyMoneyMoney::denomToPrec(sec.smallestAccountFraction()), false). - replace(QChar(','), QChar('.'))); + tqreplace(TQChar(','), TQChar('.'))); MyMoneyMoney price = split.actualPrice(); if (!price.isZero()) { q.bindValue(":price", price.toString()); q.bindValue(":priceFormatted", price.formatMoney ("", KMyMoneySettings::pricePrecision(), false) - .replace(QChar(','), QChar('.'))); + .tqreplace(TQChar(','), TQChar('.'))); } else { - q.bindValue(":price", QString()); - q.bindValue(":priceFormatted", QString()); + q.bindValue(":price", TQString()); + q.bindValue(":priceFormatted", TQString()); } q.bindValue(":memo", split.memo()); q.bindValue(":accountId", split.accountId()); q.bindValue(":checkNumber", split.number()); q.bindValue(":postDate", m_txPostDate.toString(Qt::ISODate)); // FIXME: when Tom puts date into split object q.bindValue(":bankId", split.bankID()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Split"))); - deleteKeyValuePairs("SPLIT", txId + QString::number(splitId)); - writeKeyValuePairs("SPLIT", txId + QString::number(splitId), split.pairs()); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Split"))); + deleteKeyValuePairs("SPLIT", txId + TQString::number(splitId)); + writeKeyValuePairs("SPLIT", txId + TQString::number(splitId), split.pairs()); } // **** Schedules **** void MyMoneyStorageSql::writeSchedules() { DBG("*** Entering MyMoneyStorageSql::writeSchedules"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmSchedules;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Schedule list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList list = m_storage->scheduleList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->scheduleList(); + TQValueList::ConstIterator it; MyMoneySqlQuery q2(this); //TODO: find a way to prepare the queries outside of the loop. writeSchedule() // modifies the query passed to it, so they have to be re-prepared every pass. @@ -1599,7 +1591,7 @@ void MyMoneyStorageSql::writeSchedules() { q.prepare (m_db.m_tables["kmmSchedules"].updateString()); q2.prepare (m_db.m_tables["kmmSchedules"].insertString()); bool insert = true; - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); insert = false; writeSchedule(*it, q, insert); @@ -1610,7 +1602,7 @@ void MyMoneyStorageSql::writeSchedules() { } if (!dbList.isEmpty()) { - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { deleteSchedule(*it); ++it; @@ -1648,7 +1640,7 @@ void MyMoneyStorageSql::removeSchedule(const MyMoneySchedule& sched) { endCommitUnit(__func__); } -void MyMoneyStorageSql::deleteSchedule (const QString& id) { +void MyMoneyStorageSql::deleteSchedule (const TQString& id) { DBG("*** Entering MyMoneyStorageSql::deleteSchedule"); deleteTransaction(id); MyMoneySqlQuery q(this); @@ -1673,8 +1665,8 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer q.bindValue(":occurenceString", sch.occurenceToString()); q.bindValue(":paymentType", sch.paymentType()); q.bindValue(":paymentTypeString", MyMoneySchedule::paymentMethodToString(sch.paymentType())); - q.bindValue(":startDate", sch.startDate().toString(Qt::ISODate)); - q.bindValue(":endDate", sch.endDate().toString(Qt::ISODate)); + q.bindValue(":startDate", TQString(sch.startDate().toString(Qt::ISODate))); + q.bindValue(":endDate", TQString(sch.endDate().toString(Qt::ISODate))); if (sch.isFixed()) { q.bindValue(":fixed", "Y"); } else { @@ -1686,24 +1678,24 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer q.bindValue(":autoEnter", "N"); } q.bindValue(":lastPayment", sch.lastPayment()); - q.bindValue(":nextPaymentDue", sch.nextDueDate().toString(Qt::ISODate)); + q.bindValue(":nextPaymentDue", TQString(sch.nextDueDate().toString(Qt::ISODate))); q.bindValue(":weekendOption", sch.weekendOption()); q.bindValue(":weekendOptionString", MyMoneySchedule::weekendOptionToString(sch.weekendOption())); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Schedules"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Schedules"))); //store the payment history for this scheduled task. //easiest way is to delete all and re-insert; it's not a high use table q.prepare("DELETE FROM kmmSchedulePaymentHistory WHERE schedId = :id;"); q.bindValue(":id", sch.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Schedule Payment History"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Schedule Payment History"))); q.prepare (m_db.m_tables["kmmSchedulePaymentHistory"].insertString()); - QValueList payments = sch.recordedPayments(); - QValueList::ConstIterator it; + TQValueList payments = sch.recordedPayments(); + TQValueList::ConstIterator it; for (it=payments.begin(); it!=payments.end(); ++it) { q.bindValue(":schedId", sch.id()); - q.bindValue(":payDate", (*it).toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Schedule Payment History"))); + q.bindValue(":payDate", TQString((*it).toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Schedule Payment History"))); } //store the transaction data for this task. @@ -1726,19 +1718,19 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer void MyMoneyStorageSql::writeSecurities() { DBG("*** Entering MyMoneyStorageSql::writeSecurities"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT id FROM kmmSecurities;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building security list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList securityList = m_storage->securityList(); + const TQValueList securityList = m_storage->securityList(); signalProgress(0, securityList.count(), "Writing Securities..."); q.prepare (m_db.m_tables["kmmSecurities"].updateString()); q2.prepare (m_db.m_tables["kmmSecurities"].insertString()); - for(QValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { - if (dbList.contains((*it).id())) { + for(TQValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeSecurity((*it), q); } else { @@ -1750,7 +1742,7 @@ void MyMoneyStorageSql::writeSecurities() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmSecurities WHERE id = :id"); q2.prepare("DELETE FROM kmmPrices WHERE fromId = :id OR toId = :id"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":id", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Security")); @@ -1792,7 +1784,7 @@ void MyMoneyStorageSql::removeSecurity(const MyMoneySecurity& sec) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmSecurities"].deleteString()); q.bindValue(":id", sec.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Security"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Security"))); --m_securities; writeFileInfo(); endCommitUnit(__func__); @@ -1808,7 +1800,7 @@ void MyMoneyStorageSql::writeSecurity(const MyMoneySecurity& security, MyMoneySq q.bindValue(":smallestAccountFraction", security.smallestAccountFraction()); q.bindValue(":tradingCurrency", security.tradingCurrency()); q.bindValue(":tradingMarket", security.tradingMarket()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("writing Securities"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("writing Securities"))); //Add in Key-Value Pairs for security writeKeyValuePairs("SECURITY", security.id(), security.pairs()); @@ -1822,7 +1814,7 @@ void MyMoneyStorageSql::writePrices() { // easiest way is to delete all and re-insert MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmPrices"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Prices"))); m_prices = 0; const MyMoneyPriceList list = m_storage->priceList(); @@ -1849,13 +1841,13 @@ void MyMoneyStorageSql::addPrice(const MyMoneyPrice& p) { startCommitUnit(__func__); bool newRecord = false; MyMoneySqlQuery q(this); - QString s = m_db.m_tables["kmmPrices"].selectAllString(false); + TQString s = m_db.m_tables["kmmPrices"].selectAllString(false); s += " WHERE fromId = :fromId AND toId = :toId AND priceDate = :priceDate;"; q.prepare (s); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("finding Price"))); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("finding Price"))); if (q.next()) { q.prepare(m_db.m_tables["kmmPrices"].updateString()); } else { @@ -1865,12 +1857,12 @@ void MyMoneyStorageSql::addPrice(const MyMoneyPrice& p) { } q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - q.bindValue(":price", p.rate(QString()).toString()); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + q.bindValue(":price", p.rate(TQString()).toString()); q.bindValue(":priceFormatted", - p.rate(QString()).formatMoney("", KMyMoneySettings::pricePrecision())); + p.rate(TQString()).formatMoney("", KMyMoneySettings::pricePrecision())); q.bindValue(":priceSource", p.source()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Price"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Price"))); if (newRecord) writeFileInfo(); endCommitUnit(__func__); @@ -1883,8 +1875,8 @@ void MyMoneyStorageSql::removePrice(const MyMoneyPrice& p) { q.prepare (m_db.m_tables["kmmPrices"].deleteString()); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Price"))); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Price"))); --m_prices; writeFileInfo(); endCommitUnit(__func__); @@ -1896,30 +1888,30 @@ void MyMoneyStorageSql::writePrice(const MyMoneyPrice& p) { q.prepare (m_db.m_tables["kmmPrices"].insertString()); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - q.bindValue(":price", p.rate(QString()).toString()); - q.bindValue(":priceFormatted", p.rate(QString()).formatMoney("", 2)); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + q.bindValue(":price", p.rate(TQString()).toString()); + q.bindValue(":priceFormatted", p.rate(TQString()).formatMoney("", 2)); q.bindValue(":priceSource", p.source()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Prices"))); } // **** Currencies **** void MyMoneyStorageSql::writeCurrencies() { DBG("*** Entering MyMoneyStorageSql::writeCurrencies"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT ISOCode FROM kmmCurrencies;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Currency list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList currencyList = m_storage->currencyList(); + const TQValueList currencyList = m_storage->currencyList(); signalProgress(0, currencyList.count(), "Writing Currencies..."); q.prepare (m_db.m_tables["kmmCurrencies"].updateString()); q2.prepare (m_db.m_tables["kmmCurrencies"].insertString()); - for(QValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { - if (dbList.contains((*it).id())) { + for(TQValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeCurrency((*it), q); } else { @@ -1930,7 +1922,7 @@ void MyMoneyStorageSql::writeCurrencies() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmCurrencies WHERE ISOCode = :ISOCode"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":ISOCode", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Currency")); @@ -1966,7 +1958,7 @@ void MyMoneyStorageSql::removeCurrency(const MyMoneySecurity& sec) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmCurrencies"].deleteString()); q.bindValue(":ISOcode", sec.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Currency"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Currency"))); --m_currencies; writeFileInfo(); endCommitUnit(__func__); @@ -1980,35 +1972,35 @@ void MyMoneyStorageSql::writeCurrency(const MyMoneySecurity& currency, MyMoneySq q.bindValue(":typeString", MyMoneySecurity::securityTypeToString(currency.securityType())); // writing the symbol as three short ints is a PITA, but the // problem is that database drivers have incompatible ways of declaring UTF8 - QString symbol = currency.tradingSymbol() + " "; - q.bindValue(":symbol1", symbol.mid(0,1).unicode()->unicode()); - q.bindValue(":symbol2", symbol.mid(1,1).unicode()->unicode()); - q.bindValue(":symbol3", symbol.mid(2,1).unicode()->unicode()); + TQString symbol = currency.tradingSymbol() + " "; + q.bindValue(":symbol1", symbol.mid(0,1).tqunicode()->tqunicode()); + q.bindValue(":symbol2", symbol.mid(1,1).tqunicode()->tqunicode()); + q.bindValue(":symbol3", symbol.mid(2,1).tqunicode()->tqunicode()); q.bindValue(":symbolString", symbol); q.bindValue(":partsPerUnit", currency.partsPerUnit()); q.bindValue(":smallestCashFraction", currency.smallestCashFraction()); q.bindValue(":smallestAccountFraction", currency.smallestAccountFraction()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Currencies"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Currencies"))); } void MyMoneyStorageSql::writeReports() { DBG("*** Entering MyMoneyStorageSql::writeReports"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT id FROM kmmReportConfig;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Report list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list = m_storage->reportList(); + TQValueList list = m_storage->reportList(); signalProgress(0, list.count(), "Writing Reports..."); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; q.prepare (m_db.m_tables["kmmReportConfig"].updateString()); q2.prepare (m_db.m_tables["kmmReportConfig"].insertString()); for(it = list.begin(); it != list.end(); ++it){ - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeReport(*it, q); } else { @@ -2019,7 +2011,7 @@ void MyMoneyStorageSql::writeReports() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmReportConfig WHERE id = :id"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":id", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Report")); @@ -2055,7 +2047,7 @@ void MyMoneyStorageSql::removeReport(const MyMoneyReport& rep) { MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmReportConfig WHERE id = :id"); q.bindValue(":id", rep.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Report"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Report"))); --m_reports; writeFileInfo(); endCommitUnit(__func__); @@ -2063,34 +2055,34 @@ void MyMoneyStorageSql::removeReport(const MyMoneyReport& rep) { void MyMoneyStorageSql::writeReport (const MyMoneyReport& rep, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeReport"); - QDomDocument d; // create a dummy XML document - QDomElement e = d.createElement("REPORTS"); + TQDomDocument d; // create a dummy XML document + TQDomElement e = d.createElement("REPORTS"); d.appendChild (e); rep.writeXML(d, e); // write the XML to document q.bindValue(":id", rep.id()); q.bindValue(":name", rep.name()); q.bindValue(":XML", d.toString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Reports"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Reports"))); //m_hiIdReports = calcHighId(m_hiIdReports, rep.id()); } void MyMoneyStorageSql::writeBudgets() { DBG("*** Entering MyMoneyStorageSql::writeBudgets"); // first, get a list of what's on the database (see writeInstitutions) - QValueList dbList; + TQValueList dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT name FROM kmmBudgetConfig;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Budget list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList list = m_storage->budgetList(); + TQValueList list = m_storage->budgetList(); signalProgress(0, list.count(), "Writing Budgets..."); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; q.prepare (m_db.m_tables["kmmBudgetConfig"].updateString()); q2.prepare (m_db.m_tables["kmmBudgetConfig"].insertString()); for(it = list.begin(); it != list.end(); ++it){ - if (dbList.contains((*it).name())) { + if (dbList.tqcontains((*it).name())) { dbList.remove ((*it).name()); writeBudget(*it, q); } else { @@ -2101,7 +2093,7 @@ void MyMoneyStorageSql::writeBudgets() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmBudgetConfig WHERE id = :id"); - QValueList::const_iterator it = dbList.begin(); + TQValueList::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":name", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Budget")); @@ -2137,7 +2129,7 @@ void MyMoneyStorageSql::removeBudget(const MyMoneyBudget& bud) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmBudgetConfig"].deleteString()); q.bindValue(":id", bud.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Budget"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Budget"))); --m_budgets; writeFileInfo(); endCommitUnit(__func__); @@ -2145,15 +2137,15 @@ void MyMoneyStorageSql::removeBudget(const MyMoneyBudget& bud) { void MyMoneyStorageSql::writeBudget (const MyMoneyBudget& bud, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeBudget"); - QDomDocument d; // create a dummy XML document - QDomElement e = d.createElement("BUDGETS"); + TQDomDocument d; // create a dummy XML document + TQDomElement e = d.createElement("BUDGETS"); d.appendChild (e); bud.writeXML(d, e); // write the XML to document q.bindValue(":id", bud.id()); q.bindValue(":name", bud.name()); q.bindValue(":start", bud.budgetStart()); q.bindValue(":XML", d.toString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Budgets"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Budgets"))); } void MyMoneyStorageSql::writeFileInfo() { @@ -2165,7 +2157,7 @@ void MyMoneyStorageSql::writeFileInfo() { MyMoneySqlQuery q(this); q.prepare ("SELECT * FROM kmmFileInfo;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "checking fileinfo")); - QString qs; + TQString qs; if (q.next()) qs = m_db.m_tables["kmmFileInfo"].updateString(); else @@ -2173,9 +2165,9 @@ void MyMoneyStorageSql::writeFileInfo() { q.prepare(qs); q.bindValue(":version", m_dbVersion); q.bindValue(":fixLevel", m_storage->fileFixVersion()); - q.bindValue(":created", m_storage->creationDate().toString(Qt::ISODate)); + q.bindValue(":created", TQString(m_storage->creationDate().toString(Qt::ISODate))); //q.bindValue(":lastModified", m_storage->lastModificationDate().toString(Qt::ISODate)); - q.bindValue(":lastModified", QDate::currentDate().toString(Qt::ISODate)); + q.bindValue(":lastModified", TQString(TQDate::tqcurrentDate().toString(Qt::ISODate))); q.bindValue(":baseCurrency", m_storage->pairs()["kmm-baseCurrency"]); q.bindValue(":institutions", (unsigned long long) m_institutions); q.bindValue(":accounts", (unsigned long long) m_accounts); @@ -2189,8 +2181,8 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":reports", (unsigned long long) m_reports); q.bindValue(":kvps", (unsigned long long) m_kvps); q.bindValue(":budgets", (unsigned long long) m_budgets); - q.bindValue(":dateRangeStart", QDate()); - q.bindValue(":dateRangeEnd", QDate()); + q.bindValue(":dateRangeStart", TQDate()); + q.bindValue(":dateRangeEnd", TQDate()); //FIXME: This modifies all m_ used in this function. // Sometimes the memory has been updated. @@ -2217,19 +2209,19 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":updateInProgress", "N"); q.bindValue(":logonUser", m_logonUser); q.bindValue(":logonAt", m_logonAt.toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing FileInfo"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing FileInfo"))); } // **** Key/value pairs **** -void MyMoneyStorageSql::writeKeyValuePairs(const QString& kvpType, const QString& kvpId, const QMap& pairs) { +void MyMoneyStorageSql::writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap& pairs) { DBG("*** Entering MyMoneyStorageSql::writeKeyValuePairs"); - QMap::const_iterator it; + TQMap::const_iterator it; for(it = pairs.begin(); it != pairs.end(); ++it) { writeKeyValuePair (kvpType, kvpId, it.key(), it.data()); } } -void MyMoneyStorageSql::writeKeyValuePair (const QString& kvpType, const QString& kvpId, const QString& kvpKey, const QString& kvpData) { +void MyMoneyStorageSql::writeKeyValuePair (const TQString& kvpType, const TQString& kvpId, const TQString& kvpKey, const TQString& kvpData) { DBG("*** Entering MyMoneyStorageSql::writeKeyValuePair"); MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmKeyValuePairs"].insertString()); @@ -2237,17 +2229,17 @@ void MyMoneyStorageSql::writeKeyValuePair (const QString& kvpType, const QString q.bindValue(":kvpId", kvpId); q.bindValue(":kvpKey", kvpKey); q.bindValue(":kvpData", kvpData); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing KVP"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing KVP"))); ++m_kvps; } -void MyMoneyStorageSql::deleteKeyValuePairs (const QString& kvpType, const QString& kvpId) { +void MyMoneyStorageSql::deleteKeyValuePairs (const TQString& kvpType, const TQString& kvpId) { DBG("*** Entering MyMoneyStorageSql::deleteKeyValuePairs"); MyMoneySqlQuery q(this); q.prepare ("DELETE FROM kmmKeyValuePairs WHERE kvpType = :kvpType AND kvpId = :kvpId;"); q.bindValue(":kvpType", kvpType); q.bindValue(":kvpId", kvpId); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting kvp for %1 %2").arg(kvpType).arg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting kvp for %1 %2").tqarg(kvpType).tqarg(kvpId))); m_kvps -= q.numRowsAffected(); } @@ -2262,12 +2254,12 @@ void MyMoneyStorageSql::deleteKeyValuePairs (const QString& kvpType, const QStri void MyMoneyStorageSql::readFileInfo(void) { DBG("*** Entering MyMoneyStorageSql::readFileInfo"); - signalProgress(0, 18, QObject::tr("Loading file information...")); + signalProgress(0, 18, TQObject::tr("Loading file information...")); MyMoneyDbTable& t = m_db.m_tables["kmmFileInfo"]; MyMoneySqlQuery q(this); q.prepare (t.selectAllString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading FileInfo"))); - if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("retrieving FileInfo"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading FileInfo"))); + if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("retrieving FileInfo"))); MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; while (ft != t.end()) { @@ -2302,10 +2294,10 @@ void MyMoneyStorageSql::readFileInfo(void) { ++ft; ++i; signalProgress(i,0); } - m_storage->setPairs(readKeyValuePairs("STORAGE", QString("")).pairs()); + m_storage->setPairs(readKeyValuePairs("STORAGE", TQString("")).pairs()); } -/*void MyMoneyStorageSql::setVersion (const QString& version) { +/*void MyMoneyStorageSql::setVersion (const TQString& version) { DBG("*** Entering MyMoneyStorageSql::setVersion"); m_dbVersion = version.section('.', 0, 0).toUInt(); m_minorVersion = version.section('.', 1, 1).toUInt(); @@ -2318,31 +2310,31 @@ void MyMoneyStorageSql::readFileInfo(void) { void MyMoneyStorageSql::readInstitutions(void) { TRY - QMap iList = fetchInstitutions(); + TQMap iList = fetchInstitutions(); m_storage->loadInstitutions(iList); readFileInfo(); m_storage->loadInstitutionId(m_hiIdInstitutions); PASS } -const QMap MyMoneyStorageSql::fetchInstitutions (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchInstitutions (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readInstitutions"); - signalProgress(0, m_institutions, QObject::tr("Loading institutions...")); + signalProgress(0, m_institutions, TQObject::tr("Loading institutions...")); int progress = 0; - QMap iList; + TQMap iList; unsigned long lastId = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmInstitutions"]; MyMoneySqlQuery sq(const_cast (this)); sq.prepare ("SELECT id from kmmAccounts where institutionId = :id"); MyMoneySqlQuery q(const_cast (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " id = :id" + QString::number(i) + " OR"; + queryString += " id = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } if (forUpdate) @@ -2353,17 +2345,17 @@ const QMap MyMoneyStorageSql::fetchInstitutions (co q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Institution"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString iid; + TQString iid; MyMoneyInstitution inst; while (ft != t.end()) { CASE(id) iid = GETSTRING; @@ -2378,10 +2370,10 @@ const QMap MyMoneyStorageSql::fetchInstitutions (co } // get list of subaccounts sq.bindValue(":id", iid); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Institution AccountList"))); - QStringList aList; + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Institution AccountList"))); + TQStringList aList; while (sq.next()) aList.append(sq.value(0).toString()); - for (QStringList::ConstIterator it = aList.begin(); it != aList.end(); ++it) + for (TQStringList::ConstIterator it = aList.begin(); it != aList.end(); ++it) inst.addAccountId(*it); iList[iid] = MyMoneyInstitution(iid, inst); @@ -2394,18 +2386,18 @@ const QMap MyMoneyStorageSql::fetchInstitutions (co return iList; } -void MyMoneyStorageSql::readPayees (const QString& id) { +void MyMoneyStorageSql::readPayees (const TQString& id) { DBG("*** Entering MyMoneyStorageSql::readPayees"); - QValueList list; + TQValueList list; list.append(id); readPayees(list); } -void MyMoneyStorageSql::readPayees(const QValueList pid) { +void MyMoneyStorageSql::readPayees(const TQValueList pid) { DBG("*** Entering MyMoneyStorageSql::readPayees"); TRY - QStringList pidList; - qCopy(pid.begin(), pid.end(), qBackInserter(pidList)); + TQStringList pidList; + tqCopy(pid.begin(), pid.end(), qBackInserter(pidList)); m_storage->loadPayees(fetchPayees(pidList)); readFileInfo(); @@ -2416,15 +2408,15 @@ void MyMoneyStorageSql::readPayees(const QValueList pid) { // if (pid.isEmpty()) m_payeeListRead = true; } -const QMap MyMoneyStorageSql::fetchPayees (const QStringList& idList, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchPayees (const TQStringList& idList, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readPayees"); - if (m_displayStatus) { - signalProgress(0, m_payees, QObject::tr("Loading payees...")); + if (m_displaytqStatus) { + signalProgress(0, m_payees, TQObject::tr("Loading payees...")); } else { // if (m_payeeListRead) return; } int progress = 0; - QMap pList; + TQMap pList; //unsigned long lastId; const MyMoneyDbTable& t = m_db.m_tables["kmmPayees"]; MyMoneyDbTable::field_iterator payeeEnd = t.end(); @@ -2432,26 +2424,26 @@ const QMap MyMoneyStorageSql::fetchPayees (const QStringL if (idList.isEmpty()) { q.prepare (t.selectAllString()); } else { - QString whereClause = " where ("; - QString itemConnector = ""; - QStringList::ConstIterator it; + TQString whereClause = " where ("; + TQString itemConnector = ""; + TQStringList::ConstIterator it; for (it = idList.begin(); it != idList.end(); ++it) { - whereClause.append(QString("%1id = '%2'").arg(itemConnector).arg(*it)); + whereClause.append(TQString("%1id = '%2'").tqarg(itemConnector).tqarg(*it)); itemConnector = " or "; } whereClause += ")"; q.prepare (t.selectAllString(false) + whereClause); } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Payee"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString pid; - QString boolChar; + TQString pid; + TQString boolChar; MyMoneyPayee payee; unsigned int type; bool ignoreCase; - QString matchKeys; + TQString matchKeys; while (ft != payeeEnd) { CASE(id) pid = GETCSTRING; else CASE(name) payee.setName(GETSTRING); @@ -2476,48 +2468,48 @@ const QMap MyMoneyStorageSql::fetchPayees (const QStringL PASS } else { pList[pid] = MyMoneyPayee(pid, payee); - //unsigned long id = extractId(QString(pid)); + //unsigned long id = extractId(TQString(pid)); //if(id > lastId) // lastId = id; } - if (m_displayStatus) signalProgress(++progress, 0); + if (m_displaytqStatus) signalProgress(++progress, 0); } return pList; } -const QMap MyMoneyStorageSql::fetchAccounts (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchAccounts (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::fetchAccounts"); - signalProgress(0, m_accounts, QObject::tr("Loading accounts...")); + signalProgress(0, m_accounts, TQObject::tr("Loading accounts...")); int progress = 0; - QMap accList; - QStringList kvpAccountList; + TQMap accList; + TQStringList kvpAccountList; const MyMoneyDbTable& t = m_db.m_tables["kmmAccounts"]; MyMoneyDbTable::field_iterator accEnd = t.end(); MyMoneySqlQuery q(const_cast (this)); MyMoneySqlQuery sq(const_cast (this)); - QString childQueryString = "SELECT id, parentId FROM kmmAccounts WHERE "; - QString queryString (t.selectAllString(false)); + TQString childQueryString = "SELECT id, tqparentId FROM kmmAccounts WHERE "; + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { kvpAccountList = idList; queryString += " WHERE id IN ("; - childQueryString += " parentId IN ("; + childQueryString += " tqparentId IN ("; for (unsigned i = 0; i < idList.count(); ++i) { - queryString += " :id" + QString::number(i) + ", "; - childQueryString += ":id" + QString::number(i) + ", "; + queryString += " :id" + TQString::number(i) + ", "; + childQueryString += ":id" + TQString::number(i) + ", "; } queryString = queryString.left(queryString.length() - 2) + ")"; childQueryString = childQueryString.left(childQueryString.length() - 2) + ")"; } else { - childQueryString += " NOT parentId IS NULL"; + childQueryString += " NOT tqparentId IS NULL"; } queryString += " ORDER BY id"; - childQueryString += " ORDER BY parentid, id"; + childQueryString += " ORDER BY tqparentid, id"; if (forUpdate) { queryString += " FOR UPDATE"; @@ -2528,26 +2520,26 @@ const QMap MyMoneyStorageSql::fetchAccounts (const QStr sq.prepare (childQueryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); - sq.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); + sq.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Account"))); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading subAccountList"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Account"))); + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading subAccountList"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString aid; - QString balance; + TQString aid; + TQString balance; MyMoneyAccount acc; while (ft != accEnd) { CASE(id) aid = GETCSTRING; else CASE(institutionId) acc.setInstitutionId(GETCSTRING); - else CASE(parentId) acc.setParentAccountId(GETCSTRING); + else CASE(tqparentId) acc.setParentAccountId(GETCSTRING); else CASE(lastReconciled) acc.setLastReconciliationDate(GETDATE); else CASE(lastModified) acc.setLastModified(GETDATE); else CASE(openingDate) acc.setOpeningDate(GETDATE); @@ -2575,10 +2567,10 @@ const QMap MyMoneyStorageSql::fetchAccounts (const QStr signalProgress(++progress, 0); } - QMapIterator it_acc; - QMapIterator accListEnd = accList.end(); + TQMapIterator it_acc; + TQMapIterator accListEnd = accList.end(); while (sq.next()) { - it_acc = accList.find(sq.value(1).toString()); + it_acc = accList.tqfind(sq.value(1).toString()); if (it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) { while (sq.isValid() && it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) { @@ -2593,16 +2585,16 @@ const QMap MyMoneyStorageSql::fetchAccounts (const QStr // where it may be able to be done in O(n), if things are just right. // The operator[] call in the loop is the most expensive call in this function, according // to several profile runs. - QMap kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList); - QMap ::const_iterator kvp_end = kvpResult.end(); - for (QMap ::const_iterator it_kvp = kvpResult.begin(); + TQMap kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList); + TQMap ::const_iterator kvp_end = kvpResult.end(); + for (TQMap ::const_iterator it_kvp = kvpResult.begin(); it_kvp != kvp_end; ++it_kvp) { accList[it_kvp.key()].setPairs(it_kvp.data().pairs()); } kvpResult = readKeyValuePairs("ONLINEBANKING", kvpAccountList); kvp_end = kvpResult.end(); - for (QMap ::const_iterator it_kvp = kvpResult.begin(); + for (TQMap ::const_iterator it_kvp = kvpResult.begin(); it_kvp != kvp_end; ++it_kvp) { accList[it_kvp.key()].setOnlineBankingSettings(it_kvp.data()); } @@ -2615,15 +2607,15 @@ void MyMoneyStorageSql::readAccounts(void) { m_storage->loadAccountId(m_hiIdAccounts); } -const QMap MyMoneyStorageSql::fetchBalance(const QStringList& idList, const QDate& date) const { +const TQMap MyMoneyStorageSql::fetchBalance(const TQStringList& idList, const TQDate& date) const { - QMap returnValue; + TQMap returnValue; MyMoneySqlQuery q(const_cast (this)); - QString queryString = "SELECT action, shares, accountId, postDate " + TQString queryString = "SELECT action, shares, accountId, postDate " "FROM kmmSplits WHERE txType = 'N' AND accountId in ("; for (unsigned i = 0; i < idList.count(); ++i) { - queryString += " :id" + QString::number(i) + ", "; + queryString += " :id" + TQString::number(i) + ", "; } queryString = queryString.left(queryString.length() - 2) + " )"; @@ -2631,20 +2623,20 @@ const QMap MyMoneyStorageSql::fetchBalance(const QStringL // the <= operator misbehave when the date matches. To avoid this, add a day to the // requested date and use the < operator. if (date.isValid() && !date.isNull()) - queryString += QString(" AND postDate < '%1'").arg(date.addDays(1).toString(Qt::ISODate)); + queryString += TQString(" AND postDate < '%1'").tqarg(date.addDays(1).toString(Qt::ISODate)); DBG (queryString); q.prepare(queryString); - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); returnValue[*bindVal] = MyMoneyMoney(0); } if (!q.exec()) - throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("fetching balance"))); - QString id; - QString shares; - QString action; + throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("fetching balance"))); + TQString id; + TQString shares; + TQString action; while (q.next()) { id = q.value(2).toString(); shares = q.value(1).toString(); @@ -2657,7 +2649,7 @@ const QMap MyMoneyStorageSql::fetchBalance(const QStringL return returnValue; } -void MyMoneyStorageSql::readTransactions(const QString& tidList, const QString& dateClause) { +void MyMoneyStorageSql::readTransactions(const TQString& tidList, const TQString& dateClause) { TRY m_storage->loadTransactions(fetchTransactions(tidList, dateClause)); m_storage->loadTransactionId(m_hiIdTransactions); @@ -2671,13 +2663,13 @@ void MyMoneyStorageSql::readTransactions(const MyMoneyTransactionFilter& filter) PASS } -const QMap MyMoneyStorageSql::fetchTransactions (const QString& tidList, const QString& dateClause, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchTransactions (const TQString& tidList, const TQString& dateClause, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // if (m_transactionListRead) return; // all list already in memory - if (m_displayStatus) signalProgress(0, m_transactions, QObject::tr("Loading transactions...")); + if (m_displaytqStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions...")); int progress = 0; // m_payeeList.clear(); - QString whereClause; + TQString whereClause; whereClause = " WHERE txType = 'N' "; if (! tidList.isEmpty()) { whereClause += " AND id IN " + tidList; @@ -2686,7 +2678,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co const MyMoneyDbTable& t = m_db.m_tables["kmmTransactions"]; MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(false) + whereClause + " ORDER BY id;"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Transaction"))); const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"]; whereClause = " WHERE txType = 'N' "; if (! tidList.isEmpty()) { @@ -2694,11 +2686,11 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } if (!dateClause.isEmpty()) whereClause += " and " + dateClause; MyMoneySqlQuery qs(const_cast (this)); - QString splitQuery = ts.selectAllString(false) + whereClause + TQString splitQuery = ts.selectAllString(false) + whereClause + " ORDER BY transactionId, splitId;"; qs.prepare (splitQuery); if (!qs.exec()) throw new MYMONEYEXCEPTION(buildError (qs, __func__, "reading Splits")); - QString splitTxId = "ZZZ"; + TQString splitTxId = "ZZZ"; MyMoneySplit s; if (qs.next()) { splitTxId = qs.value(0).toString(); @@ -2706,12 +2698,12 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } else { splitTxId = "ZZZ"; } - QMap txMap; - QStringList txList; + TQMap txMap; + TQStringList txList; MyMoneyDbTable::field_iterator txEnd = t.end(); while (q.next()) { MyMoneyTransaction tx; - QString txId; + TQString txId; MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; while (ft != txEnd) { @@ -2749,14 +2741,14 @@ const QMap MyMoneyStorageSql::fetchTransactions (co txMap.insert(tx.uniqueSortKey(), tx); } } - QMap kvpMap = readKeyValuePairs("TRANSACTION", txList); - QMap tList; - QMapIterator txMapEnd = txMap.end(); - for (QMapIterator i = txMap.begin(); + TQMap kvpMap = readKeyValuePairs("TRANSACTION", txList); + TQMap tList; + TQMapIterator txMapEnd = txMap.end(); + for (TQMapIterator i = txMap.begin(); i != txMapEnd; ++i) { i.data().setPairs(kvpMap[i.data().id()].pairs()); - if (m_displayStatus) signalProgress(++progress, 0); + if (m_displaytqStatus) signalProgress(++progress, 0); } if ((tidList.isEmpty()) && (dateClause.isEmpty())) { @@ -2789,20 +2781,20 @@ int MyMoneyStorageSql::splitState(const MyMoneyTransactionFilter::stateOptionE& return rc; } -const QMap MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const { +const TQMap MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // analyze the filter // if (m_transactionListRead) return; // all list already in memory // if the filter is restricted to certain accounts/categories // check if we already have them all in memory - QStringList accounts; - QString inQuery; + TQStringList accounts; + TQString inQuery; filter.accounts(accounts); filter.categories(accounts); -// QStringList::iterator it; +// TQStringList::iterator it; // bool allAccountsLoaded = true; // for (it = accounts.begin(); it != accounts.end(); ++it) { -// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) { +// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) { // allAccountsLoaded = false; // break; // } @@ -2817,7 +2809,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co alert ("Amount Filter Set"); canImplementFilter = false; } - QString n1, n2; + TQString n1, n2; if (filter.numberFilter(n1, n2)) { alert("Number filter set"); canImplementFilter = false; @@ -2832,7 +2824,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co // alert("State filter set"); // canImplementFilter = false; // } - QRegExp t2; + TQRegExp t2; if (filter.textFilter(t2)) { alert("text filter set"); canImplementFilter = false; @@ -2843,9 +2835,9 @@ const QMap MyMoneyStorageSql::fetchTransactions (co canImplementFilter = false; } if (!canImplementFilter) { - QMap transactionList = fetchTransactions(); - QMap::ConstIterator it_t; - QMap::ConstIterator txListEnd = transactionList.end(); + TQMap transactionList = fetchTransactions(); + TQMap::ConstIterator it_t; + TQMap::ConstIterator txListEnd = transactionList.end(); std::remove_if(transactionList.begin(), transactionList.end(), FilterFail(filter, m_storagePtr)); return transactionList; @@ -2854,27 +2846,27 @@ const QMap MyMoneyStorageSql::fetchTransactions (co bool accountsOnlyFilter = true; bool splitFilterActive = false; // the split filter is active if we are selecting on fields in the split table // get start and end dates - QDate start = filter.fromDate(); - QDate end = filter.toDate(); + TQDate start = filter.fromDate(); + TQDate end = filter.toDate(); // not entirely sure if the following is correct, but at best, saves a lot of reads, at worst // it only causes us to read a few more transactions that strictly necessary (I think...) - if (start == KMyMoneySettings::startDate().date()) start = QDate(); - bool txFilterActive = ((start != QDate()) || (end != QDate())); // and this for fields in the transaction table + if (start == KMyMoneySettings::startDate().date()) start = TQDate(); + bool txFilterActive = ((start != TQDate()) || (end != TQDate())); // and this for fields in the transaction table if (txFilterActive) accountsOnlyFilter = false; - QString whereClause = ""; - QString subClauseconnector = " where txType = 'N' and "; + TQString whereClause = ""; + TQString subClauseconnector = " where txType = 'N' and "; // payees - QStringList payees; + TQStringList payees; //filter.payees(payees); if (filter.payees(payees)) { accountsOnlyFilter = false; - QString itemConnector = "payeeId in ("; - QString payeesClause = ""; - QStringList::const_iterator it; + TQString itemConnector = "payeeId in ("; + TQString payeesClause = ""; + TQStringList::const_iterator it; for (it = payees.begin(); it != payees.end(); ++it) { - payeesClause.append(QString("%1'%2'") - .arg(itemConnector).arg(*it)); + payeesClause.append(TQString("%1'%2'") + .tqarg(itemConnector).tqarg(*it)); itemConnector = ", "; } if (!payeesClause.isEmpty()) { @@ -2887,13 +2879,13 @@ const QMap MyMoneyStorageSql::fetchTransactions (co // accounts and categories if (!accounts.isEmpty()) { splitFilterActive = true; - QString itemConnector = "accountId in ("; - QString accountsClause = ""; - QStringList::const_iterator it; + TQString itemConnector = "accountId in ("; + TQString accountsClause = ""; + TQStringList::const_iterator it; for (it = accounts.begin(); it != accounts.end(); ++it) { -// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) { - accountsClause.append(QString("%1 '%2'") - .arg(itemConnector).arg(*it)); +// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) { + accountsClause.append(TQString("%1 '%2'") + .tqarg(itemConnector).tqarg(*it)); itemConnector = ", "; //if (accountsOnlyFilter) m_accountsLoaded.append(*it); // a bit premature... // } @@ -2905,15 +2897,15 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } // split states - QValueList splitStates; + TQValueList splitStates; if (filter.states(splitStates)) { splitFilterActive = true; - QString itemConnector = " reconcileFlag IN ("; - QString statesClause = ""; - for (QValueList::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) { - statesClause.append(QString(" %1 '%2'") - .arg(itemConnector) - .arg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); + TQString itemConnector = " reconcileFlag IN ("; + TQString statesClause = ""; + for (TQValueList::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) { + statesClause.append(TQString(" %1 '%2'") + .tqarg(itemConnector) + .tqarg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); itemConnector = ","; } if (!statesClause.isEmpty()) { @@ -2922,8 +2914,8 @@ const QMap MyMoneyStorageSql::fetchTransactions (co } } // I've given up trying to work out the logic. we keep getting the wrong number of close brackets - int obc = whereClause.contains('('); - int cbc = whereClause.contains(')'); + int obc = whereClause.tqcontains('('); + int cbc = whereClause.tqcontains(')'); if (cbc > obc) { qFatal("invalid where clause - %s", whereClause.latin1()); } @@ -2946,22 +2938,22 @@ const QMap MyMoneyStorageSql::fetchTransactions (co return fetchTransactions(); } // build a date clause for the transaction table - QString dateClause; - QString connector = ""; - if (end != QDate()) { - dateClause = QString("(postDate < '%1')").arg(end.addDays(1).toString(Qt::ISODate)); + TQString dateClause; + TQString connector = ""; + if (end != TQDate()) { + dateClause = TQString("(postDate < '%1')").tqarg(end.addDays(1).toString(Qt::ISODate)); connector = " and "; } - if (start != QDate()) { - dateClause += QString("%1 (postDate >= '%2')").arg(connector).arg(start.toString(Qt::ISODate)); + if (start != TQDate()) { + dateClause += TQString("%1 (postDate >= '%2')").tqarg(connector).tqarg(start.toString(Qt::ISODate)); } // now get a list of transaction ids // if we have only a date filter, we need to build the list from the tx table // otherwise we need to build from the split table if (splitFilterActive) { - inQuery = QString("(select distinct transactionId from kmmSplits %1)").arg(whereClause); + inQuery = TQString("(select distinct transactionId from kmmSplits %1)").tqarg(whereClause); } else { - inQuery = QString("(select distinct id from kmmTransactions where %1)").arg(dateClause); + inQuery = TQString("(select distinct id from kmmTransactions where %1)").tqarg(dateClause); txFilterActive = false; // kill off the date filter now } @@ -2969,7 +2961,7 @@ const QMap MyMoneyStorageSql::fetchTransactions (co //FIXME: if we have an accounts-only filter, recalc balances on loaded accounts } -unsigned long MyMoneyStorageSql::transactionCount (const QString& aid) const { +unsigned long MyMoneyStorageSql::transactionCount (const TQString& aid) const { DBG("*** Entering MyMoneyStorageSql::transactionCount"); if (aid.length() == 0) return m_transactions; @@ -2984,17 +2976,17 @@ void MyMoneyStorageSql::readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, co MyMoneyDbTable::field_iterator splitEnd = t.end(); int i = 0; - // Use the QString here instead of CASE, since this is called so often. - QString fieldName; + // Use the TQString here instead of CASE, since this is called so often. + TQString fieldName; while (ft != splitEnd) { fieldName = (*ft)->name(); if (fieldName == "payeeId") s.setPayeeId(GETCSTRING); else if (fieldName == "reconcileDate") s.setReconcileDate(GETDATE); else if (fieldName == "action") s.setAction(GETCSTRING); else if (fieldName == "reconcileFlag") s.setReconcileFlag(static_cast(GETINT)); - else if (fieldName == "value") s.setValue(MyMoneyMoney(QStringEmpty(GETSTRING))); - else if (fieldName == "shares") s.setShares(MyMoneyMoney(QStringEmpty(GETSTRING))); - else if (fieldName == "price") s.setPrice(MyMoneyMoney(QStringEmpty(GETSTRING))); + else if (fieldName == "value") s.setValue(MyMoneyMoney(TQStringEmpty(GETSTRING))); + else if (fieldName == "shares") s.setShares(MyMoneyMoney(TQStringEmpty(GETSTRING))); + else if (fieldName == "price") s.setPrice(MyMoneyMoney(TQStringEmpty(GETSTRING))); else if (fieldName == "memo") s.setMemo(GETSTRING); else if (fieldName == "accountId") s.setAccountId(GETCSTRING); else if (fieldName == "checkNumber") s.setNumber(GETSTRING); @@ -3006,7 +2998,7 @@ void MyMoneyStorageSql::readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, co return; } -bool MyMoneyStorageSql::isReferencedByTransaction(const QString& id) const { +bool MyMoneyStorageSql::isReferencedByTransaction(const TQString& id) const { DBG("*** Entering MyMoneyStorageSql::isReferencedByTransaction"); MyMoneySqlQuery q(const_cast (this)); q.prepare("SELECT COUNT(*) FROM kmmTransactions " @@ -3030,13 +3022,13 @@ void MyMoneyStorageSql::readSchedules(void) { PASS } -const QMap MyMoneyStorageSql::fetchSchedules (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchSchedules (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readSchedules"); - signalProgress(0, m_schedules, QObject::tr("Loading schedules...")); + signalProgress(0, m_schedules, TQObject::tr("Loading schedules...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmSchedules"]; MyMoneySqlQuery q(const_cast (this)); - QMap sList; + TQMap sList; //unsigned long lastId = 0; const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"]; MyMoneySqlQuery qs(const_cast (this)); @@ -3044,14 +3036,14 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS MyMoneySqlQuery sq(const_cast (this)); sq.prepare ("SELECT payDate from kmmSchedulePaymentHistory where schedId = :id"); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " id = :id" + QString::number(i) + " OR"; + queryString += " id = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } queryString += " ORDER BY id;"; @@ -3064,20 +3056,20 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Schedules"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Schedules"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; MyMoneySchedule s; - QString sId; - QString boolChar; - QDate nextPaymentDue; + TQString sId; + TQString boolChar; + TQDate nextPaymentDue; while (ft != t.end()) { CASE(id) sId = GETCSTRING; else CASE(name) s.setName (GETSTRING); @@ -3110,8 +3102,8 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(false) + " WHERE id = :id;"); q.bindValue(":id", s.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Scheduled Transaction"))); - if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("retrieving scheduled transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Scheduled Transaction"))); + if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("retrieving scheduled transaction"))); MyMoneyTransaction tx(s.id(), MyMoneyTransaction()); ft = t.begin(); i = 0; @@ -3138,7 +3130,7 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS // If the transaction doesn't have a post date, setTransaction will reject it. // The old way of handling things was to store the next post date in the schedule object - // and set the transaction post date to QDate(). + // and set the transaction post date to TQDate(). // For compatibility, if this is the case, copy the next post date from the schedule object // to the transaction object post date. if (!tx.postDate().isValid()) { @@ -3149,7 +3141,7 @@ const QMap MyMoneyStorageSql::fetchSchedules (const QS // read in the recorded payments sq.bindValue(":id", s.id()); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading schedule payment history"))); + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading schedule payment history"))); while (sq.next()) s.recordPayment (sq.value(0).toDate()); sList[s.id()] = s; @@ -3174,21 +3166,21 @@ void MyMoneyStorageSql::readSecurities(void) { PASS } -const QMap MyMoneyStorageSql::fetchSecurities (const QStringList& /*idList*/, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchSecurities (const TQStringList& /*idList*/, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readSecurities"); - signalProgress(0, m_securities, QObject::tr("Loading securities...")); + signalProgress(0, m_securities, TQObject::tr("Loading securities...")); int progress = 0; - QMap sList; + TQMap sList; unsigned long lastId = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmSecurities"]; MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(false) + " ORDER BY id;"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Securities"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Securities"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; MyMoneySecurity e; - QString eid; + TQString eid; int saf = 0; while (ft != t.end()) { CASE(id) eid = GETSTRING; @@ -3232,12 +3224,12 @@ void MyMoneyStorageSql::readPrices(void) { } -const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdList, const QString& toIdList, const QDate& date_, bool exactDate, bool /*forUpdate*/) const { +const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const TQString& fromIdList, const TQString& toIdList, const TQDate& date_, bool exactDate, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::fetchSinglePrice"); const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"]; MyMoneyDbTable::field_iterator tableEnd = t.end(); MyMoneySqlQuery q(const_cast (this)); - QString queryString = t.selectAllString(false); + TQString queryString = t.selectAllString(false); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. @@ -3250,28 +3242,28 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdLi q.prepare(queryString); - QDate date (date_); + TQDate date (date_); if(!date.isValid()) - date = QDate::currentDate(); + date = TQDate::tqcurrentDate(); q.bindValue(":fromId", fromIdList); q.bindValue(":toId", toIdList); - q.bindValue(":priceDate", date.addDays(1).toString(Qt::ISODate)); + q.bindValue(":priceDate", TQString(date.addDays(1).toString(Qt::ISODate))); if (exactDate) - q.bindValue(":exactDate", date.toString(Qt::ISODate)); + q.bindValue(":exactDate", TQString(date.toString(Qt::ISODate))); if (! q.exec()) {} if (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString from; - QString to; - QDate date; + TQString from; + TQString to; + TQDate date; MyMoneyMoney rate; - QString source; + TQString source; bool foundFromId = false; bool foundToId = false; bool foundPriceDate = false; @@ -3303,30 +3295,30 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdLi return MyMoneyPrice(); } -const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const QStringList& fromIdList, const QStringList& toIdList, bool forUpdate) const { +const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const TQStringList& fromIdList, const TQStringList& toIdList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readPrices"); - signalProgress(0, m_prices, QObject::tr("Loading prices...")); + signalProgress(0, m_prices, TQObject::tr("Loading prices...")); int progress = 0; const_cast (this)->m_readingPrices = true; MyMoneyPriceList pList; const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"]; MyMoneyDbTable::field_iterator tableEnd = t.end(); MyMoneySqlQuery q(const_cast (this)); - QString queryString = t.selectAllString(false); + TQString queryString = t.selectAllString(false); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! fromIdList.empty()) { queryString += " WHERE ("; for (unsigned i = 0; i < fromIdList.count(); ++i) { - queryString += " fromId = :fromId" + QString::number(i) + " OR"; + queryString += " fromId = :fromId" + TQString::number(i) + " OR"; } queryString = queryString.left(queryString.length() - 2) + ")"; } if (! toIdList.empty()) { queryString += " AND ("; for (unsigned i = 0; i < toIdList.count(); ++i) { - queryString += " toId = :toId" + QString::number(i) + " OR"; + queryString += " toId = :toId" + TQString::number(i) + " OR"; } queryString = queryString.left(queryString.length() - 2) + ")"; } @@ -3340,27 +3332,27 @@ const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const QStringList& fromI q.prepare (queryString); if (! fromIdList.empty()) { - QStringList::const_iterator bindVal = fromIdList.begin(); + TQStringList::const_iterator bindVal = fromIdList.begin(); for (int i = 0; bindVal != fromIdList.end(); ++i, ++bindVal) { - q.bindValue (":fromId" + QString::number(i), *bindVal); + q.bindValue (":fromId" + TQString::number(i), *bindVal); } } if (! toIdList.empty()) { - QStringList::const_iterator bindVal = toIdList.begin(); + TQStringList::const_iterator bindVal = toIdList.begin(); for (int i = 0; bindVal != toIdList.end(); ++i, ++bindVal) { - q.bindValue (":toId" + QString::number(i), *bindVal); + q.bindValue (":toId" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Prices"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString from; - QString to; - QDate date; + TQString from; + TQString to; + TQDate date; MyMoneyMoney rate; - QString source; + TQString source; while (ft != tableEnd) { CASE(fromId) from = GETCSTRING; @@ -3384,22 +3376,22 @@ void MyMoneyStorageSql::readCurrencies(void) { PASS } -const QMap MyMoneyStorageSql::fetchCurrencies (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchCurrencies (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readCurrencies"); - signalProgress(0, m_currencies, QObject::tr("Loading currencies...")); + signalProgress(0, m_currencies, TQObject::tr("Loading currencies...")); int progress = 0; - QMap cList; + TQMap cList; const MyMoneyDbTable& t = m_db.m_tables["kmmCurrencies"]; MyMoneySqlQuery q(const_cast (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " isocode = :id" + QString::number(i) + " OR"; + queryString += " isocode = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } @@ -3413,32 +3405,32 @@ const QMap MyMoneyStorageSql::fetchCurrencies (const Q q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Currencies"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Currencies"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString id; + TQString id; MyMoneySecurity c; - QChar symbol[3]; + TQChar symbol[3]; while (ft != t.end()) { CASE(ISOcode) id = GETCSTRING; else CASE(name) c.setName(GETSTRING); else CASE(type) c.setSecurityType(static_cast(GETINT)); - else CASE(symbol1) symbol[0] = QChar(GETINT); - else CASE(symbol2) symbol[1] = QChar(GETINT); - else CASE(symbol3) symbol[2] = QChar(GETINT); + else CASE(symbol1) symbol[0] = TQChar(GETINT); + else CASE(symbol2) symbol[1] = TQChar(GETINT); + else CASE(symbol3) symbol[2] = TQChar(GETINT); else CASE(partsPerUnit) c.setPartsPerUnit(GETINT); else CASE(smallestCashFraction) c.setSmallestCashFraction(GETINT); else CASE(smallestAccountFraction) c.setSmallestAccountFraction(GETINT); ++ft; ++i; } - c.setTradingSymbol(QString(symbol, 3).stripWhiteSpace()); + c.setTradingSymbol(TQString(symbol, 3).stripWhiteSpace()); cList[id] = MyMoneySecurity(id, c); @@ -3455,24 +3447,24 @@ void MyMoneyStorageSql::readReports(void) { PASS } -const QMap MyMoneyStorageSql::fetchReports (const QStringList& /*idList*/, bool /*forUpdate*/) const { +const TQMap MyMoneyStorageSql::fetchReports (const TQStringList& /*idList*/, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readReports"); - signalProgress(0, m_reports, QObject::tr("Loading reports...")); + signalProgress(0, m_reports, TQObject::tr("Loading reports...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmReportConfig"]; MyMoneySqlQuery q(const_cast (this)); q.prepare (t.selectAllString(true)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading reports"))); - QMap rList; + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading reports"))); + TQMap rList; while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QDomDocument d; + TQDomDocument d; while (ft != t.end()) { CASE(XML) d.setContent(GETSTRING, false); ++ft; ++i; } - QDomNode child = d.firstChild(); + TQDomNode child = d.firstChild(); child = child.firstChild(); MyMoneyReport report; @@ -3484,13 +3476,13 @@ const QMap MyMoneyStorageSql::fetchReports (const QStrin return rList; } -const QMap MyMoneyStorageSql::fetchBudgets (const QStringList& idList, bool forUpdate) const { +const TQMap MyMoneyStorageSql::fetchBudgets (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readBudgets"); - signalProgress(0, m_budgets, QObject::tr("Loading budgets...")); + signalProgress(0, m_budgets, TQObject::tr("Loading budgets...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmBudgetConfig"]; MyMoneySqlQuery q(const_cast (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); if (! idList.empty()) { queryString += " WHERE id = '" + idList.join("' OR id = '") + "'"; } @@ -3500,17 +3492,17 @@ const QMap MyMoneyStorageSql::fetchBudgets (const QStrin queryString += ";"; q.prepare (queryString); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading budgets"))); - QMap budgets; + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading budgets"))); + TQMap budgets; while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QDomDocument d; + TQDomDocument d; while (ft != t.end()) { CASE(XML) d.setContent(GETSTRING, false); ++ft; ++i; } - QDomNode child = d.firstChild(); + TQDomNode child = d.firstChild(); child = child.firstChild(); MyMoneyBudget budget (child.toElement()); budgets.insert(budget.id(), budget); @@ -3523,25 +3515,25 @@ void MyMoneyStorageSql::readBudgets(void) { m_storage->loadBudgets(fetchBudgets()); } -const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QString& kvpId) const { +const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const { DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs"); MyMoneyKeyValueContainer list; MyMoneySqlQuery q(const_cast (this)); q.prepare ("SELECT kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type and kvpId = :id;"); q.bindValue(":type", kvpType); q.bindValue(":id", kvpId); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Kvp for %1 %2").arg(kvpType) - .arg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp for %1 %2").tqarg(kvpType) + .tqarg(kvpId))); while (q.next()) list.setValue(q.value(0).toString(), q.value(1).toString()); return (list); } -const QMap MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const { +const TQMap MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const { DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs"); - QMap retval; + TQMap retval; MyMoneySqlQuery q(const_cast (this)); - QString query ("SELECT kvpId, kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type"); + TQString query ("SELECT kvpId, kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type"); if (!kvpIdList.empty()) { query += " and kvpId IN ('" + kvpIdList.join("', '") + "')"; @@ -3550,7 +3542,7 @@ const QMap MyMoneyStorageSql::readKeyValuePai query += " order by kvpId;"; q.prepare (query); q.bindValue(":type", kvpType); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Kvp List for %1").arg(kvpType))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp List for %1").tqarg(kvpType))); while (q.next()) { retval [q.value(0).toString()].setValue(q.value(1).toString(), q.value(2).toString()); } @@ -3607,7 +3599,7 @@ long unsigned MyMoneyStorageSql::incrementBudgetId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiBudgetId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiBudgetId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdBudgets = returnValue; @@ -3623,7 +3615,7 @@ long unsigned MyMoneyStorageSql::incrementAccountId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiAccountId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiAccountId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdAccounts = returnValue; @@ -3639,7 +3631,7 @@ long unsigned MyMoneyStorageSql::incrementInstitutionId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiInstitutionId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiInstitutionId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdInstitutions = returnValue; @@ -3655,7 +3647,7 @@ long unsigned MyMoneyStorageSql::incrementPayeeId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiPayeeId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiPayeeId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdPayees = returnValue; @@ -3671,7 +3663,7 @@ long unsigned MyMoneyStorageSql::incrementReportId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiReportId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiReportId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdReports = returnValue; @@ -3687,7 +3679,7 @@ long unsigned MyMoneyStorageSql::incrementScheduleId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiScheduleId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiScheduleId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdSchedules = returnValue; @@ -3703,7 +3695,7 @@ long unsigned MyMoneyStorageSql::incrementSecurityId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiSecurityId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiSecurityId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdSecurities = returnValue; @@ -3719,7 +3711,7 @@ long unsigned MyMoneyStorageSql::incrementTransactionId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiTransactionId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiTransactionId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdTransactions = returnValue; @@ -3776,33 +3768,33 @@ void MyMoneyStorageSql::loadBudgetId(const unsigned long& id) //**************************************************** long unsigned MyMoneyStorageSql::calcHighId - (const long unsigned& i, const QString& id) { + (const long unsigned& i, const TQString& id) { DBG("*** Entering MyMoneyStorageSql::calcHighId"); - QString nid = id; - long unsigned high = (unsigned long) nid.replace(QRegExp("[A-Z]*"), "").toULongLong(); + TQString nid = id; + long unsigned high = (unsigned long) nid.tqreplace(TQRegExp("[A-Z]*"), "").toULongLong(); return std::max(high, i); } -void MyMoneyStorageSql::setProgressCallback(void(*callback)(int, int, const QString&)) { +void MyMoneyStorageSql::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStorageSql::signalProgress(int current, int total, const QString& msg) const { +void MyMoneyStorageSql::signalProgress(int current, int total, const TQString& msg) const { if (m_progressCallback != 0) (*m_progressCallback)(current, total, msg); } // **************************** Error display routine ******************************* -QString& MyMoneyStorageSql::buildError (const QSqlQuery& q, const QString& function, const QString& message) const { - QString s = QString("Error in function %1 : %2").arg(function).arg(message); - QSqlError e = lastError(); - s += QString ("\nDriver = %1, Host = %2, User = %3, Database = %4") - .arg(driverName()).arg(hostName()).arg(userName()).arg(databaseName()); - s += QString ("\nDriver Error: %1").arg(e.driverText()); - s += QString ("\nDatabase Error No %1: %2").arg(e.number()).arg(e.databaseText()); +TQString& MyMoneyStorageSql::buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const { + TQString s = TQString("Error in function %1 : %2").tqarg(function).tqarg(message); + TQSqlError e = lastError(); + s += TQString ("\nDriver = %1, Host = %2, User = %3, Database = %4") + .tqarg(driverName()).tqarg(hostName()).tqarg(userName()).tqarg(databaseName()); + s += TQString ("\nDriver Error: %1").tqarg(e.driverText()); + s += TQString ("\nDatabase Error No %1: %2").tqarg(e.number()).tqarg(e.databaseText()); e = q.lastError(); - s += QString ("\nExecuted: %1").arg(q.executedQuery()); - s += QString ("\nQuery error No %1: %2").arg(e.number()).arg(e.text()); + s += TQString ("\nExecuted: %1").tqarg(q.executedQuery()); + s += TQString ("\nQuery error No %1: %2").tqarg(e.number()).tqarg(e.text()); const_cast (this)->m_error = s; qDebug("%s", s.ascii()); @@ -3841,7 +3833,7 @@ MyMoneyDbDef::MyMoneyDbDef () { //#define ISKEY true void MyMoneyDbDef::FileInfo(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("version", "varchar(16)")); fields.append(new MyMoneyDbColumn("created", "date")); fields.append(new MyMoneyDbColumn("lastModified", "date")); @@ -3880,7 +3872,7 @@ void MyMoneyDbDef::FileInfo(void){ } void MyMoneyDbDef::Institutions(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("manager")); @@ -3895,7 +3887,7 @@ void MyMoneyDbDef::Institutions(void){ } void MyMoneyDbDef::Payees(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name")); fields.append(new MyMoneyDbTextColumn("reference")); @@ -3916,10 +3908,10 @@ void MyMoneyDbDef::Payees(void){ } void MyMoneyDbDef::Accounts(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("institutionId", "varchar(32)")); - fields.append(new MyMoneyDbColumn("parentId", "varchar(32)")); + fields.append(new MyMoneyDbColumn("tqparentId", "varchar(32)")); fields.append(new MyMoneyDbDatetimeColumn("lastReconciled")); fields.append(new MyMoneyDbDatetimeColumn("lastModified")); fields.append(new MyMoneyDbColumn("openingDate", "date")); @@ -3939,7 +3931,7 @@ void MyMoneyDbDef::Accounts(void){ } void MyMoneyDbDef::Transactions(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("txType", "char(1)")); fields.append(new MyMoneyDbDatetimeColumn("postDate")); @@ -3953,7 +3945,7 @@ void MyMoneyDbDef::Transactions(void){ } void MyMoneyDbDef::Splits(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("transactionId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("txType", "char(1)")); fields.append(new MyMoneyDbIntColumn("splitId", MyMoneyDbIntColumn::SMALL, UNSIGNED, PRIMARYKEY, NOTNULL)); @@ -3973,7 +3965,7 @@ void MyMoneyDbDef::Splits(void){ fields.append(new MyMoneyDbDatetimeColumn("postDate")); fields.append(new MyMoneyDbTextColumn("bankId")); MyMoneyDbTable t("kmmSplits", fields); - QStringList list; + TQStringList list; list << "accountId" << "txType"; t.addIndex("kmmSplitsaccount_type", list, false); t.buildSQLStrings(); @@ -3981,13 +3973,13 @@ void MyMoneyDbDef::Splits(void){ } void MyMoneyDbDef::KeyValuePairs(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("kvpType", "varchar(16)", false, NOTNULL)); fields.append(new MyMoneyDbColumn("kvpId", "varchar(32)")); fields.append(new MyMoneyDbColumn("kvpKey", "varchar(255)", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("kvpData")); MyMoneyDbTable t("kmmKeyValuePairs", fields); - QStringList list; + TQStringList list; list << "kvpType" << "kvpId"; t.addIndex("type_id", list, false); t.buildSQLStrings(); @@ -3995,7 +3987,7 @@ void MyMoneyDbDef::KeyValuePairs(void){ } void MyMoneyDbDef::Schedules(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbIntColumn("type", MyMoneyDbIntColumn::TINY, UNSIGNED, false, NOTNULL)); @@ -4022,7 +4014,7 @@ void MyMoneyDbDef::Schedules(void){ } void MyMoneyDbDef::SchedulePaymentHistory(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("schedId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("payDate", "date", PRIMARYKEY, NOTNULL)); MyMoneyDbTable t("kmmSchedulePaymentHistory", fields); @@ -4031,7 +4023,7 @@ void MyMoneyDbDef::SchedulePaymentHistory(void){ } void MyMoneyDbDef::Securities(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("name", "text", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("symbol")); @@ -4046,7 +4038,7 @@ void MyMoneyDbDef::Securities(void){ } void MyMoneyDbDef::Prices(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("fromId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("toId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("priceDate", "date", PRIMARYKEY, NOTNULL)); @@ -4059,7 +4051,7 @@ void MyMoneyDbDef::Prices(void){ } void MyMoneyDbDef::Currencies(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("ISOcode", "char(3)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbIntColumn("type", MyMoneyDbIntColumn::SMALL, UNSIGNED)); @@ -4077,7 +4069,7 @@ void MyMoneyDbDef::Currencies(void){ } void MyMoneyDbDef::Reports(void) { - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("name", "varchar(255)", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("XML", MyMoneyDbTextColumn::LONG)); fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); @@ -4087,7 +4079,7 @@ void MyMoneyDbDef::Reports(void) { } void MyMoneyDbDef::Budgets(void){ - QValueList > fields; + TQValueList > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("name", "text", false, NOTNULL)); fields.append(new MyMoneyDbColumn("start", "date", false, NOTNULL)); @@ -4111,8 +4103,8 @@ void MyMoneyDbDef::Balances(void){ } // function to write create SQL to a stream -const QString MyMoneyDbDef::generateSQL (const QString& driver) const { - QString retval; +const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const { + TQString retval; databaseTypeE dbType = m_drivers.driverToType(driver); table_iterator tt = tableBegin(); while (tt != tableEnd()) { @@ -4127,31 +4119,31 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { retval += '\n'; MyMoneyDbTable fi = m_tables["kmmFileInfo"]; - QString qs = fi.insertString(); + TQString qs = fi.insertString(); MyMoneyDbTable::field_iterator fit; for (fit = fi.begin(); fit != fi.end(); ++fit) { - QString toReplace = (*fit)->name(); + TQString toReplace = (*fit)->name(); toReplace.prepend(':'); - QString replace = "NULL"; + TQString tqreplace = "NULL"; if ((*fit)->name() == "version") - replace = QString::number(m_currentVersion); + tqreplace = TQString::number(m_currentVersion); if ((*fit)->name() == "fixLevel") - replace = QString::number + tqreplace = TQString::number (MyMoneyFile::instance()->storage()->currentFixVersion()); if ((*fit)->name() == "created") - replace = QDate::currentDate().toString(Qt::ISODate); + tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate); if ((*fit)->name() == "lastModified") - replace = QDate::currentDate().toString(Qt::ISODate); + tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate); if ((*fit)->name() == "updateInProgress") - replace = enclose("N"); - qs.replace(toReplace, replace); + tqreplace = enclose("N"); + qs.tqreplace(toReplace, tqreplace); } qs += "\n\n"; retval += qs; - qs = QString(); + qs = TQString(); unsigned int i; - QValueList stdList; + TQValueList stdList; stdList.append (MyMoneyFile::instance()->asset()); stdList.append (MyMoneyFile::instance()->equity()); stdList.append (MyMoneyFile::instance()->expense()); @@ -4164,23 +4156,23 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { MyMoneyDbTable::field_iterator act; // do the following in reverse so the 'formatted' fields are // correctly handled. - // Hmm, how does one use a QValueListIterator in reverse - // It'll be okay in Qt4 with QListIterator + // Hmm, how does one use a TQValueListIterator in reverse + // It'll be okay in TQt4 with TQListIterator for (act = ac.end(), --act; act != ac.begin(); --act) { - QString toReplace = (*act)->name(); + TQString toReplace = (*act)->name(); toReplace.prepend(':'); - QString replace = "NULL"; + TQString tqreplace = "NULL"; if ((*act)->name() == "accountType") - replace = QString::number(pac->accountType()); + tqreplace = TQString::number(pac->accountType()); if ((*act)->name() == "accountTypeString") - replace = enclose(pac->name()); + tqreplace = enclose(pac->name()); if ((*act)->name() == "isStockAccount") - replace = enclose("N"); + tqreplace = enclose("N"); if ((*act)->name() == "accountName") - replace = enclose(pac->name()); - qs.replace(toReplace, replace); + tqreplace = enclose(pac->name()); + qs.tqreplace(toReplace, tqreplace); } - qs.replace (":id", enclose(pac->id())); // a real kludge + qs.tqreplace (":id", enclose(pac->id())); // a real kludge qs += "\n\n"; retval += qs; } @@ -4189,19 +4181,19 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { //***************************************************************************** -void MyMoneyDbTable::addIndex(const QString& name, const QStringList& columns, bool unique) { +void MyMoneyDbTable::addIndex(const TQString& name, const TQStringList& columns, bool unique) { m_indices.push_back (MyMoneyDbIndex (m_name, name, columns, unique)); } void MyMoneyDbTable::buildSQLStrings (void) { // build fixed SQL strings for this table // build the insert string with placeholders for each field - QString qs = QString("INSERT INTO %1 (").arg(name()); - QString ws = ") VALUES ("; + TQString qs = TQString("INSERT INTO %1 (").tqarg(name()); + TQString ws = ") VALUES ("; field_iterator ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += QString("%1, ").arg((*ft)->name()); - ws += QString(":%1, ").arg((*ft)->name()); + qs += TQString("%1, ").tqarg((*ft)->name()); + ws += TQString(":%1, ").tqarg((*ft)->name()); ++ft; } qs = qs.left(qs.length() - 2); @@ -4213,14 +4205,14 @@ void MyMoneyDbTable::buildSQLStrings (void) { // build an update string; key fields go in the where clause qs = "UPDATE " + name() + " SET "; - ws = QString(); + ws = TQString(); ft = m_fields.begin(); while (ft != m_fields.end()) { if ((*ft)->isPrimaryKey()) { if (!ws.isEmpty()) ws += " AND "; - ws += QString("%1 = :%2").arg((*ft)->name()).arg((*ft)->name()); + ws += TQString("%1 = :%2").tqarg((*ft)->name()).tqarg((*ft)->name()); } else { - qs += QString("%1 = :%2, ").arg((*ft)->name()).arg((*ft)->name()); + qs += TQString("%1 = :%2, ").tqarg((*ft)->name()).tqarg((*ft)->name()); } ++ft; } @@ -4233,20 +4225,20 @@ void MyMoneyDbTable::buildSQLStrings (void) { m_deleteString = qs + ";"; } -const QString MyMoneyDbTable::columnList() const { +const TQString MyMoneyDbTable::columnList() const { field_iterator ft = m_fields.begin(); - QString qs; + TQString qs; ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += QString("%1, ").arg((*ft)->name()); + qs += TQString("%1, ").tqarg((*ft)->name()); ++ft; } return (qs.left(qs.length() - 2)); } -const QString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { - QString qs = QString("CREATE TABLE %1 (").arg(name()); - QString pkey; +const TQString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { + TQString qs = TQString("CREATE TABLE %1 (").tqarg(name()); + TQString pkey; for (field_iterator it = m_fields.begin(); it != m_fields.end(); ++it) { qs += (*it)->generateDDL (dbType) + ", "; if ((*it)->isPrimaryKey ()) @@ -4271,7 +4263,7 @@ const QString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { return qs; } -const QString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const +const TQString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const { if (dbType == Mysql || dbType == Oracle8) return "ALTER TABLE " + m_name + " DROP PRIMARY KEY;"; @@ -4283,8 +4275,8 @@ const QString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const return ""; } -const QString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const QString& columnName, const MyMoneyDbColumn& newDef) const { - QString qs = "ALTER TABLE " + m_name + " "; +const TQString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const TQString& columnName, const MyMoneyDbColumn& newDef) const { + TQString qs = "ALTER TABLE " + m_name + " "; if (dbType == Mysql) qs += "CHANGE " + columnName + " " + newDef.generateDDL(dbType); else if (dbType == Postgresql) @@ -4298,14 +4290,14 @@ const QString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const QSt } //***************************************************************************** -const QString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const { Q_UNUSED(dbType); - QString qs = "CREATE "; + TQString qs = "CREATE "; if (m_unique) - qs += "UNIQUE "; + qs += "UNITQUE "; qs += "INDEX " + m_table + "_" + m_name + "_idx ON " + m_table + " ("; @@ -4315,7 +4307,7 @@ const QString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const // the result of an SQL function, but not a partial column. There should be // a way to merge these, and support other DBMSs like SQLite at the same time. // For now, if we just use plain columns, this will work fine. - for (QStringList::const_iterator it = m_columns.begin(); it != m_columns.end(); ++it) { + for (TQStringList::const_iterator it = m_columns.begin(); it != m_columns.end(); ++it) { qs += *it + ","; } @@ -4341,18 +4333,18 @@ MyMoneyDbDatetimeColumn* MyMoneyDbDatetimeColumn::clone () const MyMoneyDbTextColumn* MyMoneyDbTextColumn::clone () const { return (new MyMoneyDbTextColumn (*this)); } -const QString MyMoneyDbColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbColumn::generateDDL (databaseTypeE dbType) const { Q_UNUSED(dbType); - QString qs = name() + " " + type(); + TQString qs = name() + " " + type(); if (isNotNull()) qs += " NOT NULL"; return qs; } -const QString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; switch (m_type) { case MyMoneyDbIntColumn::TINY: @@ -4423,9 +4415,9 @@ const QString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const return qs; } -const QString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; switch (m_type) { case MyMoneyDbTextColumn::TINY: @@ -4496,9 +4488,9 @@ const QString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const return qs; } -const QString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; if (dbType == Mysql || dbType == ODBC3) { qs += "datetime "; } else if (dbType == Postgresql || dbType == Db2 || dbType == Oracle8 || dbType == Sqlite3 ) { diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.h b/kmymoney2/mymoney/storage/mymoneystoragesql.h index 1abe70b..4250256 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.h +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.h @@ -13,12 +13,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include -class QIODevice; +class TQIODevice; // ---------------------------------------------------------------------------- // KDE Includes @@ -56,7 +56,7 @@ class FilterFail { m_storage (storage) {} - inline bool operator() (const QPair& transactionPair) + inline bool operator() (const TQPair& transactionPair) { return (*this) (transactionPair.second); } inline bool operator() (const MyMoneyTransaction& transaction) @@ -87,16 +87,16 @@ typedef enum databaseTypeE { // database (driver) type class MyMoneyStorageSql; /** - * The MyMoneySqlQuery class is derived from QSqlQuery to provide + * The MyMoneySqlQuery class is derived from TQSqlQuery to provide * a way to adjust some queries based on databaseTypeE and make * debugging easier by providing a place to put debug statements. */ -class MyMoneySqlQuery : public QSqlQuery { +class MyMoneySqlQuery : public TQSqlQuery { public: MyMoneySqlQuery (MyMoneyStorageSql* db = 0); virtual ~MyMoneySqlQuery() {} bool exec (); - bool prepare ( const QString & query ); + bool prepare ( const TQString & query ); private: const MyMoneyStorageSql* m_db; }; @@ -108,13 +108,13 @@ class MyMoneyDbDrivers { public: MyMoneyDbDrivers (); /** - * @return a list ofsupported Qt database driver types, their qt names and useful names + * @return a list ofsupported TQt database driver types, their qt names and useful names **/ - const QMap driverMap() const {return (m_driverMap);}; - databaseTypeE driverToType (const QString& driver) const; + const TQMap driverMap() const {return (m_driverMap);}; + databaseTypeE driverToType (const TQString& driver) const; bool isTested (databaseTypeE dbType) const; private: - QMap m_driverMap; + TQMap m_driverMap; }; /** @@ -123,11 +123,11 @@ class MyMoneyDbDrivers { */ class MyMoneyDbColumn : public KShared { public: - MyMoneyDbColumn (const QString& iname, - const QString& itype = QString::null, + MyMoneyDbColumn (const TQString& iname, + const TQString& itype = TQString(), const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): m_name(iname), m_type(itype), m_isPrimary(iprimary), @@ -147,20 +147,20 @@ class MyMoneyDbColumn : public KShared { * * @param dbType Database driver type * - * @return QString of the DDL for the column, tailored for what the driver supports. + * @return TQString of the DDL for the column, tailored for what the driver supports. */ - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; - const QString& name(void) const {return (m_name);} - const QString& type(void) const {return (m_type);} + const TQString& name(void) const {return (m_name);} + const TQString& type(void) const {return (m_type);} bool isPrimaryKey(void) const {return (m_isPrimary);} bool isNotNull(void) const {return (m_isNotNull);} private: - QString m_name; - QString m_type; + TQString m_name; + TQString m_type; bool m_isPrimary; bool m_isNotNull; - QString m_initVersion; + TQString m_initVersion; }; /** @@ -168,17 +168,17 @@ class MyMoneyDbColumn : public KShared { */ class MyMoneyDbDatetimeColumn : public MyMoneyDbColumn { public: - MyMoneyDbDatetimeColumn (const QString& iname, + MyMoneyDbDatetimeColumn (const TQString& iname, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion) {} virtual ~MyMoneyDbDatetimeColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbDatetimeColumn* clone () const; private: - static const QString calcType(void); + static const TQString calcType(void); }; /** @@ -187,17 +187,17 @@ class MyMoneyDbDatetimeColumn : public MyMoneyDbColumn { class MyMoneyDbIntColumn : public MyMoneyDbColumn { public: enum size {TINY, SMALL, MEDIUM, BIG}; - MyMoneyDbIntColumn (const QString& iname, + MyMoneyDbIntColumn (const TQString& iname, const size type = MEDIUM, const bool isigned = true, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion), m_type (type), m_isSigned (isigned) {} virtual ~MyMoneyDbIntColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbIntColumn* clone () const; private: size m_type; @@ -212,15 +212,15 @@ class MyMoneyDbIntColumn : public MyMoneyDbColumn { class MyMoneyDbTextColumn : public MyMoneyDbColumn { public: enum size {TINY, NORMAL, MEDIUM, LONG}; - MyMoneyDbTextColumn (const QString& iname, + MyMoneyDbTextColumn (const TQString& iname, const size type = MEDIUM, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion), m_type (type) {} virtual ~MyMoneyDbTextColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbTextColumn* clone () const; private: size m_type; @@ -237,9 +237,9 @@ class MyMoneyDbTextColumn : public MyMoneyDbColumn { */ class MyMoneyDbIndex { public: - MyMoneyDbIndex (const QString& table, - const QString& name, - const QStringList& columns, + MyMoneyDbIndex (const TQString& table, + const TQString& name, + const TQStringList& columns, bool unique = false): m_table(table), m_unique(unique), @@ -247,16 +247,16 @@ class MyMoneyDbIndex { m_columns(columns) {} MyMoneyDbIndex () {} - inline const QString table () const {return m_table;} + inline const TQString table () const {return m_table;} inline bool isUnique () const {return m_unique;} - inline const QString name () const {return m_name;} - inline const QStringList columns () const {return m_columns;} - const QString generateDDL (databaseTypeE dbType) const; + inline const TQString name () const {return m_name;} + inline const TQStringList columns () const {return m_columns;} + const TQString generateDDL (databaseTypeE dbType) const; private: - QString m_table; + TQString m_table; bool m_unique; - QString m_name; - QStringList m_columns; + TQString m_name; + TQStringList m_columns; }; /** @@ -270,20 +270,20 @@ class MyMoneyDbIndex { */ class MyMoneyDbTable { public: - MyMoneyDbTable (const QString& iname, - const QValueList >& ifields, - const QString& initVersion = "1.0"): + MyMoneyDbTable (const TQString& iname, + const TQValueList >& ifields, + const TQString& initVersion = "1.0"): m_name(iname), m_fields(ifields), m_initVersion(initVersion) {} MyMoneyDbTable (void) {} - inline const QString& name(void) const {return (m_name);} - inline const QString& insertString(void) const {return (m_insertString);}; - inline const QString selectAllString(bool terminate = true) const - {return (terminate ? QString(m_selectAllString + ";") : m_selectAllString);}; - inline const QString& updateString(void) const {return (m_updateString);}; - inline const QString& deleteString(void) const {return (m_deleteString);}; + inline const TQString& name(void) const {return (m_name);} + inline const TQString& insertString(void) const {return (m_insertString);}; + inline const TQString selectAllString(bool terminate = true) const + {return (terminate ? TQString(m_selectAllString + ";") : m_selectAllString);}; + inline const TQString& updateString(void) const {return (m_updateString);}; + inline const TQString& deleteString(void) const {return (m_deleteString);}; /** * This method determines the string required to drop the primary key for the table @@ -291,15 +291,15 @@ class MyMoneyDbTable { * * @param dbType The driver type of the database. * - * @return QString for the syntax to drop the primary key. + * @return TQString for the syntax to drop the primary key. */ - const QString dropPrimaryKeyString(databaseTypeE dbType) const; + const TQString dropPrimaryKeyString(databaseTypeE dbType) const; /** * This method returns a comma-separated list of all column names in the table * - * @return QString column list. + * @return TQString column list. */ - const QString columnList() const; + const TQString columnList() const; /** * This method returns the string for changing a column's definition. It covers statements * like ALTER TABLE..CHANGE COLUMN, MODIFY COLUMN, etc. @@ -308,9 +308,9 @@ class MyMoneyDbTable { * @param columnName The name of the column to be modified. * @param newDef The MyMoneyColumn object of the new column definition. * - * @return QString containing DDL to change the column. + * @return TQString containing DDL to change the column. */ - const QString modifyColumnString(databaseTypeE dbType, const QString& columnName, const MyMoneyDbColumn& newDef) const; + const TQString modifyColumnString(databaseTypeE dbType, const TQString& columnName, const MyMoneyDbColumn& newDef) const; /** * This method builds all of the SQL strings for common operations. @@ -322,9 +322,9 @@ class MyMoneyDbTable { * * @param dbType The driver type of the database. * - * @return QString of the DDL. + * @return TQString of the DDL. */ - const QString generateCreateSQL (databaseTypeE dbType) const; + const TQString generateCreateSQL (databaseTypeE dbType) const; /** * This method creates a MyMoneyDbIndex object and adds it to the list of indices for the table. @@ -333,22 +333,22 @@ class MyMoneyDbTable { * @param columns The list of the columns affected. * @param unique Whether or not this should be a unique index. */ - void addIndex(const QString& name, const QStringList& columns, bool unique = false); + void addIndex(const TQString& name, const TQStringList& columns, bool unique = false); - typedef QValueList >::const_iterator field_iterator; + typedef TQValueList >::const_iterator field_iterator; inline field_iterator begin(void) const {return m_fields.constBegin();} inline field_iterator end(void) const {return m_fields.constEnd(); } private: - QString m_name; - QValueList > m_fields; - - typedef QValueList::const_iterator index_iterator; - QValueList m_indices; - QString m_initVersion; - QString m_insertString; // string to insert a record - QString m_selectAllString; // to select all fields - QString m_updateString; // normal string for record update - QString m_deleteString; // string to delete 1 record + TQString m_name; + TQValueList > m_fields; + + typedef TQValueList::const_iterator index_iterator; + TQValueList m_indices; + TQString m_initVersion; + TQString m_insertString; // string to insert a record + TQString m_selectAllString; // to select all fields + TQString m_updateString; // normal string for record update + TQString m_deleteString; // string to delete 1 record }; /** @@ -360,21 +360,21 @@ class MyMoneyDbTable { */ class MyMoneyDbView { public: - MyMoneyDbView (const QString& name, - const QString& createString, - const QString& initVersion = "0.1") + MyMoneyDbView (const TQString& name, + const TQString& createString, + const TQString& initVersion = "0.1") : m_name (name), m_createString (createString), m_initVersion (initVersion) {} MyMoneyDbView (void) {} - inline const QString& name(void) const {return (m_name);} - inline const QString createString(void) const {return (m_createString);}; + inline const TQString& name(void) const {return (m_name);} + inline const TQString createString(void) const {return (m_createString);}; private: - QString m_name; - QString m_createString; - QString m_initVersion; + TQString m_name; + TQString m_createString; + TQString m_initVersion; }; /** @@ -387,22 +387,22 @@ public: MyMoneyDbDef(); ~MyMoneyDbDef() {} - const QString generateSQL (const QString& driver) const; + const TQString generateSQL (const TQString& driver) const; - typedef QMap::const_iterator table_iterator; + typedef TQMap::const_iterator table_iterator; inline table_iterator tableBegin(void) const {return m_tables.constBegin();} inline table_iterator tableEnd(void) const {return m_tables.constEnd();} - typedef QMap::const_iterator view_iterator; + typedef TQMap::const_iterator view_iterator; inline view_iterator viewBegin(void) const {return m_views.constBegin();} inline view_iterator viewEnd(void) const {return m_views.constEnd();} inline unsigned int currentVersion() const {return (m_currentVersion);}; private: - const QString enclose(const QString& text) const - {return (QString("'" + text + "'"));}; - static unsigned int m_currentVersion; // The current version of the database layout + const TQString enclose(const TQString& text) const + {return (TQString("'" + text + "'"));}; + static unsigned int m_currentVersion; // The current version of the database tqlayout MyMoneyDbDrivers m_drivers; #define TABLE(name) void name(); #define VIEW(name) void name(); @@ -422,8 +422,8 @@ private: TABLE(Budgets); VIEW(Balances); protected: - QMap m_tables; - QMap m_views; + TQMap m_tables; + TQMap m_views; }; class IMyMoneySerialize; @@ -432,7 +432,7 @@ class IMyMoneySerialize; * The MyMoneyDbColumn class is a base type for generic db columns. * Derived types exist for several common column types. */ -class MyMoneyStorageSql : public IMyMoneyStorageFormat, public QSqlDatabase, public KShared { +class MyMoneyStorageSql : public IMyMoneyStorageFormat, public TQSqlDatabase, public KShared { public: MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& = KURL()); @@ -444,7 +444,7 @@ public: * MyMoneyStorageSql - open database file * * @param url pseudo-URL of database to be opened - * @param openMode open mode, same as for QFile::open + * @param openMode open mode, same as for TQFile::open * @param clear whether existing data can be deleted * @return 0 - database successfully opened @@ -491,7 +491,7 @@ public: * @return : error message to be displayed * */ - const QString& lastError() const {return (m_error);}; + const TQString& lastError() const {return (m_error);}; /** * This method is used when a database file is open, and the data is to * be saved in a different file or format. It will ensure that all data @@ -533,40 +533,40 @@ public: void modifyBudget(const MyMoneyBudget& bud); void removeBudget(const MyMoneyBudget& bud); - unsigned long transactionCount (const QString& aid = QString()) const; - inline const QMap transactionCountMap () const + unsigned long transactionCount (const TQString& aid = TQString()) const; + inline const TQMap transactionCountMap () const {return (m_transactionCountMap);}; /** * the storage manager also needs the following read entry points */ - const QMap fetchAccounts (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchBalance(const QStringList& id, const QDate& date) const; - const QMap fetchBudgets (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchCurrencies (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchInstitutions (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchPayees (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const MyMoneyPriceList fetchPrices (const QStringList& fromIdList = QStringList (), const QStringList& toIdList = QStringList(), bool forUpdate = false) const; - const MyMoneyPrice fetchSinglePrice (const QString& fromIdList, const QString& toIdList, const QDate& date, bool exactDate, bool forUpdate = false) const; - const QMap fetchReports (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchSchedules (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchSecurities (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap fetchTransactions (const QString& tidList = QString (), const QString& dateClause = QString(), bool forUpdate = false) const; - const QMap fetchTransactions (const MyMoneyTransactionFilter& filter) const; - bool isReferencedByTransaction(const QString& id) const; - - void readPayees(const QString&); - void readPayees(const QValueList payeeList = QValueList()); + const TQMap fetchAccounts (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchBalance(const TQStringList& id, const TQDate& date) const; + const TQMap fetchBudgets (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchCurrencies (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchInstitutions (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchPayees (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const MyMoneyPriceList fetchPrices (const TQStringList& fromIdList = TQStringList (), const TQStringList& toIdList = TQStringList(), bool forUpdate = false) const; + const MyMoneyPrice fetchSinglePrice (const TQString& fromIdList, const TQString& toIdList, const TQDate& date, bool exactDate, bool forUpdate = false) const; + const TQMap fetchReports (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchSchedules (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchSecurities (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap fetchTransactions (const TQString& tidList = TQString (), const TQString& dateClause = TQString(), bool forUpdate = false) const; + const TQMap fetchTransactions (const MyMoneyTransactionFilter& filter) const; + bool isReferencedByTransaction(const TQString& id) const; + + void readPayees(const TQString&); + void readPayees(const TQValueList payeeList = TQValueList()); void readTransactions(const MyMoneyTransactionFilter& filter); - void setProgressCallback(void(*callback)(int, int, const QString&)); + void setProgressCallback(void(*callback)(int, int, const TQString&)); - virtual void readFile(QIODevice* s, IMyMoneySerialize* storage) { Q_UNUSED(s); Q_UNUSED(storage) }; - virtual void writeFile(QIODevice* s, IMyMoneySerialize* storage){ Q_UNUSED(s); Q_UNUSED(storage) }; + virtual void readFile(TQIODevice* s, IMyMoneySerialize* storage) { Q_UNUSED(s); Q_UNUSED(storage) }; + virtual void writeFile(TQIODevice* s, IMyMoneySerialize* storage){ Q_UNUSED(s); Q_UNUSED(storage) }; - void startCommitUnit (const QString& callingFunction); - bool endCommitUnit (const QString& callingFunction); - void cancelCommitUnit (const QString& callingFunction); + void startCommitUnit (const TQString& callingFunction); + bool endCommitUnit (const TQString& callingFunction); + void cancelCommitUnit (const TQString& callingFunction); - long unsigned getRecCount(const QString& table) const; + long unsigned getRecCount(const TQString& table) const; long unsigned getNextBudgetId() const; long unsigned getNextAccountId() const; long unsigned getNextInstitutionId() const; @@ -596,7 +596,7 @@ public: private: // a function to build a comprehensive error message - QString& buildError (const QSqlQuery& q, const QString& function, const QString& message) const; + TQString& buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const; // write routines void writeUserInformation(void); void writeInstitutions(void); @@ -614,9 +614,9 @@ private: void writeInstitution(const MyMoneyInstitution& i, MyMoneySqlQuery& q); void writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bool isUserInfo = false); void writeAccount (const MyMoneyAccount& a, MyMoneySqlQuery& q); - void writeTransaction(const QString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const QString& type); - void writeSplits(const QString& txId, const QString& type, const QValueList& splitList); - void writeSplit(const QString& txId, const MyMoneySplit& split, const QString& type, const int splitId, MyMoneySqlQuery& q); + void writeTransaction(const TQString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const TQString& type); + void writeSplits(const TQString& txId, const TQString& type, const TQValueList& splitList); + void writeSplit(const TQString& txId, const MyMoneySplit& split, const TQString& type, const int splitId, MyMoneySqlQuery& q); void writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuery& q, bool insert); void writeSecurity(const MyMoneySecurity& security, MyMoneySqlQuery& q); void writePricePair ( const MyMoneyPriceEntries& p); @@ -624,21 +624,21 @@ private: void writeCurrency(const MyMoneySecurity& currency, MyMoneySqlQuery& q); void writeReport (const MyMoneyReport& rep, MyMoneySqlQuery& q); void writeBudget (const MyMoneyBudget& bud, MyMoneySqlQuery& q); - void writeKeyValuePairs(const QString& kvpType, const QString& kvpId, const QMap& pairs); - void writeKeyValuePair(const QString& kvpType, const QString& kvpId, - const QString& kvpKey, const QString& kvpData); + void writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap& pairs); + void writeKeyValuePair(const TQString& kvpType, const TQString& kvpId, + const TQString& kvpKey, const TQString& kvpData); // read routines void readFileInfo(void); void readLogonData(void); void readUserInformation(void); void readInstitutions(void); void readAccounts(void); - void readTransaction(const QString id); - void readTransactions(const QString& tidList = QString(), const QString& dateClause = QString()); - void readTransaction(MyMoneyTransaction &tx, const QString& tid); + void readTransaction(const TQString id); + void readTransactions(const TQString& tidList = TQString(), const TQString& dateClause = TQString()); + void readTransaction(MyMoneyTransaction &tx, const TQString& tid); void readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, const MyMoneyDbTable& t) const; - const MyMoneyKeyValueContainer readKeyValuePairs (const QString& kvpType, const QString& kvpId) const; - const QMap readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const; + const MyMoneyKeyValueContainer readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const; + const TQMap readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const; void readSchedules(void); void readSecurities(void); void readPrices(void); @@ -646,27 +646,27 @@ private: void readReports(void); void readBudgets(void); - void deleteTransaction(const QString& id); - void deleteSchedule(const QString& id); - void deleteKeyValuePairs(const QString& kvpType, const QString& kvpId); - long unsigned calcHighId (const long unsigned&, const QString&); + void deleteTransaction(const TQString& id); + void deleteSchedule(const TQString& id); + void deleteKeyValuePairs(const TQString& kvpType, const TQString& kvpId); + long unsigned calcHighId (const long unsigned&, const TQString&); - void setVersion (const QString& version); + void setVersion (const TQString& version); - void signalProgress(int current, int total, const QString& = "") const; - void (*m_progressCallback)(int, int, const QString&); + void signalProgress(int current, int total, const TQString& = "") const; + void (*m_progressCallback)(int, int, const TQString&); - //void startCommitUnit (const QString& callingFunction); - //void endCommitUnit (const QString& callingFunction); - //void cancelCommitUnit (const QString& callingFunction); + //void startCommitUnit (const TQString& callingFunction); + //void endCommitUnit (const TQString& callingFunction); + //void cancelCommitUnit (const TQString& callingFunction); int splitState(const MyMoneyTransactionFilter::stateOptionE& state) const; - inline const QDate getDate (const QString& date) const { - return (date.isNull() ? QDate() : QDate::fromString(date, Qt::ISODate)); + inline const TQDate getDate (const TQString& date) const { + return (date.isNull() ? TQDate() : TQDate::fromString(date, Qt::ISODate)); } - inline const QDateTime getDateTime (const QString& date) const { - return (date.isNull() ? QDateTime() : QDateTime::fromString(date, Qt::ISODate)); + inline const TQDateTime getDateTime (const TQString& date) const { + return (date.isNull() ? TQDateTime() : TQDateTime::fromString(date, Qt::ISODate)); } // open routines @@ -690,16 +690,16 @@ private: bool sqliteAlterTable(const MyMoneyDbTable& t); bool addColumn(const MyMoneyDbTable& t, const MyMoneyDbColumn& c, - const QString& after = QString()); - bool addColumn(const QString& table, - const QString& column, - const QString& after = QString()); + const TQString& after = TQString()); + bool addColumn(const TQString& table, + const TQString& column, + const TQString& after = TQString()); bool dropColumn(const MyMoneyDbTable& t, - const QString& c); - bool dropColumn(const QString& table, - const QString& column); + const TQString& c); + bool dropColumn(const TQString& table, + const TQString& column); -// long long unsigned getRecCount(const QString& table); +// long long unsigned getRecCount(const TQString& table); int createTables(); void createTable(const MyMoneyDbTable& t); void clean (); @@ -716,7 +716,7 @@ private: bool m_loadAll; // preload all data bool m_override; // override open if already in use // error message - QString m_error; + TQString m_error; // record counts long unsigned m_institutions; long unsigned m_accounts; @@ -740,14 +740,14 @@ private: long unsigned m_hiIdReports; long unsigned m_hiIdBudgets; // encrypt option - usage TBD - QString m_encryptData; + TQString m_encryptData; /** * This variable is used to suppress status messages except during * initial data load and final write */ - bool m_displayStatus; + bool m_displaytqStatus; /** * On occasions, e.g. after a complex transaction search, or for populating a * payee popup list, it becomes necessary to load all data into memory. The @@ -760,19 +760,19 @@ private: * This member variable holds a list of those accounts for which all * transactions are in memory, thus saving reading them again */ -// QValueList m_accountsLoaded; +// TQValueList m_accountsLoaded; /** * This member variable is used when loading transactions to list all * referenced payees, which can then be read into memory (if not already there) */ -// QValueList m_payeeList; +// TQValueList m_payeeList; - void alert(QString s) const {qDebug("%s", s.ascii());}; // FIXME: remove... + void alert(TQString s) const {qDebug("%s", s.ascii());}; // FIXME: remove... /** The following keeps track of commitment units (known as transactions in SQL * though it would be confusing to use that term within KMM). It is implemented * as a stack for debug purposes. Long term, probably a count would suffice */ - QValueStack m_commitUnitStack; + TQValueStack m_commitUnitStack; /** * This member variable is used to preload transactions for preferred accounts */ @@ -790,13 +790,13 @@ private: * probably be moved into the MyMoneyAccount object; maybe we will do that once * the database code has been properly checked out */ - QMap m_transactionCountMap; + TQMap m_transactionCountMap; /** * These member variables hold the user name and date/time of logon */ - QString m_logonUser; - QDateTime m_logonAt; - QDateTime m_txPostDate; // FIXME: remove when Tom puts date into split object + TQString m_logonUser; + TQDateTime m_logonAt; + TQDateTime m_txPostDate; // FIXME: remove when Tom puts date into split object //Disable copying MyMoneyStorageSql (const MyMoneyStorageSql& rhs); diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp index e8027d1..49e0739 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp @@ -22,10 +22,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -52,49 +52,49 @@ class MyMoneyStorageXML::Private public: Private() {} - QMap iList; - QMap aList; - QMap tList; - QMap pList; - QMap sList; - QMap secList; - QMap rList; - QMap bList; - QMap prList; + TQMap iList; + TQMap aList; + TQMap tList; + TQMap pList; + TQMap sList; + TQMap secList; + TQMap rList; + TQMap bList; + TQMap prList; - QString m_fromSecurity; - QString m_toSecurity; + TQString m_fromSecurity; + TQString m_toSecurity; }; -class MyMoneyXmlContentHandler : public QXmlContentHandler +class MyMoneyXmlContentHandler : public TQXmlContentHandler { public: MyMoneyXmlContentHandler(MyMoneyStorageXML* reader); virtual ~MyMoneyXmlContentHandler() {} - virtual void setDocumentLocator (QXmlLocator * locator) { m_loc = locator; } + virtual void setDocumentLocator (TQXmlLocator * locator) { m_loc = locator; } virtual bool startDocument (void); virtual bool endDocument (void); - virtual bool startPrefixMapping(const QString & prefix, const QString & uri); - virtual bool endPrefixMapping(const QString & prefix); - virtual bool startElement(const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts); - virtual bool endElement(const QString & namespaceURI, const QString & localName, const QString & qName); - virtual bool characters(const QString & ch); - virtual bool ignorableWhitespace(const QString & ch); - virtual bool processingInstruction(const QString & target, const QString & data); - virtual bool skippedEntity(const QString & name); - virtual QString errorString(void); + virtual bool startPrefixMapping(const TQString & prefix, const TQString & uri); + virtual bool endPrefixMapping(const TQString & prefix); + virtual bool startElement(const TQString & namespaceURI, const TQString & localName, const TQString & qName, const TQXmlAttributes & atts); + virtual bool endElement(const TQString & namespaceURI, const TQString & localName, const TQString & qName); + virtual bool characters(const TQString & ch); + virtual bool ignorableWhitespace(const TQString & ch); + virtual bool processingInstruction(const TQString & target, const TQString & data); + virtual bool skippedEntity(const TQString & name); + virtual TQString errorString(void); private: MyMoneyStorageXML* m_reader; - QXmlLocator* m_loc; + TQXmlLocator* m_loc; int m_level; int m_elementCount; - QDomDocument m_doc; - QDomElement m_baseNode; - QDomElement m_currNode; - QString m_errMsg; + TQDomDocument m_doc; + TQDomElement m_baseNode; + TQDomElement m_currNode; + TQString m_errMsg; }; MyMoneyXmlContentHandler::MyMoneyXmlContentHandler(MyMoneyStorageXML* reader) : @@ -117,28 +117,28 @@ bool MyMoneyXmlContentHandler::endDocument(void) return true; } -bool MyMoneyXmlContentHandler::skippedEntity (const QString & /* name */) +bool MyMoneyXmlContentHandler::skippedEntity (const TQString & /* name */) { - // qDebug(QString("Skipped entity '%1'").arg(name)); + // qDebug(TQString("Skipped entity '%1'").tqarg(name)); return true; } -bool MyMoneyXmlContentHandler::startPrefixMapping (const QString& /*prefix */, const QString & /* uri */) +bool MyMoneyXmlContentHandler::startPrefixMapping (const TQString& /*prefix */, const TQString & /* uri */) { - // qDebug(QString("start prefix '%1', '%2'").arg(prefix).arg(uri)); + // qDebug(TQString("start prefix '%1', '%2'").tqarg(prefix).tqarg(uri)); return true; } -bool MyMoneyXmlContentHandler::endPrefixMapping (const QString& /* prefix */) +bool MyMoneyXmlContentHandler::endPrefixMapping (const TQString& /* prefix */) { - // qDebug(QString("end prefix '%1'").arg(prefix)); + // qDebug(TQString("end prefix '%1'").tqarg(prefix)); return true; } -bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, const QString& /* localName */, const QString& qName, const QXmlAttributes & atts) +bool MyMoneyXmlContentHandler::startElement (const TQString& /* namespaceURI */, const TQString& /* localName */, const TQString& qName, const TQXmlAttributes & atts) { if(m_level == 0) { - QString s = qName.lower(); + TQString s = qName.lower(); if(s == "transaction" || s == "account" || s == "price" @@ -162,28 +162,28 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, } else if(s == "transactions") { qDebug("reading transactions"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading transactions...")); m_elementCount = 0; } } else if(s == "accounts") { qDebug("reading accounts"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading accounts...")); m_elementCount = 0; } } else if(s == "securities") { qDebug("reading securities"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading securities...")); m_elementCount = 0; } } else if(s == "reports") { qDebug("reading reports"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading reports...")); m_elementCount = 0; } @@ -192,14 +192,14 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, m_elementCount = 0; } else if(s == "pricepair") { if(atts.count()) { - m_reader->d->m_fromSecurity = atts.value(QString("from")); - m_reader->d->m_toSecurity = atts.value(QString("to")); + m_reader->d->m_fromSecurity = atts.value(TQString("from")); + m_reader->d->m_toSecurity = atts.value(TQString("to")); } } } else { m_level++; - QDomElement node = m_doc.createElement(qName); + TQDomElement node = m_doc.createElement(qName); for(int i=0; i < atts.count(); ++i) { node.setAttribute(atts.qName(i), atts.value(i)); } @@ -209,12 +209,12 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, return true; } -bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, const QString& /* localName */, const QString& qName) +bool MyMoneyXmlContentHandler::endElement(const TQString& /* namespaceURI */, const TQString& /* localName */, const TQString& qName) { bool rc = true; - QString s = qName.lower(); + TQString s = qName.lower(); if(m_level) { - m_currNode = m_currNode.parentNode().toElement(); + m_currNode = m_currNode.tqparentNode().toElement(); m_level--; if(!m_level) { try { @@ -265,18 +265,18 @@ bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, con MyMoneyPrice p(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity, m_baseNode); m_reader->d->prList[MyMoneySecurityPair(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity)][p.date()] = p; } else { - m_errMsg = i18n("Unknown XML tag %1 found in line %2").arg(qName).arg(m_loc->lineNumber()); + m_errMsg = i18n("Unknown XML tag %1 found in line %2").tqarg(qName).tqarg(m_loc->lineNumber()); kdWarning() << m_errMsg << endl; rc = false; } m_reader->signalProgress(++m_elementCount, 0); } catch(MyMoneyException* e) { - m_errMsg = i18n("Exception while creating a %1 element: %2").arg(s).arg(e->what()); + m_errMsg = i18n("Exception while creating a %1 element: %2").tqarg(s).tqarg(e->what()); kdWarning() << m_errMsg << endl; delete e; rc = false; } - m_doc = QDomDocument(); + m_doc = TQDomDocument(); } } else { if(s == "institutions") { @@ -334,22 +334,22 @@ bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, con return rc; } -bool MyMoneyXmlContentHandler::characters(const QString& /* ch */) +bool MyMoneyXmlContentHandler::characters(const TQString& /* ch */) { return true; } -bool MyMoneyXmlContentHandler::ignorableWhitespace(const QString& /* ch */) +bool MyMoneyXmlContentHandler::ignorableWhitespace(const TQString& /* ch */) { return true; } -bool MyMoneyXmlContentHandler::processingInstruction(const QString& /* target */, const QString& /* data */) +bool MyMoneyXmlContentHandler::processingInstruction(const TQString& /* target */, const TQString& /* data */) { return true; } -QString MyMoneyXmlContentHandler::errorString(void) +TQString MyMoneyXmlContentHandler::errorString(void) { return m_errMsg; } @@ -373,7 +373,7 @@ MyMoneyStorageXML::~MyMoneyStorageXML() } // Function to read in the file, send to XML parser. -void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) +void MyMoneyStorageXML::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage) { Q_CHECK_PTR(storage); Q_CHECK_PTR(pDevice); @@ -382,20 +382,20 @@ void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) m_storage = storage; - m_doc = new QDomDocument; + m_doc = new TQDomDocument; Q_CHECK_PTR(m_doc); qDebug("reading file"); - // creating the QXmlInputSource object based on a QIODevice object + // creating the TQXmlInputSource object based on a TQIODevice object // reads all data of the underlying object into memory. I have not // found an object that reads on the fly. I tried to derive one myself, // but there could be a severe problem with decoding when reading // blocks of data and not a stream. So I left it the way it is. (ipwizard) - QXmlInputSource xml(pDevice); + TQXmlInputSource xml(pDevice); qDebug("start parsing file"); MyMoneyXmlContentHandler mmxml(this); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler(&mmxml); if(!reader.parse(&xml, false)) { @@ -421,7 +421,7 @@ void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) signalProgress(-1, -1); } -void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) +void MyMoneyStorageXML::writeFile(TQIODevice* qf, IMyMoneySerialize* storage) { Q_CHECK_PTR(qf); Q_CHECK_PTR(storage); @@ -432,67 +432,67 @@ void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) m_storage = storage; // qDebug("XMLWRITER: Starting file write"); - m_doc = new QDomDocument("KMYMONEY-FILE"); + m_doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(m_doc); - QDomProcessingInstruction instruct = m_doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\""); + TQDomProcessingInstruction instruct = m_doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\""); m_doc->appendChild(instruct); - QDomElement mainElement = m_doc->createElement("KMYMONEY-FILE"); + TQDomElement mainElement = m_doc->createElement("KMYMONEY-FILE"); m_doc->appendChild(mainElement); - QDomElement fileInfo = m_doc->createElement("FILEINFO"); + TQDomElement fileInfo = m_doc->createElement("FILEINFO"); writeFileInformation(fileInfo); mainElement.appendChild(fileInfo); - QDomElement userInfo = m_doc->createElement("USER"); + TQDomElement userInfo = m_doc->createElement("USER"); writeUserInformation(userInfo); mainElement.appendChild(userInfo); - QDomElement institutions = m_doc->createElement("INSTITUTIONS"); + TQDomElement institutions = m_doc->createElement("INSTITUTIONS"); writeInstitutions(institutions); mainElement.appendChild(institutions); - QDomElement payees = m_doc->createElement("PAYEES"); + TQDomElement payees = m_doc->createElement("PAYEES"); writePayees(payees); mainElement.appendChild(payees); - QDomElement accounts = m_doc->createElement("ACCOUNTS"); + TQDomElement accounts = m_doc->createElement("ACCOUNTS"); writeAccounts(accounts); mainElement.appendChild(accounts); - QDomElement transactions = m_doc->createElement("TRANSACTIONS"); + TQDomElement transactions = m_doc->createElement("TRANSACTIONS"); writeTransactions(transactions); mainElement.appendChild(transactions); - QDomElement keyvalpairs = writeKeyValuePairs(m_storage->pairs()); + TQDomElement keyvalpairs = writeKeyValuePairs(m_storage->pairs()); mainElement.appendChild(keyvalpairs); - QDomElement schedules = m_doc->createElement("SCHEDULES"); + TQDomElement schedules = m_doc->createElement("SCHEDULES"); writeSchedules(schedules); mainElement.appendChild(schedules); - QDomElement equities = m_doc->createElement("SECURITIES"); + TQDomElement equities = m_doc->createElement("SECURITIES"); writeSecurities(equities); mainElement.appendChild(equities); - QDomElement currencies = m_doc->createElement("CURRENCIES"); + TQDomElement currencies = m_doc->createElement("CURRENCIES"); writeCurrencies(currencies); mainElement.appendChild(currencies); - QDomElement prices = m_doc->createElement("PRICES"); + TQDomElement prices = m_doc->createElement("PRICES"); writePrices(prices); mainElement.appendChild(prices); - QDomElement reports = m_doc->createElement("REPORTS"); + TQDomElement reports = m_doc->createElement("REPORTS"); writeReports(reports); mainElement.appendChild(reports); - QDomElement budgets = m_doc->createElement("BUDGETS"); + TQDomElement budgets = m_doc->createElement("BUDGETS"); writeBudgets(budgets); mainElement.appendChild(budgets); - QTextStream stream(qf); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(qf); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << m_doc->toString(); delete m_doc; @@ -508,36 +508,36 @@ void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) m_storage = NULL; } -bool MyMoneyStorageXML::readFileInformation(const QDomElement& fileInfo) +bool MyMoneyStorageXML::readFileInformation(const TQDomElement& fileInfo) { signalProgress(0, 3, i18n("Loading file information...")); bool rc = true; - QDomElement temp = findChildElement("CREATION_DATE", fileInfo); - if (temp == QDomElement()) { + TQDomElement temp = findChildElement("CREATION_DATE", fileInfo); + if (temp == TQDomElement()) { rc = false; } - QString strDate = QStringEmpty(temp.attribute("date")); + TQString strDate = TQStringEmpty(temp.attribute("date")); m_storage->setCreationDate(stringToDate(strDate)); signalProgress(1, 0); temp = findChildElement("LAST_MODIFIED_DATE", fileInfo); - if (temp == QDomElement()) { + if (temp == TQDomElement()) { rc = false; } - strDate = QStringEmpty(temp.attribute("date")); + strDate = TQStringEmpty(temp.attribute("date")); m_storage->setLastModificationDate(stringToDate(strDate)); signalProgress(2, 0); temp = findChildElement("VERSION", fileInfo); - if (temp == QDomElement()) { + if (temp == TQDomElement()) { rc = false; } - QString strVersion = QStringEmpty(temp.attribute("id")); + TQString strVersion = TQStringEmpty(temp.attribute("id")); fileVersionRead = strVersion.toUInt(NULL, 16); temp = findChildElement("FIXVERSION", fileInfo); - if (temp != QDomElement()) { - QString strFixVersion = QStringEmpty(temp.attribute("id")); + if (temp != TQDomElement()) { + TQString strFixVersion = TQStringEmpty(temp.attribute("id")); m_storage->setFileFixVersion (strFixVersion.toUInt()); } // FIXME The old version stuff used this rather odd number @@ -549,33 +549,33 @@ bool MyMoneyStorageXML::readFileInformation(const QDomElement& fileInfo) return rc; } -void MyMoneyStorageXML::writeFileInformation(QDomElement& fileInfo) +void MyMoneyStorageXML::writeFileInformation(TQDomElement& fileInfo) { - QDomElement creationDate = m_doc->createElement("CREATION_DATE"); + TQDomElement creationDate = m_doc->createElement("CREATION_DATE"); creationDate.setAttribute("date", dateToString(m_storage->creationDate())); fileInfo.appendChild(creationDate); - QDomElement lastModifiedDate = m_doc->createElement("LAST_MODIFIED_DATE"); + TQDomElement lastModifiedDate = m_doc->createElement("LAST_MODIFIED_DATE"); lastModifiedDate.setAttribute("date", dateToString(m_storage->lastModificationDate())); fileInfo.appendChild(lastModifiedDate); - QDomElement version = m_doc->createElement("VERSION"); + TQDomElement version = m_doc->createElement("VERSION"); version.setAttribute("id", "1"); fileInfo.appendChild(version); - QDomElement fixVersion = m_doc->createElement("FIXVERSION"); + TQDomElement fixVersion = m_doc->createElement("FIXVERSION"); fixVersion.setAttribute("id", m_storage->fileFixVersion()); fileInfo.appendChild(fixVersion); } -void MyMoneyStorageXML::writeUserInformation(QDomElement& userInfo) +void MyMoneyStorageXML::writeUserInformation(TQDomElement& userInfo) { MyMoneyPayee user = m_storage->user(); userInfo.setAttribute("name", user.name()); userInfo.setAttribute("email", user.email()); - QDomElement address = m_doc->createElement("ADDRESS"); + TQDomElement address = m_doc->createElement("ADDRESS"); address.setAttribute("street", user.address()); address.setAttribute("city", user.city()); address.setAttribute("county", user.state()); @@ -585,22 +585,22 @@ void MyMoneyStorageXML::writeUserInformation(QDomElement& userInfo) userInfo.appendChild(address); } -bool MyMoneyStorageXML::readUserInformation(const QDomElement& userElement) +bool MyMoneyStorageXML::readUserInformation(const TQDomElement& userElement) { bool rc = true; signalProgress(0, 1, i18n("Loading user information...")); MyMoneyPayee user; - user.setName(QStringEmpty(userElement.attribute("name"))); - user.setEmail(QStringEmpty(userElement.attribute("email"))); + user.setName(TQStringEmpty(userElement.attribute("name"))); + user.setEmail(TQStringEmpty(userElement.attribute("email"))); - QDomElement addressNode = findChildElement("ADDRESS", userElement); + TQDomElement addressNode = findChildElement("ADDRESS", userElement); if(!addressNode.isNull()) { - user.setAddress(QStringEmpty(addressNode.attribute("street"))); - user.setCity(QStringEmpty(addressNode.attribute("city"))); - user.setState(QStringEmpty(addressNode.attribute("county"))); - user.setPostcode(QStringEmpty(addressNode.attribute("zipcode"))); - user.setTelephone(QStringEmpty(addressNode.attribute("telephone"))); + user.setAddress(TQStringEmpty(addressNode.attribute("street"))); + user.setCity(TQStringEmpty(addressNode.attribute("city"))); + user.setState(TQStringEmpty(addressNode.attribute("county"))); + user.setPostcode(TQStringEmpty(addressNode.attribute("zipcode"))); + user.setTelephone(TQStringEmpty(addressNode.attribute("telephone"))); } m_storage->setUser(user); @@ -609,41 +609,41 @@ bool MyMoneyStorageXML::readUserInformation(const QDomElement& userElement) return rc; } -void MyMoneyStorageXML::writeInstitutions(QDomElement& institutions) +void MyMoneyStorageXML::writeInstitutions(TQDomElement& institutions) { - const QValueList list = m_storage->institutionList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->institutionList(); + TQValueList::ConstIterator it; institutions.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) writeInstitution(institutions, *it); } -void MyMoneyStorageXML::writeInstitution(QDomElement& institution, const MyMoneyInstitution& i) +void MyMoneyStorageXML::writeInstitution(TQDomElement& institution, const MyMoneyInstitution& i) { i.writeXML(*m_doc, institution); } -void MyMoneyStorageXML::writePayees(QDomElement& payees) +void MyMoneyStorageXML::writePayees(TQDomElement& payees) { - const QValueList list = m_storage->payeeList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->payeeList(); + TQValueList::ConstIterator it; payees.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) writePayee(payees, *it); } -void MyMoneyStorageXML::writePayee(QDomElement& payee, const MyMoneyPayee& p) +void MyMoneyStorageXML::writePayee(TQDomElement& payee, const MyMoneyPayee& p) { p.writeXML(*m_doc, payee); } -void MyMoneyStorageXML::writeAccounts(QDomElement& accounts) +void MyMoneyStorageXML::writeAccounts(TQDomElement& accounts) { - QValueList list; + TQValueList list; m_storage->accountList(list); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; accounts.setAttribute("count", list.count()+5); writeAccount(accounts, m_storage->asset()); @@ -660,20 +660,20 @@ void MyMoneyStorageXML::writeAccounts(QDomElement& accounts) } } -void MyMoneyStorageXML::writeAccount(QDomElement& account, const MyMoneyAccount& p) +void MyMoneyStorageXML::writeAccount(TQDomElement& account, const MyMoneyAccount& p) { p.writeXML(*m_doc, account); } -void MyMoneyStorageXML::writeTransactions(QDomElement& transactions) +void MyMoneyStorageXML::writeTransactions(TQDomElement& transactions) { MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList list; + TQValueList list; m_storage->transactionList(list, filter); transactions.setAttribute("count", list.count()); - QValueList::ConstIterator it; + TQValueList::ConstIterator it; signalProgress(0, list.count(), i18n("Saving transactions...")); @@ -685,15 +685,15 @@ void MyMoneyStorageXML::writeTransactions(QDomElement& transactions) } } -void MyMoneyStorageXML::writeTransaction(QDomElement& transaction, const MyMoneyTransaction& tx) +void MyMoneyStorageXML::writeTransaction(TQDomElement& transaction, const MyMoneyTransaction& tx) { tx.writeXML(*m_doc, transaction); } -void MyMoneyStorageXML::writeSchedules(QDomElement& scheduled) +void MyMoneyStorageXML::writeSchedules(TQDomElement& scheduled) { - const QValueList list = m_storage->scheduleList(); - QValueList::ConstIterator it; + const TQValueList list = m_storage->scheduleList(); + TQValueList::ConstIterator it; scheduled.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) @@ -702,86 +702,86 @@ void MyMoneyStorageXML::writeSchedules(QDomElement& scheduled) } } -void MyMoneyStorageXML::writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx) +void MyMoneyStorageXML::writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx) { tx.writeXML(*m_doc, scheduledTx); } -void MyMoneyStorageXML::writeSecurities(QDomElement& equities) +void MyMoneyStorageXML::writeSecurities(TQDomElement& equities) { - const QValueList securityList = m_storage->securityList(); + const TQValueList securityList = m_storage->securityList(); equities.setAttribute("count", securityList.count()); if(securityList.size()) { - for(QValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) + for(TQValueList::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { writeSecurity(equities, (*it)); } } } -void MyMoneyStorageXML::writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security) +void MyMoneyStorageXML::writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security) { security.writeXML(*m_doc, securityElement); } -void MyMoneyStorageXML::writeCurrencies(QDomElement& currencies) +void MyMoneyStorageXML::writeCurrencies(TQDomElement& currencies) { - const QValueList currencyList = m_storage->currencyList(); + const TQValueList currencyList = m_storage->currencyList(); currencies.setAttribute("count", currencyList.count()); if(currencyList.size()) { - for(QValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) + for(TQValueList::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { writeSecurity(currencies, (*it)); } } } -void MyMoneyStorageXML::writeReports(QDomElement& parent) +void MyMoneyStorageXML::writeReports(TQDomElement& tqparent) { - const QValueList list = m_storage->reportList(); - QValueList::ConstIterator it; - parent.setAttribute("count", list.count()); + const TQValueList list = m_storage->reportList(); + TQValueList::ConstIterator it; + tqparent.setAttribute("count", list.count()); signalProgress(0, list.count(), i18n("Saving reports...")); unsigned i = 0; for(it = list.begin(); it != list.end(); ++it) { - (*it).writeXML(*m_doc, parent); + (*it).writeXML(*m_doc, tqparent); signalProgress(++i, 0); } } -void MyMoneyStorageXML::writeBudgets(QDomElement& parent) +void MyMoneyStorageXML::writeBudgets(TQDomElement& tqparent) { - const QValueList list = m_storage->budgetList(); - QValueList::ConstIterator it; - parent.setAttribute("count", list.count()); + const TQValueList list = m_storage->budgetList(); + TQValueList::ConstIterator it; + tqparent.setAttribute("count", list.count()); signalProgress(0, list.count(), i18n("Saving budgets...")); unsigned i = 0; for(it = list.begin(); it != list.end(); ++it) { - writeBudget(parent, (*it)); + writeBudget(tqparent, (*it)); signalProgress(++i, 0); } } -void MyMoneyStorageXML::writeBudget(QDomElement& budget, const MyMoneyBudget& b) +void MyMoneyStorageXML::writeBudget(TQDomElement& budget, const MyMoneyBudget& b) { b.writeXML(*m_doc, budget); } -QDomElement MyMoneyStorageXML::findChildElement(const QString& name, const QDomElement& root) +TQDomElement MyMoneyStorageXML::findChildElement(const TQString& name, const TQDomElement& root) { - QDomNode child = root.firstChild(); + TQDomNode child = root.firstChild(); while(!child.isNull()) { if(child.isElement()) { - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); if(name == childElement.tagName()) { return childElement; @@ -790,29 +790,29 @@ QDomElement MyMoneyStorageXML::findChildElement(const QString& name, const QDomE child = child.nextSibling(); } - return QDomElement(); + return TQDomElement(); } -QDomElement MyMoneyStorageXML::writeKeyValuePairs(const QMap pairs) +TQDomElement MyMoneyStorageXML::writeKeyValuePairs(const TQMap pairs) { if(m_doc) { - QDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS"); + TQDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS"); - QMap::const_iterator it; + TQMap::const_iterator it; for(it = pairs.begin(); it != pairs.end(); ++it) { - QDomElement pair = m_doc->createElement("PAIR"); + TQDomElement pair = m_doc->createElement("PAIR"); pair.setAttribute("key", it.key()); pair.setAttribute("value", it.data()); keyValPairs.appendChild(pair); } return keyValPairs; } - return QDomElement(); + return TQDomElement(); } -void MyMoneyStorageXML::writePrices(QDomElement& prices) +void MyMoneyStorageXML::writePrices(TQDomElement& prices) { const MyMoneyPriceList list = m_storage->priceList(); MyMoneyPriceList::ConstIterator it; @@ -820,7 +820,7 @@ void MyMoneyStorageXML::writePrices(QDomElement& prices) for(it = list.begin(); it != list.end(); ++it) { - QDomElement price = m_doc->createElement("PRICEPAIR"); + TQDomElement price = m_doc->createElement("PRICEPAIR"); price.setAttribute("from", it.key().first); price.setAttribute("to", it.key().second); writePricePair(price, *it); @@ -828,29 +828,29 @@ void MyMoneyStorageXML::writePrices(QDomElement& prices) } } -void MyMoneyStorageXML::writePricePair(QDomElement& price, const MyMoneyPriceEntries& p) +void MyMoneyStorageXML::writePricePair(TQDomElement& price, const MyMoneyPriceEntries& p) { MyMoneyPriceEntries::ConstIterator it; for(it = p.begin(); it != p.end(); ++it) { - QDomElement entry = m_doc->createElement("PRICE"); + TQDomElement entry = m_doc->createElement("PRICE"); writePrice(entry, *it); price.appendChild(entry); } } -void MyMoneyStorageXML::writePrice(QDomElement& price, const MyMoneyPrice& p) +void MyMoneyStorageXML::writePrice(TQDomElement& price, const MyMoneyPrice& p) { price.setAttribute("date", p.date().toString(Qt::ISODate)); - price.setAttribute("price", p.rate(QString()).toString()); + price.setAttribute("price", p.rate(TQString()).toString()); price.setAttribute("source", p.source()); } -void MyMoneyStorageXML::setProgressCallback(void(*callback)(int, int, const QString&)) +void MyMoneyStorageXML::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStorageXML::signalProgress(int current, int total, const QString& msg) +void MyMoneyStorageXML::signalProgress(int current, int total, const TQString& msg) { if(m_progressCallback != 0) (*m_progressCallback)(current, total, msg); @@ -860,23 +860,23 @@ void MyMoneyStorageXML::signalProgress(int current, int total, const QString& ms This convenience function returns all of the remaining data in the device. - @note It's copied from the original Qt sources and modified to + @note It's copied from the original TQt sources and modified to fix a problem with KFilterDev that does not correctly return atEnd() status in certain circumstances which caused our application to lock at startup. */ -QByteArray QIODevice::readAll() +TQByteArray TQIODevice::readAll() { if ( isDirectAccess() ) { // we know the size int n = size()-at(); // ### fix for 64-bit or large files? int totalRead = 0; - QByteArray ba( n ); + TQByteArray ba( n ); char* c = ba.data(); while ( n ) { int r = readBlock( c, n ); if ( r < 0 ) - return QByteArray(); + return TQByteArray(); n -= r; c += r; totalRead += r; @@ -892,13 +892,13 @@ QByteArray QIODevice::readAll() // read until we reach the end const int blocksize = 512; int nread = 0; - QByteArray ba; + TQByteArray ba; int r = 1; while ( !atEnd() && r != 0) { ba.resize( nread + blocksize ); r = readBlock( ba.data()+nread, blocksize ); if ( r < 0 ) - return QByteArray(); + return TQByteArray(); nread += r; } ba.resize( nread ); diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.h b/kmymoney2/mymoney/storage/mymoneystoragexml.h index 8485978..b74626d 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.h +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.h @@ -23,9 +23,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -class QIODevice; +#include +#include +class TQIODevice; // ---------------------------------------------------------------------------- // Project Includes @@ -54,78 +54,78 @@ public: }; protected: - void setProgressCallback(void(*callback)(int, int, const QString&)); - void signalProgress(int current, int total, const QString& = ""); + void setProgressCallback(void(*callback)(int, int, const TQString&)); + void signalProgress(int current, int total, const TQString& = ""); /** * This method returns the version of the underlying file. It * is used by the MyMoney objects contained in a MyMoneyStorageBin object (e.g. * MyMoneyAccount, MyMoneyInstitution, MyMoneyTransaction, etc.) to - * determine the layout used when reading/writing a persistant file. + * determine the tqlayout used when reading/writing a persistant file. * A parameter is used to determine the direction. * * @param dir information about the direction (reading/writing). The * default is reading. * - * @return version QString of file's version + * @return version TQString of file's version * * @see m_fileVersionRead, m_fileVersionWrite */ static unsigned int fileVersion(fileVersionDirectionType dir = Reading); - QValueList readElements(QString groupTag, QString itemTag = QString()); + TQValueList readElements(TQString groupTag, TQString itemTag = TQString()); - bool readFileInformation(const QDomElement& fileInfo); - virtual void writeFileInformation(QDomElement& fileInfo); + bool readFileInformation(const TQDomElement& fileInfo); + virtual void writeFileInformation(TQDomElement& fileInfo); - virtual void writeUserInformation(QDomElement& userInfo); + virtual void writeUserInformation(TQDomElement& userInfo); - virtual void writeInstitution(QDomElement& institutions, const MyMoneyInstitution& i); - virtual void writeInstitutions(QDomElement& institutions); + virtual void writeInstitution(TQDomElement& institutions, const MyMoneyInstitution& i); + virtual void writeInstitutions(TQDomElement& institutions); - virtual void writePrices(QDomElement& prices); - virtual void writePricePair(QDomElement& price, const MyMoneyPriceEntries& p); - virtual void writePrice(QDomElement& prices, const MyMoneyPrice& p); + virtual void writePrices(TQDomElement& prices); + virtual void writePricePair(TQDomElement& price, const MyMoneyPriceEntries& p); + virtual void writePrice(TQDomElement& prices, const MyMoneyPrice& p); - virtual void writePayees(QDomElement& payees); - virtual void writePayee(QDomElement& payees, const MyMoneyPayee& p); + virtual void writePayees(TQDomElement& payees); + virtual void writePayee(TQDomElement& payees, const MyMoneyPayee& p); - virtual void writeAccounts(QDomElement& accounts); - virtual void writeAccount(QDomElement& accounts, const MyMoneyAccount& p); + virtual void writeAccounts(TQDomElement& accounts); + virtual void writeAccount(TQDomElement& accounts, const MyMoneyAccount& p); - virtual void writeTransactions(QDomElement& transactions); - virtual void writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx); + virtual void writeTransactions(TQDomElement& transactions); + virtual void writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx); - virtual void writeSchedules(QDomElement& scheduled); - virtual void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx); + virtual void writeSchedules(TQDomElement& scheduled); + virtual void writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx); - virtual void writeReports(QDomElement& e); - virtual void writeBudgets(QDomElement& e); - virtual void writeBudget(QDomElement& budget, const MyMoneyBudget& b); + virtual void writeReports(TQDomElement& e); + virtual void writeBudgets(TQDomElement& e); + virtual void writeBudget(TQDomElement& budget, const MyMoneyBudget& b); - virtual void writeSecurities(QDomElement& securities); - virtual void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security); + virtual void writeSecurities(TQDomElement& securities); + virtual void writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security); - virtual void writeCurrencies(QDomElement& currencies); + virtual void writeCurrencies(TQDomElement& currencies); - virtual QDomElement writeKeyValuePairs(const QMap pairs); + virtual TQDomElement writeKeyValuePairs(const TQMap pairs); - virtual void readFile(QIODevice* s, IMyMoneySerialize* storage); - virtual void writeFile(QIODevice* s, IMyMoneySerialize* storage); + virtual void readFile(TQIODevice* s, IMyMoneySerialize* storage); + virtual void writeFile(TQIODevice* s, IMyMoneySerialize* storage); - bool readUserInformation(const QDomElement& userElement); + bool readUserInformation(const TQDomElement& userElement); - void readPricePair(const QDomElement& pricePair); - const MyMoneyPrice readPrice(const QString& from, const QString& to, const QDomElement& price); + void readPricePair(const TQDomElement& pricePair); + const MyMoneyPrice readPrice(const TQString& from, const TQString& to, const TQDomElement& price); - QDomElement findChildElement(const QString& name, const QDomElement& root); + TQDomElement findChildElement(const TQString& name, const TQDomElement& root); private: - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); protected: IMyMoneySerialize *m_storage; - QDomDocument *m_doc; + TQDomDocument *m_doc; private: /// \internal d-pointer class. @@ -149,7 +149,7 @@ private: * temporarily to convert the price history from the old to the * new format. This should go at some time beyond 0.8 (ipwizard) */ - QString m_baseCurrencyId; + TQString m_baseCurrencyId; }; diff --git a/kmymoney2/plugins/importinterface.cpp b/kmymoney2/plugins/importinterface.cpp index ce867c8..9c90df8 100644 --- a/kmymoney2/plugins/importinterface.cpp +++ b/kmymoney2/plugins/importinterface.cpp @@ -26,8 +26,8 @@ #include "importinterface.h" -KMyMoneyPlugin::ImportInterface::ImportInterface(QObject* parent, const char* name) : - QObject(parent, name) +KMyMoneyPlugin::ImportInterface::ImportInterface(TQObject* tqparent, const char* name) : + TQObject(tqparent, name) { } diff --git a/kmymoney2/plugins/importinterface.h b/kmymoney2/plugins/importinterface.h index 4b8a347..26083c1 100644 --- a/kmymoney2/plugins/importinterface.h +++ b/kmymoney2/plugins/importinterface.h @@ -25,8 +25,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,15 +46,16 @@ namespace KMyMoneyPlugin { * This abstract class represents the ImportInterface to * add new importers to KMyMoney. */ -class KMYMONEY_EXPORT ImportInterface : public QObject +class KMYMONEY_EXPORT ImportInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: - ImportInterface(QObject* parent, const char* name = 0); + ImportInterface(TQObject* tqparent, const char* name = 0); ~ImportInterface() {} - virtual KURL selectFile(const QString& title, const QString& path, const QString& mask, KFile::Mode mode) const = 0; + virtual KURL selectFile(const TQString& title, const TQString& path, const TQString& tqmask, KFile::Mode mode) const = 0; signals: }; diff --git a/kmymoney2/plugins/interfaces/kmmimportinterface.cpp b/kmymoney2/plugins/interfaces/kmmimportinterface.cpp index b3c54d8..d21959b 100644 --- a/kmymoney2/plugins/interfaces/kmmimportinterface.cpp +++ b/kmymoney2/plugins/interfaces/kmmimportinterface.cpp @@ -27,15 +27,15 @@ #include "../../kmymoney2.h" #include "kmmimportinterface.h" -KMyMoneyPlugin::KMMImportInterface::KMMImportInterface(KMyMoney2App* app, QObject* parent, const char* name) : - ImportInterface(parent, name), +KMyMoneyPlugin::KMMImportInterface::KMMImportInterface(KMyMoney2App* app, TQObject* tqparent, const char* name) : + ImportInterface(tqparent, name), m_app(app) { } -KURL KMyMoneyPlugin::KMMImportInterface::selectFile(const QString& title, const QString& path, const QString& mask, KFile::Mode mode) const +KURL KMyMoneyPlugin::KMMImportInterface::selectFile(const TQString& title, const TQString& path, const TQString& tqmask, KFile::Mode mode) const { - return m_app->selectFile(title, path, mask, mode); + return m_app->selectFile(title, path, tqmask, mode); } #include "kmmimportinterface.moc" diff --git a/kmymoney2/plugins/interfaces/kmmimportinterface.h b/kmymoney2/plugins/interfaces/kmmimportinterface.h index 484a228..97ffa5e 100644 --- a/kmymoney2/plugins/interfaces/kmmimportinterface.h +++ b/kmymoney2/plugins/interfaces/kmmimportinterface.h @@ -45,12 +45,13 @@ namespace KMyMoneyPlugin { */ class KMMImportInterface : public ImportInterface { Q_OBJECT + TQ_OBJECT public: - KMMImportInterface(KMyMoney2App* app, QObject* parent, const char* name = 0); + KMMImportInterface(KMyMoney2App* app, TQObject* tqparent, const char* name = 0); ~KMMImportInterface() {} - KURL selectFile(const QString& title, const QString& path, const QString& mask, KFile::Mode mode) const; + KURL selectFile(const TQString& title, const TQString& path, const TQString& tqmask, KFile::Mode mode) const; private: KMyMoney2App* m_app; diff --git a/kmymoney2/plugins/interfaces/kmmstatementinterface.cpp b/kmymoney2/plugins/interfaces/kmmstatementinterface.cpp index 9e09db2..c14caea 100644 --- a/kmymoney2/plugins/interfaces/kmmstatementinterface.cpp +++ b/kmymoney2/plugins/interfaces/kmmstatementinterface.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -31,8 +31,8 @@ #include #include -KMyMoneyPlugin::KMMStatementInterface::KMMStatementInterface(KMyMoney2App* app, QObject* parent, const char* name) : - StatementInterface(parent, name), +KMyMoneyPlugin::KMMStatementInterface::KMMStatementInterface(KMyMoney2App* app, TQObject* tqparent, const char* name) : + StatementInterface(tqparent, name), m_app(app) { } @@ -43,7 +43,7 @@ bool KMyMoneyPlugin::KMMStatementInterface::import(const MyMoneyStatement& s) return m_app->slotStatementImport(s); } -const MyMoneyAccount& KMyMoneyPlugin::KMMStatementInterface::account(const QString& key, const QString& value) const +const MyMoneyAccount& KMyMoneyPlugin::KMMStatementInterface::account(const TQString& key, const TQString& value) const { return m_app->account(key, value); } diff --git a/kmymoney2/plugins/interfaces/kmmstatementinterface.h b/kmymoney2/plugins/interfaces/kmmstatementinterface.h index 7890002..6eee779 100644 --- a/kmymoney2/plugins/interfaces/kmmstatementinterface.h +++ b/kmymoney2/plugins/interfaces/kmmstatementinterface.h @@ -46,9 +46,10 @@ namespace KMyMoneyPlugin { class KMMStatementInterface : public StatementInterface { Q_OBJECT + TQ_OBJECT public: - KMMStatementInterface(KMyMoney2App* app, QObject* parent, const char* name = 0); + KMMStatementInterface(KMyMoney2App* app, TQObject* tqparent, const char* name = 0); ~KMMStatementInterface() {} /** @@ -61,7 +62,7 @@ public: * If the account is not found in the list of accounts, MyMoneyAccount() * is returned. */ - const MyMoneyAccount& account(const QString& key, const QString& value) const; + const MyMoneyAccount& account(const TQString& key, const TQString& value) const; /** * This method stores the online parameters in @a kvps used by the plugin diff --git a/kmymoney2/plugins/interfaces/kmmviewinterface.cpp b/kmymoney2/plugins/interfaces/kmmviewinterface.cpp index 9779876..cc6ec5b 100644 --- a/kmymoney2/plugins/interfaces/kmmviewinterface.cpp +++ b/kmymoney2/plugins/interfaces/kmmviewinterface.cpp @@ -29,28 +29,28 @@ #include "../../widgets/selectedtransaction.h" #include "kmmviewinterface.h" -KMyMoneyPlugin::KMMViewInterface::KMMViewInterface(KMyMoney2App* app, KMyMoneyView* view, QObject* parent, const char* name) : - ViewInterface(parent, name), +KMyMoneyPlugin::KMMViewInterface::KMMViewInterface(KMyMoney2App* app, KMyMoneyView* view, TQObject* tqparent, const char* name) : + ViewInterface(tqparent, name), m_app(app), m_view(view) { - connect(app, SIGNAL(accountSelected(const MyMoneyAccount&)), this, SIGNAL(accountSelected(const MyMoneyAccount&))); - connect(app, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), this, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&))); - connect(app, SIGNAL(accountReconciled(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&, const MyMoneyMoney&, const QValueList >&)), - this, SIGNAL(accountReconciled(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&, const MyMoneyMoney&, const QValueList >&))); + connect(app, TQT_SIGNAL(accountSelected(const MyMoneyAccount&)), this, TQT_SIGNAL(accountSelected(const MyMoneyAccount&))); + connect(app, TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&))); + connect(app, TQT_SIGNAL(accountReconciled(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&, const MyMoneyMoney&, const TQValueList >&)), + this, TQT_SIGNAL(accountReconciled(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&, const MyMoneyMoney&, const TQValueList >&))); - connect(app, SIGNAL(institutionSelected(const MyMoneyInstitution&)), this, SIGNAL(institutionSelected(const MyMoneyInstitution&))); + connect(app, TQT_SIGNAL(institutionSelected(const MyMoneyInstitution&)), this, TQT_SIGNAL(institutionSelected(const MyMoneyInstitution&))); - connect(m_view, SIGNAL(viewStateChanged(bool)), this, SIGNAL(viewStateChanged(bool))); - connect(m_view, SIGNAL(kmmFilePlugin(unsigned int)), this, SIGNAL(kmmFilePlugin(unsigned int))); + connect(m_view, TQT_SIGNAL(viewStateChanged(bool)), this, TQT_SIGNAL(viewStateChanged(bool))); + connect(m_view, TQT_SIGNAL(kmmFilePlugin(unsigned int)), this, TQT_SIGNAL(kmmFilePlugin(unsigned int))); } -KMyMoneyViewBase* KMyMoneyPlugin::KMMViewInterface::addPage(const QString& item, const QString& icon) +KMyMoneyViewBase* KMyMoneyPlugin::KMMViewInterface::addPage(const TQString& item, const TQString& icon) { return m_view->addPage(item, icon); } -void KMyMoneyPlugin::KMMViewInterface::addWidget(KMyMoneyViewBase* view, QWidget* w) +void KMyMoneyPlugin::KMMViewInterface::addWidget(KMyMoneyViewBase* view, TQWidget* w) { if(view && w) view->addWidget(w); diff --git a/kmymoney2/plugins/interfaces/kmmviewinterface.h b/kmymoney2/plugins/interfaces/kmmviewinterface.h index d06b4f8..9797a8c 100644 --- a/kmymoney2/plugins/interfaces/kmmviewinterface.h +++ b/kmymoney2/plugins/interfaces/kmmviewinterface.h @@ -45,9 +45,10 @@ namespace KMyMoneyPlugin { */ class KMMViewInterface : public ViewInterface { Q_OBJECT + TQ_OBJECT public: - KMMViewInterface(KMyMoney2App* app, KMyMoneyView* view, QObject* parent, const char* name = 0); + KMMViewInterface(KMyMoney2App* app, KMyMoneyView* view, TQObject* tqparent, const char* name = 0); ~KMMViewInterface() {} /** @@ -59,7 +60,7 @@ public: * * @return pointer to KMyMoneyViewBase object */ - KMyMoneyViewBase* addPage(const QString& item, const QString& icon); + KMyMoneyViewBase* addPage(const TQString& item, const TQString& icon); /** * This method allows to add a widget to the view @@ -68,7 +69,7 @@ public: * @param view pointer to view object * @param w pointer to widget */ - void addWidget(KMyMoneyViewBase* view, QWidget* w); + void addWidget(KMyMoneyViewBase* view, TQWidget* w); private: KMyMoney2App* m_app; diff --git a/kmymoney2/plugins/kmymoneyplugin.cpp b/kmymoney2/plugins/kmymoneyplugin.cpp index ddca52a..d604d19 100644 --- a/kmymoney2/plugins/kmymoneyplugin.cpp +++ b/kmymoney2/plugins/kmymoneyplugin.cpp @@ -31,8 +31,8 @@ #include "kmymoneyplugin.h" -KMyMoneyPlugin::Plugin::Plugin(QObject* o, const char* name) : - QObject(o, name) +KMyMoneyPlugin::Plugin::Plugin(TQObject* o, const char* name) : + TQObject(o, name) { } @@ -40,10 +40,10 @@ KMyMoneyPlugin::Plugin::~Plugin() { } -KAction* KMyMoneyPlugin::Plugin::action(const QString& actionName) const +KAction* KMyMoneyPlugin::Plugin::action(const TQString& actionName) const { static KShortcut shortcut(""); - static KAction dummyAction(QString("Dummy"), QString(), shortcut, static_cast(this), 0, static_cast(0), ""); + static KAction dummyAction(TQString("Dummy"), TQString(), shortcut, static_cast(this), 0, static_cast(0), ""); KAction* p = actionCollection()->action(actionName.latin1()); if(p) @@ -53,10 +53,10 @@ KAction* KMyMoneyPlugin::Plugin::action(const QString& actionName) const return &dummyAction; } -KToggleAction* KMyMoneyPlugin::Plugin::toggleAction(const QString& actionName) const +KToggleAction* KMyMoneyPlugin::Plugin::toggleAction(const TQString& actionName) const { static KShortcut shortcut(""); - static KToggleAction dummyAction(QString("Dummy"), QString(), shortcut, static_cast(this), 0, static_cast(0), ""); + static KToggleAction dummyAction(TQString("Dummy"), TQString(), shortcut, static_cast(this), 0, static_cast(0), ""); KAction* q = actionCollection()->action(actionName.latin1()); @@ -75,17 +75,17 @@ KToggleAction* KMyMoneyPlugin::Plugin::toggleAction(const QString& actionName) c KMyMoneyPlugin::ViewInterface* KMyMoneyPlugin::Plugin::viewInterface() const { - return static_cast( parent()->child( 0, "KMyMoneyPlugin::ViewInterface" ) ); + return static_cast( tqparent()->child( 0, "KMyMoneyPlugin::ViewInterface" ) ); } KMyMoneyPlugin::StatementInterface* KMyMoneyPlugin::Plugin::statementInterface() const { - return static_cast( parent()->child( 0, "KMyMoneyPlugin::StatementInterface" ) ); + return static_cast( tqparent()->child( 0, "KMyMoneyPlugin::StatementInterface" ) ); } KMyMoneyPlugin::ImportInterface* KMyMoneyPlugin::Plugin::importInterface() const { - return static_cast( parent()->child( 0, "KMyMoneyPlugin::ImportInterface" ) ); + return static_cast( tqparent()->child( 0, "KMyMoneyPlugin::ImportInterface" ) ); } #include "kmymoneyplugin.moc" diff --git a/kmymoney2/plugins/kmymoneyplugin.h b/kmymoney2/plugins/kmymoneyplugin.h index 2978fde..f5cdac6 100644 --- a/kmymoney2/plugins/kmymoneyplugin.h +++ b/kmymoney2/plugins/kmymoneyplugin.h @@ -25,7 +25,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -56,19 +56,20 @@ namespace KMyMoneyPlugin { * http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html * */ - class KMYMONEY_EXPORT Plugin : public QObject, public KXMLGUIClient + class KMYMONEY_EXPORT Plugin : public TQObject, public KXMLGUIClient { Q_OBJECT + TQ_OBJECT public: - Plugin(QObject* parent, const char* name); + Plugin(TQObject* tqparent, const char* name); virtual ~Plugin(); protected: /** See KMyMoney2App::action() for a description */ - KAction* action(const QString& name) const; + KAction* action(const TQString& name) const; /** See KMyMoney2App::toggleAction() for a description */ - KToggleAction* toggleAction(const QString& name) const; + KToggleAction* toggleAction(const TQString& name) const; // define interface classes here. The interface classes provide a mechanism // for the plugin to interact with KMyMoney @@ -97,7 +98,7 @@ namespace KMyMoneyPlugin { OnlinePlugin() {} virtual ~OnlinePlugin() {} - virtual void protocols(QStringList& protocolList) const = 0; + virtual void protocols(TQStringList& protocolList) const = 0; /** * This method returns a pointer to a widget representing an additional @@ -112,7 +113,7 @@ namespace KMyMoneyPlugin { * can access the widgets created after the call to storeConfigParameters() * happened. */ - virtual QWidget* accountConfigTab(const MyMoneyAccount& account, QString& tabName) = 0; + virtual TQWidget* accountConfigTab(const MyMoneyAccount& account, TQString& tabName) = 0; /** * This method is called by the framework whenever it is time to store @@ -167,18 +168,18 @@ namespace KMyMoneyPlugin { * This method returns the english-language name of the format * this plugin imports, e.g. "OFX" * - * @return QString Name of the format + * @return TQString Name of the format */ - virtual QString formatName(void) const = 0; + virtual TQString formatName(void) const = 0; /** * This method returns the filename filter suitable for passing to * KFileDialog::setFilter(), e.g. "*.ofx *.qfx" which describes how * files of this format are likely to be named in the file system * - * @return QString Filename filter string + * @return TQString Filename filter string */ - virtual QString formatFilenameFilter(void) const = 0; + virtual TQString formatFilenameFilter(void) const = 0; /** * This method returns whether this plugin is able to import @@ -188,7 +189,7 @@ namespace KMyMoneyPlugin { * * @return bool Whether the indicated file is importable by this plugin */ - virtual bool isMyFormat( const QString& filename ) const = 0; + virtual bool isMyFormat( const TQString& filename ) const = 0; /** * Import a file @@ -197,16 +198,16 @@ namespace KMyMoneyPlugin { * * @return bool Whether the import was successful. */ - virtual bool import( const QString& filename) = 0; + virtual bool import( const TQString& filename) = 0; /** * Returns the error result of the last import * - * @return QString English-language name of the error encountered in the - * last import, or QString() if it was successful. + * @return TQString English-language name of the error encountered in the + * last import, or TQString() if it was successful. * */ - virtual QString lastError(void) const = 0; + virtual TQString lastError(void) const = 0; }; diff --git a/kmymoney2/plugins/ofximport/Makefile.am b/kmymoney2/plugins/ofximport/Makefile.am index d4729f4..43b9f94 100644 --- a/kmymoney2/plugins/ofximport/Makefile.am +++ b/kmymoney2/plugins/ofximport/Makefile.am @@ -16,7 +16,7 @@ kmm_ofximport_la_LIBADD = @OFX_LIBS@ dialogs/libdialogs.la ../libkmm_plugin.la . # LD flags for the plugin # -module says: this is a module, i.e. something you're going to dlopen # so e.g. it has no version number like a normal shared lib would have. -kmm_ofximport_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_KHTML) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_QT) -L../.libs +kmm_ofximport_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) $(LIB_KHTML) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) $(LIB_QT) -L../.libs # rc file containing the GUI for the plugin pluginsdir = $(kde_datadir)/kmm_ofximport diff --git a/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp b/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp index 3db8fbc..9248854 100644 --- a/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp +++ b/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.cpp @@ -22,10 +22,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -51,11 +51,11 @@ class KOfxDirectConnectDlg::Private { public: - QFile m_fpTrace; + TQFile m_fpTrace; }; -KOfxDirectConnectDlg::KOfxDirectConnectDlg(const MyMoneyAccount& account, QWidget *parent, const char *name) : - KOfxDirectConnectDlgDecl(parent, name), +KOfxDirectConnectDlg::KOfxDirectConnectDlg(const MyMoneyAccount& account, TQWidget *tqparent, const char *name) : + KOfxDirectConnectDlgDecl(tqparent, name), d(new Private), m_tmpfile(NULL), m_connector(account), @@ -76,19 +76,19 @@ void KOfxDirectConnectDlg::init(void) { show(); - QByteArray request = m_connector.statementRequest(); + TQByteArray request = m_connector.statementRequest(); // For debugging, dump out the request #if 0 - QFile g( "request.ofx" ); + TQFile g( "request.ofx" ); g.open( IO_WriteOnly ); - QTextStream(&g) << m_connector.url() << "\n" << QString(request); + TQTextStream(&g) << m_connector.url() << "\n" << TQString(request); g.close(); #endif - QDir homeDir(QDir::home()); + TQDir homeDir(TQDir::home()); if(homeDir.exists("ofxlog.txt")) { - d->m_fpTrace.setName(QString("%1/ofxlog.txt").arg(QDir::homeDirPath())); + d->m_fpTrace.setName(TQString("%1/ofxlog.txt").tqarg(TQDir::homeDirPath())); d->m_fpTrace.open(IO_WriteOnly | IO_Append); } @@ -98,7 +98,7 @@ void KOfxDirectConnectDlg::init(void) true ); if(d->m_fpTrace.isOpen()) { - QByteArray data = m_connector.url().utf8(); + TQByteArray data = m_connector.url().utf8(); d->m_fpTrace.writeBlock("url: ", 5); d->m_fpTrace.writeBlock(data, strlen(data)); d->m_fpTrace.writeBlock("\n", 1); @@ -109,22 +109,22 @@ void KOfxDirectConnectDlg::init(void) } m_job->addMetaData("content-type", "Content-type: application/x-ofx" ); - connect(m_job,SIGNAL(result(KIO::Job*)),this,SLOT(slotOfxFinished(KIO::Job*))); - connect(m_job,SIGNAL(data(KIO::Job*, const QByteArray&)),this,SLOT(slotOfxData(KIO::Job*,const QByteArray&))); - connect(m_job,SIGNAL(connected(KIO::Job*)),this,SLOT(slotOfxConnected(KIO::Job*))); + connect(m_job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(slotOfxFinished(KIO::Job*))); + connect(m_job,TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),this,TQT_SLOT(slotOfxData(KIO::Job*,const TQByteArray&))); + connect(m_job,TQT_SIGNAL(connected(KIO::Job*)),this,TQT_SLOT(slotOfxConnected(KIO::Job*))); - setStatus(QString("Contacting %1...").arg(m_connector.url())); + settqStatus(TQString("Contacting %1...").tqarg(m_connector.url())); kProgress1->setTotalSteps(3); kProgress1->setProgress(1); } -void KOfxDirectConnectDlg::setStatus(const QString& _status) +void KOfxDirectConnectDlg::settqStatus(const TQString& _status) { textLabel1->setText(_status); kdDebug(2) << "STATUS: " << _status << endl; } -void KOfxDirectConnectDlg::setDetails(const QString& _details) +void KOfxDirectConnectDlg::setDetails(const TQString& _details) { kdDebug(2) << "DETAILS: " << _details << endl; } @@ -133,34 +133,34 @@ void KOfxDirectConnectDlg::slotOfxConnected(KIO::Job*) { if ( m_tmpfile ) { -// throw new MYMONEYEXCEPTION(QString("Already connected, using %1.").arg(m_tmpfile->name())); +// throw new MYMONEYEXCEPTION(TQString("Already connected, using %1.").tqarg(m_tmpfile->name())); kdDebug(2) << "Already connected, using " << m_tmpfile->name() << endl; delete m_tmpfile; //delete otherwise we mem leak } m_tmpfile = new KTempFile(); - setStatus("Connection established, retrieving data..."); - setDetails(QString("Downloading data to %1...").arg(m_tmpfile->name())); + settqStatus("Connection established, retrieving data..."); + setDetails(TQString("Downloading data to %1...").tqarg(m_tmpfile->name())); kProgress1->advance(1); } -void KOfxDirectConnectDlg::slotOfxData(KIO::Job*,const QByteArray& _ba) +void KOfxDirectConnectDlg::slotOfxData(KIO::Job*,const TQByteArray& _ba) { if ( !m_tmpfile ) // throw new MYMONEYEXCEPTION("Not currently connected!!"); kdDebug(2) << "void ofxdcon::slotOfxData():: Not currently connected!" << endl; - *(m_tmpfile->textStream()) << QString(_ba); + *(m_tmpfile->textStream()) << TQString(_ba); if(d->m_fpTrace.isOpen()) { d->m_fpTrace.writeBlock(_ba, _ba.size()); } - setDetails(QString("Got %1 bytes").arg(_ba.size())); + setDetails(TQString("Got %1 bytes").tqarg(_ba.size())); } void KOfxDirectConnectDlg::slotOfxFinished(KIO::Job* /* e */) { kProgress1->advance(1); - setStatus("Completed."); + settqStatus("Completed."); if(d->m_fpTrace.isOpen()) { d->m_fpTrace.writeBlock("\nCompleted\n\n\n\n", 14); @@ -179,12 +179,12 @@ void KOfxDirectConnectDlg::slotOfxFinished(KIO::Job* /* e */) } else if ( m_job->isErrorPage() ) { - QString details; - QFile f( m_tmpfile->name() ); + TQString details; + TQFile f( m_tmpfile->name() ); if ( f.open( IO_ReadOnly ) ) { - QTextStream stream( &f ); - QString line; + TQTextStream stream( &f ); + TQString line; while ( !stream.atEnd() ) { details += stream.readLine(); // line of text excluding '\n' } @@ -217,7 +217,7 @@ void KOfxDirectConnectDlg::reject(void) delete m_tmpfile; m_tmpfile = NULL; } - QDialog::reject(); + TQDialog::reject(); } #include "kofxdirectconnectdlg.moc" diff --git a/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.h b/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.h index e5d92cd..4d165ec 100644 --- a/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.h +++ b/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlg.h @@ -49,8 +49,9 @@ class TransferJob; class KOfxDirectConnectDlg : public KOfxDirectConnectDlgDecl { Q_OBJECT + TQ_OBJECT public: - KOfxDirectConnectDlg(const MyMoneyAccount&, QWidget *parent = 0, const char *name = 0); + KOfxDirectConnectDlg(const MyMoneyAccount&, TQWidget *tqparent = 0, const char *name = 0); ~KOfxDirectConnectDlg(); void init(void); @@ -60,17 +61,17 @@ signals: * This signal is emitted when the statement is downloaded * and stored in file @a fname. */ - void statementReady(const QString& fname); + void statementReady(const TQString& fname); protected slots: void slotOfxFinished(KIO::Job*); - void slotOfxData(KIO::Job*,const QByteArray&); + void slotOfxData(KIO::Job*,const TQByteArray&); void slotOfxConnected(KIO::Job*); virtual void reject(void); protected: - void setStatus(const QString& _status); - void setDetails(const QString& _details); + void settqStatus(const TQString& _status); + void setDetails(const TQString& _details); KTempFile* m_tmpfile; MyMoneyOfxConnector m_connector; diff --git a/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlgdecl.ui b/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlgdecl.ui index 3937012..7315638 100644 --- a/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlgdecl.ui +++ b/kmymoney2/plugins/ofximport/dialogs/kofxdirectconnectdlgdecl.ui @@ -1,6 +1,6 @@ KOfxDirectConnectDlgDecl - + KOfxDirectConnectDlgDecl @@ -22,7 +22,7 @@ unnamed - + textLabel1 @@ -35,9 +35,9 @@ kProgress1 - + - layout2 + tqlayout2 @@ -53,14 +53,14 @@ Expanding - + 51 20 - + buttonCancel @@ -84,7 +84,7 @@ Expanding - + 61 20 @@ -105,5 +105,5 @@ reject() - + diff --git a/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupdecl.ui b/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupdecl.ui index 3ee9b6a..85cef17 100644 --- a/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupdecl.ui +++ b/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupdecl.ui @@ -1,6 +1,6 @@ KOnlineBankingSetupDecl - + KOnlineBankingSetupDecl @@ -15,7 +15,7 @@ Online Banking Account Setup - + FIPage @@ -26,7 +26,7 @@ unnamed - + textLabel1 @@ -43,7 +43,7 @@ image0 - + m_listLayout @@ -51,22 +51,22 @@ unnamed - + textLabel2 Please select your financial institution from the list below... - + WordBreak|AlignVCenter - + m_selectionTab - + tab @@ -98,7 +98,7 @@ - + tab @@ -109,9 +109,9 @@ unnamed - + - layout8 + tqlayout8 @@ -122,7 +122,7 @@ m_url - + textLabel4 @@ -130,7 +130,7 @@ Org - + textLabel1_5 @@ -148,7 +148,7 @@ m_fid - + textLabel2_4 @@ -168,7 +168,7 @@ Expanding - + 20 90 @@ -182,7 +182,7 @@ - + LoginPage @@ -193,7 +193,7 @@ unnamed - + textLabel1_3 @@ -210,9 +210,9 @@ image0 - + - layout6 + tqlayout6 @@ -228,7 +228,7 @@ Expanding - + 120 21 @@ -251,7 +251,7 @@ m_headerVersionCombo - + textLabel3 @@ -264,7 +264,7 @@ m_applicationCombo - + textLabel1_4 @@ -272,7 +272,7 @@ Username - + textLabel1_6 @@ -280,7 +280,7 @@ Header Version - + m_editPassword @@ -288,12 +288,12 @@ Password - + m_editUsername - + textLabel1_2_3 @@ -301,7 +301,7 @@ Identify as - + textLabel2_3 @@ -309,7 +309,7 @@ Password - + m_textDetails @@ -318,7 +318,7 @@ - + AccountPage @@ -329,7 +329,7 @@ unnamed - + textLabel1_2 @@ -346,26 +346,26 @@ image0 - + - layout29 + tqlayout29 unnamed - + textLabel2_2 Please select the account from your financial institution from the list below which matches this account. - + WordBreak|AlignVCenter - + Number @@ -418,7 +418,7 @@ - + WizardPage @@ -429,7 +429,7 @@ unnamed - + textLabel1_2_2 @@ -446,22 +446,22 @@ image0 - + - layout6 + tqlayout6 unnamed - + m_labelFinal Congratulations! You have successfully set up your bank for online banking via OFX. - + WordBreak|AlignVCenter @@ -484,5 +484,5 @@ m_listFi m_listAccount - + diff --git a/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.cpp b/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.cpp index d24f9a4..eac5079 100644 --- a/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.cpp +++ b/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.cpp @@ -22,13 +22,13 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,12 +54,12 @@ class KOnlineBankingSetupWizard::Private { public: - QFile m_fpTrace; - QTextStream m_trace; + TQFile m_fpTrace; + TQTextStream m_trace; }; -KOnlineBankingSetupWizard::KOnlineBankingSetupWizard(QWidget *parent, const char *name): - KOnlineBankingSetupDecl(parent,name), +KOnlineBankingSetupWizard::KOnlineBankingSetupWizard(TQWidget *tqparent, const char *name): + KOnlineBankingSetupDecl(tqparent,name), d(new Private), m_fDone(false), m_fInit(false), @@ -79,8 +79,8 @@ KOnlineBankingSetupWizard::KOnlineBankingSetupWizard(QWidget *parent, const char tabLayout->insertWidget(0, new KListViewSearchLineWidget(m_listFi, tab, 0)); OfxPartner::setDirectory(locateLocal("appdata", "")); - QStringList banks = OfxPartner::BankNames(); - QStringList::const_iterator it_bank = banks.begin(); + TQStringList banks = OfxPartner::BankNames(); + TQStringList::const_iterator it_bank = banks.begin(); while (it_bank != banks.end()) { new KListViewItem( m_listFi, (*it_bank)); @@ -129,28 +129,28 @@ bool KOnlineBankingSetupWizard::finishFiPage(void) if(m_selectionTab->currentPageIndex() == 0) { // Get the fipids for the selected bank - QListViewItem* item = m_listFi->currentItem(); + TQListViewItem* item = m_listFi->currentItem(); if ( item ) { - QString bank = item->text(0); + TQString bank = item->text(0); m_textDetails->clear(); - m_textDetails->append(QString("

Details for %1:

").arg(bank)); - QStringList fipids = OfxPartner::FipidForBank(bank); - QStringList::const_iterator it_fipid = fipids.begin(); + m_textDetails->append(TQString("

Details for %1:

").tqarg(bank)); + TQStringList fipids = OfxPartner::FipidForBank(bank); + TQStringList::const_iterator it_fipid = fipids.begin(); while ( it_fipid != fipids.end() ) { // For each fipid, get the connection details info = OfxPartner::ServiceInfo(*it_fipid); // Print them to the text browser - QString message = QString("

Fipid: %1
").arg(*it_fipid); + TQString message = TQString("

Fipid: %1
").tqarg(*it_fipid); // If the bank supports retrieving statements if ( info.accountlist ) { m_bankInfo.push_back(info); - message += QString("URL: %1
Org: %2
Fid: %3
").arg(info.url,info.org,info.fid); + message += TQString("URL: %1
Org: %2
Fid: %3
").tqarg(info.url,info.org,info.fid); if ( info.statements ) message += i18n("Supports online statements
"); if ( info.investments ) @@ -180,12 +180,12 @@ bool KOnlineBankingSetupWizard::finishFiPage(void) } m_textDetails->clear(); - m_textDetails->append(QString("

Details for %1:

").arg(m_bankName->text())); + m_textDetails->append(TQString("

Details for %1:

").tqarg(m_bankName->text())); memset(&info, 0, sizeof(OfxFiServiceInfo)); - strncpy(info.fid, m_fid->text().data(), OFX_FID_LENGTH-1); + strncpy(info.fid, m_fid->text().ascii(), OFX_FID_LENGTH-1); strncpy(info.org, m_bankName->text().latin1(), OFX_ORG_LENGTH-1); - strncpy(info.url, m_url->url().data(), OFX_URL_LENGTH-1); + strncpy(info.url, m_url->url().ascii(), OFX_URL_LENGTH-1); info.accountlist = 1; info.statements = 1; info.billpay = 1; @@ -193,8 +193,8 @@ bool KOnlineBankingSetupWizard::finishFiPage(void) m_bankInfo.push_back(info); - QString message; - message += QString("URL: %1
Org: %2
Fid: %3
").arg(info.url,info.org,info.fid); + TQString message; + message += TQString("URL: %1
Org: %2
Fid: %3
").tqarg(info.url,info.org,info.fid); if ( info.statements ) message += i18n("Supports online statements
"); if ( info.investments ) @@ -211,8 +211,8 @@ bool KOnlineBankingSetupWizard::finishLoginPage(void) { bool result = true; - QString username = m_editUsername->text(); - QString password = m_editPassword->text(); + TQString username = m_editUsername->text(); + TQString password = m_editPassword->text(); m_listAccount->clear(); @@ -231,27 +231,27 @@ bool KOnlineBankingSetupWizard::finishLoginPage(void) // pretend we're Quicken 2008 // http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-intuit-products/ // http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-microsoft-money/ - QString appId = m_appId->appId(); - QRegExp exp("(.*):(.*)"); + TQString appId = m_appId->appId(); + TQRegExp exp("(.*):(.*)"); if(exp.search(appId) != -1) { strncpy(fi.appid, exp.cap(1).latin1(), OFX_APPID_LENGTH-1); strncpy(fi.appver, exp.cap(2).latin1(), OFX_APPVER_LENGTH-1); } else { - strncpy(fi.appid, "QWIN", OFX_APPID_LENGTH-1); + strncpy(fi.appid, "TQWIN", OFX_APPID_LENGTH-1); strncpy(fi.appver, "1700", OFX_APPVER_LENGTH-1); } - QString hver = m_headerVersion->headerVersion(); + TQString hver = m_headerVersion->headerVersion(); strncpy(fi.header_version, hver.latin1(), OFX_HEADERVERSION_LENGTH-1); #endif // who owns this memory?!?! char* request = libofx_request_accountinfo( &fi ); - KURL filename(QString("%1response.ofx").arg(locateLocal("appdata", ""))); - QByteArray req; + KURL filename(TQString("%1response.ofx").tqarg(locateLocal("appdata", ""))); + TQByteArray req; req.setRawData(request, strlen(request)); - OfxHttpsRequest("POST", (*m_it_info).url, req, QMap(), filename, true); + OfxHttpsRequest("POST", (*m_it_info).url, req, TQMap(), filename, true); req.resetRawData(request, strlen(request)); LibofxContextPtr ctx = libofx_get_new_context(); @@ -296,7 +296,7 @@ int KOnlineBankingSetupWizard::ofxAccountCallback(struct OfxAccountData data, vo if ( data.account_type_valid ) { - QString type; + TQString type; switch ( data.account_type ) { case OfxAccountData::OFX_CHECKING: /**< A standard checking account */ @@ -348,7 +348,7 @@ int KOnlineBankingSetupWizard::ofxAccountCallback(struct OfxAccountData data, vo kvps.setValue("fid",(*(pthis->m_it_info)).fid); kvps.setValue("org",(*(pthis->m_it_info)).org); kvps.setValue("fipid",""); - QListViewItem* item = pthis->m_listFi->currentItem(); + TQListViewItem* item = pthis->m_listFi->currentItem(); if ( item ) kvps.setValue("bankname",item->text(0)); @@ -360,7 +360,7 @@ int KOnlineBankingSetupWizard::ofxAccountCallback(struct OfxAccountData data, vo if(/* !kvps.value("bankid").isEmpty() && */ !kvps.value("uniqueId").isEmpty()) { - kvps.setValue("kmmofx-acc-ref", QString("%1-%2").arg(kvps.value("bankid"), kvps.value("uniqueId"))); + kvps.setValue("kmmofx-acc-ref", TQString("%1-%2").tqarg(kvps.value("bankid"), kvps.value("uniqueId"))); } else { qDebug("Cannot setup kmmofx-acc-ref for '%s'", kvps.value("bankname").data()); } @@ -375,15 +375,15 @@ int KOnlineBankingSetupWizard::ofxStatusCallback(struct OfxStatusData data, void { KOnlineBankingSetupWizard* pthis = reinterpret_cast(pv); - QString message; + TQString message; if(data.code_valid==true) { - message += QString("#%1 %2: \"%3\"\n").arg(data.code).arg(data.name,data.description); + message += TQString("#%1 %2: \"%3\"\n").tqarg(data.code).tqarg(data.name,data.description); } if(data.server_message_valid==true){ - message += i18n("Server message: %1\n").arg(data.server_message); + message += i18n("Server message: %1\n").tqarg(data.server_message); } if(data.severity_valid==true){ @@ -391,10 +391,10 @@ int KOnlineBankingSetupWizard::ofxStatusCallback(struct OfxStatusData data, void case OfxStatusData::INFO : break; case OfxStatusData::WARN : - KMessageBox::detailedError( pthis, i18n("Your bank returned warnings when signing on"), i18n("WARNING %1").arg(message) ); + KMessageBox::detailedError( pthis, i18n("Your bank returned warnings when signing on"), i18n("WARNING %1").tqarg(message) ); break; case OfxStatusData::ERROR : - KMessageBox::detailedError( pthis, i18n("Error signing onto your bank"), i18n("ERROR %1").arg(message) ); + KMessageBox::detailedError( pthis, i18n("Error signing onto your bank"), i18n("ERROR %1").tqarg(message) ); break; default: break; @@ -409,17 +409,17 @@ bool KOnlineBankingSetupWizard::chosenSettings( MyMoneyKeyValueContainer& settin if ( m_fDone ) { - QListViewItem* qitem = m_listAccount->currentItem(); + TQListViewItem* qitem = m_listAccount->currentItem(); ListViewItem* item = dynamic_cast(qitem); if ( item ) { settings = *item; settings.deletePair("appId"); settings.deletePair("kmmofx-headerVersion"); - QString appId = m_appId->appId(); + TQString appId = m_appId->appId(); if(!appId.isEmpty()) settings.setValue("appId", appId); - QString hVer = m_headerVersion->headerVersion(); + TQString hVer = m_headerVersion->headerVersion(); if(!hVer.isEmpty()) settings.setValue("kmmofx-headerVersion", hVer); result = true; @@ -429,8 +429,8 @@ bool KOnlineBankingSetupWizard::chosenSettings( MyMoneyKeyValueContainer& settin return result; } -KOnlineBankingSetupWizard::ListViewItem::ListViewItem( QListView* parent, const MyMoneyKeyValueContainer& kvps ): - MyMoneyKeyValueContainer( kvps ), QListViewItem( parent ) +KOnlineBankingSetupWizard::ListViewItem::ListViewItem( TQListView* tqparent, const MyMoneyKeyValueContainer& kvps ): + MyMoneyKeyValueContainer( kvps ), TQListViewItem( tqparent ) { setText( 0, value("accountid") ); setText( 1, value("type") ); diff --git a/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.h b/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.h index 65a89de..4faccbc 100644 --- a/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.h +++ b/kmymoney2/plugins/ofximport/dialogs/konlinebankingsetupwizard.h @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -61,15 +61,16 @@ class OfxHeaderVersion; class KOnlineBankingSetupWizard : public KOnlineBankingSetupDecl { Q_OBJECT + TQ_OBJECT public: - class ListViewItem: public MyMoneyKeyValueContainer, public QListViewItem + class ListViewItem: public MyMoneyKeyValueContainer, public TQListViewItem { public: - ListViewItem( QListView* parent, const MyMoneyKeyValueContainer& kvps ); + ListViewItem( TQListView* tqparent, const MyMoneyKeyValueContainer& kvps ); virtual void x(void); }; - KOnlineBankingSetupWizard(QWidget *parent=0, const char *name=0); + KOnlineBankingSetupWizard(TQWidget *tqparent=0, const char *name=0); ~KOnlineBankingSetupWizard(); bool chosenSettings( MyMoneyKeyValueContainer& settings ); @@ -94,8 +95,8 @@ private: /// \internal d-pointer instance. Private* const d; - QValueList m_bankInfo; - QValueList::const_iterator m_it_info; + TQValueList m_bankInfo; + TQValueList::const_iterator m_it_info; bool m_fDone; bool m_fInit; OfxAppVersion* m_appId; diff --git a/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.cpp b/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.cpp index 6e5cef9..8ca0aac 100644 --- a/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.cpp +++ b/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.cpp @@ -26,11 +26,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -48,22 +48,22 @@ #include #include "mymoneyofxconnector.h" -KOnlineBankingStatus::KOnlineBankingStatus(const MyMoneyAccount& acc, QWidget *parent, const char *name) : - KOnlineBankingStatusDecl(parent,name), +KOnlineBankingtqStatus::KOnlineBankingtqStatus(const MyMoneyAccount& acc, TQWidget *tqparent, const char *name) : + KOnlineBankingStatusDecl(tqparent,name), m_appId(0) { - m_ledOnlineStatus->off(); + m_ledOnlinetqStatus->off(); // Set up online banking settings if applicable MyMoneyKeyValueContainer settings = acc.onlineBankingSettings(); - m_textOnlineStatus->setText(i18n("Enabled & configured")); - m_ledOnlineStatus->on(); + m_textOnlinetqStatus->setText(i18n("Enabled & configured")); + m_ledOnlinetqStatus->on(); - QString account = settings.value("accountid"); - QString bank = settings.value("bankname"); - QString bankid = QString("%1 %2").arg(settings.value("bankid")).arg(settings.value("branchid")); + TQString account = settings.value("accountid"); + TQString bank = settings.value("bankname"); + TQString bankid = TQString("%1 %2").tqarg(settings.value("bankid")).tqarg(settings.value("branchid")); if ( bankid.length() > 1 ) - bank += QString(" (%1)").arg(bankid); + bank += TQString(" (%1)").tqarg(bankid); m_textBank->setText(bank); m_textOnlineAccount->setText(account); @@ -71,7 +71,7 @@ KOnlineBankingStatus::KOnlineBankingStatus(const MyMoneyAccount& acc, QWidget *p m_headerVersion = new OfxHeaderVersion(m_headerVersionCombo, settings.value("kmmofx-headerVersion")); int numDays = 60; - QString snumDays = settings.value("kmmofx-numRequestDays"); + TQString snumDays = settings.value("kmmofx-numRequestDays"); if (!snumDays.isEmpty()) numDays = snumDays.toInt(); m_numdaysSpin->setValue(numDays); @@ -79,33 +79,33 @@ KOnlineBankingStatus::KOnlineBankingStatus(const MyMoneyAccount& acc, QWidget *p m_lastUpdateRB->setChecked(!settings.value("kmmofx-lastUpdate").isEmpty() && settings.value("kmmofx-lastUpdate").toInt() != 0); m_lastUpdateTXT->setText(acc.value("lastImportedTransactionDate")); m_pickDateRB->setChecked(!settings.value("kmmofx-pickDate").isEmpty() && settings.value("kmmofx-pickDate").toInt() != 0); - QString specificDate = settings.value("kmmofx-specificDate"); + TQString specificDate = settings.value("kmmofx-specificDate"); if (!specificDate.isEmpty()) - m_specificDate->setDate(QDate::fromString(specificDate)); + m_specificDate->setDate(TQDate::fromString(specificDate)); else - m_specificDate->setDate(QDate::currentDate()); - m_specificDate->setMaxValue(QDate::currentDate()); + m_specificDate->setDate(TQDate::tqcurrentDate()); + m_specificDate->setMaxValue(TQDate::tqcurrentDate()); m_payeeidRB->setChecked(settings.value("kmmofx-preferPayeeid").isEmpty() || settings.value("kmmofx-preferPayeeid").toInt() != 0); m_nameRB->setChecked(!settings.value("kmmofx-preferName").isEmpty() && settings.value("kmmofx-preferName").toInt() != 0); } -KOnlineBankingStatus::~KOnlineBankingStatus() +KOnlineBankingtqStatus::~KOnlineBankingtqStatus() { delete m_appId; } -const QString& KOnlineBankingStatus::appId(void) const +const TQString& KOnlineBankingtqStatus::appId(void) const { if(m_appId) return m_appId->appId(); - return QString::null; + return TQString(); } -QString KOnlineBankingStatus::headerVersion(void) const +TQString KOnlineBankingtqStatus::headerVersion(void) const { if(m_headerVersion) return m_headerVersion->headerVersion(); - return QString::null; + return TQString(); } #include "konlinebankingstatus.moc" diff --git a/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.h b/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.h index bbd62ea..75e3369 100644 --- a/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.h +++ b/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatus.h @@ -24,7 +24,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -41,14 +41,15 @@ class OfxHeaderVersion; * @author Thomas Baumgart */ -class KOnlineBankingStatus : public KOnlineBankingStatusDecl +class KOnlineBankingtqStatus : public KOnlineBankingStatusDecl { Q_OBJECT + TQ_OBJECT public: - KOnlineBankingStatus(const MyMoneyAccount& acc, QWidget *parent=0, const char *name=0); - ~KOnlineBankingStatus(); - const QString& appId(void) const; - QString headerVersion(void) const; + KOnlineBankingtqStatus(const MyMoneyAccount& acc, TQWidget *tqparent=0, const char *name=0); + ~KOnlineBankingtqStatus(); + const TQString& appId(void) const; + TQString headerVersion(void) const; private: OfxAppVersion* m_appId; OfxHeaderVersion* m_headerVersion; diff --git a/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatusdecl.ui b/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatusdecl.ui index f76f9e4..106618a 100644 --- a/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatusdecl.ui +++ b/kmymoney2/plugins/ofximport/dialogs/konlinebankingstatusdecl.ui @@ -1,6 +1,6 @@ KOnlineBankingStatusDecl - + KOnlineBankingStatusDecl @@ -16,7 +16,7 @@ unnamed - + groupBox1 @@ -27,7 +27,7 @@ unnamed - + m_textBank @@ -48,7 +48,7 @@ &lt;Not configured&gt; - + textLabel2 @@ -56,7 +56,7 @@ BANK/BROKER: - + m_textOnlineAccount @@ -77,9 +77,9 @@ &lt;Not configured&gt; - + - layout5 + tqlayout5 @@ -87,15 +87,15 @@ - m_ledOnlineStatus + m_ledOnlinetqStatus Off - + - m_textOnlineStatus + m_textOnlinetqStatus @@ -119,7 +119,7 @@ Expanding - + 41 21 @@ -128,7 +128,7 @@ - + textLabel3 @@ -136,7 +136,7 @@ ACCOUNT: - + textLabel1 @@ -146,7 +146,7 @@ - + groupBox2 @@ -157,15 +157,15 @@ unnamed - + - layout8 + tqlayout8 unnamed - + textLabel1_3 @@ -188,7 +188,7 @@ Expanding - + 150 21 @@ -200,7 +200,7 @@ m_headerVersionCombo - + textLabel1_2 @@ -210,7 +210,7 @@ - + buttonGroup2 @@ -227,23 +227,23 @@ unnamed - + - layout17 + tqlayout17 unnamed - + - layout8 + tqlayout8 unnamed - + m_todayRB @@ -254,7 +254,7 @@ true - + m_numdaysSpin @@ -262,7 +262,7 @@ 180 - + textLabel2_2 @@ -272,15 +272,15 @@ - + - layout16 + tqlayout16 unnamed - + m_lastUpdateRB @@ -288,7 +288,7 @@ Last &update - + m_lastUpdateTXT @@ -298,15 +298,15 @@ - + - layout7 + tqlayout7 unnamed - + m_pickDateRB @@ -314,7 +314,7 @@ Pi&ck date - + m_specificDate @@ -346,7 +346,7 @@ Expanding - + 41 20 @@ -355,7 +355,7 @@ - + groupBox3 @@ -366,15 +366,15 @@ unnamed - + - layout11 + tqlayout11 unnamed - + buttonGroup1 @@ -394,7 +394,7 @@ 1 - + m_payeeidRB @@ -405,7 +405,7 @@ true - + m_nameRB @@ -415,7 +415,7 @@ - + textLabel3_2 @@ -435,7 +435,7 @@ Expanding - + 31 20 @@ -456,7 +456,7 @@ Expanding - + 20 50 @@ -479,5 +479,5 @@ setEnabled(bool) - + diff --git a/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp b/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp index 6e841bb..71897d2 100644 --- a/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp +++ b/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.cpp @@ -27,8 +27,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,7 +46,7 @@ #include #include "mymoneyofxconnector.h" -OfxHeaderVersion::OfxHeaderVersion(KComboBox* combo, const QString& headerVersion) : +OfxHeaderVersion::OfxHeaderVersion(KComboBox* combo, const TQString& headerVersion) : m_combo(combo) { combo->clear(); @@ -66,24 +66,24 @@ OfxHeaderVersion::OfxHeaderVersion(KComboBox* combo, const QString& headerVersio #endif } -QString OfxHeaderVersion::headerVersion(void) const +TQString OfxHeaderVersion::headerVersion(void) const { return m_combo->currentText(); } -OfxAppVersion::OfxAppVersion(KComboBox* combo, const QString& appId) : +OfxAppVersion::OfxAppVersion(KComboBox* combo, const TQString& appId) : m_combo(combo) { // http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-intuit-products/ // http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-microsoft-money/ // Quicken - m_appMap[i18n("Quicken Windows 2003")] = "QWIN:1200"; - m_appMap[i18n("Quicken Windows 2004")] = "QWIN:1300"; - m_appMap[i18n("Quicken Windows 2005")] = "QWIN:1400"; - m_appMap[i18n("Quicken Windows 2006")] = "QWIN:1500"; - m_appMap[i18n("Quicken Windows 2007")] = "QWIN:1600"; - m_appMap[i18n("Quicken Windows 2008")] = "QWIN:1700"; + m_appMap[i18n("Quicken Windows 2003")] = "TQWIN:1200"; + m_appMap[i18n("Quicken Windows 2004")] = "TQWIN:1300"; + m_appMap[i18n("Quicken Windows 2005")] = "TQWIN:1400"; + m_appMap[i18n("Quicken Windows 2006")] = "TQWIN:1500"; + m_appMap[i18n("Quicken Windows 2007")] = "TQWIN:1600"; + m_appMap[i18n("Quicken Windows 2008")] = "TQWIN:1700"; // MS-Money m_appMap[i18n("MS-Money 2003")] = "Money:1100"; @@ -99,7 +99,7 @@ OfxAppVersion::OfxAppVersion(KComboBox* combo, const QString& appId) : combo->clear(); combo->insertStringList(m_appMap.keys()); - QMap::const_iterator it_a; + TQMap::const_iterator it_a; for(it_a = m_appMap.begin(); it_a != m_appMap.end(); ++it_a) { if(*it_a == appId) break; @@ -118,14 +118,14 @@ OfxAppVersion::OfxAppVersion(KComboBox* combo, const QString& appId) : #endif } -const QString& OfxAppVersion::appId(void) const +const TQString& OfxAppVersion::appId(void) const { - static QString defaultAppId("QWIN:1700"); + static TQString defaultAppId("TQWIN:1700"); - QString app = m_combo->currentText(); + TQString app = m_combo->currentText(); if(m_appMap[app] != defaultAppId) return m_appMap[app]; - return QString::null; + return TQString(); } MyMoneyOfxConnector::MyMoneyOfxConnector(const MyMoneyAccount& _account): @@ -134,28 +134,28 @@ MyMoneyOfxConnector::MyMoneyOfxConnector(const MyMoneyAccount& _account): m_fiSettings = m_account.onlineBankingSettings(); } -QString MyMoneyOfxConnector::iban(void) const { return m_fiSettings.value("bankid"); } -QString MyMoneyOfxConnector::fiorg(void) const { return m_fiSettings.value("org"); } -QString MyMoneyOfxConnector::fiid(void) const { return m_fiSettings.value("fid"); } -QString MyMoneyOfxConnector::username(void) const { return m_fiSettings.value("username"); } -QString MyMoneyOfxConnector::password(void) const { return m_fiSettings.value("password"); } -QString MyMoneyOfxConnector::accountnum(void) const { return m_fiSettings.value("accountid"); } -QString MyMoneyOfxConnector::url(void) const { return m_fiSettings.value("url"); } +TQString MyMoneyOfxConnector::iban(void) const { return m_fiSettings.value("bankid"); } +TQString MyMoneyOfxConnector::fiorg(void) const { return m_fiSettings.value("org"); } +TQString MyMoneyOfxConnector::fiid(void) const { return m_fiSettings.value("fid"); } +TQString MyMoneyOfxConnector::username(void) const { return m_fiSettings.value("username"); } +TQString MyMoneyOfxConnector::password(void) const { return m_fiSettings.value("password"); } +TQString MyMoneyOfxConnector::accountnum(void) const { return m_fiSettings.value("accountid"); } +TQString MyMoneyOfxConnector::url(void) const { return m_fiSettings.value("url"); } -QDate MyMoneyOfxConnector::statementStartDate(void) const { +TQDate MyMoneyOfxConnector::statementStartDate(void) const { if ((m_fiSettings.value("kmmofx-todayMinus").toInt() != 0) && !m_fiSettings.value("kmmofx-numRequestDays").isEmpty()) { - return QDate::currentDate().addDays(-m_fiSettings.value("kmmofx-numRequestDays").toInt()); + return TQDate::tqcurrentDate().addDays(-m_fiSettings.value("kmmofx-numRequestDays").toInt()); } else if ((m_fiSettings.value("kmmofx-lastUpdate").toInt() != 0) && !m_account.value("lastImportedTransactionDate").isEmpty()) { - return QDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate); + return TQDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate); } else if ((m_fiSettings.value("kmmofx-pickDate").toInt() != 0) && !m_fiSettings.value("kmmofx-specificDate").isEmpty()) { - return QDate::fromString(m_fiSettings.value("kmmofx-specificDate")); + return TQDate::fromString(m_fiSettings.value("kmmofx-specificDate")); } - return QDate::currentDate().addMonths(-2); + return TQDate::tqcurrentDate().addMonths(-2); } #if LIBOFX_IS_VERSION(0,9,0) @@ -163,7 +163,7 @@ OfxAccountData::AccountType MyMoneyOfxConnector::accounttype(void) const { OfxAccountData::AccountType result = OfxAccountData::OFX_CHECKING; - QString type = m_account.onlineBankingSettings()["type"]; + TQString type = m_account.onlineBankingSettings()["type"]; if(type == "CHECKING") result = OfxAccountData::OFX_CHECKING; else if(type == "SAVINGS") @@ -197,10 +197,10 @@ OfxAccountData::AccountType MyMoneyOfxConnector::accounttype(void) const // This is a bit of a personalized hack. Sometimes we may want to override the // ofx type for an account. For now, I will stash it in the notes! - QRegExp rexp("OFXTYPE:([A-Z]*)"); + TQRegExp rexp("OFXTYPE:([A-Z]*)"); if ( rexp.search(m_account.description()) != -1 ) { - QString override = rexp.cap(1); + TQString override = rexp.cap(1); kdDebug(2) << "MyMoneyOfxConnector::accounttype() overriding to " << result << endl; if ( override == "BANK" ) @@ -235,10 +235,10 @@ AccountType MyMoneyOfxConnector::accounttype(void) const // This is a bit of a personalized hack. Sometimes we may want to override the // ofx type for an account. For now, I will stash it in the notes! - QRegExp rexp("OFXTYPE:([A-Z]*)"); + TQRegExp rexp("OFXTYPE:([A-Z]*)"); if ( rexp.search(m_account.description()) != -1 ) { - QString override = rexp.cap(1); + TQString override = rexp.cap(1); kdDebug(2) << "MyMoneyOfxConnector::accounttype() overriding to " << result << endl; if ( override == "BANK" ) @@ -269,24 +269,24 @@ void MyMoneyOfxConnector::initRequest(OfxFiLogin* fi) const // If we don't know better, we pretend to be Quicken 2008 // http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-intuit-products/ // http://ofxblog.wordpress.com/2007/06/06/ofx-appid-and-appver-for-microsoft-money/ - QString appId = m_account.onlineBankingSettings().value("appId"); - QRegExp exp("(.*):(.*)"); + TQString appId = m_account.onlineBankingSettings().value("appId"); + TQRegExp exp("(.*):(.*)"); if(exp.search(appId) != -1) { strncpy(fi->appid, exp.cap(1).latin1(), OFX_APPID_LENGTH-1); strncpy(fi->appver, exp.cap(2).latin1(), OFX_APPVER_LENGTH-1); } else { - strncpy(fi->appid, "QWIN", OFX_APPID_LENGTH-1); + strncpy(fi->appid, "TQWIN", OFX_APPID_LENGTH-1); strncpy(fi->appver, "1700", OFX_APPVER_LENGTH-1); } - QString headerVersion = m_account.onlineBankingSettings().value("kmmofx-headerVersion"); + TQString headerVersion = m_account.onlineBankingSettings().value("kmmofx-headerVersion"); if(!headerVersion.isEmpty()) { strncpy(fi->header_version, headerVersion.latin1(), OFX_HEADERVERSION_LENGTH-1); } #endif } -const QByteArray MyMoneyOfxConnector::statementRequest(void) const +const TQByteArray MyMoneyOfxConnector::statementRequest(void) const { OfxFiLogin fi; initRequest(&fi); @@ -313,29 +313,29 @@ const QByteArray MyMoneyOfxConnector::statementRequest(void) const account.type = accounttype(); #endif - char* szrequest = libofx_request_statement( &fi, &account, QDateTime(statementStartDate()).toTime_t() ); - QString request = szrequest; + char* szrequest = libofx_request_statement( &fi, &account, TQDateTime(statementStartDate()).toTime_t() ); + TQString request = szrequest; // remove the trailing zero - QByteArray result = request.utf8(); + TQByteArray result = request.utf8(); result.truncate(result.size()-1); free(szrequest); - QString msg(result); + TQString msg(result); return result; } #if 0 // this code is not used anymore. The logic is now // contained in KOnlineBankingSetupWizard::finishLoginPage(void) -const QByteArray MyMoneyOfxConnector::accountInfoRequest(void) const +const TQByteArray MyMoneyOfxConnector::accountInfoRequest(void) const { OfxFiLogin fi; initRequest(&fi); char* szrequest = libofx_request_accountinfo( &fi ); - QString request = szrequest; + TQString request = szrequest; // remove the trailing zero - QByteArray result = request.utf8(); + TQByteArray result = request.utf8(); result.truncate(result.size()-1); free(szrequest); @@ -345,7 +345,7 @@ const QByteArray MyMoneyOfxConnector::accountInfoRequest(void) const #if 0 -MyMoneyOfxConnector::Tag MyMoneyOfxConnector::message(const QString& _msgType, const QString& _trnType, const Tag& _request) +MyMoneyOfxConnector::Tag MyMoneyOfxConnector::message(const TQString& _msgType, const TQString& _trnType, const Tag& _request) { return Tag(_msgType+"MSGSRQV1") .subtag(Tag(_trnType+"TRNRQ") @@ -356,8 +356,8 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::message(const QString& _msgType, c MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentRequest(void) const { - QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]")); - QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); + TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); return message("INVSTMT","INVSTMT",Tag("INVSTMTRQ") .subtag(Tag("INVACCTFROM").element("BROKERID", fiorg()).element("ACCTID", accountnum())) @@ -367,18 +367,18 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentRequest(void) const .element("INCBAL","Y")); } -MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementRequest(const QDate& _dtstart) const +MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementRequest(const TQDate& _dtstart) const { - QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); return message("BANK","STMT",Tag("STMTRQ") .subtag(Tag("BANKACCTFROM").element("BANKID", iban()).element("ACCTID", accountnum()).element("ACCTTYPE", "CHECKING")) .subtag(Tag("INCTRAN").element("DTSTART",dtstart_string).element("INCLUDE","Y"))); } -MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardRequest(const QDate& _dtstart) const +MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardRequest(const TQDate& _dtstart) const { - QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); return message("CREDITCARD","CCSTMT",Tag("CCSTMTRQ") .subtag(Tag("CCACCTFROM").element("ACCTID",accountnum())) @@ -387,7 +387,7 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardRequest(const QDate& _dt MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOn(void) const { - QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); Tag fi("FI"); fi.element("ORG",fiorg()); @@ -401,13 +401,13 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOn(void) const .element("USERPASS",password()) .element("LANGUAGE","ENG") .subtag(fi) - .element("APPID","QWIN") + .element("APPID","TQWIN") .element("APPVER","1100")); } -QString MyMoneyOfxConnector::header(void) +TQString MyMoneyOfxConnector::header(void) { - return QString("OFXHEADER:100\r\n" + return TQString("OFXHEADER:100\r\n" "DATA:OFXSGML\r\n" "VERSION:102\r\n" "SECURITY:NONE\r\n" @@ -416,13 +416,13 @@ QString MyMoneyOfxConnector::header(void) "COMPRESSION:NONE\r\n" "OLDFILEUID:NONE\r\n" "NEWFILEUID:%1\r\n" - "\r\n").arg(uuid()); + "\r\n").tqarg(uuid()); } -QString MyMoneyOfxConnector::uuid(void) +TQString MyMoneyOfxConnector::uuid(void) { static int id = 1; - return QDateTime::currentDateTime().toString("yyyyMMdd-hhmmsszzz-") + QString::number(id++); + return TQDateTime::tqcurrentDateTime().toString("yyyyMMdd-hhmmsszzz-") + TQString::number(id++); } // @@ -436,9 +436,9 @@ QString MyMoneyOfxConnector::uuid(void) // the open source software community. // -const QByteArray MyMoneyOfxConnector::statementResponse(const QDate& _dtstart) const +const TQByteArray MyMoneyOfxConnector::statementResponse(const TQDate& _dtstart) const { - QString request; + TQString request; if ( accounttype()=="CC" ) request = header() + Tag("OFX").subtag(signOnResponse()).subtag(creditCardStatementResponse(_dtstart)); @@ -448,7 +448,7 @@ const QByteArray MyMoneyOfxConnector::statementResponse(const QDate& _dtstart) c request = header() + Tag("OFX").subtag(signOnResponse()).subtag(bankStatementResponse(_dtstart)); // remove the trailing zero - QByteArray result = request.utf8(); + TQByteArray result = request.utf8(); result.truncate(result.size()-1); return result; @@ -456,7 +456,7 @@ const QByteArray MyMoneyOfxConnector::statementResponse(const QDate& _dtstart) c MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOnResponse(void) const { - QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); Tag sonrs("SONRS"); sonrs @@ -480,7 +480,7 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::signOnResponse(void) const return Tag("SIGNONMSGSRSV1").subtag(sonrs); } -MyMoneyOfxConnector::Tag MyMoneyOfxConnector::messageResponse(const QString& _msgType, const QString& _trnType, const Tag& _response) +MyMoneyOfxConnector::Tag MyMoneyOfxConnector::messageResponse(const TQString& _msgType, const TQString& _trnType, const Tag& _response) { return Tag(_msgType+"MSGSRSV1") .subtag(Tag(_trnType+"TRNRS") @@ -490,20 +490,20 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::messageResponse(const QString& _ms .subtag(_response)); } -MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementResponse(const QDate& _dtstart) const +MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementResponse(const TQDate& _dtstart) const { MyMoneyFile* file = MyMoneyFile::instance(); - QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]")); - QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); + TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); - QString transactionlist; + TQString transactionlist; MyMoneyTransactionFilter filter; - filter.setDateFilter(_dtstart,QDate::currentDate()); + filter.setDateFilter(_dtstart,TQDate::tqcurrentDate()); filter.addAccount(m_account.id()); - QValueList transactions = file->transactionList(filter); - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList transactions = file->transactionList(filter); + TQValueList::const_iterator it_transaction = transactions.begin(); while ( it_transaction != transactions.end() ) { transactionlist += transaction( *it_transaction ); @@ -514,23 +514,23 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::bankStatementResponse(const QDate& .element("CURDEF","USD") .subtag(Tag("BANKACCTFROM").element("BANKID", iban()).element("ACCTID", accountnum()).element("ACCTTYPE", "CHECKING")) .subtag(Tag("BANKTRANLIST").element("DTSTART",dtstart_string).element("DTEND",dtnow_string).data(transactionlist)) - .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(QString(),2)).element("DTASOF",dtnow_string ))); + .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(TQString(),2)).element("DTASOF",dtnow_string ))); } -MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardStatementResponse(const QDate& _dtstart) const +MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardStatementResponse(const TQDate& _dtstart) const { MyMoneyFile* file = MyMoneyFile::instance(); - QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]")); - QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); + TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); - QString transactionlist; + TQString transactionlist; MyMoneyTransactionFilter filter; - filter.setDateFilter(_dtstart,QDate::currentDate()); + filter.setDateFilter(_dtstart,TQDate::tqcurrentDate()); filter.addAccount(m_account.id()); - QValueList transactions = file->transactionList(filter); - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList transactions = file->transactionList(filter); + TQValueList::const_iterator it_transaction = transactions.begin(); while ( it_transaction != transactions.end() ) { transactionlist += transaction( *it_transaction ); @@ -541,24 +541,24 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::creditCardStatementResponse(const .element("CURDEF","USD") .subtag(Tag("CCACCTFROM").element("ACCTID", accountnum())) .subtag(Tag("BANKTRANLIST").element("DTSTART",dtstart_string).element("DTEND",dtnow_string).data(transactionlist)) - .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(QString(),2)).element("DTASOF",dtnow_string ))); + .subtag(Tag("LEDGERBAL").element("BALAMT",file->balance(m_account.id()).formatMoney(TQString(),2)).element("DTASOF",dtnow_string ))); } -QString MyMoneyOfxConnector::investmentStatementResponse(const QDate& _dtstart) const +TQString MyMoneyOfxConnector::investmentStatementResponse(const TQDate& _dtstart) const { MyMoneyFile* file = MyMoneyFile::instance(); - QString dtstart_string = _dtstart.toString(Qt::ISODate).remove(QRegExp("[^0-9]")); - QString dtnow_string = QDateTime::currentDateTime().toString(Qt::ISODate).remove(QRegExp("[^0-9]")); + TQString dtstart_string = _dtstart.toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); + TQString dtnow_string = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate).remove(TQRegExp("[^0-9]")); - QString transactionlist; + TQString transactionlist; MyMoneyTransactionFilter filter; - filter.setDateFilter(_dtstart,QDate::currentDate()); + filter.setDateFilter(_dtstart,TQDate::tqcurrentDate()); filter.addAccount(m_account.id()); filter.addAccount(m_account.accountList()); - QValueList transactions = file->transactionList(filter); - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList transactions = file->transactionList(filter); + TQValueList::const_iterator it_transaction = transactions.begin(); while ( it_transaction != transactions.end() ) { transactionlist += investmentTransaction( *it_transaction ); @@ -575,8 +575,8 @@ QString MyMoneyOfxConnector::investmentStatementResponse(const QDate& _dtstart) securitylist.subtag(Tag("STOCKINFO") .subtag(Tag("SECINFO") .subtag(Tag("SECID") - .element("UNIQUEID",equity.id()) - .element("UNIQUEIDTYPE","KMYMONEY")) + .element("UNITQUEID",equity.id()) + .element("UNITQUEIDTYPE","KMYMONEY")) .element("SECNAME",equity.name()) .element("TICKER",equity.tradingSymbol()) .element("FIID",equity.id()))); @@ -612,8 +612,8 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::transaction(const MyMoneyTransacti // This is a temporary hack. I don't use the trntype field in importing at all, // but libofx requires it to be there in order to import the file. .element("TRNTYPE","DEBIT") - .element("DTPOSTED",_t.postDate().toString(Qt::ISODate).remove(QRegExp("[^0-9]"))) - .element("TRNAMT",s.value().formatMoney(QString(),2)); + .element("DTPOSTED",_t.postDate().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"))) + .element("TRNAMT",s.value().formatMoney(TQString(),2)); if ( ! _t.bankID().isEmpty() ) result.element("FITID",_t.bankID()); @@ -639,10 +639,10 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone //Use this version for inv transactions MyMoneySplit s = _t.splitByAccount( m_account.accountList(), true ); - QCString stockid = file->account(s.accountId()).currencyId(); + TQCString stockid = file->account(s.accountId()).currencyId(); Tag invtran("INVTRAN"); - invtran.element("FITID",_t.id()).element("DTTRADE",_t.postDate().toString(Qt::ISODate).remove(QRegExp("[^0-9]"))); + invtran.element("FITID",_t.id()).element("DTTRADE",_t.postDate().toString(Qt::ISODate).remove(TQRegExp("[^0-9]"))); if ( !_t.memo().isEmpty() ) invtran.element("MEMO",_t.memo()); @@ -653,10 +653,10 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone return Tag("SELLSTOCK") .subtag(Tag("INVSELL") .subtag(invtran) - .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY")) - .element("UNITS",QString(((s.shares())).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]"))) - .element("UNITPRICE",QString((s.value()/s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.]"))) - .element("TOTAL",QString((-s.value()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]"))) + .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY")) + .element("UNITS",TQString(((s.shares())).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]"))) + .element("UNITPRICE",TQString((s.value()/s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.]"))) + .element("TOTAL",TQString((-s.value()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]"))) .element("SUBACCTSEC","CASH") .element("SUBACCTFUND","CASH")) .element("SELLTYPE","SELL"); @@ -666,10 +666,10 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone return Tag("BUYSTOCK") .subtag(Tag("INVBUY") .subtag(invtran) - .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY")) - .element("UNITS",QString((s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]"))) - .element("UNITPRICE",QString((s.value()/s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.]"))) - .element("TOTAL",QString((-(s.value())).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]"))) + .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY")) + .element("UNITS",TQString((s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]"))) + .element("UNITPRICE",TQString((s.value()/s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.]"))) + .element("TOTAL",TQString((-(s.value())).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]"))) .element("SUBACCTSEC","CASH") .element("SUBACCTFUND","CASH")) .element("BUYTYPE","BUY"); @@ -682,22 +682,22 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone return Tag("REINVEST") .subtag(invtran) - .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY")) + .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY")) .element("INCOMETYPE","DIV") - .element("TOTAL",QString((-s.value()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]"))) + .element("TOTAL",TQString((-s.value()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]"))) .element("SUBACCTSEC","CASH") - .element("UNITS",QString((s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.\\-]"))) - .element("UNITPRICE",QString((s.value()/s.shares()).formatMoney(QString(),2)).remove(QRegExp("[^0-9.]"))); + .element("UNITS",TQString((s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.\\-]"))) + .element("UNITPRICE",TQString((s.value()/s.shares()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9.]"))); } else if ( s.action() == MyMoneySplit::ActionDividend ) { // find the split with the category, which has the actual amount of the dividend - QValueList splits = _t.splits(); - QValueList::const_iterator it_split = splits.begin(); + TQValueList splits = _t.splits(); + TQValueList::const_iterator it_split = splits.begin(); bool found = false; while( it_split != splits.end() ) { - QCString accid = (*it_split).accountId(); + TQCString accid = (*it_split).accountId(); MyMoneyAccount acc = file->account(accid); if ( acc.accountType() == MyMoneyAccount::Income || acc.accountType() == MyMoneyAccount::Expense ) { @@ -710,9 +710,9 @@ MyMoneyOfxConnector::Tag MyMoneyOfxConnector::investmentTransaction(const MyMone if ( found ) return Tag("INCOME") .subtag(invtran) - .subtag(Tag("SECID").element("UNIQUEID",stockid).element("UNIQUEIDTYPE","KMYMONEY")) + .subtag(Tag("SECID").element("UNITQUEID",stockid).element("UNITQUEIDTYPE","KMYMONEY")) .element("INCOMETYPE","DIV") - .element("TOTAL",QString((-(*it_split).value()).formatMoney(QString(),2)).remove(QRegExp("[^0-9\\.\\-]"))) + .element("TOTAL",TQString((-(*it_split).value()).formatMoney(TQString(),2)).remove(TQRegExp("[^0-9\\.\\-]"))) .element("SUBACCTSEC","CASH") .element("SUBACCTFUND","CASH"); else diff --git a/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.h b/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.h index 1091b15..56497f2 100644 --- a/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.h +++ b/kmymoney2/plugins/ofximport/dialogs/mymoneyofxconnector.h @@ -40,7 +40,7 @@ // ---------------------------------------------------------------------------- // QT Includes -class QDate; +class TQDate; // ---------------------------------------------------------------------------- // KDE Includes @@ -61,17 +61,17 @@ class MyMoneyTransaction; class OfxAppVersion { public: - OfxAppVersion(KComboBox* combo, const QString& appId); + OfxAppVersion(KComboBox* combo, const TQString& appId); /** * This method returns the currently selected application id * as a colon separated value consisting of the application - * and version (eg. "QWIN:1700"). If current value is the + * and version (eg. "TQWIN:1700"). If current value is the * default, an empty string is returned. */ - const QString& appId(void) const; + const TQString& appId(void) const; private: - QMap m_appMap; + TQMap m_appMap; KComboBox* m_combo; }; @@ -81,8 +81,8 @@ private: class OfxHeaderVersion { public: - OfxHeaderVersion(KComboBox* combo, const QString& headerVersion); - QString headerVersion(void) const; + OfxHeaderVersion(KComboBox* combo, const TQString& headerVersion); + TQString headerVersion(void) const; private: KComboBox* m_combo; @@ -95,25 +95,25 @@ class MyMoneyOfxConnector { public: MyMoneyOfxConnector(const MyMoneyAccount& _account); - QString url(void) const; + TQString url(void) const; /** * Constructs the request for a statement. The first date * for which transactions will be requested is determined * by statementStartDate() */ - const QByteArray statementRequest(void) const; - const QByteArray statementResponse(const QDate& _dtstart) const; + const TQByteArray statementRequest(void) const; + const TQByteArray statementResponse(const TQDate& _dtstart) const; private: void initRequest(OfxFiLogin* fi) const; - QDate statementStartDate(void) const; - QString iban(void) const; - QString fiorg(void) const; - QString fiid(void) const; - QString username(void) const; - QString password(void) const; - QString accountnum(void) const; + TQDate statementStartDate(void) const; + TQString iban(void) const; + TQString fiorg(void) const; + TQString fiid(void) const; + TQString username(void) const; + TQString password(void) const; + TQString accountnum(void) const; #if LIBOFX_IS_VERSION(0,9,0) OfxAccountData::AccountType accounttype(void) const; #else diff --git a/kmymoney2/plugins/ofximport/ofximporterplugin.cpp b/kmymoney2/plugins/ofximport/ofximporterplugin.cpp index 21a6466..77b790e 100644 --- a/kmymoney2/plugins/ofximport/ofximporterplugin.cpp +++ b/kmymoney2/plugins/ofximport/ofximporterplugin.cpp @@ -18,11 +18,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,8 +45,8 @@ K_EXPORT_COMPONENT_FACTORY( kmm_ofximport, KGenericFactory( "kmm_ofximport" ) ) -OfxImporterPlugin::OfxImporterPlugin(QObject *parent, const char *name, const QStringList&) : - KMyMoneyPlugin::Plugin( parent, name ), +OfxImporterPlugin::OfxImporterPlugin(TQObject *tqparent, const char *name, const TQStringList&) : + KMyMoneyPlugin::Plugin( tqparent, name ), KMyMoneyPlugin::ImporterPlugin(), m_valid( false ) { @@ -61,7 +61,7 @@ OfxImporterPlugin::~OfxImporterPlugin() void OfxImporterPlugin::createActions(void) { - new KAction(i18n("OFX..."), "", 0, this, SLOT(slotImportFile()), actionCollection(), "file_import_ofx"); + new KAction(i18n("OFX..."), "", 0, this, TQT_SLOT(slotImportFile()), actionCollection(), "file_import_ofx"); } void OfxImporterPlugin::slotImportFile(void) @@ -74,42 +74,42 @@ void OfxImporterPlugin::slotImportFile(void) if ( isMyFormat(url.path()) ) { slotImportFile(url.path()); } else { - KMessageBox::error( 0, i18n("Unable to import %1 using the OFX importer plugin. This file is not the correct format.").arg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("Incorrect format")); + KMessageBox::error( 0, i18n("Unable to import %1 using the OFX importer plugin. This file is not the correct format.").tqarg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("Incorrect format")); } } } -QString OfxImporterPlugin::formatName(void) const +TQString OfxImporterPlugin::formatName(void) const { return "OFX"; } -QString OfxImporterPlugin::formatFilenameFilter(void) const +TQString OfxImporterPlugin::formatFilenameFilter(void) const { return "*.ofx *.qfx *.ofc"; } -bool OfxImporterPlugin::isMyFormat( const QString& filename ) const +bool OfxImporterPlugin::isMyFormat( const TQString& filename ) const { - // filename is considered an Ofx file if it contains + // filename is considered an Ofx file if it tqcontains // the tag "" or "" in the first 20 lines // which contain some data. bool result = false; - QFile f( filename ); + TQFile f( filename ); if ( f.open( IO_ReadOnly ) ) { - QTextStream ts( &f ); + TQTextStream ts( &f ); int lineCount = 20; while ( !ts.atEnd() && !result && lineCount != 0) { // get a line of data and remove all unnecessary whitepace chars - QString line = ts.readLine().simplifyWhiteSpace(); - if ( line.contains("",false) - || line.contains("",false) ) + TQString line = ts.readLine().simplifyWhiteSpace(); + if ( line.tqcontains("",false) + || line.tqcontains("",false) ) result = true; // count only lines that contains some non white space chars if(!line.isEmpty()) @@ -121,7 +121,7 @@ bool OfxImporterPlugin::isMyFormat( const QString& filename ) const return result; } -bool OfxImporterPlugin::import( const QString& filename ) +bool OfxImporterPlugin::import( const TQString& filename ) { m_fatalerror = i18n("Unable to parse file"); m_valid = false; @@ -132,7 +132,7 @@ bool OfxImporterPlugin::import( const QString& filename ) m_statementlist.clear(); m_securitylist.clear(); - QCString filename_deep( filename.utf8() ); + TQCString filename_deep( filename.utf8() ); LibofxContextPtr ctx = libofx_get_new_context(); Q_CHECK_PTR(ctx); @@ -147,13 +147,13 @@ bool OfxImporterPlugin::import( const QString& filename ) if ( m_valid ) { - m_fatalerror = QString(); + m_fatalerror = TQString(); m_valid = storeStatements(m_statementlist); } return m_valid; } -QString OfxImporterPlugin::lastError(void) const +TQString OfxImporterPlugin::lastError(void) const { if(m_errors.count() == 0) return m_fatalerror; @@ -179,13 +179,13 @@ int OfxImporterPlugin::ofxTransactionCallback(struct OfxTransactionData data, vo if(data.date_posted_valid==true) { - QDateTime dt; + TQDateTime dt; dt.setTime_t(data.date_posted, Qt::UTC); t.m_datePosted = dt.date(); } else if(data.date_initiated_valid==true) { - QDateTime dt; + TQDateTime dt; dt.setTime_t(data.date_initiated, Qt::UTC); t.m_datePosted = dt.date(); } @@ -206,11 +206,11 @@ int OfxImporterPlugin::ofxTransactionCallback(struct OfxTransactionData data, vo if(data.fi_id_valid==true) { - t.m_strBankID = QString("ID ") + data.fi_id; + t.m_strBankID = TQString("ID ") + data.fi_id; } else if(data.reference_number_valid==true) { - t.m_strBankID = QString("REF ") + data.reference_number; + t.m_strBankID = TQString("REF ") + data.reference_number; } // Decide whether to import NAME or PAYEEID if both are present in the download if (pofx->m_preferName) { @@ -288,7 +288,7 @@ int OfxImporterPlugin::ofxTransactionCallback(struct OfxTransactionData data, vo } bool unhandledtype = false; - QString type; + TQString type; if(data.invtransactiontype_valid==true) { @@ -351,7 +351,7 @@ int OfxImporterPlugin::ofxTransactionCallback(struct OfxTransactionData data, vo break; default: unhandledtype = true; - type = QString("UNKNOWN %1").arg(data.invtransactiontype); + type = TQString("UNKNOWN %1").tqarg(data.invtransactiontype); break; } } @@ -373,14 +373,14 @@ int OfxImporterPlugin::ofxTransactionCallback(struct OfxTransactionData data, vo double proper_total = t.m_dShares * data.unitprice + t.m_moneyFees; if ( proper_total != t.m_moneyAmount ) { - pofx->addWarning(QString("Transaction %1 has an incorrect total of %2. Using calculated total of %3 instead.").arg(t.m_strBankID).arg(t.m_moneyAmount).arg(proper_total)); + pofx->addWarning(TQString("Transaction %1 has an incorrect total of %2. Using calculated total of %3 instead.").tqarg(t.m_strBankID).tqarg(t.m_moneyAmount).tqarg(proper_total)); t.m_moneyAmount = proper_total; } } #endif if ( unhandledtype ) - pofx->addWarning(QString("Transaction %1 has an unsupported type (%2).").arg(t.m_strBankID,type)); + pofx->addWarning(TQString("Transaction %1 has an unsupported type (%2).").tqarg(t.m_strBankID,type)); else s.m_listTransactions += t; @@ -409,14 +409,14 @@ int OfxImporterPlugin::ofxStatementCallback(struct OfxStatementData data, void* if(data.date_start_valid==true) { - QDateTime dt; + TQDateTime dt; dt.setTime_t(data.date_start, Qt::UTC); s.m_dateBegin = dt.date(); } if(data.date_end_valid==true) { - QDateTime dt; + TQDateTime dt; dt.setTime_t(data.date_end, Qt::UTC); s.m_dateEnd = dt.date(); } @@ -482,7 +482,7 @@ int OfxImporterPlugin::ofxAccountCallback(struct OfxAccountData data, void * pv) } // ask KMyMoney for an account id - s.m_accountId = pofx->account("kmmofx-acc-ref", QString("%1-%2").arg(s.m_strRoutingNumber, s.m_strAccountNumber)).id(); + s.m_accountId = pofx->account("kmmofx-acc-ref", TQString("%1-%2").tqarg(s.m_strRoutingNumber, s.m_strAccountNumber)).id(); // copy over the securities s.m_listSecurities = pofx->m_securitylist; @@ -519,7 +519,7 @@ int OfxImporterPlugin::ofxStatusCallback(struct OfxStatusData data, void * pv) // kdDebug(2) << __func__ << endl; OfxImporterPlugin* pofx = reinterpret_cast(pv); - QString message; + TQString message; // if we got this far, we know we were able to parse the file. // so if it fails after here it can only because there were no actual @@ -527,13 +527,13 @@ int OfxImporterPlugin::ofxStatusCallback(struct OfxStatusData data, void * pv) pofx->m_fatalerror = "No accounts found."; if(data.ofx_element_name_valid==true) - message.prepend(QString("%1: ").arg(data.ofx_element_name)); + message.prepend(TQString("%1: ").tqarg(data.ofx_element_name)); if(data.code_valid==true) - message += QString("%1 (Code %2): %3").arg(data.name).arg(data.code).arg(data.description); + message += TQString("%1 (Code %2): %3").tqarg(data.name).tqarg(data.code).tqarg(data.description); if(data.server_message_valid==true) - message += QString(" (%1)").arg(data.server_message); + message += TQString(" (%1)").tqarg(data.server_message); if(data.severity_valid==true){ switch(data.severity){ @@ -564,21 +564,21 @@ bool OfxImporterPlugin::importStatement(const MyMoneyStatement& s) return statementInterface()->import(s); } -const MyMoneyAccount& OfxImporterPlugin::account(const QString& key, const QString& value) const +const MyMoneyAccount& OfxImporterPlugin::account(const TQString& key, const TQString& value) const { return statementInterface()->account(key, value); } -void OfxImporterPlugin::protocols(QStringList& protocolList) const +void OfxImporterPlugin::protocols(TQStringList& protocolList) const { protocolList.clear(); protocolList << "OFX"; } -QWidget* OfxImporterPlugin::accountConfigTab(const MyMoneyAccount& acc, QString& name) +TQWidget* OfxImporterPlugin::accountConfigTab(const MyMoneyAccount& acc, TQString& name) { name = i18n("Online settings"); - m_statusDlg = new KOnlineBankingStatus(acc, 0, 0); + m_statusDlg = new KOnlineBankingtqStatus(acc, 0, 0); return m_statusDlg; } @@ -593,13 +593,13 @@ MyMoneyKeyValueContainer OfxImporterPlugin::onlineBankingSettings(const MyMoneyK if(!m_statusDlg->appId().isEmpty()) kvp.setValue("appId", m_statusDlg->appId()); kvp.setValue("kmmofx-headerVersion", m_statusDlg->headerVersion()); - kvp.setValue("kmmofx-numRequestDays", QString::number(m_statusDlg->m_numdaysSpin->value())); - kvp.setValue("kmmofx-todayMinus", QString::number(m_statusDlg->m_todayRB->isChecked())); - kvp.setValue("kmmofx-lastUpdate", QString::number(m_statusDlg->m_lastUpdateRB->isChecked())); - kvp.setValue("kmmofx-pickDate", QString::number(m_statusDlg->m_pickDateRB->isChecked())); + kvp.setValue("kmmofx-numRequestDays", TQString::number(m_statusDlg->m_numdaysSpin->value())); + kvp.setValue("kmmofx-todayMinus", TQString::number(m_statusDlg->m_todayRB->isChecked())); + kvp.setValue("kmmofx-lastUpdate", TQString::number(m_statusDlg->m_lastUpdateRB->isChecked())); + kvp.setValue("kmmofx-pickDate", TQString::number(m_statusDlg->m_pickDateRB->isChecked())); kvp.setValue("kmmofx-specificDate", m_statusDlg->m_specificDate->date().toString()); - kvp.setValue("kmmofx-preferPayeeid", QString::number(m_statusDlg->m_payeeidRB->isChecked())); - kvp.setValue("kmmofx-preferName", QString::number(m_statusDlg->m_nameRB->isChecked())); + kvp.setValue("kmmofx-preferPayeeid", TQString::number(m_statusDlg->m_payeeidRB->isChecked())); + kvp.setValue("kmmofx-preferName", TQString::number(m_statusDlg->m_nameRB->isChecked())); } return kvp; } @@ -611,7 +611,7 @@ bool OfxImporterPlugin::mapAccount(const MyMoneyAccount& acc, MyMoneyKeyValueCon bool rc = false; KOnlineBankingSetupWizard wiz(0, "onlinebankingsetup"); if(wiz.isInit()) { - if(wiz.exec() == QDialog::Accepted) { + if(wiz.exec() == TQDialog::Accepted) { rc = wiz.chosenSettings( settings ); } } @@ -629,29 +629,29 @@ bool OfxImporterPlugin::updateAccount(const MyMoneyAccount& acc, bool moreAccoun m_preferName = acc.onlineBankingSettings().value("kmmofx-preferName").toInt() != 0; KOfxDirectConnectDlg dlg(acc); - connect(&dlg, SIGNAL(statementReady(const QString&)), - this, SLOT(slotImportFile(const QString&))); + connect(&dlg, TQT_SIGNAL(statementReady(const TQString&)), + this, TQT_SLOT(slotImportFile(const TQString&))); dlg.init(); dlg.exec(); } } catch (MyMoneyException *e) { - KMessageBox::information(0 ,i18n("Error connecting to bank: %1").arg(e->what())); + KMessageBox::information(0 ,i18n("Error connecting to bank: %1").tqarg(e->what())); delete e; } return false; } -void OfxImporterPlugin::slotImportFile(const QString& url) +void OfxImporterPlugin::slotImportFile(const TQString& url) { if(!import(url)) { - KMessageBox::error( 0, QString("%1").arg(i18n("Unable to import %1 using the OFX importer plugin. The plugin returned the following error:

%2").arg(url, lastError())), i18n("Importing error")); + KMessageBox::error( 0, TQString("%1").tqarg(i18n("Unable to import %1 using the OFX importer plugin. The plugin returned the following error:

%2").tqarg(url, lastError())), i18n("Importing error")); } } -bool OfxImporterPlugin::storeStatements(QValueList& statements) +bool OfxImporterPlugin::storeStatements(TQValueList& statements) { bool hasstatements = (statements.count() > 0); bool ok = true; @@ -671,7 +671,7 @@ bool OfxImporterPlugin::storeStatements(QValueList& statements }*/ qDebug("OfxImporterPlugin::storeStatements() with %d statements called", static_cast(statements.count())); - QValueList::const_iterator it_s = statements.begin(); + TQValueList::const_iterator it_s = statements.begin(); while ( it_s != statements.end() && !abort ) { ok = ok && importStatement((*it_s)); ++it_s; diff --git a/kmymoney2/plugins/ofximport/ofximporterplugin.h b/kmymoney2/plugins/ofximport/ofximporterplugin.h index b665439..36473d8 100644 --- a/kmymoney2/plugins/ofximport/ofximporterplugin.h +++ b/kmymoney2/plugins/ofximport/ofximporterplugin.h @@ -24,7 +24,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // Library Includes @@ -35,7 +35,7 @@ // Project Includes #include "../kmymoneyplugin.h" -class KOnlineBankingStatus; +class KOnlineBankingtqStatus; /** @author Ace Jones @@ -43,8 +43,9 @@ class KOnlineBankingStatus; class OfxImporterPlugin : public KMyMoneyPlugin::Plugin, public KMyMoneyPlugin::ImporterPlugin, public KMyMoneyPlugin::OnlinePlugin { Q_OBJECT + TQ_OBJECT public: - OfxImporterPlugin(QObject *parent = 0, const char *name = 0, const QStringList& = QStringList()); + OfxImporterPlugin(TQObject *tqparent = 0, const char *name = 0, const TQStringList& = TQStringList()); ~OfxImporterPlugin(); @@ -52,18 +53,18 @@ public: * This method returns the english-language name of the format * this plugin imports, e.g. "OFX" * - * @return QString Name of the format + * @return TQString Name of the format */ - virtual QString formatName(void) const; + virtual TQString formatName(void) const; /** * This method returns the filename filter suitable for passing to * KFileDialog::setFilter(), e.g. "*.ofx *.qfx" which describes how * files of this format are likely to be named in the file system * - * @return QString Filename filter string + * @return TQString Filename filter string */ - virtual QString formatFilenameFilter(void) const; + virtual TQString formatFilenameFilter(void) const; /** * This method returns whether this plugin is able to import @@ -73,7 +74,7 @@ public: * * @return bool Whether the indicated file is importable by this plugin */ - virtual bool isMyFormat( const QString& filename ) const; + virtual bool isMyFormat( const TQString& filename ) const; /** * Import a file @@ -82,31 +83,31 @@ public: * * @return bool Whether the import was successful. */ - virtual bool import( const QString& filename ); + virtual bool import( const TQString& filename ); /** * Returns the error result of the last import * - * @return QString English-language name of the error encountered in the - * last import, or QString() if it was successful. + * @return TQString English-language name of the error encountered in the + * last import, or TQString() if it was successful. * */ - virtual QString lastError(void) const; + virtual TQString lastError(void) const; - QWidget* accountConfigTab(const MyMoneyAccount& acc, QString& name); + TQWidget* accountConfigTab(const MyMoneyAccount& acc, TQString& name); MyMoneyKeyValueContainer onlineBankingSettings(const MyMoneyKeyValueContainer& current); - const MyMoneyAccount& account(const QString& key, const QString& value) const; + const MyMoneyAccount& account(const TQString& key, const TQString& value) const; - void protocols(QStringList& protocolList) const; + void protocols(TQStringList& protocolList) const; bool mapAccount(const MyMoneyAccount& acc, MyMoneyKeyValueContainer& settings); bool updateAccount(const MyMoneyAccount& acc, bool moreAccounts); protected slots: void slotImportFile(void); - void slotImportFile(const QString& url); + void slotImportFile(const TQString& url); protected: void createActions(void); @@ -114,13 +115,13 @@ protected: MyMoneyStatement& back(void) { return m_statementlist.back(); } bool isValid(void) const { return m_valid; } void setValid(void) { m_valid = true; } - void addInfo(const QString& _msg ) { m_infos+=_msg; } - void addWarning(const QString& _msg ) { m_warnings+=_msg; } - void addError(const QString& _msg ) { m_errors+=_msg; } - const QStringList& infos(void) const { return m_infos; } - const QStringList& warnings(void) const { return m_warnings; } - const QStringList& errors(void) const { return m_errors; } - bool storeStatements(QValueList& statements); + void addInfo(const TQString& _msg ) { m_infos+=_msg; } + void addWarning(const TQString& _msg ) { m_warnings+=_msg; } + void addError(const TQString& _msg ) { m_errors+=_msg; } + const TQStringList& infos(void) const { return m_infos; } + const TQStringList& warnings(void) const { return m_warnings; } + const TQStringList& errors(void) const { return m_errors; } + bool storeStatements(TQValueList& statements); bool importStatement(const MyMoneyStatement& s); @@ -133,13 +134,13 @@ protected: private: bool m_valid; bool m_preferName; - QValueList m_statementlist; - QValueList m_securitylist; - QString m_fatalerror; - QStringList m_infos; - QStringList m_warnings; - QStringList m_errors; - KOnlineBankingStatus* m_statusDlg; + TQValueList m_statementlist; + TQValueList m_securitylist; + TQString m_fatalerror; + TQStringList m_infos; + TQStringList m_warnings; + TQStringList m_errors; + KOnlineBankingtqStatus* m_statusDlg; }; #endif diff --git a/kmymoney2/plugins/ofximport/ofxpartner.cpp b/kmymoney2/plugins/ofximport/ofxpartner.cpp index d36fbb2..9605e5a 100644 --- a/kmymoney2/plugins/ofximport/ofxpartner.cpp +++ b/kmymoney2/plugins/ofximport/ofxpartner.cpp @@ -23,15 +23,15 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -48,26 +48,26 @@ namespace OfxPartner { -bool post(const QString& request, const QMap& attr, const KURL& url, const KURL& filename); -bool get(const QString& request, const QMap& attr, const KURL& url, const KURL& filename); +bool post(const TQString& request, const TQMap& attr, const KURL& url, const KURL& filename); +bool get(const TQString& request, const TQMap& attr, const KURL& url, const KURL& filename); -const QString kBankFilename = "ofx-bank-index.xml"; -const QString kCcFilename = "ofx-cc-index.xml"; -const QString kInvFilename = "ofx-inv-index.xml"; +const TQString kBankFilename = "ofx-bank-index.xml"; +const TQString kCcFilename = "ofx-cc-index.xml"; +const TQString kInvFilename = "ofx-inv-index.xml"; #define VER "9" -static QString directory; +static TQString directory; -void setDirectory(const QString& dir) +void setDirectory(const TQString& dir) { directory = dir; } -bool needReload(const QFileInfo& i) +bool needReload(const TQFileInfo& i) { return ((!i.isReadable()) - || (i.lastModified().addDays(7) < QDateTime::currentDateTime()) + || (i.lastModified().addDays(7) < TQDateTime::tqcurrentDateTime()) || (i.size() < 1024)); } @@ -78,55 +78,55 @@ void ValidateIndexCache(void) struct stat filestats; KURL fname; - QMap attr; + TQMap attr; attr["content-type"] = "application/x-www-form-urlencoded"; attr["accept"] = "*/*"; fname = directory + kBankFilename; - QFileInfo i(fname.path()); + TQFileInfo i(fname.path()); if(needReload(i)) post("T=1&S=*&R=1&O=0&TEST=0", attr, KURL("http://moneycentral.msn.com/money/2005/mnynet/service/ols/filist.aspx?SKU=3&VER=" VER), fname); fname = directory + kCcFilename; - i = QFileInfo(fname.path()); + i = TQFileInfo(fname.path()); if(needReload(i)) post("T=2&S=*&R=1&O=0&TEST=0", attr, KURL("http://moneycentral.msn.com/money/2005/mnynet/service/ols/filist.aspx?SKU=3&VER=" VER) ,fname); fname = directory + kInvFilename; - i = QFileInfo(fname.path()); + i = TQFileInfo(fname.path()); if(needReload(i)) post("T=3&S=*&R=1&O=0&TEST=0", attr, KURL("http://moneycentral.msn.com/money/2005/mnynet/service/ols/filist.aspx?SKU=3&VER=" VER), fname); } -static void ParseFile(QMap& result, const QString& fileName, const QString& bankName) +static void ParseFile(TQMap& result, const TQString& fileName, const TQString& bankName) { - QFile f(fileName); + TQFile f(fileName); if(f.open(IO_ReadOnly)) { - QTextStream stream(&f); - stream.setEncoding(QTextStream::Unicode); - QString msg; + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::Unicode); + TQString msg; int errl, errc; - QDomDocument doc; + TQDomDocument doc; if(doc.setContent(stream.read(), &msg, &errl, &errc)) { - QDomNodeList olist = doc.elementsByTagName("prov"); + TQDomNodeList olist = doc.elementsByTagName("prov"); for(int i = 0; i < olist.count(); ++i) { - QDomNode onode = olist.item(i); + TQDomNode onode = olist.item(i); if(onode.isElement()) { bool collectGuid = false; - QDomElement elo = onode.toElement(); - QDomNodeList ilist = onode.childNodes(); + TQDomElement elo = onode.toElement(); + TQDomNodeList ilist = onode.childNodes(); for(int j = 0; j < ilist.count(); ++j) { - QDomNode inode = ilist.item(j); - QDomElement el = inode.toElement(); + TQDomNode inode = ilist.item(j); + TQDomElement el = inode.toElement(); if(el.tagName() == "name") { if(bankName.isEmpty()) - result[el.text()] = QString(); + result[el.text()] = TQString(); else if(el.text() == bankName) { collectGuid = true; } } if(el.tagName() == "guid" && collectGuid) { - result[el.text()] = QString(); + result[el.text()] = TQString(); } } } @@ -136,26 +136,26 @@ static void ParseFile(QMap& result, const QString& fileName, c } } -QValueList BankNames(void) +TQValueList BankNames(void) { - QMap result; + TQMap result; // Make sure the index files are up to date ValidateIndexCache(); - ParseFile(result, directory + kBankFilename, QString()); - ParseFile(result, directory + kCcFilename, QString()); - ParseFile(result, directory + kInvFilename, QString()); + ParseFile(result, directory + kBankFilename, TQString()); + ParseFile(result, directory + kCcFilename, TQString()); + ParseFile(result, directory + kInvFilename, TQString()); // Add Innovision - result["Innovision"] = QString(); + result["Innovision"] = TQString(); return result.keys(); } -QValueList FipidForBank(const QString& bank) +TQValueList FipidForBank(const TQString& bank) { - QMap result; + TQMap result; ParseFile(result, directory + kBankFilename, bank); ParseFile(result, directory + kCcFilename, bank); @@ -163,21 +163,21 @@ QValueList FipidForBank(const QString& bank) // the fipid for Innovision is 1. if ( bank == "Innovision" ) - result["1"] = QString(); + result["1"] = TQString(); return result.keys(); } -QString extractNodeText(QDomElement& node, const QString& name) +TQString extractNodeText(TQDomElement& node, const TQString& name) { - QString res; - QRegExp exp("([^/]+)/?([^/].*)?"); + TQString res; + TQRegExp exp("([^/]+)/?([^/].*)?"); if(exp.search(name) != -1) { - QDomNodeList olist = node.elementsByTagName(exp.cap(1)); + TQDomNodeList olist = node.elementsByTagName(exp.cap(1)); if(olist.count()) { - QDomNode onode = olist.item(0); + TQDomNode onode = olist.item(0); if(onode.isElement()) { - QDomElement elo = onode.toElement(); + TQDomElement elo = onode.toElement(); if(exp.cap(2).isEmpty()) { res = elo.text(); } else { @@ -189,16 +189,16 @@ QString extractNodeText(QDomElement& node, const QString& name) return res; } -QString extractNodeText(QDomDocument& doc, const QString& name) +TQString extractNodeText(TQDomDocument& doc, const TQString& name) { - QString res; - QRegExp exp("([^/]+)/?([^/].*)?"); + TQString res; + TQRegExp exp("([^/]+)/?([^/].*)?"); if(exp.search(name) != -1) { - QDomNodeList olist = doc.elementsByTagName(exp.cap(1)); + TQDomNodeList olist = doc.elementsByTagName(exp.cap(1)); if(olist.count()) { - QDomNode onode = olist.item(0); + TQDomNode onode = olist.item(0); if(onode.isElement()) { - QDomElement elo = onode.toElement(); + TQDomElement elo = onode.toElement(); if(exp.cap(2).isEmpty()) { res = elo.text(); } else { @@ -210,7 +210,7 @@ QString extractNodeText(QDomDocument& doc, const QString& name) return res; } -OfxFiServiceInfo ServiceInfo(const QString& fipid) +OfxFiServiceInfo ServiceInfo(const TQString& fipid) { OfxFiServiceInfo result; memset(&result, 0, sizeof(OfxFiServiceInfo)); @@ -229,31 +229,31 @@ OfxFiServiceInfo ServiceInfo(const QString& fipid) return result; } - QMap attr; + TQMap attr; attr["content-type"] = "application/x-www-form-urlencoded"; attr["accept"] = "*/*"; - KURL guidFile(QString("%1fipid-%2.xml").arg(directory).arg(fipid)); + KURL guidFile(TQString("%1fipid-%2.xml").tqarg(directory).tqarg(fipid)); - // Apparently at some point in time, for VER=6 msn returned an online URL + // Aptqparently at some point in time, for VER=6 msn returned an online URL // to a static error page (http://moneycentral.msn.com/cust404.htm). // Increasing to VER=9 solved the problem. This may happen again in the // future. - QFileInfo i(guidFile.path()); - if(!i.isReadable() || i.lastModified().addDays(7) < QDateTime::currentDateTime()) - get("", attr, KURL(QString("http://moneycentral.msn.com/money/2005/mnynet/service/olsvcupd/OnlSvcBrandInfo.aspx?MSNGUID=&GUID=%1&SKU=3&VER=" VER).arg(fipid)), guidFile); + TQFileInfo i(guidFile.path()); + if(!i.isReadable() || i.lastModified().addDays(7) < TQDateTime::tqcurrentDateTime()) + get("", attr, KURL(TQString("http://moneycentral.msn.com/money/2005/mnynet/service/olsvcupd/OnlSvcBrandInfo.aspx?MSNGUID=&GUID=%1&SKU=3&VER=" VER).tqarg(fipid)), guidFile); - QFile f(guidFile.path()); + TQFile f(guidFile.path()); if(f.open(IO_ReadOnly)) { - QTextStream stream(&f); - stream.setEncoding(QTextStream::Unicode); - QString msg; + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::Unicode); + TQString msg; int errl, errc; - QDomDocument doc; + TQDomDocument doc; if(doc.setContent(stream.read(), &msg, &errl, &errc)) { - QString fid = extractNodeText(doc, "ProviderSettings/FID"); - QString org = extractNodeText(doc, "ProviderSettings/Org"); - QString url = extractNodeText(doc, "ProviderSettings/ProviderURL"); + TQString fid = extractNodeText(doc, "ProviderSettings/FID"); + TQString org = extractNodeText(doc, "ProviderSettings/Org"); + TQString url = extractNodeText(doc, "ProviderSettings/ProviderURL"); strncpy(result.fid, fid.latin1(), OFX_FID_LENGTH-1); strncpy(result.org, org.latin1(), OFX_ORG_LENGTH-1); strncpy(result.url, url.latin1(), OFX_URL_LENGTH-1); @@ -267,22 +267,22 @@ OfxFiServiceInfo ServiceInfo(const QString& fipid) return result; } -bool get(const QString& request, const QMap& attr, const KURL& url, const KURL& filename) +bool get(const TQString& request, const TQMap& attr, const KURL& url, const KURL& filename) { - QByteArray req(0); + TQByteArray req(0); OfxHttpRequest job("GET", url, req, attr, filename, true); - return job.error() == QHttp::NoError; + return job.error() == TQHttp::NoError; } -bool post(const QString& request, const QMap& attr, const KURL& url, const KURL& filename) +bool post(const TQString& request, const TQMap& attr, const KURL& url, const KURL& filename) { - QByteArray req; + TQByteArray req; req.fill(0, request.length()+1); req.duplicate(request.ascii(), request.length()); OfxHttpRequest job("POST", url, req, attr, filename, true); - return job.error() == QHttp::NoError; + return job.error() == TQHttp::NoError; } } // namespace OfxPartner @@ -290,16 +290,16 @@ bool post(const QString& request, const QMap& attr, const KURL class OfxHttpsRequest::Private { public: - QFile m_fpTrace; + TQFile m_fpTrace; }; -OfxHttpsRequest::OfxHttpsRequest(const QString& type, const KURL &url, const QByteArray &postData, const QMap& metaData, const KURL& dst, bool showProgressInfo) : +OfxHttpsRequest::OfxHttpsRequest(const TQString& type, const KURL &url, const TQByteArray &postData, const TQMap& metaData, const KURL& dst, bool showProgressInfo) : d(new Private), m_dst(dst) { - QDir homeDir(QDir::home()); + TQDir homeDir(TQDir::home()); if(homeDir.exists("ofxlog.txt")) { - d->m_fpTrace.setName(QString("%1/ofxlog.txt").arg(QDir::homeDirPath())); + d->m_fpTrace.setName(TQString("%1/ofxlog.txt").tqarg(TQDir::homeDirPath())); d->m_fpTrace.open(IO_WriteOnly | IO_Append); } @@ -307,16 +307,16 @@ OfxHttpsRequest::OfxHttpsRequest(const QString& type, const KURL &url, const QBy m_job->addMetaData("content-type", "Content-type: application/x-ofx" ); if(d->m_fpTrace.isOpen()) { - QTextStream ts(&d->m_fpTrace); + TQTextStream ts(&d->m_fpTrace); ts << "url: " << url.prettyURL() << "\n"; - ts << "request:\n" << QString(postData) << "\n" << "response:\n"; + ts << "request:\n" << TQString(postData) << "\n" << "response:\n"; } - connect(m_job,SIGNAL(result(KIO::Job*)),this,SLOT(slotOfxFinished(KIO::Job*))); - connect(m_job,SIGNAL(data(KIO::Job*, const QByteArray&)),this,SLOT(slotOfxData(KIO::Job*,const QByteArray&))); - connect(m_job,SIGNAL(connected(KIO::Job*)),this,SLOT(slotOfxConnected(KIO::Job*))); + connect(m_job,TQT_SIGNAL(result(KIO::Job*)),this,TQT_SLOT(slotOfxFinished(KIO::Job*))); + connect(m_job,TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),this,TQT_SLOT(slotOfxData(KIO::Job*,const TQByteArray&))); + connect(m_job,TQT_SIGNAL(connected(KIO::Job*)),this,TQT_SLOT(slotOfxConnected(KIO::Job*))); - qApp->enter_loop(); + tqApp->enter_loop(); } OfxHttpsRequest::~OfxHttpsRequest() @@ -332,11 +332,11 @@ void OfxHttpsRequest::slotOfxConnected(KIO::Job*) m_file.open(IO_WriteOnly); } -void OfxHttpsRequest::slotOfxData(KIO::Job*,const QByteArray& _ba) +void OfxHttpsRequest::slotOfxData(KIO::Job*,const TQByteArray& _ba) { if(m_file.isOpen()) { - QTextStream ts(&m_file); - ts << QString(_ba); + TQTextStream ts(&m_file); + ts << TQString(_ba); if(d->m_fpTrace.isOpen()) { d->m_fpTrace.writeBlock(_ba, _ba.size()); @@ -361,11 +361,11 @@ void OfxHttpsRequest::slotOfxFinished(KIO::Job* /* e */) unlink(m_dst.path()); } else if ( m_job->isErrorPage() ) { - QString details; - QFile f( m_dst.path() ); + TQString details; + TQFile f( m_dst.path() ); if ( f.open( IO_ReadOnly ) ) { - QTextStream stream( &f ); - QString line; + TQTextStream stream( &f ); + TQString line; while ( !stream.atEnd() ) { details += stream.readLine(); // line of text excluding '\n' } @@ -375,42 +375,42 @@ void OfxHttpsRequest::slotOfxFinished(KIO::Job* /* e */) unlink(m_dst.path()); } - qApp->exit_loop(); + tqApp->exit_loop(); } -OfxHttpRequest::OfxHttpRequest(const QString& type, const KURL &url, const QByteArray &postData, const QMap& metaData, const KURL& dst, bool showProgressInfo) +OfxHttpRequest::OfxHttpRequest(const TQString& type, const KURL &url, const TQByteArray &postData, const TQMap& metaData, const KURL& dst, bool showProgressInfo) { - QFile f(dst.path()); - m_error = QHttp::NoError; - QString errorMsg; + TQFile f(dst.path()); + m_error = TQHttp::NoError; + TQString errorMsg; if(f.open(IO_WriteOnly)) { - m_job = new QHttp(url.host()); - QHttpRequestHeader header(type, url.encodedPathAndQuery()); + m_job = new TQHttp(url.host()); + TQHttpRequestHeader header(type, url.encodedPathAndQuery()); header.setValue("Host", url.host()); - QMap::const_iterator it; + TQMap::const_iterator it; for(it = metaData.begin(); it != metaData.end(); ++it) { header.setValue(it.key(), *it); } - m_job->request(header, postData, &f); + m_job->request(header, postData, TQT_TQIODEVICE(&f)); - connect(m_job, SIGNAL(requestFinished(int, bool)), - this, SLOT(slotOfxFinished(int, bool))); + connect(m_job, TQT_SIGNAL(requestFinished(int, bool)), + this, TQT_SLOT(slotOfxFinished(int, bool))); - qApp->enter_loop(); + tqApp->enter_loop(); - if(m_error != QHttp::NoError) + if(m_error != TQHttp::NoError) errorMsg = m_job->errorString(); delete m_job; } else { - m_error = QHttp::Aborted; - errorMsg = i18n("Cannot open file %1 for writing").arg(dst.path()); + m_error = TQHttp::Aborted; + errorMsg = i18n("Cannot open file %1 for writing").tqarg(dst.path()); } - if(m_error != QHttp::NoError) { + if(m_error != TQHttp::NoError) { KMessageBox::error(0, errorMsg, i18n("OFX setup error")); unlink(dst.path()); } @@ -421,7 +421,7 @@ void OfxHttpRequest::slotOfxFinished(int, bool rc) if(rc) { m_error = m_job->error(); } - qApp->exit_loop(); + tqApp->exit_loop(); } #include "ofxpartner.moc" diff --git a/kmymoney2/plugins/ofximport/ofxpartner.h b/kmymoney2/plugins/ofximport/ofxpartner.h index e624282..84f4d2a 100644 --- a/kmymoney2/plugins/ofximport/ofxpartner.h +++ b/kmymoney2/plugins/ofximport/ofxpartner.h @@ -22,8 +22,8 @@ // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -49,54 +49,56 @@ namespace OfxPartner * default will be to store the files in the current * directory. */ - void setDirectory(const QString& dir); + void setDirectory(const TQString& dir); void ValidateIndexCache(void); - OfxFiServiceInfo ServiceInfo(const QString& fipid); - QValueList BankNames(void); - QValueList FipidForBank(const QString& bank); + OfxFiServiceInfo ServiceInfo(const TQString& fipid); + TQValueList BankNames(void); + TQValueList FipidForBank(const TQString& bank); } -class OfxHttpRequest : public QObject +class OfxHttpRequest : public TQObject { Q_OBJECT + TQ_OBJECT public: - OfxHttpRequest(const QString& method, const KURL &url, const QByteArray &postData, const QMap& metaData, const KURL& dst, bool showProgressInfo=true); + OfxHttpRequest(const TQString& method, const KURL &url, const TQByteArray &postData, const TQMap& metaData, const KURL& dst, bool showProgressInfo=true); virtual ~OfxHttpRequest() {} - QHttp::Error error(void) const { return m_error; } + TQHttp::Error error(void) const { return m_error; } protected slots: void slotOfxFinished(int, bool); private: - QHttp* m_job; + TQHttp* m_job; KURL m_dst; - QHttp::Error m_error; + TQHttp::Error m_error; }; -class OfxHttpsRequest : public QObject +class OfxHttpsRequest : public TQObject { Q_OBJECT + TQ_OBJECT public: - OfxHttpsRequest(const QString& method, const KURL &url, const QByteArray &postData, const QMap& metaData, const KURL& dst, bool showProgressInfo=true); + OfxHttpsRequest(const TQString& method, const KURL &url, const TQByteArray &postData, const TQMap& metaData, const KURL& dst, bool showProgressInfo=true); virtual ~OfxHttpsRequest(); - QHttp::Error error(void) const { return m_error; } + TQHttp::Error error(void) const { return m_error; } protected slots: void slotOfxFinished(KIO::Job*); - void slotOfxData(KIO::Job*,const QByteArray&); + void slotOfxData(KIO::Job*,const TQByteArray&); void slotOfxConnected(KIO::Job*); private: class Private; Private* d; KURL m_dst; - QFile m_file; - QHttp::Error m_error; + TQFile m_file; + TQHttp::Error m_error; KIO::TransferJob* m_job; }; #endif // OFXPARTNER_H diff --git a/kmymoney2/plugins/pluginloader.cpp b/kmymoney2/plugins/pluginloader.cpp index 0201337..49f9dcc 100644 --- a/kmymoney2/plugins/pluginloader.cpp +++ b/kmymoney2/plugins/pluginloader.cpp @@ -18,9 +18,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -48,24 +48,24 @@ namespace KMyMoneyPlugin { //--------------------------------------------------------------------- static PluginLoader* s_instance = 0; -typedef QMap PluginsMap; +typedef TQMap PluginsMap; struct PluginLoader::Private { - QObject* m_parent; + TQObject* m_parent; KPluginInfo::List m_pluginList; KPluginSelector* m_pluginSelector; PluginsMap m_loadedPlugins; }; -PluginLoader::PluginLoader(QObject* parent) +PluginLoader::PluginLoader(TQObject* tqparent) { Q_ASSERT( s_instance == 0 ); s_instance = this; d = new Private; - d->m_parent = parent; + d->m_parent = tqparent; KTrader::OfferList offers = KTrader::self()->query("KMyMoneyPlugin"); d->m_pluginList = KPluginInfo::fromServices(offers); @@ -75,8 +75,8 @@ PluginLoader::PluginLoader(QObject* parent) d->m_pluginSelector->addPlugins(d->m_pluginList); d->m_pluginSelector->load(); - connect(d->m_pluginSelector, SIGNAL(changed(bool)), this, SLOT(changed())); - connect(d->m_pluginSelector, SIGNAL(configCommitted(const QCString &)), this, SLOT(changedConfigOfPlugin(const QCString &))); + connect(d->m_pluginSelector, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(changed())); + connect(d->m_pluginSelector, TQT_SIGNAL(configCommitted(const TQCString &)), this, TQT_SLOT(changedConfigOfPlugin(const TQCString &))); } PluginLoader::~PluginLoader() @@ -100,7 +100,7 @@ void PluginLoader::loadPlugin(KPluginInfo* info) KService::Ptr service = info->service(); int error = 0; Plugin* plugin = KParts::ComponentFactory - ::createInstanceFromService(service, d->m_parent, info->name().utf8(), QStringList(), &error); + ::createInstanceFromService(service, d->m_parent, info->name().utf8(), TQStringList(), &error); if (plugin) { kdDebug() << "KMyMoneyPlugin::PluginLoader: Loaded plugin " << plugin->name() << endl; d->m_loadedPlugins.insert(info->name(), plugin); @@ -131,16 +131,16 @@ void PluginLoader::changed() loadPlugins(); } -void PluginLoader::changedConfigOfPlugin(const QCString & name) +void PluginLoader::changedConfigOfPlugin(const TQCString & name) { - PluginsMap::iterator itPlugin = d->m_loadedPlugins.find(QString(name)); + PluginsMap::iterator itPlugin = d->m_loadedPlugins.tqfind(TQString(name)); if (itPlugin != d->m_loadedPlugins.end()) configChanged(*itPlugin); } Plugin* PluginLoader::getPluginFromInfo(KPluginInfo* info) { - PluginsMap::iterator itPlugin = d->m_loadedPlugins.find(info->name()); + PluginsMap::iterator itPlugin = d->m_loadedPlugins.tqfind(info->name()); if (itPlugin != d->m_loadedPlugins.end()) return *itPlugin; else diff --git a/kmymoney2/plugins/pluginloader.h b/kmymoney2/plugins/pluginloader.h index 4d0c500..5111948 100644 --- a/kmymoney2/plugins/pluginloader.h +++ b/kmymoney2/plugins/pluginloader.h @@ -25,8 +25,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,11 +43,12 @@ namespace KMyMoneyPlugin { class Plugin; - class KMYMONEY_EXPORT PluginLoader : public QObject + class KMYMONEY_EXPORT PluginLoader : public TQObject { Q_OBJECT + TQ_OBJECT public: - PluginLoader(QObject* parent); + PluginLoader(TQObject* tqparent); virtual ~PluginLoader(); static PluginLoader* instance(); @@ -65,7 +66,7 @@ namespace KMyMoneyPlugin private slots: void changed(); - void changedConfigOfPlugin( const QCString & ); + void changedConfigOfPlugin( const TQCString & ); private: struct Private; diff --git a/kmymoney2/plugins/statementinterface.cpp b/kmymoney2/plugins/statementinterface.cpp index 753db2e..3dfac42 100644 --- a/kmymoney2/plugins/statementinterface.cpp +++ b/kmymoney2/plugins/statementinterface.cpp @@ -26,8 +26,8 @@ #include "statementinterface.h" -KMyMoneyPlugin::StatementInterface::StatementInterface(QObject* parent, const char* name) : - QObject(parent, name) +KMyMoneyPlugin::StatementInterface::StatementInterface(TQObject* tqparent, const char* name) : + TQObject(tqparent, name) { } diff --git a/kmymoney2/plugins/statementinterface.h b/kmymoney2/plugins/statementinterface.h index a3a31d1..66d533a 100644 --- a/kmymoney2/plugins/statementinterface.h +++ b/kmymoney2/plugins/statementinterface.h @@ -25,7 +25,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,11 +43,12 @@ namespace KMyMoneyPlugin { * This abstract class represents the interface to import statements * into the KMyMoney application */ -class KMYMONEY_EXPORT StatementInterface : public QObject { +class KMYMONEY_EXPORT StatementInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: - StatementInterface(QObject* parent, const char* name = 0); + StatementInterface(TQObject* tqparent, const char* name = 0); ~StatementInterface() {} /** @@ -60,7 +61,7 @@ public: * If the account is not found in the list of accounts, MyMoneyAccount() * is returned. */ - virtual const MyMoneyAccount& account(const QString& key, const QString& value) const = 0; + virtual const MyMoneyAccount& account(const TQString& key, const TQString& value) const = 0; /** */ diff --git a/kmymoney2/plugins/viewinterface.cpp b/kmymoney2/plugins/viewinterface.cpp index 4db12f1..03f0d0b 100644 --- a/kmymoney2/plugins/viewinterface.cpp +++ b/kmymoney2/plugins/viewinterface.cpp @@ -26,8 +26,8 @@ #include "viewinterface.h" -KMyMoneyPlugin::ViewInterface::ViewInterface(QObject* parent, const char* name) : - QObject(parent, name) +KMyMoneyPlugin::ViewInterface::ViewInterface(TQObject* tqparent, const char* name) : + TQObject(tqparent, name) { } diff --git a/kmymoney2/plugins/viewinterface.h b/kmymoney2/plugins/viewinterface.h index d7c7424..edec926 100644 --- a/kmymoney2/plugins/viewinterface.h +++ b/kmymoney2/plugins/viewinterface.h @@ -25,10 +25,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -class QFrame; +#include +#include +#include +class TQFrame; // ---------------------------------------------------------------------------- // KDE Includes @@ -53,27 +53,28 @@ namespace KMyMoneyPlugin { * add new view pages to the JanusWidget of KMyMoney. It * also gives access to the account context menu. */ -class KMYMONEY_EXPORT ViewInterface : public QObject { +class KMYMONEY_EXPORT ViewInterface : public TQObject { Q_OBJECT + TQ_OBJECT public: - ViewInterface(QObject* parent, const char* name = 0); + ViewInterface(TQObject* tqparent, const char* name = 0); ~ViewInterface() {} /** * This method creates a new page in the application. * See KJanusWidget::addPage() for details. */ - virtual KMyMoneyViewBase* addPage(const QString& item, const QString& icon) = 0; + virtual KMyMoneyViewBase* addPage(const TQString& item, const TQString& icon) = 0; /** - * This method adds a widget to the layout of the view + * This method adds a widget to the tqlayout of the view * created with addPage() * * @param view pointer to view widget * @param w widget to be added to @p page */ - virtual void addWidget(KMyMoneyViewBase* view, QWidget* w) = 0; + virtual void addWidget(KMyMoneyViewBase* view, TQWidget* w) = 0; signals: /** @@ -87,7 +88,7 @@ signals: /** * This signal is emitted when a transaction/list of transactions has been selected by * the GUI. If no transaction is selected or the selection is removed, - * @p transactions is identical to an empty QValueList. This signal is used + * @p transactions is identical to an empty TQValueList. This signal is used * by plugins to get information about changes. */ void transactionsSelected(const KMyMoneyRegister::SelectedTransactions& transactions); @@ -109,10 +110,10 @@ signals: * @param date the reconciliation date as provided through the dialog * @param startingBalance the starting balance as provided through the dialog * @param endingBalance the ending balance as provided through the dialog - * @param transactionList reference to QValueList of QPair containing all + * @param transactionList reference to TQValueList of TQPair containing all * transaction/split pairs processed by the reconciliation. */ - void accountReconciled(const MyMoneyAccount& account, const QDate& date, const MyMoneyMoney& startingBalance, const MyMoneyMoney& endingBalance, const QValueList >& transactionList); + void accountReconciled(const MyMoneyAccount& account, const TQDate& date, const MyMoneyMoney& startingBalance, const MyMoneyMoney& endingBalance, const TQValueList >& transactionList); void viewStateChanged(bool); diff --git a/kmymoney2/reports/kreportchartview.cpp b/kmymoney2/reports/kreportchartview.cpp index 21b08fa..e9c9060 100644 --- a/kmymoney2/reports/kreportchartview.cpp +++ b/kmymoney2/reports/kreportchartview.cpp @@ -34,12 +34,12 @@ using namespace reports; -KReportChartView::KReportChartView( QWidget* parent, const char* name ): KDChartWidget(parent,name) +KReportChartView::KReportChartView( TQWidget* tqparent, const char* name ): KDChartWidget(tqparent,name) { // ******************************************************************** // Set KMyMoney's Chart Parameter Defaults // ******************************************************************** - this->setPaletteBackgroundColor( Qt::white ); + this->setPaletteBackgroundColor( TQt::white ); KDChartParams* _params = new KDChartParams(); _params->setChartType( KDChartParams::Line ); @@ -49,7 +49,7 @@ KReportChartView::KReportChartView( QWidget* parent, const char* name ): KDChart /** // use line marker, but only circles. _params->setLineMarker( true ); - _params->setLineMarkerSize( QSize(8,8) ); + _params->setLineMarkerSize( TQSize(8,8) ); _params->setLineMarkerStyle( 0, KDChartParams::LineMarkerCircle ); _params->setLineMarkerStyle( 1, KDChartParams::LineMarkerCircle ); _params->setLineMarkerStyle( 2, KDChartParams::LineMarkerCircle ); @@ -90,21 +90,21 @@ KReportChartView::KReportChartView( QWidget* parent, const char* name ): KDChart // ******************************************************************** // Tooltip Setup // ******************************************************************** - label = new QLabel( this ); + label = new TQLabel( this ); label->hide(); - // mouse tracking on will force the mouseMoveEvent() method to be called from Qt + // mouse tracking on will force the mouseMoveEvent() method to be called from TQt label->setMouseTracking( true ); - label->setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); - label->setAlignment( AlignRight ); + label->setFrameStyle( TQFrame::PopupPanel | TQFrame::Raised ); + label->tqsetAlignment( AlignRight ); label->setAutoResize( true ); } /** * This function implements mouseMoveEvents */ -void KReportChartView::mouseMoveEvent( QMouseEvent* event ) +void KReportChartView::mouseMoveEvent( TQMouseEvent* event ) { - QPoint translate, pos; // some movement helpers + TQPoint translate, pos; // some movement helpers uint dataset; // the current dataset (eg. category) uint datasets; // the total number of datasets double value; // the value of the region @@ -121,10 +121,10 @@ void KReportChartView::mouseMoveEvent( QMouseEvent* event ) // ..by going through every data region and checking whether it // contains the mouse pointer KDChartDataRegion* current = 0; - QPtrListIterator < KDChartDataRegion > it( *(this->dataRegions()) ); + TQPtrListIterator < KDChartDataRegion > it( *(this->dataRegions()) ); while ( ( current = it.current() ) ) { ++it; - if ( current->contains( event->pos() ) ) + if ( current->tqcontains( event->pos() ) ) { // we found the data region that contains the mouse value = this->data()->cellVal(current->row, current->col).toDouble(); @@ -150,18 +150,18 @@ void KReportChartView::mouseMoveEvent( QMouseEvent* event ) if(datasets > 1) { // set the tooltip text - label->setText(QString("

%1

%2
(%3\%)") - .arg(this->params()->legendText( dataset )) - .arg(value, 0, 'f', 2) - .arg(pivot_sum, 0, 'f', 2) + label->setText(TQString("

%1

%2
(%3\%)") + .tqarg(this->params()->legendText( dataset )) + .tqarg(value, 0, 'f', 2) + .tqarg(pivot_sum, 0, 'f', 2) ); } else // if there is only one dataset, don't show percentage { // set the tooltip text - label->setText(QString("

%1

%2") - .arg(this->params()->legendText( dataset )) - .arg(value, 0, 'f', 2) + label->setText(TQString("

%1

%2") + .tqarg(this->params()->legendText( dataset )) + .tqarg(value, 0, 'f', 2) ); } diff --git a/kmymoney2/reports/kreportchartview.h b/kmymoney2/reports/kreportchartview.h index a1bf786..d04e291 100644 --- a/kmymoney2/reports/kreportchartview.h +++ b/kmymoney2/reports/kreportchartview.h @@ -34,7 +34,7 @@ #undef new #endif -#include +#include #include #include #include @@ -51,11 +51,11 @@ namespace reports { class KReportChartView: public KDChartWidget { public: - KReportChartView( QWidget* parent, const char* name ); + KReportChartView( TQWidget* tqparent, const char* name ); ~KReportChartView() {} static bool implemented(void) { return true; } void setNewData( const KDChartTableData& newdata ) { this->setData(new KDChartTableData(newdata)); } - QStringList& abscissaNames(void) { return m_abscissaNames; } + TQStringList& abscissaNames(void) { return m_abscissaNames; } void refreshLabels(void) { this->params()->setAxisLabelStringParams( KDChartAxisParams::AxisPosBottom,&m_abscissaNames,0); } void setProperty(int row, int col, int id); // void setCircularLabels(void) { this->params()->setAxisLabelStringParams( KDChartAxisParams::AxisPosCircular,&m_abscissaNames,0); } @@ -64,14 +64,14 @@ public: bool getAccountSeries(void) {return _accountSeries; } protected: - virtual void mouseMoveEvent( QMouseEvent* event ); + virtual void mouseMoveEvent( TQMouseEvent* event ); private: - QStringList m_abscissaNames; + TQStringList m_abscissaNames; bool _accountSeries; // label to display when hovering on a data region - QLabel *label; + TQLabel *label; }; } // end namespace reports @@ -80,10 +80,10 @@ private: namespace reports { -class KReportChartView : public QWidget +class KReportChartView : public TQWidget { public: - KReportChartView( QWidget* parent, const char* name ): QWidget(parent,name) {} + KReportChartView( TQWidget* tqparent, const char* name ): TQWidget(tqparent,name) {} ~KReportChartView() {} static bool implemented(void) { return false; } }; diff --git a/kmymoney2/reports/listtable.cpp b/kmymoney2/reports/listtable.cpp index 797b392..16db407 100644 --- a/kmymoney2/reports/listtable.cpp +++ b/kmymoney2/reports/listtable.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,7 +43,7 @@ namespace reports { - QStringList ListTable::TableRow::m_sortCriteria; + TQStringList ListTable::TableRow::m_sortCriteria; // **************************************************************************** // @@ -54,7 +54,7 @@ namespace reports { class GroupIterator { public: - GroupIterator ( const QString& _group, const QString& _subtotal, unsigned _depth ) : m_depth ( _depth ), m_groupField ( _group ), m_subtotalField ( _subtotal ) {} + GroupIterator ( const TQString& _group, const TQString& _subtotal, unsigned _depth ) : m_depth ( _depth ), m_groupField ( _group ), m_subtotalField ( _subtotal ) {} GroupIterator ( void ) {} void update ( const ListTable::TableRow& _row ) { @@ -73,20 +73,20 @@ namespace reports { const MyMoneyMoney& subtotal ( void ) const { return m_previousSubtotal; } const MyMoneyMoney& currenttotal ( void ) const { return m_currentSubtotal; } unsigned depth ( void ) const { return m_depth; } - const QString& name ( void ) const { return m_currentGroup; } - const QString& oldName ( void ) const { return m_previousGroup; } - const QString& groupField ( void ) const { return m_groupField; } - const QString& subtotalField ( void ) const { return m_subtotalField; } + const TQString& name ( void ) const { return m_currentGroup; } + const TQString& oldName ( void ) const { return m_previousGroup; } + const TQString& groupField ( void ) const { return m_groupField; } + const TQString& subtotalField ( void ) const { return m_subtotalField; } // ***DV*** HACK make the currentGroup test different but look the same void force ( void ) { m_currentGroup += " "; } private: MyMoneyMoney m_currentSubtotal; MyMoneyMoney m_previousSubtotal; unsigned m_depth; - QString m_currentGroup; - QString m_previousGroup; - QString m_groupField; - QString m_subtotalField; + TQString m_currentGroup; + TQString m_previousGroup; + TQString m_groupField; + TQString m_subtotalField; }; // **************************************************************************** @@ -99,7 +99,7 @@ namespace reports { { bool result = false; - QStringList::const_iterator it_criterion = m_sortCriteria.begin(); + TQStringList::const_iterator it_criterion = m_sortCriteria.begin(); while ( it_criterion != m_sortCriteria.end() ) { if ( this->operator[] ( *it_criterion ) < _compare[ *it_criterion ] ) @@ -145,28 +145,28 @@ namespace reports { { } - void ListTable::render ( QString& result, QString& csv ) const + void ListTable::render ( TQString& result, TQString& csv ) const { MyMoneyMoney grandtotal; MyMoneyFile* file = MyMoneyFile::instance(); result = ""; csv = ""; - result += QString ( "

%1

\n" ).arg ( m_config.name() ); + result += TQString ( "

%1

\n" ).arg ( m_config.name() ); csv += "\"Report: " + m_config.name() + "\"\n"; //actual dates of the report - result += QString("
"); + result += TQString("
"); if(!m_config.fromDate().isNull()) { - result += i18n("Report date range", "%1 through %2").arg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).arg(KGlobal::locale()->formatDate(m_config.toDate(), true)); - result += QString("
\n"); - result += QString("
 
\n"); + result += i18n("Report date range", "%1 through %2").tqarg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).tqarg(KGlobal::locale()->formatDate(m_config.toDate(), true)); + result += TQString("
\n"); + result += TQString("
 
\n"); - csv += i18n("Report date range", "%1 through %2").arg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).arg(KGlobal::locale()->formatDate(m_config.toDate(), true)); - csv += QString("\n"); + csv += i18n("Report date range", "%1 through %2").tqarg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).tqarg(KGlobal::locale()->formatDate(m_config.toDate(), true)); + csv += TQString("\n"); } - result += QString ( "
" ); + result += TQString ( "
" ); if ( m_config.isConvertCurrency() ) { result += i18n ( "All currencies converted to %1" ).arg ( file->baseCurrency().name() ); @@ -177,23 +177,23 @@ namespace reports { result += i18n ( "All values shown in %1 unless otherwise noted" ).arg ( file->baseCurrency().name() ); csv += i18n ( "All values shown in %1 unless otherwise noted\n" ).arg ( file->baseCurrency().name() ); } - result += QString ( "
\n" ); - result += QString ( "
 
\n" ); + result += TQString ( "
\n" ); + result += TQString ( "
 
\n" ); // retrieve the configuration parameters from the report definition. // the things that we care about for query reports are: // how to group the rows, what columns to display, and what field // to subtotal on - QStringList groups = QStringList::split ( ",", m_group ); - QStringList columns = QStringList::split ( ",", m_columns ); + TQStringList groups = TQStringList::split ( ",", m_group ); + TQStringList columns = TQStringList::split ( ",", m_columns ); columns += m_subtotal; - QStringList postcolumns = QStringList::split ( ",", m_postcolumns ); + TQStringList postcolumns = TQStringList::split ( ",", m_postcolumns ); columns += postcolumns; // // Table header // - QMap i18nHeaders; + TQMap i18nHeaders; i18nHeaders["postdate"] = i18n ( "Date" ); i18nHeaders["value"] = i18n ( "Amount" ); i18nHeaders["number"] = i18n ( "Num" ); @@ -246,24 +246,24 @@ namespace reports { i18nHeaders["currentbalance"] = i18n ( "Current Balance" ); // the list of columns which represent money, so we can display them correctly - QStringList moneyColumns = QStringList::split ( ",", "value,shares,price,latestprice,netinvvalue,buys,sells,cashincome,reinvestincome,startingbal,fees,interest,payment,balance,balancewarning,maxbalancelimit,creditwarning,maxcreditlimit,loanamount,periodicpayment,finalpayment,currentbalance" ); + TQStringList moneyColumns = TQStringList::split ( ",", "value,shares,price,latestprice,netinvvalue,buys,sells,cashincome,reinvestincome,startingbal,fees,interest,payment,balance,balancewarning,maxbalancelimit,creditwarning,maxcreditlimit,loanamount,periodicpayment,finalpayment,currentbalance" ); // the list of columns which represent shares, which is like money except the // transaction currency will not be displayed - QStringList sharesColumns = QStringList::split ( ",", "shares" ); + TQStringList sharesColumns = TQStringList::split ( ",", "shares" ); // the list of columns which represent a percentage, so we can display them correctly - QStringList percentColumns = QStringList::split ( ",", "return,returninvestment,interestrate" ); + TQStringList percentColumns = TQStringList::split ( ",", "return,returninvestment,interestrate" ); // the list of columns which represent dates, so we can display them correctly - QStringList dateColumns = QStringList::split ( ",", "postdate,entrydate,nextduedate,openingdate,nextinterestchange" ); + TQStringList dateColumns = TQStringList::split ( ",", "postdate,entrydate,nextduedate,openingdate,nextinterestchange" ); result += "\n"; - QStringList::const_iterator it_column = columns.begin(); + TQStringList::const_iterator it_column = columns.begin(); while ( it_column != columns.end() ) { - QString i18nName = i18nHeaders[*it_column]; + TQString i18nName = i18nHeaders[*it_column]; if ( i18nName.isEmpty() ) i18nName = *it_column; result += ""; @@ -286,8 +286,8 @@ namespace reports { // header. The group iterator keeps track of a subtotal also. int depth = 1; - QValueList groupIteratorList; - QStringList::const_iterator it_grouplevel = groups.begin(); + TQValueList groupIteratorList; + TQStringList::const_iterator it_grouplevel = groups.begin(); while ( it_grouplevel != groups.end() ) { groupIteratorList += GroupIterator ( ( *it_grouplevel ), m_subtotal, depth++ ); @@ -302,7 +302,7 @@ namespace reports { // ***DV*** MyMoneyMoney startingBalance; - for ( QValueList::const_iterator it_row = m_rows.begin(); + for ( TQValueList::const_iterator it_row = m_rows.begin(); it_row != m_rows.end(); ++it_row ) { @@ -310,7 +310,7 @@ namespace reports { // this could be overridden using the "fraction" element of a row for each row. // Currently (2008-02-21) this override is not used at all (ipwizard) int fraction = file->baseCurrency().smallestAccountFraction(); - if ( ( *it_row ).find ( "fraction" ) != ( *it_row ).end() ) + if ( ( *it_row ).tqfind ( "fraction" ) != ( *it_row ).end() ) fraction = ( *it_row ) ["fraction"].toInt(); // @@ -328,7 +328,7 @@ namespace reports { // then we need to force all the downstream groups to get one too. // Update the group iterators with the current row value - QValueList::iterator it_group = groupIteratorList.begin(); + TQValueList::iterator it_group = groupIteratorList.begin(); while ( it_group != groupIteratorList.end() ) { ( *it_group ).update ( *it_row ); @@ -347,17 +347,17 @@ namespace reports { grandtotal += ( *it_group ).subtotal(); grandtotal = grandtotal.convert(fraction); - QString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); - QString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); + TQString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); + TQString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); // ***DV*** HACK fix the side-effiect from .force() method above - QString oldName = QString ( ( *it_group ).oldName() ).stripWhiteSpace(); + TQString oldName = TQString ( ( *it_group ).oldName() ).stripWhiteSpace(); result += "" - "" "\n"; @@ -376,8 +376,8 @@ namespace reports { { row_odd = true; result += "" - "\n"; csv += "\"" + ( *it_group ).name() + "\"\n"; } @@ -390,7 +390,7 @@ namespace reports { // skip the opening and closing balance row, // if the balance column is not shown - if ( ( columns.contains ( "balance" ) == 0 ) && ( ( *it_row ) ["rank"] == "-2" ) ) + if ( ( columns.tqcontains ( "balance" ) == 0 ) && ( ( *it_row ) ["rank"] == "-2" ) ) continue; bool need_label = true; @@ -399,17 +399,17 @@ namespace reports { if ( ( * it_row ) ["rank"] == "0" ) row_odd = ! row_odd; if ( ( * it_row ) ["rank"] == "-2" ) - result += QString ( "" ).arg ( ( * it_row ) ["id"] ); + result += TQString ( "" ).arg ( ( * it_row ) ["id"] ); else if ( ( * it_row ) ["rank"] == "1" ) - result += QString ( "" ).arg ( row_odd ? "item1" : "item0" ); + result += TQString ( "" ).arg ( row_odd ? "item1" : "item0" ); else - result += QString ( "" ).arg ( row_odd ? "row-odd " : "row-even" ); + result += TQString ( "" ).arg ( row_odd ? "row-odd " : "row-even" ); - QStringList::const_iterator it_column = columns.begin(); + TQStringList::const_iterator it_column = columns.begin(); while ( it_column != columns.end() ) { - QString data = ( *it_row ) [*it_column]; + TQString data = ( *it_row ) [*it_column]; // ***DV*** if ( ( * it_row ) ["rank"] == "1" ) { @@ -468,61 +468,61 @@ namespace reports { // TODO: This and the i18n headings are handled // as a set of parallel vectors. Would be much better to make a single // vector of a properties class. - if ( sharesColumns.contains ( *it_column ) ) + if ( sharesColumns.tqcontains ( *it_column ) ) { if ( data.isEmpty() ) { - result += QString ( "" ); + result += TQString ( "" ); csv += "\"\","; } else { - result += QString ( "" ).arg ( MyMoneyMoney ( data ).formatMoney ( "", 3 ) ); + result += TQString ( "" ).arg ( MyMoneyMoney ( data ).formatMoney ( "", 3 ) ); csv += "\"" + MyMoneyMoney ( data ).formatMoney ( "", 3, false ) + "\","; } } - else if ( moneyColumns.contains ( *it_column ) ) + else if ( moneyColumns.tqcontains ( *it_column ) ) { if ( data.isEmpty() ) { - result += QString ( "" ) + result += TQString ( "" ) .arg ( ( *it_column == "value" ) ? " class=\"value\"" : "" ); csv += "\"\","; } else if ( MyMoneyMoney( data ) == MyMoneyMoney::autoCalc ) { - result += QString ( "%2" ) + result += TQString ( "%2" ) .arg ( ( *it_column == "value" ) ? " class=\"value\"" : "" ) .arg (i18n("Calculated")); csv += "\""+ i18n("Calculated") +"\","; } else if ( *it_column == "price" ) { - result += QString ( "" ) + result += TQString ( "" ) .arg ( MyMoneyMoney ( data ).formatMoney ( MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision()) ) ); csv += "\"" + ( *it_row ) ["currency"] + " " + MyMoneyMoney ( data ).formatMoney ( MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision()), false ) + "\","; } else { - result += QString ( "%2 %3" ) + result += TQString ( "%2 %3" ) .arg ( ( *it_column == "value" ) ? " class=\"value\"" : "" ) .arg ( ( *it_row ) ["currency"] ) .arg ( MyMoneyMoney ( data ).formatMoney ( fraction ) ); csv += "\"" + ( *it_row ) ["currency"] + " " + MyMoneyMoney ( data ).formatMoney ( fraction, false ) + "\","; } } - else if ( percentColumns.contains ( *it_column ) ) + else if ( percentColumns.tqcontains ( *it_column ) ) { data = ( MyMoneyMoney ( data ) * MyMoneyMoney ( 100, 1 ) ).formatMoney ( fraction ); - result += QString ( "" ).arg ( data ); + result += TQString ( "" ).arg ( data ); csv += data + "%,"; } - else if ( dateColumns.contains ( *it_column ) ) + else if ( dateColumns.tqcontains ( *it_column ) ) { // do this before we possibly change data csv += "\"" + data + "\","; // if we have a locale() then use its date formatter if ( KGlobal::locale() && ! data.isEmpty() ) { - QDate qd = QDate::fromString ( data, Qt::ISODate ); + TQDate qd = TQDate::fromString ( data, Qt::ISODate ); data = KGlobal::locale()->formatDate ( qd, true ); } - result += QString ( "" ).arg ( data ); + result += TQString ( "" ).arg ( data ); } else { - result += QString ( "" ).arg ( data ); + result += TQString ( "" ).arg ( data ); csv += "\"" + data + "\","; } ++it_column; @@ -541,7 +541,7 @@ namespace reports { if ( m_config.isConvertCurrency() ) { int fraction = file->baseCurrency().smallestAccountFraction(); - QValueList::iterator it_group = groupIteratorList.fromLast(); + TQValueList::iterator it_group = groupIteratorList.fromLast(); while ( it_group != groupIteratorList.end() ) { ( *it_group ).update ( TableRow() ); @@ -552,12 +552,12 @@ namespace reports { } - QString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); - QString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); + TQString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); + TQString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); result += "" - "" "\n"; csv += "\"" + i18n ( "Total" ) + " " + ( *it_group ).oldName() + "\",\"" + subtotal_csv + "\"\n"; @@ -568,12 +568,12 @@ namespace reports { // Grand total // - QString grandtotal_html = grandtotal.formatMoney ( fraction ); - QString grandtotal_csv = grandtotal.formatMoney ( fraction, false ); + TQString grandtotal_html = grandtotal.formatMoney ( fraction ); + TQString grandtotal_csv = grandtotal.formatMoney ( fraction, false ); result += "" "" "\n"; csv += "\"" + i18n ( "Grand Total" ) + "\",\"" + grandtotal_csv + "\"\n"; @@ -581,29 +581,29 @@ namespace reports { result += "
" + i18nName + "
" + + TQString::number ( columns.count() - 1 - postcolumns.count() ) + "\">" + i18n ( "Total" ) + " " + oldName + "" + subtotal_html + "
" + + "" + ( *it_group ).name() + "
%1%1%2%2%1%%1%%1%1%1%1
" + + "" + i18n ( "Total" ) + " " + ( *it_group ).oldName() + "" + subtotal_html + "
" + + "colspan=\"" + TQString::number ( columns.count() - 1 - postcolumns.count() ) + "\">" + i18n ( "Grand Total" ) + "" + grandtotal_html + "
\n"; } - QString ListTable::renderHTML ( void ) const + TQString ListTable::renderHTML ( void ) const { - QString html, csv; + TQString html, csv; render ( html, csv ); return html; } - QString ListTable::renderCSV ( void ) const + TQString ListTable::renderCSV ( void ) const { - QString html, csv; + TQString html, csv; render ( html, csv ); return csv; } - void ListTable::dump ( const QString& file, const QString& context ) const + void ListTable::dump ( const TQString& file, const TQString& context ) const { - QFile g ( file ); + TQFile g ( file ); g.open ( IO_WriteOnly ); if ( ! context.isEmpty() ) - QTextStream ( &g ) << context.arg ( renderHTML() ); + TQTextStream ( &g ) << context.arg ( renderHTML() ); else - QTextStream ( &g ) << renderHTML(); + TQTextStream ( &g ) << renderHTML(); g.close(); } @@ -612,15 +612,15 @@ namespace reports { // if we're not in expert mode, we need to make sure // that all stock accounts for the selected investment // account are also selected - QStringList accountList; + TQStringList accountList; if(m_config.accounts(accountList)) { if(!KMyMoneyGlobalSettings::expertMode()) { - QStringList::const_iterator it_a, it_b; + TQStringList::const_iterator it_a, it_b; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!accountList.contains(*it_b)) { + if(!accountList.tqcontains(*it_b)) { m_config.addAccount(*it_b); } } diff --git a/kmymoney2/reports/listtable.h b/kmymoney2/reports/listtable.h index 5ffa64d..1397a93 100644 --- a/kmymoney2/reports/listtable.h +++ b/kmymoney2/reports/listtable.h @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,10 +54,10 @@ namespace reports { { public: ListTable ( const MyMoneyReport& ); - QString renderHTML ( void ) const; - QString renderCSV ( void ) const; + TQString renderHTML ( void ) const; + TQString renderCSV ( void ) const; void drawChart ( KReportChartView& ) const {} - void dump ( const QString& file, const QString& context = QString() ) const; + void dump ( const TQString& file, const TQString& context = TQString() ) const; void init ( void ); public: @@ -65,10 +65,10 @@ namespace reports { * Contains a single row in the table. * * Each column is a key/value pair, both strings. This class is just - * a QMap with the added ability to specify which columns you'd like to + * a TQMap with the added ability to specify which columns you'd like to * use as a sort key when you qHeapSort a list of these TableRows */ - class TableRow: public QMap + class TableRow: public TQMap { public: bool operator< ( const TableRow& ) const; @@ -76,15 +76,15 @@ namespace reports { bool operator> ( const TableRow& ) const; bool operator== ( const TableRow& ) const; - static void setSortCriteria ( const QString& _criteria ) { m_sortCriteria = QStringList::split ( ",", _criteria ); } + static void setSortCriteria ( const TQString& _criteria ) { m_sortCriteria = TQStringList::split ( ",", _criteria ); } private: - static QStringList m_sortCriteria; + static TQStringList m_sortCriteria; }; - QValueList rows() {return m_rows;}; + TQValueList rows() {return m_rows;}; protected: - void render ( QString&, QString& ) const; + void render ( TQString&, TQString& ) const; /** * If not in expert mode, include all subaccounts for each selected @@ -92,23 +92,23 @@ namespace reports { */ void includeInvestmentSubAccounts(void); - QValueList m_rows; + TQValueList m_rows; - QString m_group; + TQString m_group; /** * Comma-separated list of columns to place BEFORE the subtotal column */ - QString m_columns; + TQString m_columns; /** * Name of the subtotal column */ - QString m_subtotal; + TQString m_subtotal; /** * Comma-separated list of columns to place AFTER the subtotal column */ - QString m_postcolumns; - QString m_summarize; - QString m_propagate; + TQString m_postcolumns; + TQString m_summarize; + TQString m_propagate; MyMoneyReport m_config; diff --git a/kmymoney2/reports/objectinfotable.cpp b/kmymoney2/reports/objectinfotable.cpp index 649f6c2..37dfecc 100644 --- a/kmymoney2/reports/objectinfotable.cpp +++ b/kmymoney2/reports/objectinfotable.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -105,7 +105,7 @@ void ObjectInfoTable::init ( void ) throw new MYMONEYEXCEPTION ( "ObjectInfoTable::ObjectInfoTable(): unhandled row type" ); } - QString sort = m_group + "," + m_columns + ",id,rank"; + TQString sort = m_group + "," + m_columns + ",id,rank"; switch ( m_config.rowType() ) { case MyMoneyReport::eSchedule: @@ -133,11 +133,11 @@ void ObjectInfoTable::constructScheduleTable ( void ) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList schedules; + TQValueList schedules; schedules = file->scheduleList ( "", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, m_config.fromDate(), m_config.toDate() ); - QValueList::const_iterator it_schedule = schedules.begin(); + TQValueList::const_iterator it_schedule = schedules.begin(); while ( it_schedule != schedules.end() ) { MyMoneySchedule schedule = *it_schedule; @@ -157,7 +157,7 @@ void ObjectInfoTable::constructScheduleTable ( void ) //convert to base currency if needed MyMoneyMoney xr = MyMoneyMoney(1,1); if (m_config.isConvertCurrency() && account.isForeignCurrency()) { - xr = account.baseCurrencyPrice(QDate::currentDate()).reduce(); + xr = account.baseCurrencyPrice(TQDate::tqcurrentDate()).reduce(); } // help for sort and render functions @@ -187,8 +187,8 @@ void ObjectInfoTable::constructScheduleTable ( void ) if ( m_config.detailLevel() == MyMoneyReport::eDetailAll ) { //get the information for all splits - QValueList splits = transaction.splits(); - QValueList::const_iterator split_it = splits.begin(); + TQValueList splits = transaction.splits(); + TQValueList::const_iterator split_it = splits.begin(); for ( ;split_it != splits.end(); split_it++ ) { TableRow splitRow; @@ -235,9 +235,9 @@ void ObjectInfoTable::constructAccountTable ( void ) //make sure we have all subaccounts of investment accounts includeInvestmentSubAccounts(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { TableRow accountRow; @@ -274,7 +274,7 @@ void ObjectInfoTable::constructAccountTable ( void ) //convert to base currency if needed if (m_config.isConvertCurrency() && account.isForeignCurrency()) { - MyMoneyMoney xr = account.baseCurrencyPrice(QDate::currentDate()).reduce(); + MyMoneyMoney xr = account.baseCurrencyPrice(TQDate::tqcurrentDate()).reduce(); value = value * xr; } accountRow["currentbalance"] = value.toString(); @@ -289,9 +289,9 @@ void ObjectInfoTable::constructAccountLoanTable ( void ) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { TableRow accountRow; @@ -306,7 +306,7 @@ void ObjectInfoTable::constructAccountLoanTable ( void ) //convert to base currency if needed MyMoneyMoney xr = MyMoneyMoney(1,1); if (m_config.isConvertCurrency() && account.isForeignCurrency()) { - xr = account.baseCurrencyPrice(QDate::currentDate()).reduce(); + xr = account.baseCurrencyPrice(TQDate::tqcurrentDate()).reduce(); } accountRow["rank"] = "0"; @@ -321,7 +321,7 @@ void ObjectInfoTable::constructAccountLoanTable ( void ) accountRow["currencyname"] = (file->currency(account.currencyId())).name(); accountRow["payee"] = file->payee(loan.payee()).name(); accountRow["loanamount"] = (loan.loanAmount() * xr).toString(); - accountRow["interestrate"] = (loan.interestRate(QDate::currentDate())/MyMoneyMoney(100,1)*xr).toString(); + accountRow["interestrate"] = (loan.interestRate(TQDate::tqcurrentDate())/MyMoneyMoney(100,1)*xr).toString(); accountRow["nextinterestchange"] = loan.nextInterestChange().toString( Qt::ISODate ); accountRow["periodicpayment"] = (loan.periodicPayment() * xr).toString(); accountRow["finalpayment"] = (loan.finalPayment() * xr).toString(); @@ -342,7 +342,7 @@ MyMoneyMoney ObjectInfoTable::investmentBalance(const MyMoneyAccount& acc) MyMoneyMoney value; value = file->balance(acc.id()); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount stock = file->account(*it_a); try { @@ -357,7 +357,7 @@ MyMoneyMoney ObjectInfoTable::investmentBalance(const MyMoneyAccount& acc) val = val.convert(acc.fraction()); value += val; } catch(MyMoneyException* e) { - qWarning("%s", (QString("cannot convert stock balance of %1 to base currency: %2").arg(stock.name(), e->what())).data()); + qWarning("%s", (TQString("cannot convert stock balance of %1 to base currency: %2").tqarg(stock.name(), e->what())).data()); delete e; } } diff --git a/kmymoney2/reports/objectinfotable.h b/kmymoney2/reports/objectinfotable.h index 0b4ab71..69489df 100644 --- a/kmymoney2/reports/objectinfotable.h +++ b/kmymoney2/reports/objectinfotable.h @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -72,4 +72,4 @@ private: } -#endif // QUERYREPORT_H +#endif // TQUERYREPORT_H diff --git a/kmymoney2/reports/pivotgrid.cpp b/kmymoney2/reports/pivotgrid.cpp index 9cdf9b3..6a3f773 100644 --- a/kmymoney2/reports/pivotgrid.cpp +++ b/kmymoney2/reports/pivotgrid.cpp @@ -18,16 +18,16 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -93,12 +93,12 @@ PivotCell PivotCell::stockSplit(const MyMoneyMoney& factor) return s; } -const QString PivotCell::formatMoney(int fraction, bool showThousandSeparator) const +const TQString PivotCell::formatMoney(int fraction, bool showThousandSeparator) const { return formatMoney("", MyMoneyMoney::denomToPrec(fraction), showThousandSeparator); } -const QString PivotCell::formatMoney(const QString& currency, const int prec, bool showThousandSeparator) const +const TQString PivotCell::formatMoney(const TQString& currency, const int prec, bool showThousandSeparator) const { // construct the result MyMoneyMoney res = (*this * m_stockSplit) + m_postSplit; @@ -132,7 +132,7 @@ PivotGridRowSet::PivotGridRowSet( unsigned _numcolumns ) insert(ePrice, PivotGridRow(_numcolumns)); } -PivotGridRowSet PivotGrid::rowSet(QString id) +PivotGridRowSet PivotGrid::rowSet(TQString id) { //go through the data and get the row that matches the id diff --git a/kmymoney2/reports/pivotgrid.h b/kmymoney2/reports/pivotgrid.h index ca7f5ab..c067c27 100644 --- a/kmymoney2/reports/pivotgrid.h +++ b/kmymoney2/reports/pivotgrid.h @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,7 +45,7 @@ namespace reports { * * A 'Row Pair' is two rows of money values. Each column is the SAME month. One row is the * 'actual' values for the period, the other row is the 'budgetted' values for the same - * period. For ease of implementation, a Row Pair is implemented as a Row which contains + * period. For ease of implementation, a Row Pair is implemented as a Row which tqcontains * another Row. The inherited Row is the 'actual', the contained row is the 'Budget'. * * An 'Inner Group' contains a rows for each subordinate account within a single top-level @@ -69,8 +69,8 @@ namespace reports { static PivotCell stockSplit(const MyMoneyMoney& factor); PivotCell operator += (const PivotCell& right); PivotCell operator += (const MyMoneyMoney& value); - const QString formatMoney(int fraction, bool showThousandSeparator = true) const; - const QString formatMoney(const QString& currency, const int prec, bool showThousandSeparator = true) const; + const TQString formatMoney(int fraction, bool showThousandSeparator = true) const; + const TQString formatMoney(const TQString& currency, const int prec, bool showThousandSeparator = true) const; MyMoneyMoney calculateRunningSum(const MyMoneyMoney& runningSum); MyMoneyMoney cellBalance(const MyMoneyMoney& _balance); bool isUsed(void) const { return m_cellUsed; } @@ -79,7 +79,7 @@ namespace reports { MyMoneyMoney m_postSplit; bool m_cellUsed; }; - class PivotGridRow: public QValueList + class PivotGridRow: public TQValueList { public: @@ -91,13 +91,13 @@ namespace reports { MyMoneyMoney m_total; }; - class PivotGridRowSet: public QMap + class PivotGridRowSet: public TQMap { public: PivotGridRowSet( unsigned _numcolumns = 0 ); }; - class PivotInnerGroup: public QMap + class PivotInnerGroup: public TQMap { public: PivotInnerGroup( unsigned _numcolumns = 0 ): m_total(_numcolumns) {} @@ -105,7 +105,7 @@ namespace reports { PivotGridRowSet m_total; }; - class PivotOuterGroup: public QMap + class PivotOuterGroup: public TQMap { public: PivotOuterGroup( unsigned _numcolumns = 0, unsigned _sort=m_kDefaultSortOrder, bool _inverted=false): m_total(_numcolumns), m_inverted(_inverted), m_sortOrder(_sort) {} @@ -127,7 +127,7 @@ namespace reports { // The localized name of the group for display in the report. Outergoups need this // independently, because they will lose their association with the TGrid when the // report is rendered. - QString m_displayName; + TQString m_displayName; // lower numbers sort toward the top of the report. defaults to 100, which is a nice // middle-of-the-road value @@ -136,10 +136,10 @@ namespace reports { // default sort order static const unsigned m_kDefaultSortOrder; }; - class PivotGrid: public QMap + class PivotGrid: public TQMap { public: - PivotGridRowSet rowSet (QString id); + PivotGridRowSet rowSet (TQString id); PivotGridRowSet m_total; }; diff --git a/kmymoney2/reports/pivotgridtest.cpp b/kmymoney2/reports/pivotgridtest.cpp index 397491d..431ef0f 100644 --- a/kmymoney2/reports/pivotgridtest.cpp +++ b/kmymoney2/reports/pivotgridtest.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ /* -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -62,7 +62,7 @@ void PivotGridTest::setUp () MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -75,16 +75,16 @@ void PivotGridTest::setUp () acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); diff --git a/kmymoney2/reports/pivottable.cpp b/kmymoney2/reports/pivottable.cpp index c12ca57..2f51a9c 100644 --- a/kmymoney2/reports/pivottable.cpp +++ b/kmymoney2/reports/pivottable.cpp @@ -19,16 +19,16 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -61,11 +61,11 @@ namespace reports { -QString Debug::m_sTabs; +TQString Debug::m_sTabs; bool Debug::m_sEnabled = DEBUG_ENABLED_BY_DEFAULT; -QString Debug::m_sEnableKey; +TQString Debug::m_sEnableKey; -Debug::Debug( const QString& _name ): m_methodName( _name ), m_enabled( m_sEnabled ) +Debug::Debug( const TQString& _name ): m_methodName( _name ), m_enabled( m_sEnabled ) { if (!m_enabled && _name == m_sEnableKey) m_enabled = true; @@ -89,7 +89,7 @@ Debug::~Debug() } } -void Debug::output( const QString& _text ) +void Debug::output( const TQString& _text ) { if ( m_enabled ) qDebug( "%s%s(): %s", m_sTabs.latin1(), m_methodName.latin1(), _text.latin1() ); @@ -131,8 +131,8 @@ void PivotTable::init(void) { // strip out the 'days' component of the begin and end dates. // we're only using these variables to contain year and month. - m_beginDate = QDate( m_beginDate.year(), m_beginDate.month(), 1 ); - m_endDate = QDate( m_endDate.year(), m_endDate.month(), 1 ); + m_beginDate = TQDate( m_beginDate.year(), m_beginDate.month(), 1 ); + m_endDate = TQDate( m_endDate.year(), m_endDate.month(), 1 ); } m_numColumns = columnValue(m_endDate) - columnValue(m_beginDate) + 2; @@ -184,7 +184,7 @@ void PivotTable::init(void) // Populate all transactions into the row/column pivot grid // - QValueList transactions; + TQValueList transactions; m_config_f.setReportAllSplits(false); m_config_f.setConsiderCategory(true); try { @@ -193,7 +193,7 @@ void PivotTable::init(void) qDebug("ERR: %s thrown in %s(%ld)", e->what().data(), e->file().data(), e->line()); throw e; } - DEBUG_OUTPUT(QString("Found %1 matching transactions").arg(transactions.count())); + DEBUG_OUTPUT(TQString("Found %1 matching transactions").tqarg(transactions.count())); // Include scheduled transactions if required @@ -202,14 +202,14 @@ void PivotTable::init(void) // Create a custom version of the report filter, excluding date // We'll use this to compare the transaction against MyMoneyTransactionFilter schedulefilter(m_config_f); - schedulefilter.setDateFilter(QDate(),QDate()); + schedulefilter.setDateFilter(TQDate(),TQDate()); // Get the real dates from the config filter - QDate configbegin, configend; + TQDate configbegin, configend; m_config_f.validDateRange(configbegin, configend); - QValueList schedules = file->scheduleList(); - QValueList::const_iterator it_schedule = schedules.begin(); + TQValueList schedules = file->scheduleList(); + TQValueList::const_iterator it_schedule = schedules.begin(); while ( it_schedule != schedules.end() ) { // If the transaction meets the filter @@ -221,17 +221,17 @@ void PivotTable::init(void) tx.setValue("kmm-schedule-id", (*it_schedule).id()); // Get the dates when a payment will be made within the report window - QDate nextpayment = (*it_schedule).adjustedNextPayment(configbegin); + TQDate nextpayment = (*it_schedule).adjustedNextPayment(configbegin); if ( nextpayment.isValid() ) { // Add one transaction for each date - QValueList paymentDates = (*it_schedule).paymentDates(nextpayment,configend); - QValueList::const_iterator it_date = paymentDates.begin(); + TQValueList paymentDates = (*it_schedule).paymentDates(nextpayment,configend); + TQValueList::const_iterator it_date = paymentDates.begin(); while ( it_date != paymentDates.end() ) { //if the payment occurs in the past, enter it tomorrow - if(QDate::currentDate() >= *it_date) { - tx.setPostDate(QDate::currentDate().addDays(1)); + if(TQDate::tqcurrentDate() >= *it_date) { + tx.setPostDate(TQDate::tqcurrentDate().addDays(1)); } else { tx.setPostDate(*it_date); } @@ -240,7 +240,7 @@ void PivotTable::init(void) transactions += tx; } - DEBUG_OUTPUT(QString("Added transaction for schedule %1 on %2").arg((*it_schedule).id()).arg((*it_date).toString())); + DEBUG_OUTPUT(TQString("Added transaction for schedule %1 on %2").tqarg((*it_schedule).id()).tqarg((*it_date).toString())); ++it_date; } @@ -256,13 +256,13 @@ void PivotTable::init(void) bool al_transfers = ( m_config_f.rowType() == MyMoneyReport::eExpenseIncome ) && ( m_config_f.isIncludingTransfers() ); //this is to store balance for loan accounts when not included in the report - QMap loanBalances; + TQMap loanBalances; - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList::const_iterator it_transaction = transactions.begin(); unsigned colofs = columnValue(m_beginDate) - 1; while ( it_transaction != transactions.end() ) { - QDate postdate = (*it_transaction).postDate(); + TQDate postdate = (*it_transaction).postDate(); unsigned column = columnValue(postdate) - colofs; MyMoneyTransaction tx = (*it_transaction); @@ -275,19 +275,19 @@ void PivotTable::init(void) if(!split.id().isEmpty()) { ReportAccount splitAccount = file->account(split.accountId()); MyMoneyAccount::accountTypeE type = splitAccount.accountGroup(); - QString outergroup = KMyMoneyUtils::accountTypeToString(type); + TQString outergroup = KMyMoneyUtils::accountTypeToString(type); //if the account is included in the report, calculate the balance from the cells if(m_config_f.includes( splitAccount )) { loanBalances[splitAccount.id()] = cellBalance(outergroup, splitAccount, column, false); } else { //if it is not in the report and also not in loanBalances, get the balance from the file - if(!loanBalances.contains(splitAccount.id())) { - QDate dueDate = sched.nextDueDate(); + if(!loanBalances.tqcontains(splitAccount.id())) { + TQDate dueDate = sched.nextDueDate(); //if the payment is overdue, use current date - if(dueDate < QDate::currentDate()) - dueDate = QDate::currentDate(); + if(dueDate < TQDate::tqcurrentDate()) + dueDate = TQDate::tqcurrentDate(); //get the balance from the file for the date loanBalances[splitAccount.id()] = file->balance(splitAccount.id(), dueDate.addDays(-1)); @@ -298,7 +298,7 @@ void PivotTable::init(void) //if the loan split is not included in the report, update the balance for the next occurrence if(!m_config_f.includes( splitAccount )) { - QValueList::ConstIterator it_loanSplits; + TQValueList::ConstIterator it_loanSplits; for(it_loanSplits = tx.splits().begin(); it_loanSplits != tx.splits().end(); ++it_loanSplits) { if((*it_loanSplits).isAmortizationSplit() && (*it_loanSplits).accountId() == splitAccount.id() ) loanBalances[splitAccount.id()] = loanBalances[splitAccount.id()] + (*it_loanSplits).shares(); @@ -307,8 +307,8 @@ void PivotTable::init(void) } } - QValueList splits = tx.splits(); - QValueList::const_iterator it_split = splits.begin(); + TQValueList splits = tx.splits(); + TQValueList::const_iterator it_split = splits.begin(); while ( it_split != splits.end() ) { ReportAccount splitAccount = (*it_split).accountId(); @@ -323,7 +323,7 @@ void PivotTable::init(void) MyMoneyMoney value; // the outer group is the account class (major account type) MyMoneyAccount::accountTypeE type = splitAccount.accountGroup(); - QString outergroup = KMyMoneyUtils::accountTypeToString(type); + TQString outergroup = KMyMoneyUtils::accountTypeToString(type); value = (*it_split).shares(); bool stockSplit = tx.isStockSplit(); @@ -468,7 +468,7 @@ void PivotTable::collapseColumns(void) void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("From Column %1 to %2").arg(sourcecolumn).arg(destcolumn)); + DEBUG_OUTPUT(TQString("From Column %1 to %2").tqarg(sourcecolumn).tqarg(destcolumn)); // iterate over outer groups PivotGrid::iterator it_outergroup = m_grid.begin(); @@ -483,9 +483,9 @@ void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn) while ( it_row != (*it_innergroup).end() ) { if ( (*it_row)[eActual].count() <= sourcecolumn ) - throw new MYMONEYEXCEPTION(QString("Sourcecolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").arg(sourcecolumn).arg((*it_row)[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Sourcecolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").tqarg(sourcecolumn).tqarg((*it_row)[eActual].count())); if ( (*it_row)[eActual].count() <= destcolumn ) - throw new MYMONEYEXCEPTION(QString("Destcolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").arg(sourcecolumn).arg((*it_row)[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Destcolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").tqarg(sourcecolumn).tqarg((*it_row)[eActual].count())); (*it_row)[eActual][destcolumn] += (*it_row)[eActual][sourcecolumn]; ++it_row; @@ -500,7 +500,7 @@ void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn) void PivotTable::clearColumn(unsigned column) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("Column %1").arg(column)); + DEBUG_OUTPUT(TQString("Column %1").tqarg(column)); // iterate over outer groups PivotGrid::iterator it_outergroup = m_grid.begin(); @@ -515,7 +515,7 @@ void PivotTable::clearColumn(unsigned column) while ( it_row != (*it_innergroup).end() ) { if ( (*it_row)[eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::accumulateColumn").arg(column).arg((*it_row)[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::accumulateColumn").tqarg(column).tqarg((*it_row)[eActual].count())); (*it_row++)[eActual][column] = PivotCell(); } @@ -540,19 +540,19 @@ void PivotTable::calculateColumnHeadings(void) { if ( columnpitch == 1 ) { - QDate columnDate = m_beginDate; + TQDate columnDate = m_beginDate; unsigned column = 1; while ( column++ < m_numColumns ) { - QString heading = KGlobal::locale()->calendar()->monthName(columnDate.month(), columnDate.year(), true) + " " + QString::number(columnDate.day()); + TQString heading = KGlobal::locale()->calendar()->monthName(columnDate.month(), columnDate.year(), true) + " " + TQString::number(columnDate.day()); columnDate = columnDate.addDays(1); m_columnHeadings.append( heading); } } else { - QDate day = m_beginDate; - QDate prv = m_beginDate; + TQDate day = m_beginDate; + TQDate prv = m_beginDate; // use the user's locale to determine the week's start unsigned dow = (day.dayOfWeek() +8 -KGlobal::locale()->weekStartDay())%7; @@ -561,11 +561,11 @@ void PivotTable::calculateColumnHeadings(void) { if (((dow % columnpitch) == 0) || (day == m_endDate)) { - m_columnHeadings.append(QString("%1 %2 - %3 %4") - .arg(KGlobal::locale()->calendar()->monthName(prv.month(), prv.year(), true)) - .arg(prv.day()) - .arg(KGlobal::locale()->calendar()->monthName(day.month(), day.year(), true)) - .arg(day.day())); + m_columnHeadings.append(TQString("%1 %2 - %3 %4") + .tqarg(KGlobal::locale()->calendar()->monthName(prv.month(), prv.year(), true)) + .tqarg(prv.day()) + .tqarg(KGlobal::locale()->calendar()->monthName(day.month(), day.year(), true)) + .tqarg(day.day())); prv = day.addDays(1); } day = day.addDays(1); @@ -582,7 +582,7 @@ void PivotTable::calculateColumnHeadings(void) unsigned year = m_beginDate.year(); unsigned column = 1; while ( column++ < m_numColumns ) - m_columnHeadings.append(QString::number(year++)); + m_columnHeadings.append(TQString::number(year++)); } else { @@ -592,11 +592,11 @@ void PivotTable::calculateColumnHeadings(void) unsigned column = 1; while ( column++ < m_numColumns ) { - QString heading = KGlobal::locale()->calendar()->monthName(1+segment*columnpitch, 2000, true); + TQString heading = KGlobal::locale()->calendar()->monthName(1+segment*columnpitch, 2000, true); if ( columnpitch != 1 ) heading += "-" + KGlobal::locale()->calendar()->monthName((1+segment)*columnpitch, 2000, true); if ( includeyear ) - heading += " " + QString::number(year); + heading += " " + TQString::number(year); m_columnHeadings.append( heading); if ( ++segment >= 12/columnpitch ) { @@ -613,10 +613,10 @@ void PivotTable::createAccountRows(void) DEBUG_ENTER(__PRETTY_FUNCTION__); MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { @@ -626,10 +626,10 @@ void PivotTable::createAccountRows(void) // and if the report includes this account if ( m_config_f.includes( *it_account ) ) { - DEBUG_OUTPUT(QString("Includes account %1").arg(account.name())); + DEBUG_OUTPUT(TQString("Includes account %1").tqarg(account.name())); // the row group is the account class (major account type) - QString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup()); + TQString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup()); // place into the 'opening' column... assignCell( outergroup, account, 0, MyMoneyMoney() ); } @@ -644,8 +644,8 @@ void PivotTable::calculateOpeningBalances( void ) // First, determine the inclusive dates of the report. Normally, that's just // the begin & end dates of m_config_f. However, if either of those dates are // blank, we need to use m_beginDate and/or m_endDate instead. - QDate from = m_config_f.fromDate(); - QDate to = m_config_f.toDate(); + TQDate from = m_config_f.fromDate(); + TQDate to = m_config_f.toDate(); if ( ! from.isValid() ) from = m_beginDate; if ( ! to.isValid() ) @@ -653,10 +653,10 @@ void PivotTable::calculateOpeningBalances( void ) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { @@ -674,18 +674,18 @@ void PivotTable::calculateOpeningBalances( void ) filter.addAccount(account.id()); filter.setDateFilter(m_beginDate, m_endDate); filter.setReportAllSplits(false); - QValueList transactions = file->transactionList(filter); + TQValueList transactions = file->transactionList(filter); //if a closed account has no transactions in that timeframe, do not include it if(transactions.size() == 0 ) { - DEBUG_OUTPUT(QString("DOES NOT INCLUDE account %1").arg(account.name())); + DEBUG_OUTPUT(TQString("DOES NOT INCLUDE account %1").tqarg(account.name())); ++it_account; continue; } } - DEBUG_OUTPUT(QString("Includes account %1").arg(account.name())); + DEBUG_OUTPUT(TQString("Includes account %1").tqarg(account.name())); // the row group is the account class (major account type) - QString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup()); + TQString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup()); // extract the balance of the account for the given begin date, which is // the opening balance plus the sum of all transactions prior to the begin @@ -699,7 +699,7 @@ void PivotTable::calculateOpeningBalances( void ) } else { - DEBUG_OUTPUT(QString("DOES NOT INCLUDE account %1").arg(account.name())); + DEBUG_OUTPUT(TQString("DOES NOT INCLUDE account %1").tqarg(account.name())); } ++it_account; @@ -713,7 +713,7 @@ void PivotTable::calculateRunningSums( PivotInnerGroup::iterator& it_row) while ( column < m_numColumns ) { if ( it_row.data()[eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").arg(column).arg(it_row.data()[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").tqarg(column).tqarg(it_row.data()[eActual].count())); runningsum = it_row.data()[eActual][column].calculateRunningSum(runningsum); @@ -742,7 +742,7 @@ void PivotTable::calculateRunningSums( void ) while ( column < m_numColumns ) { if ( it_row.data()[eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").arg(column).arg(it_row.data()[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").tqarg(column).tqarg(it_row.data()[eActual].count())); runningsum = ( it_row.data()[eActual][column] += runningsum ); @@ -758,11 +758,11 @@ void PivotTable::calculateRunningSums( void ) } } -MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAccount& _row, unsigned _column, bool budget) +MyMoneyMoney PivotTable::cellBalance(const TQString& outergroup, const ReportAccount& _row, unsigned _column, bool budget) { if(m_runningSumsCalculated) { qDebug("You must not call PivotTable::cellBalance() after calling PivotTable::calculateRunningSums()"); - throw new MYMONEYEXCEPTION(QString("You must not call PivotTable::cellBalance() after calling PivotTable::calculateRunningSums()")); + throw new MYMONEYEXCEPTION(TQString("You must not call PivotTable::cellBalance() after calling PivotTable::calculateRunningSums()")); } // for budget reports, if this is the actual value, map it to the account which @@ -770,7 +770,7 @@ MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAcco ReportAccount row = _row; if ( !budget && m_config_f.hasBudget() ) { - QString newrow = m_budgetMap[row.id()]; + TQString newrow = m_budgetMap[row.id()]; // if there was no mapping found, then the budget report is not interested // in this account. @@ -780,16 +780,16 @@ MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAcco row = newrow; } - // ensure the row already exists (and its parental hierarchy) + // ensure the row already exists (and its tqparental hierarchy) createRow( outergroup, row, true ); - // Determine the inner group from the top-most parent account - QString innergroup( row.topParentName() ); + // Determine the inner group from the top-most tqparent account + TQString innergroup( row.topParentName() ); if ( m_numColumns <= _column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of m_numColumns range (%2) in PivotTable::cellBalance").arg(_column).arg(m_numColumns)); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of m_numColumns range (%2) in PivotTable::cellBalance").tqarg(_column).tqarg(m_numColumns)); if ( m_grid[outergroup][innergroup][row][eActual].count() <= _column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::cellBalance").arg(_column).arg(m_grid[outergroup][innergroup][row][eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::cellBalance").tqarg(_column).tqarg(m_grid[outergroup][innergroup][row][eActual].count())); MyMoneyMoney balance; if ( budget ) @@ -801,7 +801,7 @@ MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAcco while ( column < _column) { if ( m_grid[outergroup][innergroup][row][eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::cellBalance").arg(column).arg(m_grid[outergroup][innergroup][row][eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::cellBalance").tqarg(column).tqarg(m_grid[outergroup][innergroup][row][eActual].count())); balance = m_grid[outergroup][innergroup][row][eActual][column].cellBalance(balance); @@ -827,11 +827,11 @@ void PivotTable::calculateBudgetMapping( void ) MyMoneyBudget budget = MyMoneyBudget(); //if no budget has been selected if (m_config_f.budget() == "Any" ) { - QValueList budgets = file->budgetList(); - QValueList::const_iterator budgets_it = budgets.begin(); + TQValueList budgets = file->budgetList(); + TQValueList::const_iterator budgets_it = budgets.begin(); while( budgets_it != budgets.end() ) { //pick the first budget that matches the report start year - if( (*budgets_it).budgetStart().year() == QDate::currentDate().year() ) { + if( (*budgets_it).budgetStart().year() == TQDate::tqcurrentDate().year() ) { budget = file->budget( (*budgets_it).id()); break; } @@ -852,24 +852,24 @@ void PivotTable::calculateBudgetMapping( void ) //kdDebug(2) << "Budget " << budget.name() << ": " << endl; // Go through all accounts in the system to build the mapping - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { //include only the accounts selected for the report if ( m_config_f.includes ( *it_account ) ) { - QString id = ( *it_account ).id(); - QString acid = id; + TQString id = ( *it_account ).id(); + TQString acid = id; // If the budget contains this account outright - if ( budget.contains ( id ) ) + if ( budget.tqcontains ( id ) ) { // Add it to the mapping m_budgetMap[acid] = id; // kdDebug(2) << ReportAccount(acid).debugName() << " self-maps / type =" << budget.account(id).budgetLevel() << endl; } - // Otherwise, search for a parent account which includes sub-accounts + // Otherwise, search for a tqparent account which includes sub-accounts else { //if includeBudgetActuals, include all accounts regardless of whether in budget or not @@ -879,8 +879,8 @@ void PivotTable::calculateBudgetMapping( void ) } do { - id = file->account ( id ).parentAccountId(); - if ( budget.contains ( id ) ) + id = file->account ( id ).tqparentAccountId(); + if ( budget.tqcontains ( id ) ) { if ( budget.account ( id ).budgetSubaccounts() ) { @@ -897,8 +897,8 @@ void PivotTable::calculateBudgetMapping( void ) } // end while looping through the accounts in the file // Place the budget values into the budget grid - QValueList baccounts = budget.getaccounts(); - QValueList::const_iterator it_bacc = baccounts.begin(); + TQValueList baccounts = budget.getaccounts(); + TQValueList::const_iterator it_bacc = baccounts.begin(); while ( it_bacc != baccounts.end() ) { ReportAccount splitAccount = (*it_bacc).id(); @@ -906,12 +906,12 @@ void PivotTable::calculateBudgetMapping( void ) //include the budget account only if it is included in the report if ( m_config_f.includes ( splitAccount ) ) { MyMoneyAccount::accountTypeE type = splitAccount.accountGroup(); - QString outergroup = KMyMoneyUtils::accountTypeToString(type); + TQString outergroup = KMyMoneyUtils::accountTypeToString(type); // reverse sign to match common notation for cash flow direction, only for expense/income splits MyMoneyMoney reverse((splitAccount.accountType() == MyMoneyAccount::Expense) ? -1 : 1, 1); - const QMap& periods = (*it_bacc).getPeriods(); + const TQMap& periods = (*it_bacc).getPeriods(); MyMoneyMoney value = (*periods.begin()).amount() * reverse; MyMoneyMoney price = MyMoneyMoney(1,1); unsigned column = 1; @@ -933,7 +933,7 @@ void PivotTable::calculateBudgetMapping( void ) || m_config_f.columnType() == MyMoneyReport::eQuarters) { //value = value * MyMoneyMoney(m_config_f.columnType(), 1); - QDate budgetDate = budget.budgetStart(); + TQDate budgetDate = budget.budgetStart(); while ( column < m_numColumns && budget.budgetStart().addYears(1) > budgetDate ) { //only show budget values if the budget year and the column date match //no currency conversion is done here because that is done for all columns later @@ -954,7 +954,7 @@ void PivotTable::calculateBudgetMapping( void ) // place each value in the appropriate column // budget periods are supposed to come in order just like columns { - QMap::const_iterator it_period = periods.begin(); + TQMap::const_iterator it_period = periods.begin(); while ( it_period != periods.end() && column < m_numColumns) { if((*it_period).startDate() > columnDate(column) ) { @@ -1009,9 +1009,9 @@ void PivotTable::convertToBaseCurrency( void ) while ( column < m_numColumns ) { if ( it_row.data()[eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::convertToBaseCurrency").arg(column).arg(it_row.data()[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::convertToBaseCurrency").tqarg(column).tqarg(it_row.data()[eActual].count())); - QDate valuedate = columnDate(column); + TQDate valuedate = columnDate(column); //get base price for that date MyMoneyMoney conversionfactor = it_row.key().baseCurrencyPrice(valuedate); @@ -1025,7 +1025,7 @@ void PivotTable::convertToBaseCurrency( void ) //convert to lowest fraction it_row.data()[ m_rowTypeList[i] ][column] = PivotCell(value.convert(fraction)); - DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,QString("Factor of %1, value was %2, now %3").arg(conversionfactor).arg(DEBUG_SENSITIVE(oldval)).arg(DEBUG_SENSITIVE(it_row.data()[m_rowTypeList[i]][column].toDouble()))); + DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,TQString("Factor of %1, value was %2, now %3").tqarg(conversionfactor).tqarg(DEBUG_SENSITIVE(oldval)).tqarg(DEBUG_SENSITIVE(it_row.data()[m_rowTypeList[i]][column].toDouble()))); } } @@ -1058,9 +1058,9 @@ void PivotTable::convertToDeepCurrency( void ) while ( column < m_numColumns ) { if ( it_row.data()[eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::convertToDeepCurrency").arg(column).arg(it_row.data()[eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::convertToDeepCurrency").tqarg(column).tqarg(it_row.data()[eActual].count())); - QDate valuedate = columnDate(column); + TQDate valuedate = columnDate(column); //get conversion factor for the account and date MyMoneyMoney conversionfactor = it_row.key().deepCurrencyPrice(valuedate); @@ -1085,7 +1085,7 @@ void PivotTable::convertToDeepCurrency( void ) it_row.data()[ePrice][column] = PivotCell(priceValue.convert(10000)); } - DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,QString("Factor of %1, value was %2, now %3").arg(conversionfactor).arg(DEBUG_SENSITIVE(oldval)).arg(DEBUG_SENSITIVE(it_row.data()[eActual][column].toDouble()))); + DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,TQString("Factor of %1, value was %2, now %3").tqarg(conversionfactor).tqarg(DEBUG_SENSITIVE(oldval)).tqarg(DEBUG_SENSITIVE(it_row.data()[eActual][column].toDouble()))); ++column; } @@ -1139,9 +1139,9 @@ void PivotTable::calculateTotals( void ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { if ( it_row.data()[ m_rowTypeList[i] ].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, row columns").arg(column).arg(it_row.data()[ m_rowTypeList[i] ].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, row columns").tqarg(column).tqarg(it_row.data()[ m_rowTypeList[i] ].count())); if ( (*it_innergroup).m_total[ m_rowTypeList[i] ].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); //calculate total MyMoneyMoney value = it_row.data()[ m_rowTypeList[i] ][column]; @@ -1162,9 +1162,9 @@ void PivotTable::calculateTotals( void ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { if ( (*it_innergroup).m_total[ m_rowTypeList[i] ].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); if ( (*it_outergroup).m_total[ m_rowTypeList[i] ].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, outer group totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, outer group totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); //calculate totals MyMoneyMoney value = (*it_innergroup).m_total[ m_rowTypeList[i] ][column]; @@ -1187,7 +1187,7 @@ void PivotTable::calculateTotals( void ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { if ( m_grid.m_total[ m_rowTypeList[i] ].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count())); //calculate actual totals MyMoneyMoney value = (*it_outergroup).m_total[ m_rowTypeList[i] ][column]; @@ -1215,7 +1215,7 @@ void PivotTable::calculateTotals( void ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { if ( m_grid.m_total[ m_rowTypeList[i] ].count() <= totalcolumn ) - throw new MYMONEYEXCEPTION(QString("Total column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").arg(totalcolumn).arg(m_grid.m_total[ m_rowTypeList[i] ].count())); + throw new MYMONEYEXCEPTION(TQString("Total column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").tqarg(totalcolumn).tqarg(m_grid.m_total[ m_rowTypeList[i] ].count())); //calculate actual totals MyMoneyMoney value = m_grid.m_total[ m_rowTypeList[i] ][totalcolumn]; @@ -1225,17 +1225,17 @@ void PivotTable::calculateTotals( void ) } } -void PivotTable::assignCell( const QString& outergroup, const ReportAccount& _row, unsigned column, MyMoneyMoney value, bool budget, bool stockSplit ) +void PivotTable::assignCell( const TQString& outergroup, const ReportAccount& _row, unsigned column, MyMoneyMoney value, bool budget, bool stockSplit ) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("Parameters: %1,%2,%3,%4,%5").arg(outergroup).arg(_row.debugName()).arg(column).arg(DEBUG_SENSITIVE(value.toDouble())).arg(budget)); + DEBUG_OUTPUT(TQString("Parameters: %1,%2,%3,%4,%5").tqarg(outergroup).tqarg(_row.debugName()).tqarg(column).tqarg(DEBUG_SENSITIVE(value.toDouble())).tqarg(budget)); // for budget reports, if this is the actual value, map it to the account which // holds its budget ReportAccount row = _row; if ( !budget && m_config_f.hasBudget() ) { - QString newrow = m_budgetMap[row.id()]; + TQString newrow = m_budgetMap[row.id()]; // if there was no mapping found, then the budget report is not interested // in this account. @@ -1245,16 +1245,16 @@ void PivotTable::assignCell( const QString& outergroup, const ReportAccount& _ro row = newrow; } - // ensure the row already exists (and its parental hierarchy) + // ensure the row already exists (and its tqparental hierarchy) createRow( outergroup, row, true ); - // Determine the inner group from the top-most parent account - QString innergroup( row.topParentName() ); + // Determine the inner group from the top-most tqparent account + TQString innergroup( row.topParentName() ); if ( m_numColumns <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of m_numColumns range (%2) in PivotTable::assignCell").arg(column).arg(m_numColumns)); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of m_numColumns range (%2) in PivotTable::assignCell").tqarg(column).tqarg(m_numColumns)); if ( m_grid[outergroup][innergroup][row][eActual].count() <= column ) - throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::assignCell").arg(column).arg(m_grid[outergroup][innergroup][row][eActual].count())); + throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::assignCell").tqarg(column).tqarg(m_grid[outergroup][innergroup][row][eActual].count())); if(!stockSplit) { // Determine whether the value should be inverted before being placed in the row @@ -1272,44 +1272,44 @@ void PivotTable::assignCell( const QString& outergroup, const ReportAccount& _ro } -void PivotTable::createRow( const QString& outergroup, const ReportAccount& row, bool recursive ) +void PivotTable::createRow( const TQString& outergroup, const ReportAccount& row, bool recursive ) { DEBUG_ENTER(__PRETTY_FUNCTION__); - // Determine the inner group from the top-most parent account - QString innergroup( row.topParentName() ); + // Determine the inner group from the top-most tqparent account + TQString innergroup( row.topParentName() ); - if ( ! m_grid.contains(outergroup) ) + if ( ! m_grid.tqcontains(outergroup) ) { - DEBUG_OUTPUT(QString("Adding group [%1]").arg(outergroup)); + DEBUG_OUTPUT(TQString("Adding group [%1]").tqarg(outergroup)); m_grid[outergroup] = PivotOuterGroup(m_numColumns); } - if ( ! m_grid[outergroup].contains(innergroup) ) + if ( ! m_grid[outergroup].tqcontains(innergroup) ) { - DEBUG_OUTPUT(QString("Adding group [%1][%2]").arg(outergroup).arg(innergroup)); + DEBUG_OUTPUT(TQString("Adding group [%1][%2]").tqarg(outergroup).tqarg(innergroup)); m_grid[outergroup][innergroup] = PivotInnerGroup(m_numColumns); } - if ( ! m_grid[outergroup][innergroup].contains(row) ) + if ( ! m_grid[outergroup][innergroup].tqcontains(row) ) { - DEBUG_OUTPUT(QString("Adding row [%1][%2][%3]").arg(outergroup).arg(innergroup).arg(row.debugName())); + DEBUG_OUTPUT(TQString("Adding row [%1][%2][%3]").tqarg(outergroup).tqarg(innergroup).tqarg(row.debugName())); m_grid[outergroup][innergroup][row] = PivotGridRowSet(m_numColumns); if ( recursive && !row.isTopLevel() ) - createRow( outergroup, row.parent(), recursive ); + createRow( outergroup, row.tqparent(), recursive ); } } -unsigned PivotTable::columnValue(const QDate& _date) const +unsigned PivotTable::columnValue(const TQDate& _date) const { if (m_config_f.isColumnsAreDays()) - return (QDate().daysTo(_date)); + return (TQDate().daysTo(_date)); else return (_date.year() * 12 + _date.month()); } -QDate PivotTable::columnDate(int column) const +TQDate PivotTable::columnDate(int column) const { if (m_config_f.isColumnsAreDays()) return m_beginDate.addDays( m_config_f.columnPitch() * column - 1 ); @@ -1317,7 +1317,7 @@ QDate PivotTable::columnDate(int column) const return m_beginDate.addMonths( m_config_f.columnPitch() * column ).addDays(-1); } -QString PivotTable::renderCSV( void ) const +TQString PivotTable::renderCSV( void ) const { DEBUG_ENTER(__PRETTY_FUNCTION__); @@ -1325,11 +1325,11 @@ QString PivotTable::renderCSV( void ) const // Report Title // - QString result = QString("\"Report: %1\"\n").arg(m_config_f.name()); + TQString result = TQString("\"Report: %1\"\n").tqarg(m_config_f.name()); if ( m_config_f.isConvertCurrency() ) - result += i18n("All currencies converted to %1\n").arg(MyMoneyFile::instance()->baseCurrency().name()); + result += i18n("All currencies converted to %1\n").tqarg(MyMoneyFile::instance()->baseCurrency().name()); else - result += i18n("All values shown in %1 unless otherwise noted\n").arg(MyMoneyFile::instance()->baseCurrency().name()); + result += i18n("All values shown in %1 unless otherwise noted\n").tqarg(MyMoneyFile::instance()->baseCurrency().name()); // // Table Header @@ -1339,10 +1339,10 @@ QString PivotTable::renderCSV( void ) const unsigned column = 1; while ( column < m_numColumns ) - result += QString(",%1").arg(QString(m_columnHeadings[column++])); + result += TQString(",%1").tqarg(TQString(m_columnHeadings[column++])); if ( m_config_f.isShowingRowTotals() ) - result += QString(",%1").arg(i18n("Total")); + result += TQString(",%1").tqarg(i18n("Total")); result += "\n"; @@ -1374,7 +1374,7 @@ QString PivotTable::renderCSV( void ) const // Rows // - QString innergroupdata; + TQString innergroupdata; PivotInnerGroup::const_iterator it_row = (*it_innergroup).begin(); while ( it_row != (*it_innergroup).end() ) { @@ -1385,7 +1385,7 @@ QString PivotTable::renderCSV( void ) const // Columns // - QString rowdata; + TQString rowdata; unsigned column = 1; bool isUsed = false; @@ -1396,14 +1396,14 @@ QString PivotTable::renderCSV( void ) const //show columns for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { isUsed |= it_row.data()[ m_rowTypeList[i] ][column].isUsed(); - rowdata += QString(",\"%1\"").arg(it_row.data()[ m_rowTypeList[i] ][column].formatMoney(fraction, false)); + rowdata += TQString(",\"%1\"").tqarg(it_row.data()[ m_rowTypeList[i] ][column].formatMoney(fraction, false)); } column++; } if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) - rowdata += QString(",\"%1\"").arg((*it_row)[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); + rowdata += TQString(",\"%1\"").tqarg((*it_row)[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); } // @@ -1411,13 +1411,13 @@ QString PivotTable::renderCSV( void ) const // if(!rowname.isClosed() || isUsed) { - innergroupdata += "\"" + QString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name(); + innergroupdata += "\"" + TQString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name(); // if we don't convert the currencies to the base currency and the // current row contains a foreign currency, then we append the currency // to the name of the account if (!m_config_f.isConvertCurrency() && rowname.isForeignCurrency() ) - innergroupdata += QString(" (%1)").arg(rowname.currencyId()); + innergroupdata += TQString(" (%1)").tqarg(rowname.currencyId()); innergroupdata += "\""; @@ -1434,7 +1434,7 @@ QString PivotTable::renderCSV( void ) const // bool finishrow = true; - QString finalRow; + TQString finalRow; bool isUsed = false; if ( m_config_f.detailLevel() == MyMoneyReport::eDetailAll && ((*it_innergroup).size() > 1 )) { @@ -1459,9 +1459,9 @@ QString PivotTable::renderCSV( void ) const ReportAccount rowname = (*it_innergroup).begin().key(); isUsed |= !rowname.isClosed(); - finalRow = "\"" + QString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name(); + finalRow = "\"" + TQString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name(); if (!m_config_f.isConvertCurrency() && rowname.isForeignCurrency() ) - finalRow += QString(" (%1)").arg(rowname.currencyId()); + finalRow += TQString(" (%1)").tqarg(rowname.currencyId()); finalRow += "\""; } @@ -1477,14 +1477,14 @@ QString PivotTable::renderCSV( void ) const { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { isUsed |= (*it_innergroup).m_total[ m_rowTypeList[i] ][column].isUsed(); - finalRow += QString(",\"%1\"").arg((*it_innergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false)); + finalRow += TQString(",\"%1\"").tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false)); } column++; } if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) - finalRow += QString(",\"%1\"").arg((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); + finalRow += TQString(",\"%1\"").tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); } finalRow += "\n"; @@ -1504,18 +1504,18 @@ QString PivotTable::renderCSV( void ) const if ( m_config_f.isShowingColumnTotals() ) { - result += QString("%1 %2").arg(i18n("Total")).arg(it_outergroup.key()); + result += TQString("%1 %2").tqarg(i18n("Total")).tqarg(it_outergroup.key()); unsigned column = 1; while ( column < m_numColumns ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) - result += QString(",\"%1\"").arg((*it_outergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false)); + result += TQString(",\"%1\"").tqarg((*it_outergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false)); column++; } if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) - result += QString(",\"%1\"").arg((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); + result += TQString(",\"%1\"").tqarg((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); } result += "\n"; @@ -1533,14 +1533,14 @@ QString PivotTable::renderCSV( void ) const unsigned totalcolumn = 1; while ( totalcolumn < m_numColumns ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) - result += QString(",\"%1\"").arg(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn].formatMoney(fraction, false)); + result += TQString(",\"%1\"").tqarg(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn].formatMoney(fraction, false)); totalcolumn++; } if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) - result += QString(",\"%1\"").arg(m_grid.m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); + result += TQString(",\"%1\"").tqarg(m_grid.m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false)); } result += "\n"; @@ -1549,55 +1549,55 @@ QString PivotTable::renderCSV( void ) const return result; } -QString PivotTable::renderHTML( void ) const +TQString PivotTable::renderHTML( void ) const { DEBUG_ENTER(__PRETTY_FUNCTION__); - QString colspan = QString(" colspan=\"%1\"").arg(m_numColumns + 1 + (m_config_f.isShowingRowTotals() ? 1 : 0) ); + TQString colspan = TQString(" colspan=\"%1\"").tqarg(m_numColumns + 1 + (m_config_f.isShowingRowTotals() ? 1 : 0) ); // // Report Title // - QString result = QString("

%1

\n").arg(m_config_f.name()); + TQString result = TQString("

%1

\n").tqarg(m_config_f.name()); //actual dates of the report - result += QString("
"); - result += i18n("Report date range", "%1 through %2").arg(KGlobal::locale()->formatDate(m_config_f.fromDate(), true)).arg(KGlobal::locale()->formatDate(m_config_f.toDate(), true)); - result += QString("
\n"); - result += QString("
 
\n"); + result += TQString("
"); + result += i18n("Report date range", "%1 through %2").tqarg(KGlobal::locale()->formatDate(m_config_f.fromDate(), true)).tqarg(KGlobal::locale()->formatDate(m_config_f.toDate(), true)); + result += TQString("
\n"); + result += TQString("
 
\n"); //currency conversion message - result += QString("
"); + result += TQString("
"); if ( m_config_f.isConvertCurrency() ) - result += i18n("All currencies converted to %1").arg(MyMoneyFile::instance()->baseCurrency().name()); + result += i18n("All currencies converted to %1").tqarg(MyMoneyFile::instance()->baseCurrency().name()); else - result += i18n("All values shown in %1 unless otherwise noted").arg(MyMoneyFile::instance()->baseCurrency().name()); - result += QString("
\n"); - result += QString("
 
\n"); + result += i18n("All values shown in %1 unless otherwise noted").tqarg(MyMoneyFile::instance()->baseCurrency().name()); + result += TQString("
\n"); + result += TQString("
 
\n"); // setup a leftborder for better readability of budget vs actual reports - QString leftborder; + TQString leftborder; if (m_rowTypeList.size() > 1) leftborder = " class=\"leftborder\""; // // Table Header // - result += QString("\n\n\n" - "\n").arg(i18n("Account")); + result += TQString("\n\n
%1
\n" + "\n").tqarg(i18n("Account")); - QString headerspan; + TQString headerspan; int span = m_rowTypeList.size(); - headerspan = QString(" colspan=\"%1\"").arg(span); + headerspan = TQString(" colspan=\"%1\"").tqarg(span); unsigned column = 1; while ( column < m_numColumns ) - result += QString("%2").arg(headerspan,QString(m_columnHeadings[column++]).replace(QRegExp(" "),"
")); + result += TQString("%2").tqarg(headerspan,TQString(m_columnHeadings[column++]).tqreplace(TQRegExp(" "),"
")); if ( m_config_f.isShowingRowTotals() ) - result += QString("%2").arg(headerspan).arg(i18n("Total")); + result += TQString("%2").tqarg(headerspan).tqarg(i18n("Total")); result += "
\n"; @@ -1611,22 +1611,22 @@ QString PivotTable::renderHTML( void ) const unsigned column = 1; while ( column < m_numColumns ) { - QString lb; + TQString lb; if(column != 1) lb = leftborder; for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - result += QString("%1") - .arg(i18n( m_columnTypeHeaderList[i] )) - .arg(i == 0 ? lb : QString() ); + result += TQString("%1") + .tqarg(i18n( m_columnTypeHeaderList[i] )) + .tqarg(i == 0 ? lb : TQString() ); } column++; } if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - result += QString("%1") - .arg(i18n( m_columnTypeHeaderList[i] )) - .arg(i == 0 ? leftborder : QString() ); + result += TQString("%1") + .tqarg(i18n( m_columnTypeHeaderList[i] )) + .tqarg(i == 0 ? leftborder : TQString() ); } } result += ""; @@ -1646,7 +1646,7 @@ QString PivotTable::renderHTML( void ) const // // I hope this doesn't bog the performance of reports, given that we're copying the entire report // data. If this is a perf hit, we could change to storing outergroup pointers, I think. - QValueList outergroups; + TQValueList outergroups; PivotGrid::const_iterator it_outergroup_map = m_grid.begin(); while ( it_outergroup_map != m_grid.end() ) { @@ -1660,14 +1660,14 @@ QString PivotTable::renderHTML( void ) const } qHeapSort(outergroups); - QValueList::const_iterator it_outergroup = outergroups.begin(); + TQValueList::const_iterator it_outergroup = outergroups.begin(); while ( it_outergroup != outergroups.end() ) { // // Outer Group Header // - result += QString("\n").arg(colspan).arg((*it_outergroup).m_displayName); + result += TQString("\n").tqarg(colspan).tqarg((*it_outergroup).m_displayName); // Skip the inner groups if the report only calls for outer group totals to be shown if ( m_config_f.detailLevel() != MyMoneyReport::eDetailGroup ) @@ -1685,7 +1685,7 @@ QString PivotTable::renderHTML( void ) const // Rows // - QString innergroupdata; + TQString innergroupdata; PivotInnerGroup::const_iterator it_row = (*it_innergroup).begin(); while ( it_row != (*it_innergroup).end() ) { @@ -1693,19 +1693,19 @@ QString PivotTable::renderHTML( void ) const // Columns // - QString rowdata; + TQString rowdata; unsigned column = 1; bool isUsed = it_row.data()[eActual][0].isUsed(); while ( column < m_numColumns ) { - QString lb; + TQString lb; if(column != 1) lb = leftborder; for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - rowdata += QString("%1") - .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column])) - .arg(i == 0 ? lb : QString()); + rowdata += TQString("%1") + .tqarg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column])) + .tqarg(i == 0 ? lb : TQString()); isUsed |= it_row.data()[ m_rowTypeList[i] ][column].isUsed(); } @@ -1716,9 +1716,9 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - rowdata += QString("%1") - .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + rowdata += TQString("%1") + .tqarg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total)) + .tqarg(i == 0 ? leftborder : TQString()); } } @@ -1730,13 +1730,13 @@ QString PivotTable::renderHTML( void ) const // don't show closed accounts if they have not been used if(!rowname.isClosed() || isUsed) { - innergroupdata += QString("%5%6") - .arg(rownum & 0x01 ? "even" : "odd") - .arg(rowname.isTopLevel() ? " id=\"topparent\"" : "") - .arg("") //.arg((*it_row).m_total.isZero() ? colspan : "") // colspan the distance if this row will be blank - .arg(rowname.hierarchyDepth() - 1) - .arg(rowname.name().replace(QRegExp(" "), " ")) - .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?QString():QString(" (%1)").arg(rowname.currency().id())); + innergroupdata += TQString("%5%6") + .tqarg(rownum & 0x01 ? "even" : "odd") + .tqarg(rowname.isTopLevel() ? " id=\"toptqparent\"" : "") + .tqarg("") //.tqarg((*it_row).m_total.isZero() ? colspan : "") // colspan the distance if this row will be blank + .tqarg(rowname.hierarchyDepth() - 1) + .tqarg(rowname.name().tqreplace(TQRegExp(" "), " ")) + .tqarg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?TQString():TQString(" (%1)").tqarg(rowname.currency().id())); // Don't print this row if it's going to be all zeros // TODO: Uncomment this, and deal with the case where the data @@ -1755,7 +1755,7 @@ QString PivotTable::renderHTML( void ) const // bool finishrow = true; - QString finalRow; + TQString finalRow; bool isUsed = false; if ( m_config_f.detailLevel() == MyMoneyReport::eDetailAll && ((*it_innergroup).size() > 1 )) { @@ -1765,9 +1765,9 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingColumnTotals() ) { // Start the TOTALS row - finalRow = QString("") - .arg(rownum & 0x01 ? "even" : "odd") - .arg(i18n("Total")); + finalRow = TQString("") + .tqarg(rownum & 0x01 ? "even" : "odd") + .tqarg(i18n("Total")); // don't suppress display of totals isUsed = true; } @@ -1787,12 +1787,12 @@ QString PivotTable::renderHTML( void ) const // This works for me (ipwizard) ReportAccount rowname = (*it_innergroup).begin().key(); isUsed |= !rowname.isClosed(); - finalRow = QString("") - .arg(rownum & 0x01 ? "even" : "odd") - .arg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" ) - .arg(rowname.hierarchyDepth() - 1) - .arg(rowname.name().replace(QRegExp(" "), " ")) - .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?QString():QString(" (%1)").arg(rowname.currency().id())); + finalRow = TQString("") + .tqarg(rownum & 0x01 ? "even" : "odd") + .tqarg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" ) + .tqarg(rowname.hierarchyDepth() - 1) + .tqarg(rowname.name().tqreplace(TQRegExp(" "), " ")) + .tqarg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?TQString():TQString(" (%1)").tqarg(rowname.currency().id())); } // Finish the row started above, unless told not to @@ -1802,14 +1802,14 @@ QString PivotTable::renderHTML( void ) const isUsed |= (*it_innergroup).m_total[eActual][0].isUsed(); while ( column < m_numColumns ) { - QString lb; + TQString lb; if(column != 1) lb = leftborder; for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - finalRow += QString("%1") - .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ][column])) - .arg(i == 0 ? lb : QString()); + finalRow += TQString("%1") + .tqarg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ][column])) + .tqarg(i == 0 ? lb : TQString()); isUsed |= (*it_innergroup).m_total[ m_rowTypeList[i] ][column].isUsed(); } @@ -1819,9 +1819,9 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - finalRow += QString("%1") - .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + finalRow += TQString("%1") + .tqarg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total)) + .tqarg(i == 0 ? leftborder : TQString()); } } @@ -1844,18 +1844,18 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingColumnTotals() ) { - result += QString("").arg(i18n("Total")).arg((*it_outergroup).m_displayName); + result += TQString("").tqarg(i18n("Total")).tqarg((*it_outergroup).m_displayName); unsigned column = 1; while ( column < m_numColumns ) { - QString lb; + TQString lb; if(column != 1) lb = leftborder; for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - result += QString("%1") - .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column])) - .arg(i == 0 ? lb : QString()); + result += TQString("%1") + .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column])) + .tqarg(i == 0 ? lb : TQString()); } column++; @@ -1864,9 +1864,9 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - result += QString("%1") - .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + result += TQString("%1") + .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total)) + .tqarg(i == 0 ? leftborder : TQString()); } } result += "\n"; @@ -1884,19 +1884,19 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingColumnTotals() ) { - result += QString("\n"); - result += QString("").arg(i18n("Grand Total")); + result += TQString("\n"); + result += TQString("").tqarg(i18n("Grand Total")); unsigned totalcolumn = 1; while ( totalcolumn < m_numColumns ) { - QString lb; + TQString lb; if(totalcolumn != 1) lb = leftborder; for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - result += QString("%1") - .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn])) - .arg(i == 0 ? lb : QString()); + result += TQString("%1") + .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn])) + .tqarg(i == 0 ? lb : TQString()); } totalcolumn++; @@ -1905,27 +1905,27 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingRowTotals() ) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { - result += QString("%1") - .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + result += TQString("%1") + .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total)) + .tqarg(i == 0 ? leftborder : TQString()); } } result += "\n"; } - result += QString("\n"); - result += QString("\n"); + result += TQString("\n"); + result += TQString("\n"); result += "
%1
%2
%2
  %2
  %2
%5%6
%5%6
%1 %2
%1 %2
 
%1
 
%1
 
 
 
 
\n"; return result; } -void PivotTable::dump( const QString& file, const QString& /* context */) const +void PivotTable::dump( const TQString& file, const TQString& /* context */) const { - QFile g( file ); + TQFile g( file ); g.open( IO_WriteOnly ); - QTextStream(&g) << renderHTML(); + TQTextStream(&g) << renderHTML(); g.close(); } @@ -2030,13 +2030,13 @@ void PivotTable::drawChart( KReportChartView& _view ) const _view.setAccountSeries( accountSeries ); // Set up X axis labels (ie "abscissa" to use the technical term) - QStringList& abscissaNames = _view.abscissaNames(); + TQStringList& abscissaNames = _view.abscissaNames(); abscissaNames.clear(); if ( accountSeries ) { unsigned column = 1; while ( column < m_numColumns ) { - abscissaNames += QString(m_columnHeadings[column++]).replace(" ", " "); + abscissaNames += TQString(m_columnHeadings[column++]).tqreplace(" ", " "); } } else @@ -2064,7 +2064,7 @@ void PivotTable::drawChart( KReportChartView& _view ) const // // Rows // - QString innergroupdata; + TQString innergroupdata; PivotInnerGroup::const_iterator it_row = (*it_innergroup).begin(); while ( it_row != (*it_innergroup).end() ) { @@ -2213,14 +2213,14 @@ void PivotTable::drawChart( KReportChartView& _view ) const { // the first column of report which represents a date in the future, or one past the // last column if all columns are in the present day. Only relevant when accountSeries==true - unsigned futurecolumn = columnValue(QDate::currentDate()) - columnValue(m_beginDate) + 1; + unsigned futurecolumn = columnValue(TQDate::tqcurrentDate()) - columnValue(m_beginDate) + 1; // kdDebug(2) << "futurecolumn: " << futurecolumn << endl; // kdDebug(2) << "m_numColumns: " << m_numColumns << endl; // Properties for line charts whose values are in the future. KDChartPropertySet propSetFutureValue("future value", KDChartParams::KDCHART_PROPSET_NORMAL_DATA); - propSetFutureValue.setLineStyle(KDChartPropertySet::OwnID, Qt::DotLine); + propSetFutureValue.setLineStyle(KDChartPropertySet::OwnID, TQt::DotLine); const int idPropFutureValue = _view.params()->registerProperties(propSetFutureValue); for(int col = futurecolumn; col < m_numColumns; ++col) { @@ -2270,17 +2270,17 @@ unsigned PivotTable::drawChartRowSet(unsigned rowNum, const bool seriesTotals, c return ++rowNum; } -QString PivotTable::coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol, int prec) const +TQString PivotTable::coloredAmount(const MyMoneyMoney& amount, const TQString& currencySymbol, int prec) const { - QString result; + TQString result; if( amount.isNegative() ) - result += QString("") - .arg(KMyMoneyGlobalSettings::listNegativeValueColor().red()) - .arg(KMyMoneyGlobalSettings::listNegativeValueColor().green()) - .arg(KMyMoneyGlobalSettings::listNegativeValueColor().blue()); + result += TQString("") + .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().red()) + .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().green()) + .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().blue()); result += amount.formatMoney(currencySymbol, prec); if( amount.isNegative() ) - result += QString(""); + result += TQString(""); return result; } @@ -2335,10 +2335,10 @@ void PivotTable::calculateForecast(void) forecast.setIncludeUnusedAccounts(true); //setup forecast dates - if(m_endDate > QDate::currentDate()) { + if(m_endDate > TQDate::tqcurrentDate()) { forecast.setForecastEndDate(m_endDate); - forecast.setForecastStartDate(QDate::currentDate()); - forecast.setForecastDays(QDate::currentDate().daysTo(m_endDate)); + forecast.setForecastStartDate(TQDate::tqcurrentDate()); + forecast.setForecastDays(TQDate::tqcurrentDate().daysTo(m_endDate)); } else { forecast.setForecastStartDate(m_beginDate); forecast.setForecastEndDate(m_endDate); @@ -2346,7 +2346,7 @@ void PivotTable::calculateForecast(void) } //adjust history dates if beginning date is before today - if(m_beginDate < QDate::currentDate()) { + if(m_beginDate < TQDate::tqcurrentDate()) { forecast.setHistoryEndDate(m_beginDate.addDays(-1)); forecast.setHistoryStartDate(forecast.historyEndDate().addDays(-forecast.accountsCycle()*forecast.forecastCycles())); } @@ -2365,7 +2365,7 @@ void PivotTable::calculateForecast(void) while ( it_row != (*it_innergroup).end() ) { unsigned column = 1; - QDate forecastDate = m_beginDate; + TQDate forecastDate = m_beginDate; //check whether columns are days or months if(m_config_f.isColumnsAreDays()) { @@ -2380,7 +2380,7 @@ void PivotTable::calculateForecast(void) while(column < m_numColumns) { //set forecastDate to last day of each month //TODO we really need a date manipulation util - forecastDate = QDate(forecastDate.year(), forecastDate.month(), forecastDate.daysInMonth()); + forecastDate = TQDate(forecastDate.year(), forecastDate.month(), forecastDate.daysInMonth()); //check that forecastDate is not over ending date if(forecastDate > m_endDate) forecastDate = m_endDate; @@ -2466,9 +2466,9 @@ void PivotTable::calculateMovingAverage (void) while(column < m_numColumns) { MyMoneyMoney totalPrice = MyMoneyMoney( 0, 1 ); - QDate averageStart = columnDate(column).addDays(-delta); - QDate averageEnd = columnDate(column).addDays(delta); - for(QDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) { + TQDate averageStart = columnDate(column).addDays(-delta); + TQDate averageEnd = columnDate(column).addDays(delta); + for(TQDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) { if(m_config_f.isConvertCurrency()) { totalPrice += it_row.key().deepCurrencyPrice(averageDate) * it_row.key().baseCurrencyPrice(averageDate); } else { @@ -2489,28 +2489,28 @@ void PivotTable::calculateMovingAverage (void) } else { //if columns are months while(column < m_numColumns) { - QDate averageStart = columnDate(column); + TQDate averageStart = columnDate(column); //set the right start date depending on the column type switch(m_config_f.columnType()) { case MyMoneyReport::eYears: { - averageStart = QDate(columnDate(column).year(), 1, 1); + averageStart = TQDate(columnDate(column).year(), 1, 1); break; } case MyMoneyReport::eBiMonths: { - averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1); + averageStart = TQDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1); break; } case MyMoneyReport::eQuarters: { - averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1); + averageStart = TQDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1); break; } case MyMoneyReport::eMonths: { - averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1); + averageStart = TQDate(columnDate(column).year(), columnDate(column).month(), 1); break; } case MyMoneyReport::eWeeks: @@ -2524,8 +2524,8 @@ void PivotTable::calculateMovingAverage (void) //gather the actual data and calculate the average MyMoneyMoney totalPrice = MyMoneyMoney(0, 1); - QDate averageEnd = columnDate(column); - for(QDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) { + TQDate averageEnd = columnDate(column); + for(TQDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) { if(m_config_f.isConvertCurrency()) { totalPrice += it_row.key().deepCurrencyPrice(averageDate) * it_row.key().baseCurrencyPrice(averageDate); } else { @@ -2582,15 +2582,15 @@ void PivotTable::includeInvestmentSubAccounts() // if we're not in expert mode, we need to make sure // that all stock accounts for the selected investment // account are also selected - QStringList accountList; + TQStringList accountList; if(m_config_f.accounts(accountList)) { if(!KMyMoneyGlobalSettings::expertMode()) { - QStringList::const_iterator it_a, it_b; + TQStringList::const_iterator it_a, it_b; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!accountList.contains(*it_b)) { + if(!accountList.tqcontains(*it_b)) { m_config_f.addAccount(*it_b); } } diff --git a/kmymoney2/reports/pivottable.h b/kmymoney2/reports/pivottable.h index 226c9a5..26ac53c 100644 --- a/kmymoney2/reports/pivottable.h +++ b/kmymoney2/reports/pivottable.h @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -76,15 +76,15 @@ public: /** * Render the report to an HTML stream. * - * @return QString HTML string representing the report + * @return TQString HTML string representing the report */ - QString renderHTML( void ) const; + TQString renderHTML( void ) const; /** * Render the report to a comma-separated-values stream. * - * @return QString CSV string representing the report + * @return TQString CSV string representing the report */ - QString renderCSV( void ) const; + TQString renderCSV( void ) const; /** * Render the report to a graphical chart @@ -99,7 +99,7 @@ public: * @param file The filename to dump into * @param context unused, but provided for interface compatibility */ - void dump( const QString& file, const QString& context=QString()) const; + void dump( const TQString& file, const TQString& context=TQString()) const; /** * Returns the grid generated by the report @@ -114,10 +114,10 @@ private: PivotGrid m_grid; - QStringList m_columnHeadings; + TQStringList m_columnHeadings; unsigned m_numColumns; - QDate m_beginDate; - QDate m_endDate; + TQDate m_beginDate; + TQDate m_endDate; bool m_runningSumsCalculated; /** @@ -125,17 +125,17 @@ private: * the budget for it. If an account is not contained in this map, it is not included * in the budget. */ - QMap m_budgetMap; + TQMap m_budgetMap; /** * This list contains the types of PivotGridRows that are going to be shown in the report */ - QValueList m_rowTypeList; + TQValueList m_rowTypeList; /** * This list contains the i18n headers for the column types */ - QValueList m_columnTypeHeaderList; + TQValueList m_columnTypeHeaderList; MyMoneyReport m_config_f; @@ -153,7 +153,7 @@ private: * with $red, $green and $blue being the actual value for the * chosen color. */ - QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol = QString(), int prec = 2 ) const; + TQString coloredAmount(const MyMoneyMoney& amount, const TQString& currencySymbol = TQString(), int prec = 2 ) const; protected: /** @@ -165,9 +165,9 @@ protected: * * @param outergroup The outer row group * @param row The row itself - * @param recursive Whether to also recursively create rows for our parent accounts + * @param recursive Whether to also recursively create rows for our tqparent accounts */ - void createRow( const QString& outergroup, const ReportAccount& row, bool recursive ); + void createRow( const TQString& outergroup, const ReportAccount& row, bool recursive ); /** * Assigns a value into the grid @@ -183,7 +183,7 @@ protected: * @param stockSplit Wheter this is a stock split (@p true) or an actual * value (@p false). Defaults to @p false. */ - inline void assignCell( const QString& outergroup, const ReportAccount& row, unsigned column, MyMoneyMoney value, bool budget = false, bool stockSplit = false ); + inline void assignCell( const TQString& outergroup, const ReportAccount& row, unsigned column, MyMoneyMoney value, bool budget = false, bool stockSplit = false ); /** * Create a row for each included account. This is used when @@ -207,7 +207,7 @@ protected: * in the user's hierarchy and the account where the budget is held for it. * This is needed because the user can budget on a given account for that * account and all its descendants. Also if NO budget is placed on the - * account or any of its parents, the account is not included in the map. + * account or any of its tqparents, the account is not included in the map. */ void calculateBudgetMapping( void ); @@ -317,19 +317,19 @@ protected: * * @param _date The date */ - unsigned columnValue(const QDate& _date) const; + unsigned columnValue(const TQDate& _date) const; /** * Calculate the date of the last day covered by a given column. * * @param column The column */ - QDate columnDate(int column) const; + TQDate columnDate(int column) const; /** * Returns the balance of a given cell. Throws an exception once calculateRunningSums() has been run. */ - MyMoneyMoney cellBalance(const QString& outergroup, const ReportAccount& _row, unsigned column, bool budget); + MyMoneyMoney cellBalance(const TQString& outergroup, const ReportAccount& _row, unsigned column, bool budget); /** * Draws a PivotGridRowSet in a chart for the given ERowType diff --git a/kmymoney2/reports/pivottabletest.cpp b/kmymoney2/reports/pivottabletest.cpp index a235c0b..f5dbe12 100644 --- a/kmymoney2/reports/pivottabletest.cpp +++ b/kmymoney2/reports/pivottabletest.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -60,7 +60,7 @@ void PivotTableTest::setUp () MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -73,16 +73,16 @@ void PivotTableTest::setUp () acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); @@ -102,7 +102,7 @@ void PivotTableTest::testNetWorthSingle() { MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2004,7,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2004,7,1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); writeTabletoCSV(networth_f); @@ -130,7 +130,7 @@ void PivotTableTest::testNetWorthOfsetting() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid["Liability"]["Credit Card"][acCredit][eActual][7]==-moCreditOpen); @@ -146,7 +146,7 @@ void PivotTableTest::testNetWorthOpeningPrior() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2005,8,1),QDate(2005,12,31)); + filter.setDateFilter(TQDate(2005,8,1),TQDate(2005,12,31)); filter.setName("Net Worth Opening Prior 1"); XMLandback(filter); PivotTable networth_f( filter ); @@ -160,9 +160,9 @@ void PivotTableTest::testNetWorthOpeningPrior() // Test the net worth report to make sure that transactions prior to the report // period are included in the opening balance - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acChecking, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acChecking, acChild ); filter.setName("Net Worth Opening Prior 2"); PivotTable networth_f2( filter ); @@ -179,7 +179,7 @@ void PivotTableTest::testNetWorthDateFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2004,2,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2004,2,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid.m_total[eActual][1]==moZero); @@ -196,7 +196,7 @@ void PivotTableTest::testSpendingEmpty() PivotTable spending_f1( filter ); CPPUNIT_ASSERT(spending_f1.m_grid.m_total[eActual].m_total==moZero); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); PivotTable spending_f2( filter ); CPPUNIT_ASSERT(spending_f2.m_grid.m_total[eActual].m_total==moZero); } @@ -204,11 +204,11 @@ void PivotTableTest::testSpendingEmpty() void PivotTableTest::testSingleTransaction() { // Test a single transaction - TransactionHelper t( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal,moSolo, acChecking, acSolo ); + TransactionHelper t( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal,moSolo, acChecking, acSolo ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setName("Spending with Single Transaction.html"); XMLandback(filter); PivotTable spending_f( filter ); @@ -222,7 +222,7 @@ void PivotTableTest::testSingleTransaction() filter.clear(); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid["Asset"]["Checking Account"].m_total[eActual][2]==(moCheckingOpen-moSolo) ); @@ -232,13 +232,13 @@ void PivotTableTest::testSubAccount() { // Test a sub-account with a value, under an account with a value - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setName("Spending with Sub-Account"); XMLandback(filter); @@ -255,7 +255,7 @@ void PivotTableTest::testSubAccount() filter.clear(); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setName("Net Worth with Sub-Account"); XMLandback(filter); PivotTable networth_f( filter ); @@ -268,13 +268,13 @@ void PivotTableTest::testSubAccount() void PivotTableTest::testFilterIEvsIE() { // Test that removing an income/spending account will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acChild); filter.addCategory(acSolo); XMLandback(filter); @@ -289,13 +289,13 @@ void PivotTableTest::testFilterIEvsIE() void PivotTableTest::testFilterALvsAL() { // Test that removing an asset/liability account will remove the entry from an asset/liability report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acChecking); filter.addCategory(acChild); filter.addCategory(acSolo); @@ -307,13 +307,13 @@ void PivotTableTest::testFilterALvsAL() void PivotTableTest::testFilterALvsIE() { // Test that removing an asset/liability account will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acChecking); CPPUNIT_ASSERT(file->transactionList(filter).count() == 1); @@ -329,13 +329,13 @@ void PivotTableTest::testFilterAllvsIE() { // Test that removing an asset/liability account AND an income/expense // category will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acCredit); filter.addCategory(acChild); PivotTable spending_f( filter ); @@ -348,14 +348,14 @@ void PivotTableTest::testFilterAllvsIE() void PivotTableTest::testFilterBasics() { // Test that the filters are operating the way that the reports expect them to - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyTransactionFilter filter; filter.clear(); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acSolo); filter.setReportAllSplits(false); filter.setConsiderCategory(true); @@ -371,7 +371,7 @@ void PivotTableTest::testFilterBasics() CPPUNIT_ASSERT(file->transactionList(filter).count() == 1); filter.clear(); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acParent); filter.addAccount(acCredit); filter.setReportAllSplits(false); @@ -392,26 +392,26 @@ void PivotTableTest::testMultipleCurrencies() MyMoneyMoney moCanTransaction( 100.0 ); MyMoneyMoney moJpyTransaction( 100.0 ); - QString acCanChecking = makeAccount(QString("Canadian Checking"),MyMoneyAccount::Checkings,moCanOpening,QDate(2003,11,15),acAsset,"CAD"); - QString acJpyChecking = makeAccount(QString("Japanese Checking"),MyMoneyAccount::Checkings,moJpyOpening,QDate(2003,11,15),acAsset,"JPY"); - QString acCanCash = makeAccount(QString("Canadian"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acForeign,"CAD"); - QString acJpyCash = makeAccount(QString("Japanese"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acForeign,"JPY"); + TQString acCanChecking = makeAccount(TQString("Canadian Checking"),MyMoneyAccount::Checkings,moCanOpening,TQDate(2003,11,15),acAsset,"CAD"); + TQString acJpyChecking = makeAccount(TQString("Japanese Checking"),MyMoneyAccount::Checkings,moJpyOpening,TQDate(2003,11,15),acAsset,"JPY"); + TQString acCanCash = makeAccount(TQString("Canadian"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acForeign,"CAD"); + TQString acJpyCash = makeAccount(TQString("Japanese"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acForeign,"JPY"); - makePrice("CAD",QDate(2004,1,1),MyMoneyMoney(moCanPrice)); - makePrice("JPY",QDate(2004,1,1),MyMoneyMoney(moJpyPrice)); - makePrice("JPY",QDate(2004,5,1),MyMoneyMoney(moJpyPrice2)); - makePrice("JPY",QDate(2004,6,30),MyMoneyMoney(moJpyPrice3)); - makePrice("JPY",QDate(2004,7,15),MyMoneyMoney(moJpyPrice4)); + makePrice("CAD",TQDate(2004,1,1),MyMoneyMoney(moCanPrice)); + makePrice("JPY",TQDate(2004,1,1),MyMoneyMoney(moJpyPrice)); + makePrice("JPY",TQDate(2004,5,1),MyMoneyMoney(moJpyPrice2)); + makePrice("JPY",TQDate(2004,6,30),MyMoneyMoney(moJpyPrice3)); + makePrice("JPY",TQDate(2004,7,15),MyMoneyMoney(moJpyPrice4)); - TransactionHelper t1( QDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t2( QDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t3( QDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t4( QDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); - TransactionHelper t5( QDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); - TransactionHelper t6( QDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t1( TQDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t2( TQDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t3( TQDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t4( TQDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t5( TQDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t6( TQDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); #if 0 - QFile g( "multicurrencykmy.xml" ); + TQFile g( "multicurrencykmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -421,7 +421,7 @@ void PivotTableTest::testMultipleCurrencies() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setConvertCurrency(true); filter.setName("Multiple Currency Spending Rerport (with currency conversion)"); @@ -436,7 +436,7 @@ void PivotTableTest::testMultipleCurrencies() CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acCanCash][eActual][3]==(moCanTransaction*moCanPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acCanCash][eActual][4]==(moCanTransaction*moCanPrice)); - // test multiple foreign currencies under a common parent + // test multiple foreign currencies under a common tqparent CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][2]==(moJpyTransaction*moJpyPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][3]==(moJpyTransaction*moJpyPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][4]==(moJpyTransaction*moJpyPrice)); @@ -462,7 +462,7 @@ void PivotTableTest::testMultipleCurrencies() filter.clear(); filter.setName("Multiple currency net worth"); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); writeTabletoCSV(networth_f); @@ -497,12 +497,12 @@ void PivotTableTest::testAdvancedFilter() // amount { - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setAmountFilter(moChild,moChild); XMLandback(filter); PivotTable spending_f( filter ); @@ -511,14 +511,14 @@ void PivotTableTest::testAdvancedFilter() // payee (specific) { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart" ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, TQString(), "Thomas Baumgart" ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.addPayee(MyMoneyFile::instance()->payeeByName("Thomas Baumgart").id()); filter.setName("Spending with Payee Filter"); XMLandback(filter); @@ -530,15 +530,15 @@ void PivotTableTest::testAdvancedFilter() } // payee (no payee) { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, QString(), QString() ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, TQString(), TQString() ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); - filter.addPayee(QString()); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); + filter.addPayee(TQString()); XMLandback(filter); PivotTable spending_f( filter ); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Parent"][acParent][eActual][11]==moNoPayee); @@ -547,24 +547,24 @@ void PivotTableTest::testAdvancedFilter() // text { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart" ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, TQString(), "Thomas Baumgart" ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); - filter.setTextFilter(QRegExp("Thomas")); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); + filter.setTextFilter(TQRegExp("Thomas")); XMLandback(filter); PivotTable spending_f( filter ); } // type (payment, deposit, transfer) { - TransactionHelper t1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,2,1), MyMoneySplit::ActionDeposit, -moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking ); + TransactionHelper t1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,2,1), MyMoneySplit::ActionDeposit, -moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); @@ -589,7 +589,7 @@ void PivotTableTest::testAdvancedFilter() CPPUNIT_ASSERT(spending_f3.m_grid.m_total[eActual].m_total == moZero); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter( QDate(2004,1,1), QDate(2004,12,31) ); + filter.setDateFilter( TQDate(2004,1,1), TQDate(2004,12,31) ); XMLandback(filter); PivotTable networth_f4( filter ); @@ -601,12 +601,12 @@ void PivotTableTest::testAdvancedFilter() // state (reconciled, cleared, not) { - TransactionHelper t1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - QValueList splits = t1.splits(); + TQValueList splits = t1.splits(); splits[0].setReconcileFlag(MyMoneySplit::Cleared); splits[1].setReconcileFlag(MyMoneySplit::Cleared); t1.modifySplit(splits[0]); @@ -623,7 +623,7 @@ void PivotTableTest::testAdvancedFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.addState(MyMoneyTransactionFilter::cleared); XMLandback(filter); PivotTable spending_f( filter ); @@ -646,12 +646,12 @@ void PivotTableTest::testAdvancedFilter() // number { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - QValueList splits = t1.splits(); + TQValueList splits = t1.splits(); splits[0].setNumber("1"); splits[1].setNumber("1"); t1.modifySplit(splits[0]); @@ -684,7 +684,7 @@ void PivotTableTest::testAdvancedFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setNumberFilter("1","3"); XMLandback(filter); PivotTable spending_f( filter ); @@ -693,21 +693,21 @@ void PivotTableTest::testAdvancedFilter() // blank dates { - TransactionHelper t1y1( QDate(2003,10,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y1( QDate(2003,11,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y1( QDate(2003,12,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y1( TQDate(2003,10,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y1( TQDate(2003,11,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y1( TQDate(2003,12,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y3( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y3( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y3( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y3( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y3( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y3( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(),QDate(2004,7,1)); + filter.setDateFilter(TQDate(),TQDate(2004,7,1)); XMLandback(filter); PivotTable spending_f( filter ); CPPUNIT_ASSERT(spending_f.m_grid.m_total[eActual].m_total==-moSolo-moParent1-moParent2-moSolo-moParent1-moParent2); @@ -725,21 +725,21 @@ void PivotTableTest::testColumnType() { // test column type values of other than 'month' - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2003,12,31),QDate(2005,12,31)); + filter.setDateFilter(TQDate(2003,12,31),TQDate(2005,12,31)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(MyMoneyReport::eBiMonths); XMLandback(filter); @@ -809,19 +809,19 @@ void PivotTableTest::testColumnType() // Test days-based reports - TransactionHelper t1d1( QDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d1( QDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d1( QDate(2004,7,5), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d1( TQDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d1( TQDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d1( TQDate(2004,7,5), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1d2( QDate(2004,7,14), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d2( QDate(2004,7,15), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d2( QDate(2004,7,20), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d2( TQDate(2004,7,14), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d2( TQDate(2004,7,15), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d2( TQDate(2004,7,20), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1d3( QDate(2004,8,2), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d3( QDate(2004,8,3), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d3( QDate(2004,8,4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d3( TQDate(2004,8,2), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d3( TQDate(2004,8,3), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d3( TQDate(2004,8,4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - filter.setDateFilter(QDate(2004,7,2),QDate(2004,7,14)); + filter.setDateFilter(TQDate(2004,7,2),TQDate(2004,7,14)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(MyMoneyReport::eMonths); filter.setColumnsAreDays(true); @@ -837,7 +837,7 @@ void PivotTableTest::testColumnType() unsigned save_dayweekstart = KGlobal::locale()->weekStartDay(); KGlobal::locale()->setWeekStartDay(2); - filter.setDateFilter(QDate(2004,7,2),QDate(2004,8,1)); + filter.setDateFilter(TQDate(2004,7,2),TQDate(2004,8,1)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(static_cast(7)); filter.setColumnsAreDays(true); @@ -868,23 +868,23 @@ void PivotTableTest::testInvestment(void) eqStock2 = makeEquity("Stock2","STK2"); // Accounts - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset); - acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock1); - acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock2); - acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset); + acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock1); + acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock2); + acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); // Transactions // Date Action Shares Price Stock Asset Income - InvTransactionHelper s1b1( QDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1b2( QDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s1( QDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s2( QDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1r1( QDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1r2( QDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1c1( QDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1c2( QDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1b1( TQDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1b2( TQDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s1( TQDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s2( TQDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1r1( TQDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1r2( TQDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1c1( TQDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1c2( TQDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); - makeEquityPrice( eqStock1, QDate(2004,10,1), 100.00 ); + makeEquityPrice( eqStock1, TQDate(2004,10,1), 100.00 ); // // Net Worth Report (with investments) @@ -892,7 +892,7 @@ void PivotTableTest::testInvestment(void) MyMoneyReport networth_r; networth_r.setRowType( MyMoneyReport::eAssetLiability ); - networth_r.setDateFilter(QDate(2004,1,1),QDate(2004,12,31).addDays(-1)); + networth_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,12,31).addDays(-1)); XMLandback(networth_r); PivotTable networth(networth_r); @@ -920,7 +920,7 @@ void PivotTableTest::testInvestment(void) #if 0 // Dump file & reports - QFile g( "investmentkmy.xml" ); + TQFile g( "investmentkmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -945,7 +945,7 @@ void PivotTableTest::testBudget(void) // 1. Budget on A, transations on A { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acSolo, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSolo, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, @@ -958,7 +958,7 @@ void PivotTableTest::testBudget(void) // 2. Budget on B, not applying to sub accounts, transactions on B and B:1 { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -974,7 +974,7 @@ void PivotTableTest::testBudget(void) // 3. Budget on C, applying to sub accounts, transactions on C and C:1 and C:1:a { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, true, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, true, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -989,9 +989,9 @@ void PivotTableTest::testBudget(void) // 4. Budget on D, not applying to sub accounts, budget on D:1 not applying, budget on D:2 applying. Transactions on D, D:1, D:2, D:2:a, D:2:b { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, false, 100.0 ); - budget += BudgetEntryHelper( QDate(2006,1,1), acChild, false, 100.0 ); - budget += BudgetEntryHelper( QDate(2006,1,1), acSecondChild, true, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acChild, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSecondChild, true, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -1003,12 +1003,12 @@ void PivotTableTest::testBudget(void) // - Totals for D, D:1, D:2 show up. D:2:a and D:2:b do not // - D actuals (only) compare against D budget // - Ditto for D:1 - // - D:2 acutals and children compare against D:2 budget + // - D:2 acutals and tqchildren compare against D:2 budget // 5. Budget on E, no transactions on E { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acSolo, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSolo, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, diff --git a/kmymoney2/reports/querytable.cpp b/kmymoney2/reports/querytable.cpp index 29702c6..cc38a2f 100644 --- a/kmymoney2/reports/querytable.cpp +++ b/kmymoney2/reports/querytable.cpp @@ -25,9 +25,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -59,7 +59,7 @@ namespace reports { // // **************************************************************************** -QDate CashFlowListItem::m_sToday = QDate::currentDate(); +TQDate CashFlowListItem::m_sToday = TQDate::tqcurrentDate(); MyMoneyMoney CashFlowListItem::NPV( double _rate ) const { @@ -158,12 +158,12 @@ double CashFlowList::calculateXIRR ( void ) const double CashFlowList::xirrResult ( double& rate ) const { - QDate date; + TQDate date; double r = rate + 1.0; double res = 0.00000;//back().value().toDouble(); - QValueList::const_iterator list_it = begin(); + TQValueList::const_iterator list_it = begin(); while( list_it != end() ) { double e_i = ( (* list_it).today().daysTo ( (* list_it).date() ) ) / 365.0; MyMoneyMoney val = (* list_it).value(); @@ -178,12 +178,12 @@ double CashFlowList::xirrResult ( double& rate ) const double CashFlowList::xirrResultDerive ( double& rate ) const { - QDate date; + TQDate date; double r = rate + 1.0; double res = 0.00000; - QValueList::const_iterator list_it = begin(); + TQValueList::const_iterator list_it = begin(); while( list_it != end() ) { double e_i = ( (* list_it).today().daysTo ( (* list_it).date() ) ) / 365.0; MyMoneyMoney val = (* list_it).value(); @@ -225,7 +225,7 @@ void CashFlowList::dumpDebug(void) const const_iterator it_item = begin(); while ( it_item != end() ) { - kdDebug(2) << (*it_item).date().toString(Qt::ISODate) << " " << (*it_item).value().toString() << endl; + kdDebug(2) << TQString((*it_item).date().toString(Qt::ISODate)) << " " << (*it_item).value().toString() << endl; ++it_item; } } @@ -334,7 +334,7 @@ void QueryTable::init(void) throw new MYMONEYEXCEPTION("QueryTable::QueryTable(): unhandled row type"); } - QString sort = m_group + "," + m_columns + ",id,rank"; + TQString sort = m_group + "," + m_columns + ",id,rank"; switch (m_config.rowType()) { case MyMoneyReport::eAccountByTopAccount: @@ -350,32 +350,32 @@ void QueryTable::init(void) unsigned qc = m_config.queryColumns(); - if ( qc & MyMoneyReport::eQCnumber ) + if ( qc & MyMoneyReport::eTQCnumber ) m_columns += ",number"; - if ( qc & MyMoneyReport::eQCpayee ) + if ( qc & MyMoneyReport::eTQCpayee ) m_columns += ",payee"; - if ( qc & MyMoneyReport::eQCcategory ) + if ( qc & MyMoneyReport::eTQCcategory ) m_columns += ",category"; - if ( qc & MyMoneyReport::eQCaccount ) + if ( qc & MyMoneyReport::eTQCaccount ) m_columns += ",account"; - if ( qc & MyMoneyReport::eQCreconciled ) + if ( qc & MyMoneyReport::eTQCreconciled ) m_columns += ",reconcileflag"; - if ( qc & MyMoneyReport::eQCmemo ) + if ( qc & MyMoneyReport::eTQCmemo ) m_columns += ",memo"; - if ( qc & MyMoneyReport::eQCaction ) + if ( qc & MyMoneyReport::eTQCaction ) m_columns += ",action"; - if ( qc & MyMoneyReport::eQCshares ) + if ( qc & MyMoneyReport::eTQCshares ) m_columns += ",shares"; - if ( qc & MyMoneyReport::eQCprice ) + if ( qc & MyMoneyReport::eTQCprice ) m_columns += ",price"; - if ( qc & MyMoneyReport::eQCperformance ) + if ( qc & MyMoneyReport::eTQCperformance ) m_columns += ",startingbal,buys,sells,reinvestincome,cashincome,return,returninvestment"; - if ( qc & MyMoneyReport::eQCloan ) + if ( qc & MyMoneyReport::eTQCloan ) { m_columns += ",payment,interest,fees"; m_postcolumns = "balance"; } - if ( qc & MyMoneyReport::eQCbalance) + if ( qc & MyMoneyReport::eTQCbalance) m_postcolumns = "balance"; TableRow::setSortCriteria(sort); @@ -417,14 +417,14 @@ void QueryTable::constructTransactionTable(void) } // support for opening and closing balances - QMap accts; + TQMap accts; //get all transactions for this report - QValueList transactions = file->transactionList(report); - for (QValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { + TQValueList transactions = file->transactionList(report); + for (TQValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { TableRow qA, qS; - QDate pd; + TQDate pd; qA["id"] = qS["id"] = (* it_transaction).id(); qA["entrydate"] = qS["entrydate"] = (* it_transaction).entryDate().toString(Qt::ISODate); @@ -432,8 +432,8 @@ void QueryTable::constructTransactionTable(void) qA["commodity"] = qS["commodity"] = (* it_transaction).commodity(); pd = (* it_transaction).postDate(); - qA["month"] = qS["month"] = i18n("Month of %1").arg(QDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); - qA["week"] = qS["week"] = i18n("Week of %1").arg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); + qA["month"] = qS["month"] = i18n("Month of %1").tqarg(TQDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); + qA["week"] = qS["week"] = i18n("Week of %1").tqarg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); qA["currency"] = qS["currency"] = ""; @@ -450,8 +450,8 @@ void QueryTable::constructTransactionTable(void) // to be the account (qA) that will have the sub-item "split" entries. we add // one transaction entry (qS) for each subsequent entry in the split. - const QValueList& splits = (*it_transaction).splits(); - QValueList::const_iterator myBegin, it_split; + const TQValueList& splits = (*it_transaction).splits(); + TQValueList::const_iterator myBegin, it_split; //S_end = splits.end(); for (it_split = splits.begin(), myBegin = splits.end(); it_split != splits.end(); ++it_split) { @@ -491,7 +491,7 @@ void QueryTable::constructTransactionTable(void) // split entries (qS) normally. bool loan_special_case = false; - if(m_config.queryColumns() & MyMoneyReport::eQCloan) { + if(m_config.queryColumns() & MyMoneyReport::eTQCloan) { ReportAccount splitAcc = (*it_split).accountId(); loan_special_case = splitAcc.isLoan(); } @@ -517,10 +517,10 @@ void QueryTable::constructTransactionTable(void) bool include_me = true; bool transaction_text = false; //indicates whether a text should be considered as a match for the transaction or for a split only - QString a_fullname = ""; - QString a_memo = ""; + TQString a_fullname = ""; + TQString a_memo = ""; unsigned int pass = 1; - QString myBeginCurrency = (file->account((*myBegin).accountId())).currencyId(); //currency of the main split + TQString myBeginCurrency = (file->account((*myBegin).accountId())).currencyId(); //currency of the main split do { MyMoneyMoney xr; ReportAccount splitAcc = (* it_split).accountId(); @@ -532,8 +532,8 @@ void QueryTable::constructTransactionTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = splitAcc.institutionId(); - QString payee = (*it_split).payeeId(); + TQString institution = splitAcc.institutionId(); + TQString payee = (*it_split).payeeId(); //convert to base currency if ( m_config.isConvertCurrency() ) { @@ -548,8 +548,8 @@ void QueryTable::constructTransactionTable(void) if (splitAcc.isInvest()) { - // use the institution of the parent for stock accounts - institution = splitAcc.parent().institutionId(); + // use the institution of the tqparent for stock accounts + institution = splitAcc.tqparent().institutionId(); MyMoneyMoney shares = (*it_split).shares(); qA["action"] = (*it_split).action(); @@ -559,7 +559,7 @@ void QueryTable::constructTransactionTable(void) if (((*it_split).action() == MyMoneySplit::ActionBuyShares) && (*it_split).shares().isNegative()) qA["action"] = "Sell"; - qA["investaccount"] = splitAcc.parent().name(); + qA["investaccount"] = splitAcc.tqparent().name(); } if (it_split == myBegin) { @@ -671,7 +671,7 @@ void QueryTable::constructTransactionTable(void) //--- default case includes all transaction details else { - //this is when the splits are going to be shown as children of the main split + //this is when the splits are going to be shown as tqchildren of the main split if ((splits.count() > 2) && use_summary) { qA["value"] = ""; @@ -693,8 +693,8 @@ void QueryTable::constructTransactionTable(void) if (! splitAcc.isIncomeExpense()) { qA["category"] = ((*it_split).shares().isNegative()) ? - i18n("Transfer from %1").arg(splitAcc.fullName()) - : i18n("Transfer to %1").arg(splitAcc.fullName()); + i18n("Transfer from %1").tqarg(splitAcc.fullName()) + : i18n("Transfer to %1").tqarg(splitAcc.fullName()); qA["topcategory"] = splitAcc.topParentName(); qA["categorytype"] = i18n("Transfer"); } @@ -735,8 +735,8 @@ void QueryTable::constructTransactionTable(void) qS["topaccount"] = splitAcc.topParentName(); qS["category"] = ((*it_split).shares().isNegative()) - ? i18n("Transfer to %1").arg(a_fullname) - : i18n("Transfer from %1").arg(a_fullname); + ? i18n("Transfer to %1").tqarg(a_fullname) + : i18n("Transfer from %1").tqarg(a_fullname); qS["institution"] = institution.isEmpty() ? i18n("No Institution") @@ -807,14 +807,14 @@ void QueryTable::constructTransactionTable(void) return; } - QDate startDate, endDate; + TQDate startDate, endDate; report.validDateRange(startDate, endDate); - QString strStartDate = startDate.toString(Qt::ISODate); - QString strEndDate = endDate.toString(Qt::ISODate); + TQString strStartDate = startDate.toString(Qt::ISODate); + TQString strEndDate = endDate.toString(Qt::ISODate); startDate = startDate.addDays(-1); - QMap::const_iterator it_account, accts_end; + TQMap::const_iterator it_account, accts_end; for (it_account = accts.begin(); it_account != accts.end(); ++it_account) { TableRow qA; @@ -827,11 +827,11 @@ void QueryTable::constructTransactionTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = account.institutionId(); + TQString institution = account.institutionId(); - // use the institution of the parent for stock accounts + // use the institution of the tqparent for stock accounts if (account.isInvest()) - institution = account.parent().institutionId(); + institution = account.tqparent().institutionId(); MyMoneyMoney startBalance, endBalance, startPrice, endPrice; MyMoneyMoney startShares, endShares; @@ -868,7 +868,7 @@ void QueryTable::constructTransactionTable(void) qA["postdate"] = strStartDate; qA["balance"] = startBalance.convert(fraction).toString(); - qA["value"] = QString(); + qA["value"] = TQString(); qA["id"] = "A"; m_rows += qA; @@ -904,8 +904,8 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow // Account, Value on , Buys, Sells, Income, Value on , Return% MyMoneyReport report = m_config; - QDate startingDate; - QDate endingDate; + TQDate startingDate; + TQDate endingDate; MyMoneyMoney price; report.validDateRange( startingDate, endingDate ); startingDate = startingDate.addDays(-1); @@ -923,11 +923,11 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow { MyMoneyTransactionFilter filter; //get the transactions for the time before the report - filter.setDateFilter(QDate(), startingDate); + filter.setDateFilter(TQDate(), startingDate); filter.addAccount(account.id()); filter.setReportAllSplits(true); - QValueList startTransactions = file->transactionList(filter); + TQValueList startTransactions = file->transactionList(filter); if(startTransactions.size() > 0) { //get the last transaction @@ -973,8 +973,8 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow report.setConsiderCategory(true); report.clearAccountFilter(); report.addAccount(account.id()); - QValueList transactions = file->transactionList( report ); - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList transactions = file->transactionList( report ); + TQValueList::const_iterator it_transaction = transactions.begin(); while ( it_transaction != transactions.end() ) { // s is the split for the stock account @@ -990,7 +990,7 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow MyMoneyMoney value = s.value() * price; - const QString& action = s.action(); + const TQString& action = s.action(); if ( action == MyMoneySplit::ActionBuyShares ) { if ( s.value().isPositive() ) { @@ -1005,8 +1005,8 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow reinvestincome += CashFlowListItem( (*it_transaction).postDate(), value ); } else if ( action == MyMoneySplit::ActionDividend || action == MyMoneySplit::ActionYield ) { // find the split with the category, which has the actual amount of the dividend - QValueList splits = (*it_transaction).splits(); - QValueList::const_iterator it_split = splits.begin(); + TQValueList splits = (*it_transaction).splits(); + TQValueList::const_iterator it_split = splits.begin(); bool found = false; while( it_split != splits.end() ) { ReportAccount acc = (*it_split).accountId(); @@ -1074,7 +1074,7 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow result["return"] = annualReturn.toString(); result["returninvestment"] = returnInvestment.toString(); } - catch (QString e) + catch (TQString e) { kdDebug(2) << e << endl; } @@ -1094,9 +1094,9 @@ void QueryTable::constructAccountTable(void) //make sure we have all subaccounts of investment accounts includeInvestmentSubAccounts(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { ReportAccount account = *it_account; @@ -1146,9 +1146,9 @@ void QueryTable::constructAccountTable(void) qaccountrow["price"] = ( netprice.reduce() ).convert(MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision())).toString(); qaccountrow["value"] = ( netprice.reduce() * shares.reduce() ).convert(fraction).toString(); - QString iid = (*it_account).institutionId(); + TQString iid = (*it_account).institutionId(); - // If an account does not have an institution, get it from the top-parent. + // If an account does not have an institution, get it from the top-tqparent. if ( iid.isEmpty() && ! account.isTopLevel() ) { ReportAccount topaccount = account.topParent(); @@ -1169,7 +1169,7 @@ void QueryTable::constructAccountTable(void) constructPerformanceRow( account, qaccountrow ); } else - qaccountrow["equitytype"] = QString(); + qaccountrow["equitytype"] = TQString(); // don't add the account if it is closed. In fact, the business logic // should prevent that an account can be closed with a balance not equal @@ -1194,14 +1194,14 @@ void QueryTable::constructSplitsTable(void) report.setConsiderCategory(true); // support for opening and closing balances - QMap accts; + TQMap accts; //get all transactions for this report - QValueList transactions = file->transactionList(report); - for (QValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { + TQValueList transactions = file->transactionList(report); + for (TQValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { TableRow qA, qS; - QDate pd; + TQDate pd; qA["id"] = qS["id"] = (* it_transaction).id(); qA["entrydate"] = qS["entrydate"] = (* it_transaction).entryDate().toString(Qt::ISODate); @@ -1209,8 +1209,8 @@ void QueryTable::constructSplitsTable(void) qA["commodity"] = qS["commodity"] = (* it_transaction).commodity(); pd = (* it_transaction).postDate(); - qA["month"] = qS["month"] = i18n("Month of %1").arg(QDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); - qA["week"] = qS["week"] = i18n("Week of %1").arg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); + qA["month"] = qS["month"] = i18n("Month of %1").tqarg(TQDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); + qA["week"] = qS["week"] = i18n("Week of %1").tqarg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); qA["currency"] = qS["currency"] = ""; @@ -1226,8 +1226,8 @@ void QueryTable::constructSplitsTable(void) // that is not an income or expense account if there is no stock or loan account) // to be the account (qA) that will have the sub-item "split" entries. we add // one transaction entry (qS) for each subsequent entry in the split. - const QValueList& splits = (*it_transaction).splits(); - QValueList::const_iterator myBegin, it_split; + const TQValueList& splits = (*it_transaction).splits(); + TQValueList::const_iterator myBegin, it_split; //S_end = splits.end(); for (it_split = splits.begin(), myBegin = splits.end(); it_split != splits.end(); ++it_split) { @@ -1266,7 +1266,7 @@ void QueryTable::constructSplitsTable(void) // reference (loan) account (qA). however, we process the matching // split entries (qS) normally. bool loan_special_case = false; - if(m_config.queryColumns() & MyMoneyReport::eQCloan) { + if(m_config.queryColumns() & MyMoneyReport::eTQCloan) { ReportAccount splitAcc = (*it_split).accountId(); loan_special_case = splitAcc.isLoan(); } @@ -1276,8 +1276,8 @@ void QueryTable::constructSplitsTable(void) bool include_me = true; bool transaction_text = false; //indicates whether a text should be considered as a match for the transaction or for a split only - QString a_fullname = ""; - QString a_memo = ""; + TQString a_fullname = ""; + TQString a_memo = ""; unsigned int pass = 1; do { @@ -1291,8 +1291,8 @@ void QueryTable::constructSplitsTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = splitAcc.institutionId(); - QString payee = (*it_split).payeeId(); + TQString institution = splitAcc.institutionId(); + TQString payee = (*it_split).payeeId(); if ( m_config.isConvertCurrency() ) { xr = (splitAcc.deepCurrencyPrice((*it_transaction).postDate()) * splitAcc.baseCurrencyPrice((*it_transaction).postDate())).reduce(); @@ -1308,8 +1308,8 @@ void QueryTable::constructSplitsTable(void) if (splitAcc.isInvest()) { - // use the institution of the parent for stock accounts - institution = splitAcc.parent().institutionId(); + // use the institution of the tqparent for stock accounts + institution = splitAcc.tqparent().institutionId(); MyMoneyMoney shares = (*it_split).shares(); qA["action"] = (*it_split).action(); @@ -1319,7 +1319,7 @@ void QueryTable::constructSplitsTable(void) if (((*it_split).action() == MyMoneySplit::ActionBuyShares) && (*it_split).shares().isNegative()) qA["action"] = "Sell"; - qA["investaccount"] = splitAcc.parent().name(); + qA["investaccount"] = splitAcc.tqparent().name(); } include_me = m_config.includes(splitAcc); @@ -1364,8 +1364,8 @@ void QueryTable::constructSplitsTable(void) //fill in account information if (! splitAcc.isIncomeExpense() && it_split != myBegin) { qA["account"] = ((*it_split).shares().isNegative()) ? - i18n("Transfer to %1").arg(myBeginAcc.fullName()) - : i18n("Transfer from %1").arg(myBeginAcc.fullName()); + i18n("Transfer to %1").tqarg(myBeginAcc.fullName()) + : i18n("Transfer from %1").tqarg(myBeginAcc.fullName()); } else if (it_split == myBegin ) { //handle the main split if((splits.count() > 2)) { @@ -1373,7 +1373,7 @@ void QueryTable::constructSplitsTable(void) qA["account"] = i18n("[Split Transaction]"); } else { //fill the account name of the second split - QValueList::const_iterator tempSplit = splits.begin(); + TQValueList::const_iterator tempSplit = splits.begin(); //there are supposed to be only 2 splits if we ever get here if(tempSplit == myBegin && splits.count() > 1) @@ -1383,8 +1383,8 @@ void QueryTable::constructSplitsTable(void) ReportAccount tempSplitAcc = (*tempSplit).accountId(); if (! tempSplitAcc.isIncomeExpense()) { qA["account"] = ((*it_split).shares().isNegative()) ? - i18n("Transfer to %1").arg(tempSplitAcc.fullName()) - : i18n("Transfer from %1").arg(tempSplitAcc.fullName()); + i18n("Transfer to %1").tqarg(tempSplitAcc.fullName()) + : i18n("Transfer from %1").tqarg(tempSplitAcc.fullName()); } else { qA["account"] = tempSplitAcc.fullName(); } @@ -1439,14 +1439,14 @@ void QueryTable::constructSplitsTable(void) return; } - QDate startDate, endDate; + TQDate startDate, endDate; report.validDateRange(startDate, endDate); - QString strStartDate = startDate.toString(Qt::ISODate); - QString strEndDate = endDate.toString(Qt::ISODate); + TQString strStartDate = startDate.toString(Qt::ISODate); + TQString strEndDate = endDate.toString(Qt::ISODate); startDate = startDate.addDays(-1); - QMap::const_iterator it_account, accts_end; + TQMap::const_iterator it_account, accts_end; for (it_account = accts.begin(); it_account != accts.end(); ++it_account) { TableRow qA; @@ -1459,11 +1459,11 @@ void QueryTable::constructSplitsTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = account.institutionId(); + TQString institution = account.institutionId(); - // use the institution of the parent for stock accounts + // use the institution of the tqparent for stock accounts if (account.isInvest()) - institution = account.parent().institutionId(); + institution = account.tqparent().institutionId(); MyMoneyMoney startBalance, endBalance, startPrice, endPrice; MyMoneyMoney startShares, endShares; @@ -1500,7 +1500,7 @@ void QueryTable::constructSplitsTable(void) qA["postdate"] = strStartDate; qA["balance"] = startBalance.convert(fraction).toString(); - qA["value"] = QString(); + qA["value"] = TQString(); qA["id"] = "A"; m_rows += qA; diff --git a/kmymoney2/reports/querytable.h b/kmymoney2/reports/querytable.h index 7beb3d4..e1b3918 100644 --- a/kmymoney2/reports/querytable.h +++ b/kmymoney2/reports/querytable.h @@ -23,13 +23,13 @@ * * ***************************************************************************/ -#ifndef QUERYTABLE_H -#define QUERYTABLE_H +#ifndef TQUERYTABLE_H +#define TQUERYTABLE_H // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -79,25 +79,25 @@ class CashFlowListItem { public: CashFlowListItem(void) {} - CashFlowListItem( const QDate& _date, const MyMoneyMoney& _value ): m_date(_date), m_value(_value) {} + CashFlowListItem( const TQDate& _date, const MyMoneyMoney& _value ): m_date(_date), m_value(_value) {} bool operator<( const CashFlowListItem _second ) const { return m_date < _second.m_date; } bool operator<=( const CashFlowListItem _second ) const { return m_date <= _second.m_date; } bool operator>( const CashFlowListItem _second ) const { return m_date > _second.m_date; } - const QDate& date( void ) const { return m_date; } + const TQDate& date( void ) const { return m_date; } const MyMoneyMoney& value( void ) const { return m_value; } MyMoneyMoney NPV( double _rate ) const; - static void setToday( const QDate& _today ) { m_sToday = _today; } - const QDate& today( void ) const { return m_sToday; } + static void setToday( const TQDate& _today ) { m_sToday = _today; } + const TQDate& today( void ) const { return m_sToday; } private: - QDate m_date; + TQDate m_date; MyMoneyMoney m_value; - static QDate m_sToday; + static TQDate m_sToday; }; -class CashFlowList: public QValueList +class CashFlowList: public TQValueList { public: CashFlowList(void) {} @@ -139,4 +139,4 @@ class CashFlowList: public QValueList } -#endif // QUERYREPORT_H +#endif // TQUERYREPORT_H diff --git a/kmymoney2/reports/querytabletest.cpp b/kmymoney2/reports/querytabletest.cpp index 8b3c579..73ab69d 100644 --- a/kmymoney2/reports/querytabletest.cpp +++ b/kmymoney2/reports/querytabletest.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include "reportstestcommon.h" #define private public -#include "querytable.h" +#include "tquerytable.h" #undef private #include "../mymoney/mymoneyaccount.h" @@ -56,7 +56,7 @@ void QueryTableTest::setUp () { MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -69,13 +69,13 @@ void QueryTableTest::setUp () { acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acTax = makeAccount(QString("Tax"), MyMoneyAccount::Expense,0,QDate(2005,1,11),acExpense, "", true); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acTax = makeAccount(TQString("Tax"), MyMoneyAccount::Expense,0,TQDate(2005,1,11),acExpense, "", true); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); @@ -93,26 +93,26 @@ void QueryTableTest::testQueryBasics() { try { - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); unsigned cols; MyMoneyReport filter; filter.setRowType( MyMoneyReport::eCategory ); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount; filter.setQueryColumns( static_cast(cols) ); // filter.setName("Transactions by Category"); XMLandback(filter); @@ -120,7 +120,7 @@ void QueryTableTest::testQueryBasics() writeTabletoHTML(qtbl_1,"Transactions by Category.html"); - QValueList rows = qtbl_1.rows(); + TQValueList rows = qtbl_1.rows(); CPPUNIT_ASSERT(rows.count() == 12); CPPUNIT_ASSERT(rows[0]["categorytype"]=="Expense"); @@ -130,14 +130,14 @@ void QueryTableTest::testQueryBasics() CPPUNIT_ASSERT(rows[11]["category"]=="Solo"); CPPUNIT_ASSERT(rows[11]["postdate"]=="2005-01-01"); - QString html = qtbl_1.renderHTML(); + TQString html = qtbl_1.renderHTML(); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Parent") == -(moParent1 + moParent2) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Parent: Child") == -(moChild) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Solo") == -(moSolo) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen ); filter.setRowType( MyMoneyReport::eTopCategory ); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount; filter.setQueryColumns( static_cast(cols) ); // filter.setName("Transactions by Top Category"); XMLandback(filter); @@ -166,7 +166,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::eAccount ); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_3(filter); @@ -200,7 +200,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::ePayee ); filter.setName("Transactions by Payee"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCmemo | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_4(filter); @@ -226,7 +226,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::eMonth ); filter.setName("Transactions by Month"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_5(filter); @@ -254,7 +254,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::eWeek ); filter.setName("Transactions by Week"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_6(filter); @@ -311,23 +311,23 @@ void QueryTableTest::testCashFlowAnalysis() CashFlowList list; - list += CashFlowListItem( QDate(2004,5,3),1000.0 ); - list += CashFlowListItem( QDate(2004,5,20),59.0 ); - list += CashFlowListItem( QDate(2004,6,3),14.0 ); - list += CashFlowListItem( QDate(2004,6,24),92.0 ); - list += CashFlowListItem( QDate(2004,7,6),63.0 ); - list += CashFlowListItem( QDate(2004,7,25),15.0 ); - list += CashFlowListItem( QDate(2004,8,5),92.0 ); - list += CashFlowListItem( QDate(2004,9,2),18.0 ); - list += CashFlowListItem( QDate(2004,9,21),5.0 ); - list += CashFlowListItem( QDate(2004,10,16),-2037.0 ); + list += CashFlowListItem( TQDate(2004,5,3),1000.0 ); + list += CashFlowListItem( TQDate(2004,5,20),59.0 ); + list += CashFlowListItem( TQDate(2004,6,3),14.0 ); + list += CashFlowListItem( TQDate(2004,6,24),92.0 ); + list += CashFlowListItem( TQDate(2004,7,6),63.0 ); + list += CashFlowListItem( TQDate(2004,7,25),15.0 ); + list += CashFlowListItem( TQDate(2004,8,5),92.0 ); + list += CashFlowListItem( TQDate(2004,9,2),18.0 ); + list += CashFlowListItem( TQDate(2004,9,21),5.0 ); + list += CashFlowListItem( TQDate(2004,10,16),-2037.0 ); MyMoneyMoney IRR(list.IRR(),1000); CPPUNIT_ASSERT( IRR == MyMoneyMoney(1676,1000) ); list.pop_back(); - list += CashFlowListItem( QDate(2004,10,16),-1358.0 ); + list += CashFlowListItem( TQDate(2004,10,16),-1358.0 ); IRR = MyMoneyMoney( list.IRR(), 1000 ); @@ -338,7 +338,7 @@ void QueryTableTest::testAccountQuery() { try { - QString htmlcontext = QString("\n\n%1\n\n"); + TQString htmlcontext = TQString("\n\n%1\n\n"); // // No transactions, opening balances only @@ -352,7 +352,7 @@ void QueryTableTest::testAccountQuery() writeTabletoHTML(qtbl_1,"Accounts by Institution (No transactions).html"); - QValueList rows = qtbl_1.rows(); + TQValueList rows = qtbl_1.rows(); CPPUNIT_ASSERT(rows.count() == 2); CPPUNIT_ASSERT(rows[0]["account"]=="Checking Account"); @@ -362,7 +362,7 @@ void QueryTableTest::testAccountQuery() CPPUNIT_ASSERT(MyMoneyMoney(rows[1]["value"])==moCreditOpen); CPPUNIT_ASSERT(rows[1]["equitytype"].isEmpty()); - QString html = qtbl_1.renderHTML(); + TQString html = qtbl_1.renderHTML(); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" None") == moCheckingOpen+moCreditOpen ); CPPUNIT_ASSERT( searchHTML(html,i18n("Grand Total")) == moCheckingOpen+moCreditOpen ); @@ -370,20 +370,20 @@ void QueryTableTest::testAccountQuery() // Adding in transactions // - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); filter.setRowType( MyMoneyReport::eInstitution ); filter.setName("Accounts by Institution (With Transactions)"); @@ -439,25 +439,25 @@ void QueryTableTest::testInvestment(void) eqStock2 = makeEquity("Stock2","STK2"); // Accounts - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset); - acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock1); - acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock2); - acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); - acInterest = makeAccount("Interest",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset); + acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock1); + acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock2); + acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); + acInterest = makeAccount("Interest",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); // Transactions // Date Action Shares Price Stock Asset Income - InvTransactionHelper s1b1( QDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1b2( QDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s1( QDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s2( QDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1r1( QDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1r2( QDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1c1( QDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1c2( QDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1y1( QDate(2004,9,15), MyMoneySplit::ActionYield, 10.00, 110.00, acStock1, acChecking, acInterest ); - - makeEquityPrice( eqStock1, QDate(2004,10,1), 100.00 ); + InvTransactionHelper s1b1( TQDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1b2( TQDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s1( TQDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s2( TQDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1r1( TQDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1r2( TQDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1c1( TQDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1c2( TQDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1y1( TQDate(2004,9,15), MyMoneySplit::ActionYield, 10.00, 110.00, acStock1, acChecking, acInterest ); + + makeEquityPrice( eqStock1, TQDate(2004,10,1), 100.00 ); // // Investment Transactions Report @@ -465,13 +465,13 @@ void QueryTableTest::testInvestment(void) MyMoneyReport invtran_r( MyMoneyReport::eTopAccount, - MyMoneyReport::eQCaction|MyMoneyReport::eQCshares|MyMoneyReport::eQCprice, + MyMoneyReport::eTQCaction|MyMoneyReport::eTQCshares|MyMoneyReport::eTQCprice, MyMoneyTransactionFilter::userDefined, MyMoneyReport::eDetailAll, i18n("Investment Transactions"), i18n("Test Report") ); - invtran_r.setDateFilter(QDate(2004,1,1),QDate(2004,12,31)); + invtran_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,12,31)); invtran_r.setInvestmentsOnly(true); XMLandback(invtran_r); QueryTable invtran(invtran_r); @@ -479,7 +479,7 @@ void QueryTableTest::testInvestment(void) #if 1 writeTabletoHTML(invtran,"investment_transactions_test.html"); - QValueList rows = invtran.rows(); + TQValueList rows = invtran.rows(); CPPUNIT_ASSERT(rows.count()==17); CPPUNIT_ASSERT(MyMoneyMoney(rows[1]["value"])==MyMoneyMoney(100000.00)); @@ -541,7 +541,7 @@ void QueryTableTest::testInvestment(void) CPPUNIT_ASSERT(rows[8]["action"]=="Yield"); #endif - QString html = invtran.renderHTML(); + TQString html = invtran.renderHTML(); #if 1 // i think this is the correct amount. different treatment of dividend and yield CPPUNIT_ASSERT( searchHTML(html,i18n("Total Stock 1")) == MyMoneyMoney(175000.00) ); @@ -557,13 +557,13 @@ void QueryTableTest::testInvestment(void) MyMoneyReport invhold_r( MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::eTQCperformance, MyMoneyTransactionFilter::userDefined, MyMoneyReport::eDetailAll, i18n("Investment Performance by Account"), i18n("Test Report") ); - invhold_r.setDateFilter(QDate(2004,1,1),QDate(2004,10,1)); + invhold_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,10,1)); invhold_r.setInvestmentsOnly(true); XMLandback(invhold_r); QueryTable invhold(invhold_r); @@ -587,7 +587,7 @@ void QueryTableTest::testInvestment(void) #if 0 // Dump file & reports - QFile g( "investmentkmy.xml" ); + TQFile g( "investmentkmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -611,20 +611,20 @@ void QueryTableTest::testInvestment(void) { try { - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); unsigned cols; @@ -632,25 +632,25 @@ void QueryTableTest::testInvestment(void) filter.setRowType( MyMoneyReport::eAccount ); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory | MyMoneyReport::eTQCbalance; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_3(filter); writeTabletoHTML(qtbl_3,"Transactions by Account.html"); - QString html = qtbl_3.renderHTML(); + TQString html = qtbl_3.renderHTML(); - QValueList rows = qtbl_3.rows(); + TQValueList rows = qtbl_3.rows(); CPPUNIT_ASSERT(rows.count() == 16); //this is to make sure that the dates of closing and opening balances and the balance numbers are ok - QString openingDate = KGlobal::locale()->formatDate(QDate(2004,1,1), true); - QString closingDate = KGlobal::locale()->formatDate(QDate(2005,9,1), true); - CPPUNIT_ASSERT( html.find(openingDate + ""+i18n("Opening Balance")) > 0); - CPPUNIT_ASSERT( html.find(closingDate + ""+i18n("Closing Balance")+" -702.36") > 0); - CPPUNIT_ASSERT( html.find(closingDate + ""+i18n("Closing Balance")+" -705.69") > 0); + TQString openingDate = KGlobal::locale()->formatDate(TQDate(2004,1,1), true); + TQString closingDate = KGlobal::locale()->formatDate(TQDate(2005,9,1), true); + CPPUNIT_ASSERT( html.tqfind(openingDate + ""+i18n("Opening Balance")) > 0); + CPPUNIT_ASSERT( html.tqfind(closingDate + ""+i18n("Closing Balance")+" -702.36") > 0); + CPPUNIT_ASSERT( html.tqfind(closingDate + ""+i18n("Closing Balance")+" -705.69") > 0); } catch(MyMoneyException *e) @@ -664,15 +664,15 @@ void QueryTableTest::testInvestment(void) void QueryTableTest::testTaxReport() { try { - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax ); unsigned cols; MyMoneyReport filter; filter.setRowType( MyMoneyReport::eCategory ); filter.setName("Tax Transactions"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount; filter.setQueryColumns( static_cast(cols) ); filter.setTax(true); @@ -681,9 +681,9 @@ void QueryTableTest::testTaxReport() writeTabletoHTML(qtbl_3,"Tax Transactions.html"); - QValueList rows = qtbl_3.rows(); + TQValueList rows = qtbl_3.rows(); - QString html = qtbl_3.renderHTML(); + TQString html = qtbl_3.renderHTML(); CPPUNIT_ASSERT(rows.count() == 1); } catch(MyMoneyException *e) { CPPUNIT_FAIL(e->what()); diff --git a/kmymoney2/reports/querytabletest.h b/kmymoney2/reports/querytabletest.h index 36f3075..af5ae4b 100644 --- a/kmymoney2/reports/querytabletest.h +++ b/kmymoney2/reports/querytabletest.h @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef QUERYTABLETEST_H -#define QUERYTABLETEST_H +#ifndef TQUERYTABLETEST_H +#define TQUERYTABLETEST_H #include #include "../mymoney/mymoneyfile.h" diff --git a/kmymoney2/reports/reportaccount.cpp b/kmymoney2/reports/reportaccount.cpp index 5f7e7f8..d38727d 100644 --- a/kmymoney2/reports/reportaccount.cpp +++ b/kmymoney2/reports/reportaccount.cpp @@ -52,11 +52,11 @@ ReportAccount::ReportAccount( const ReportAccount& copy ): DEBUG_ENTER(__PRETTY_FUNCTION__); } -ReportAccount::ReportAccount( const QString& accountid ): +ReportAccount::ReportAccount( const TQString& accountid ): MyMoneyAccount( MyMoneyFile::instance()->account(accountid) ) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("Account %1").arg(accountid)); + DEBUG_OUTPUT(TQString("Account %1").tqarg(accountid)); calculateAccountHierarchy(); } @@ -64,7 +64,7 @@ ReportAccount::ReportAccount( const MyMoneyAccount& account ): MyMoneyAccount( account ) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("Account %1").arg(account.id())); + DEBUG_OUTPUT(TQString("Account %1").tqarg(account.id())); calculateAccountHierarchy(); } @@ -73,21 +73,21 @@ void ReportAccount::calculateAccountHierarchy( void ) DEBUG_ENTER(__PRETTY_FUNCTION__); MyMoneyFile* file = MyMoneyFile::instance(); - QString resultid = id(); - QString parentid = parentAccountId(); + TQString resultid = id(); + TQString tqparentid = tqparentAccountId(); #ifdef DEBUG_HIDE_SENSITIVE m_nameHierarchy.prepend(file->account(resultid).id()); #else m_nameHierarchy.prepend(file->account(resultid).name()); #endif - while (!file->isStandardAccount(parentid)) + while (!file->isStandardAccount(tqparentid)) { - // take on the identity of our parent - resultid = parentid; + // take on the identity of our tqparent + resultid = tqparentid; // and try again - parentid = file->account(resultid).parentAccountId(); + tqparentid = file->account(resultid).tqparentAccountId(); #ifdef DEBUG_HIDE_SENSITIVE m_nameHierarchy.prepend(file->account(resultid).id()); #else @@ -96,7 +96,7 @@ void ReportAccount::calculateAccountHierarchy( void ) } } -MyMoneyMoney ReportAccount::deepCurrencyPrice( const QDate& date ) const +MyMoneyMoney ReportAccount::deepCurrencyPrice( const TQDate& date ) const { DEBUG_ENTER(__PRETTY_FUNCTION__); @@ -111,25 +111,25 @@ MyMoneyMoney ReportAccount::deepCurrencyPrice( const QDate& date ) const { result = price.rate(undersecurity.tradingCurrency()); - DEBUG_OUTPUT(QString("Converting under %1 to deep %2, price on %3 is %4") - .arg(undersecurity.name()) - .arg(file->security(undersecurity.tradingCurrency()).name()) - .arg(date.toString()) - .arg(result.toDouble())); + DEBUG_OUTPUT(TQString("Converting under %1 to deep %2, price on %3 is %4") + .tqarg(undersecurity.name()) + .tqarg(file->security(undersecurity.tradingCurrency()).name()) + .tqarg(date.toString()) + .tqarg(result.toDouble())); } else { - DEBUG_OUTPUT(QString("No price to convert under %1 to deep %2 on %3") - .arg(undersecurity.name()) - .arg(file->security(undersecurity.tradingCurrency()).name()) - .arg(date.toString())); + DEBUG_OUTPUT(TQString("No price to convert under %1 to deep %2 on %3") + .tqarg(undersecurity.name()) + .tqarg(file->security(undersecurity.tradingCurrency()).name()) + .tqarg(date.toString())); } } return result; } -MyMoneyMoney ReportAccount::baseCurrencyPrice( const QDate& date ) const +MyMoneyMoney ReportAccount::baseCurrencyPrice( const TQDate& date ) const { // Note that whether or not the user chooses to convert to base currency, all the values // for a given account/category are converted to the currency for THAT account/category @@ -156,7 +156,7 @@ MyMoneyMoney ReportAccount::baseCurrencyPrice( const QDate& date ) const return result; } -MyMoneyMoney ReportAccount::foreignCurrencyPrice( const QString foreignCurrency, const QDate& date ) const +MyMoneyMoney ReportAccount::foreignCurrencyPrice( const TQString foreignCurrency, const TQDate& date ) const { DEBUG_ENTER(__PRETTY_FUNCTION__); @@ -166,7 +166,7 @@ MyMoneyMoney ReportAccount::foreignCurrencyPrice( const QString foreignCurrency, MyMoneySecurity security = file->security(foreignCurrency); //check whether it is a currency or a commodity. In the latter case case, get the trading currency - QString tradingCurrency; + TQString tradingCurrency; if(security.isCurrency()) { tradingCurrency = foreignCurrency; } else { @@ -180,18 +180,18 @@ MyMoneyMoney ReportAccount::foreignCurrencyPrice( const QString foreignCurrency, if(price.isValid()) { result = price.rate(tradingCurrency); - DEBUG_OUTPUT(QString("Converting deep %1 to currency %2, price on %3 is %4") - .arg(file->currency(currency().id()).name()) - .arg(file->currency(foreignCurrency).name()) - .arg(date.toString()) - .arg(result.toDouble())); + DEBUG_OUTPUT(TQString("Converting deep %1 to currency %2, price on %3 is %4") + .tqarg(file->currency(currency().id()).name()) + .tqarg(file->currency(foreignCurrency).name()) + .tqarg(date.toString()) + .tqarg(result.toDouble())); } else { - DEBUG_OUTPUT(QString("No price to convert deep %1 to currency %2 on %3") - .arg(file->currency(currency().id()).name()) - .arg(file->currency(foreignCurrency).name()) - .arg(date.toString())); + DEBUG_OUTPUT(TQString("No price to convert deep %1 to currency %2 on %3") + .tqarg(file->currency(currency().id()).name()) + .tqarg(file->currency(foreignCurrency).name()) + .tqarg(date.toString())); } } return result; @@ -232,8 +232,8 @@ bool ReportAccount::operator<(const ReportAccount& second) const bool result = false; bool haveresult = false; - QStringList::const_iterator it_first = m_nameHierarchy.begin(); - QStringList::const_iterator it_second = second.m_nameHierarchy.begin(); + TQStringList::const_iterator it_first = m_nameHierarchy.begin(); + TQStringList::const_iterator it_second = second.m_nameHierarchy.begin(); while ( it_first != m_nameHierarchy.end() ) { // The first string is longer than the second, but otherwise identical @@ -265,7 +265,7 @@ bool ReportAccount::operator<(const ReportAccount& second) const if ( !haveresult && ( it_second != second.m_nameHierarchy.end() ) ) result = true; -// DEBUG_OUTPUT(QString("%1 < %2 is %3").arg(debugName(),second.debugName()).arg(result)); +// DEBUG_OUTPUT(TQString("%1 < %2 is %3").tqarg(debugName(),second.debugName()).tqarg(result)); return result; } @@ -274,21 +274,21 @@ bool ReportAccount::operator<(const ReportAccount& second) const * method only returns the last name in the list, which is the engine name] * of this account. * - * @return QString The account's name + * @return TQString The account's name */ -QString ReportAccount::name( void ) const +TQString ReportAccount::name( void ) const { return m_nameHierarchy.back(); } // MyMoneyAccount:fullHierarchyDebug() -QString ReportAccount::debugName( void ) const +TQString ReportAccount::debugName( void ) const { return m_nameHierarchy.join("|"); } // MyMoneyAccount:fullHierarchy() -QString ReportAccount::fullName( void ) const +TQString ReportAccount::fullName( void ) const { return m_nameHierarchy.join(": "); } @@ -305,9 +305,9 @@ unsigned ReportAccount::hierarchyDepth( void ) const return ( m_nameHierarchy.size() ); } -ReportAccount ReportAccount::parent( void ) const +ReportAccount ReportAccount::tqparent( void ) const { - return ReportAccount( parentAccountId() ); + return ReportAccount( tqparentAccountId() ); } ReportAccount ReportAccount::topParent( void ) const @@ -315,22 +315,22 @@ ReportAccount ReportAccount::topParent( void ) const DEBUG_ENTER(__PRETTY_FUNCTION__); MyMoneyFile* file = MyMoneyFile::instance(); - QString resultid = id(); - QString parentid = parentAccountId(); + TQString resultid = id(); + TQString tqparentid = tqparentAccountId(); - while (!file->isStandardAccount(parentid)) + while (!file->isStandardAccount(tqparentid)) { - // take on the identity of our parent - resultid = parentid; + // take on the identity of our tqparent + resultid = tqparentid; // and try again - parentid = file->account(resultid).parentAccountId(); + tqparentid = file->account(resultid).tqparentAccountId(); } return ReportAccount( resultid ); } -QString ReportAccount::topParentName( void ) const +TQString ReportAccount::topParentName( void ) const { return m_nameHierarchy.first(); } diff --git a/kmymoney2/reports/reportaccount.h b/kmymoney2/reports/reportaccount.h index e07f9b1..91db6a2 100644 --- a/kmymoney2/reports/reportaccount.h +++ b/kmymoney2/reports/reportaccount.h @@ -22,7 +22,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,20 +54,20 @@ namespace reports { class ReportAccount: public MyMoneyAccount { private: - QStringList m_nameHierarchy; + TQStringList m_nameHierarchy; public: /** * Default constructor * - * Needed to allow this object to be stored in a QMap. + * Needed to allow this object to be stored in a TQMap. */ ReportAccount( void ); /** * Copy constructor * - * Needed to allow this object to be stored in a QMap. + * Needed to allow this object to be stored in a TQMap. */ ReportAccount( const ReportAccount& ); @@ -76,7 +76,7 @@ public: * * @param accountid Account which this account descriptor should be based off of */ - ReportAccount( const QString& accountid ); + ReportAccount( const TQString& accountid ); /** * Regular constructor @@ -110,7 +110,7 @@ public: * @param date The date in question * @return MyMoneyMoney The value of the account's currency on that date */ - MyMoneyMoney deepCurrencyPrice( const QDate& date ) const; + MyMoneyMoney deepCurrencyPrice( const TQDate& date ) const; /** * Returns the price of this account's deep currency on the indicated date, @@ -119,7 +119,7 @@ public: * @param date The date in question * @return MyMoneyMoney The value of the account's currency on that date */ - MyMoneyMoney baseCurrencyPrice( const QDate& date ) const; + MyMoneyMoney baseCurrencyPrice( const TQDate& date ) const; /** * Returns the price of this account's deep currency on the indicated date, @@ -129,7 +129,7 @@ public: * @param date The date in question * @return MyMoneyMoney The value of the account's currency on that date */ - MyMoneyMoney foreignCurrencyPrice( const QString foreignCurrency, const QDate& date ) const; + MyMoneyMoney foreignCurrencyPrice( const TQString foreignCurrency, const TQDate& date ) const; /** * Fetch the trading symbol of this account's deep currency @@ -151,9 +151,9 @@ public: * method only returns the last name in the list, which is the engine name] * of this account. * - * @return QString The account's name + * @return TQString The account's name */ - QString name( void ) const; + TQString name( void ) const; /** * The entire hierarchy of this account descriptor @@ -161,52 +161,52 @@ public: * to always look pretty, while fullName() is. So if the user is ever * going to see the results, use fullName(). * - * @return QString The account's full hierarchy + * @return TQString The account's full hierarchy */ - QString fullName( void ) const; + TQString fullName( void ) const; /** * The entire hierarchy of this account descriptor, suitable for displaying * in debugging output * - * @return QString The account's full hierarchy (suitable for debugging) + * @return TQString The account's full hierarchy (suitable for debugging) */ - QString debugName( void ) const; + TQString debugName( void ) const; /** - * Whether this account is a 'top level' parent account. This means that - * it's parent is an account class, like asset, liability, expense or income + * Whether this account is a 'top level' tqparent account. This means that + * it's tqparent is an account class, like asset, liability, expense or income * - * @return bool True if this account is a top level parent account + * @return bool True if this account is a top level tqparent account */ /*inline*/ bool isTopLevel( void ) const; /** - * Returns the name of the top level parent account + * Returns the name of the top level tqparent account * - * (See isTopLevel for a definition of 'top level parent') + * (See isTopLevel for a definition of 'top level tqparent') * - * @return QString The name of the top level parent account + * @return TQString The name of the top level tqparent account */ - /*inline*/ QString topParentName( void ) const; + /*inline*/ TQString topParentName( void ) const; /** - * Returns a report account containing the top parent account + * Returns a report account containing the top tqparent account * - * @return ReportAccount The account of the top parent + * @return ReportAccount The account of the top tqparent */ ReportAccount topParent( void ) const; /** - * Returns a report account containing the immediate parent account + * Returns a report account containing the immediate tqparent account * - * @return ReportAccount The account of the immediate parent + * @return ReportAccount The account of the immediate tqparent */ - ReportAccount parent( void ) const; + ReportAccount tqparent( void ) const; /** * Returns the number of accounts in this account's hierarchy. If this is a - * Top Category, it returns 1. If it's parent is a Top Category, returns 2, + * Top Category, it returns 1. If it's tqparent is a Top Category, returns 2, * etc. * * @return unsigned Hierarchy depth diff --git a/kmymoney2/reports/reportdebug.h b/kmymoney2/reports/reportdebug.h index 3a95465..2e822d0 100644 --- a/kmymoney2/reports/reportdebug.h +++ b/kmymoney2/reports/reportdebug.h @@ -49,7 +49,7 @@ namespace reports { #define DEBUG_ENABLE(x) Debug::enable(x) #define DEBUG_ENABLE_KEY(x) Debug::setEnableKey(x) #ifdef DEBUG_HIDE_SENSITIVE -#define DEBUG_SENSITIVE(x) QString("hidden") +#define DEBUG_SENSITIVE(x) TQString("hidden") #else #define DEBUG_SENSITIVE(x) (x) #endif @@ -65,17 +65,17 @@ namespace reports { class Debug { - QString m_methodName; - static QString m_sTabs; + TQString m_methodName; + static TQString m_sTabs; static bool m_sEnabled; bool m_enabled; - static QString m_sEnableKey; + static TQString m_sEnableKey; public: - Debug( const QString& _name ); + Debug( const TQString& _name ); ~Debug(); - void output( const QString& _text ); + void output( const TQString& _text ); static void enable( bool _e ) { m_sEnabled = _e; } - static void setEnableKey( const QString& _s ) { m_sEnableKey = _s; } + static void setEnableKey( const TQString& _s ) { m_sEnableKey = _s; } }; } // end namespace reports diff --git a/kmymoney2/reports/reportstestcommon.cpp b/kmymoney2/reports/reportstestcommon.cpp index 31e6c1d..7d42abc 100644 --- a/kmymoney2/reports/reportstestcommon.cpp +++ b/kmymoney2/reports/reportstestcommon.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -31,7 +31,7 @@ #define private public #include "pivottable.h" -#include "querytable.h" +#include "tquerytable.h" #undef private using namespace reports; @@ -58,35 +58,35 @@ const MyMoneyMoney moChild(14.00); const MyMoneyMoney moThomas(5.11); const MyMoneyMoney moNoPayee(8944.70); -QString acAsset; -QString acLiability; -QString acExpense; -QString acIncome; -QString acChecking; -QString acCredit; -QString acSolo; -QString acParent; -QString acChild; -QString acSecondChild; -QString acGrandChild1; -QString acGrandChild2; -QString acForeign; -QString acCanChecking; -QString acJpyChecking; -QString acCanCash; -QString acJpyCash; -QString inBank; -QString eqStock1; -QString eqStock2; -QString acInvestment; -QString acStock1; -QString acStock2; -QString acDividends; -QString acInterest; -QString acTax; -QString acCash; - -TransactionHelper::TransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _value, const QString& _accountid, const QString& _categoryid, const QString& _currencyid, const QString& _payee ) +TQString acAsset; +TQString acLiability; +TQString acExpense; +TQString acIncome; +TQString acChecking; +TQString acCredit; +TQString acSolo; +TQString acParent; +TQString acChild; +TQString acSecondChild; +TQString acGrandChild1; +TQString acGrandChild2; +TQString acForeign; +TQString acCanChecking; +TQString acJpyChecking; +TQString acCanCash; +TQString acJpyCash; +TQString inBank; +TQString eqStock1; +TQString eqStock2; +TQString acInvestment; +TQString acStock1; +TQString acStock2; +TQString acDividends; +TQString acInterest; +TQString acTax; +TQString acCash; + +TransactionHelper::TransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _value, const TQString& _accountid, const TQString& _categoryid, const TQString& _currencyid, const TQString& _payee ) { // _currencyid is the currency of the transaction, and of the _value // both the account and category can have their own currency (athough the category having @@ -100,7 +100,7 @@ TransactionHelper::TransactionHelper( const QDate& _date, const QString& _action MyMoneyFileTransaction ft; setPostDate(_date); - QString currencyid = _currencyid; + TQString currencyid = _currencyid; if ( currencyid.isEmpty() ) currencyid=MyMoneyFile::instance()->baseCurrency().id(); setCommodity(currencyid); @@ -144,12 +144,12 @@ void TransactionHelper::update(void) ft.commit(); } -InvTransactionHelper::InvTransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ) +InvTransactionHelper::InvTransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ) { init(_date, _action, _shares, _price, _stockaccountid, _transferid, _categoryid); } -void InvTransactionHelper::init( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ) +void InvTransactionHelper::init( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount stockaccount = file->account(_stockaccountid); @@ -216,8 +216,8 @@ void InvTransactionHelper::init( const QDate& _date, const QString& _action, MyM //kdDebug(2) << "updating price..." << endl; // update the price, while we're here - QString stockid = stockaccount.currencyId(); - QString basecurrencyid = file->baseCurrency().id(); + TQString stockid = stockaccount.currencyId(); + TQString basecurrencyid = file->baseCurrency().id(); MyMoneyPrice price = file->price( stockid, basecurrencyid, _date, true ); if ( !price.isValid() ) { @@ -228,7 +228,7 @@ void InvTransactionHelper::init( const QDate& _date, const QString& _action, MyM //kdDebug(2) << "successfully added " << id() << endl; } -QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const QDate& _open, const QString& _parent, QString _currency, bool _taxReport ) +TQString makeAccount( const TQString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const TQDate& _open, const TQString& _parent, TQString _currency, bool _taxReport ) { MyMoneyAccount info; MyMoneyFileTransaction ft; @@ -244,8 +244,8 @@ QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, M if(_taxReport) info.setValue("Tax", "Yes"); - MyMoneyAccount parent = MyMoneyFile::instance()->account(_parent); - MyMoneyFile::instance()->addAccount( info, parent ); + MyMoneyAccount tqparent = MyMoneyFile::instance()->account(_parent); + MyMoneyFile::instance()->addAccount( info, tqparent ); // create the opening balance transaction if any if(!_balance.isZero()) { MyMoneySecurity sec = MyMoneyFile::instance()->currency(info.currencyId()); @@ -257,7 +257,7 @@ QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, M return info.id(); } -void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMoney& _price ) +void makePrice(const TQString& _currencyid, const TQDate& _date, const MyMoneyMoney& _price ) { MyMoneyFileTransaction ft; MyMoneyFile* file = MyMoneyFile::instance(); @@ -267,7 +267,7 @@ void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMone ft.commit(); } -QString makeEquity(const QString& _name, const QString& _symbol ) +TQString makeEquity(const TQString& _name, const TQString& _symbol ) { MyMoneySecurity equity; MyMoneyFileTransaction ft; @@ -282,11 +282,11 @@ QString makeEquity(const QString& _name, const QString& _symbol ) return equity.id(); } -void makeEquityPrice(const QString& _id, const QDate& _date, const MyMoneyMoney& _price ) +void makeEquityPrice(const TQString& _id, const TQDate& _date, const MyMoneyMoney& _price ) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyFileTransaction ft; - QString basecurrencyid = file->baseCurrency().id(); + TQString basecurrencyid = file->baseCurrency().id(); MyMoneyPrice price = file->price( _id, basecurrencyid, _date, true ); if ( !price.isValid() ) { @@ -296,114 +296,114 @@ void makeEquityPrice(const QString& _id, const QDate& _date, const MyMoneyMoney& ft.commit(); } -void writeRCFtoXMLDoc( const MyMoneyReport& filter, QDomDocument* doc ) +void writeRCFtoXMLDoc( const MyMoneyReport& filter, TQDomDocument* doc ) { - QDomProcessingInstruction instruct = doc->createProcessingInstruction(QString("xml"), QString("version=\"1.0\" encoding=\"utf-8\"")); + TQDomProcessingInstruction instruct = doc->createProcessingInstruction(TQString("xml"), TQString("version=\"1.0\" encoding=\"utf-8\"")); doc->appendChild(instruct); - QDomElement root = doc->createElement("KMYMONEY-FILE"); + TQDomElement root = doc->createElement("KMYMONEY-FILE"); doc->appendChild(root); - QDomElement reports = doc->createElement("REPORTS"); + TQDomElement reports = doc->createElement("REPORTS"); root.appendChild(reports); - QDomElement report = doc->createElement("REPORT"); + TQDomElement report = doc->createElement("REPORT"); filter.write(report,doc); reports.appendChild(report); } -void writeTabletoHTML( const PivotTable& table, const QString& _filename ) +void writeTabletoHTML( const PivotTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.html").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("report-%1%2.html").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderHTML(); + TQTextStream(&g) << table.renderHTML(); g.close(); } -void writeTabletoHTML( const QueryTable& table, const QString& _filename ) +void writeTabletoHTML( const QueryTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.html").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("report-%1%2.html").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderHTML(); + TQTextStream(&g) << table.renderHTML(); g.close(); } -void writeTabletoCSV( const PivotTable& table, const QString& _filename ) +void writeTabletoCSV( const PivotTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.csv").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("report-%1%2.csv").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderCSV(); + TQTextStream(&g) << table.renderCSV(); g.close(); } -void writeTabletoCSV( const QueryTable& table, const QString& _filename ) +void writeTabletoCSV( const QueryTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("qreport-%1%2.csv").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("qreport-%1%2.csv").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderCSV(); + TQTextStream(&g) << table.renderCSV(); g.close(); } -void writeRCFtoXML( const MyMoneyReport& filter, const QString& _filename ) +void writeRCFtoXML( const MyMoneyReport& filter, const TQString& _filename ) { static unsigned filenum = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.xml").arg(QString::number(filenum).rightJustify(2, '0')); + filename = TQString("report-%1%2.xml").tqarg(TQString::number(filenum).rightJustify(2, '0')); ++filenum; } - QDomDocument* doc = new QDomDocument("KMYMONEY-FILE"); + TQDomDocument* doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(doc); writeRCFtoXMLDoc(filter,doc); - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream stream(&g); + TQTextStream stream(&g); #if KDE_IS_VERSION(3,2,0) - stream.setEncoding(QTextStream::UnicodeUTF8); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << doc->toString(); #else - //stream.setEncoding(QTextStream::Locale); - QString temp = doc->toString(); + //stream.setEncoding(TQTextStream::Locale); + TQString temp = doc->toString(); stream << temp.data(); #endif g.close(); @@ -411,21 +411,21 @@ void writeRCFtoXML( const MyMoneyReport& filter, const QString& _filename ) delete doc; } -bool readRCFfromXMLDoc( QValueList& list, QDomDocument* doc ) +bool readRCFfromXMLDoc( TQValueList& list, TQDomDocument* doc ) { bool result = false; - QDomElement rootElement = doc->documentElement(); + TQDomElement rootElement = doc->documentElement(); if(!rootElement.isNull()) { - QDomNode child = rootElement.firstChild(); + TQDomNode child = rootElement.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); if("REPORTS" == childElement.tagName()) { result = true; - QDomNode subchild = child.firstChild(); + TQDomNode subchild = child.firstChild(); while(!subchild.isNull() && subchild.isElement()) { MyMoneyReport filter; @@ -442,12 +442,12 @@ bool readRCFfromXMLDoc( QValueList& list, QDomDocument* doc ) return result; } -bool readRCFfromXML( QValueList& list, const QString& filename ) +bool readRCFfromXML( TQValueList& list, const TQString& filename ) { int result = false; - QFile f( filename ); + TQFile f( filename ); f.open( IO_ReadOnly ); - QDomDocument* doc = new QDomDocument; + TQDomDocument* doc = new TQDomDocument; if(doc->setContent(&f, FALSE)) { result = readRCFfromXMLDoc(list,doc); @@ -465,11 +465,11 @@ void XMLandback( MyMoneyReport& filter ) // in all cases, the result should be the same if the read // & write methods are working correctly. - QDomDocument* doc = new QDomDocument("KMYMONEY-FILE"); + TQDomDocument* doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(doc); writeRCFtoXMLDoc(filter,doc); - QValueList list; + TQValueList list; if ( readRCFfromXMLDoc(list,doc) && list.count() > 0 ) filter = list[0]; else @@ -479,11 +479,11 @@ void XMLandback( MyMoneyReport& filter ) } -MyMoneyMoney searchHTML(const QString& _html, const QString& _search) +MyMoneyMoney searchHTML(const TQString& _html, const TQString& _search) { - QRegExp re(QString("%1[<>/td]*([\\-.0-9,]*)").arg(_search)); + TQRegExp re(TQString("%1[<>/td]*([\\-.0-9,]*)").tqarg(_search)); re.search(_html); - QString found = re.cap(1); + TQString found = re.cap(1); found.remove(','); return MyMoneyMoney(found.toDouble()); diff --git a/kmymoney2/reports/reportstestcommon.h b/kmymoney2/reports/reportstestcommon.h index 6f4826e..a3f40fd 100644 --- a/kmymoney2/reports/reportstestcommon.h +++ b/kmymoney2/reports/reportstestcommon.h @@ -18,8 +18,8 @@ #ifndef REPORTSTESTCOMMON_H #define REPORTSTESTCOMMON_H -#include -class QDomDocument; +#include +class TQDomDocument; #include "../mymoney/mymoneyaccount.h" #include "../mymoney/mymoneytransaction.h" @@ -46,40 +46,40 @@ extern const MyMoneyMoney moChild; extern const MyMoneyMoney moThomas; extern const MyMoneyMoney moNoPayee; -extern QString acAsset; -extern QString acLiability; -extern QString acExpense; -extern QString acIncome; -extern QString acChecking; -extern QString acCredit; -extern QString acSolo; -extern QString acParent; -extern QString acChild; -extern QString acSecondChild; -extern QString acGrandChild1; -extern QString acGrandChild2; -extern QString acForeign; -extern QString acCanChecking; -extern QString acJpyChecking; -extern QString acCanCash; -extern QString acJpyCash; -extern QString inBank; -extern QString eqStock1; -extern QString eqStock2; -extern QString acInvestment; -extern QString acStock1; -extern QString acStock2; -extern QString acDividends; -extern QString acInterest; -extern QString acTax; -extern QString acCash; +extern TQString acAsset; +extern TQString acLiability; +extern TQString acExpense; +extern TQString acIncome; +extern TQString acChecking; +extern TQString acCredit; +extern TQString acSolo; +extern TQString acParent; +extern TQString acChild; +extern TQString acSecondChild; +extern TQString acGrandChild1; +extern TQString acGrandChild2; +extern TQString acForeign; +extern TQString acCanChecking; +extern TQString acJpyChecking; +extern TQString acCanCash; +extern TQString acJpyCash; +extern TQString inBank; +extern TQString eqStock1; +extern TQString eqStock2; +extern TQString acInvestment; +extern TQString acStock1; +extern TQString acStock2; +extern TQString acDividends; +extern TQString acInterest; +extern TQString acTax; +extern TQString acCash; class TransactionHelper: public MyMoneyTransaction { private: - QString m_id; + TQString m_id; public: - TransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _value, const QString& _accountid, const QString& _categoryid, const QString& _currencyid = QString(), const QString& _payee="Test Payee" ); + TransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _value, const TQString& _accountid, const TQString& _categoryid, const TQString& _currencyid = TQString(), const TQString& _payee="Test Payee" ); ~TransactionHelper(); void update(void); protected: @@ -89,42 +89,42 @@ protected: class InvTransactionHelper: public TransactionHelper { public: - InvTransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ); - void init( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ); + InvTransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ); + void init( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ); }; class BudgetEntryHelper { private: - QDate m_date; - QString m_categoryid; + TQDate m_date; + TQString m_categoryid; bool m_applytosub; MyMoneyMoney m_amount; public: BudgetEntryHelper( void ): m_applytosub(false) {} - BudgetEntryHelper( const QDate& _date, const QString& _categoryid, bool _applytosub, const MyMoneyMoney& _amount ): m_date(_date), m_categoryid(_categoryid), m_applytosub(_applytosub), m_amount(_amount) {} + BudgetEntryHelper( const TQDate& _date, const TQString& _categoryid, bool _applytosub, const MyMoneyMoney& _amount ): m_date(_date), m_categoryid(_categoryid), m_applytosub(_applytosub), m_amount(_amount) {} }; -class BudgetHelper: public QValueList +class BudgetHelper: public TQValueList { - MyMoneyMoney budgetAmount( const QDate& _date, const QString& _categoryid, bool& _applytosub ); + MyMoneyMoney budgetAmount( const TQDate& _date, const TQString& _categoryid, bool& _applytosub ); }; -extern QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const QDate& _open, const QString& _parent, QString _currency="", bool _taxReport = false ); -extern void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMoney& _price ); -QString makeEquity(const QString& _name, const QString& _symbol ); -extern void makeEquityPrice(const QString& _id, const QDate& _date, const MyMoneyMoney& _price ); -extern void writeRCFtoXMLDoc( const MyMoneyReport& filter, QDomDocument* doc ); -extern void writeTabletoHTML( const reports::PivotTable& table, const QString& _filename = QString() ); -extern void writeTabletoHTML( const reports::QueryTable& table, const QString& _filename = QString() ); -extern void writeTabletoCSV( const reports::PivotTable& table, const QString& _filename = QString() ); -extern void writeTabletoCSV( const reports::QueryTable& table, const QString& _filename = QString() ); -extern void writeRCFtoXML( const MyMoneyReport& filter, const QString& _filename = QString() ); -extern bool readRCFfromXMLDoc( QValueList& list, QDomDocument* doc ); -extern bool readRCFfromXML( QValueList& list, const QString& filename ); +extern TQString makeAccount( const TQString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const TQDate& _open, const TQString& _parent, TQString _currency="", bool _taxReport = false ); +extern void makePrice(const TQString& _currencyid, const TQDate& _date, const MyMoneyMoney& _price ); +TQString makeEquity(const TQString& _name, const TQString& _symbol ); +extern void makeEquityPrice(const TQString& _id, const TQDate& _date, const MyMoneyMoney& _price ); +extern void writeRCFtoXMLDoc( const MyMoneyReport& filter, TQDomDocument* doc ); +extern void writeTabletoHTML( const reports::PivotTable& table, const TQString& _filename = TQString() ); +extern void writeTabletoHTML( const reports::QueryTable& table, const TQString& _filename = TQString() ); +extern void writeTabletoCSV( const reports::PivotTable& table, const TQString& _filename = TQString() ); +extern void writeTabletoCSV( const reports::QueryTable& table, const TQString& _filename = TQString() ); +extern void writeRCFtoXML( const MyMoneyReport& filter, const TQString& _filename = TQString() ); +extern bool readRCFfromXMLDoc( TQValueList& list, TQDomDocument* doc ); +extern bool readRCFfromXML( TQValueList& list, const TQString& filename ); extern void XMLandback( MyMoneyReport& filter ); -extern MyMoneyMoney searchHTML(const QString& _html, const QString& _search); +extern MyMoneyMoney searchHTML(const TQString& _html, const TQString& _search); } // end namespace test diff --git a/kmymoney2/reports/reporttable.h b/kmymoney2/reports/reporttable.h index 3bab330..a05ff51 100644 --- a/kmymoney2/reports/reporttable.h +++ b/kmymoney2/reports/reporttable.h @@ -42,10 +42,10 @@ protected: ReportTable() {} public: virtual ~ReportTable() {} - virtual QString renderHTML(void) const = 0; - virtual QString renderCSV(void) const = 0; + virtual TQString renderHTML(void) const = 0; + virtual TQString renderCSV(void) const = 0; virtual void drawChart(KReportChartView& view) const = 0; - virtual void dump(const QString& file, const QString& context=QString()) const = 0; + virtual void dump(const TQString& file, const TQString& context=TQString()) const = 0; }; } diff --git a/kmymoney2/views/kaccountsview.cpp b/kmymoney2/views/kaccountsview.cpp index b0800cd..f84bf63 100644 --- a/kmymoney2/views/kaccountsview.cpp +++ b/kmymoney2/views/kaccountsview.cpp @@ -17,10 +17,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,8 +43,8 @@ #include "../kmymoney2.h" -KMyMoneyAccountIconItem::KMyMoneyAccountIconItem(QIconView *parent, const MyMoneyAccount& account) : - KIconViewItem(parent, account.name()), +KMyMoneyAccountIconItem::KMyMoneyAccountIconItem(TQIconView *tqparent, const MyMoneyAccount& account) : + KIconViewItem(tqparent, account.name()), m_account(account), m_reconcileFlag(false) { @@ -68,29 +68,29 @@ void KMyMoneyAccountIconItem::updateAccount(const MyMoneyAccount& account) setPixmap(account.accountPixmap(m_reconcileFlag)); } -KAccountsView::KAccountsView(QWidget *parent, const char *name) : - KAccountsViewDecl(parent,name), +KAccountsView::KAccountsView(TQWidget *tqparent, const char *name) : + KAccountsViewDecl(tqparent,name), m_assetItem(0), m_liabilityItem(0) { // create the searchline widget - // and insert it into the existing layout - m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->parentWidget()); - QVBoxLayout* layout = dynamic_cast(m_accountTree->parentWidget()->layout()); - if(layout) { - layout->insertWidget(0, m_searchWidget); + // and insert it into the existing tqlayout + m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->tqparentWidget()); + TQVBoxLayout* tqlayout = dynamic_cast(m_accountTree->tqparentWidget()->tqlayout()); + if(tqlayout) { + tqlayout->insertWidget(0, m_searchWidget); } // setup icons for collapse and expand button KIconLoader *ic = KGlobal::iconLoader(); KGuiItem collapseGuiItem("", - QIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); KGuiItem expandGuiItem("", - QIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); m_collapseButton->setGuiItem(collapseGuiItem); m_expandButton->setGuiItem(expandGuiItem); @@ -101,21 +101,21 @@ KAccountsView::KAccountsView(QWidget *parent, const char *name) : config->setGroup("Last Use Settings"); m_tab->setCurrentPage(config->readNumEntry("KAccountsView_LastType", 0)); - connect(m_tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotTabChanged(QWidget*))); + connect(m_tab, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(slotTabChanged(TQWidget*))); - connect(m_accountTree, SIGNAL(selectObject(const MyMoneyObject&)), this, SIGNAL(selectObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(openContextMenu(const MyMoneyObject&)), this, SIGNAL(openContextMenu(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(valueChanged(void)), this, SLOT(slotUpdateNetWorth(void))); - connect(m_accountTree, SIGNAL(openObject(const MyMoneyObject&)), this, SIGNAL(openObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_accountTree, TQT_SIGNAL(selectObject(const MyMoneyObject&)), this, TQT_SIGNAL(selectObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), this, TQT_SIGNAL(openContextMenu(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(valueChanged(void)), this, TQT_SLOT(slotUpdateNetWorth(void))); + connect(m_accountTree, TQT_SIGNAL(openObject(const MyMoneyObject&)), this, TQT_SIGNAL(openObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); - connect(m_accountIcons, SIGNAL(selectionChanged(QIconViewItem*)), this, SLOT(slotSelectIcon(QIconViewItem*))); - connect(m_accountIcons, SIGNAL(rightButtonClicked(QIconViewItem*, const QPoint&)), this, SLOT(slotOpenContext(QIconViewItem*))); - connect(m_accountIcons, SIGNAL(executed(QIconViewItem*)), this, SLOT(slotOpenObject(QIconViewItem*))); + connect(m_accountIcons, TQT_SIGNAL(selectionChanged(TQIconViewItem*)), this, TQT_SLOT(slotSelectIcon(TQIconViewItem*))); + connect(m_accountIcons, TQT_SIGNAL(rightButtonClicked(TQIconViewItem*, const TQPoint&)), this, TQT_SLOT(slotOpenContext(TQIconViewItem*))); + connect(m_accountIcons, TQT_SIGNAL(executed(TQIconViewItem*)), this, TQT_SLOT(slotOpenObject(TQIconViewItem*))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadAccounts())); - connect(m_collapseButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); - connect(m_expandButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadAccounts())); + connect(m_collapseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); + connect(m_expandButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); } KAccountsView::~KAccountsView() @@ -137,7 +137,7 @@ void KAccountsView::slotLoadAccounts(void) slotTabChanged(m_tab->currentPage()); } -void KAccountsView::slotTabChanged(QWidget* _tab) +void KAccountsView::slotTabChanged(TQWidget* _tab) { AccountsViewTab tab = static_cast(m_tab->indexOf(_tab)); @@ -196,7 +196,7 @@ void KAccountsView::polish(void) { // don't forget base class implementation KAccountsViewDecl::polish(); - m_accountTree->setResizeMode(QListView::LastColumn); + m_accountTree->setResizeMode(TQListView::LastColumn); m_accountTree->restoreLayout("Account View Settings"); } @@ -222,7 +222,7 @@ void KAccountsView::loadIconView(void) ::timetrace("start load accounts icon view"); // remember the positions of the icons - QMap posMap; + TQMap posMap; KMyMoneyAccountIconItem* p = dynamic_cast(m_accountIcons->firstItem()); for(;p; p = dynamic_cast(p->nextItem())) posMap[p->itemObject().id()] = p->pos(); @@ -232,16 +232,16 @@ void KAccountsView::loadIconView(void) // clear the current contents and recreate it m_accountIcons->clear(); - QMap accountMap; + TQMap accountMap; MyMoneyFile* file = MyMoneyFile::instance(); // get account list and sort by name - QValueList alist; + TQValueList alist; file->accountList(alist); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = alist.begin(); it_a != alist.end(); ++it_a) { - accountMap[QString("%1-%2").arg((*it_a).name()).arg((*it_a).id())] = *it_a; + accountMap[TQString("%1-%2").tqarg((*it_a).name()).tqarg((*it_a).id())] = *it_a; } bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() @@ -249,12 +249,12 @@ void KAccountsView::loadIconView(void) bool existNewIcons = false; // parse list and add all asset and liability accounts - QMap::const_iterator it; + TQMap::const_iterator it; for(it = accountMap.begin(); it != accountMap.end(); ++it) { - QPoint loc; + TQPoint loc; if((*it).isClosed() && !showClosedAccounts) continue; - const QString& pos = (*it).value("kmm-iconpos"); + const TQString& pos = (*it).value("kmm-iconpos"); KMyMoneyAccountIconItem* item; switch((*it).accountGroup()) { case MyMoneyAccount::Equity: @@ -271,12 +271,12 @@ void KAccountsView::loadIconView(void) // if we have a position stored with the object and no other // idea of it's current position, then take the one // stored inside the object. Also, turn off auto arrangement - if(!pos.isEmpty() && posMap[(*it).id()] == QPoint()) { + if(!pos.isEmpty() && posMap[(*it).id()] == TQPoint()) { posMap[(*it).id()] = point(pos); } loc = posMap[(*it).id()]; - if(loc == QPoint()) { + if(loc == TQPoint()) { existNewIcons = true; } else { m_accountIcons->setAutoArrange(false); @@ -286,7 +286,7 @@ void KAccountsView::loadIconView(void) if((*it).id() == m_reconciliationAccount.id()) item->setReconciliation(true); - if(loc != QPoint()) { + if(loc != TQPoint()) { item->move(loc); } break; @@ -311,15 +311,15 @@ void KAccountsView::loadIconView(void) void KAccountsView::loadListView(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load accounts list view"); // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -329,7 +329,7 @@ void KAccountsView::loadListView(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -344,9 +344,9 @@ void KAccountsView::loadListView(void) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList slist = file->currencyList(); + TQValueList slist = file->currencyList(); slist += file->securityList(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { m_securityMap[(*it_s).id()] = *it_s; } @@ -388,13 +388,13 @@ void KAccountsView::loadListView(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -403,11 +403,11 @@ void KAccountsView::loadListView(void) // reposition viewport m_accountTree->setContentsPos(startPoint.x(), startPoint.y()); - m_searchWidget->searchLine()->updateSearch(QString::null); + m_searchWidget->searchLine()->updateSearch(TQString()); // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); // and in case we need to show things expanded, we'll do so if(KMyMoneyGlobalSettings::showAccountsExpanded()) @@ -419,7 +419,7 @@ void KAccountsView::loadListView(void) ::timetrace("done load accounts list view"); } -bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList) +bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList) { MyMoneyFile* file = MyMoneyFile::instance(); @@ -427,10 +427,10 @@ bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStri bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked() || !KMyMoneyGlobalSettings::hideClosedAccounts(); - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { const MyMoneyAccount& acc = file->account(*it_a); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -452,7 +452,7 @@ bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStri delete e; } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); if(acc.id() == m_reconciliationAccount.id()) item->setReconciliation(true); @@ -478,14 +478,14 @@ bool KAccountsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStri return unused; } -void KAccountsView::slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +void KAccountsView::slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { Q_UNUSED(reconciliationDate); Q_UNUSED(endingBalance); // scan through the list of accounts and mark all non // expanded and re-select the one that was probably selected before - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); KMyMoneyAccountTreeItem* item; while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); @@ -506,7 +506,7 @@ void KAccountsView::slotReconcileAccount(const MyMoneyAccount& acc, const QDate& if(!acc.id().isEmpty()) { // scan through the list of accounts and mark // the one that is currently reconciled - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->itemObject().id() == acc.id()) { @@ -534,19 +534,19 @@ void KAccountsView::slotUpdateNetWorth(void) MyMoneyMoney netWorth = m_assetItem->totalValue() - m_liabilityItem->totalValue(); - QString s(i18n("Net Worth: ")); + TQString s(i18n("Net Worth: ")); // FIXME figure out how to deal with the approximate // if(!(file->totalValueValid(assetAccount.id()) & file->totalValueValid(liabilityAccount.id()))) // s += "~ "; - s.replace(QString(" "), QString(" ")); + s.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } const MyMoneySecurity& sec = MyMoneyFile::instance()->baseCurrency(); - QString v(netWorth.formatMoney(sec)); - s += v.replace(QString(" "), QString(" ")); + TQString v(netWorth.formatMoney(sec)); + s += v.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } @@ -560,42 +560,42 @@ KMyMoneyAccountIconItem* KAccountsView::selectedIcon(void) const return dynamic_cast(m_accountIcons->currentItem()); } -void KAccountsView::slotSelectIcon(QIconViewItem* item) +void KAccountsView::slotSelectIcon(TQIconViewItem* item) { KMyMoneyAccountIconItem* p = dynamic_cast(item); if(p) emit selectObject(p->itemObject()); } -void KAccountsView::slotOpenContext(QIconViewItem* item) +void KAccountsView::slotOpenContext(TQIconViewItem* item) { KMyMoneyAccountIconItem* p = dynamic_cast(item); if(p) emit openContextMenu(p->itemObject()); } -void KAccountsView::slotOpenObject(QIconViewItem* item) +void KAccountsView::slotOpenObject(TQIconViewItem* item) { KMyMoneyAccountIconItem* p = dynamic_cast(item); if(p) emit openObject(p->itemObject()); } -QString KAccountsView::point(const QPoint& val) const +TQString KAccountsView::point(const TQPoint& val) const { - return QString("%1;%2").arg(val.x()).arg(val.y()); + return TQString("%1;%2").tqarg(val.x()).tqarg(val.y()); } -QPoint KAccountsView::point(const QString& val) const +TQPoint KAccountsView::point(const TQString& val) const { - QRegExp exp("(\\d+);(\\d+)"); + TQRegExp exp("(\\d+);(\\d+)"); int x = 0; int y = 0; if(exp.search(val) != -1) { x = exp.cap(1).toInt(); y = exp.cap(2).toInt(); } - return QPoint(x, y); + return TQPoint(x, y); } void KAccountsView::slotUpdateIconPos(unsigned int action) diff --git a/kmymoney2/views/kaccountsview.h b/kmymoney2/views/kaccountsview.h index ed30ac5..33a787c 100644 --- a/kmymoney2/views/kaccountsview.h +++ b/kmymoney2/views/kaccountsview.h @@ -49,12 +49,12 @@ public: /** * Constructor to be used to construct an account icon object. * - * @param parent pointer to the KIconView object this entry should be + * @param tqparent pointer to the KIconView object this entry should be * added to. * @param account const reference to MyMoneyAccount for which * the KIconView entry is constructed */ - KMyMoneyAccountIconItem(QIconView *parent, const MyMoneyAccount& account); + KMyMoneyAccountIconItem(TQIconView *tqparent, const MyMoneyAccount& account); ~KMyMoneyAccountIconItem(); /** @@ -87,10 +87,11 @@ private: class KAccountsView : public KAccountsViewDecl { Q_OBJECT + TQ_OBJECT private: public: - KAccountsView(QWidget *parent=0, const char *name=0); + KAccountsView(TQWidget *tqparent=0, const char *name=0); virtual ~KAccountsView(); public slots: @@ -103,8 +104,8 @@ public slots: void show(void); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); @@ -117,7 +118,7 @@ public slots: */ void slotUpdateIconPos(unsigned int action); - void slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + void slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); protected: typedef enum { @@ -136,7 +137,7 @@ protected: void loadListView(void); void loadIconView(void); - bool loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList); + bool loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList); /** * This method returns a pointer to the currently selected @@ -144,15 +145,15 @@ protected: */ KMyMoneyAccountIconItem* selectedIcon(void) const; - QPoint point(const QString& str) const; - QString point(const QPoint& val) const; + TQPoint point(const TQString& str) const; + TQString point(const TQPoint& val) const; protected slots: void slotUpdateNetWorth(void); - void slotTabChanged(QWidget*); - void slotSelectIcon(QIconViewItem* item); - void slotOpenContext(QIconViewItem* item); - void slotOpenObject(QIconViewItem* item); + void slotTabChanged(TQWidget*); + void slotSelectIcon(TQIconViewItem* item); + void slotOpenContext(TQIconViewItem* item); + void slotOpenObject(TQIconViewItem* item); void slotExpandCollapse(void); signals: @@ -181,17 +182,17 @@ signals: /** * This signal is emitted, when the user selected to reparent the - * account @p acc to be a subordinate account of @p parent. + * account @p acc to be a subordinate account of @p tqparent. * * @param acc const reference to account to be reparented - * @param parent const reference to new parent account + * @param tqparent const reference to new tqparent account */ - void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& parent); + void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& tqparent); private: MyMoneyAccount m_reconciliationAccount; - QMap m_securityMap; - QMap m_transactionCountMap; + TQMap m_securityMap; + TQMap m_transactionCountMap; KMyMoneyAccountTreeItem* m_assetItem; KMyMoneyAccountTreeItem* m_liabilityItem; diff --git a/kmymoney2/views/kaccountsviewdecl.ui b/kmymoney2/views/kaccountsviewdecl.ui index c8bb5ac..922844f 100644 --- a/kmymoney2/views/kaccountsviewdecl.ui +++ b/kmymoney2/views/kaccountsviewdecl.ui @@ -1,6 +1,6 @@ KAccountsViewDecl - + KAccountsViewDecl @@ -19,11 +19,11 @@ 0 - + m_tab - + tab @@ -45,9 +45,9 @@ false - + - layout5 + tqlayout5 @@ -85,7 +85,7 @@ Expanding - + 515 20 @@ -96,7 +96,7 @@ - + tab @@ -127,7 +127,7 @@ - + m_hiddenCategories @@ -135,9 +135,9 @@ Note: Unused categories are not shown as selected by settings. - + - layout4 + tqlayout4 @@ -153,18 +153,18 @@ Expanding - + 367 20 - + m_totalProfitsLabel - + 150 0 @@ -176,7 +176,7 @@ RichText - + WordBreak|AlignVCenter|AlignRight @@ -200,5 +200,8 @@ slotCollapseAll() - + + kmymoney/kmymoneyaccounttree.h + + diff --git a/kmymoney2/views/kbudgetview.cpp b/kmymoney2/views/kbudgetview.cpp index a8d5bc1..c2bf5dc 100644 --- a/kmymoney2/views/kbudgetview.cpp +++ b/kmymoney2/views/kbudgetview.cpp @@ -19,17 +19,17 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -61,12 +61,12 @@ #include "../kmymoney2.h" // *** KBudgetListItem Implementation *** -KBudgetListItem::KBudgetListItem(KListView *parent, const MyMoneyBudget& budget) : - KListViewItem(parent), +KBudgetListItem::KBudgetListItem(KListView *tqparent, const MyMoneyBudget& budget) : + KListViewItem(tqparent), m_budget(budget) { setText(0, budget.name()); - setText(1, QString("%1").arg(budget.budgetStart().year())); + setText(1, TQString("%1").tqarg(budget.budgetStart().year())); // allow in column rename setRenameEnabled(0, true); @@ -76,18 +76,18 @@ KBudgetListItem::~KBudgetListItem() { } -void KBudgetListItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +void KBudgetListItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { p->setFont(KMyMoneyGlobalSettings::listCellFont()); - QColorGroup cg2(cg); + TQColorGroup cg2(cg); if (isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } @@ -95,8 +95,8 @@ void KBudgetListItem::paintCell(QPainter *p, const QColorGroup & cg, int column, const int KBudgetView::m_iBudgetYearsAhead = 5; const int KBudgetView::m_iBudgetYearsBack = 3; -KBudgetView::KBudgetView(QWidget *parent, const char *name ) : - KBudgetViewDecl(parent,name), +KBudgetView::KBudgetView(TQWidget *tqparent, const char *name ) : + KBudgetViewDecl(tqparent,name), m_needReload(false), m_inSelection(false) { @@ -104,73 +104,73 @@ KBudgetView::KBudgetView(QWidget *parent, const char *name ) : m_budgetList->setSorting(0); KIconLoader* il = KGlobal::iconLoader(); - KGuiItem newButtenItem( QString(""), - QIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), + KGuiItem newButtenItem( TQString(""), + TQIconSet(il->loadIcon("file_new", KIcon::Small, KIcon::SizeSmall)), i18n("Creates a new budget"), i18n("Use this to create a new empty budget.")); m_newButton->setGuiItem(newButtenItem); - QToolTip::add(m_newButton, newButtenItem.toolTip()); + TQToolTip::add(m_newButton, newButtenItem.toolTip()); - KGuiItem renameButtenItem( QString(""), - QIconSet(il->loadIcon("editpaste", KIcon::Small, KIcon::SizeSmall)), + KGuiItem renameButtenItem( TQString(""), + TQIconSet(il->loadIcon("editpaste", KIcon::Small, KIcon::SizeSmall)), i18n("Rename the current selected budget"), i18n("Use this to start renaming the selected budget.")); m_renameButton->setGuiItem(renameButtenItem); - QToolTip::add(m_renameButton, renameButtenItem.toolTip()); + TQToolTip::add(m_renameButton, renameButtenItem.toolTip()); - KGuiItem deleteButtenItem( QString(""), - QIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), + KGuiItem deleteButtenItem( TQString(""), + TQIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), i18n("Delete the current selected budget"), i18n("Use this to delete the selected budget.")); m_deleteButton->setGuiItem(deleteButtenItem); - QToolTip::add(m_deleteButton, deleteButtenItem.toolTip()); + TQToolTip::add(m_deleteButton, deleteButtenItem.toolTip()); - KGuiItem updateButtenItem( QString(""), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + KGuiItem updateButtenItem( TQString(""), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered values and stores the budget"), i18n("Use this to store the modified data.")); m_updateButton->setGuiItem(updateButtenItem); - QToolTip::add(m_updateButton, updateButtenItem.toolTip()); + TQToolTip::add(m_updateButton, updateButtenItem.toolTip()); - KGuiItem resetButtenItem( QString(""), - QIconSet(il->loadIcon("undo", KIcon::Small, KIcon::SizeSmall)), + KGuiItem resetButtenItem( TQString(""), + TQIconSet(il->loadIcon("undo", KIcon::Small, KIcon::SizeSmall)), i18n("Revert budget to last saved state"), i18n("Use this to discard the modified data.")); m_resetButton->setGuiItem(resetButtenItem); - QToolTip::add(m_resetButton, resetButtenItem.toolTip()); + TQToolTip::add(m_resetButton, resetButtenItem.toolTip()); - connect(m_budgetList, SIGNAL(contextMenu(KListView*, QListViewItem* , const QPoint&)), - this, SLOT(slotOpenContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(m_budgetList, SIGNAL(itemRenamed(QListViewItem*,int,const QString&)), this, SLOT(slotRenameBudget(QListViewItem*,int,const QString&))); - connect(m_budgetList, SIGNAL(selectionChanged()), this, SLOT(slotSelectBudget())); + connect(m_budgetList, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem* , const TQPoint&)), + this, TQT_SLOT(slotOpenContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(m_budgetList, TQT_SIGNAL(itemRenamed(TQListViewItem*,int,const TQString&)), this, TQT_SLOT(slotRenameBudget(TQListViewItem*,int,const TQString&))); + connect(m_budgetList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectBudget())); - connect(m_cbBudgetSubaccounts, SIGNAL(clicked()), this, SLOT(cb_includesSubaccounts_clicked())); + connect(m_cbBudgetSubaccounts, TQT_SIGNAL(clicked()), this, TQT_SLOT(cb_includesSubaccounts_clicked())); - connect(m_accountTree, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectAccount(QListViewItem*))); - connect(m_accountTree, SIGNAL(valueChanged()), this, SLOT(slotRefreshHideUnusedButton())); + connect(m_accountTree, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectAccount(TQListViewItem*))); + connect(m_accountTree, TQT_SIGNAL(valueChanged()), this, TQT_SLOT(slotRefreshHideUnusedButton())); // connect the buttons to the actions. Make sure the enabled state // of the actions is reflected by the buttons - connect(kmymoney2->action("budget_new"), SIGNAL(enabled(bool)), m_newButton, SLOT(setEnabled(bool))); - connect(m_renameButton, SIGNAL(clicked()), kmymoney2->action("budget_rename"), SLOT(activate())); - connect(kmymoney2->action("budget_rename"), SIGNAL(enabled(bool)), m_renameButton, SLOT(setEnabled(bool))); - connect(m_deleteButton, SIGNAL(clicked()), kmymoney2->action("budget_delete"), SLOT(activate())); - connect(kmymoney2->action("budget_delete"), SIGNAL(enabled(bool)), m_deleteButton, SLOT(setEnabled(bool))); + connect(kmymoney2->action("budget_new"), TQT_SIGNAL(enabled(bool)), m_newButton, TQT_SLOT(setEnabled(bool))); + connect(m_renameButton, TQT_SIGNAL(clicked()), kmymoney2->action("budget_rename"), TQT_SLOT(activate())); + connect(kmymoney2->action("budget_rename"), TQT_SIGNAL(enabled(bool)), m_renameButton, TQT_SLOT(setEnabled(bool))); + connect(m_deleteButton, TQT_SIGNAL(clicked()), kmymoney2->action("budget_delete"), TQT_SLOT(activate())); + connect(kmymoney2->action("budget_delete"), TQT_SIGNAL(enabled(bool)), m_deleteButton, TQT_SLOT(setEnabled(bool))); - connect(m_budgetValue, SIGNAL(valuesChanged()), this, SLOT(slotBudgetedAmountChanged())); + connect(m_budgetValue, TQT_SIGNAL(valuesChanged()), this, TQT_SLOT(slotBudgetedAmountChanged())); - connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNewBudget())); - connect(m_updateButton, SIGNAL(pressed()), this, SLOT(slotUpdateBudget())); - connect(m_resetButton, SIGNAL(pressed()), this, SLOT(slotResetBudget())); + connect(m_newButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewBudget())); + connect(m_updateButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateBudget())); + connect(m_resetButton, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotResetBudget())); - connect(m_hideUnusedButton, SIGNAL(toggled(bool)), this, SLOT(slotHideUnused(bool))); + connect(m_hideUnusedButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotHideUnused(bool))); // setup initial state m_newButton->setEnabled(kmymoney2->action("budget_new")->isEnabled()); m_renameButton->setEnabled(kmymoney2->action("budget_rename")->isEnabled()); m_deleteButton->setEnabled(kmymoney2->action("budget_delete")->isEnabled()); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotRefreshView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotRefreshView())); } KBudgetView::~KBudgetView() @@ -179,8 +179,8 @@ KBudgetView::~KBudgetView() void KBudgetView::show() { - QTimer::singleShot(50, this, SLOT(slotRearrange())); - QWidget::show(); + TQTimer::singleShot(50, this, TQT_SLOT(slotRearrange())); + TQWidget::show(); if(m_needReload) { slotRefreshView(); } @@ -197,7 +197,7 @@ void KBudgetView::slotRearrange(void) resizeEvent(0); } -void KBudgetView::resizeEvent(QResizeEvent* ev) +void KBudgetView::resizeEvent(TQResizeEvent* ev) { // resize the register KBudgetViewDecl::resizeEvent(ev); @@ -212,7 +212,7 @@ void KBudgetView::slotReloadView(void) void KBudgetView::loadBudgets(void) { - QString id; + TQString id; ::timetrace("Start KBudgetView::loadBudgets"); @@ -220,7 +220,7 @@ void KBudgetView::loadBudgets(void) id = m_budget.id(); // remember the upper left corner of the viewport - QPoint startPoint = m_budgetList->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_budgetList->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_budgetList->setUpdatesEnabled(false); @@ -230,24 +230,24 @@ void KBudgetView::loadBudgets(void) m_budgetValue->clear(); // add the correct years to the drop down list - QDate date = QDate::currentDate(Qt::LocalTime); + TQDate date = TQDate::tqcurrentDate(Qt::LocalTime); int iStartYear = date.year() - m_iBudgetYearsBack; m_yearList.clear(); for (int i=0; i list = MyMoneyFile::instance()->budgetList(); - QValueList::ConstIterator it; + TQValueList list = MyMoneyFile::instance()->budgetList(); + TQValueList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { KBudgetListItem* item = new KBudgetListItem(m_budgetList, *it); // create a list of unique years - if (m_yearList.findIndex(QString::number((*it).budgetStart().year())) == -1) - m_yearList += QString::number((*it).budgetStart().year()); + if (m_yearList.tqfindIndex(TQString::number((*it).budgetStart().year())) == -1) + m_yearList += TQString::number((*it).budgetStart().year()); if(item->budget().id() == id) { m_budget = (*it); @@ -266,7 +266,7 @@ void KBudgetView::loadBudgets(void) // turn updates back on m_budgetList->setUpdatesEnabled(true); - m_budgetList->repaintContents(); + m_budgetList->tqrepaintContents(); // reset the status of the buttons m_updateButton->setEnabled(false); @@ -278,9 +278,9 @@ void KBudgetView::loadBudgets(void) ::timetrace("End KBudgetView::loadBudgets"); } -void KBudgetView::ensureBudgetVisible(const QString& id) +void KBudgetView::ensureBudgetVisible(const TQString& id) { - for (QListViewItem * item = m_budgetList->firstChild(); item; item = item->itemBelow()) { + for (TQListViewItem * item = m_budgetList->firstChild(); item; item = item->itemBelow()) { KBudgetListItem* p = dynamic_cast(item); if(p && p->budget().id() == id) { if(p->itemAbove()) @@ -300,7 +300,7 @@ void KBudgetView::slotRefreshView(void) { if(isVisible()) { if(m_inSelection) - QTimer::singleShot(0, this, SLOT(slotRefreshView())); + TQTimer::singleShot(0, this, TQT_SLOT(slotRefreshView())); else { loadBudgets(); m_needReload = false; @@ -312,7 +312,7 @@ void KBudgetView::slotRefreshView(void) void KBudgetView::loadAccounts(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load budget account view"); @@ -329,10 +329,10 @@ void KBudgetView::loadAccounts(void) // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -342,7 +342,7 @@ void KBudgetView::loadAccounts(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -368,13 +368,13 @@ void KBudgetView::loadAccounts(void) m_accountTree->setBaseCurrency(security); const MyMoneyAccount& income = file->income(); - QStringList incSubAcctList = income.accountList(); + TQStringList incSubAcctList = income.accountList(); m_incomeItem = new KMyMoneyAccountTreeBudgetItem(m_accountTree, income, m_budget, security, i18n("Income")); haveUnusedBudgets |= loadSubAccounts(m_incomeItem, incSubAcctList, m_budget); m_incomeItem->setSelectable(false); const MyMoneyAccount& expense = file->expense(); - QStringList expSubAcctList = expense.accountList(); + TQStringList expSubAcctList = expense.accountList(); m_expenseItem = new KMyMoneyAccountTreeBudgetItem(m_accountTree, expense, m_budget, security, i18n("Expense")); haveUnusedBudgets |= loadSubAccounts(m_expenseItem, expSubAcctList, m_budget); m_expenseItem->setSelectable(false); @@ -386,13 +386,13 @@ void KBudgetView::loadAccounts(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -403,7 +403,7 @@ void KBudgetView::loadAccounts(void) // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); m_updateButton->setEnabled(!(selectedBudget() == m_budget)); m_resetButton->setEnabled(!(selectedBudget() == m_budget)); @@ -412,7 +412,7 @@ void KBudgetView::loadAccounts(void) } -bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QStringList& accountList, const MyMoneyBudget& budget) +bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* tqparent, TQStringList& accountList, const MyMoneyBudget& budget) { MyMoneyFile* file = MyMoneyFile::instance(); @@ -421,24 +421,24 @@ bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QString //sort the subaccount list //FIXME this is just a hack to order the accounts if ( !accountList.isEmpty() ) { - QMap accountMap; - QValueList alist; + TQMap accountMap; + TQValueList alist; file->accountList ( alist, accountList ); accountList.clear(); - QValueList::const_iterator it_ac; + TQValueList::const_iterator it_ac; for ( it_ac = alist.begin(); it_ac != alist.end(); ++it_ac ) { accountMap[(*it_ac).name()] = *it_ac; } - QMap::const_iterator it_am; + TQMap::const_iterator it_am; for ( it_am = accountMap.begin(); it_am != accountMap.end(); ++it_am ) { accountList.prepend((*it_am).id()); //use prepend instead of append otherwise account show up in ascending order } } - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { const MyMoneyAccount& acc = file->account(*it_a); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -460,12 +460,12 @@ bool KBudgetView::loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QString delete e; } - QStringList subAcctList = acc.accountList(); - KMyMoneyAccountTreeBudgetItem *item = new KMyMoneyAccountTreeBudgetItem(parent, acc, budget, prices, security); + TQStringList subAcctList = acc.accountList(); + KMyMoneyAccountTreeBudgetItem *item = new KMyMoneyAccountTreeBudgetItem(tqparent, acc, budget, prices, security); unused |= loadSubAccounts(item, subAcctList, budget); // no child accounts and no value assigned to this account - bool thisUnused = (!item->firstChild()) && (!budget.contains(acc.id())); + bool thisUnused = (!item->firstChild()) && (!budget.tqcontains(acc.id())); // In case of a budget which is unused and we are requested to suppress // the display of those, @@ -485,8 +485,8 @@ void KBudgetView::askSave(void) // check if the content of a currently selected budget was modified // and ask to store the data if (m_updateButton->isEnabled()) { - if (KMessageBox::questionYesNo(this, QString("%1").arg( - i18n("Do you want to save the changes for %1").arg(m_budget.name())), + if (KMessageBox::questionYesNo(this, TQString("%1").tqarg( + i18n("Do you want to save the changes for %1").tqarg(m_budget.name())), i18n("Save changes")) == KMessageBox::Yes) { m_inSelection = true; slotUpdateBudget(); @@ -517,7 +517,7 @@ void KBudgetView::slotSelectBudget(void) m_assignmentBox->setEnabled(false); m_budget = MyMoneyBudget(); - QListViewItemIterator it_l(m_budgetList, QListViewItemIterator::Selected); + TQListViewItemIterator it_l(m_budgetList, TQListViewItemIterator::Selected); item = dynamic_cast(it_l.current()); if(item) { m_budget = item->budget(); @@ -527,7 +527,7 @@ void KBudgetView::slotSelectBudget(void) slotRefreshHideUnusedButton(); loadAccounts(); - QValueList budgetList; + TQValueList budgetList; if(!m_budget.id().isEmpty()) budgetList << m_budget; emit selectObjects(budgetList); @@ -546,7 +546,7 @@ const MyMoneyBudget& KBudgetView::selectedBudget(void) const { static MyMoneyBudget nullBudget; - QListViewItemIterator it_l(m_budgetList, QListViewItemIterator::Selected); + TQListViewItemIterator it_l(m_budgetList, TQListViewItemIterator::Selected); KBudgetListItem* item = dynamic_cast(it_l.current()); if(item) { return item->budget(); @@ -557,12 +557,12 @@ const MyMoneyBudget& KBudgetView::selectedBudget(void) const KMyMoneyAccountTreeBudgetItem* KBudgetView::selectedAccount(void) const { - QListViewItemIterator it_l(m_accountTree, QListViewItemIterator::Selected); + TQListViewItemIterator it_l(m_accountTree, TQListViewItemIterator::Selected); KMyMoneyAccountTreeBudgetItem* item = dynamic_cast(it_l.current()); return item; } -void KBudgetView::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint& p) +void KBudgetView::slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint& p) { Q_UNUSED(lv); Q_UNUSED(p); @@ -580,15 +580,15 @@ void KBudgetView::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPo void KBudgetView::slotStartRename(void) { - QListViewItemIterator it_l(m_budgetList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_budgetList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; if((it_v = it_l.current()) != 0) { it_v->startRename(0); } } // This variant is only called when a single budget is selected and renamed. -void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString& txt) +void KBudgetView::slotRenameBudget(TQListViewItem* p , int /*col*/, const TQString& txt) { KBudgetListItem *pBudget = dynamic_cast (p); if (!pBudget) @@ -596,7 +596,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString //kdDebug() << "[KPayeesView::slotRenamePayee]" << endl; // create a copy of the new name without appended whitespaces - QString new_name = txt.stripWhiteSpace(); + TQString new_name = txt.stripWhiteSpace(); if (pBudget->budget().name() != new_name) { MyMoneyFileTransaction ft; try { @@ -609,7 +609,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString if (KMessageBox::questionYesNo(this, i18n("A budget with the name '%1' already exists. It is not advisable to have " "multiple budgets with the same identification name. Are you sure you would like " - "to rename the budget?").arg(new_name)) != KMessageBox::Yes) + "to rename the budget?").tqarg(new_name)) != KMessageBox::Yes) { p->setText(0,pBudget->budget().name()); return; @@ -633,7 +633,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify budget"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -642,7 +642,7 @@ void KBudgetView::slotRenameBudget(QListViewItem* p , int /*col*/, const QString } } -void KBudgetView::slotSelectAccount(QListViewItem* item) +void KBudgetView::slotSelectAccount(TQListViewItem* item) { if(item->listView() == m_accountTree) { m_assignmentBox->setEnabled(false); @@ -653,7 +653,7 @@ void KBudgetView::slotSelectAccount(QListViewItem* item) if (m_budget.id().isEmpty() ) return; - QString id = account->id(); + TQString id = account->id(); m_leAccounts->setText(MyMoneyFile::instance()->accountToCategory(id)); m_cbBudgetSubaccounts->setChecked(m_budget.account(id).budgetSubaccounts()); m_accountTotal->setValue(m_budget.account(id).totalBalance()); @@ -709,7 +709,7 @@ void KBudgetView::cb_includesSubaccounts_clicked() return; if(selectedAccount() != 0) { - QString accountID = selectedAccount()->id(); + TQString accountID = selectedAccount()->id(); // now, we get a reference to the accountgroup, to mofify its atribute, // and then put the resulting account group instead of the original @@ -734,7 +734,7 @@ void KBudgetView::slotResetBudget(void) loadAccounts(); } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to reset budget"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -748,7 +748,7 @@ void KBudgetView::slotUpdateBudget(void) slotRefreshHideUnusedButton(); } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify budget"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -757,11 +757,11 @@ void KBudgetView::languageChange(void) { KBudgetViewDecl::languageChange(); - m_newButton->setText(QString()); - m_renameButton->setText(QString()); - m_deleteButton->setText(QString()); - m_updateButton->setText(QString()); - m_resetButton->setText(QString()); + m_newButton->setText(TQString()); + m_renameButton->setText(TQString()); + m_deleteButton->setText(TQString()); + m_updateButton->setText(TQString()); + m_resetButton->setText(TQString()); } #include "kbudgetview.moc" diff --git a/kmymoney2/views/kbudgetview.h b/kmymoney2/views/kbudgetview.h index f857a15..14c7611 100644 --- a/kmymoney2/views/kbudgetview.h +++ b/kmymoney2/views/kbudgetview.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -50,20 +50,20 @@ public: /** * Constructor to be used to construct a budget entry object. * - * @param parent pointer to the KListView object this entry should be + * @param tqparent pointer to the KListView object this entry should be * added to. * @param budget const reference to MyMoneyBudget for which * the KListView entry is constructed */ - KBudgetListItem(KListView *parent, const MyMoneyBudget& budget); + KBudgetListItem(KListView *tqparent, const MyMoneyBudget& budget); ~KBudgetListItem(); /** - * This method is re-implemented from QListViewItem::paintCell(). - * Besides the standard implementation, the QPainter is set + * This method is re-implemented from TQListViewItem::paintCell(). + * Besides the standard implementation, the TQPainter is set * according to the applications settings. */ - void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align); const MyMoneyBudget& budget(void) { return m_budget; }; void setBudget(const MyMoneyBudget& budget) { m_budget = budget; } @@ -79,14 +79,15 @@ private: class KBudgetView : public KBudgetViewDecl { Q_OBJECT + TQ_OBJECT public: - KBudgetView(QWidget *parent=0, const char *name=0); + KBudgetView(TQWidget *tqparent=0, const char *name=0); ~KBudgetView(); void show(); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); @@ -123,16 +124,16 @@ public slots: protected: - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); void loadAccounts(void); - bool loadSubAccounts(KMyMoneyAccountTreeBudgetItem* parent, QStringList& accountList, const MyMoneyBudget& budget); + bool loadSubAccounts(KMyMoneyAccountTreeBudgetItem* tqparent, TQStringList& accountList, const MyMoneyBudget& budget); /** * This method loads all available budgets into the budget list widget. If a budget is * currently selected it remains selected if it is still present. */ void loadBudgets(void); - void ensureBudgetVisible(const QString& id); + void ensureBudgetVisible(const TQString& id); const MyMoneyBudget& selectedBudget(void) const; KMyMoneyAccountTreeBudgetItem* selectedAccount(void) const; void setTimeSpan(KMyMoneyAccountTreeBudgetItem *account, MyMoneyBudget::AccountGroup& accountGroup, int iTimeSpan); @@ -148,7 +149,7 @@ protected slots: * @param col The column where the name is located * @param txt The text of the new name */ - void slotRenameBudget(QListViewItem *p, int col, const QString& txt); + void slotRenameBudget(TQListViewItem *p, int col, const TQString& txt); /** * This slot is called when the amount of a budget is changed. It @@ -158,7 +159,7 @@ protected slots: /** */ - void slotSelectAccount(QListViewItem*); + void slotSelectAccount(TQListViewItem*); void AccountEnter(); @@ -181,14 +182,14 @@ private slots: * @param i the item on which the cursor resides * @param p position of the pointing device */ - void slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint& p); + void slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint& p); signals: /** * This signal serves as proxy for KMyMoneyBudgetList::selectObject() */ void openContextMenu(const MyMoneyObject& obj); - void selectObjects(const QValueList& budget); + void selectObjects(const TQValueList& budget); private: typedef enum { @@ -200,8 +201,8 @@ private: MyMoneyBudget m_budget; - QMap m_transactionCountMap; - QStringList m_yearList; + TQMap m_transactionCountMap; + TQStringList m_yearList; KMyMoneyAccountTreeBudgetItem* m_incomeItem; KMyMoneyAccountTreeBudgetItem* m_expenseItem; diff --git a/kmymoney2/views/kbudgetviewdecl.ui b/kmymoney2/views/kbudgetviewdecl.ui index f3fb5be..e03457d 100644 --- a/kmymoney2/views/kbudgetviewdecl.ui +++ b/kmymoney2/views/kbudgetviewdecl.ui @@ -1,6 +1,6 @@ KBudgetViewDecl - + KBudgetViewDecl @@ -30,15 +30,15 @@ 0 - + - layout7 + tqlayout7 unnamed - + groupBox1 @@ -57,9 +57,9 @@ unnamed - + - layout8 + tqlayout8 @@ -163,9 +163,9 @@ - + - layout6 + tqlayout6 @@ -184,7 +184,7 @@ - + m_hideUnusedButton @@ -192,7 +192,7 @@ Hide unused budget categories - + m_assignmentBox @@ -211,15 +211,15 @@ unnamed - + - layout7 + tqlayout7 unnamed - + textLabel3 @@ -227,7 +227,7 @@ Account - + m_leAccounts @@ -246,7 +246,7 @@ true - + textLabel1 @@ -273,7 +273,7 @@ - + m_cbBudgetSubaccounts @@ -281,9 +281,9 @@ Include subaccounts - + - layout9 + tqlayout9 @@ -304,7 +304,7 @@ Expanding - + 21 20 @@ -344,5 +344,9 @@ 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000032d49444154388db59531681c4714863f892dde8004b320c32e3870020b74458a6b0f5458e581c016a809a8496b42208454098604d2c4904a6954a410511ae752085b858c1208dc35221244b00119f60ac12ee860062c980719708a95a248f129459cd7cceeccf0edb76fff61a706830197d5ed765ff3166a30184c4d5d829fed3c7bdd5e6ce3bda71a5738ef301802e1d6d179477152303c1842bc822797a64fbf7b4a9a43be00ada817cb0e12011c2611205ccd73755f9c087c6b19bef0d7c100f5b8267d07caf10fe8ab9210156320fc01be16aa5a11043307f30b20a21041019985f48ef2f7fa0becc68e80475fd584e831b396f210f67795c3831a4940a3228925bb27f4d652ba4b01a199b73342f3981be0ca57745042ac30c632d853b6373d44b056c8ef0922508d94d14be59b2f4aeaf58cd5751069e06f3436890114332b9487d0bf80f61e64dc5f813c3790045453f67703fd4d4f7f6b4496b5597e689044af194f5f5e841800210478bee3d1a8f41e64acbe0f69ae6852e1cf0ccf7f74f4d652defbc042226c6f55e8f89f91bb6e9c387c9d521c9558db988a3416fe3c67e32b4779ec7167f0e8939ce19ea7fc5d298a80c875f03563930855ed2081bc05e91d5014ef53363eaf288e3d6285ee520a338e76c7a251a94e41e30470d3631004a262672e3eca59cec6978ef2b889979d11f2bb904af3be92081a416e28dfe831983920b1142345d5b0ff2234a6334276d7321ad53c795c511ca654a5a251996f19b83d158ef602b45a423d52f67703abeb29ee4ce9de4fc93378f218462f6b3efdb042cf3d59666977a0aa6fe9310888d25b13342afd4dcffeaee3d147399da540ab13f8f8b39c2cb3f8710d11ba2b96f9c57fcd7180287497a03ecde86f8dd8fe1a867b9ef6bb1612a84a871f6bd35b94e217a53832589970f2dcd85d9c7d4580d57521cbdaf4bfaf288e95e268d4ec8e60e72ccb0f2dbffea454e71e8d29f57882717152509482a48d8924b0bc12e82ee51445a03a6da079cbd0eec0fc22142b06620e89a3fc8d3783870743d814d2bc8994aa6ff286472e764902e5a96f72bbd3b4c37b280e95aa9e604c84e1cf978b37c74935797d7ae2ca7fac6968fe51ff0bf86dc30783c1d49f0baa9bb819e612310000000049454e44ae426082 - + + kmymoney/kmymoneyedit.h + kmymoney/kbudgetvalues.h + + diff --git a/kmymoney2/views/kcategoriesview.cpp b/kmymoney2/views/kcategoriesview.cpp index e01d62b..3c31f34 100644 --- a/kmymoney2/views/kcategoriesview.cpp +++ b/kmymoney2/views/kcategoriesview.cpp @@ -23,8 +23,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,44 +46,44 @@ #include "../kmymoney2.h" -KCategoriesView::KCategoriesView(QWidget *parent, const char *name ) : - KCategoriesViewDecl(parent, name), +KCategoriesView::KCategoriesView(TQWidget *tqparent, const char *name ) : + KCategoriesViewDecl(tqparent, name), m_incomeItem(0), m_expenseItem(0), m_needReload(false) { // create the searchline widget - // and insert it into the existing layout - m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->parentWidget()); - QVBoxLayout* layout = dynamic_cast(m_accountTree->parentWidget()->layout()); - if(layout) { - layout->insertWidget(0, m_searchWidget); + // and insert it into the existing tqlayout + m_searchWidget = new KListViewSearchLineWidget(m_accountTree, m_accountTree->tqparentWidget()); + TQVBoxLayout* tqlayout = dynamic_cast(m_accountTree->tqparentWidget()->tqlayout()); + if(tqlayout) { + tqlayout->insertWidget(0, m_searchWidget); } // setup icons for collapse and expand button KIconLoader *ic = KGlobal::iconLoader(); KGuiItem collapseGuiItem("", - QIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag-", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); KGuiItem expandGuiItem("", - QIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), - QString(), - QString()); + TQIconSet(ic->loadIcon("viewmag+", KIcon::Small, KIcon::SizeSmall)), + TQString(), + TQString()); m_collapseButton->setGuiItem(collapseGuiItem); m_expandButton->setGuiItem(expandGuiItem); m_accountTree->setSectionHeader(i18n("Category")); - connect(m_accountTree, SIGNAL(selectObject(const MyMoneyObject&)), this, SIGNAL(selectObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(openContextMenu(const MyMoneyObject&)), this, SIGNAL(openContextMenu(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(valueChanged(void)), this, SLOT(slotUpdateProfit(void))); - connect(m_accountTree, SIGNAL(openObject(const MyMoneyObject&)), this, SIGNAL(openObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_accountTree, TQT_SIGNAL(selectObject(const MyMoneyObject&)), this, TQT_SIGNAL(selectObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), this, TQT_SIGNAL(openContextMenu(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(valueChanged(void)), this, TQT_SLOT(slotUpdateProfit(void))); + connect(m_accountTree, TQT_SIGNAL(openObject(const MyMoneyObject&)), this, TQT_SIGNAL(openObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), this, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadAccounts())); - connect(m_collapseButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); - connect(m_expandButton, SIGNAL(clicked()), this, SLOT(slotExpandCollapse())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadAccounts())); + connect(m_collapseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); + connect(m_expandButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExpandCollapse())); } KCategoriesView::~KCategoriesView() @@ -118,7 +118,7 @@ void KCategoriesView::show(void) void KCategoriesView::polish(void) { KCategoriesViewDecl::polish(); - m_accountTree->setResizeMode(QListView::LastColumn); + m_accountTree->setResizeMode(TQListView::LastColumn); m_accountTree->restoreLayout("Category View Settings"); } @@ -134,15 +134,15 @@ void KCategoriesView::slotLoadAccounts(void) void KCategoriesView::loadAccounts(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load categories view"); // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -152,7 +152,7 @@ void KCategoriesView::loadAccounts(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -167,9 +167,9 @@ void KCategoriesView::loadAccounts(void) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList slist = file->currencyList(); + TQValueList slist = file->currencyList(); slist += file->securityList(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { m_securityMap[(*it_s).id()] = *it_s; } @@ -198,13 +198,13 @@ void KCategoriesView::loadAccounts(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -213,11 +213,11 @@ void KCategoriesView::loadAccounts(void) // reposition viewport m_accountTree->setContentsPos(startPoint.x(), startPoint.y()); - m_searchWidget->searchLine()->updateSearch(QString::null); + m_searchWidget->searchLine()->updateSearch(TQString()); // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); // and in case we need to show things expanded, we'll do so if(KMyMoneyGlobalSettings::showAccountsExpanded()) @@ -229,16 +229,16 @@ void KCategoriesView::loadAccounts(void) ::timetrace("done load categories view"); } -bool KCategoriesView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList) +bool KCategoriesView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList) { MyMoneyFile* file = MyMoneyFile::instance(); bool unused = false; - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { const MyMoneyAccount& acc = file->account(*it_a); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -260,7 +260,7 @@ bool KCategoriesView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QSt delete e; } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); unused |= loadSubAccounts(item, acc.accountList()); // no child accounts and not transactions in this account means 'unused' @@ -286,7 +286,7 @@ void KCategoriesView::slotUpdateProfit(void) MyMoneyMoney profit = m_incomeItem->totalValue() - m_expenseItem->totalValue(); - QString s(i18n("Profit: ")); + TQString s(i18n("Profit: ")); if(profit.isNegative()) s = i18n("Loss: "); @@ -294,13 +294,13 @@ void KCategoriesView::slotUpdateProfit(void) // if(!(file->totalValueValid(assetAccount.id()) & file->totalValueValid(liabilityAccount.id()))) // s += "~ "; - s.replace(QString(" "), QString(" ")); + s.tqreplace(TQString(" "), TQString(" ")); if(profit.isNegative()) { s += ""; } const MyMoneySecurity& sec = MyMoneyFile::instance()->baseCurrency(); - QString v(profit.abs().formatMoney(sec)); - s += v.replace(QString(" "), QString(" ")); + TQString v(profit.abs().formatMoney(sec)); + s += v.tqreplace(TQString(" "), TQString(" ")); if(profit.isNegative()) { s += ""; } diff --git a/kmymoney2/views/kcategoriesview.h b/kmymoney2/views/kcategoriesview.h index 4a6ad3c..d37e74d 100644 --- a/kmymoney2/views/kcategoriesview.h +++ b/kmymoney2/views/kcategoriesview.h @@ -45,7 +45,7 @@ class KListViewSearchLineWidget; * @author Michael Edwardes, Thomas Baumgart * * While named "categories view", this view actually displays all accounts - * that are children of the global "Income" and "Expense" accounts. Even though + * that are tqchildren of the global "Income" and "Expense" accounts. Even though * categories are internally just accounts as well, the distinction between * categories and accounts in the user interface is done for better * usability and clarity. @@ -63,8 +63,9 @@ class KListViewSearchLineWidget; class KCategoriesView : public KCategoriesViewDecl { Q_OBJECT + TQ_OBJECT public: - KCategoriesView(QWidget *parent=0, const char *name=0); + KCategoriesView(TQWidget *tqparent=0, const char *name=0); virtual ~KCategoriesView(); @@ -78,15 +79,15 @@ public slots: void show(void); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); protected: void loadAccounts(void); - bool loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QStringList& accountList); + bool loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQStringList& accountList); protected slots: void slotUpdateProfit(void); @@ -99,7 +100,7 @@ private: * * @param type account type as defined in MyMoneyAccount::accountTypeE */ - const QPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; + const TQPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; signals: /** @@ -121,16 +122,16 @@ signals: /** * This signal is emitted, when the user selected to reparent the - * account @p acc to be a subordinate account of @p parent. + * account @p acc to be a subordinate account of @p tqparent. * * @param acc const reference to account to be reparented - * @param parent const reference to new parent account + * @param tqparent const reference to new tqparent account */ - void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& parent); + void reparent(const MyMoneyAccount& acc, const MyMoneyAccount& tqparent); private: - QMap m_securityMap; - QMap m_transactionCountMap; + TQMap m_securityMap; + TQMap m_transactionCountMap; KMyMoneyAccountTreeItem* m_incomeItem; KMyMoneyAccountTreeItem* m_expenseItem; diff --git a/kmymoney2/views/kcategoriesviewdecl.ui b/kmymoney2/views/kcategoriesviewdecl.ui index 858cc54..7ede46b 100644 --- a/kmymoney2/views/kcategoriesviewdecl.ui +++ b/kmymoney2/views/kcategoriesviewdecl.ui @@ -1,6 +1,6 @@ KCategoriesViewDecl - + KCategoriesViewDecl @@ -27,9 +27,9 @@ false - + - layout5_2 + tqlayout5_2 @@ -67,7 +67,7 @@ Expanding - + 515 20 @@ -76,7 +76,7 @@ - + m_hiddenCategories @@ -84,9 +84,9 @@ Note: Unused categories are not shown as selected by settings. - + - layout5 + tqlayout5 @@ -102,18 +102,18 @@ Expanding - + 310 16 - + m_totalProfitsLabel - + 150 0 @@ -125,7 +125,7 @@ RichText - + WordBreak|AlignVCenter|AlignRight @@ -149,5 +149,8 @@ slotCollapseAll() - + + kmymoney/kmymoneyaccounttree.h + + diff --git a/kmymoney2/views/kforecastview.cpp b/kmymoney2/views/kforecastview.cpp index c7bcb0a..bf27e7f 100644 --- a/kmymoney2/views/kforecastview.cpp +++ b/kmymoney2/views/kforecastview.cpp @@ -17,12 +17,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -46,8 +46,8 @@ #include "../reports/pivottable.h" #include "../reports/pivotgrid.h" -KForecastView::KForecastView(QWidget *parent, const char *name) : - KForecastViewDecl(parent,name) +KForecastView::KForecastView(TQWidget *tqparent, const char *name) : + KForecastViewDecl(tqparent,name) { for(int i=0; i < MaxViewTabs; ++i) m_needReload[i] = false; @@ -56,11 +56,11 @@ KForecastView::KForecastView(QWidget *parent, const char *name) : config->setGroup("Last Use Settings"); m_tab->setCurrentPage(config->readNumEntry("KForecastView_LastType", 0)); - connect(m_tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotTabChanged(QWidget*))); + connect(m_tab, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(slotTabChanged(TQWidget*))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadForecast())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadForecast())); - connect(m_forecastButton, SIGNAL(clicked()), this, SLOT(slotManualForecast())); + connect(m_forecastButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotManualForecast())); m_forecastList->setAllColumnsShowFocus(true); m_summaryList->setAllColumnsShowFocus(true); @@ -68,7 +68,7 @@ KForecastView::KForecastView(QWidget *parent, const char *name) : m_advancedList->setAllColumnsShowFocus(true); m_forecastChart = new KReportChartView(m_tabChart, "forecastChart" ); - m_forecastChart->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_forecastChart->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); loadForecastSettings(); @@ -78,7 +78,7 @@ KForecastView::~KForecastView() { } -void KForecastView::slotTabChanged(QWidget* _tab) +void KForecastView::slotTabChanged(TQWidget* _tab) { ForecastViewTab tab = static_cast(m_tab->indexOf(_tab)); @@ -212,7 +212,7 @@ void KForecastView::loadListView(void) void KForecastView::loadSummaryView(void) { MyMoneyForecast forecast; - QValueList accList; + TQValueList accList; int dropMinimum; int dropZero; @@ -246,7 +246,7 @@ void KForecastView::loadSummaryView(void) //Get all accounts of the right type to calculate forecast m_nameIdx.clear(); accList = forecast.accountList(); - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; if(m_nameIdx[acc.id()] != acc.id()) { //Check if the account is there @@ -254,7 +254,7 @@ void KForecastView::loadSummaryView(void) } } - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for(it_nc = m_nameIdx.begin(); it_nc != m_nameIdx.end(); ++it_nc) { const MyMoneyAccount& acc = file->account(*it_nc); @@ -269,7 +269,7 @@ void KForecastView::loadSummaryView(void) } //Check if the account is going to be below zero or below the minimal balance in the forecast period - QString minimumBalance = acc.value("minimumBalance"); + TQString minimumBalance = acc.value("minimumBalance"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); //Check if the account is going to be below minimal balance @@ -279,7 +279,7 @@ void KForecastView::loadSummaryView(void) dropZero = forecast.daysToZeroBalance(acc); // spit out possible warnings - QString msg; + TQString msg; // if a minimum balance has been specified, an appropriate warning will // only be shown, if the drop below 0 is on a different day or not present @@ -292,14 +292,14 @@ void KForecastView::loadSummaryView(void) case -1: break; case 0: - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %2 is below the minimum balance %3 today.").arg(acc.name()).arg(minBalance.formatMoney(acc, currency)); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %2 is below the minimum balance %3 today.").tqarg(acc.name()).tqarg(minBalance.formatMoney(acc, currency)); + msg += TQString(""); break; default: - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").arg(acc.name()).arg(minBalance.formatMoney(acc, currency)).arg(dropMinimum-1); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").tqarg(acc.name()).tqarg(minBalance.formatMoney(acc, currency)).tqarg(dropMinimum-1); + msg += TQString(""); } if(!msg.isEmpty()) { @@ -308,31 +308,31 @@ void KForecastView::loadSummaryView(void) } // a drop below zero is always shown - msg = QString(); + msg = TQString(); switch(dropZero) { case -1: break; case 0: if(acc.accountGroup() == MyMoneyAccount::Asset) { - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %1 is below %2 today.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %1 is below %2 today.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)); + msg += TQString(""); break; } if(acc.accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 is above %2 today.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)); + msg = i18n("The balance of %1 is above %2 today.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)); break; } break; default: if(acc.accountGroup() == MyMoneyAccount::Asset) { - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The balance of %1 will drop below %2 in %3 days.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)).arg(dropZero); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The balance of %1 will drop below %2 in %3 days.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)).tqarg(dropZero); + msg += TQString(""); break; } if(acc.accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 will raise above %2 in %3 days.").arg(acc.name()).arg(MyMoneyMoney().formatMoney(acc, currency)).arg(dropZero); + msg = i18n("The balance of %1 will raise above %2 in %3 days.").tqarg(acc.name()).tqarg(MyMoneyMoney().formatMoney(acc, currency)).tqarg(dropZero); break; } } @@ -341,12 +341,12 @@ void KForecastView::loadSummaryView(void) } //advice about trends - msg = QString(); + msg = TQString(); MyMoneyMoney accCycleVariation = forecast.accountCycleVariation(acc); if (accCycleVariation < MyMoneyMoney(0, 1)) { - msg = QString("").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); - msg += i18n("The account %1 is decreasing %2 per cycle.").arg(acc.name()).arg(accCycleVariation.formatMoney(acc, currency)); - msg += QString(""); + msg = TQString("").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name()); + msg += i18n("The account %1 is decreasing %2 per cycle.").tqarg(acc.name()).tqarg(accCycleVariation.formatMoney(acc, currency)); + msg += TQString(""); } if(!msg.isEmpty()) { @@ -360,7 +360,7 @@ void KForecastView::loadSummaryView(void) void KForecastView::loadAdvancedView(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; + TQValueList accList; MyMoneySecurity baseCurrency = file->baseCurrency(); MyMoneyForecast forecast; int daysToBeginDay; @@ -376,7 +376,7 @@ void KForecastView::loadAdvancedView(void) //Get all accounts of the right type to calculate forecast m_nameIdx.clear(); accList = forecast.accountList(); - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; if(m_nameIdx[acc.id()] != acc.id()) { //Check if the account is there @@ -393,32 +393,32 @@ void KForecastView::loadAdvancedView(void) int accountColumn = m_advancedList->addColumn(i18n("Account"), -1); //if beginning of forecast is today, set the begin day to next cycle to avoid repeating the first cycle - if(QDate::currentDate() < forecast.beginForecastDate()) { - daysToBeginDay = QDate::currentDate().daysTo(forecast.beginForecastDate()); + if(TQDate::tqcurrentDate() < forecast.beginForecastDate()) { + daysToBeginDay = TQDate::tqcurrentDate().daysTo(forecast.beginForecastDate()); } else { daysToBeginDay = forecast.accountsCycle(); } //add columns for(int i = 1; ((i * forecast.accountsCycle()) + daysToBeginDay) <= forecast.forecastDays(); ++i) { - int col = m_advancedList->addColumn(i18n("Min Bal %1").arg(i), -1); - m_advancedList->setColumnAlignment(col, Qt::AlignRight); - m_advancedList->addColumn(i18n("Min Date %1").arg(i), -1); + int col = m_advancedList->addColumn(i18n("Min Bal %1").tqarg(i), -1); + m_advancedList->setColumnAlignment(col, TQt::AlignRight); + m_advancedList->addColumn(i18n("Min Date %1").tqarg(i), -1); } for(int i = 1; ((i * forecast.accountsCycle()) + daysToBeginDay) <= forecast.forecastDays(); ++i) { - int col = m_advancedList->addColumn(i18n("Max Bal %1").arg(i), -1); - m_advancedList->setColumnAlignment(col, Qt::AlignRight); - m_advancedList->addColumn(i18n("Max Date %1").arg(i), -1); + int col = m_advancedList->addColumn(i18n("Max Bal %1").tqarg(i), -1); + m_advancedList->setColumnAlignment(col, TQt::AlignRight); + m_advancedList->addColumn(i18n("Max Date %1").tqarg(i), -1); } int col = m_advancedList->addColumn(i18n("Average"), -1); - m_advancedList->setColumnAlignment(col, Qt::AlignRight); + m_advancedList->setColumnAlignment(col, TQt::AlignRight); m_advancedList->setSorting(-1); KMyMoneyForecastListViewItem *advancedItem = 0; - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for(it_nc = m_nameIdx.begin(); it_nc != m_nameIdx.end(); ++it_nc) { const MyMoneyAccount& acc = file->account(*it_nc); - QString amount; + TQString amount; MyMoneyMoney amountMM; MyMoneySecurity currency; @@ -436,35 +436,35 @@ void KForecastView::loadAdvancedView(void) int it_c = 1; // iterator for the columns of the listview //get minimum balance list - QValueList minBalanceList = forecast.accountMinimumBalanceDateList(acc); - QValueList::Iterator t_min; + TQValueList minBalanceList = forecast.accountMinimumBalanceDateList(acc); + TQValueList::Iterator t_min; for(t_min = minBalanceList.begin(); t_min != minBalanceList.end() ; ++t_min) { - QDate minDate = *t_min; + TQDate minDate = *t_min; amountMM = forecast.forecastBalance(acc, minDate); amount = amountMM.formatMoney(acc, currency); advancedItem->setText(it_c, amount, amountMM.isNegative()); it_c++; - QString dateString = KGlobal::locale()->formatDate(minDate, true); + TQString dateString = KGlobal::locale()->formatDate(minDate, true); advancedItem->setText(it_c, dateString, amountMM.isNegative()); it_c++; } //get maximum balance list - QValueList maxBalanceList = forecast.accountMaximumBalanceDateList(acc); - QValueList::Iterator t_max; + TQValueList maxBalanceList = forecast.accountMaximumBalanceDateList(acc); + TQValueList::Iterator t_max; for(t_max = maxBalanceList.begin(); t_max != maxBalanceList.end() ; ++t_max) { - QDate maxDate = *t_max; + TQDate maxDate = *t_max; amountMM = forecast.forecastBalance(acc, maxDate); amount = amountMM.formatMoney(acc, currency); advancedItem->setText(it_c, amount, amountMM.isNegative()); it_c++; - QString dateString = KGlobal::locale()->formatDate(maxDate, true); + TQString dateString = KGlobal::locale()->formatDate(maxDate, true); advancedItem->setText(it_c, dateString, amountMM.isNegative()); it_c++; } @@ -481,15 +481,15 @@ void KForecastView::loadBudgetView(void) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyForecast forecast; -// QValueList accList; +// TQValueList accList; m_budgetList->setBaseCurrency(file->baseCurrency()); //get the settings from current page and calculate this year based on last year - QDate historyEndDate = QDate(QDate::currentDate().year()-1, 12, 31); - QDate historyStartDate = historyEndDate.addDays(-m_accountsCycle->value() * m_forecastCycles->value()); - QDate forecastStartDate = QDate(QDate::currentDate().year(), 1, 1); - QDate forecastEndDate = QDate::currentDate().addDays(m_forecastDays->value()); + TQDate historyEndDate = TQDate(TQDate::tqcurrentDate().year()-1, 12, 31); + TQDate historyStartDate = historyEndDate.addDays(-m_accountsCycle->value() * m_forecastCycles->value()); + TQDate forecastStartDate = TQDate(TQDate::tqcurrentDate().year(), 1, 1); + TQDate forecastEndDate = TQDate::tqcurrentDate().addDays(m_forecastDays->value()); forecast.setHistoryMethod(m_historyMethod->selectedId()); MyMoneyBudget budget; @@ -513,10 +513,10 @@ void KForecastView::loadBudgetView(void) m_budgetList->show(); } -QValueList KForecastView::getAccountPrices(const MyMoneyAccount& acc) +TQValueList KForecastView::getAccountPrices(const MyMoneyAccount& acc) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.isInvest()) { @@ -543,7 +543,7 @@ void KForecastView::addAssetLiabilityRows(const MyMoneyForecast& forecast) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList basePrices; + TQValueList basePrices; m_assetItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->asset(), forecast, basePrices, file->baseCurrency() ); m_assetItem->setOpen(true); m_liabilityItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->liability(), forecast, basePrices, file->baseCurrency()); @@ -554,7 +554,7 @@ void KForecastView::addIncomeExpenseRows(const MyMoneyForecast& forecast) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList basePrices; + TQValueList basePrices; m_incomeItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->income(), forecast, basePrices, file->baseCurrency() ); m_incomeItem->setOpen(true); m_expenseItem = new KMyMoneyAccountTreeForecastItem( m_totalItem, file->expense(), forecast, basePrices, file->baseCurrency()); @@ -576,10 +576,10 @@ bool KForecastView::includeAccount(MyMoneyForecast& forecast, const MyMoneyAccou if( forecast.isForecastAccount(acc) ) return true; - QStringList accounts = acc.accountList(); + TQStringList accounts = acc.accountList(); if(accounts.size() > 0) { - QStringList::ConstIterator it_acc; + TQStringList::ConstIterator it_acc; for(it_acc = accounts.begin(); it_acc != accounts.end(); ++it_acc) { MyMoneyAccount account = file->account(*it_acc); if( includeAccount(forecast, account) ) @@ -589,10 +589,10 @@ bool KForecastView::includeAccount(MyMoneyForecast& forecast, const MyMoneyAccou return false; } -void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* parentItem, int forecastType ) +void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* tqparentItem, int forecastType ) { - QMap nameIdx; - QStringList accList; + TQMap nameIdx; + TQStringList accList; MyMoneyFile* file = MyMoneyFile::instance(); KMyMoneyAccountTreeForecastItem *forecastItem = 0; @@ -602,16 +602,16 @@ void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount if(accList.size() == 0) return; - QStringList::ConstIterator accList_t; + TQStringList::ConstIterator accList_t; for(accList_t = accList.begin(); accList_t != accList.end(); ++accList_t ) { MyMoneyAccount subAccount = file->account(*accList_t); - //only add the account if it is a forecast account or the parent of a forecast account + //only add the account if it is a forecast account or the tqparent of a forecast account if(includeAccount(forecast, subAccount)) { nameIdx[subAccount.id()] = subAccount.id(); } } - QMap::ConstIterator it_nc; + TQMap::ConstIterator it_nc; for(it_nc = nameIdx.begin(); it_nc != nameIdx.end(); ++it_nc) { const MyMoneyAccount subAccount = file->account(*it_nc); @@ -623,14 +623,14 @@ void KForecastView::loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount currency = file->security(subAccount.currencyId()); } - QString amount; - QString vAmount; + TQString amount; + TQString vAmount; MyMoneyMoney vAmountMM; //get prices - QValueList prices = getAccountPrices(subAccount); + TQValueList prices = getAccountPrices(subAccount); - forecastItem = new KMyMoneyAccountTreeForecastItem( parentItem, subAccount, forecast, prices, currency, static_cast(forecastType) ); + forecastItem = new KMyMoneyAccountTreeForecastItem( tqparentItem, subAccount, forecast, prices, currency, static_cast(forecastType) ); forecastItem->setOpen(true); loadAccounts(forecast, subAccount, forecastItem, forecastType); @@ -658,7 +658,7 @@ void KForecastView::loadChartView(void) reportCfg.setColumnsAreDays( true ); reportCfg.setConvertCurrency( true ); reportCfg.setIncludingForecast( true ); - reportCfg.setDateFilter(QDate::currentDate(),QDate::currentDate().addDays(m_forecastDays->value())); + reportCfg.setDateFilter(TQDate::tqcurrentDate(),TQDate::tqcurrentDate().addDays(m_forecastDays->value())); reports::PivotTable table(reportCfg); diff --git a/kmymoney2/views/kforecastview.h b/kmymoney2/views/kforecastview.h index 8beb24a..36de0e5 100644 --- a/kmymoney2/views/kforecastview.h +++ b/kmymoney2/views/kforecastview.h @@ -46,10 +46,11 @@ using namespace reports; class KForecastView : public KForecastViewDecl { Q_OBJECT + TQ_OBJECT private: public: - KForecastView(QWidget *parent=0, const char *name=0); + KForecastView(TQWidget *tqparent=0, const char *name=0); virtual ~KForecastView(); void show(void); @@ -69,7 +70,7 @@ protected: MaxViewTabs } ForecastViewTab; - QMap m_nameIdx; + TQMap m_nameIdx; /** @@ -108,21 +109,21 @@ protected: void loadForecastSettings(void); protected slots: - void slotTabChanged(QWidget*); + void slotTabChanged(TQWidget*); /** * Get the list of prices for an account * This is used later to create an instance of KMyMoneyAccountTreeForecastItem * */ - QValueList getAccountPrices(const MyMoneyAccount& acc); + TQValueList getAccountPrices(const MyMoneyAccount& acc); private: void addAssetLiabilityRows(const MyMoneyForecast& forecast); void addIncomeExpenseRows(const MyMoneyForecast& forecast); void addTotalRow(KMyMoneyAccountTreeForecast* forecastList, const MyMoneyForecast& forecast); bool includeAccount(MyMoneyForecast& forecast, const MyMoneyAccount& acc); - void loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* parentItem, int forecastType); + void loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* tqparentItem, int forecastType); bool m_needReload[MaxViewTabs]; KMyMoneyAccountTreeForecastItem* m_totalItem; diff --git a/kmymoney2/views/kforecastviewdecl.ui b/kmymoney2/views/kforecastviewdecl.ui index 6d2bf3b..3110bbf 100644 --- a/kmymoney2/views/kforecastviewdecl.ui +++ b/kmymoney2/views/kforecastviewdecl.ui @@ -1,6 +1,6 @@ KForecastViewDecl - + KForecastViewDecl @@ -19,7 +19,7 @@ 0 - + groupBox3 @@ -30,15 +30,15 @@ unnamed - + - layout16 + tqlayout16 unnamed - + textLabel1 @@ -54,7 +54,7 @@ Days to Forecast: - + m_forecastDays @@ -65,7 +65,7 @@ 1 - + textLabel3 @@ -81,7 +81,7 @@ Days of Accounts Cycle: - + m_accountsCycle @@ -100,7 +100,7 @@ 1 - + textLabel5 @@ -108,7 +108,7 @@ Day of Month to start Forecast: - + m_beginDay @@ -119,7 +119,7 @@ 0 - + textLabel4 @@ -127,7 +127,7 @@ Historic Cycles: - + m_forecastCycles @@ -138,7 +138,7 @@ 1 - + textLabel6 @@ -146,7 +146,7 @@ Chart Detail: - + All @@ -189,24 +189,24 @@ Expanding - + 16 31 - + - layout76 + tqlayout76 unnamed - + - layout17 + tqlayout17 @@ -216,7 +216,7 @@ unnamed - + textLabel2 @@ -232,7 +232,7 @@ Current Forecast Method: - + m_forecastMethod @@ -254,7 +254,7 @@ - + m_historyMethod @@ -265,7 +265,7 @@ unnamed - + radioButton11 @@ -276,7 +276,7 @@ 0 - + radioButton12 @@ -287,7 +287,7 @@ 1 - + radioButton12 @@ -312,16 +312,16 @@ Expanding - + 21 6 - + - layout75 + tqlayout75 @@ -345,7 +345,7 @@ Expanding - + 31 21 @@ -369,7 +369,7 @@ - + m_tab @@ -381,7 +381,7 @@ 1 - + summary @@ -470,7 +470,7 @@ AutoOneFit - + New Item @@ -502,7 +502,7 @@ - + detail @@ -526,7 +526,7 @@ - + advanced @@ -550,7 +550,7 @@ - + budget @@ -574,7 +574,7 @@ - + m_tabChart @@ -610,5 +610,5 @@ - + diff --git a/kmymoney2/views/kgloballedgerview.cpp b/kmymoney2/views/kgloballedgerview.cpp index bf95e50..981f5e1 100644 --- a/kmymoney2/views/kgloballedgerview.cpp +++ b/kmymoney2/views/kgloballedgerview.cpp @@ -20,9 +20,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -65,26 +65,26 @@ public: MousePressFilter* m_mousePressFilter; KMyMoneyRegister::RegisterSearchLineWidget* m_registerSearchLine; - QPoint m_startPoint; - QString m_reconciliationAccount; - QDate m_reconciliationDate; + TQPoint m_startPoint; + TQString m_reconciliationAccount; + TQDate m_reconciliationDate; MyMoneyMoney m_endingBalance; int m_precision; bool m_inLoading; bool m_recursion; bool m_showDetails; KMyMoneyRegister::Action m_action; - QTimer m_viewPosTimer; + TQTimer m_viewPosTimer; }; -MousePressFilter::MousePressFilter(QWidget* parent, const char* name) : - QObject(parent, name), +MousePressFilter::MousePressFilter(TQWidget* tqparent, const char* name) : + TQObject(tqparent, name), m_lastMousePressEvent(0), m_filterActive(true) { } -void MousePressFilter::addWidget(QWidget* w) +void MousePressFilter::addWidget(TQWidget* w) { m_parents.append(w); } @@ -94,27 +94,27 @@ void MousePressFilter::setFilterActive(bool state) m_filterActive = state; } -bool MousePressFilter::isChildOf( QWidget* child, QWidget *parent ) +bool MousePressFilter::isChildOf( TQWidget* child, TQWidget *tqparent ) { while(child) { - if(child == parent) + if(child == tqparent) return true; // If one of the ancestors is a KPassivePopup then it's as // if it is a child of our own if(dynamic_cast(child)) return true; - child = child->parentWidget(); + child = child->tqparentWidget(); } return false; } -bool MousePressFilter::eventFilter(QObject* o, QEvent* e) +bool MousePressFilter::eventFilter(TQObject* o, TQEvent* e) { if(m_filterActive) { - if(e->type() == QEvent::MouseButtonPress && !m_lastMousePressEvent) { - QValueList::const_iterator it_w; + if(e->type() == TQEvent::MouseButtonPress && !m_lastMousePressEvent) { + TQValueList::const_iterator it_w; for(it_w = m_parents.begin(); it_w != m_parents.end(); ++it_w) { - if(isChildOf((QWidget*)o, (*it_w))) { + if(isChildOf((TQWidget*)o, (*it_w))) { m_lastMousePressEvent = e; break; } @@ -126,7 +126,7 @@ bool MousePressFilter::eventFilter(QObject* o, QEvent* e) } } - if(e->type() != QEvent::MouseButtonPress) { + if(e->type() != TQEvent::MouseButtonPress) { m_lastMousePressEvent = 0; } } @@ -143,21 +143,21 @@ KGlobalLedgerView::Private::Private() : { } -QDate KGlobalLedgerView::m_lastPostDate; +TQDate KGlobalLedgerView::m_lastPostDate; -KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name ) - : KMyMoneyViewBase(parent, name, i18n("Ledgers")), +KGlobalLedgerView::KGlobalLedgerView(TQWidget *tqparent, const char *name ) + : KMyMoneyViewBase(tqparent, name, i18n("Ledgers")), d(new Private), m_needReload(false), m_newAccountLoaded(true), m_inEditMode(false) { - d->m_mousePressFilter = new MousePressFilter((QWidget*)this); + d->m_mousePressFilter = new MousePressFilter((TQWidget*)this); d->m_action = KMyMoneyRegister::ActionNone;; // create the toolbar frame at the top of the view - m_toolbarFrame = new QFrame(this); - QVBoxLayout* toolbarLayout = new QVBoxLayout(m_toolbarFrame, 0, 0); + m_toolbarFrame = new TQFrame(this); + TQVBoxLayout* toolbarLayout = new TQVBoxLayout(m_toolbarFrame, 0, 0); m_toolbar = new KToolBar(m_toolbarFrame, 0, true); toolbarLayout->addWidget(m_toolbar); @@ -176,21 +176,21 @@ KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name ) //m_toolbar->setMaximumSize(50,20); m_toolbar->alignItemRight(1); #endif - m_toolbar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - layout()->addWidget(m_toolbarFrame); + m_toolbar->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed); + tqlayout()->addWidget(m_toolbarFrame); // create the register frame - m_registerFrame = new QFrame(this); - QVBoxLayout* registerFrameLayout = new QVBoxLayout(m_registerFrame, 0, 0); - layout()->addWidget(m_registerFrame); - layout()->setStretchFactor(m_registerFrame, 2); + m_registerFrame = new TQFrame(this); + TQVBoxLayout* registerFrameLayout = new TQVBoxLayout(m_registerFrame, 0, 0); + tqlayout()->addWidget(m_registerFrame); + tqlayout()->setStretchFactor(m_registerFrame, 2); m_register = new KMyMoneyRegister::Register(m_registerFrame); registerFrameLayout->addWidget(m_register); m_register->installEventFilter(this); - connect(m_register, SIGNAL(openContextMenu()), this, SIGNAL(openContextMenu())); - connect(m_register, SIGNAL(headerClicked()), this, SLOT(slotSortOptions())); - connect(m_register, SIGNAL(reconcileStateColumnClicked(KMyMoneyRegister::Transaction*)), this, SLOT(slotToggleTransactionMark(KMyMoneyRegister::Transaction*))); - connect(&d->m_viewPosTimer, SIGNAL(timeout()), this, SLOT(slotUpdateViewPos())); + connect(m_register, TQT_SIGNAL(openContextMenu()), this, TQT_SIGNAL(openContextMenu())); + connect(m_register, TQT_SIGNAL(headerClicked()), this, TQT_SLOT(slotSortOptions())); + connect(m_register, TQT_SIGNAL(reconcileStateColumnClicked(KMyMoneyRegister::Transaction*)), this, TQT_SLOT(slotToggleTransactionMark(KMyMoneyRegister::Transaction*))); + connect(&d->m_viewPosTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotUpdateViewPos())); // insert search line widget @@ -198,24 +198,24 @@ KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name ) m_toolbar->setStretchableWidget(d->m_registerSearchLine); // create the summary frame - m_summaryFrame = new QFrame(this); - QHBoxLayout* summaryFrameLayout = new QHBoxLayout(m_summaryFrame, 0, 0); - m_leftSummaryLabel = new QLabel(m_summaryFrame); - m_centerSummaryLabel = new QLabel(m_summaryFrame); - m_rightSummaryLabel = new QLabel(m_summaryFrame); + m_summaryFrame = new TQFrame(this); + TQHBoxLayout* summaryFrameLayout = new TQHBoxLayout(m_summaryFrame, 0, 0); + m_leftSummaryLabel = new TQLabel(m_summaryFrame); + m_centerSummaryLabel = new TQLabel(m_summaryFrame); + m_rightSummaryLabel = new TQLabel(m_summaryFrame); summaryFrameLayout->addWidget(m_leftSummaryLabel); - QSpacerItem* spacer = new QSpacerItem( 20, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); summaryFrameLayout->addItem(spacer); summaryFrameLayout->addWidget(m_centerSummaryLabel); - spacer = new QSpacerItem( 20, 1, QSizePolicy::Expanding, QSizePolicy::Minimum ); + spacer = new TQSpacerItem( 20, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); summaryFrameLayout->addItem(spacer); summaryFrameLayout->addWidget(m_rightSummaryLabel); - layout()->addWidget(m_summaryFrame); + tqlayout()->addWidget(m_summaryFrame); // create the button frame - m_buttonFrame = new QFrame(this); - QVBoxLayout* buttonLayout = new QVBoxLayout(m_buttonFrame, 0, 0); - layout()->addWidget(m_buttonFrame); + m_buttonFrame = new TQFrame(this); + TQVBoxLayout* buttonLayout = new TQVBoxLayout(m_buttonFrame, 0, 0); + tqlayout()->addWidget(m_buttonFrame); m_buttonbar = new KToolBar(m_buttonFrame, 0, true); m_buttonbar->setIconText(KToolBar::IconTextRight); buttonLayout->addWidget(m_buttonbar); @@ -229,26 +229,26 @@ KGlobalLedgerView::KGlobalLedgerView(QWidget *parent, const char *name ) kmymoney2->action("transaction_match")->plug(m_buttonbar); // create the transaction form frame - m_formFrame = new QFrame(this); - QVBoxLayout* frameLayout = new QVBoxLayout(m_formFrame, 5, 0); + m_formFrame = new TQFrame(this); + TQVBoxLayout* frameLayout = new TQVBoxLayout(m_formFrame, 5, 0); m_form = new KMyMoneyTransactionForm::TransactionForm(m_formFrame); frameLayout->addWidget(m_form->tabBar(m_formFrame)); frameLayout->addWidget(m_form); - m_formFrame->setFrameShape( QFrame::Panel ); - m_formFrame->setFrameShadow( QFrame::Raised ); - layout()->addWidget(m_formFrame); - - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadView())); - connect(m_register, SIGNAL(focusChanged(KMyMoneyRegister::Transaction*)), m_form, SLOT(slotSetTransaction(KMyMoneyRegister::Transaction*))); - connect(m_register, SIGNAL(focusChanged()), kmymoney2, SLOT(slotUpdateActions())); - connect(m_accountComboBox, SIGNAL(accountSelected(const QString&)), this, SLOT(slotSelectAccount(const QString&))); - connect(m_register, SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&))); - connect(m_register, SIGNAL(editTransaction()), this, SIGNAL(startEdit())); - connect(m_register, SIGNAL(emptyItemSelected()), this, SLOT(slotNewTransaction())); - connect(m_register, SIGNAL(aboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&)), this, SLOT(slotAboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&))); - connect(d->m_mousePressFilter, SIGNAL(mousePressedOnExternalWidget(bool&)), this, SIGNAL(cancelOrEndEdit(bool&))); - - connect(m_form, SIGNAL(newTransaction(KMyMoneyRegister::Action)), this, SLOT(slotNewTransaction(KMyMoneyRegister::Action))); + m_formFrame->setFrameShape( TQFrame::Panel ); + m_formFrame->setFrameShadow( TQFrame::Raised ); + tqlayout()->addWidget(m_formFrame); + + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadView())); + connect(m_register, TQT_SIGNAL(focusChanged(KMyMoneyRegister::Transaction*)), m_form, TQT_SLOT(slotSetTransaction(KMyMoneyRegister::Transaction*))); + connect(m_register, TQT_SIGNAL(focusChanged()), kmymoney2, TQT_SLOT(slotUpdateActions())); + connect(m_accountComboBox, TQT_SIGNAL(accountSelected(const TQString&)), this, TQT_SLOT(slotSelectAccount(const TQString&))); + connect(m_register, TQT_SIGNAL(selectionChanged(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&))); + connect(m_register, TQT_SIGNAL(editTransaction()), this, TQT_SIGNAL(startEdit())); + connect(m_register, TQT_SIGNAL(emptyItemSelected()), this, TQT_SLOT(slotNewTransaction())); + connect(m_register, TQT_SIGNAL(aboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&)), this, TQT_SLOT(slotAboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&))); + connect(d->m_mousePressFilter, TQT_SIGNAL(mousePressedOnExternalWidget(bool&)), this, TQT_SIGNAL(cancelOrEndEdit(bool&))); + + connect(m_form, TQT_SIGNAL(newTransaction(KMyMoneyRegister::Action)), this, TQT_SLOT(slotNewTransaction(KMyMoneyRegister::Action))); // setup mouse press filter d->m_mousePressFilter->addWidget(m_formFrame); @@ -287,8 +287,8 @@ void KGlobalLedgerView::clear(void) m_register->clear(); // setup header font - QFont font = KMyMoneyGlobalSettings::listHeaderFont(); - QFontMetrics fm( font ); + TQFont font = KMyMoneyGlobalSettings::listHeaderFont(); + TQFontMetrics fm( font ); int height = fm.lineSpacing()+6; m_register->horizontalHeader()->setMinimumHeight(height); m_register->horizontalHeader()->setMaximumHeight(height); @@ -305,7 +305,7 @@ void KGlobalLedgerView::clear(void) m_transactionList.clear(); // and the selected account in the combo box - m_accountComboBox->setSelected(QString()); + m_accountComboBox->setSelected(TQString()); // fraction defaults to two digits d->m_precision = 2; @@ -324,12 +324,12 @@ void KGlobalLedgerView::loadView(void) KMyMoneyRegister::SelectedTransactions list; emit transactionsSelected(list); - QMap isSelected; - QString focusItemId; - QString anchorItemId; + TQMap isSelected; + TQString focusItemId; + TQString anchorItemId; if(!d->m_inLoading) - d->m_startPoint = QPoint(-1, -1); + d->m_startPoint = TQPoint(-1, -1); if(!m_newAccountLoaded) { // remember the current selected transactions @@ -348,11 +348,11 @@ void KGlobalLedgerView::loadView(void) // remember the upper left corner of the viewport if(!d->m_inLoading && d->m_showDetails == KMyMoneyGlobalSettings::showRegisterDetailed()) - d->m_startPoint = QPoint(m_register->contentsX(), m_register->contentsY()); + d->m_startPoint = TQPoint(m_register->contentsX(), m_register->contentsY()); } else { if(d->m_viewPosTimer.isActive()) d->m_viewPosTimer.stop(); - d->m_startPoint = QPoint(-1, -1); + d->m_startPoint = TQPoint(-1, -1); d->m_inLoading = false; d->m_registerSearchLine->searchLine()->reset(); } @@ -381,14 +381,14 @@ void KGlobalLedgerView::loadView(void) // ... and recreate it KMyMoneyRegister::RegisterItem* focusItem = 0; KMyMoneyRegister::RegisterItem* anchorItem = 0; - QMap actBalance, clearedBalance, futureBalance; - QMap::iterator it_b; + TQMap actBalance, clearedBalance, futureBalance; + TQMap::iterator it_b; try { // setup the filter to select the transactions we want to display // and update the sort order - QString sortOrder; - QString key; - QDate reconciliationDate = d->m_reconciliationDate; + TQString sortOrder; + TQString key; + TQDate reconciliationDate = d->m_reconciliationDate; MyMoneyTransactionFilter filter(m_account.id()); // if it's an investment account, we also take care of @@ -402,7 +402,7 @@ void KGlobalLedgerView::loadView(void) filter.addState(MyMoneyTransactionFilter::notReconciled); filter.addState(MyMoneyTransactionFilter::cleared); } else { - filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), QDate()); + filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), TQDate()); key = "kmm-sort-std"; sortOrder = KMyMoneyGlobalSettings::sortNormalView(); if (KMyMoneyGlobalSettings::hideReconciledTransactions() @@ -426,8 +426,8 @@ void KGlobalLedgerView::loadView(void) kmymoney2->slotStatusProgressBar(0, m_transactionList.count()); // create the elements for the register - QValueList >::const_iterator it; - QMapuniqueMap; + TQValueList >::const_iterator it; + TQMapuniqueMap; int i = 0; for(it = m_transactionList.begin(); it != m_transactionList.end(); ++it) { uniqueMap[(*it).first.id()]++; @@ -448,10 +448,10 @@ void KGlobalLedgerView::loadView(void) // show scheduled transactions which have a scheduled postdate // within the next 'period' days. In reconciliation mode, the // period starts on the statement date. - QDate endDate = QDate::currentDate().addDays(period); + TQDate endDate = TQDate::tqcurrentDate().addDays(period); if(isReconciliationAccount()) endDate = reconciliationDate.addDays(period); - QValueList scheduleList = MyMoneyFile::instance()->scheduleList(m_account.id()); + TQValueList scheduleList = MyMoneyFile::instance()->scheduleList(m_account.id()); while(scheduleList.count() > 0){ MyMoneySchedule& s = scheduleList.first(); for(;;) { @@ -464,11 +464,11 @@ void KGlobalLedgerView::loadView(void) // certainly be posted in the past. So we take todays date // as the alternative if(s.isOverdue()) - t.setPostDate(QDate::currentDate()); + t.setPostDate(TQDate::tqcurrentDate()); else t.setPostDate(s.adjustedNextDueDate()); - const QValueList& splits = t.splits(); - QValueList::const_iterator it_s; + const TQValueList& splits = t.splits(); + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { if((*it_s).accountId() == m_account.id()) { new KMyMoneyRegister::StdTransactionScheduled(m_register, t, *it_s, uniqueMap[t.id()]); @@ -476,7 +476,7 @@ void KGlobalLedgerView::loadView(void) } // keep track of this payment locally (not in the engine) if(s.isOverdue()) - s.setLastPayment(QDate::currentDate()); + s.setLastPayment(TQDate::tqcurrentDate()); else s.setLastPayment(s.nextDueDate()); @@ -528,7 +528,7 @@ void KGlobalLedgerView::loadView(void) actBalance[m_account.id()] = MyMoneyMoney(); if(m_account.accountType() == MyMoneyAccount::Investment) { - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = m_account.accountList().begin(); it_a != m_account.accountList().end(); ++it_a) { actBalance[*it_a] = MyMoneyMoney(); } @@ -544,10 +544,10 @@ void KGlobalLedgerView::loadView(void) || m_account.accountGroup() == MyMoneyAccount::Equity) factor = -factor; - QMap deposits; - QMap payments; - QMap depositAmount; - QMap paymentAmount; + TQMap deposits; + TQMap payments; + TQMap depositAmount; + TQMap paymentAmount; for(it_b = actBalance.begin(); it_b != actBalance.end(); ++it_b) { MyMoneyMoney balance = MyMoneyFile::instance()->balance(it_b.key()); balance = balance * factor; @@ -590,7 +590,7 @@ void KGlobalLedgerView::loadView(void) while(p) { KMyMoneyRegister::Transaction* t = dynamic_cast(p); if(t) { - if(isSelected.contains(t->id())) + if(isSelected.tqcontains(t->id())) t->setSelected(true); if(t->id() == focusItemId) @@ -629,7 +629,7 @@ void KGlobalLedgerView::loadView(void) } } - if(t->transaction().postDate() > QDate::currentDate()) { + if(t->transaction().postDate() > TQDate::tqcurrentDate()) { tracer.printf("Reducing actual balance by %s because %s/%s(%s) is in the future", (split.shares() * factor).formatMoney("", 2).data(), t->transaction().id().data(), split.id().data(), t->transaction().postDate().toString(Qt::ISODate).data()); actBalance[split.accountId()] -= split.shares() * factor; } @@ -652,11 +652,11 @@ void KGlobalLedgerView::loadView(void) arg(paymentAmount[m_account.id()].abs().formatMoney(m_account.fraction())) ); } if(pStatement) { - pStatement->setText(i18n("%1 payments (%2)").arg(payments[m_account.id()]). + pStatement->setText(i18n("%1 payments (%2)").tqarg(payments[m_account.id()]). arg(paymentAmount[m_account.id()].abs().formatMoney(m_account.fraction())) ); } if(dStatement) { - dStatement->setText(i18n("%1 deposits (%2)").arg(deposits[m_account.id()]). + dStatement->setText(i18n("%1 deposits (%2)").tqarg(deposits[m_account.id()]). arg(depositAmount[m_account.id()].abs().formatMoney(m_account.fraction())) ); } @@ -699,9 +699,9 @@ void KGlobalLedgerView::loadView(void) // (re-)position viewport if(m_newAccountLoaded) { if(focusItem) { - d->m_startPoint = QPoint(-1, -1); + d->m_startPoint = TQPoint(-1, -1); } else { - d->m_startPoint = QPoint(0, 0); + d->m_startPoint = TQPoint(0, 0); } } if(!d->m_inLoading) { @@ -715,7 +715,7 @@ void KGlobalLedgerView::loadView(void) emit accountSelected(m_account); } -void KGlobalLedgerView::updateSummaryLine(const QMap& actBalance, const QMap& clearedBalance) +void KGlobalLedgerView::updateSummaryLine(const TQMap& actBalance, const TQMap& clearedBalance) { MyMoneyFile* file = MyMoneyFile::instance(); m_leftSummaryLabel->show(); @@ -724,24 +724,24 @@ void KGlobalLedgerView::updateSummaryLine(const QMap& act if(isReconciliationAccount()) { if(m_account.accountType() != MyMoneyAccount::Investment) { - m_leftSummaryLabel->setText(i18n("Statement: %1").arg(d->m_endingBalance.formatMoney("", d->m_precision))); - m_centerSummaryLabel->setText(i18n("Cleared: %1").arg(clearedBalance[m_account.id()].formatMoney("", d->m_precision))); - m_rightSummaryLabel->setText(i18n("Difference: %1").arg((clearedBalance[m_account.id()] - d->m_endingBalance).formatMoney("", d->m_precision))); + m_leftSummaryLabel->setText(i18n("Statement: %1").tqarg(d->m_endingBalance.formatMoney("", d->m_precision))); + m_centerSummaryLabel->setText(i18n("Cleared: %1").tqarg(clearedBalance[m_account.id()].formatMoney("", d->m_precision))); + m_rightSummaryLabel->setText(i18n("Difference: %1").tqarg((clearedBalance[m_account.id()] - d->m_endingBalance).formatMoney("", d->m_precision))); } } else { // update summary line in normal mode - QDate reconcileDate = m_account.lastReconciliationDate(); + TQDate reconcileDate = m_account.lastReconciliationDate(); if(reconcileDate.isValid()) { - m_leftSummaryLabel->setText(i18n("Last reconciled: %1").arg(KGlobal::locale()->formatDate(reconcileDate, true))); + m_leftSummaryLabel->setText(i18n("Last reconciled: %1").tqarg(KGlobal::locale()->formatDate(reconcileDate, true))); } else { m_leftSummaryLabel->setText(i18n("Never reconciled")); } m_rightSummaryLabel->setPaletteForegroundColor(m_leftSummaryLabel->paletteForegroundColor()); if(m_account.accountType() != MyMoneyAccount::Investment) { - m_centerSummaryLabel->setText(i18n("Cleared: %1").arg(clearedBalance[m_account.id()].formatMoney("", d->m_precision))); - m_rightSummaryLabel->setText(i18n("Balance: %1").arg(actBalance[m_account.id()].formatMoney("", d->m_precision))); + m_centerSummaryLabel->setText(i18n("Cleared: %1").tqarg(clearedBalance[m_account.id()].formatMoney("", d->m_precision))); + m_rightSummaryLabel->setText(i18n("Balance: %1").tqarg(actBalance[m_account.id()].formatMoney("", d->m_precision))); bool showNegative = actBalance[m_account.id()].isNegative(); if(m_account.accountGroup() == MyMoneyAccount::Liability && !actBalance[m_account.id()].isZero()) showNegative = !showNegative; @@ -752,11 +752,11 @@ void KGlobalLedgerView::updateSummaryLine(const QMap& act m_centerSummaryLabel->hide(); MyMoneyMoney balance; MyMoneySecurity base = file->baseCurrency(); - QMap::const_iterator it_b; + TQMap::const_iterator it_b; bool approx = false; for(it_b = actBalance.begin(); it_b != actBalance.end(); ++it_b) { MyMoneyAccount stock = file->account(it_b.key()); - QString currencyId = stock.currencyId(); + TQString currencyId = stock.currencyId(); MyMoneySecurity sec = file->security(currencyId); MyMoneyPrice priceInfo; MyMoneyMoney rate(1,1); @@ -775,7 +775,7 @@ void KGlobalLedgerView::updateSummaryLine(const QMap& act } balance += ((*it_b) * rate).convert(base.smallestAccountFraction()); } - m_rightSummaryLabel->setText(i18n("Investment value: %1%2").arg(approx ? "~" : "").arg(balance.formatMoney(base.tradingSymbol(), d->m_precision))); + m_rightSummaryLabel->setText(i18n("Investment value: %1%2").tqarg(approx ? "~" : "").tqarg(balance.formatMoney(base.tradingSymbol(), d->m_precision))); } } } @@ -784,18 +784,18 @@ void KGlobalLedgerView::slotUpdateViewPos(void) { m_register->setUpdatesEnabled(true); - if(d->m_startPoint == QPoint(-1, -1)) { + if(d->m_startPoint == TQPoint(-1, -1)) { m_register->ensureItemVisible(m_register->focusItem()); m_register->updateContents(); } else { m_register->setContentsPos(d->m_startPoint.x(), d->m_startPoint.y()); - m_register->repaintContents(); + m_register->tqrepaintContents(); } d->m_inLoading = false; } -void KGlobalLedgerView::resizeEvent(QResizeEvent* ev) +void KGlobalLedgerView::resizeEvent(TQResizeEvent* ev) { m_register->resize(KMyMoneyRegister::DetailColumn); m_form->resize(KMyMoneyTransactionForm::ValueColumn1); @@ -820,9 +820,9 @@ void KGlobalLedgerView::loadAccounts(void) m_accountComboBox->loadList((KMyMoneyUtils::categoryTypeE)(KMyMoneyUtils::asset | KMyMoneyUtils::liability)); if(m_account.id().isEmpty()) { - QStringList list = m_accountComboBox->accountList(); + TQStringList list = m_accountComboBox->accountList(); if(list.count()) { - QStringList::Iterator it; + TQStringList::Iterator it; for(it = list.begin(); it != list.end(); ++it) { MyMoneyAccount a = file->account(*it); if(!a.isInvest()) { @@ -849,7 +849,7 @@ void KGlobalLedgerView::loadAccounts(void) } } -void KGlobalLedgerView::selectTransaction(const QString& id) +void KGlobalLedgerView::selectTransaction(const TQString& id) { if(!id.isEmpty()) { KMyMoneyRegister::RegisterItem* p = m_register->lastItem(); @@ -879,14 +879,14 @@ void KGlobalLedgerView::slotSelectAllTransactions(void) } p = p->nextItem(); } - m_register->repaintItems(); + m_register->tqrepaintItems(); // inform everyone else about the selected items KMyMoneyRegister::SelectedTransactions list(m_register); emit transactionsSelected(list); } -void KGlobalLedgerView::slotSetReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +void KGlobalLedgerView::slotSetReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { if(d->m_reconciliationAccount != acc.id()) { // make sure the account is selected @@ -935,7 +935,7 @@ bool KGlobalLedgerView::slotSelectAccount(const MyMoneyObject& obj) return rc; } -bool KGlobalLedgerView::slotSelectAccount(const QString& id, const QString& transactionId) +bool KGlobalLedgerView::slotSelectAccount(const TQString& id, const TQString& transactionId) { bool rc = true; @@ -944,9 +944,9 @@ bool KGlobalLedgerView::slotSelectAccount(const QString& id, const QString& tran try { m_account = MyMoneyFile::instance()->account(id); // if a stock account is selected, we show the - // the corresponding parent (investment) account + // the corresponding tqparent (investment) account if(m_account.isInvest()) { - m_account = MyMoneyFile::instance()->account(m_account.parentAccountId()); + m_account = MyMoneyFile::instance()->account(m_account.tqparentAccountId()); } m_newAccountLoaded = true; slotLoadView(); @@ -1089,14 +1089,14 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected } // decide, if we edit in the register or in the form - TransactionEditorContainer* parent; + TransactionEditorContainer* tqparent; if(m_formFrame->isVisible()) - parent = m_form; + tqparent = m_form; else { - parent = m_register; + tqparent = m_register; } - editor = item->createEditor(parent, list, m_lastPostDate); + editor = item->createEditor(tqparent, list, m_lastPostDate); // check that we use the same transaction commodity in all selected transactions // if not, we need to update this in the editor's list. The user can also bail out @@ -1111,27 +1111,27 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected } if(editor) { - if(parent == m_register) { + if(tqparent == m_register) { // make sure, the height of the table is correct m_register->updateRegister(KMyMoneyGlobalSettings::ledgerLens() | !KMyMoneyGlobalSettings::transactionForm()); } m_inEditMode = true; - connect(editor, SIGNAL(transactionDataSufficient(bool)), kmymoney2->action("transaction_enter"), SLOT(setEnabled(bool))); - connect(editor, SIGNAL(returnPressed()), kmymoney2->action("transaction_enter"), SLOT(activate())); - connect(editor, SIGNAL(escapePressed()), kmymoney2->action("transaction_cancel"), SLOT(activate())); + connect(editor, TQT_SIGNAL(transactionDataSufficient(bool)), kmymoney2->action("transaction_enter"), TQT_SLOT(setEnabled(bool))); + connect(editor, TQT_SIGNAL(returnPressed()), kmymoney2->action("transaction_enter"), TQT_SLOT(activate())); + connect(editor, TQT_SIGNAL(escapePressed()), kmymoney2->action("transaction_cancel"), TQT_SLOT(activate())); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), editor, SLOT(slotReloadEditWidgets())); - connect(editor, SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&))); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), editor, TQT_SLOT(slotReloadEditWidgets())); + connect(editor, TQT_SIGNAL(finishEdit(const KMyMoneyRegister::SelectedTransactions&)), this, TQT_SLOT(slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions&))); - connect(editor, SIGNAL(objectCreation(bool)), d->m_mousePressFilter, SLOT(setFilterDeactive(bool))); - connect(editor, SIGNAL(createPayee(const QString&, QString&)), kmymoney2, SLOT(slotPayeeNew(const QString&, QString&))); - connect(editor, SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); - connect(editor, SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&))); - connect(editor, SIGNAL(assignNumber(void)), kmymoney2, SLOT(slotTransactionAssignNumber())); - connect(editor, SIGNAL(lastPostDateUsed(const QDate&)), this, SLOT(slotKeepPostDate(const QDate&))); + connect(editor, TQT_SIGNAL(objectCreation(bool)), d->m_mousePressFilter, TQT_SLOT(setFilterDeactive(bool))); + connect(editor, TQT_SIGNAL(createPayee(const TQString&, TQString&)), kmymoney2, TQT_SLOT(slotPayeeNew(const TQString&, TQString&))); + connect(editor, TQT_SIGNAL(createCategory(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotCategoryNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(editor, TQT_SIGNAL(createSecurity(MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotInvestmentNew(MyMoneyAccount&, const MyMoneyAccount&))); + connect(editor, TQT_SIGNAL(assignNumber(void)), kmymoney2, TQT_SLOT(slotTransactionAssignNumber())); + connect(editor, TQT_SIGNAL(lastPostDateUsed(const TQDate&)), this, TQT_SLOT(slotKeepPostDate(const TQDate&))); - // create the widgets, place them in the parent and load them with data + // create the widgets, place them in the tqparent and load them with data // setup tab order m_tabOrderWidgets.clear(); editor->setup(m_tabOrderWidgets, m_account, d->m_action); @@ -1139,22 +1139,22 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected Q_ASSERT(!m_tabOrderWidgets.isEmpty()); // install event filter in all taborder widgets - for(QWidget* w = m_tabOrderWidgets.first(); w; w = m_tabOrderWidgets.next()) { + for(TQWidget* w = m_tabOrderWidgets.first(); w; w = m_tabOrderWidgets.next()) { w->installEventFilter(this); } // Install a filter that checks if a mouse press happened outside // of one of our own widgets. - qApp->installEventFilter(d->m_mousePressFilter); + tqApp->installEventFilter(d->m_mousePressFilter); // Check if the editor has some preference on where to set the focus // If not, set the focus to the first widget in the tab order - QWidget* focusWidget = editor->firstWidget(); - if(!focusWidget) - focusWidget = m_tabOrderWidgets.first(); + TQWidget* tqfocusWidget = editor->firstWidget(); + if(!tqfocusWidget) + tqfocusWidget = m_tabOrderWidgets.first(); // for some reason, this only works reliably if delayed a bit - QTimer::singleShot(10, focusWidget, SLOT(setFocus())); + TQTimer::singleShot(10, tqfocusWidget, TQT_SLOT(setFocus())); // preset to 'I have no idea which type to create' for the next round. d->m_action = KMyMoneyRegister::ActionNone; @@ -1166,7 +1166,7 @@ TransactionEditor* KGlobalLedgerView::startEdit(const KMyMoneyRegister::Selected void KGlobalLedgerView::slotLeaveEditMode(const KMyMoneyRegister::SelectedTransactions& list) { m_inEditMode = false; - qApp->removeEventFilter(d->m_mousePressFilter); + tqApp->removeEventFilter(d->m_mousePressFilter); // a possible focusOut event may have removed the focus, so we // install it back again. @@ -1204,13 +1204,13 @@ bool KGlobalLedgerView::focusNextPrevChild(bool next) // qDebug("KGlobalLedgerView::focusNextPrevChild(editmode=%s)", m_inEditMode ? "true" : "false"); if(m_inEditMode) { - QWidget *w = 0; - QWidget *currentWidget; + TQWidget *w = 0; + TQWidget *currentWidget; - w = qApp->focusWidget(); - while(w && m_tabOrderWidgets.find(w) == -1) { - // qDebug("'%s' not in list, use parent", w->className()); - w = w->parentWidget(); + w = tqApp->tqfocusWidget(); + while(w && m_tabOrderWidgets.tqfind(w) == -1) { + // qDebug("'%s' not in list, use tqparent", w->className()); + w = w->tqparentWidget(); } // if(w) qDebug("tab order is at '%s'", w->className()); currentWidget = m_tabOrderWidgets.current(); @@ -1222,7 +1222,7 @@ bool KGlobalLedgerView::focusNextPrevChild(bool next) } if(w != currentWidget - && ((w->focusPolicy() & TabFocus) == TabFocus) + && ((w->focusPolicy() & TQ_TabFocus) == TQ_TabFocus) && w->isVisible() && w->isEnabled()) { // qDebug("Selecting '%s' as focus", w->className()); w->setFocus(); @@ -1258,26 +1258,26 @@ void KGlobalLedgerView::show(void) KMyMoneyViewBase::show(); } -bool KGlobalLedgerView::eventFilter(QObject* o, QEvent* e) +bool KGlobalLedgerView::eventFilter(TQObject* o, TQEvent* e) { bool rc = false; - if(e->type() == QEvent::KeyPress) { - QKeyEvent *k = static_cast(e); + if(e->type() == TQEvent::KeyPress) { + TQKeyEvent *k = TQT_TQKEYEVENT(e); if(m_inEditMode) { // qDebug("object = %s, key = %d", o->className(), k->key()); - if(o == m_register) { + if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_register)) { // we hide all key press events from the register // while editing a transaction rc = true; } } else { // qDebug("object = %s, key = %d", o->className(), k->key()); - if(o == m_register) { - if((k->state() & Qt::KeyButtonMask) == 0) { + if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_register)) { + if((k->state() & TQt::KeyButtonMask) == 0) { switch(k->key()) { - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Enter: kmymoney2->action("transaction_edit")->activate(); rc = true; break; @@ -1297,8 +1297,8 @@ void KGlobalLedgerView::slotSortOptions(void) { KSortOptionDlg* dlg = new KSortOptionDlg(this); - QString key; - QString sortOrder, def; + TQString key; + TQString sortOrder, def; if(isReconciliationAccount()) { key = "kmm-sort-reconcile"; def = KMyMoneyGlobalSettings::sortReconcileView(); @@ -1311,11 +1311,11 @@ void KGlobalLedgerView::slotSortOptions(void) if(!m_account.value(key).isEmpty()) sortOrder = m_account.value(key); - QString oldOrder = sortOrder; + TQString oldOrder = sortOrder; dlg->setSortOption(sortOrder, def); - if(dlg->exec() == QDialog::Accepted) { + if(dlg->exec() == TQDialog::Accepted) { sortOrder = dlg->sortOption(); if(sortOrder != oldOrder) { if(sortOrder.isEmpty()) { @@ -1343,12 +1343,12 @@ void KGlobalLedgerView::slotToggleTransactionMark(KMyMoneyRegister::Transaction* } } -void KGlobalLedgerView::slotKeepPostDate(const QDate& date) +void KGlobalLedgerView::slotKeepPostDate(const TQDate& date) { m_lastPostDate = date; } -bool KGlobalLedgerView::canCreateTransactions(QString& tooltip) const +bool KGlobalLedgerView::canCreateTransactions(TQString& tooltip) const { bool rc = true; if(m_account.id().isEmpty()) { @@ -1367,7 +1367,7 @@ bool KGlobalLedgerView::canCreateTransactions(QString& tooltip) const return rc; } -bool KGlobalLedgerView::canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KGlobalLedgerView::canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { if(m_register->focusItem() == 0) return false; @@ -1379,17 +1379,17 @@ bool KGlobalLedgerView::canProcessTransactions(const KMyMoneyRegister::SelectedT return list.count() > 0; } -bool KGlobalLedgerView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KGlobalLedgerView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { return canProcessTransactions(list,tooltip) && list.canModify(); } -bool KGlobalLedgerView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KGlobalLedgerView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { return canProcessTransactions(list,tooltip) && list.canDuplicate(); } -bool KGlobalLedgerView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KGlobalLedgerView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { // check if we can edit the list of transactions. We can edit, if // @@ -1421,7 +1421,7 @@ bool KGlobalLedgerView::canEditTransactions(const KMyMoneyRegister::SelectedTran KMyMoneyRegister::SelectedTransactions::const_iterator it_t; for(it_t = list.begin(); rc && it_t != list.end(); ++it_t) { if((*it_t).transaction().id().isEmpty()) { - tooltip = QString(); + tooltip = TQString(); rc = false; continue; } diff --git a/kmymoney2/views/kgloballedgerview.h b/kmymoney2/views/kgloballedgerview.h index 861bd0e..0d782ab 100644 --- a/kmymoney2/views/kgloballedgerview.h +++ b/kmymoney2/views/kgloballedgerview.h @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,12 +45,12 @@ #include #include -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QPopupMenu; -class QFrame; -class QLabel; +class TQVBoxLayout; +class TQHBoxLayout; +class TQGridLayout; +class TQPopupMenu; +class TQFrame; +class TQLabel; class KMyMoneyAccountCombo; class KToolBar; @@ -63,17 +63,18 @@ class TransactionEditor; * events on widgets outside a given set of widgets. This is used internally * to detect when to leave the edit mode. */ -class MousePressFilter : public QObject +class MousePressFilter : public TQObject { Q_OBJECT + TQ_OBJECT public: - MousePressFilter(QWidget* parent = 0, const char* name = 0); + MousePressFilter(TQWidget* tqparent = 0, const char* name = 0); /** - * Add widget @p w to the list of possible parent objects. See eventFilter() how + * Add widget @p w to the list of possible tqparent objects. See eventFilter() how * they will be used. */ - void addWidget(QWidget* w); + void addWidget(TQWidget* w); public slots: /** @@ -95,32 +96,32 @@ public slots: protected: /** * This method checks if the widget @p child is a child of - * the widget @p parent and returns either @a true or @a false. + * the widget @p tqparent and returns either @a true or @a false. * * @param child pointer to child widget - * @param parent pointer to parent widget - * @retval true @p child points to widget which has @p parent as parent or grand-parent - * @retval false @p child points to a widget which is not related to @p parent + * @param tqparent pointer to tqparent widget + * @retval true @p child points to widget which has @p tqparent as tqparent or grand-tqparent + * @retval false @p child points to a widget which is not related to @p tqparent */ - bool isChildOf(QWidget* child, QWidget* parent); + bool isChildOf(TQWidget* child, TQWidget* tqparent); /** * Reimplemented from base class. Sends out the mousePressedOnExternalWidget() signal * if object @p o points to an object which is not a child widget of any added previously * using the addWidget() method. The signal is sent out only once for each event @p e. * - * @param o pointer to QObject - * @param e pointer to QEvent + * @param o pointer to TQObject + * @param e pointer to TQEvent * @return always returns @a false */ - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); signals: void mousePressedOnExternalWidget(bool&); private: - QValueList m_parents; - QEvent* m_lastMousePressEvent; + TQValueList m_parents; + TQEvent* m_lastMousePressEvent; bool m_filterActive; }; @@ -130,15 +131,16 @@ private: class KGlobalLedgerView : public KMyMoneyViewBase { Q_OBJECT + TQ_OBJECT public: - KGlobalLedgerView(QWidget *parent=0, const char *name=0); + KGlobalLedgerView(TQWidget *tqparent=0, const char *name=0); ~KGlobalLedgerView(); /** * This method returns the id of the currently selected account - * or QString() if none is selected. + * or TQString() if none is selected. */ - const QString accountId(void) const { return m_account.id(); } + const TQString accountId(void) const { return m_account.id(); } /** * Checks if new transactions can be created in the current context @@ -150,7 +152,7 @@ public: * @retval true Yes, view allows to create transactions (tooltip is not changed) * @retval false No, view does not support creation of transactions (tooltip is updated with message) */ - bool canCreateTransactions(QString& tooltip) const; + bool canCreateTransactions(TQString& tooltip) const; /** * Checks if a list of transactions can be modified (edit/delete) in the current context @@ -163,9 +165,9 @@ public: * @retval true Yes, view allows to edit/delete transactions (tooltip is not changed) * @retval false No, view cannot edit/delete transactions (tooltip is updated with message) */ - bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; - bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * Checks if the list of transactions can be edited in the current context @@ -177,7 +179,7 @@ public: * * @return @c true if edit operation is possible, @c false if not */ - bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; TransactionEditor* startEdit(const KMyMoneyRegister::SelectedTransactions& list); @@ -204,13 +206,13 @@ public slots: * * @param accountId Internal id used for the account to show * @param transactionId Internal id used for the transaction to select. - * Default is QString() which will select the last + * Default is TQString() which will select the last * transaction in the ledger if not the same account * * @retval true selection of account referenced by @p id succeeded * @retval false selection of account failed */ - bool slotSelectAccount(const QString& accountId, const QString& transactionId = QString()); + bool slotSelectAccount(const TQString& accountId, const TQString& transactionId = TQString()); /** * This method is provided for convenience and acts as the method above. @@ -228,7 +230,7 @@ public slots: * @param endingBalance The calculated ending balance for the statement * Default ist 0. */ - void slotSetReconcileAccount(const MyMoneyAccount& account = MyMoneyAccount(), const QDate& reconciliationDate = QDate(), const MyMoneyMoney& endingBalance = MyMoneyMoney()); + void slotSetReconcileAccount(const MyMoneyAccount& account = MyMoneyAccount(), const TQDate& reconciliationDate = TQDate(), const MyMoneyMoney& endingBalance = MyMoneyMoney()); /** * Select all transactions in the ledger that are not hidden. @@ -253,9 +255,9 @@ protected: void loadView(void); - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); - void selectTransaction(const QString& id); + void selectTransaction(const TQString& id); /** * This method handles the focus of the keyboard. When in edit mode @@ -268,7 +270,7 @@ protected: */ bool focusNextPrevChild(bool next); - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); /** * Returns @a true if setReconciliationAccount() has been called for @@ -287,7 +289,7 @@ protected: * @param actBalance map of account indexed values to be used as actual balance * @param clearedBalance map of account indexed values to be used as cleared balance */ - void updateSummaryLine(const QMap& actBalance, const QMap& clearedBalance); + void updateSummaryLine(const TQMap& actBalance, const TQMap& clearedBalance); /** * setup the default action according to the current account type @@ -301,13 +303,13 @@ protected slots: /** * Sets the contentsPos of the register to d->m_startPoint or makes - * the focus item visible if d->m_startPoint equals QPoint(-1, -1). + * the focus item visible if d->m_startPoint equals TQPoint(-1, -1). */ void slotUpdateViewPos(void); void slotSortOptions(void); void slotToggleTransactionMark(KMyMoneyRegister::Transaction* t); - void slotKeepPostDate(const QDate&); + void slotKeepPostDate(const TQDate&); void slotAboutToSelectItem(KMyMoneyRegister::RegisterItem*, bool&); @@ -318,7 +320,7 @@ protected: * and is used to preset the posting date when new transactions are created. * This member is initialised to the current date when the program is started. */ - static QDate m_lastPostDate; + static TQDate m_lastPostDate; private: /// \internal d-pointer class. @@ -327,11 +329,11 @@ private: Private* const d; // frames - QFrame* m_toolbarFrame; - QFrame* m_registerFrame; - QFrame* m_buttonFrame; - QFrame* m_formFrame; - QFrame* m_summaryFrame; + TQFrame* m_toolbarFrame; + TQFrame* m_registerFrame; + TQFrame* m_buttonFrame; + TQFrame* m_formFrame; + TQFrame* m_summaryFrame; // widgets KMyMoneyAccountCombo* m_accountComboBox; @@ -347,11 +349,11 @@ private: /** * This member holds the transaction list */ - QValueList > m_transactionList; + TQValueList > m_transactionList; - QLabel* m_leftSummaryLabel; - QLabel* m_centerSummaryLabel; - QLabel* m_rightSummaryLabel; + TQLabel* m_leftSummaryLabel; + TQLabel* m_centerSummaryLabel; + TQLabel* m_rightSummaryLabel; KMyMoneyTransactionForm::TransactionForm* m_form; @@ -359,7 +361,7 @@ private: bool m_newAccountLoaded; bool m_inEditMode; - QWidgetList m_tabOrderWidgets; + TQWidgetList m_tabOrderWidgets; signals: void accountSelected(const MyMoneyObject&); @@ -396,7 +398,7 @@ signals: void toggleReconciliationFlag(void); private: - bool canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canProcessTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; }; #endif diff --git a/kmymoney2/views/khomeview.cpp b/kmymoney2/views/khomeview.cpp index 95b7323..51e9c65 100644 --- a/kmymoney2/views/khomeview.cpp +++ b/kmymoney2/views/khomeview.cpp @@ -23,16 +23,16 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -88,12 +88,12 @@ class KHomeView::Private { public: Private() {} - void addNameIndex(QMap &idx, const MyMoneyAccount& account); + void addNameIndex(TQMap &idx, const MyMoneyAccount& account); }; -void KHomeView::Private::addNameIndex(QMap &idx, const MyMoneyAccount& account) +void KHomeView::Private::addNameIndex(TQMap &idx, const MyMoneyAccount& account) { - QString key = account.name(); + TQString key = account.name(); if(idx[key].id().isEmpty()) { idx[key] = account; @@ -101,15 +101,15 @@ void KHomeView::Private::addNameIndex(QMap &idx, const } else if(idx[key].id() != account.id()) { key = account.name() + "[%1]"; int dup = 2; - while(!idx[key.arg(dup)].id().isEmpty() - && idx[key.arg(dup)].id() != account.id()) + while(!idx[key.tqarg(dup)].id().isEmpty() + && idx[key.tqarg(dup)].id() != account.id()) ++dup; - idx[key.arg(dup)] = account; + idx[key.tqarg(dup)] = account; } } -KHomeView::KHomeView(QWidget *parent, const char *name ) : - KMyMoneyViewBase(parent, name, i18n("Home")), +KHomeView::KHomeView(TQWidget *tqparent, const char *name ) : + KMyMoneyViewBase(tqparent, name, i18n("Home")), d(new Private), m_showAllSchedules(false), m_needReload(true) @@ -117,13 +117,13 @@ KHomeView::KHomeView(QWidget *parent, const char *name ) : m_part = new KHTMLPart(this, "htmlpart_km2"); addWidget(m_part->view()); - m_filename = KMyMoneyUtils::findResource("appdata", QString("html/home%1.html")); + m_filename = KMyMoneyUtils::findResource("appdata", TQString("html/home%1.html")); // m_part->openURL(m_filename); - connect(m_part->browserExtension(), SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)), - this, SLOT(slotOpenURL(const KURL&, const KParts::URLArgs&))); + connect(m_part->browserExtension(), TQT_SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)), + this, TQT_SLOT(slotOpenURL(const KURL&, const KParts::URLArgs&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadView())); } KHomeView::~KHomeView() @@ -153,7 +153,7 @@ void KHomeView::show(void) loadView(); m_needReload = false; } - QWidget::show(); + TQWidget::show(); } void KHomeView::slotPrintView(void) @@ -167,7 +167,7 @@ void KHomeView::loadView(void) m_part->setZoomFactor( KMyMoneyGlobalSettings::fontSizePercentage() ); //kdDebug() << "Setting font size: " << m_part->zoomFactor() << endl; - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list); if(list.count() == 0) { @@ -186,7 +186,7 @@ void KHomeView::loadView(void) else { qDebug("Element id=test found!"); - QString tagname = e.tagName().string(); + TQString tagname = e.tagName().string(); qDebug("%s",tagname.latin1()); qDebug("%s id=%s",e.tagName().string().latin1(),e.getAttribute("id").string().latin1()); @@ -214,23 +214,23 @@ void KHomeView::loadView(void) //clear the forecast flag so it will be reloaded m_forecast.setForecastDone(false); - QString filename = KGlobal::dirs()->findResource("appdata", "html/kmymoney2.css"); - QString header = QString("\n\n").arg(filename); + TQString filename = KGlobal::dirs()->findResource("appdata", "html/kmymoney2.css"); + TQString header = TQString("\n\n").tqarg(filename); header += KMyMoneyUtils::variableCSS(); header += "\n"; - QString footer = "\n"; + TQString footer = "\n"; m_part->begin(); m_part->write(header); - m_part->write(QString("
%1
").arg(i18n("Your Financial Summary"))); + m_part->write(TQString("
%1
").tqarg(i18n("Your Financial Summary"))); - QStringList settings = KMyMoneyGlobalSettings::itemList(); + TQStringList settings = KMyMoneyGlobalSettings::itemList(); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it = settings.begin(); it != settings.end(); ++it) { int option = (*it).toInt(); @@ -246,7 +246,7 @@ void KHomeView::loadView(void) case 3: // payment accounts // Check if preferred accounts are shown separately - if(settings.find("2") == settings.end()) { + if(settings.tqfind("2") == settings.end()) { showAccounts(static_cast (Payment | Preferred), i18n("Payment Accounts")); } else { @@ -279,7 +279,7 @@ void KHomeView::loadView(void) } m_part->write("
"); - m_part->write(link(VIEW_WELCOME, QString()) + i18n("Show KMyMoney welcome page") + linkend()); + m_part->write(link(VIEW_WELCOME, TQString()) + i18n("Show KMyMoney welcome page") + linkend()); m_part->write("
"); m_part->write("
"); m_part->write(footer); @@ -291,7 +291,7 @@ void KHomeView::loadView(void) void KHomeView::showNetWorthGraph(void) { #ifdef HAVE_KDCHART - m_part->write(QString("
%1
\n
 
\n").arg(i18n("Networth Forecast"))); + m_part->write(TQString("
%1
\n
 
\n").tqarg(i18n("Networth Forecast"))); MyMoneyReport reportCfg = MyMoneyReport( MyMoneyReport::eAssetLiability, @@ -311,7 +311,7 @@ void KHomeView::showNetWorthGraph(void) reportCfg.setColumnsAreDays( true ); reportCfg.setConvertCurrency( true ); reportCfg.setIncludingForecast( true ); - reportCfg.setDateFilter(QDate::currentDate(),QDate::currentDate().addDays(+90)); + reportCfg.setDateFilter(TQDate::tqcurrentDate(),TQDate::tqcurrentDate().addDays(+90)); reports::PivotTable table(reportCfg); @@ -330,7 +330,7 @@ void KHomeView::showNetWorthGraph(void) const int idPropFutureValue = chartWidget->params()->registerProperties(propSetFutureValue); //KDChartPropertySet propSetLastValue("last value", idPropFutureValue); - //propSetLastValue.setExtraLinesAlign(KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignBottom); + //propSetLastValue.setExtraLinesAlign(KDChartPropertySet::OwnID, TQt::AlignLeft | TQt::AlignBottom); //propSetLastValue.setExtraLinesWidth(KDChartPropertySet::OwnID, -4); //propSetLastValue.setExtraLinesColor(KDChartPropertySet::OwnID, KMyMoneyGlobalSettings::listGridColor()); // propSetLastValue.setShowMarker(KDChartPropertySet::OwnID, true); @@ -349,19 +349,19 @@ void KHomeView::showNetWorthGraph(void) chartWidget->resize(width()-80, nh); } - QPixmap pm(chartWidget->width(), chartWidget->height()); + TQPixmap pm(chartWidget->width(), chartWidget->height()); pm.fill(KGlobalSettings::baseColor()); - QPainter p(&pm); + TQPainter p(&pm); chartWidget->paintTo(p); - QByteArray ba; - QBuffer buffer( ba ); + TQByteArray ba; + TQBuffer buffer( ba ); buffer.open( IO_WriteOnly ); pm.save( &buffer, "PNG" ); // writes pixmap into ba in PNG format m_part->write(""); m_part->write(""); - m_part->write(QString("").arg(KCodecs::base64Encode(ba))); + m_part->write(TQString("").tqarg(TQString(KCodecs::base64Encode(ba)))); m_part->write(""); m_part->write("
\"Networth\"
\"Networth\"
"); @@ -372,8 +372,8 @@ void KHomeView::showNetWorthGraph(void) void KHomeView::showPayments(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList overdues; - QValueList schedule; + TQValueList overdues; + TQValueList schedule; int i = 0; //if forecast has not been executed yet, do it. @@ -383,12 +383,12 @@ void KHomeView::showPayments(void) schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate::currentDate(), - QDate::currentDate().addMonths(1)); + TQDate::tqcurrentDate(), + TQDate::tqcurrentDate().addMonths(1)); overdues = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), QDate(), true); + TQDate(), TQDate(), true); if(schedule.empty() && overdues.empty()) return; @@ -396,11 +396,11 @@ void KHomeView::showPayments(void) // HACK // Remove the finished schedules - QValueList::Iterator d_it; + TQValueList::Iterator d_it; for (d_it=schedule.begin(); d_it!=schedule.end();) { // FIXME cleanup old code - // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == QDate()) + // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == TQDate()) if ((*d_it).isFinished()) { d_it = schedule.remove(d_it); @@ -412,7 +412,7 @@ void KHomeView::showPayments(void) for (d_it=overdues.begin(); d_it!=overdues.end();) { // FIXME cleanup old code - // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == QDate()) + // if ((*d_it).isFinished() || (*d_it).nextPayment((*d_it).lastPayment()) == TQDate()) if ((*d_it).isFinished()) { d_it = overdues.remove(d_it); @@ -422,17 +422,17 @@ void KHomeView::showPayments(void) } m_part->write("
"); - m_part->write(QString("
%1
\n").arg(i18n("Payments"))); + m_part->write(TQString("
%1
\n").tqarg(i18n("Payments"))); if(overdues.count() > 0) { m_part->write("
 
\n"); qBubbleSort(overdues); - QValueList::Iterator it; - QValueList::Iterator it_f; + TQValueList::Iterator it; + TQValueList::Iterator it_f; m_part->write(""); - m_part->write(QString("\n").arg(showColoredAmount(i18n("Overdue payments"), true))); + m_part->write(TQString("\n").tqarg(showColoredAmount(i18n("Overdue payments"), true))); m_part->write(""); m_part->write("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showPaymentEntry(*it, cnt); m_part->write(""); // make sure to not repeat overdues later again @@ -483,15 +483,15 @@ void KHomeView::showPayments(void) qBubbleSort(schedule); // Extract todays payments if any - QValueList todays; - QValueList::Iterator t_it; + TQValueList todays; + TQValueList::Iterator t_it; for (t_it=schedule.begin(); t_it!=schedule.end();) { - if ((*t_it).nextDueDate() == QDate::currentDate()) { + if ((*t_it).nextDueDate() == TQDate::tqcurrentDate()) { todays.append(*t_it); (*t_it).setNextDueDate((*t_it).nextPayment((*t_it).nextDueDate())); - //if nextDueDate is still currentDate then remove it from scheduled payments - if ((*t_it).nextDueDate() == QDate::currentDate()) { + //if nextDueDate is still tqcurrentDate then remove it from scheduled payments + if ((*t_it).nextDueDate() == TQDate::tqcurrentDate()) { t_it = schedule.remove(t_it); continue; } @@ -502,7 +502,7 @@ void KHomeView::showPayments(void) if (todays.count() > 0) { m_part->write("
 
\n"); m_part->write("
%1
%1
"); m_part->write(i18n("Date")); @@ -453,9 +453,9 @@ void KHomeView::showPayments(void) for(it = overdues.begin(); it != overdues.end(); ++it) { // determine number of overdue payments - QDate nextDate = (*it).adjustedNextDueDate(); + TQDate nextDate = (*it).adjustedNextDueDate(); int cnt = 0; - while(nextDate.isValid() && nextDate < QDate::currentDate()) { + while(nextDate.isValid() && nextDate < TQDate::tqcurrentDate()) { ++cnt; nextDate = (*it).nextPayment(nextDate); // for single occurence nextDate will not change, so we @@ -464,7 +464,7 @@ void KHomeView::showPayments(void) break; } - m_part->write(QString("
"); - m_part->write(QString("\n").arg(i18n("Today's payments"))); + m_part->write(TQString("\n").tqarg(i18n("Today's payments"))); m_part->write(""); m_part->write(""); for(t_it = todays.begin(); t_it != todays.end(); ++t_it) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showPaymentEntry(*t_it); m_part->write(""); } @@ -533,10 +533,10 @@ void KHomeView::showPayments(void) { m_part->write("
 
\n"); - QValueList::Iterator it; + TQValueList::Iterator it; m_part->write("
%1
%1
"); m_part->write(i18n("Date")); @@ -522,7 +522,7 @@ void KHomeView::showPayments(void) m_part->write("
"); - m_part->write(QString("\n").arg(i18n("Future payments"))); + m_part->write(TQString("\n").tqarg(i18n("Future payments"))); m_part->write(""); m_part->write("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showPaymentEntry(*it); m_part->write(""); @@ -602,12 +602,12 @@ void KHomeView::showPayments(void) while(1); if (needMoreLess) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); m_part->write(""); m_part->write(""); @@ -620,7 +620,7 @@ void KHomeView::showPayments(void) void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) { - QString tmp; + TQString tmp; MyMoneyFile* file = MyMoneyFile::instance(); try { @@ -629,49 +629,49 @@ void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) MyMoneyTransaction t = sched.transaction(); // only show the entry, if it is still active // FIXME clean old code - // if(!sched.isFinished() && sched.nextPayment(sched.lastPayment()) != QDate()) { + // if(!sched.isFinished() && sched.nextPayment(sched.lastPayment()) != TQDate()) { if(!sched.isFinished()) { MyMoneySplit sp = t.splitByAccount(acc.id(), true); - QString pathEnter, pathSkip; + TQString pathEnter, pathSkip; KGlobal::iconLoader()->loadIcon("key_enter", KIcon::Small, KIcon::SizeSmall, KIcon::DefaultState, &pathEnter); KGlobal::iconLoader()->loadIcon("player_fwd", KIcon::Small, KIcon::SizeSmall, KIcon::DefaultState, &pathSkip); //show payment date - tmp = QString(""; //show balance after payments tmp += ""; @@ -685,13 +685,13 @@ void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt) } } -void KHomeView::showAccounts(KHomeView::paymentTypeE type, const QString& header) +void KHomeView::showAccounts(KHomeView::paymentTypeE type, const TQString& header) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accounts; - QValueList::Iterator it; - QValueList::Iterator prevIt; - QMap nameIdx; + TQValueList accounts; + TQValueList::Iterator it; + TQValueList::Iterator prevIt; + TQMap nameIdx; bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); @@ -767,7 +767,7 @@ void KHomeView::showAccounts(KHomeView::paymentTypeE type, const QString& header } if(accounts.count() > 0) { - QString tmp; + TQString tmp; int i = 0; tmp = "
" + header + "
\n
 
\n"; m_part->write(tmp); @@ -786,9 +786,9 @@ void KHomeView::showAccounts(KHomeView::paymentTypeE type, const QString& header m_part->write("
"); - QMap::const_iterator it_m; + TQMap::const_iterator it_m; for(it_m = nameIdx.begin(); it_m != nameIdx.end(); ++it_m) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); showAccountEntry(*it_m); m_part->write(""); } @@ -812,17 +812,17 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc) showAccountEntry(acc, value, MyMoneyMoney(), showLimit); } else { //get balance for normal accounts - value = file->balance(acc.id(), QDate::currentDate()); + value = file->balance(acc.id(), TQDate::tqcurrentDate()); //if credit card or checkings account, show maximum credit if( acc.accountType() == MyMoneyAccount::CreditCard || acc.accountType() == MyMoneyAccount::Checkings ) { - QString maximumCredit = acc.value("maxCreditAbsolute"); + TQString maximumCredit = acc.value("maxCreditAbsolute"); MyMoneyMoney maxCredit = MyMoneyMoney(maximumCredit); showAccountEntry(acc, value, value - maxCredit, showLimit); } else { //otherwise use minimum balance - QString minimumBalance = acc.value("minBalanceAbsolute"); + TQString minimumBalance = acc.value("minBalanceAbsolute"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); showAccountEntry(acc, value, value - minBalance, showLimit); } @@ -832,33 +832,33 @@ void KHomeView::showAccountEntry(const MyMoneyAccount& acc) void KHomeView::showAccountEntry(const MyMoneyAccount& acc, const MyMoneyMoney& value, const MyMoneyMoney& valueToMinBal, const bool showMinBal) { MyMoneyFile* file = MyMoneyFile::instance(); - QString tmp; + TQString tmp; MyMoneySecurity currency = file->currency(acc.currencyId()); - QString amount; - QString amountToMinBal; + TQString amount; + TQString amountToMinBal; //format amounts amount = value.formatMoney(acc, currency); - amount.replace(" "," "); + amount.tqreplace(" "," "); if(showMinBal) { amountToMinBal = valueToMinBal.formatMoney(acc, currency); - amountToMinBal.replace(" "," "); + amountToMinBal.tqreplace(" "," "); } - tmp = QString(""; + tmp = TQString(""; //show account balance - tmp += QString("").arg(showColoredAmount(amount, value.isNegative())); + tmp += TQString("").tqarg(showColoredAmount(amount, value.isNegative())); //show minimum balance column if requested if(showMinBal) { //if it is an investment, show minimum balance empty if(acc.accountType() == MyMoneyAccount::Investment) { - tmp += QString(""); + tmp += TQString(""); } else { //show minimum balance entry - tmp += QString("").arg(showColoredAmount(amountToMinBal, valueToMinBal.isNegative())); + tmp += TQString("").tqarg(showColoredAmount(amountToMinBal, valueToMinBal.isNegative())); } } // qDebug("accountEntry = '%s'", tmp.latin1()); @@ -871,7 +871,7 @@ MyMoneyMoney KHomeView::investmentBalance(const MyMoneyAccount& acc) MyMoneyMoney value; value = file->balance(acc.id()); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount stock = file->account(*it_a); try { @@ -886,7 +886,7 @@ MyMoneyMoney KHomeView::investmentBalance(const MyMoneyAccount& acc) val = val.convert(acc.fraction()); value += val; } catch(MyMoneyException* e) { - qWarning("%s", (QString("cannot convert stock balance of %1 to base currency: %2").arg(stock.name(), e->what())).data()); + qWarning("%s", (TQString("cannot convert stock balance of %1 to base currency: %2").tqarg(stock.name(), e->what())).data()); delete e; } } @@ -895,18 +895,18 @@ MyMoneyMoney KHomeView::investmentBalance(const MyMoneyAccount& acc) void KHomeView::showFavoriteReports(void) { - QValueList reports = MyMoneyFile::instance()->reportList(); + TQValueList reports = MyMoneyFile::instance()->reportList(); if ( reports.count() > 0 ) { bool firstTime = 1; int row = 0; - QValueList::const_iterator it_report = reports.begin(); + TQValueList::const_iterator it_report = reports.begin(); while( it_report != reports.end() ) { if ( (*it_report).isFavorite() ) { if(firstTime) { - m_part->write(QString("
%1
\n
 
\n").arg(i18n("Favorite Reports"))); + m_part->write(TQString("
%1
\n
 
\n").tqarg(i18n("Favorite Reports"))); m_part->write("
%1
%1
"); m_part->write(i18n("Date")); @@ -560,7 +560,7 @@ void KHomeView::showPayments(void) cnt = (m_showAllSchedules) ? -1 : 6; bool needMoreLess = m_showAllSchedules; - QDate lastDate = QDate::currentDate().addMonths(1); + TQDate lastDate = TQDate::tqcurrentDate().addMonths(1); qBubbleSort(schedule); do { it = schedule.begin(); @@ -569,7 +569,7 @@ void KHomeView::showPayments(void) // if the next due date is invalid (schedule is finished) // we remove it from the list - QDate nextDate = (*it).nextDueDate(); + TQDate nextDate = (*it).nextDueDate(); if(!nextDate.isValid()) { schedule.remove(it); continue; @@ -585,7 +585,7 @@ void KHomeView::showPayments(void) if(cnt > 0) --cnt; - m_part->write(QString("
"); if(m_showAllSchedules) { - m_part->write(link(VIEW_SCHEDULE, QString("?mode=%1").arg("reduced")) + i18n("Less...") + linkend()); + m_part->write(link(VIEW_SCHEDULE, TQString("?mode=%1").tqarg("reduced")) + i18n("Less...") + linkend()); } else { - m_part->write(link(VIEW_SCHEDULE, QString("?mode=%1").arg("full")) + i18n("More...") + linkend()); + m_part->write(link(VIEW_SCHEDULE, TQString("?mode=%1").tqarg("full")) + i18n("More...") + linkend()); } m_part->write("
") + + tmp = TQString("") + KGlobal::locale()->formatDate(sched.adjustedNextDueDate(), true) + ""; if(pathEnter.length() > 0) - tmp += link(VIEW_SCHEDULE, QString("?id=%1&mode=enter").arg(sched.id()), i18n("Enter schedule")) + QString("").arg(pathEnter) + linkend(); + tmp += link(VIEW_SCHEDULE, TQString("?id=%1&mode=enter").tqarg(sched.id()), i18n("Enter schedule")) + TQString("").tqarg(pathEnter) + linkend(); if(pathSkip.length() > 0) - tmp += " " + link(VIEW_SCHEDULE, QString("?id=%1&mode=skip").arg(sched.id()), i18n("Skip schedule")) + QString("").arg(pathSkip) + linkend(); + tmp += " " + link(VIEW_SCHEDULE, TQString("?id=%1&mode=skip").tqarg(sched.id()), i18n("Skip schedule")) + TQString("").tqarg(pathSkip) + linkend(); - tmp += QString(" "); - tmp += link(VIEW_SCHEDULE, QString("?id=%1&mode=edit").arg(sched.id()), i18n("Edit schedule")) + sched.name() + linkend(); + tmp += TQString(" "); + tmp += link(VIEW_SCHEDULE, TQString("?id=%1&mode=edit").tqarg(sched.id()), i18n("Edit schedule")) + sched.name() + linkend(); //show quantity of payments overdue if any if(cnt > 1) - tmp += i18n(" (%1 payments)").arg(cnt); + tmp += i18n(" (%1 payments)").tqarg(cnt); //show account of the main split tmp += ""; - tmp += QString(file->account(acc.id()).name()); + tmp += TQString(file->account(acc.id()).name()); //show amount of the schedule tmp += ""; const MyMoneySecurity& currency = MyMoneyFile::instance()->currency(acc.currencyId()); - QString amount = (sp.value()*cnt).formatMoney(acc, currency); - amount.replace(" "," "); + TQString amount = (sp.value()*cnt).formatMoney(acc, currency); + amount.tqreplace(" "," "); tmp += showColoredAmount(amount, (sp.value()*cnt).isNegative()) ; tmp += ""; MyMoneyMoney payment = MyMoneyMoney((sp.value()*cnt)); - QDate paymentDate = QDate(sched.nextDueDate()); + TQDate paymentDate = TQDate(sched.nextDueDate()); MyMoneyMoney balanceAfter = forecastPaymentBalance(acc, payment, paymentDate); - QString balance = balanceAfter.formatMoney(acc, currency); - balance.replace(" "," "); + TQString balance = balanceAfter.formatMoney(acc, currency); + balance.tqreplace(" "," "); tmp += showColoredAmount(balance, balanceAfter.isNegative()); tmp += "
") + - link(VIEW_LEDGER, QString("?id=%1").arg(acc.id())) + acc.name() + linkend() + "") + + link(VIEW_LEDGER, TQString("?id=%1").tqarg(acc.id())) + acc.name() + linkend() + "%1%1  %1%1
"); m_part->write("") - .arg(row++ & 0x01 ? "even" : "odd") - .arg(link(VIEW_REPORTS, QString("?id=%1").arg((*it_report).id()))) - .arg((*it_report).name()) - .arg(linkend()) - .arg((*it_report).comment()) + m_part->write(TQString("") + .tqarg(row++ & 0x01 ? "even" : "odd") + .tqarg(link(VIEW_REPORTS, TQString("?id=%1").tqarg((*it_report).id()))) + .tqarg((*it_report).name()) + .tqarg(linkend()) + .tqarg((*it_report).comment()) ); } @@ -934,9 +934,9 @@ void KHomeView::showFavoriteReports(void) void KHomeView::showForecast(void) { - QMap nameIdx; + TQMap nameIdx; MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accList; + TQValueList accList; // if forecast has not been executed yet, do it. if(!m_forecast.isForecastDone()) @@ -945,7 +945,7 @@ void KHomeView::showForecast(void) accList = m_forecast.accountList(); // add it to a map to have it ordered by name - QValueList::const_iterator accList_t = accList.begin(); + TQValueList::const_iterator accList_t = accList.begin(); for ( ; accList_t != accList.end(); ++accList_t ) { d->addNameIndex(nameIdx, *accList_t); } @@ -955,22 +955,22 @@ void KHomeView::showForecast(void) int colspan = 1; // get begin day - int beginDay = QDate::currentDate().daysTo(m_forecast.beginForecastDate()); + int beginDay = TQDate::tqcurrentDate().daysTo(m_forecast.beginForecastDate()); // if begin day is today skip to next cycle if(beginDay == 0) beginDay = m_forecast.accountsCycle(); // Now output header - m_part->write(QString("
%1
\n
 
\n").arg(i18n("%1 Day Forecast").arg(m_forecast.forecastDays()))); + m_part->write(TQString("
%1
\n
 
\n").tqarg(i18n("%1 Day Forecast").tqarg(m_forecast.forecastDays()))); m_part->write("
"); m_part->write(i18n("Report")); @@ -916,12 +916,12 @@ void KHomeView::showFavoriteReports(void) firstTime = false; } - m_part->write(QString("
%2%3%4%5
%2%3%4%5
"); m_part->write(""); int colWidth = 55/ (m_forecast.forecastDays() / m_forecast.accountsCycle()); for(i = 0; (i*m_forecast.accountsCycle() + beginDay) <= m_forecast.forecastDays(); ++i) { - m_part->write(QString(""); colspan++; } @@ -979,17 +979,17 @@ void KHomeView::showForecast(void) // Now output entries i = 0; - QMap::ConstIterator it_account; + TQMap::ConstIterator it_account; for(it_account = nameIdx.begin(); it_account != nameIdx.end(); ++it_account) { //MyMoneyAccount acc = (*it_n); - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); - m_part->write(QString(""); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString(""); int dropZero = -1; //account dropped below zero int dropMinimum = -1; //account dropped below minimum balance - QString minimumBalance = (*it_account).value("minimumBalance"); + TQString minimumBalance = (*it_account).value("minimumBalance"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); MyMoneySecurity currency; MyMoneyMoney forecastBalance; @@ -1003,12 +1003,12 @@ void KHomeView::showForecast(void) } for (int f = beginDay; f <= m_forecast.forecastDays(); f += m_forecast.accountsCycle()) { - forecastBalance = m_forecast.forecastBalance(*it_account, QDate::currentDate().addDays(f)); - QString amount; + forecastBalance = m_forecast.forecastBalance(*it_account, TQDate::tqcurrentDate().addDays(f)); + TQString amount; amount = forecastBalance.formatMoney( *it_account, currency); - amount.replace(" "," "); - m_part->write(QString("").arg(showColoredAmount(amount, forecastBalance.isNegative()))); + amount.tqreplace(" "," "); + m_part->write(TQString("").tqarg(showColoredAmount(amount, forecastBalance.isNegative()))); } m_part->write(""); @@ -1023,7 +1023,7 @@ void KHomeView::showForecast(void) // spit out possible warnings - QString msg; + TQString msg; // if a minimum balance has been specified, an appropriate warning will // only be shown, if the drop below 0 is on a different day or not present @@ -1036,48 +1036,48 @@ void KHomeView::showForecast(void) case -1: break; case 0: - msg = i18n("The balance of %1 is below the minimum balance %2 today.").arg((*it_account).name()).arg(minBalance.formatMoney(*it_account, currency)); + msg = i18n("The balance of %1 is below the minimum balance %2 today.").tqarg((*it_account).name()).tqarg(minBalance.formatMoney(*it_account, currency)); msg = showColoredAmount(msg, true); break; default: - msg = i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").arg((*it_account).name()).arg(minBalance.formatMoney(*it_account, currency)).arg(dropMinimum-1); + msg = i18n("The balance of %1 will drop below the minimum balance %2 in %3 days.").tqarg((*it_account).name()).tqarg(minBalance.formatMoney(*it_account, currency)).tqarg(dropMinimum-1); msg = showColoredAmount(msg, true); break; } if(!msg.isEmpty()) { - m_part->write(QString("").arg(msg).arg(colspan)); + m_part->write(TQString("").tqarg(msg).tqarg(colspan)); } } // a drop below zero is always shown - msg = QString(); + msg = TQString(); switch(dropZero) { case -1: break; case 0: if((*it_account).accountGroup() == MyMoneyAccount::Asset) { - msg = i18n("The balance of %1 is below %2 today.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)); + msg = i18n("The balance of %1 is below %2 today.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)); msg = showColoredAmount(msg, true); break; } if((*it_account).accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 is above %2 today.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)); + msg = i18n("The balance of %1 is above %2 today.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)); break; } break; default: if((*it_account).accountGroup() == MyMoneyAccount::Asset) { - msg = i18n("The balance of %1 will drop below %2 in %3 days.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)).arg(dropZero); + msg = i18n("The balance of %1 will drop below %2 in %3 days.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)).tqarg(dropZero); msg = showColoredAmount(msg, true); break; } if((*it_account).accountGroup() == MyMoneyAccount::Liability) { - msg = i18n("The balance of %1 will raise above %2 in %3 days.").arg((*it_account).name()).arg(MyMoneyMoney().formatMoney(*it_account, currency)).arg(dropZero); + msg = i18n("The balance of %1 will raise above %2 in %3 days.").tqarg((*it_account).name()).tqarg(MyMoneyMoney().formatMoney(*it_account, currency)).tqarg(dropZero); break; } } if(!msg.isEmpty()) { - m_part->write(QString("").arg(msg).arg(colspan)); + m_part->write(TQString("").tqarg(msg).tqarg(colspan)); } } m_part->write("
"); m_part->write(i18n("Account")); m_part->write("").arg(colWidth)); + m_part->write(TQString("").tqarg(colWidth)); - m_part->write(i18n("%1 days").arg(i*m_forecast.accountsCycle() + beginDay)); + m_part->write(i18n("%1 days").tqarg(i*m_forecast.accountsCycle() + beginDay)); m_part->write("
") + - link(VIEW_LEDGER, QString("?id=%1").arg((*it_account).id())) + (*it_account).name() + linkend() + "
") + + link(VIEW_LEDGER, TQString("?id=%1").tqarg((*it_account).id())) + (*it_account).name() + linkend() + "").arg(colWidth)); - m_part->write(QString("%1").tqarg(colWidth)); + m_part->write(TQString("%1
%1
%1
%1
%1
"); @@ -1085,27 +1085,27 @@ void KHomeView::showForecast(void) } } -const QString KHomeView::link(const QString& view, const QString& query, const QString& _title) const +const TQString KHomeView::link(const TQString& view, const TQString& query, const TQString& _title) const { - QString titlePart; - QString title(_title); + TQString titlePart; + TQString title(_title); if(!title.isEmpty()) - titlePart = QString(" title=\"%1\"").arg(title.replace(" ", " ")); + titlePart = TQString(" title=\"%1\"").tqarg(title.tqreplace(" ", " ")); - return QString("").arg(view, query, titlePart); + return TQString("").tqarg(view, query, titlePart); } -const QString KHomeView::linkend(void) const +const TQString KHomeView::linkend(void) const { return ""; } void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) { - QString protocol = url.protocol(); - QString view = url.fileName(false); - QString id = url.queryItem("id").data(); - QString mode = url.queryItem("mode").data(); + TQString protocol = url.protocol(); + TQString view = url.fileName(false); + TQString id = url.queryItem("id"); + TQString mode = url.queryItem("mode"); if ( protocol == "http" ) { @@ -1118,26 +1118,26 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) else { if(view == VIEW_LEDGER) { - emit ledgerSelected(id, QString()); + emit ledgerSelected(id, TQString()); } else if(view == VIEW_SCHEDULE) { if(mode == "enter") { emit scheduleSelected(id); - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action("schedule_enter"), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action("schedule_enter"), TQT_SLOT(activate())); } else if(mode == "edit") { emit scheduleSelected(id); - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action("schedule_edit"), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action("schedule_edit"), TQT_SLOT(activate())); } else if(mode == "skip") { emit scheduleSelected(id); - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action("schedule_skip"), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action("schedule_skip"), TQT_SLOT(activate())); } else if(mode == "full") { m_showAllSchedules = true; @@ -1152,11 +1152,11 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) emit reportSelected(id); } else if(view == VIEW_WELCOME) { - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); if ( mode == "whatsnew" ) { - QString fname = KMyMoneyUtils::findResource("appdata",QString("html/whats_new%1.html")); + TQString fname = KMyMoneyUtils::findResource("appdata",TQString("html/whats_new%1.html")); if(!fname.isEmpty()) m_part->openURL(fname); } @@ -1164,12 +1164,12 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) m_part->openURL(m_filename); } else if(view == "action") { - KMainWindow* mw = dynamic_cast(qApp->mainWidget()); + KMainWindow* mw = dynamic_cast(tqApp->mainWidget()); Q_CHECK_PTR(mw); - QTimer::singleShot(0, mw->actionCollection()->action( id ), SLOT(activate())); + TQTimer::singleShot(0, mw->actionCollection()->action( id ), TQT_SLOT(activate())); } else if(view == VIEW_HOME) { - QValueList list; + TQValueList list; MyMoneyFile::instance()->accountList(list); if(list.count() == 0) { KMessageBox::information(this, i18n("Before KMyMoney can give you detailed information about your financial status, you need to create at least one account. Until then, KMyMoney shows the welcome page instead.")); @@ -1184,13 +1184,13 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */) void KHomeView::showAssetsLiabilities(void) { - QValueList accounts; - QValueList::Iterator it; - QMap nameAssetsIdx; - QMap nameLiabilitiesIdx; + TQValueList accounts; + TQValueList::Iterator it; + TQMap nameAssetsIdx; + TQMap nameLiabilitiesIdx; MyMoneyMoney netAssets; MyMoneyMoney netLiabilities; - QString fontStart, fontEnd; + TQString fontStart, fontEnd; MyMoneyFile* file = MyMoneyFile::instance(); int prec = MyMoneyMoney::denomToPrec(file->baseCurrency().smallestAccountFraction()); @@ -1257,10 +1257,10 @@ void KHomeView::showAssetsLiabilities(void) m_part->write(""); //get asset and liability accounts - QMap::const_iterator asset_it = nameAssetsIdx.begin(); - QMap::const_iterator liabilities_it = nameLiabilitiesIdx.begin(); + TQMap::const_iterator asset_it = nameAssetsIdx.begin(); + TQMap::const_iterator liabilities_it = nameLiabilitiesIdx.begin(); for(; asset_it != nameAssetsIdx.end() || liabilities_it != nameLiabilitiesIdx.end();) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); //write an asset account if we still have any if(asset_it != nameAssetsIdx.end()) { MyMoneyMoney value; @@ -1268,12 +1268,12 @@ void KHomeView::showAssetsLiabilities(void) if( (*asset_it).accountType() == MyMoneyAccount::Investment) { value = investmentBalance(*asset_it); } else { - value = MyMoneyFile::instance()->balance((*asset_it).id(), QDate::currentDate()); + value = MyMoneyFile::instance()->balance((*asset_it).id(), TQDate::tqcurrentDate()); } //calculate balance for foreign currency accounts if((*asset_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*asset_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; baseValue = baseValue.convert(10000); netAssets += baseValue; @@ -1294,11 +1294,11 @@ void KHomeView::showAssetsLiabilities(void) //write a liability account if(liabilities_it != nameLiabilitiesIdx.end()) { MyMoneyMoney value; - value = MyMoneyFile::instance()->balance((*liabilities_it).id(), QDate::currentDate()); + value = MyMoneyFile::instance()->balance((*liabilities_it).id(), TQDate::tqcurrentDate()); //calculate balance if foreign currency if((*liabilities_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*liabilities_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; baseValue = baseValue.convert(10000); netLiabilities += baseValue; @@ -1318,30 +1318,30 @@ void KHomeView::showAssetsLiabilities(void) MyMoneyMoney netWorth = netAssets+netLiabilities; //format assets, liabilities and net worth - QString amountAssets = netAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountLiabilities = netLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountNetWorth = netWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountAssets.replace(" "," "); - amountLiabilities.replace(" "," "); - amountNetWorth.replace(" "," "); + TQString amountAssets = netAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountLiabilities = netLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountNetWorth = netWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountAssets.tqreplace(" "," "); + amountLiabilities.tqreplace(" "," "); + amountNetWorth.tqreplace(" "," "); - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); //print total for assets - m_part->write(QString("%1%2").arg(i18n("Total Assets")).arg(showColoredAmount(amountAssets, netAssets.isNegative()))); + m_part->write(TQString("%1%2").tqarg(i18n("Total Assets")).tqarg(showColoredAmount(amountAssets, netAssets.isNegative()))); //leave the intermediate column empty m_part->write(""); //print total liabilities - m_part->write(QString("%1%2").arg(i18n("Total Liabilities")).arg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()))); + m_part->write(TQString("%1%2").tqarg(i18n("Total Liabilities")).tqarg(showColoredAmount(amountLiabilities, netLiabilities.isNegative()))); m_part->write(""); //print net worth - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); m_part->write(""); - m_part->write(QString("%1%2").arg(i18n("Net Worth")).arg(showColoredAmount(amountNetWorth, netWorth.isNegative() ))); + m_part->write(TQString("%1%2").tqarg(i18n("Net Worth")).tqarg(showColoredAmount(amountNetWorth, netWorth.isNegative() ))); m_part->write(""); m_part->write(""); @@ -1392,19 +1392,19 @@ void KHomeView::showBudget(void) m_part->write(i18n("Difference")); m_part->write(""); - m_part->write(QString("")); + m_part->write(TQString("")); MyMoneyMoney totalBudgetValue = grid.m_total[eBudget].m_total; MyMoneyMoney totalActualValue = grid.m_total[eActual].m_total; MyMoneyMoney totalBudgetDiffValue = grid.m_total[eBudgetDiff].m_total; - QString totalBudgetAmount = totalBudgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString totalActualAmount = totalActualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString totalBudgetDiffAmount = totalBudgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString totalBudgetAmount = totalBudgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString totalActualAmount = totalActualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString totalBudgetDiffAmount = totalBudgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - m_part->write(QString("%1").arg(showColoredAmount(totalBudgetAmount, totalBudgetValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(totalActualAmount, totalActualValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(totalBudgetDiffAmount, totalBudgetDiffValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(totalBudgetAmount, totalBudgetValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(totalActualAmount, totalActualValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(totalBudgetDiffAmount, totalBudgetDiffValue.isNegative()))); m_part->write(""); m_part->write(""); @@ -1448,10 +1448,10 @@ void KHomeView::showBudget(void) //write the outergroup if it is the first row of outergroup being shown if(i == 0) { m_part->write(""); - m_part->write(QString("%1").arg(KMyMoneyUtils::accountTypeToString( rowname.accountType()))); + m_part->write(TQString("%1").tqarg(KMyMoneyUtils::accountTypeToString( rowname.accountType()))); m_part->write(""); } - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); //get values from grid MyMoneyMoney actualValue = it_row.data()[eActual][1]; @@ -1459,17 +1459,17 @@ void KHomeView::showBudget(void) MyMoneyMoney budgetDiffValue = it_row.data()[eBudgetDiff][1]; //format amounts - QString actualAmount = actualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString budgetAmount = budgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString budgetDiffAmount = budgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString actualAmount = actualValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString budgetAmount = budgetValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString budgetDiffAmount = budgetDiffValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); //account name - m_part->write(QString("") + link(VIEW_LEDGER, QString("?id=%1").arg(rowname.id())) + rowname.name() + linkend() + ""); + m_part->write(TQString("") + link(VIEW_LEDGER, TQString("?id=%1").tqarg(rowname.id())) + rowname.name() + linkend() + ""); //show amounts - m_part->write(QString("%1").arg(showColoredAmount(budgetAmount, budgetValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(actualAmount, actualValue.isNegative()))); - m_part->write(QString("%1").arg(showColoredAmount(budgetDiffAmount, budgetDiffValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(budgetAmount, budgetValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(actualAmount, actualValue.isNegative()))); + m_part->write(TQString("%1").tqarg(showColoredAmount(budgetDiffAmount, budgetDiffValue.isNegative()))); m_part->write(""); } ++it_row; @@ -1481,19 +1481,19 @@ void KHomeView::showBudget(void) //if no negative differences are found, then inform that if(i == 0) { - m_part->write(QString("").arg(i++ & 0x01 ? "even" : "odd")); - m_part->write(QString("%1").arg(i18n("No Budget Categories have been overrun"))); + m_part->write(TQString("").tqarg(i++ & 0x01 ? "even" : "odd")); + m_part->write(TQString("%1").tqarg(i18n("No Budget Categories have been overrun"))); m_part->write(""); } m_part->write("
"); } } -QString KHomeView::showColoredAmount(const QString& amount, bool isNegative) +TQString KHomeView::showColoredAmount(const TQString& amount, bool isNegative) { if(isNegative) { //if negative, get the settings for negative numbers - return QString("%2").arg(KMyMoneyGlobalSettings::listNegativeValueColor().name(), amount); + return TQString("%2").tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().name(), amount); } //if positive, return the same string @@ -1516,18 +1516,18 @@ void KHomeView::doForecast(void) m_forecast.doForecast(); } -MyMoneyMoney KHomeView::forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, QDate& paymentDate) +MyMoneyMoney KHomeView::forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, TQDate& paymentDate) { - //if paymentDate before or equal to currentDate set it to current date plus 1 + //if paymentDate before or equal to tqcurrentDate set it to current date plus 1 //so we get to accumulate forecast balance correctly - if(paymentDate <= QDate::currentDate()) - paymentDate = QDate::currentDate().addDays(1); + if(paymentDate <= TQDate::tqcurrentDate()) + paymentDate = TQDate::tqcurrentDate().addDays(1); //check if the account is already there - if(m_accountList.find(acc.id()) == m_accountList.end() - || m_accountList[acc.id()].find(paymentDate) == m_accountList[acc.id()].end()) + if(m_accountList.tqfind(acc.id()) == m_accountList.end() + || m_accountList[acc.id()].tqfind(paymentDate) == m_accountList[acc.id()].end()) { - if(paymentDate == QDate::currentDate()) { + if(paymentDate == TQDate::tqcurrentDate()) { m_accountList[acc.id()][paymentDate] = m_forecast.forecastBalance(acc, paymentDate); } else { m_accountList[acc.id()][paymentDate] = m_forecast.forecastBalance(acc, paymentDate.addDays(-1)); @@ -1547,25 +1547,25 @@ void KHomeView::showCashFlowSummary() int prec = MyMoneyMoney::denomToPrec(file->baseCurrency().smallestAccountFraction()); //set start and end of month dates - QDate startOfMonth = QDate(QDate::currentDate().year(), QDate::currentDate().month(), 1); - QDate endOfMonth = QDate(QDate::currentDate().year(), QDate::currentDate().month(), QDate::currentDate().daysInMonth()); + TQDate startOfMonth = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), 1); + TQDate endOfMonth = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), TQDate::tqcurrentDate().daysInMonth()); //Add total income and expenses for this month //get transactions for current month filter.setDateFilter(startOfMonth, endOfMonth); filter.setReportAllSplits(false); - QValueList transactions = file->transactionList(filter); + TQValueList transactions = file->transactionList(filter); //if no transaction then skip and print total in zero if(transactions.size() > 0) { - QValueList::const_iterator it_transaction; + TQValueList::const_iterator it_transaction; //get all transactions for this month for(it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction ) { //get the splits for each transaction - const QValueList& splits = (*it_transaction).splits(); - QValueList::const_iterator it_split; + const TQValueList& splits = (*it_transaction).splits(); + TQValueList::const_iterator it_split; for(it_split = splits.begin(); it_split != splits.end(); ++it_split) { if(!(*it_split).shares().isZero()) { ReportAccount repSplitAcc = ReportAccount((*it_split).accountId()); @@ -1596,10 +1596,10 @@ void KHomeView::showCashFlowSummary() } //format income and expenses - QString amountIncome = incomeValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountExpense = expenseValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountIncome.replace(" "," "); - amountExpense.replace(" "," "); + TQString amountIncome = incomeValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountExpense = expenseValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountIncome.tqreplace(" "," "); + amountExpense.tqreplace(" "," "); //calculate schedules @@ -1610,14 +1610,14 @@ void KHomeView::showCashFlowSummary() MyMoneyMoney scheduledOtherTransfer; //get overdues and schedules until the end of this month - QValueList schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, + TQValueList schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), endOfMonth); //Remove the finished schedules - QValueList::Iterator finished_it; + TQValueList::Iterator finished_it; for (finished_it=schedule.begin(); finished_it!=schedule.end();) { if ((*finished_it).isFinished()) { finished_it = schedule.remove(finished_it); @@ -1627,9 +1627,9 @@ void KHomeView::showCashFlowSummary() } //add income and expenses - QValueList::Iterator sched_it; + TQValueList::Iterator sched_it; for (sched_it=schedule.begin(); sched_it!=schedule.end();) { - QDate nextDate = (*sched_it).nextDueDate(); + TQDate nextDate = (*sched_it).nextDueDate(); int cnt = 0; while(nextDate.isValid() && nextDate <= endOfMonth) { @@ -1650,18 +1650,18 @@ void KHomeView::showCashFlowSummary() // take care of the autoCalc stuff if((*sched_it).type() == MyMoneySchedule::TYPE_LOANPAYMENT) { - QDate nextDate = (*sched_it).nextPayment((*sched_it).lastPayment()); + TQDate nextDate = (*sched_it).nextPayment((*sched_it).lastPayment()); //make sure we have all 'starting balances' so that the autocalc works - QValueList::const_iterator it_s; - QMap balanceMap; + TQValueList::const_iterator it_s; + TQMap balanceMap; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s ) { MyMoneyAccount acc = file->account((*it_s).accountId()); // collect all overdues on the first day - QDate schedDate = nextDate; - if(QDate::currentDate() >= nextDate) - schedDate = QDate::currentDate().addDays(1); + TQDate schedDate = nextDate; + if(TQDate::tqcurrentDate() >= nextDate) + schedDate = TQDate::tqcurrentDate().addDays(1); balanceMap[acc.id()] += file->balance(acc.id()); } @@ -1669,8 +1669,8 @@ void KHomeView::showCashFlowSummary() } //go through the splits and assign to liquid or other transfers - const QValueList splits = transaction.splits(); - QValueList::const_iterator split_it; + const TQValueList splits = transaction.splits(); + TQValueList::const_iterator split_it; for (split_it = splits.begin(); split_it != splits.end(); ++split_it) { if( (*split_it).accountId() != acc.id() ) { ReportAccount repSplitAcc = ReportAccount((*split_it).accountId()); @@ -1680,7 +1680,7 @@ void KHomeView::showCashFlowSummary() //convert to foreign currency if needed if(repSplitAcc.currencyId() != file->baseCurrency().id()) { - MyMoneyMoney curPrice = repSplitAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repSplitAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); value = value * curPrice; value = value.convert(10000); } @@ -1707,19 +1707,19 @@ void KHomeView::showCashFlowSummary() } //format the currency strings - QString amountScheduledIncome = scheduledIncome.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountScheduledExpense = scheduledExpense.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountScheduledLiquidTransfer = scheduledLiquidTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountScheduledOtherTransfer = scheduledOtherTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledIncome = scheduledIncome.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledExpense = scheduledExpense.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledLiquidTransfer = scheduledLiquidTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountScheduledOtherTransfer = scheduledOtherTransfer.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountScheduledIncome.replace(" "," "); - amountScheduledExpense.replace(" "," "); - amountScheduledLiquidTransfer.replace(" "," "); - amountScheduledOtherTransfer.replace(" "," "); + amountScheduledIncome.tqreplace(" "," "); + amountScheduledExpense.tqreplace(" "," "); + amountScheduledLiquidTransfer.tqreplace(" "," "); + amountScheduledOtherTransfer.tqreplace(" "," "); //get liquid assets and liabilities - QValueList accounts; - QValueList::const_iterator account_it; + TQValueList accounts; + TQValueList::const_iterator account_it; MyMoneyMoney liquidAssets; MyMoneyMoney liquidLiabilities; @@ -1733,11 +1733,11 @@ void KHomeView::showCashFlowSummary() case MyMoneyAccount::Savings: case MyMoneyAccount::Cash: { - MyMoneyMoney value = MyMoneyFile::instance()->balance((*account_it).id(), QDate::currentDate()); + MyMoneyMoney value = MyMoneyFile::instance()->balance((*account_it).id(), TQDate::tqcurrentDate()); //calculate balance for foreign currency accounts if((*account_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*account_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; liquidAssets += baseValue; liquidAssets = liquidAssets.convert(10000); @@ -1750,11 +1750,11 @@ void KHomeView::showCashFlowSummary() case MyMoneyAccount::CreditCard: { MyMoneyMoney value; - value = MyMoneyFile::instance()->balance((*account_it).id(), QDate::currentDate()); + value = MyMoneyFile::instance()->balance((*account_it).id(), TQDate::tqcurrentDate()); //calculate balance if foreign currency if((*account_it).currencyId() != file->baseCurrency().id()) { ReportAccount repAcc = ReportAccount((*account_it).id()); - MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(QDate::currentDate()); + MyMoneyMoney curPrice = repAcc.baseCurrencyPrice(TQDate::tqcurrentDate()); MyMoneyMoney baseValue = value * curPrice; liquidLiabilities += baseValue; liquidLiabilities = liquidLiabilities.convert(10000); @@ -1773,12 +1773,12 @@ void KHomeView::showCashFlowSummary() MyMoneyMoney liquidWorth = liquidAssets+liquidLiabilities; //format assets, liabilities and net worth - QString amountLiquidAssets = liquidAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountLiquidLiabilities = liquidLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountLiquidWorth = liquidWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountLiquidAssets.replace(" "," "); - amountLiquidLiabilities.replace(" "," "); - amountLiquidWorth.replace(" "," "); + TQString amountLiquidAssets = liquidAssets.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountLiquidLiabilities = liquidLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountLiquidWorth = liquidWorth.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountLiquidAssets.tqreplace(" "," "); + amountLiquidLiabilities.tqreplace(" "," "); + amountLiquidWorth.tqreplace(" "," "); //show the summary m_part->write("
" + i18n("Cash Flow Summary") + "
\n
 
\n"); @@ -1807,19 +1807,19 @@ void KHomeView::showCashFlowSummary() m_part->write(""); //add row with banding - m_part->write(QString("")); + m_part->write(TQString("")); //print current income - m_part->write(QString("%2").arg(showColoredAmount(amountIncome, incomeValue.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountIncome, incomeValue.isNegative()))); //print the scheduled income - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledIncome, scheduledIncome.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledIncome, scheduledIncome.isNegative()))); //print current expenses - m_part->write(QString("%2").arg(showColoredAmount(amountExpense, expenseValue.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountExpense, expenseValue.isNegative()))); //print the scheduled expenses - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledExpense, scheduledExpense.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledExpense, scheduledExpense.isNegative()))); m_part->write(""); m_part->write(""); @@ -1849,19 +1849,19 @@ void KHomeView::showCashFlowSummary() m_part->write(""); //add row with banding - m_part->write(QString("")); + m_part->write(TQString("")); //print current liquid assets - m_part->write(QString("%2").arg(showColoredAmount(amountLiquidAssets, liquidAssets.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountLiquidAssets, liquidAssets.isNegative()))); //print the scheduled transfers - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledLiquidTransfer, scheduledLiquidTransfer.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledLiquidTransfer, scheduledLiquidTransfer.isNegative()))); //print current liabilities - m_part->write(QString("%2").arg(showColoredAmount(amountLiquidLiabilities, liquidLiabilities.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountLiquidLiabilities, liquidLiabilities.isNegative()))); //print the scheduled transfers - m_part->write(QString("%2").arg(showColoredAmount(amountScheduledOtherTransfer, scheduledOtherTransfer.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountScheduledOtherTransfer, scheduledOtherTransfer.isNegative()))); m_part->write(""); @@ -1873,12 +1873,12 @@ void KHomeView::showCashFlowSummary() MyMoneyMoney expectedAsset = liquidAssets + scheduledIncome + scheduledExpense + scheduledLiquidTransfer + scheduledOtherTransfer; MyMoneyMoney expectedLiabilities = liquidLiabilities + scheduledLiquidTransfer; - QString amountExpectedAsset = expectedAsset.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountExpectedLiabilities = expectedLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); - QString amountProfit = profitValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); - amountProfit.replace(" "," "); - amountExpectedAsset.replace(" "," "); - amountExpectedLiabilities.replace(" "," "); + TQString amountExpectedAsset = expectedAsset.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountExpectedLiabilities = expectedLiabilities.formatMoney(file->baseCurrency().tradingSymbol(), prec); + TQString amountProfit = profitValue.formatMoney(file->baseCurrency().tradingSymbol(), prec); + amountProfit.tqreplace(" "," "); + amountExpectedAsset.tqreplace(" "," "); + amountExpectedLiabilities.tqreplace(" "," "); @@ -1888,7 +1888,7 @@ void KHomeView::showCashFlowSummary() //income and expense title m_part->write(""); m_part->write(""); - m_part->write(i18n("Cash Flow Status")); + m_part->write(i18n("Cash Flow tqStatus")); m_part->write(""); //column titles m_part->write(""); @@ -1905,17 +1905,17 @@ void KHomeView::showCashFlowSummary() m_part->write(""); //add row with banding - m_part->write(QString("")); + m_part->write(TQString("")); m_part->write(" "); //print expected assets - m_part->write(QString("%2").arg(showColoredAmount(amountExpectedAsset, expectedAsset.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountExpectedAsset, expectedAsset.isNegative()))); //print expected liabilities - m_part->write(QString("%2").arg(showColoredAmount(amountExpectedLiabilities, expectedLiabilities.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountExpectedLiabilities, expectedLiabilities.isNegative()))); //print expected profit - m_part->write(QString("%2").arg(showColoredAmount(amountProfit, profitValue.isNegative()))); + m_part->write(TQString("%2").tqarg(showColoredAmount(amountProfit, profitValue.isNegative()))); m_part->write(""); diff --git a/kmymoney2/views/khomeview.h b/kmymoney2/views/khomeview.h index 213fd91..f580ed4 100644 --- a/kmymoney2/views/khomeview.h +++ b/kmymoney2/views/khomeview.h @@ -24,9 +24,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QVBoxLayout; -class QFrame; +#include +class TQVBoxLayout; +class TQFrame; // ---------------------------------------------------------------------------- // KDE Includes @@ -51,6 +51,7 @@ class QFrame; class KHomeView : public KMyMoneyViewBase { Q_OBJECT + TQ_OBJECT public: /** * Definition of bitmap used as argument for showAccounts(). @@ -60,13 +61,13 @@ public: Payment = 2 ///< show payment accounts }; - KHomeView(QWidget *parent=0, const char *name=0); + KHomeView(TQWidget *tqparent=0, const char *name=0); ~KHomeView(); protected: void showPayments(void); void showPaymentEntry(const MyMoneySchedule&, int cnt = 1); - void showAccounts(paymentTypeE type, const QString& hdr); + void showAccounts(paymentTypeE type, const TQString& hdr); void showAccountEntry(const MyMoneyAccount&); void showFavoriteReports(void); void showForecast(void); @@ -78,8 +79,8 @@ protected: void showBudget(void); void showCashFlowSummary(void); - const QString link(const QString& view, const QString& query, const QString& title = QString()) const; - const QString linkend(void) const; + const TQString link(const TQString& view, const TQString& query, const TQString& title = TQString()) const; + const TQString linkend(void) const; void loadView(void); public slots: @@ -99,9 +100,9 @@ public slots: void slotPrintView(void); signals: - void ledgerSelected(const QString& id, const QString& transaction); - void scheduleSelected(const QString& id); - void reportSelected(const QString& id); + void ledgerSelected(const TQString& id, const TQString& transaction); + void scheduleSelected(const TQString& id); + void reportSelected(const TQString& id); private: /// \internal d-pointer class. @@ -112,7 +113,7 @@ private: /** * daily balances of an account */ - typedef QMap dailyBalances; + typedef TQMap dailyBalances; /** * Print an account and its balance and limit @@ -129,7 +130,7 @@ private: * Print text in the color set for negative numbers, if @p amount is negative * abd @p isNegative is true */ - QString showColoredAmount(const QString& amount, bool isNegative); + TQString showColoredAmount(const TQString& amount, bool isNegative); /** * Run the forecast @@ -139,11 +140,11 @@ private: /** * Calculate the forecast balance after a payment has been made */ - MyMoneyMoney forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, QDate& paymentDate); + MyMoneyMoney forecastPaymentBalance(const MyMoneyAccount& acc, const MyMoneyMoney& payment, TQDate& paymentDate); KHTMLPart* m_part; - QVBoxLayout* m_qvboxlayoutPage; - QString m_filename; + TQVBoxLayout* m_qvboxtqlayoutPage; + TQString m_filename; bool m_showAllSchedules; bool m_needReload; MyMoneyForecast m_forecast; @@ -151,7 +152,7 @@ private: /** * daily forecast balance of accounts */ - QMap m_accountList; + TQMap m_accountList; }; diff --git a/kmymoney2/views/kinstitutionsview.cpp b/kmymoney2/views/kinstitutionsview.cpp index 2c3ac5d..5fd9999 100644 --- a/kmymoney2/views/kinstitutionsview.cpp +++ b/kmymoney2/views/kinstitutionsview.cpp @@ -17,9 +17,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -36,19 +36,19 @@ #include "../kmymoneyglobalsettings.h" #include "../kmymoney2.h" -KInstitutionsView::KInstitutionsView(QWidget *parent, const char *name) : - KInstitutionsViewDecl(parent,name), +KInstitutionsView::KInstitutionsView(TQWidget *tqparent, const char *name) : + KInstitutionsViewDecl(tqparent,name), m_needReload(false) { m_accountTree->header()->setLabel(0, i18n("Institution/Account")); - connect(m_accountTree, SIGNAL(selectObject(const MyMoneyObject&)), this, SIGNAL(selectObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(openContextMenu(const MyMoneyObject&)), this, SIGNAL(openContextMenu(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(valueChanged(void)), this, SLOT(slotUpdateNetWorth(void))); - connect(m_accountTree, SIGNAL(openObject(const MyMoneyObject&)), this, SIGNAL(openObject(const MyMoneyObject&))); - connect(m_accountTree, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), this, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))); + connect(m_accountTree, TQT_SIGNAL(selectObject(const MyMoneyObject&)), this, TQT_SIGNAL(selectObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), this, TQT_SIGNAL(openContextMenu(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(valueChanged(void)), this, TQT_SLOT(slotUpdateNetWorth(void))); + connect(m_accountTree, TQT_SIGNAL(openObject(const MyMoneyObject&)), this, TQT_SIGNAL(openObject(const MyMoneyObject&))); + connect(m_accountTree, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), this, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadAccounts())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadAccounts())); } KInstitutionsView::~KInstitutionsView() @@ -75,7 +75,7 @@ void KInstitutionsView::show(void) void KInstitutionsView::polish(void) { KInstitutionsViewDecl::polish(); - m_accountTree->setResizeMode(QListView::LastColumn); + m_accountTree->setResizeMode(TQListView::LastColumn); m_accountTree->restoreLayout("Institution View Settings"); } @@ -90,15 +90,15 @@ void KInstitutionsView::slotLoadAccounts(void) void KInstitutionsView::loadAccounts(void) { - QMap isOpen; + TQMap isOpen; ::timetrace("start load institutions view"); // remember the id of the current selected item KMyMoneyAccountTreeBaseItem *item = m_accountTree->selectedItem(); - QString selectedItemId = (item) ? item->id() : QString(); + TQString selectedItemId = (item) ? item->id() : TQString(); // keep a map of all 'expanded' accounts - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->isOpen()) { @@ -108,7 +108,7 @@ void KInstitutionsView::loadAccounts(void) } // remember the upper left corner of the viewport - QPoint startPoint = m_accountTree->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_accountTree->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_accountTree->setUpdatesEnabled(false); @@ -121,25 +121,25 @@ void KInstitutionsView::loadAccounts(void) MyMoneyFile* file = MyMoneyFile::instance(); - QValueList alist; + TQValueList alist; file->accountList(alist); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = alist.begin(); it_a != alist.end(); ++it_a) { m_accountMap[(*it_a).id()] = *it_a; } // we need to make sure we show stock accounts - // under the right institution (the one of the parent account) - QMap::iterator it_am; + // under the right institution (the one of the tqparent account) + TQMap::iterator it_am; for(it_am = m_accountMap.begin(); it_am != m_accountMap.end(); ++it_am) { if((*it_am).isInvest()) { - (*it_am).setInstitutionId(m_accountMap[(*it_am).parentAccountId()].institutionId()); + (*it_am).setInstitutionId(m_accountMap[(*it_am).tqparentAccountId()].institutionId()); } } - QValueList slist = file->currencyList(); + TQValueList slist = file->currencyList(); slist += file->securityList(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = slist.begin(); it_s != slist.end(); ++it_s) { m_securityMap[(*it_s).id()] = *it_s; } @@ -157,13 +157,13 @@ void KInstitutionsView::loadAccounts(void) none.setName(i18n("Accounts with no institution assigned")); KMyMoneyAccountTreeItem* noInstitutionItem = new KMyMoneyAccountTreeItem(m_accountTree, none); noInstitutionItem->setPixmap(0,none.pixmap()); - loadSubAccounts(noInstitutionItem, QString()); + loadSubAccounts(noInstitutionItem, TQString()); // hide it, if unused noInstitutionItem->setVisible(noInstitutionItem->childCount() != 0); - QValueList list = file->institutionList(); - QValueList::const_iterator it_i; + TQValueList list = file->institutionList(); + TQValueList::const_iterator it_i; for(it_i = list.begin(); it_i != list.end(); ++it_i) { KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(m_accountTree, *it_i); item->setPixmap(0, none.pixmap()); @@ -177,13 +177,13 @@ void KInstitutionsView::loadAccounts(void) // scan through the list of accounts and re-expand those that were // expanded and re-select the one that was probably selected before - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item) { if(item->id() == selectedItemId) m_accountTree->setSelected(item, true); - if(isOpen.find(item->id()) != isOpen.end()) + if(isOpen.tqfind(item->id()) != isOpen.end()) item->setOpen(true); } ++it_lvi; @@ -194,16 +194,16 @@ void KInstitutionsView::loadAccounts(void) // turn updates back on m_accountTree->setUpdatesEnabled(true); - m_accountTree->repaintContents(); + m_accountTree->tqrepaintContents(); ::timetrace("done load institutions view"); } -void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent) +void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent) { bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); - const MyMoneyAccount& account = dynamic_cast(parent->itemObject()); - QValueList::const_iterator it_a; + const MyMoneyAccount& account = dynamic_cast(tqparent->itemObject()); + TQValueList::const_iterator it_a; MyMoneyFile* file = MyMoneyFile::instance(); for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) { MyMoneyAccount acc = m_accountMap[(*it_a)]; @@ -212,23 +212,23 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent) if(acc.isClosed() && !showClosedAccounts) continue; const MyMoneySecurity& security = m_securityMap[acc.currencyId()]; - QValueList prices; + TQValueList prices; prices += file->price(acc.currencyId(), security.tradingCurrency()); if(security.tradingCurrency() != file->baseCurrency().id()) { MyMoneySecurity sec = m_securityMap[security.tradingCurrency()]; prices += file->price(sec.id(), file->baseCurrency().id()); } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); if(acc.id() == m_reconciliationAccount.id()) item->setReconciliation(true); } } -void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QString& institutionId) +void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQString& institutionId) { MyMoneyFile* file = MyMoneyFile::instance(); - QMap::const_iterator it_a; + TQMap::const_iterator it_a; MyMoneyMoney value; bool showClosedAccounts = kmymoney2->toggleAction("view_show_all_accounts")->isChecked(); @@ -244,7 +244,7 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const Q if(acc.institutionId() == institutionId && !acc.isInvest() && (!acc.isClosed() || showClosedAccounts)) { - QValueList prices; + TQValueList prices; MyMoneySecurity security = file->baseCurrency(); try { if(acc.currencyId() != file->baseCurrency().id()) { @@ -257,7 +257,7 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const Q delete e; } - KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(parent, acc, prices, security); + KMyMoneyAccountTreeItem* item = new KMyMoneyAccountTreeItem(tqparent, acc, prices, security); if(acc.id() == m_reconciliationAccount.id()) item->setReconciliation(true); @@ -276,8 +276,8 @@ void KInstitutionsView::loadSubAccounts(KMyMoneyAccountTreeItem* parent, const Q // it does not take the negative sign for liability accounts // into account. So we correct this here with the value we // have calculated while filling the list - parent->adjustTotalValue(-parent->totalValue()); // load a 0 - parent->adjustTotalValue(value); // now store the new value + tqparent->adjustTotalValue(-tqparent->totalValue()); // load a 0 + tqparent->adjustTotalValue(value); // now store the new value // we need to call slotUpdateNetWorth() here manually, because // KMyMoneyAccountTreeItem::adjustTotalValue() does not send out @@ -297,19 +297,19 @@ void KInstitutionsView::slotUpdateNetWorth(void) item = dynamic_cast(item->nextSibling()); } - QString s(i18n("Net Worth: ")); + TQString s(i18n("Net Worth: ")); // FIXME figure out how to deal with the approximate // if(!(file->totalValueValid(assetAccount.id()) & file->totalValueValid(liabilityAccount.id()))) // s += "~ "; - s.replace(QString(" "), QString(" ")); + s.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } const MyMoneySecurity& sec = MyMoneyFile::instance()->baseCurrency(); - QString v(netWorth.formatMoney(sec)); - s += v.replace(QString(" "), QString(" ")); + TQString v(netWorth.formatMoney(sec)); + s += v.tqreplace(TQString(" "), TQString(" ")); if(netWorth.isNegative()) { s += ""; } @@ -318,14 +318,14 @@ void KInstitutionsView::slotUpdateNetWorth(void) m_totalProfitsLabel->setText(s); } -void KInstitutionsView::slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +void KInstitutionsView::slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { Q_UNUSED(reconciliationDate); Q_UNUSED(endingBalance); // scan through the list of accounts and mark all non // expanded and re-select the one that was probably selected before - QListViewItemIterator it_lvi(m_accountTree); + TQListViewItemIterator it_lvi(m_accountTree); KMyMoneyAccountTreeItem* item; while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); @@ -337,7 +337,7 @@ void KInstitutionsView::slotReconcileAccount(const MyMoneyAccount& acc, const QD m_reconciliationAccount = acc; if(!acc.id().isEmpty()) { - it_lvi = QListViewItemIterator(m_accountTree); + it_lvi = TQListViewItemIterator(m_accountTree); while(it_lvi.current()) { item = dynamic_cast(it_lvi.current()); if(item && item->itemObject().id() == acc.id()) { diff --git a/kmymoney2/views/kinstitutionsview.h b/kmymoney2/views/kinstitutionsview.h index 3a35713..9c1ab96 100644 --- a/kmymoney2/views/kinstitutionsview.h +++ b/kmymoney2/views/kinstitutionsview.h @@ -42,10 +42,11 @@ class KInstitutionsView : public KInstitutionsViewDecl { Q_OBJECT + TQ_OBJECT private: public: - KInstitutionsView(QWidget *parent=0, const char *name=0); + KInstitutionsView(TQWidget *tqparent=0, const char *name=0); virtual ~KInstitutionsView(); public slots: @@ -58,22 +59,22 @@ public slots: void show(void); /** - * Override the base class behaviour to restore the layout. Do not - * do this in show() because show() itself may change the layout + * Override the base class behaviour to restore the tqlayout. Do not + * do this in show() because show() itself may change the tqlayout * in undesired ways. */ void polish(void); - void slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + void slotReconcileAccount(const MyMoneyAccount& acc, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); protected: void loadAccounts(void); // load accounts that are kept at a specific institution - void loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QString& institutionId); + void loadSubAccounts(KMyMoneyAccountTreeItem* tqparent, const TQString& institutionId); - // load stock accounts under the investment account (parent) - void loadSubAccounts(KMyMoneyAccountTreeItem* parent); + // load stock accounts under the investment account (tqparent) + void loadSubAccounts(KMyMoneyAccountTreeItem* tqparent); protected slots: void slotUpdateNetWorth(void); @@ -85,7 +86,7 @@ private: * * @param type account type as defined in MyMoneyAccount::accountTypeE */ - const QPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; + const TQPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; signals: /** @@ -117,9 +118,9 @@ signals: private: MyMoneyAccount m_reconciliationAccount; - QMap m_accountMap; - QMap m_securityMap; - QMap m_transactionCountMap; + TQMap m_accountMap; + TQMap m_securityMap; + TQMap m_transactionCountMap; /// set if a view needs to be reloaded during show() bool m_needReload; diff --git a/kmymoney2/views/kinstitutionsviewdecl.ui b/kmymoney2/views/kinstitutionsviewdecl.ui index 3a0a740..678ec08 100644 --- a/kmymoney2/views/kinstitutionsviewdecl.ui +++ b/kmymoney2/views/kinstitutionsviewdecl.ui @@ -1,6 +1,6 @@ KInstitutionsViewDecl - + KInstitutionsViewDecl @@ -27,9 +27,9 @@ false - + - layout2 + tqlayout2 @@ -45,18 +45,18 @@ Expanding - + 20 20 - + m_totalProfitsLabel - + 150 0 @@ -68,7 +68,7 @@ RichText - + WordBreak|AlignVCenter|AlignRight @@ -78,5 +78,8 @@ - + + kmymoney/kmymoneyaccounttree.h + + diff --git a/kmymoney2/views/kinvestmentlistitem.cpp b/kmymoney2/views/kinvestmentlistitem.cpp index c2c41d9..f3cf29b 100644 --- a/kmymoney2/views/kinvestmentlistitem.cpp +++ b/kmymoney2/views/kinvestmentlistitem.cpp @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -40,8 +40,8 @@ #include #include -KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount& account) - : KListViewItem(parent) +KInvestmentListItem::KInvestmentListItem(KListView* tqparent, const MyMoneyAccount& account) + : KListViewItem(tqparent) { bColumn5Negative = false; bColumn6Negative = false; @@ -50,7 +50,7 @@ KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount bColumn9Negative = false; m_account = account; - m_listView = parent; + m_listView = tqparent; MyMoneySecurity security; MyMoneyFile* file = MyMoneyFile::instance(); @@ -60,7 +60,7 @@ KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount int prec = MyMoneyMoney::denomToPrec(m_tradingCurrency.smallestAccountFraction()); - QValueList transactionList; + TQValueList transactionList; // FIXME PRICE // equity_price_history history = equity.priceHistory(); @@ -100,37 +100,37 @@ KInvestmentListItem::~KInvestmentListItem() // FIXME PRICE #if 0 -const QString KInvestmentListItem::calculate1WeekGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculate1WeekGain(const equity_price_history& history) { return calculateGain(history, -7, 0, false, bColumn6Negative); } -const QString KInvestmentListItem::calculate4WeekGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculate4WeekGain(const equity_price_history& history) { return calculateGain(history, -28, 0, false, bColumn7Negative); } -const QString KInvestmentListItem::calculate3MonthGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculate3MonthGain(const equity_price_history& history) { return calculateGain(history, 0, -3, false, bColumn8Negative); } -const QString KInvestmentListItem::calculateYTDGain(const equity_price_history& history) +const TQString KInvestmentListItem::calculateYTDGain(const equity_price_history& history) { return calculateGain(history, 0, 0, true, bColumn9Negative); } -const QString KInvestmentListItem::calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative) +const TQString KInvestmentListItem::calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative) { bNegative = false; if(history.isEmpty()) { - return QString("0.0%"); + return TQString("0.0%"); } else { bool bFoundCurrent = false, bFoundComparison = false; - QDate tempDate, comparisonDate = QDate::currentDate(); + TQDate tempDate, comparisonDate = TQDate::tqcurrentDate(); if(YTD) { @@ -147,9 +147,9 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his //find the current value, or closest to the current value. equity_price_history::ConstIterator itToday = history.end(); - for(tempDate = QDate::currentDate(); tempDate >= comparisonDate; ) + for(tempDate = TQDate::tqcurrentDate(); tempDate >= comparisonDate; ) { - itToday = history.find(tempDate); + itToday = history.tqfind(tempDate); if(itToday != history.end()) { currentValue = itToday.data(); @@ -162,14 +162,14 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his if(!bFoundCurrent) { - return QString("0.0%"); + return TQString("0.0%"); } - //find a date that is closest to a week old, not older, and not today's date. Because its a QMap, this map + //find a date that is closest to a week old, not older, and not today's date. Because its a TQMap, this map //should already be sorted earliest to latest. for(equity_price_history::ConstIterator it = history.begin(); it != history.end(); ++it) { - if(it.key() >= comparisonDate && it.key() < QDate::currentDate()) + if(it.key() >= comparisonDate && it.key() < TQDate::tqcurrentDate()) { comparisonDate = it.key(); comparisonValue = it.data(); @@ -180,7 +180,7 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his if(!bFoundComparison) { - return QString("0.0%"); + return TQString("0.0%"); } //qDebug("Current date/value to use is %s/%s, Previous is %s/%s", tempDate.toString().data(), currentValue.toString().data(), comparisonDate.toString().data(), comparisonValue.toString().data()); @@ -195,21 +195,21 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his bNegative = true; } - QString ds = QString("%1%").arg(result, 0, 'f', 3); + TQString ds = TQString("%1%").tqarg(result, 0, 'f', 3); return ds; /*MyMoneyMoney result = (currentValue / comparisonValue); result = result * 100; result = result - 100; qDebug("final result = %s", result.toString().data()); - return QString(result.formatMoney("", 3) + "%");*/ + return TQString(result.formatMoney("", 3) + "%");*/ } } - return QString(""); + return TQString(""); } #endif -int KInvestmentListItem::compare(QListViewItem* i, int col, bool ascending) const +int KInvestmentListItem::compare(TQListViewItem* i, int col, bool ascending) const { KInvestmentListItem* item = dynamic_cast(i); // do special sorting only for numeric columns @@ -247,7 +247,7 @@ int KInvestmentListItem::compare(QListViewItem* i, int col, bool ascending) cons return KListViewItem::compare(i, col, ascending); } -void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align) +void KInvestmentListItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align) { bool bPaintRed = false; if((column == COLUMN_RAWGAIN_INDEX && bColumn5Negative) || @@ -261,15 +261,15 @@ void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int co p->save(); - QColorGroup cg2(cg); + TQColorGroup cg2(cg); if(isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); #ifndef KMM_DESIGNER - QFont font = KMyMoneyGlobalSettings::listCellFont(); + TQFont font = KMyMoneyGlobalSettings::listCellFont(); // strike out closed accounts if(m_account.isClosed()) font.setStrikeOut(true); @@ -279,15 +279,15 @@ void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int co if(bPaintRed) { - QColorGroup _cg( cg2); - QColor c = _cg.text(); - _cg.setColor(QColorGroup::Text, Qt::red); - QListViewItem::paintCell(p, _cg, column, width, align); - _cg.setColor(QColorGroup::Text, c); + TQColorGroup _cg( cg2); + TQColor c = _cg.text(); + _cg.setColor(TQColorGroup::Text, TQt::red); + TQListViewItem::paintCell(p, _cg, column, width, align); + _cg.setColor(TQColorGroup::Text, c); } else { - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } p->restore(); diff --git a/kmymoney2/views/kinvestmentlistitem.h b/kmymoney2/views/kinvestmentlistitem.h index d0ad62b..cb0d944 100644 --- a/kmymoney2/views/kinvestmentlistitem.h +++ b/kmymoney2/views/kinvestmentlistitem.h @@ -59,30 +59,30 @@ class KInvestmentListItem : public KListViewItem { public: - KInvestmentListItem(KListView* parent, const MyMoneyAccount& security); + KInvestmentListItem(KListView* tqparent, const MyMoneyAccount& security); ~KInvestmentListItem(); - QString securityId() const { return m_account.currencyId(); }; + TQString securityId() const { return m_account.currencyId(); }; const MyMoneyAccount& account(void) const { return m_account; }; const MyMoneySecurity tradingCurrency(void) const { return m_tradingCurrency; }; /** * Helper method to show the right order */ - int compare(QListViewItem* i, int col, bool ascending) const; + int compare(TQListViewItem* i, int col, bool ascending) const; protected: - void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align); private: // FIXME PRICE #if 0 - const QString calculate1WeekGain(const equity_price_history& history); - const QString calculate4WeekGain(const equity_price_history& history); - const QString calculate3MonthGain(const equity_price_history& history); - const QString calculateYTDGain(const equity_price_history& history); - const QString calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative); + const TQString calculate1WeekGain(const equity_price_history& history); + const TQString calculate4WeekGain(const equity_price_history& history); + const TQString calculate3MonthGain(const equity_price_history& history); + const TQString calculateYTDGain(const equity_price_history& history); + const TQString calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative); #endif private: diff --git a/kmymoney2/views/kinvestmentview.cpp b/kmymoney2/views/kinvestmentview.cpp index ae8cc11..d6ebb1a 100644 --- a/kmymoney2/views/kinvestmentview.cpp +++ b/kmymoney2/views/kinvestmentview.cpp @@ -62,8 +62,8 @@ public: -KInvestmentView::KInvestmentView(QWidget *parent, const char *name) : - KInvestmentViewDecl(parent,name), +KInvestmentView::KInvestmentView(TQWidget *tqparent, const char *name) : + KInvestmentViewDecl(tqparent,name), d(new Private) { m_table->setRootIsDecorated(false); @@ -72,31 +72,31 @@ KInvestmentView::KInvestmentView(QWidget *parent, const char *name) : m_table->addColumn(i18n("Symbol")); int col = m_table->addColumn(i18n("Value")); - m_table->setColumnAlignment(col, Qt::AlignRight); + m_table->setColumnAlignment(col, TQt::AlignRight); col = m_table->addColumn(i18n("Quantity")); - m_table->setColumnAlignment(col, Qt::AlignRight); + m_table->setColumnAlignment(col, TQt::AlignRight); col = m_table->addColumn(i18n("Price")); - m_table->setColumnAlignment(col, Qt::AlignRight); + m_table->setColumnAlignment(col, TQt::AlignRight); m_table->setMultiSelection(false); - m_table->setColumnWidthMode(0, QListView::Maximum); + m_table->setColumnWidthMode(0, TQListView::Maximum); m_table->header()->setResizeEnabled(true); m_table->setAllColumnsShowFocus(true); m_table->setShowSortIndicator(true); m_table->restoreLayout(KGlobal::config(), "Investment Settings"); - connect(m_table, SIGNAL(contextMenu(KListView*, QListViewItem* , const QPoint&)), - this, SLOT(slotListContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(m_table, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(slotSelectionChanged(QListViewItem *))); + connect(m_table, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem* , const TQPoint&)), + this, TQT_SLOT(slotListContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(m_table, TQT_SIGNAL(selectionChanged(TQListViewItem *)), this, TQT_SLOT(slotSelectionChanged(TQListViewItem *))); - connect(m_accountComboBox, SIGNAL(accountSelected(const QString&)), - this, SLOT(slotSelectAccount(const QString&))); + connect(m_accountComboBox, TQT_SIGNAL(accountSelected(const TQString&)), + this, TQT_SLOT(slotSelectAccount(const TQString&))); - connect(m_table, SIGNAL(doubleClicked(QListViewItem*,const QPoint&, int)), kmymoney2->action("investment_edit"), SLOT(activate())); + connect(m_table, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint&, int)), kmymoney2->action("investment_edit"), TQT_SLOT(activate())); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadView())); } KInvestmentView::~KInvestmentView() @@ -105,7 +105,7 @@ KInvestmentView::~KInvestmentView() delete d; } -void KInvestmentView::slotSelectionChanged(QListViewItem *item) +void KInvestmentView::slotSelectionChanged(TQListViewItem *item) { kmymoney2->slotSelectInvestment(); @@ -121,7 +121,7 @@ void KInvestmentView::slotSelectionChanged(QListViewItem *item) } } -void KInvestmentView::slotListContextMenu(KListView* /* lv */, QListViewItem* /*item*/, const QPoint& /*point*/) +void KInvestmentView::slotListContextMenu(KListView* /* lv */, TQListViewItem* /*item*/, const TQPoint& /*point*/) { kmymoney2->slotSelectInvestment(); KInvestmentListItem *pItem = dynamic_cast(m_table->selectedItem()); @@ -160,9 +160,9 @@ void KInvestmentView::loadAccounts(void) m_accountComboBox->loadList(MyMoneyAccount::Investment); if(d->m_account.id().isEmpty()) { - QStringList list = m_accountComboBox->accountList(); + TQStringList list = m_accountComboBox->accountList(); if(list.count()) { - QStringList::Iterator it; + TQStringList::Iterator it; for(it = list.begin(); it != list.end(); ++it) { MyMoneyAccount a = file->account(*it); if(a.accountType() == MyMoneyAccount::Investment) { @@ -205,7 +205,7 @@ bool KInvestmentView::slotSelectAccount(const MyMoneyObject& obj) return rc; } -bool KInvestmentView::slotSelectAccount(const QString& id, const QString& transactionId, const bool /* reconciliation*/) +bool KInvestmentView::slotSelectAccount(const TQString& id, const TQString& transactionId, const bool /* reconciliation*/) { bool rc = true; @@ -215,9 +215,9 @@ bool KInvestmentView::slotSelectAccount(const QString& id, const QString& transa try { d->m_account = MyMoneyFile::instance()->account(id); // if a stock account is selected, we show the - // the corresponding parent (investment) account + // the corresponding tqparent (investment) account if(d->m_account.isInvest()) { - d->m_account = MyMoneyFile::instance()->account(d->m_account.parentAccountId()); + d->m_account = MyMoneyFile::instance()->account(d->m_account.tqparentAccountId()); } // TODO if we don't have an investment account, then we should switch to the ledger view d->m_newAccountLoaded = true; @@ -246,8 +246,8 @@ bool KInvestmentView::slotSelectAccount(const QString& id, const QString& transa void KInvestmentView::clear(void) { // setup header font - QFont font = KMyMoneyGlobalSettings::listHeaderFont(); - QFontMetrics fm( font ); + TQFont font = KMyMoneyGlobalSettings::listHeaderFont(); + TQFontMetrics fm( font ); int height = fm.lineSpacing()+6; m_table->header()->setMinimumHeight(height); m_table->header()->setMaximumHeight(height); @@ -261,7 +261,7 @@ void KInvestmentView::clear(void) m_table->clear(); // and the selected account in the combo box - m_accountComboBox->setSelected(QString()); + m_accountComboBox->setSelected(TQString()); } void KInvestmentView::loadView(void) @@ -287,9 +287,9 @@ void KInvestmentView::loadView(void) || !KMyMoneyGlobalSettings::hideClosedAccounts(); try { d->m_account = file->account(d->m_account.id()); - QStringList securities = d->m_account.accountList(); + TQStringList securities = d->m_account.accountList(); - for(QStringList::ConstIterator it = securities.begin(); it != securities.end(); ++it) { + for(TQStringList::ConstIterator it = securities.begin(); it != securities.end(); ++it) { MyMoneyAccount acc = file->account(*it); if(!acc.isClosed() || showClosedAccounts) new KInvestmentListItem(m_table, acc); diff --git a/kmymoney2/views/kinvestmentview.h b/kmymoney2/views/kinvestmentview.h index ba0aecc..98e2b9a 100644 --- a/kmymoney2/views/kinvestmentview.h +++ b/kmymoney2/views/kinvestmentview.h @@ -47,9 +47,10 @@ class MyMoneyInvestTransaction; class KInvestmentView : public KInvestmentViewDecl { Q_OBJECT + TQ_OBJECT public: - KInvestmentView(QWidget *parent=0, const char *name=0); + KInvestmentView(TQWidget *tqparent=0, const char *name=0); ~KInvestmentView(); /** @@ -79,7 +80,7 @@ public slots: * @retval true selection of account referenced by @p id succeeded * @retval false selection of account failed */ - bool slotSelectAccount(const QString& accountId, const QString& transactionId = QString(), const bool reconciliation = false); + bool slotSelectAccount(const TQString& accountId, const TQString& transactionId = TQString(), const bool reconciliation = false); /** * This method is provided for convenience and acts as the method above. @@ -110,9 +111,9 @@ protected slots: * This slot receives the signal from the listview @c lv control that the context menu * was requested for @c item at @c point. */ - void slotListContextMenu(KListView* lv, QListViewItem* item, const QPoint& point); + void slotListContextMenu(KListView* lv, TQListViewItem* item, const TQPoint& point); - void slotSelectionChanged(QListViewItem *item); + void slotSelectionChanged(TQListViewItem *item); signals: @@ -120,7 +121,7 @@ signals: * This signal is emitted, if an account has been selected * which cannot handled by this view. */ - void accountSelected(const QString& accountId, const QString& transactionId); + void accountSelected(const TQString& accountId, const TQString& transactionId); void accountSelected(const MyMoneyObject&); diff --git a/kmymoney2/views/kinvestmentviewdecl.ui b/kmymoney2/views/kinvestmentviewdecl.ui index 1c74d50..d339bbf 100644 --- a/kmymoney2/views/kinvestmentviewdecl.ui +++ b/kmymoney2/views/kinvestmentviewdecl.ui @@ -1,6 +1,6 @@ KInvestmentViewDecl - + KInvestmentViewDecl @@ -22,15 +22,15 @@ 0 - + - layout2 + tqlayout2 unnamed - + textLabel1 @@ -53,7 +53,7 @@ Expanding - + 280 20 @@ -79,5 +79,8 @@ - + + kmymoney/kmymoneyaccountcombo.h + + diff --git a/kmymoney2/views/kmymoneyfile.cpp b/kmymoney2/views/kmymoneyfile.cpp index 4046cc0..76d3ea1 100644 --- a/kmymoney2/views/kmymoneyfile.cpp +++ b/kmymoney2/views/kmymoneyfile.cpp @@ -39,7 +39,7 @@ KMyMoneyFile::KMyMoneyFile() } /* -KMyMoneyFile::KMyMoneyFile(const QString&) +KMyMoneyFile::KMyMoneyFile(const TQString&) { } */ diff --git a/kmymoney2/views/kmymoneyfile.h b/kmymoney2/views/kmymoneyfile.h index ccda128..d7675c0 100644 --- a/kmymoney2/views/kmymoneyfile.h +++ b/kmymoney2/views/kmymoneyfile.h @@ -42,7 +42,7 @@ private: bool m_open; protected: - // KMyMoneyFile(const QString&); + // KMyMoneyFile(const TQString&); public: KMyMoneyFile(); diff --git a/kmymoney2/views/kmymoneytransaction.cpp b/kmymoney2/views/kmymoneytransaction.cpp index ee16a6a..373c55e 100644 --- a/kmymoney2/views/kmymoneytransaction.cpp +++ b/kmymoney2/views/kmymoneytransaction.cpp @@ -45,7 +45,7 @@ KMyMoneyTransaction::~KMyMoneyTransaction() { } -void KMyMoneyTransaction::setSplitId(const QString& id) +void KMyMoneyTransaction::setSplitId(const TQString& id) { m_splitId = id; } diff --git a/kmymoney2/views/kmymoneytransaction.h b/kmymoney2/views/kmymoneytransaction.h index 4deb184..f15f204 100644 --- a/kmymoney2/views/kmymoneytransaction.h +++ b/kmymoney2/views/kmymoneytransaction.h @@ -50,11 +50,11 @@ public: KMyMoneyTransaction(const MyMoneyTransaction& t); ~KMyMoneyTransaction(); - void setSplitId(const QString& id); - const QString& splitId(void) const { return m_splitId; }; + void setSplitId(const TQString& id); + const TQString& splitId(void) const { return m_splitId; }; private: - QString m_splitId; + TQString m_splitId; }; diff --git a/kmymoney2/views/kmymoneyview.cpp b/kmymoney2/views/kmymoneyview.cpp index 8719d79..bf1b5cc 100644 --- a/kmymoney2/views/kmymoneyview.cpp +++ b/kmymoney2/views/kmymoneyview.cpp @@ -25,17 +25,17 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -120,15 +120,15 @@ #define RECOVER_KEY_ID "0xD2B08440" -KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) - : KJanusWidget(parent, name, KJanusWidget::IconList), +KMyMoneyView::KMyMoneyView(TQWidget *tqparent, const char *name) + : KJanusWidget(tqparent, name, KJanusWidget::IconList), // m_bankRightClick(false), m_inConstructor(true), m_fileOpen(false), m_fmode(0600) { // the global variable kmymoney2 is not yet assigned. So we construct it here - QObject* kmymoney2 = parent->parent(); + TQObject* kmymoney2 = tqparent->tqparent(); const int iconSize = (KMyMoneyGlobalSettings::iconSize()+1)*16; newStorage(); @@ -137,100 +137,100 @@ KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) DesktopIcon("home", iconSize)); m_homeView = new KHomeView(m_homeViewFrame, "HomeView"); - connect(m_homeView, SIGNAL(ledgerSelected(const QString&, const QString&)), - this, SLOT(slotLedgerSelected(const QString&, const QString&))); - connect(m_homeView, SIGNAL(scheduleSelected(const QString&)), - this, SLOT(slotScheduleSelected(const QString&))); - connect(m_homeView, SIGNAL(reportSelected(const QString&)), - this, SLOT(slotShowReport(const QString&))); + connect(m_homeView, TQT_SIGNAL(ledgerSelected(const TQString&, const TQString&)), + this, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); + connect(m_homeView, TQT_SIGNAL(scheduleSelected(const TQString&)), + this, TQT_SLOT(slotScheduleSelected(const TQString&))); + connect(m_homeView, TQT_SIGNAL(reportSelected(const TQString&)), + this, TQT_SLOT(slotShowReport(const TQString&))); // Page 1 m_institutionsViewFrame = addVBoxPage( i18n("Institutions"), i18n("Institutions"), DesktopIcon("institutions", iconSize)); addTitleBar(m_institutionsViewFrame, i18n("Institutions")); m_institutionsView = new KInstitutionsView(m_institutionsViewFrame, "InstitutionsView"); - connect(m_institutionsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInstitution(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowInstitutionContextMenu(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotInstitutionEdit(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotAccountOpen(const MyMoneyObject&))); - connect(m_institutionsView, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), kmymoney2, SLOT(slotReparentAccount(const MyMoneyAccount&, const MyMoneyInstitution&))); - connect(this, SIGNAL(reconciliationStarts(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&)), m_institutionsView, SLOT(slotReconcileAccount(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&))); + connect(m_institutionsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInstitution(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowInstitutionContextMenu(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotInstitutionEdit(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotAccountOpen(const MyMoneyObject&))); + connect(m_institutionsView, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&)), kmymoney2, TQT_SLOT(slotRetqparentAccount(const MyMoneyAccount&, const MyMoneyInstitution&))); + connect(this, TQT_SIGNAL(reconciliationStarts(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&)), m_institutionsView, TQT_SLOT(slotReconcileAccount(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&))); // Page 2 m_accountsViewFrame = addVBoxPage( i18n("Accounts"), i18n("Accounts"), DesktopIcon("accounts", iconSize)); addTitleBar(m_accountsViewFrame, i18n("Accounts")); m_accountsView = new KAccountsView(m_accountsViewFrame, "AccountsView"); - connect(m_accountsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInstitution(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInvestment(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotAccountOpen(const MyMoneyObject&))); - connect(m_accountsView, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotReparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); - connect(this, SIGNAL(kmmFilePlugin(unsigned int)), m_accountsView, SLOT(slotUpdateIconPos(unsigned int))); - connect(this, SIGNAL(reconciliationStarts(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&)), m_accountsView, SLOT(slotReconcileAccount(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&))); + connect(m_accountsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInstitution(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInvestment(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotAccountOpen(const MyMoneyObject&))); + connect(m_accountsView, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotRetqparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(this, TQT_SIGNAL(kmmFilePlugin(unsigned int)), m_accountsView, TQT_SLOT(slotUpdateIconPos(unsigned int))); + connect(this, TQT_SIGNAL(reconciliationStarts(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&)), m_accountsView, TQT_SLOT(slotReconcileAccount(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&))); // Page 3 m_scheduleViewFrame = addVBoxPage( i18n("Scheduled\ntransactions"), i18n("Bills & Reminders"), DesktopIcon("schedule", iconSize)); addTitleBar(m_scheduleViewFrame, i18n("Scheduled transactions")); m_scheduledView = new KScheduledView(m_scheduleViewFrame, "ScheduledView"); - connect(kmymoney2, SIGNAL(fileLoaded(const KURL&)), m_scheduledView, SLOT(slotReloadView())); - connect(m_scheduledView, SIGNAL(scheduleSelected(const MyMoneySchedule&)), kmymoney2, SLOT(slotSelectSchedule(const MyMoneySchedule&))); - connect(m_scheduledView, SIGNAL(openContextMenu()), kmymoney2, SLOT(slotShowScheduleContextMenu())); - connect(m_scheduledView, SIGNAL(enterSchedule()), kmymoney2, SLOT(slotScheduleEnter())); - connect(m_scheduledView, SIGNAL(skipSchedule()), kmymoney2, SLOT(slotScheduleSkip())); - connect(m_scheduledView, SIGNAL(editSchedule()), kmymoney2, SLOT(slotScheduleEdit())); + connect(kmymoney2, TQT_SIGNAL(fileLoaded(const KURL&)), m_scheduledView, TQT_SLOT(slotReloadView())); + connect(m_scheduledView, TQT_SIGNAL(scheduleSelected(const MyMoneySchedule&)), kmymoney2, TQT_SLOT(slotSelectSchedule(const MyMoneySchedule&))); + connect(m_scheduledView, TQT_SIGNAL(openContextMenu()), kmymoney2, TQT_SLOT(slotShowScheduleContextMenu())); + connect(m_scheduledView, TQT_SIGNAL(enterSchedule()), kmymoney2, TQT_SLOT(slotScheduleEnter())); + connect(m_scheduledView, TQT_SIGNAL(skipSchedule()), kmymoney2, TQT_SLOT(slotScheduleSkip())); + connect(m_scheduledView, TQT_SIGNAL(editSchedule()), kmymoney2, TQT_SLOT(slotScheduleEdit())); // Page 4 m_categoriesViewFrame = addVBoxPage( i18n("Categories"), i18n("Categories"), DesktopIcon("categories", iconSize)); addTitleBar(m_categoriesViewFrame, i18n("Categories")); m_categoriesView = new KCategoriesView(m_categoriesViewFrame, "CategoriesView"); - connect(m_categoriesView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectInstitution(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, SLOT(slotAccountOpen(const MyMoneyObject&))); - connect(m_categoriesView, SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, SLOT(slotReparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); + connect(m_categoriesView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(selectObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectInstitution(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowAccountContextMenu(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(openObject(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotAccountOpen(const MyMoneyObject&))); + connect(m_categoriesView, TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&)), kmymoney2, TQT_SLOT(slotRetqparentAccount(const MyMoneyAccount&, const MyMoneyAccount&))); // Page 5 m_payeesViewFrame = addVBoxPage( i18n("Payees"), i18n("Payees"), DesktopIcon("payee", iconSize)); addTitleBar(m_payeesViewFrame, i18n("Payees")); m_payeesView = new KPayeesView(m_payeesViewFrame, "PayeesView"); - connect(kmymoney2, SIGNAL(payeeCreated(const QString&)), m_payeesView, SLOT(slotSelectPayeeAndTransaction(const QString&))); - connect(kmymoney2, SIGNAL(payeeRename()), m_payeesView, SLOT(slotStartRename())); - connect(m_payeesView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowPayeeContextMenu())); - connect(m_payeesView, SIGNAL(selectObjects(const QValueList&)), kmymoney2, SLOT(slotSelectPayees(const QValueList&))); - connect(m_payeesView, SIGNAL(transactionSelected(const QString&, const QString&)), - this, SLOT(slotLedgerSelected(const QString&, const QString&))); + connect(kmymoney2, TQT_SIGNAL(payeeCreated(const TQString&)), m_payeesView, TQT_SLOT(slotSelectPayeeAndTransaction(const TQString&))); + connect(kmymoney2, TQT_SIGNAL(payeeRename()), m_payeesView, TQT_SLOT(slotStartRename())); + connect(m_payeesView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowPayeeContextMenu())); + connect(m_payeesView, TQT_SIGNAL(selectObjects(const TQValueList&)), kmymoney2, TQT_SLOT(slotSelectPayees(const TQValueList&))); + connect(m_payeesView, TQT_SIGNAL(transactionSelected(const TQString&, const TQString&)), + this, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); // Page 6 m_ledgerViewFrame = addVBoxPage( i18n("Ledgers"), i18n("Ledgers"), DesktopIcon("ledger", iconSize)); m_ledgerView = new KGlobalLedgerView(m_ledgerViewFrame, "GlobalLedgerView"); - connect(m_ledgerView, SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_ledgerView, SIGNAL(openContextMenu()), kmymoney2, SLOT(slotShowTransactionContextMenu())); - connect(m_ledgerView, SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), kmymoney2, SLOT(slotSelectTransactions(const KMyMoneyRegister::SelectedTransactions&))); - connect(m_ledgerView, SIGNAL(newTransaction()), kmymoney2, SLOT(slotTransactionsNew())); - connect(m_ledgerView, SIGNAL(cancelOrEndEdit(bool&)), kmymoney2, SLOT(slotTransactionsCancelOrEnter(bool&))); - connect(m_ledgerView, SIGNAL(startEdit()), kmymoney2, SLOT(slotTransactionsEdit())); - connect(m_ledgerView, SIGNAL(endEdit()), kmymoney2, SLOT(slotTransactionsEnter())); - connect(m_ledgerView, SIGNAL(toggleReconciliationFlag()), kmymoney2, SLOT(slotToggleReconciliationFlag())); - connect(this, SIGNAL(reconciliationStarts(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&)), m_ledgerView, SLOT(slotSetReconcileAccount(const MyMoneyAccount&, const QDate&, const MyMoneyMoney&))); - connect(kmymoney2, SIGNAL(selectAllTransactions()), m_ledgerView, SLOT(slotSelectAllTransactions())); + connect(m_ledgerView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_ledgerView, TQT_SIGNAL(openContextMenu()), kmymoney2, TQT_SLOT(slotShowTransactionContextMenu())); + connect(m_ledgerView, TQT_SIGNAL(transactionsSelected(const KMyMoneyRegister::SelectedTransactions&)), kmymoney2, TQT_SLOT(slotSelectTransactions(const KMyMoneyRegister::SelectedTransactions&))); + connect(m_ledgerView, TQT_SIGNAL(newTransaction()), kmymoney2, TQT_SLOT(slotTransactionsNew())); + connect(m_ledgerView, TQT_SIGNAL(cancelOrEndEdit(bool&)), kmymoney2, TQT_SLOT(slotTransactionsCancelOrEnter(bool&))); + connect(m_ledgerView, TQT_SIGNAL(startEdit()), kmymoney2, TQT_SLOT(slotTransactionsEdit())); + connect(m_ledgerView, TQT_SIGNAL(endEdit()), kmymoney2, TQT_SLOT(slotTransactionsEnter())); + connect(m_ledgerView, TQT_SIGNAL(toggleReconciliationFlag()), kmymoney2, TQT_SLOT(slotToggleReconciliationFlag())); + connect(this, TQT_SIGNAL(reconciliationStarts(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&)), m_ledgerView, TQT_SLOT(slotSetReconcileAccount(const MyMoneyAccount&, const TQDate&, const MyMoneyMoney&))); + connect(kmymoney2, TQT_SIGNAL(selectAllTransactions()), m_ledgerView, TQT_SLOT(slotSelectAllTransactions())); // Page 7 m_investmentViewFrame = addVBoxPage( i18n("Investments"), i18n("Investments"), DesktopIcon("investments", iconSize)); addTitleBar(m_investmentViewFrame, i18n("Investments")); m_investmentView = new KInvestmentView(m_investmentViewFrame, "InvestmentView"); - connect(m_investmentView, SIGNAL(accountSelected(const QString&, const QString&)), - this, SLOT(slotLedgerSelected(const QString&, const QString&))); - connect(m_investmentView, SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_investmentView, SIGNAL(investmentRightMouseClick()), kmymoney2, SLOT(slotShowInvestmentContextMenu())); + connect(m_investmentView, TQT_SIGNAL(accountSelected(const TQString&, const TQString&)), + this, TQT_SLOT(slotLedgerSelected(const TQString&, const TQString&))); + connect(m_investmentView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_investmentView, TQT_SIGNAL(investmentRightMouseClick()), kmymoney2, TQT_SLOT(slotShowInvestmentContextMenu())); // Page 8 m_reportsViewFrame = addVBoxPage(i18n("Reports"), i18n("Reports"), @@ -242,10 +242,10 @@ KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) DesktopIcon("budget", iconSize)); addTitleBar(m_budgetViewFrame, i18n("Budgets")); m_budgetView = new KBudgetView(m_budgetViewFrame, "BudgetView"); - connect(kmymoney2, SIGNAL(fileLoaded(const KURL&)), m_budgetView, SLOT(slotRefreshView())); - connect(m_budgetView, SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, SLOT(slotShowBudgetContextMenu())); - connect(m_budgetView, SIGNAL(selectObjects(const QValueList&)), kmymoney2, SLOT(slotSelectBudget(const QValueList&))); - connect(kmymoney2, SIGNAL(budgetRename()), m_budgetView, SLOT(slotStartRename())); + connect(kmymoney2, TQT_SIGNAL(fileLoaded(const KURL&)), m_budgetView, TQT_SLOT(slotRefreshView())); + connect(m_budgetView, TQT_SIGNAL(openContextMenu(const MyMoneyObject&)), kmymoney2, TQT_SLOT(slotShowBudgetContextMenu())); + connect(m_budgetView, TQT_SIGNAL(selectObjects(const TQValueList&)), kmymoney2, TQT_SLOT(slotSelectBudget(const TQValueList&))); + connect(kmymoney2, TQT_SIGNAL(budgetRename()), m_budgetView, TQT_SLOT(slotStartRename())); // Page 10 m_forecastViewFrame = addVBoxPage( i18n("Forecast"), i18n("Forecast"), @@ -254,19 +254,19 @@ KMyMoneyView::KMyMoneyView(QWidget *parent, const char *name) m_forecastView = new KForecastView(m_forecastViewFrame, "ForecastView"); // get rid of the title text - QWidget* widget = dynamic_cast(child("KJanusWidgetTitleLabel", "QLabel")); + TQWidget* widget = dynamic_cast(child("KJanusWidgetTitleLabel", TQLABEL_OBJECT_NAME_STRING)); if(widget) widget->hide(); // and the separator below it - widget = dynamic_cast(child(0, "KSeparator")); + widget = dynamic_cast(child(0, "KSeparator")); if(widget) widget->hide(); // select the page first, before connecting the aboutToShow signal // because we don't want to override the information stored in the config file showPage(0); - connect(this, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT(slotRememberPage(QWidget*))); + connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget*)), this, TQT_SLOT(slotRememberPage(TQWidget*))); m_inConstructor = false; } @@ -276,24 +276,24 @@ KMyMoneyView::~KMyMoneyView() removeStorage(); } -void KMyMoneyView::addTitleBar(QWidget* parent, const QString& title) +void KMyMoneyView::addTitleBar(TQWidget* tqparent, const TQString& title) { - KMyMoneyTitleLabel* label = new KMyMoneyTitleLabel( parent, "titleLabel" ); - label->setMinimumSize( QSize( 100, 30 ) ); + KMyMoneyTitleLabel* label = new KMyMoneyTitleLabel( tqparent, "titleLabel" ); + label->setMinimumSize( TQSize( 100, 30 ) ); label->setRightImageFile("pics/titlelabel_background.png" ); label->setText(title); } void KMyMoneyView::showTitleBar(bool show) { - QObjectList *l = queryList( 0, "titleLabel" ); - QObjectListIterator it( *l ); // iterate over the labels - QObject *obj; + TQObjectList *l = queryList( 0, "titleLabel" ); + TQObjectListIterator it( *l ); // iterate over the labels + TQObject *obj; while ( (obj = it.current()) != 0 ) { // for each found object... ++it; - ((QWidget*)obj)->setShown( show ); + ((TQWidget*)obj)->setShown( show ); } delete l; // delete the list, not the objects } @@ -337,7 +337,7 @@ bool KMyMoneyView::canPrint(void) return rc; } -bool KMyMoneyView::canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& /* list */, QString& tooltip) const +bool KMyMoneyView::canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& /* list */, TQString& tooltip) const { // we can only create transactions in the ledger view so // we check that this is the active page @@ -350,7 +350,7 @@ bool KMyMoneyView::canCreateTransactions(const KMyMoneyRegister::SelectedTransac return rc; } -bool KMyMoneyView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KMyMoneyView::canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { // we can only modify transactions in the ledger view so // we check that this is the active page @@ -365,7 +365,7 @@ bool KMyMoneyView::canModifyTransactions(const KMyMoneyRegister::SelectedTransac return rc; } -bool KMyMoneyView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KMyMoneyView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { // we can only duplicate transactions in the ledger view so // we check that this is the active page @@ -380,7 +380,7 @@ bool KMyMoneyView::canDuplicateTransactions(const KMyMoneyRegister::SelectedTran return rc; } -bool KMyMoneyView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const +bool KMyMoneyView::canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const { bool rc; // we can only edit transactions in the ledger view so @@ -397,7 +397,7 @@ bool KMyMoneyView::createNewTransaction(void) { bool rc = false; KMyMoneyRegister::SelectedTransactions list; - QString txt; + TQString txt; if(canCreateTransactions(list, txt)) { rc = m_ledgerView->selectEmptyTransaction(); } @@ -407,7 +407,7 @@ bool KMyMoneyView::createNewTransaction(void) TransactionEditor* KMyMoneyView::startEdit(const KMyMoneyRegister::SelectedTransactions& list) { TransactionEditor* editor = 0; - QString txt; + TQString txt; if(canEditTransactions(list, txt) || canCreateTransactions(list, txt)) { editor = m_ledgerView->startEdit(list); } @@ -451,16 +451,16 @@ void KMyMoneyView::enableViews(int state) emit viewStateChanged(state != 0); } -void KMyMoneyView::slotLedgerSelected(const QString& _accId, const QString& transaction) +void KMyMoneyView::slotLedgerSelected(const TQString& _accId, const TQString& transaction) { MyMoneyAccount acc = MyMoneyFile::instance()->account(_accId); - QString accId(_accId); + TQString accId(_accId); switch(acc.accountType()) { case MyMoneyAccount::Stock: // if a stock account is selected, we show the - // the corresponding parent (investment) account - acc = MyMoneyFile::instance()->account(acc.parentAccountId()); + // the corresponding tqparent (investment) account + acc = MyMoneyFile::instance()->account(acc.tqparentAccountId()); accId = acc.id(); // tricky fall through here @@ -492,19 +492,19 @@ void KMyMoneyView::slotLedgerSelected(const QString& _accId, const QString& tran } } -void KMyMoneyView::slotPayeeSelected(const QString& payee, const QString& account, const QString& transaction) +void KMyMoneyView::slotPayeeSelected(const TQString& payee, const TQString& account, const TQString& transaction) { showPage(pageIndex(m_payeesViewFrame)); m_payeesView->slotSelectPayeeAndTransaction(payee, account, transaction); } -void KMyMoneyView::slotScheduleSelected(const QString& scheduleId) +void KMyMoneyView::slotScheduleSelected(const TQString& scheduleId) { MyMoneySchedule sched = MyMoneyFile::instance()->schedule(scheduleId); kmymoney2->slotSelectSchedule(sched); } -void KMyMoneyView::slotShowReport(const QString& reportid) +void KMyMoneyView::slotShowReport(const TQString& reportid) { showPage(pageIndex(m_reportsViewFrame)); m_reportsView->slotOpenReport(reportid); @@ -536,7 +536,7 @@ void KMyMoneyView::closeFile(void) m_fileOpen = false; } -void KMyMoneyView::ungetString(QIODevice *qfile, char *buf, int len) +void KMyMoneyView::ungetString(TQIODevice *qfile, char *buf, int len) { buf = &buf[len-1]; while(len--) { @@ -546,7 +546,7 @@ void KMyMoneyView::ungetString(QIODevice *qfile, char *buf, int len) bool KMyMoneyView::readFile(const KURL& url) { - QString filename; + TQString filename; // newStorage(); m_fileOpen = false; @@ -583,7 +583,7 @@ bool KMyMoneyView::readFile(const KURL& url) } else { if(!KIO::NetAccess::download(url, filename, NULL)) { KMessageBox::detailedError(this, - i18n("Error while loading file '%1'!").arg(url.url()), + i18n("Error while loading file '%1'!").tqarg(url.url()), KIO::NetAccess::lastErrorString(), i18n("File access error")); return false; @@ -592,26 +592,26 @@ bool KMyMoneyView::readFile(const KURL& url) // let's glimps into the file to figure out, if it's one // of the old (uncompressed) or new (compressed) files. - QFile file(filename); - QFileInfo info(file); + TQFile file(filename); + TQFileInfo info(file); if(!info.isFile()) { - QString msg=i18n("%1 is not a KMyMoney file.").arg(filename); - KMessageBox::error(this, QString("

")+msg, i18n("Filetype Error")); + TQString msg=i18n("%1 is not a KMyMoney file.").tqarg(filename); + KMessageBox::error(this, TQString("

")+msg, i18n("Filetype Error")); return false; } m_fmode = 0600; - m_fmode |= info.permission(QFileInfo::ReadGroup) ? 040 : 0; - m_fmode |= info.permission(QFileInfo::WriteGroup) ? 020 : 0; - m_fmode |= info.permission(QFileInfo::ReadOther) ? 004 : 0; - m_fmode |= info.permission(QFileInfo::WriteOther) ? 002 : 0; + m_fmode |= info.permission(TQFileInfo::ReadGroup) ? 040 : 0; + m_fmode |= info.permission(TQFileInfo::WriteGroup) ? 020 : 0; + m_fmode |= info.permission(TQFileInfo::ReadOther) ? 004 : 0; + m_fmode |= info.permission(TQFileInfo::WriteOther) ? 002 : 0; - QIODevice *qfile = 0; + TQIODevice *qfile = 0; bool rc = true; // There's a problem with the KFilterDev and KGPGFile classes: // One supports the at(n) member but not ungetch() together with // readBlock() and the other does not provide an at(n) method but - // supports readBlock() that considers the ungetch() buffer. QFile + // supports readBlock() that considers the ungetch() buffer. TQFile // supports everything so this is not a problem. We solve the problem // for now by keeping track of which method can be used. bool haveAt = true; @@ -619,29 +619,29 @@ bool KMyMoneyView::readFile(const KURL& url) emit kmmFilePlugin (preOpen); ::timetrace("start reading file"); if(file.open(IO_ReadOnly)) { - QByteArray hdr(2); + TQByteArray hdr(2); int cnt; cnt = file.readBlock(hdr.data(), 2); file.close(); if(cnt == 2) { - if(QString(hdr) == QString("\037\213")) { // gzipped? + if(TQString(hdr) == TQString("\037\213")) { // gzipped? ::timetrace("detected GZIP"); qfile = KFilterDev::deviceForFile(filename, COMPRESSION_MIME_TYPE); - } else if(QString(hdr) == QString("--")){ // PGP ASCII armored? + } else if(TQString(hdr) == TQString("--")){ // PGP ASCII armored? ::timetrace("detected GPG"); if(KGPGFile::GPGAvailable()) { ::timetrace("have GPG"); - qfile = new KGPGFile(filename); + qfile = TQT_TQIODEVICE(new KGPGFile(filename)); haveAt = false; isEncrypted = true; } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("GPG is not available for decryption of file %1").arg(filename))); - qfile = new QFile(file.name()); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("GPG is not available for decryption of file %1").tqarg(filename))); + qfile = TQT_TQIODEVICE(new TQFile(file.name())); } } else { // we can't use file directly, as we delete qfile later on - qfile = new QFile(file.name()); + qfile = TQT_TQIODEVICE(new TQFile(file.name())); } ::timetrace("open file"); @@ -656,9 +656,9 @@ bool KMyMoneyView::readFile(const KURL& url) // Ok, we got the first block of 8 bytes. Read in the two // unsigned long int's by preserving endianess. This is - // achieved by reading them through a QDataStream object - Q_INT32 magic0, magic1; - QDataStream s(hdr, IO_ReadOnly); + // achieved by reading them through a TQDataStream object + TQ_INT32 magic0, magic1; + TQDataStream s(hdr, IO_ReadOnly); s >> magic0; s >> magic1; @@ -689,9 +689,9 @@ bool KMyMoneyView::readFile(const KURL& url) qfile->at(0); else ungetString(qfile, hdr.data(), 70); - QRegExp kmyexp(""); - QRegExp gncexp(""); + TQRegExp gncexp("%1"). arg(i18n("File %1 contains the old binary format used by KMyMoney. Please use an older version of KMyMoney (0.8.x) that still supports this format to convert it to the new XML based format.").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 contains the old binary format used by KMyMoney. Please use an older version of KMyMoney (0.8.x) that still supports this format to convert it to the new XML based format.").tqarg(filename))); } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("File %1 contains an unknown file format!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 contains an unknown file format!").tqarg(filename))); } rc = false; } } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("Cannot read from file %1!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("Cannot read from file %1!").tqarg(filename))); rc = false; } } catch (MyMoneyException *e) { - KMessageBox::sorry(this, QString("%1"). arg(i18n("Cannot load file %1. Reason: %2").arg(filename, e->what()))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("Cannot load file %1. Reason: %2").tqarg(filename, e->what()))); delete e; rc = false; } @@ -735,13 +735,13 @@ bool KMyMoneyView::readFile(const KURL& url) } qfile->close(); } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("File %1 not found!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 not found!").tqarg(filename))); rc = false; } delete qfile; } } else { - KMessageBox::sorry(this, QString("%1"). arg(i18n("File %1 not found!").arg(filename))); + KMessageBox::sorry(this, TQString("%1"). arg(i18n("File %1 not found!").tqarg(filename))); rc = false; } @@ -775,7 +775,7 @@ bool KMyMoneyView::readFile(const KURL& url) return initializeStorage(); } -void KMyMoneyView::checkAccountName(const MyMoneyAccount& _acc, const QString& name) const +void KMyMoneyView::checkAccountName(const MyMoneyAccount& _acc, const TQString& name) const { MyMoneyFile* file = MyMoneyFile::instance(); if(_acc.name() != name) { @@ -805,7 +805,7 @@ bool KMyMoneyView::openDatabase (const KURL& url) { retry = false; break; case 1: // permanent error - KMessageBox::detailedError (this, i18n("Can't open database %1\n").arg(dbURL.prettyURL()), reader->lastError()); + KMessageBox::detailedError (this, i18n("Can't open database %1\n").tqarg(dbURL.prettyURL()), reader->lastError()); if (pDBMgr) { removeStorage(); delete pDBMgr; @@ -819,7 +819,7 @@ bool KMyMoneyView::openDatabase (const KURL& url) { } return false; } else { - QString options = dbURL.queryItem("options") + ",override"; + TQString options = dbURL.queryItem("options") + ",override"; dbURL.removeQueryItem("mode"); // now redundant dbURL.removeQueryItem("options"); dbURL.addQueryItem("options", options); @@ -911,7 +911,7 @@ bool KMyMoneyView::initializeStorage() // Check if we have to modify the file before we allow to work with it IMyMoneyStorage* s = MyMoneyFile::instance()->storage(); while (s->fileFixVersion() < s->currentFixVersion()) { - qDebug("%s", (QString("testing fileFixVersion %1 < %2").arg(s->fileFixVersion()).arg(s->currentFixVersion())).data()); + qDebug("%s", (TQString("testing fileFixVersion %1 < %2").tqarg(s->fileFixVersion()).tqarg(s->currentFixVersion())).data()); switch (s->fileFixVersion()) { case 0: fixFile_0(); @@ -967,11 +967,11 @@ bool KMyMoneyView::initializeStorage() return true; } -void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, bool plaintext, const QString& keyList) +void KMyMoneyView::saveToLocalFile(TQFile* qfile, IMyMoneyStorageFormat* pWriter, bool plaintext, const TQString& keyList) { - QIODevice *dev = qfile; + TQIODevice *dev = TQT_TQIODEVICE(qfile); KFilterBase *base = 0; - QIODevice *statusDevice = dev; + TQIODevice *statusDevice = dev; bool encryptedOk = true; bool encryptRecover = false; @@ -983,23 +983,23 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, if(KMyMoneyGlobalSettings::encryptRecover()) { encryptRecover = true; - if(!KGPGFile::keyAvailable(QString(RECOVER_KEY_ID))) { - KMessageBox::sorry(this, QString("

")+i18n("You have selected to encrypt your data also with the KMyMoney recover key, but the key with id

%1

has not been found in your keyring at this time. Please make sure to import this key into your keyring. You can find it on the KMyMoney web-site. This time your data will not be encrypted with the KMyMoney recover key.").arg(RECOVER_KEY_ID), i18n("GPG-Key not found")); + if(!KGPGFile::keyAvailable(TQString(RECOVER_KEY_ID))) { + KMessageBox::sorry(this, TQString("

")+i18n("You have selected to encrypt your data also with the KMyMoney recover key, but the key with id

%1

has not been found in your keyring at this time. Please make sure to import this key into your keyring. You can find it on the KMyMoney web-site. This time your data will not be encrypted with the KMyMoney recover key.").tqarg(RECOVER_KEY_ID), i18n("GPG-Key not found")); encryptRecover = false; } } - QStringList keys = QStringList::split(",", keyList); - QStringList::const_iterator it_s; + TQStringList keys = TQStringList::split(",", keyList); + TQStringList::const_iterator it_s; for(it_s = keys.begin(); it_s != keys.begin(); ++it_s) { if(!KGPGFile::keyAvailable(*it_s)) { - KMessageBox::sorry(this, QString("

")+i18n("You have specified to encrypt your data for the user-id

%1.

Unfortunately, a valid key for this user-id was not found in your keyring. Please make sure to import a valid key for this user-id. This time, encryption is disabled.").arg(*it_s), i18n("GPG-Key not found")); + KMessageBox::sorry(this, TQString("

")+i18n("You have specified to encrypt your data for the user-id

%1.

Unfortunately, a valid key for this user-id was not found in your keyring. Please make sure to import a valid key for this user-id. This time, encryption is disabled.").tqarg(*it_s), i18n("GPG-Key not found")); encryptedOk = false; } } if(encryptedOk == true) { - QString msg = QString("

") + i18n("You have configured to save your data in encrypted form using GPG. Please be aware, that this is a brand new feature which is yet untested. Make sure, you have the necessary understanding that you might loose all your data if you store it encrypted and cannot decrypt it later on! If unsure, answer No."); + TQString msg = TQString("

") + i18n("You have configured to save your data in encrypted form using GPG. Please be aware, that this is a brand new feature which is yet untested. Make sure, you have the necessary understanding that you might loose all your data if you store it encrypted and cannot decrypt it later on! If unsure, answer No."); if(KMessageBox::questionYesNo(this, msg, i18n("Store GPG encrypted"), KStdGuiItem::yes(), KStdGuiItem::no(), "StoreEncrypted") == KMessageBox::No) { encryptedOk = false; @@ -1007,7 +1007,7 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, } } - int mask = umask((~m_fmode) & 0777); + int tqmask = umask((~m_fmode) & 0777); bool blocked = MyMoneyFile::instance()->signalsBlocked(); MyMoneyFile::instance()->blockSignals(true); MyMoneyFileTransaction ft; @@ -1017,8 +1017,8 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, base++; KGPGFile *kgpg = new KGPGFile(qfile->name()); if(kgpg) { - QStringList keys = QStringList::split(",", keyList); - QStringList::const_iterator it_s; + TQStringList keys = TQStringList::split(",", keyList); + TQStringList::const_iterator it_s; for(it_s = keys.begin(); it_s != keys.end(); ++it_s) { kgpg->addRecipient((*it_s).latin1()); } @@ -1027,11 +1027,11 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, } MyMoneyFile::instance()->setValue("kmm-encryption-key", keyList); } - statusDevice = dev = kgpg; + statusDevice = dev = TQT_TQIODEVICE(kgpg); if(!dev || !dev->open(IO_WriteOnly)) { MyMoneyFile::instance()->blockSignals(blocked); delete dev; - throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").tqarg(qfile->name())); } } else if(!plaintext) { @@ -1039,26 +1039,26 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, base = KFilterBase::findFilterByMimeType( COMPRESSION_MIME_TYPE ); if(base) { qfile->close(); - base->setDevice(qfile, false); + base->setDevice(TQT_TQIODEVICE(qfile), false); // we need to reopen the file to set the mode inside the filter stuff dev = new KFilterDev(base, true); if(!dev || !dev->open(IO_WriteOnly)) { MyMoneyFile::instance()->blockSignals(blocked); delete dev; - throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Unable to open file '%1' for writing.").tqarg(qfile->name())); } statusDevice = base->device(); } } - umask(mask); + umask(tqmask); ft.commit(); pWriter->setProgressCallback(&KMyMoneyView::progressCallback); - dev->resetStatus(); + dev->resetqStatus(); pWriter->writeFile(dev, dynamic_cast (MyMoneyFile::instance()->storage())); MyMoneyFile::instance()->blockSignals(blocked); if(statusDevice->status() != IO_Ok) { - throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").tqarg(qfile->name())); } pWriter->setProgressCallback(0); @@ -1067,16 +1067,16 @@ void KMyMoneyView::saveToLocalFile(QFile* qfile, IMyMoneyStorageFormat* pWriter, dev->close(); if(statusDevice->status() != IO_Ok) { delete dev; - throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").arg(qfile->name())); + throw new MYMONEYEXCEPTION(i18n("Failure while writing to '%1'").tqarg(qfile->name())); } delete dev; } else qfile->close(); } -bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) +bool KMyMoneyView::saveFile(const KURL& url, const TQString& keyList) { - QString filename = url.path(); + TQString filename = url.path(); if (!fileOpen()) { KMessageBox::error(this, i18n("Tried to access a file when it's not open")); @@ -1090,7 +1090,7 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) "If you still want to use older versions of KMyMoney with your data files, " "please make sure you keep a backup-file of your finance data. " "If you want to abort this operation, please press Cancel now"), - QString::null, KStdGuiItem::cont(), "WarningNewFileVersion0.5") == KMessageBox::Cancel) + TQString(), KStdGuiItem::cont(), "WarningNewFileVersion0.5") == KMessageBox::Cancel) return false; #endif @@ -1115,19 +1115,19 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) bool rc = true; try { if(! url.isValid()) { - throw new MYMONEYEXCEPTION(i18n("Malformed URL '%1'").arg(url.url())); + throw new MYMONEYEXCEPTION(i18n("Malformed URL '%1'").tqarg(url.url())); } if(url.isLocalFile()) { filename = url.path(); int fmode = 0600; gid_t gid = static_cast(-1); // don't change the group id (see "man 2 chown") - QFileInfo fi(filename); + TQFileInfo fi(filename); if(fi.exists()) { - fmode |= fi.permission(QFileInfo::ReadGroup) ? 040 : 0; - fmode |= fi.permission(QFileInfo::WriteGroup) ? 020 : 0; - fmode |= fi.permission(QFileInfo::ReadOther) ? 004 : 0; - fmode |= fi.permission(QFileInfo::WriteOther) ? 002 : 0; + fmode |= fi.permission(TQFileInfo::ReadGroup) ? 040 : 0; + fmode |= fi.permission(TQFileInfo::WriteGroup) ? 020 : 0; + fmode |= fi.permission(TQFileInfo::ReadOther) ? 004 : 0; + fmode |= fi.permission(TQFileInfo::WriteOther) ? 002 : 0; if(fi.groupId() != static_cast(-2)) gid = fi.groupId(); } @@ -1135,19 +1135,19 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) // create a new basic block here, so that the object qfile gets // deleted, before we reach the chown() call { - int mask = umask((~fmode) & 0777); + int tqmask = umask((~fmode) & 0777); KSaveFile qfile(filename, fmode); - umask(mask); + umask(tqmask); if(qfile.status() == 0) { try { saveToLocalFile(qfile.file(), pWriter, plaintext, keyList); } catch (MyMoneyException* e) { qfile.abort(); delete e; - throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); + throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename)); } } else { - throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); + throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").tqarg(filename)); } } chown(filename, static_cast(-1), gid); @@ -1155,7 +1155,7 @@ bool KMyMoneyView::saveFile(const KURL& url, const QString& keyList) KTempFile tmpfile; saveToLocalFile(tmpfile.file(), pWriter, plaintext, keyList); if(!KIO::NetAccess::upload(tmpfile.name(), url, NULL)) - throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").arg(url.url())); + throw new MYMONEYEXCEPTION(i18n("Unable to upload to '%1'").tqarg(url.url())); tmpfile.unlink(); } m_fileType = KmmXML; @@ -1210,7 +1210,7 @@ bool KMyMoneyView::saveAsDatabase(const KURL& url) KMessageBox::detailedError (this, i18n("Can't open or create database %1\n" "Retry SaveAsDatabase and click Help" - " for further info").arg(url.prettyURL()), writer->lastError()); + " for further info").tqarg(url.prettyURL()), writer->lastError()); } delete writer; return (rc); @@ -1224,7 +1224,7 @@ bool KMyMoneyView::dirty(void) return MyMoneyFile::instance()->dirty(); } -bool KMyMoneyView::startReconciliation(const MyMoneyAccount& account, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance) +bool KMyMoneyView::startReconciliation(const MyMoneyAccount& account, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance) { bool ok = true; @@ -1249,7 +1249,7 @@ bool KMyMoneyView::startReconciliation(const MyMoneyAccount& account, const QDat void KMyMoneyView::finishReconciliation(const MyMoneyAccount& /* account */) { - emit reconciliationStarts(MyMoneyAccount(), QDate(), MyMoneyMoney()); + emit reconciliationStarts(MyMoneyAccount(), TQDate(), MyMoneyMoney()); } void KMyMoneyView::newFile(void) @@ -1268,7 +1268,7 @@ void KMyMoneyView::slotSetBaseCurrency(const MyMoneySecurity& baseCurrency) MyMoneyFile::instance()->setBaseCurrency(baseCurrency); ft.commit(); } catch(MyMoneyException *e) { - KMessageBox::sorry(this, i18n("Cannot set %1 as base currency: %2").arg(baseCurrency.name()).arg(e->what()), i18n("Set base currency")); + KMessageBox::sorry(this, i18n("Cannot set %1 as base currency: %2").tqarg(baseCurrency.name()).tqarg(e->what()), i18n("Set base currency")); delete e; } } @@ -1282,15 +1282,15 @@ void KMyMoneyView::selectBaseCurrency(void) // check if we have a base currency. If not, we need to select one if(file->baseCurrency().id().isEmpty()) { KCurrencyEditDlg dlg(this, "CurrencyEditDlg"); - connect(&dlg, SIGNAL(selectBaseCurrency(const MyMoneySecurity&)), this, SLOT(slotSetBaseCurrency(const MyMoneySecurity&))); + connect(&dlg, TQT_SIGNAL(selectBaseCurrency(const MyMoneySecurity&)), this, TQT_SLOT(slotSetBaseCurrency(const MyMoneySecurity&))); dlg.exec(); } if(!file->baseCurrency().id().isEmpty()) { // check that all accounts have a currency - QValueList list; + TQValueList list; file->accountList(list); - QValueList::Iterator it; + TQValueList::Iterator it; // don't forget those standard accounts list << file->asset(); @@ -1370,7 +1370,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("BAM", i18n("Bosnian Convertible Mark")), create); loadDefaultCurrency(MyMoneySecurity("BWP", i18n("Botswana Pula")), create); loadDefaultCurrency(MyMoneySecurity("BRL", i18n("Brazilian Real"), "R$"), create); - loadDefaultCurrency(MyMoneySecurity("GBP", i18n("British Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("GBP", i18n("British Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("BND", i18n("Brunei Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("BGL", i18n("Bulgarian Lev")), create); loadDefaultCurrency(MyMoneySecurity("BIF", i18n("Burundi Franc")), create); @@ -1385,7 +1385,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("CNY", i18n("Chinese Yuan Renminbi")), create); loadDefaultCurrency(MyMoneySecurity("COP", i18n("Colombian Peso")), create); loadDefaultCurrency(MyMoneySecurity("KMF", i18n("Comoros Franc")), create); - loadDefaultCurrency(MyMoneySecurity("CRC", i18n("Costa Rican Colon"), QChar(0x20A1)), create); + loadDefaultCurrency(MyMoneySecurity("CRC", i18n("Costa Rican Colon"), TQChar(0x20A1)), create); loadDefaultCurrency(MyMoneySecurity("HRK", i18n("Croatian Kuna")), create); loadDefaultCurrency(MyMoneySecurity("CUP", i18n("Cuban Peso")), create); loadDefaultCurrency(MyMoneySecurity("CZK", i18n("Czech Koruna")), create); @@ -1393,18 +1393,18 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("DJF", i18n("Djibouti Franc")), create); loadDefaultCurrency(MyMoneySecurity("DOP", i18n("Dominican Peso")), create); loadDefaultCurrency(MyMoneySecurity("XCD", i18n("East Caribbean Dollar"), "$"), create); - loadDefaultCurrency(MyMoneySecurity("EGP", i18n("Egyptian Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("EGP", i18n("Egyptian Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("SVC", i18n("El Salvador Colon")), create); loadDefaultCurrency(MyMoneySecurity("ERN", i18n("Eritrean Nakfa")), create); loadDefaultCurrency(MyMoneySecurity("EEK", i18n("Estonian Kroon")), create); loadDefaultCurrency(MyMoneySecurity("ETB", i18n("Ethiopian Birr")), create); - loadDefaultCurrency(MyMoneySecurity("EUR", i18n("Euro"), QChar(0x20ac)), true); - loadDefaultCurrency(MyMoneySecurity("FKP", i18n("Falkland Islands Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("EUR", i18n("Euro"), TQChar(0x20ac)), true); + loadDefaultCurrency(MyMoneySecurity("FKP", i18n("Falkland Islands Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("FJD", i18n("Fiji Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("GMD", i18n("Gambian Dalasi")), create); loadDefaultCurrency(MyMoneySecurity("GEL", i18n("Georgian Lari")), create); loadDefaultCurrency(MyMoneySecurity("GHC", i18n("Ghanaian Cedi")), create); - loadDefaultCurrency(MyMoneySecurity("GIP", i18n("Gibraltar Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("GIP", i18n("Gibraltar Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("GTQ", i18n("Guatemalan Quetzal")), create); loadDefaultCurrency(MyMoneySecurity("GWP", i18n("Guinea-Bissau Peso")), create); loadDefaultCurrency(MyMoneySecurity("GYD", i18n("Guyanan Dollar"), "$"), create); @@ -1413,21 +1413,21 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("HKD", i18n("Hong Kong Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("HUF", i18n("Hungarian Forint"), "HUF", 1, 1, 100), create); loadDefaultCurrency(MyMoneySecurity("ISK", i18n("Iceland Krona")), create); - loadDefaultCurrency(MyMoneySecurity("INR", i18n("Indian Rupee"), QChar(0x20A8)), create); + loadDefaultCurrency(MyMoneySecurity("INR", i18n("Indian Rupee"), TQChar(0x20A8)), create); loadDefaultCurrency(MyMoneySecurity("IDR", i18n("Indonesian Rupiah"), "IDR", 100, 1), create); loadDefaultCurrency(MyMoneySecurity("IRR", i18n("Iranian Rial"), "IRR", 1, 1), create); loadDefaultCurrency(MyMoneySecurity("IQD", i18n("Iraqi Dinar"), "IQD", 1000, 1000), create); - loadDefaultCurrency(MyMoneySecurity("ILS", i18n("Israeli New Shekel"), QChar(0x20AA)), create); + loadDefaultCurrency(MyMoneySecurity("ILS", i18n("Israeli New Shekel"), TQChar(0x20AA)), create); loadDefaultCurrency(MyMoneySecurity("JMD", i18n("Jamaican Dollar"), "$"), create); - loadDefaultCurrency(MyMoneySecurity("JPY", i18n("Japanese Yen"), QChar(0x00A5), 100, 1), create); + loadDefaultCurrency(MyMoneySecurity("JPY", i18n("Japanese Yen"), TQChar(0x00A5), 100, 1), create); loadDefaultCurrency(MyMoneySecurity("JOD", i18n("Jordanian Dinar"), "JOD", 1000, 1000), create); loadDefaultCurrency(MyMoneySecurity("KZT", i18n("Kazakhstan Tenge")), create); loadDefaultCurrency(MyMoneySecurity("KES", i18n("Kenyan Shilling")), create); loadDefaultCurrency(MyMoneySecurity("KWD", i18n("Kuwaiti Dinar"), "KWD", 1000, 1000), create); loadDefaultCurrency(MyMoneySecurity("KGS", i18n("Kyrgyzstan Som")), create); - loadDefaultCurrency(MyMoneySecurity("LAK", i18n("Laos Kip"), QChar(0x20AD)), create); + loadDefaultCurrency(MyMoneySecurity("LAK", i18n("Laos Kip"), TQChar(0x20AD)), create); loadDefaultCurrency(MyMoneySecurity("LVL", i18n("Latvian Lats")), create); - loadDefaultCurrency(MyMoneySecurity("LBP", i18n("Lebanese Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("LBP", i18n("Lebanese Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("LSL", i18n("Lesotho Loti")), create); loadDefaultCurrency(MyMoneySecurity("LRD", i18n("Liberian Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("LYD", i18n("Libyan Dinar"), "LYD", 1000, 1000), create); @@ -1443,7 +1443,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("MUR", i18n("Mauritius Rupee")), create); loadDefaultCurrency(MyMoneySecurity("MXN", i18n("Mexican Peso"), "$"), create); loadDefaultCurrency(MyMoneySecurity("MDL", i18n("Moldavian Leu")), create); - loadDefaultCurrency(MyMoneySecurity("MNT", i18n("Mongolian Tugrik"), QChar(0x20AE)), create); + loadDefaultCurrency(MyMoneySecurity("MNT", i18n("Mongolian Tugrik"), TQChar(0x20AE)), create); loadDefaultCurrency(MyMoneySecurity("MAD", i18n("Moroccan Dirham")), create); loadDefaultCurrency(MyMoneySecurity("MZM", i18n("Mozambique Metical")), create); loadDefaultCurrency(MyMoneySecurity("MMK", i18n("Myanmar Kyat")), create); @@ -1451,8 +1451,8 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("NPR", i18n("Nepalese Rupee")), create); loadDefaultCurrency(MyMoneySecurity("NZD", i18n("New Zealand Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("NIC", i18n("Nicaraguan Cordoba Oro")), create); - loadDefaultCurrency(MyMoneySecurity("NGN", i18n("Nigerian Naira"), QChar(0x20A6)), create); - loadDefaultCurrency(MyMoneySecurity("KPW", i18n("North Korean Won"), QChar(0x20A9)), create); + loadDefaultCurrency(MyMoneySecurity("NGN", i18n("Nigerian Naira"), TQChar(0x20A6)), create); + loadDefaultCurrency(MyMoneySecurity("KPW", i18n("North Korean Won"), TQChar(0x20A9)), create); loadDefaultCurrency(MyMoneySecurity("NOK", i18n("Norwegian Kroner"), "kr"), create); loadDefaultCurrency(MyMoneySecurity("OMR", i18n("Omani Rial"), "OMR", 1000, 1000), create); loadDefaultCurrency(MyMoneySecurity("PKR", i18n("Pakistan Rupee")), create); @@ -1460,9 +1460,9 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("PGK", i18n("Papua New Guinea Kina")), create); loadDefaultCurrency(MyMoneySecurity("PYG", i18n("Paraguay Guarani")), create); loadDefaultCurrency(MyMoneySecurity("PEN", i18n("Peruvian Nuevo Sol")), create); - loadDefaultCurrency(MyMoneySecurity("PHP", i18n("Philippine Peso"), QChar(0x20B1)), create); + loadDefaultCurrency(MyMoneySecurity("PHP", i18n("Philippine Peso"), TQChar(0x20B1)), create); loadDefaultCurrency(MyMoneySecurity("PLN", i18n("Polish Zloty")), create); - loadDefaultCurrency(MyMoneySecurity("QAR", i18n("Qatari Rial")), create); + loadDefaultCurrency(MyMoneySecurity("TQAR", i18n("Qatari Rial")), create); loadDefaultCurrency(MyMoneySecurity("RON", i18n("Romanian Leu (new)")), true); loadDefaultCurrency(MyMoneySecurity("RUB", i18n("Russian Ruble")), true); loadDefaultCurrency(MyMoneySecurity("RWF", i18n("Rwanda Franc")), create); @@ -1477,19 +1477,19 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("SBD", i18n("Solomon Islands Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("SOS", i18n("Somali Shilling")), create); loadDefaultCurrency(MyMoneySecurity("ZAR", i18n("South African Rand")), create); - loadDefaultCurrency(MyMoneySecurity("KRW", i18n("South Korean Won"), QChar(0x20A9)), create); + loadDefaultCurrency(MyMoneySecurity("KRW", i18n("South Korean Won"), TQChar(0x20A9)), create); loadDefaultCurrency(MyMoneySecurity("LKR", i18n("Sri Lanka Rupee")), create); - loadDefaultCurrency(MyMoneySecurity("SHP", i18n("St. Helena Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("SHP", i18n("St. Helena Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("SDD", i18n("Sudanese Dinar")), create); loadDefaultCurrency(MyMoneySecurity("SRG", i18n("Suriname Guilder")), create); loadDefaultCurrency(MyMoneySecurity("SZL", i18n("Swaziland Lilangeni")), create); loadDefaultCurrency(MyMoneySecurity("SEK", i18n("Swedish Krona")), create); loadDefaultCurrency(MyMoneySecurity("CHF", i18n("Swiss Franc"), "SFr"), create); - loadDefaultCurrency(MyMoneySecurity("SYP", i18n("Syrian Pound"), QChar(0x00A3)), create); + loadDefaultCurrency(MyMoneySecurity("SYP", i18n("Syrian Pound"), TQChar(0x00A3)), create); loadDefaultCurrency(MyMoneySecurity("TWD", i18n("Taiwan Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("TJS", i18n("Tajikistan Somani")), create); loadDefaultCurrency(MyMoneySecurity("TZS", i18n("Tanzanian Shilling")), create); - loadDefaultCurrency(MyMoneySecurity("THB", i18n("Thai Baht"), QChar(0x0E3F)), create); + loadDefaultCurrency(MyMoneySecurity("THB", i18n("Thai Baht"), TQChar(0x0E3F)), create); loadDefaultCurrency(MyMoneySecurity("TOP", i18n("Tongan Pa'anga")), create); loadDefaultCurrency(MyMoneySecurity("TTD", i18n("Trinidad and Tobago Dollar"), "$"), create); loadDefaultCurrency(MyMoneySecurity("TND", i18n("Tunisian Dinar"), "TND", 1000, 1000), create); @@ -1503,7 +1503,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("UZS", i18n("Uzbekistani Sum")), create); loadDefaultCurrency(MyMoneySecurity("VUV", i18n("Vanuatu Vatu")), create); loadDefaultCurrency(MyMoneySecurity("VEB", i18n("Venezuelan Bolivar")), create); - loadDefaultCurrency(MyMoneySecurity("VND", i18n("Vietnamese Dong"), QChar(0x20AB)), create); + loadDefaultCurrency(MyMoneySecurity("VND", i18n("Vietnamese Dong"), TQChar(0x20AB)), create); loadDefaultCurrency(MyMoneySecurity("YUM", i18n("Yugoslav Dinar")), create); loadDefaultCurrency(MyMoneySecurity("ZMK", i18n("Zambian Kwacha")), create); loadDefaultCurrency(MyMoneySecurity("ZWD", i18n("Zimbabwe Dollar"), "$"), create); @@ -1514,7 +1514,7 @@ void KMyMoneyView::loadDefaultCurrencies(void) loadDefaultCurrency(MyMoneySecurity("XAG", i18n("Silver"), "XAG", 1, 1000000), create); } -void KMyMoneyView::loadAncientCurrency(const QString& id, const QString& name, const QString& sym, const QDate& date, const MyMoneyMoney& rate, const QString& newId, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) +void KMyMoneyView::loadAncientCurrency(const TQString& id, const TQString& name, const TQString& sym, const TQDate& date, const MyMoneyMoney& rate, const TQString& newId, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyPrice price(id, newId, date, rate, "KMyMoney"); @@ -1544,34 +1544,34 @@ void KMyMoneyView::loadAncientCurrency(const QString& id, const QString& name, c void KMyMoneyView::loadAncientCurrencies(void) { - loadAncientCurrency("ATS", i18n("Austrian Schilling"), "ÖS", QDate(1998,12,31), MyMoneyMoney(10000, 137603), "EUR"); - loadAncientCurrency("DEM", i18n("German Mark"), "DM", QDate(1998,12,31), MyMoneyMoney(100000, 195583), "EUR"); - loadAncientCurrency("FRF", i18n("French Franc"), "FF", QDate(1998,12,31), MyMoneyMoney(100000, 655957), "EUR"); - loadAncientCurrency("ITL", i18n("Italian Lira"), QChar(0x20A4), QDate(1998,12,31), MyMoneyMoney(100, 193627), "EUR"); - loadAncientCurrency("ESP", i18n("Spanish Peseta"), QString(), QDate(1998,12,31), MyMoneyMoney(1000, 166386), "EUR"); - loadAncientCurrency("NLG", i18n("Dutch Guilder"), QString(), QDate(1998,12,31), MyMoneyMoney(100000, 220371), "EUR"); - loadAncientCurrency("BEF", i18n("Belgian Franc"), "Fr", QDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); - loadAncientCurrency("LUF", i18n("Luxembourg Franc"), "Fr", QDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); - loadAncientCurrency("PTE", i18n("Portuguese Escudo"), QString(), QDate(1998,12,31), MyMoneyMoney(1000, 200482), "EUR"); - loadAncientCurrency("IEP", i18n("Irish Pound"), QChar(0x00A3), QDate(1998,12,31), MyMoneyMoney(1000000, 787564), "EUR"); - loadAncientCurrency("FIM", i18n("Finnish Markka"), QString(), QDate(1998,12,31), MyMoneyMoney(100000, 594573), "EUR"); - loadAncientCurrency("GRD", i18n("Greek Drachma"), QChar(0x20AF), QDate(1998,12,31), MyMoneyMoney(100, 34075), "EUR"); + loadAncientCurrency("ATS", i18n("Austrian Schilling"), "ÖS", TQDate(1998,12,31), MyMoneyMoney(10000, 137603), "EUR"); + loadAncientCurrency("DEM", i18n("German Mark"), "DM", TQDate(1998,12,31), MyMoneyMoney(100000, 195583), "EUR"); + loadAncientCurrency("FRF", i18n("French Franc"), "FF", TQDate(1998,12,31), MyMoneyMoney(100000, 655957), "EUR"); + loadAncientCurrency("ITL", i18n("Italian Lira"), TQChar(0x20A4), TQDate(1998,12,31), MyMoneyMoney(100, 193627), "EUR"); + loadAncientCurrency("ESP", i18n("Spanish Peseta"), TQString(), TQDate(1998,12,31), MyMoneyMoney(1000, 166386), "EUR"); + loadAncientCurrency("NLG", i18n("Dutch Guilder"), TQString(), TQDate(1998,12,31), MyMoneyMoney(100000, 220371), "EUR"); + loadAncientCurrency("BEF", i18n("Belgian Franc"), "Fr", TQDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); + loadAncientCurrency("LUF", i18n("Luxembourg Franc"), "Fr", TQDate(1998,12,31), MyMoneyMoney(10000, 403399), "EUR"); + loadAncientCurrency("PTE", i18n("Portuguese Escudo"), TQString(), TQDate(1998,12,31), MyMoneyMoney(1000, 200482), "EUR"); + loadAncientCurrency("IEP", i18n("Irish Pound"), TQChar(0x00A3), TQDate(1998,12,31), MyMoneyMoney(1000000, 787564), "EUR"); + loadAncientCurrency("FIM", i18n("Finnish Markka"), TQString(), TQDate(1998,12,31), MyMoneyMoney(100000, 594573), "EUR"); + loadAncientCurrency("GRD", i18n("Greek Drachma"), TQChar(0x20AF), TQDate(1998,12,31), MyMoneyMoney(100, 34075), "EUR"); - loadAncientCurrency("ROL", i18n("Romanian Leu"), "ROL", QDate(2005,6,30), MyMoneyMoney(1, 10000), "RON"); + loadAncientCurrency("ROL", i18n("Romanian Leu"), "ROL", TQDate(2005,6,30), MyMoneyMoney(1, 10000), "RON"); - loadAncientCurrency("RUR", i18n("Russian Ruble (old)"), "RUR", QDate(1998, 1, 1), MyMoneyMoney(1, 1000), "RUB"); + loadAncientCurrency("RUR", i18n("Russian Ruble (old)"), "RUR", TQDate(1998, 1, 1), MyMoneyMoney(1, 1000), "RUB"); - loadAncientCurrency("SIT", i18n("Slovenian Tolar"), "SIT", QDate(2006,12,31), MyMoneyMoney(100, 23964), "EUR"); + loadAncientCurrency("SIT", i18n("Slovenian Tolar"), "SIT", TQDate(2006,12,31), MyMoneyMoney(100, 23964), "EUR"); // Source: http://www.tf-portfoliosolutions.net/products/turkishlira.aspx - loadAncientCurrency("TRL", i18n("Turkish Lira"), "TL", QDate(2004,12,31), MyMoneyMoney(1,1000000), "TRY"); + loadAncientCurrency("TRL", i18n("Turkish Lira"), "TL", TQDate(2004,12,31), MyMoneyMoney(1,1000000), "TRY"); // Source: http://www.focus.de/finanzen/news/malta-und-zypern_aid_66058.html - loadAncientCurrency("MTL", i18n("Maltese Lira"), "MTL", QDate(2008,1,1), MyMoneyMoney(429300,1000000), "EUR"); - loadAncientCurrency("CYP", i18n("Cyprus Pound"), QString("C%1").arg(QChar(0x00A3)), QDate(2008,1,1), MyMoneyMoney(585274,1000000), "EUR"); + loadAncientCurrency("MTL", i18n("Maltese Lira"), "MTL", TQDate(2008,1,1), MyMoneyMoney(429300,1000000), "EUR"); + loadAncientCurrency("CYP", i18n("Cyprus Pound"), TQString("C%1").tqarg(TQChar(0x00A3)), TQDate(2008,1,1), MyMoneyMoney(585274,1000000), "EUR"); // Source: http://www.focus.de/finanzen/news/waehrungszone-slowakei-ist-neuer-euro-staat_aid_359025.html - loadAncientCurrency("SKK", i18n("Slovak Koruna"), "SKK", QDate(2008,12,31), MyMoneyMoney(1000,30126), "EUR"); + loadAncientCurrency("SKK", i18n("Slovak Koruna"), "SKK", TQDate(2008,12,31), MyMoneyMoney(1000,30126), "EUR"); } void KMyMoneyView::viewUp(void) @@ -1580,7 +1580,7 @@ void KMyMoneyView::viewUp(void) return; } -void KMyMoneyView::viewAccountList(const QString& /*selectAccount*/) +void KMyMoneyView::viewAccountList(const TQString& /*selectAccount*/) { if(pageIndex(m_accountsViewFrame) != activePageIndex()) showPage(1); @@ -1591,13 +1591,13 @@ void KMyMoneyView::viewAccountList(const QString& /*selectAccount*/) void KMyMoneyView::slotRefreshViews() { // turn off sync between ledger and investment view - disconnect(m_investmentView, SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, SLOT(slotSelectAccount(const MyMoneyObject&))); - disconnect(m_ledgerView, SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, SLOT(slotSelectAccount(const MyMoneyObject&))); + disconnect(m_investmentView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + disconnect(m_ledgerView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); // TODO turn sync between ledger and investment view if selected by user if(KMyMoneyGlobalSettings::syncLedgerInvestment()) { - connect(m_investmentView, SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, SLOT(slotSelectAccount(const MyMoneyObject&))); - connect(m_ledgerView, SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_investmentView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_ledgerView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); + connect(m_ledgerView, TQT_SIGNAL(accountSelected(const MyMoneyObject&)), m_investmentView, TQT_SLOT(slotSelectAccount(const MyMoneyObject&))); } showTitleBar(KMyMoneyGlobalSettings::showTitleBar()); @@ -1623,12 +1623,12 @@ void KMyMoneyView::slotShowTransactionDetail(bool detailed) } -void KMyMoneyView::progressCallback(int current, int total, const QString& msg) +void KMyMoneyView::progressCallback(int current, int total, const TQString& msg) { kmymoney2->progressCallback(current, total, msg); } -void KMyMoneyView::slotRememberPage(QWidget* w) +void KMyMoneyView::slotRememberPage(TQWidget* w) { KConfig *config = KGlobal::config(); config->setGroup("Last Use Settings"); @@ -1645,22 +1645,22 @@ void KMyMoneyView::fixFile_2(void) MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyTransactionFilter filter; filter.setReportAllSplits( false ); - QValueList transactionList; + TQValueList transactionList; file->transactionList(transactionList, filter); // scan the transactions and modify transactions with two splits // which reference an account and a category to have the memo text // of the account. - QValueList::Iterator it_t; + TQValueList::Iterator it_t; int count = 0; for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { if((*it_t).splitCount() == 2) { - QString accountId; - QString categoryId; - QString accountMemo; - QString categoryMemo; - const QValueList& splits = (*it_t).splits(); - QValueList::const_iterator it_s; + TQString accountId; + TQString categoryId; + TQString accountMemo; + TQString categoryMemo; + const TQValueList& splits = (*it_t).splits(); + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneyAccount acc = file->account((*it_s).accountId()); if(acc.isIncomeExpense()) { @@ -1688,23 +1688,23 @@ void KMyMoneyView::fixFile_2(void) void KMyMoneyView::fixFile_1(void) { - // we need to fix reports. If the account filter list contains + // we need to fix reports. If the account filter list tqcontains // investment accounts, we need to add the stock accounts to the list // as well if we don't have the expert mode enabled if(!KMyMoneyGlobalSettings::expertMode()) { try { - QValueList reports = MyMoneyFile::instance()->reportList(); - QValueList::iterator it_r; + TQValueList reports = MyMoneyFile::instance()->reportList(); + TQValueList::iterator it_r; for(it_r = reports.begin(); it_r != reports.end(); ++it_r) { - QStringList list; + TQStringList list; (*it_r).accounts(list); - QStringList missing; - QStringList::const_iterator it_a, it_b; + TQStringList missing; + TQStringList::const_iterator it_a, it_b; for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!list.contains(*it_b)) { + if(!list.tqcontains(*it_b)) { missing.append(*it_b); } } @@ -1724,20 +1724,20 @@ void KMyMoneyView::fixFile_1(void) #if 0 if(!m_accountsView->allItemsSelected()) { // retrieve a list of selected accounts - QStringList list; + TQStringList list; m_accountsView->selectedItems(list); // if we're not in expert mode, we need to make sure // that all stock accounts for the selected investment // account are also selected if(!KMyMoneyGlobalSettings::expertMode()) { - QStringList missing; - QStringList::const_iterator it_a, it_b; + TQStringList missing; + TQStringList::const_iterator it_a, it_b; for(it_a = list.begin(); it_a != list.end(); ++it_a) { MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); if(acc.accountType() == MyMoneyAccount::Investment) { for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) { - if(!list.contains(*it_b)) { + if(!list.tqcontains(*it_b)) { missing.append(*it_b); } } @@ -1764,13 +1764,13 @@ void KMyMoneyView::fixFile_0(void) */ MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accountList; + TQValueList accountList; file->accountList(accountList); ::timetrace("Have account list"); - QValueList::Iterator it_a; - QValueList scheduleList = file->scheduleList(); + TQValueList::Iterator it_a; + TQValueList scheduleList = file->scheduleList(); ::timetrace("Have schedule list"); - QValueList::Iterator it_s; + TQValueList::Iterator it_s; MyMoneyAccount equity = file->equity(); MyMoneyAccount asset = file->asset(); @@ -1784,15 +1784,15 @@ void KMyMoneyView::fixFile_0(void) } // until early before 0.8 release, the equity account was not saved to // the file. If we have an equity account with no sub-accounts but - // find and equity account that has equity() as it's parent, we reparent + // find and equity account that has equity() as it's tqparent, we reparent // this account. Need to move it to asset() first, because otherwise // MyMoneyFile::reparent would act as NOP. if(equityListEmpty && (*it_a).accountType() == MyMoneyAccount::Equity) { - if((*it_a).parentAccountId() == equity.id()) { + if((*it_a).tqparentAccountId() == equity.id()) { MyMoneyAccount acc = *it_a; - // tricky, force parent account to be empty so that we really - // can re-parent it - acc.setParentAccountId(QString()); + // tricky, force tqparent account to be empty so that we really + // can re-tqparent it + acc.setParentAccountId(TQString()); file->reparentAccount(acc, equity); kdDebug(2) << __func__ << " fixed account " << acc.id() << " reparented to " << equity.id() << endl; } @@ -1812,8 +1812,8 @@ void KMyMoneyView::fixFile_0(void) void KMyMoneyView::fixSchedule_0(MyMoneySchedule sched) { MyMoneyTransaction t = sched.transaction(); - QValueList splitList = t.splits(); - QValueList::ConstIterator it_s; + TQValueList splitList = t.splits(); + TQValueList::ConstIterator it_s; bool updated = false; try { @@ -1844,7 +1844,7 @@ void KMyMoneyView::fixSchedule_0(MyMoneySchedule sched) if((*it_s).reconcileFlag() != MyMoneySplit::NotReconciled) { kdDebug(2) << __func__ << " " << sched.id() << " " << (*it_s).id() << " should be 'not reconciled'" << endl; MyMoneySplit split = *it_s; - split.setReconcileDate(QDate()); + split.setReconcileDate(TQDate()); split.setReconcileFlag(MyMoneySplit::NotReconciled); t.modifySplit(split); updated = true; @@ -1884,7 +1884,7 @@ void KMyMoneyView::fixLoanAccount_0(MyMoneyAccount acc) i18n("The account \"%1\" was previously created as loan account but some information " "is missing. The new loan wizard will be started to collect all relevant " "information. Please use a KMyMoney version >= 0.8.7 and < 0.9 to correct the problem." - ).arg(acc.name()), + ).tqarg(acc.name()), i18n("Account problem")); throw new MYMONEYEXCEPTION("Fix LoanAccount0 not supported anymore"); @@ -1911,7 +1911,7 @@ void KMyMoneyView::createSchedule(MyMoneySchedule newSchedule, MyMoneyAccount& n // to the account pool. Note: the schedule code used to leave // this always the first split, but the loan code leaves it as // the second one. So I thought, searching is a good alternative .... - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).accountId().isEmpty()) { MyMoneySplit s = (*it_s); @@ -1952,16 +1952,16 @@ void KMyMoneyView::fixTransactions_0(void) #endif ::timetrace("fixTransactions: get schedule list"); - QValueList scheduleList = file->scheduleList(); + TQValueList scheduleList = file->scheduleList(); ::timetrace("fixTransactions: get transaction list"); MyMoneyTransactionFilter filter; filter.setReportAllSplits( false ); - QValueList transactionList; + TQValueList transactionList; file->transactionList(transactionList, filter); ::timetrace("fixTransactions: have list"); - QValueList::Iterator it_x; - QStringList interestAccounts; + TQValueList::Iterator it_x; + TQStringList interestAccounts; KMSTATUS(i18n("Fix transactions")); kmymoney2->slotStatusProgressBar(0, scheduleList.count() + transactionList.count()); @@ -1970,12 +1970,12 @@ void KMyMoneyView::fixTransactions_0(void) // scan the schedules to find interest accounts for(it_x = scheduleList.begin(); it_x != scheduleList.end(); ++it_x) { MyMoneyTransaction t = (*it_x).transaction(); - QValueList::ConstIterator it_s; - QStringList accounts; + TQValueList::ConstIterator it_s; + TQStringList accounts; bool hasDuplicateAccounts = false; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { - if(accounts.contains((*it_s).accountId())) { + if(accounts.tqcontains((*it_s).accountId())) { hasDuplicateAccounts = true; kdDebug(2) << __func__ << " " << t.id() << " has multiple splits with account " << (*it_s).accountId() << endl; } else { @@ -1983,7 +1983,7 @@ void KMyMoneyView::fixTransactions_0(void) } if((*it_s).action() == MyMoneySplit::ActionInterest) { - if(interestAccounts.contains((*it_s).accountId()) == 0) { + if(interestAccounts.tqcontains((*it_s).accountId()) == 0) { interestAccounts << (*it_s).accountId(); } } @@ -1998,12 +1998,12 @@ void KMyMoneyView::fixTransactions_0(void) ::timetrace("fixTransactions: start loop"); // scan the transactions and modify loan transactions - QValueList::Iterator it_t; + TQValueList::Iterator it_t; for(it_t = transactionList.begin(); it_t != transactionList.end(); ++it_t) { const char *defaultAction = 0; - QValueList splits = (*it_t).splits(); - QValueList::Iterator it_s; - QStringList accounts; + TQValueList splits = (*it_t).splits(); + TQValueList::Iterator it_s; + TQStringList accounts; // check if base commodity is set. if not, set baseCurrency if((*it_t).commodity().isEmpty()) { @@ -2091,14 +2091,14 @@ void KMyMoneyView::fixTransactions_0(void) // and check if there are any duplicates in this transactions for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneyAccount splitAccount = file->account((*it_s).accountId()); - if(accounts.contains((*it_s).accountId())) { + if(accounts.tqcontains((*it_s).accountId())) { hasDuplicateAccounts = true; } else { accounts << (*it_s).accountId(); } // if this split references an interest account, the action // must be of type ActionInterest - if(interestAccounts.contains((*it_s).accountId())) { + if(interestAccounts.tqcontains((*it_s).accountId())) { if((*it_s).action() != MyMoneySplit::ActionInterest) { kdDebug(2) << __func__ << " " << (*it_t).id() << " contains an interest account (" << (*it_s).accountId() << ") but does not have ActionInterest" << endl; (*it_s).setAction(MyMoneySplit::ActionInterest); @@ -2175,10 +2175,10 @@ void KMyMoneyView::slotPrintView(void) m_homeView->slotPrintView(); } -KMyMoneyViewBase* KMyMoneyView::addPage(const QString& title, const QString& icon) +KMyMoneyViewBase* KMyMoneyView::addPage(const TQString& title, const TQString& icon) { const int iconSize = (KMyMoneyGlobalSettings::iconSize()+1)*16; - QFrame* frm = KJanusWidget::addVBoxPage(title, title, DesktopIcon(icon, iconSize)); + TQFrame* frm = KJanusWidget::addVBoxPage(title, title, DesktopIcon(icon, iconSize)); return new KMyMoneyViewBase(frm, title.latin1(), title); } @@ -2189,8 +2189,8 @@ KMyMoneyViewBase* KMyMoneyView::addPage(const QString& title, const QString& ico // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -2202,30 +2202,30 @@ KMyMoneyViewBase* KMyMoneyView::addPage(const QString& title, const QString& ico class KMyMoneyViewBase::Private { public: - QFrame* m_titleLine; + TQFrame* m_titleLine; KMyMoneyTitleLabel* m_titleLabel; - QVBoxLayout* m_viewLayout; + TQVBoxLayout* m_viewLayout; }; -KMyMoneyViewBase::KMyMoneyViewBase(QWidget* parent, const char* name, const QString& title) : - QWidget(parent, name), +KMyMoneyViewBase::KMyMoneyViewBase(TQWidget* tqparent, const char* name, const TQString& title) : + TQWidget(tqparent, name), d(new Private) { - d->m_viewLayout = new QVBoxLayout(this); + d->m_viewLayout = new TQVBoxLayout(this); d->m_viewLayout->setSpacing( 6 ); d->m_viewLayout->setMargin( 0 ); d->m_titleLabel = new KMyMoneyTitleLabel( this, "titleLabel" ); - d->m_titleLabel->setMinimumSize( QSize( 100, 30 ) ); + d->m_titleLabel->setMinimumSize( TQSize( 100, 30 ) ); d->m_titleLabel->setRightImageFile("pics/titlelabel_background.png" ); d->m_titleLabel->setText(title); d->m_viewLayout->addWidget( d->m_titleLabel ); #if 0 - d->m_titleLine = new QFrame( this, "titleLine" ); - d->m_titleLine->setFrameShape( QFrame::HLine ); - d->m_titleLine->setFrameShadow( QFrame::Sunken ); - d->m_titleLine->setFrameShape( QFrame::HLine ); + d->m_titleLine = new TQFrame( this, "titleLine" ); + d->m_titleLine->setFrameShape( TQFrame::HLine ); + d->m_titleLine->setFrameShadow( TQFrame::Sunken ); + d->m_titleLine->setFrameShape( TQFrame::HLine ); d->m_viewLayout->addWidget( d->m_titleLine ); #endif } @@ -2235,12 +2235,12 @@ KMyMoneyViewBase::~KMyMoneyViewBase() delete d; } -void KMyMoneyViewBase::addWidget(QWidget* w) +void KMyMoneyViewBase::addWidget(TQWidget* w) { d->m_viewLayout->addWidget(w); } -QVBoxLayout* KMyMoneyViewBase::layout(void) const +TQVBoxLayout* KMyMoneyViewBase::tqlayout(void) const { return d->m_viewLayout; } diff --git a/kmymoney2/views/kmymoneyview.h b/kmymoney2/views/kmymoneyview.h index 13e3d76..e1c1266 100644 --- a/kmymoney2/views/kmymoneyview.h +++ b/kmymoney2/views/kmymoneyview.h @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QVBox; -class QFile; -class QVBoxLayout; +#include +class TQVBox; +class TQFile; +class TQVBoxLayout; // ---------------------------------------------------------------------------- // KDE Includes @@ -65,7 +65,7 @@ class TransactionEditor; class KForecastView; /** - * This class represents the view of the MyMoneyFile which contains + * This class represents the view of the MyMoneyFile which tqcontains * Banks/Accounts/Transactions, Recurring transactions (or Bills & Deposits) * and scripts (yet to be implemented). Each different aspect of the file * is represented by a tab within the view. @@ -77,6 +77,7 @@ class KForecastView; class KMyMoneyView : public KJanusWidget { Q_OBJECT + TQ_OBJECT public: enum viewID { @@ -127,17 +128,17 @@ private: KReportsView* m_reportsView; KForecastView* m_forecastView; - QVBox* m_homeViewFrame; - QVBox* m_accountsViewFrame; - QVBox* m_institutionsViewFrame; - QVBox* m_categoriesViewFrame; - QVBox* m_payeesViewFrame; - QVBox* m_budgetViewFrame; - QVBox* m_scheduleViewFrame; - QVBox* m_ledgerViewFrame; - QVBox* m_investmentViewFrame; - QVBox* m_reportsViewFrame; - QVBox* m_forecastViewFrame; + TQVBox* m_homeViewFrame; + TQVBox* m_accountsViewFrame; + TQVBox* m_institutionsViewFrame; + TQVBox* m_categoriesViewFrame; + TQVBox* m_payeesViewFrame; + TQVBox* m_budgetViewFrame; + TQVBox* m_scheduleViewFrame; + TQVBox* m_ledgerViewFrame; + TQVBox* m_investmentViewFrame; + TQVBox* m_reportsViewFrame; + TQVBox* m_forecastViewFrame; bool m_inConstructor; @@ -161,9 +162,9 @@ private: fileTypeE m_fileType; private: - void addTitleBar(QWidget* parent, const QString& title); + void addTitleBar(TQWidget* tqparent, const TQString& title); - void ungetString(QIODevice *qfile, char * buf, int len); + void ungetString(TQIODevice *qfile, char * buf, int len); /** * This method creates the currency @p curr if it does not exist and @@ -180,7 +181,7 @@ private: /** * */ - void loadAncientCurrency(const QString& id, const QString& name, const QString& sym, const QDate& date, const MyMoneyMoney& rate, const QString& newId, const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); + void loadAncientCurrency(const TQString& id, const TQString& name, const TQString& sym, const TQDate& date, const MyMoneyMoney& rate, const TQString& newId, const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); /** * if no base currency is defined, start the dialog and force it to be set @@ -200,9 +201,9 @@ private: */ void removeStorage(void); - void viewAccountList(const QString& selectAccount); // Show the accounts view + void viewAccountList(const TQString& selectAccount); // Show the accounts view - static void progressCallback(int current, int total, const QString&); + static void progressCallback(int current, int total, const TQString&); /** */ @@ -222,14 +223,14 @@ private: void createSchedule(MyMoneySchedule s, MyMoneyAccount& a); - void checkAccountName(const MyMoneyAccount& acc, const QString& name) const; + void checkAccountName(const MyMoneyAccount& acc, const TQString& name) const; public: /** * The constructor for KMyMoneyView. Just creates all the tabs for the * different aspects of the MyMoneyFile. */ - KMyMoneyView(QWidget *parent=0, const char *name=0); + KMyMoneyView(TQWidget *tqparent=0, const char *name=0); /** * Destructor @@ -266,14 +267,14 @@ public: * * @param url The URL to save into. * If no protocol is specified, file:// is assumed. - * @param keyList QString containing a comma separated list of keys + * @param keyList TQString containing a comma separated list of keys * to be used for encryption. If @p keyList is empty, * the file will be saved unencrypted (the default) * * @retval false save operation failed * @retval true save operation was successful */ - bool saveFile(const KURL& url, const QString& keyList = QString()); + bool saveFile(const KURL& url, const TQString& keyList = TQString()); /** * Saves the data into permanent storage on a new or empty SQL database. * @@ -340,9 +341,9 @@ public: */ void enableViews(int state = -1); - KMyMoneyViewBase* addPage(const QString& title, const QString& icon = QString()); + KMyMoneyViewBase* addPage(const TQString& title, const TQString& icon = TQString()); - void addWidget(QWidget* w); + void addWidget(TQWidget* w); virtual bool showPage(int index); @@ -357,7 +358,7 @@ public: * @retval true Yes, view allows to create a transaction (tooltip is not changed) * @retval false No, view cannot to create a transaction (tooltip is updated with message) */ - bool canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canCreateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * check if the current view allows to modify (edit/delete) the selected transactions @@ -370,9 +371,9 @@ public: * @retval true Yes, view allows to edit/delete transactions (tooltip is not changed) * @retval false No, view cannot edit/delete transactions (tooltip is updated with message) */ - bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canModifyTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; - bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canDuplicateTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * check if the current view allows to edit the selected transactions @@ -385,7 +386,7 @@ public: * @retval true Yes, view allows to enter/edit transactions * @retval false No, view cannot enter/edit transactions */ - bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, QString& tooltip) const; + bool canEditTransactions(const KMyMoneyRegister::SelectedTransactions& list, TQString& tooltip) const; /** * check if the current view allows to print something @@ -410,7 +411,7 @@ public: * @retval true Reconciliation started * @retval false Account cannot be reconciled */ - bool startReconciliation(const MyMoneyAccount& account, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + bool startReconciliation(const MyMoneyAccount& account, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); /** * Used to finish reconciliation of account @a account. It switches the @@ -437,7 +438,7 @@ public slots: * * @param widget pointer to page widget */ - void slotRememberPage(QWidget* widget); + void slotRememberPage(TQWidget* widget); /** * Brings up a dialog to change the list(s) settings and saves them into the @@ -445,7 +446,7 @@ public slots: * * @see KListSettingsDlg * Refreshs all views. Used e.g. after settings have been changed or - * data has been loaded from external sources (QIF import). + * data has been loaded from external sources (TQIF import). **/ void slotRefreshViews(); @@ -457,7 +458,7 @@ public slots: * @param acc The ID of the account to be shown * @param transaction The ID of the transaction to be selected */ - void slotLedgerSelected(const QString& acc, const QString& transaction = QString()); + void slotLedgerSelected(const TQString& acc, const TQString& transaction = TQString()); /** * Called, whenever the payees view should pop up and a specific @@ -467,7 +468,7 @@ public slots: * @param accountId The ID of the account to be shown * @param transactionId The ID of the transaction to be selected */ - void slotPayeeSelected(const QString& payeeId, const QString& accountId, const QString& transactionId); + void slotPayeeSelected(const TQString& payeeId, const TQString& accountId, const TQString& transactionId); /** * Called, whenever the schedule view should pop up and a specific @@ -475,7 +476,7 @@ public slots: * * @param schedule The ID of the schedule to be shown */ - void slotScheduleSelected(const QString& schedule); + void slotScheduleSelected(const TQString& schedule); /** * Called, whenever the report view should pop up and a specific @@ -483,7 +484,7 @@ public slots: * * @param reportid The ID of the report to be shown */ - void slotShowReport(const QString& reportid); + void slotShowReport(const TQString& reportid); /** * Same as the above, but the caller passes in an actual report @@ -546,15 +547,15 @@ private: * the final destination is reached over a network * protocol (e.g. FTP) * - * @param qf pointer to QFile representing the opened file + * @param qf pointer to TQFile representing the opened file * @param writer pointer to the formatter * @param plaintext whether to override any compression & encryption settings - * @param keyList QString containing a comma separated list of keys to be used for encryption + * @param keyList TQString containing a comma separated list of keys to be used for encryption * If @p keyList is empty, the file will be saved unencrypted * * @note This method will close the file when it is written. */ - void saveToLocalFile(QFile* qf, IMyMoneyStorageFormat* writer, bool plaintext=false, const QString& keyList = QString()); + void saveToLocalFile(TQFile* qf, IMyMoneyStorageFormat* writer, bool plaintext=false, const TQString& keyList = TQString()); /** * Internal method used by slotAccountNew() and slotAccountCategory(). @@ -587,7 +588,7 @@ signals: * @param endingBalance collected ending balance when reconciliation starts * 0 otherwise */ - void reconciliationStarts(const MyMoneyAccount& account, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + void reconciliationStarts(const MyMoneyAccount& account, const TQDate& reconciliationDate, const MyMoneyMoney& endingBalance); }; @@ -595,16 +596,17 @@ signals: * This class is an abstract base class that all specific views * should be based on. */ -class KMyMoneyViewBase : public QWidget +class KMyMoneyViewBase : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KMyMoneyViewBase(QWidget* parent, const char *name, const QString& title); + KMyMoneyViewBase(TQWidget* tqparent, const char *name, const TQString& title); virtual ~KMyMoneyViewBase(); - void setTitle(const QString& title); - QVBoxLayout* layout(void) const; - void addWidget(QWidget* w); + void setTitle(const TQString& title); + TQVBoxLayout* tqlayout(void) const; + void addWidget(TQWidget* w); /** * This method is used to edit the currently selected transactions @@ -614,7 +616,7 @@ public: * @retval false view was not capable to edit transactions * @retval true view was capable to edit the transactions and did so */ - bool editTransactions(const QValueList& transactions) const { Q_UNUSED(transactions) return false; } + bool editTransactions(const TQValueList& transactions) const { Q_UNUSED(transactions) return false; } private: /// \internal d-pointer class. class Private; diff --git a/kmymoney2/views/kpayeesview.cpp b/kmymoney2/views/kpayeesview.cpp index ad17ff4..83c7e8f 100644 --- a/kmymoney2/views/kpayeesview.cpp +++ b/kmymoney2/views/kpayeesview.cpp @@ -25,22 +25,22 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -70,7 +70,7 @@ /* KTransactionPtrVector */ /* -------------------------------------------------------------------------------*/ -int KTransactionPtrVector::compareItems(const QString& s1, const QString& s2) const +int KTransactionPtrVector::compareItems(const TQString& s1, const TQString& s2) const { if(s1 == s2) return 0; @@ -99,7 +99,7 @@ int KTransactionPtrVector::compareItems(KTransactionPtrVector::Item d1, KTransac s2 = t2->splitByPayee(m_id); break; } - QString p1, p2; + TQString p1, p2; switch(m_sortType) { case SortValue: @@ -245,13 +245,13 @@ void KTransactionPtrVector::setSortType(const TransactionSortE type) sort(); } -void KTransactionPtrVector::setAccountId(const QString& id) +void KTransactionPtrVector::setAccountId(const TQString& id) { m_id = id; m_idMode = AccountMode; } -void KTransactionPtrVector::setPayeeId(const QString& id) +void KTransactionPtrVector::setPayeeId(const TQString& id) { m_id = id; m_idMode = PayeeMode; @@ -260,8 +260,8 @@ void KTransactionPtrVector::setPayeeId(const QString& id) // *** KPayeeListItem Implementation *** -KPayeeListItem::KPayeeListItem(KListView *parent, const MyMoneyPayee& payee) : - KListViewItem(parent), +KPayeeListItem::KPayeeListItem(KListView *tqparent, const MyMoneyPayee& payee) : + KListViewItem(tqparent), m_payee(payee) { setText(0, payee.name()); @@ -273,22 +273,22 @@ KPayeeListItem::~KPayeeListItem() { } -void KPayeeListItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +void KPayeeListItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { - QColorGroup cg2(cg); + TQColorGroup cg2(cg); if(isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); p->setFont(KMyMoneyGlobalSettings::listCellFont()); - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } -KTransactionListItem::KTransactionListItem(KListView* view, KTransactionListItem* parent, const QString& accountId, const QString& transactionId) : - KListViewItem(view, parent) +KTransactionListItem::KTransactionListItem(KListView* view, KTransactionListItem* tqparent, const TQString& accountId, const TQString& transactionId) : + KListViewItem(view, tqparent) { m_accountId = accountId; m_transactionId = transactionId; @@ -298,14 +298,14 @@ KTransactionListItem::~KTransactionListItem() { } -void KTransactionListItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) +void KTransactionListItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment) { - QColorGroup _cg = cg; - _cg.setColor(QColorGroup::Base, backgroundColor()); - QListViewItem::paintCell(p, _cg, column, width, alignment); + TQColorGroup _cg = cg; + _cg.setColor(TQColorGroup::Base, backgroundColor()); + TQListViewItem::paintCell(p, _cg, column, width, tqalignment); } -const QColor KTransactionListItem::backgroundColor(void) +const TQColor KTransactionListItem::backgroundColor(void) { return isAlternate() ? KMyMoneyGlobalSettings::listBGColor() : KMyMoneyGlobalSettings::listColor(); } @@ -315,30 +315,30 @@ const QColor KTransactionListItem::backgroundColor(void) // *** KPayeesView Implementation *** -KPayeesView::KPayeesView(QWidget *parent, const char *name ) : - KPayeesViewDecl(parent,name), +KPayeesView::KPayeesView(TQWidget *tqparent, const char *name ) : + KPayeesViewDecl(tqparent,name), m_needReload(false), m_needConnection(true), m_updatesQueued(0), m_inSelection(false) { // create the searchline widget - // and insert it into the existing layout + // and insert it into the existing tqlayout m_searchWidget = new KListViewSearchLineWidget(m_payeesList, this); - m_searchWidget->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed)); + m_searchWidget->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed)); KPayeesViewDeclLayout->insertWidget(0, m_searchWidget); - m_splitter = new QSplitter(this); - m_payeesList->reparent(m_splitter, QPoint(0,0), true); - m_tabWidget->reparent(m_splitter, QPoint(0, 0), true); - m_splitter->setResizeMode(m_tabWidget, QSplitter::Stretch); + m_splitter = new TQSplitter(this); + m_payeesList->reparent(m_splitter, TQPoint(0,0), true); + m_tabWidget->reparent(m_splitter, TQPoint(0, 0), true); + m_splitter->setResizeMode(m_tabWidget, TQSplitter::Stretch); m_splitter->setOpaqueResize(); - layout10->addWidget(m_splitter); + tqlayout10->addWidget(m_splitter); // use the size settings of the last run (if any) KConfig *config = KGlobal::config(); config->setGroup("Last Use Settings"); - QValueList sizes = config->readIntListEntry("KPayeesViewSplitterSize"); + TQValueList sizes = config->readIntListEntry("KPayeesViewSplitterSize"); if(sizes.size() == 2) { if(!sizes[0] || !sizes[1]) { sizes[0] = 1; @@ -348,10 +348,10 @@ KPayeesView::KPayeesView(QWidget *parent, const char *name ) : } m_transactionView->setSorting(-1); - m_transactionView->setColumnWidthMode(2, QListView::Manual); - m_transactionView->setColumnAlignment(3, Qt::AlignRight); + m_transactionView->setColumnWidthMode(2, TQListView::Manual); + m_transactionView->setColumnAlignment(3, TQt::AlignRight); // never show horizontal scroll bars - m_transactionView->setHScrollBarMode(QScrollView::AlwaysOff); + m_transactionView->setHScrollBarMode(TQScrollView::AlwaysOff); m_payeesList->addColumn(i18n("Name")); @@ -366,44 +366,44 @@ KPayeesView::KPayeesView(QWidget *parent, const char *name ) : KIconLoader* il = KGlobal::iconLoader(); KGuiItem updateButtenItem( i18n("Update"), - QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + TQIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), i18n("Accepts the entered data and stores it"), i18n("Use this to accept the modified data.")); m_updateButton->setGuiItem(updateButtenItem); - connect(m_payeesList, SIGNAL(selectionChanged()), this, SLOT(slotSelectPayee())); - connect(m_payeesList, SIGNAL(itemRenamed(QListViewItem*,int,const QString&)), this, SLOT(slotRenamePayee(QListViewItem*,int,const QString&))); + connect(m_payeesList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectPayee())); + connect(m_payeesList, TQT_SIGNAL(itemRenamed(TQListViewItem*,int,const TQString&)), this, TQT_SLOT(slotRenamePayee(TQListViewItem*,int,const TQString&))); - connect(addressEdit, SIGNAL(textChanged()), this, SLOT(slotPayeeDataChanged())); - connect(postcodeEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(telephoneEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(emailEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(notesEdit, SIGNAL(textChanged()), this, SLOT(slotPayeeDataChanged())); - connect(matchKeyEditList, SIGNAL(changed()), this, SLOT(slotKeyListChanged())); + connect(addressEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotPayeeDataChanged())); + connect(postcodeEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(telephoneEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(emailEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(notesEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotPayeeDataChanged())); + connect(matchKeyEditList, TQT_SIGNAL(changed()), this, TQT_SLOT(slotKeyListChanged())); - connect(radioNoMatch, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(radioNameMatch, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(radioKeyMatch, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(checkMatchIgnoreCase, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); + connect(radioNoMatch, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(radioNameMatch, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(radioKeyMatch, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(checkMatchIgnoreCase, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); - connect(checkEnableDefaultAccount, SIGNAL(toggled(bool)), this, SLOT(slotPayeeDataChanged())); - connect(comboDefaultAccount, SIGNAL(accountSelected(const QString&)), this, SLOT(slotPayeeDataChanged())); - connect(buttonSelectMyAccount, SIGNAL(clicked()), this, SLOT(slotChooseDefaultAccount())); + connect(checkEnableDefaultAccount, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(comboDefaultAccount, TQT_SIGNAL(accountSelected(const TQString&)), this, TQT_SLOT(slotPayeeDataChanged())); + connect(buttonSelectMyAccount, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotChooseDefaultAccount())); - connect(m_updateButton, SIGNAL(clicked()), this, SLOT(slotUpdatePayee())); - connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotHelp())); + connect(m_updateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpdatePayee())); + connect(m_helpButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotHelp())); - connect(m_payeesList, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotOpenContextMenu(KListView*, QListViewItem*, const QPoint&))); + connect(m_payeesList, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), this, TQT_SLOT(slotOpenContextMenu(KListView*, TQListViewItem*, const TQPoint&))); -// connect(m_payeesList, SIGNAL(rightButtonClicked(QListViewItem* , const QPoint&, int)), -// this, SLOT(slotOpenContextMenu(QListViewItem*))); +// connect(m_payeesList, TQT_SIGNAL(rightButtonClicked(TQListViewItem* , const TQPoint&, int)), +// this, TQT_SLOT(slotOpenContextMenu(TQListViewItem*))); - connect(m_transactionView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(slotTransactionDoubleClicked(QListViewItem*))); + connect(m_transactionView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), + this, TQT_SLOT(slotTransactionDoubleClicked(TQListViewItem*))); - connect(m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(rearrange(void))); + connect(m_tabWidget, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(rearrange(void))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotLoadPayees())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotLoadPayees())); } KPayeesView::~KPayeesView() @@ -419,7 +419,7 @@ void KPayeesView::slotQueueUpdate(void) m_updatesQueued++; // The KListViewSearchLineWidget has an internal timer for update purposes // of 200 ms, so we should be safe with 250 ms here - QTimer::singleShot(250, this, SLOT(slotActivateUpdate())); + TQTimer::singleShot(250, this, TQT_SLOT(slotActivateUpdate())); } void KPayeesView::slotActivateUpdate(void) @@ -432,20 +432,20 @@ void KPayeesView::slotActivateUpdate(void) void KPayeesView::slotChooseDefaultAccount(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QMap account_count; + TQMap account_count; for (int i = 0; i < m_transactionPtrVector.size(); ++i) { KMyMoneyTransaction* t = m_transactionPtrVector[i]; MyMoneySplit s = t->splitById(t->splitId()); const MyMoneyAccount& acc = file->account(s.accountId()); - QString txt; + TQString txt; if (s.action() != MyMoneySplit::ActionAmortization && acc.accountType() != MyMoneyAccount::AssetLoan && !file->isTransfer(*t) && t->splitCount() == 2) { MyMoneySplit s0 = t->splitByAccount(s.accountId(), false); - if (account_count.contains(s0.accountId())) { + if (account_count.tqcontains(s0.accountId())) { account_count[s0.accountId()]++; } else { @@ -454,7 +454,7 @@ void KPayeesView::slotChooseDefaultAccount(void) } } - QMapIterator most_frequent, iter; + TQMapIterator most_frequent, iter; most_frequent = account_count.end(); for (iter = account_count.begin(); iter != account_count.end(); iter++) { if (iter.data() > most_frequent.data()) { @@ -470,19 +470,19 @@ void KPayeesView::slotChooseDefaultAccount(void) void KPayeesView::slotStartRename(void) { - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; if((it_v = it_l.current()) != 0) { it_v->startRename(0); } } // This variant is only called when a single payee is selected and renamed. -void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QString& txt) +void KPayeesView::slotRenamePayee(TQListViewItem* p , int /* col */, const TQString& txt) { //kdDebug() << "[KPayeesView::slotRenamePayee]" << endl; // create a copy of the new name without appended whitespaces - QString new_name = txt.stripWhiteSpace(); + TQString new_name = txt.stripWhiteSpace(); if (m_payee.name() != new_name) { MyMoneyFileTransaction ft; try { @@ -495,7 +495,7 @@ void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QStrin if (KMessageBox::questionYesNo(this, i18n("A payee with the name '%1' already exists. It is not advisable to have " "multiple payees with the same identification name. Are you sure you would like " - "to rename the payee?").arg(new_name)) != KMessageBox::Yes) + "to rename the payee?").tqarg(new_name)) != KMessageBox::Yes) { p->setText(0,m_payee.name()); return; @@ -521,7 +521,7 @@ void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QStrin } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify payee"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -530,9 +530,9 @@ void KPayeesView::slotRenamePayee(QListViewItem* p , int /* col */, const QStrin } } -void KPayeesView::ensurePayeeVisible(const QString& id) +void KPayeesView::ensurePayeeVisible(const TQString& id) { - for (QListViewItem * item = m_payeesList->firstChild(); item; item = item->itemBelow()) { + for (TQListViewItem * item = m_payeesList->firstChild(); item; item = item->itemBelow()) { KPayeeListItem* p = dynamic_cast(item); if(p && p->payee().id() == id) { if(p->itemAbove()) @@ -548,10 +548,10 @@ void KPayeesView::ensurePayeeVisible(const QString& id) } } -void KPayeesView::selectedPayees(QValueList& payeesList) const +void KPayeesView::selectedPayees(TQValueList& payeesList) const { - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected | QListViewItemIterator::Visible); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected | TQListViewItemIterator::Visible); + TQListViewItem* it_v; while((it_v = it_l.current()) != 0) { KPayeeListItem* item = dynamic_cast(it_v); if(item) @@ -565,8 +565,8 @@ void KPayeesView::slotSelectPayee(void) // check if the content of a currently selected payee was modified // and ask to store the data if (m_updateButton->isEnabled()) { - if (KMessageBox::questionYesNo(this, QString("%1").arg( - i18n("Do you want to save the changes for %1?").arg(m_newName)), + if (KMessageBox::questionYesNo(this, TQString("%1").tqarg( + i18n("Do you want to save the changes for %1?").tqarg(m_newName)), i18n("Save changes")) == KMessageBox::Yes) { m_inSelection = true; slotUpdatePayee(); @@ -576,7 +576,7 @@ void KPayeesView::slotSelectPayee(void) // loop over all payees and count the number of payees, also // optain last selected payee - QValueList payeesList; + TQValueList payeesList; selectedPayees(payeesList); emit selectObjects(payeesList); @@ -593,18 +593,18 @@ void KPayeesView::slotSelectPayee(void) m_tabWidget->setEnabled(false); // disable tab widget clearItemData(); // disable renaming in all listviewitem - for (QListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) + for (TQListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) i->setRenameEnabled(0, false); return; } // otherwise we have just one selected, enable payee information widget m_tabWidget->setEnabled(true); // enable renaming in all listviewitem - for (QListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) + for (TQListViewItem * i = m_payeesList->firstChild(); i; i = i->itemBelow()) i->setRenameEnabled(0, true); // as of now we are updating only the last selected payee, and until - // selection mode of the QListView has been changed to Extended, this + // selection mode of the TQListView has been changed to Extended, this // will also be the only selection and behave exactly as before - Andreas try { m_payee = payeesList[0]; @@ -620,7 +620,7 @@ void KPayeesView::slotSelectPayee(void) emailEdit->setText(m_payee.email()); notesEdit->setText(m_payee.notes()); - QStringList keys; + TQStringList keys; bool ignorecase = false; MyMoneyPayee::payeeMatchType type = m_payee.matchData(ignorecase, keys); @@ -646,11 +646,11 @@ void KPayeesView::slotSelectPayee(void) void KPayeesView::clearItemData(void) { - addressEdit->setText(QString()); - postcodeEdit->setText(QString()); - telephoneEdit->setText(QString()); - emailEdit->setText(QString()); - notesEdit->setText(QString()); + addressEdit->setText(TQString()); + postcodeEdit->setText(TQString()); + telephoneEdit->setText(TQString()); + emailEdit->setText(TQString()); + notesEdit->setText(TQString()); showTransactions(); } @@ -664,16 +664,16 @@ void KPayeesView::showTransactions(void) m_transactionView->clear(); if(m_payee.id().isEmpty() || !m_tabWidget->isEnabled()) { - m_balanceLabel->setText(i18n("Balance: %1").arg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); + m_balanceLabel->setText(i18n("Balance: %1").tqarg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); return; } // setup the list and the pointer vector MyMoneyTransactionFilter filter; filter.addPayee(m_payee.id()); - filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), QDate()); + filter.setDateFilter(KMyMoneyGlobalSettings::startDate().date(), TQDate()); - QValueList list = file->transactionList(filter); + TQValueList list = file->transactionList(filter); m_transactionList.clear(); m_transactionPtrVector.clear(); @@ -681,8 +681,8 @@ void KPayeesView::showTransactions(void) m_transactionPtrVector.setPayeeId(m_payee.id()); m_transactionPtrVector.setSortType(KTransactionPtrVector::SortPostDate); - QValueList::ConstIterator it_t; - QString lastId; + TQValueList::ConstIterator it_t; + TQString lastId; int ofs = 0; for(i = 0, it_t = list.begin(); it_t != list.end(); ++it_t) { @@ -699,7 +699,7 @@ void KPayeesView::showTransactions(void) MyMoneyAccount acc = MyMoneyFile::instance()->account(filter.matchingSplits()[ofs].accountId()); if(acc.accountGroup() == MyMoneyAccount::Asset || acc.accountGroup() == MyMoneyAccount::Liability) { - QValueList::ConstIterator it_k; + TQValueList::ConstIterator it_k; it_k = m_transactionList.append(k); balance += k.splitById(k.splitId()).value(); m_transactionPtrVector.insert(i, &(*it_k)); @@ -723,28 +723,28 @@ void KPayeesView::showTransactions(void) item->setText(0, s.number()); item->setText(1, KGlobal::locale()->formatDate(t->postDate(), true)); - QString txt; + TQString txt; if(s.action() == MyMoneySplit::ActionAmortization) { if(acc.accountType() == MyMoneyAccount::Loan) { if(s.value().isPositive()) { - txt = i18n("Amortization of %1").arg(acc.name()); + txt = i18n("Amortization of %1").tqarg(acc.name()); } else { - txt = i18n("Payment to %1").arg(acc.name()); + txt = i18n("Payment to %1").tqarg(acc.name()); } } else if(acc.accountType() == MyMoneyAccount::AssetLoan) { if(s.value().isNegative()) { - txt = i18n("Amortization of %1").arg(acc.name()); + txt = i18n("Amortization of %1").tqarg(acc.name()); } else { - txt = i18n("Payment to %1").arg(acc.name()); + txt = i18n("Payment to %1").tqarg(acc.name()); } } else { - txt = i18n("Loan payment from %1").arg(acc.name()); + txt = i18n("Loan payment from %1").tqarg(acc.name()); } } else if (file->isTransfer(*t)) { if(!s.value().isNegative()) { - txt = i18n("Transfer to %1").arg(acc.name()); + txt = i18n("Transfer to %1").tqarg(acc.name()); } else { - txt = i18n("Transfer from %1").arg(acc.name()); + txt = i18n("Transfer from %1").tqarg(acc.name()); } } else if(t->splitCount() > 2) { txt = i18n("Split transaction (category replacement)", "Split transaction"); @@ -755,7 +755,7 @@ void KPayeesView::showTransactions(void) item->setText(2, txt); item->setText(3, s.value().formatMoney(acc.fraction())); } - m_balanceLabel->setText(i18n("Balance: %1").arg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); + m_balanceLabel->setText(i18n("Balance: %1").tqarg(balance.formatMoney(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()))); // Trick: it seems, that the initial sizing of the view does // not work correctly. At least, the columns do not get displayed @@ -763,14 +763,14 @@ void KPayeesView::showTransactions(void) // is incorrect. If the widget is visible, resizing works correctly. // So, we let the dialog show up and resize it then. It's not really // clean, but the only way I got the damned thing working. - QTimer::singleShot(50, this, SLOT(rearrange())); + TQTimer::singleShot(50, this, TQT_SLOT(rearrange())); } void KPayeesView::slotKeyListChanged(void) { bool rc = false; bool ignorecase = false; - QStringList keys; + TQStringList keys; // J.Rodehueser: delete unused variable 'type' // orig: MyMoneyPayee::payeeMatchType type = m_payee.matchData(ignorecase, keys); m_payee.matchData(ignorecase, keys); @@ -801,7 +801,7 @@ void KPayeesView::slotPayeeDataChanged(void) || (!notesEdit->text().isEmpty() && m_payee.notes() != notesEdit->text())); bool ignorecase = false; - QStringList keys; + TQStringList keys; MyMoneyPayee::payeeMatchType type = m_payee.matchData(ignorecase, keys); rc |= (static_cast(type) != m_matchType->selectedId()); @@ -831,7 +831,7 @@ void KPayeesView::slotPayeeDataChanged(void) rc |= !m_payee.defaultAccountId().isEmpty(); } else { - QString temp = comboDefaultAccount->selectedAccounts().front(); + TQString temp = comboDefaultAccount->selectedAccounts().front(); rc |= ( temp.isEmpty() != m_payee.defaultAccountId().isEmpty()) || (!m_payee.defaultAccountId().isEmpty() && temp != m_payee.defaultAccountId()); } @@ -860,7 +860,7 @@ void KPayeesView::slotUpdatePayee(void) m_payee.setDefaultAccountId(); if (checkEnableDefaultAccount->isChecked()) { - QString temp; + TQString temp; if (!comboDefaultAccount->selectedAccounts().empty()) { temp = comboDefaultAccount->selectedAccounts().front(); m_payee.setDefaultAccountId(temp); @@ -872,7 +872,7 @@ void KPayeesView::slotUpdatePayee(void) } catch(MyMoneyException *e) { KMessageBox::detailedSorry(0, i18n("Unable to modify payee"), - (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line())); + (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line())); delete e; } } @@ -882,7 +882,7 @@ void KPayeesView::readConfig(void) { m_transactionView->setFont(KMyMoneyGlobalSettings::listCellFont()); - QFontMetrics fm( KMyMoneyGlobalSettings::listHeaderFont() ); + TQFontMetrics fm( KMyMoneyGlobalSettings::listHeaderFont() ); int height = fm.lineSpacing()+6; m_transactionView->header()->setMinimumHeight(height); @@ -890,7 +890,7 @@ void KPayeesView::readConfig(void) m_transactionView->header()->setFont(KMyMoneyGlobalSettings::listHeaderFont()); m_payeesList->setDefaultRenameAction( - KMyMoneyGlobalSettings::focusChangeIsEnter() ? QListView::Accept : QListView::Reject); + KMyMoneyGlobalSettings::focusChangeIsEnter() ? TQListView::Accept : TQListView::Reject); //initialize the account list? comboDefaultAccount->loadList((KMyMoneyUtils::categoryTypeE)(KMyMoneyUtils::asset | KMyMoneyUtils::liability | MyMoneyAccount::Income | MyMoneyAccount::Expense)); @@ -904,7 +904,7 @@ void KPayeesView::show(void) // If you want to learn about the details, see the source of KListViewSearchLineWidget's // constructor if(m_needConnection) { - connect(m_searchWidget->searchLine(), SIGNAL(textChanged(const QString&)), this, SLOT(slotQueueUpdate(void))); + connect(m_searchWidget->searchLine(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotQueueUpdate(void))); m_needConnection = false; } @@ -913,13 +913,13 @@ void KPayeesView::show(void) m_needReload = false; } - // fixup the layout - QTimer::singleShot(0, this, SLOT(rearrange())); + // fixup the tqlayout + TQTimer::singleShot(0, this, TQT_SLOT(rearrange())); // don't forget base class implementation KPayeesViewDecl::show(); - QValueList list; + TQValueList list; selectedPayees(list); emit selectObjects(list); } @@ -928,7 +928,7 @@ void KPayeesView::slotLoadPayees(void) { if(isVisible()) { if(m_inSelection) - QTimer::singleShot(0, this, SLOT(slotLoadPayees())); + TQTimer::singleShot(0, this, TQT_SLOT(slotLoadPayees())); else loadPayees(); } else { @@ -941,15 +941,15 @@ void KPayeesView::loadPayees(void) if(m_inSelection) return; - QMap isSelected; - QString id; + TQMap isSelected; + TQString id; ::timetrace("Start KPayeesView::loadPayees"); readConfig(); // remember which items are selected in the list - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; while((it_v = it_l.current()) != 0) { KPayeeListItem* item = dynamic_cast(it_v); if(item) @@ -963,7 +963,7 @@ void KPayeesView::loadPayees(void) id = currentItem->payee().id(); // remember the upper left corner of the viewport - QPoint startPoint = m_payeesList->viewportToContents(QPoint(0, 0)); + TQPoint startPoint = m_payeesList->viewportToContents(TQPoint(0, 0)); // turn off updates to avoid flickering during reload m_payeesList->setUpdatesEnabled(false); @@ -973,8 +973,8 @@ void KPayeesView::loadPayees(void) m_transactionView->clear(); currentItem = 0; - QValueListlist = MyMoneyFile::instance()->payeeList(); - QValueList::ConstIterator it; + TQValueListlist = MyMoneyFile::instance()->payeeList(); + TQValueList::ConstIterator it; for (it = list.begin(); it != list.end(); ++it) { KPayeeListItem* item = new KPayeeListItem(m_payeesList, *it); @@ -991,11 +991,11 @@ void KPayeesView::loadPayees(void) // reposition viewport m_payeesList->setContentsPos(startPoint.x(), startPoint.y()); - m_searchWidget->searchLine()->updateSearch(QString::null); + m_searchWidget->searchLine()->updateSearch(TQString()); // turn updates back on m_payeesList->setUpdatesEnabled(true); - m_payeesList->repaintContents(); + m_payeesList->tqrepaintContents(); slotSelectPayee(); @@ -1007,7 +1007,7 @@ void KPayeesView::rearrange(void) resizeEvent(0); } -void KPayeesView::resizeEvent(QResizeEvent* ev) +void KPayeesView::resizeEvent(TQResizeEvent* ev) { // resize the register int w = m_transactionView->visibleWidth(); @@ -1023,14 +1023,14 @@ void KPayeesView::resizeEvent(QResizeEvent* ev) KPayeesViewDecl::resizeEvent(ev); } -void KPayeesView::slotTransactionDoubleClicked(QListViewItem* i) +void KPayeesView::slotTransactionDoubleClicked(TQListViewItem* i) { KTransactionListItem* item = static_cast(i); if (item) emit transactionSelected(item->accountId(), item->transactionId()); } -void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QString& accountId, const QString& transactionId) +void KPayeesView::slotSelectPayeeAndTransaction(const TQString& payeeId, const TQString& accountId, const TQString& transactionId) { if(!isVisible()) return; @@ -1041,8 +1041,8 @@ void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QS m_searchWidget->searchLine()->updateSearch(); // deselect all other selected items - QListViewItemIterator it_l(m_payeesList, QListViewItemIterator::Selected); - QListViewItem* it_v; + TQListViewItemIterator it_l(m_payeesList, TQListViewItemIterator::Selected); + TQListViewItem* it_v; while((it_v = it_l.current()) != 0) { KPayeeListItem* item = dynamic_cast(it_v); if(item) @@ -1051,7 +1051,7 @@ void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QS } // find the payee in the list - QListViewItem* it; + TQListViewItem* it; for(it = m_payeesList->firstChild(); it; it = it->itemBelow()) { KPayeeListItem* item = dynamic_cast(it); if(item && item->payee().id() == payeeId) { @@ -1088,7 +1088,7 @@ void KPayeesView::slotSelectPayeeAndTransaction(const QString& payeeId, const QS } } -void KPayeesView::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint& p) +void KPayeesView::slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint& p) { Q_UNUSED(p); if(lv == m_payeesList) { diff --git a/kmymoney2/views/kpayeesview.h b/kmymoney2/views/kpayeesview.h index 92f98fd..f4a481e 100644 --- a/kmymoney2/views/kpayeesview.h +++ b/kmymoney2/views/kpayeesview.h @@ -29,8 +29,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -class QSplitter; +#include +class TQSplitter; // ---------------------------------------------------------------------------- // KDE Includes @@ -57,7 +57,7 @@ class KListViewSearchLineWidget; * vector is created, the sort method is set to SortPostDate. * The sort type can be changed using the method setSortType(). */ -class KTransactionPtrVector : public QPtrVector { +class KTransactionPtrVector : public TQPtrVector { public: /** * This enumerator defines the possible sort methods. @@ -111,20 +111,20 @@ public: * get information about the split referencing the current account * during the sort phase. */ - void setAccountId(const QString& id); + void setAccountId(const TQString& id); /** * This method is used to set the payee id to have a chance to * get information about the split referencing the current payee * during the sort phase. */ - void setPayeeId(const QString& id); + void setPayeeId(const TQString& id); protected: int compareItems(KTransactionPtrVector::Item d1, KTransactionPtrVector::Item d2); private: - int compareItems(const QString& s1, const QString& s2) const; + int compareItems(const TQString& s1, const TQString& s2) const; private: enum { @@ -132,7 +132,7 @@ private: PayeeMode }; short m_idMode; - QString m_id; + TQString m_id; TransactionSortE m_sortType; }; @@ -147,20 +147,20 @@ public: /** * Constructor to be used to construct a payee entry object. * - * @param parent pointer to the KListView object this entry should be + * @param tqparent pointer to the KListView object this entry should be * added to. * @param payee const reference to MyMoneyPayee for which * the KListView entry is constructed */ - KPayeeListItem(KListView *parent, const MyMoneyPayee& payee); + KPayeeListItem(KListView *tqparent, const MyMoneyPayee& payee); ~KPayeeListItem(); /** - * This method is re-implemented from QListViewItem::paintCell(). - * Besides the standard implementation, the QPainter is set + * This method is re-implemented from TQListViewItem::paintCell(). + * Besides the standard implementation, the TQPainter is set * according to the applications settings. */ - void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align); + void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align); const MyMoneyPayee& payee(void) const { return m_payee; }; @@ -175,48 +175,49 @@ private: class KTransactionListItem : public KListViewItem { public: - KTransactionListItem(KListView* view, KTransactionListItem* parent, const QString& accountId, const QString& transaction); + KTransactionListItem(KListView* view, KTransactionListItem* tqparent, const TQString& accountId, const TQString& transaction); ~KTransactionListItem(); - const QString& transactionId(void) const { return m_transactionId; }; + const TQString& transactionId(void) const { return m_transactionId; }; - const QString& accountId(void) const { return m_accountId; }; + const TQString& accountId(void) const { return m_accountId; }; /** * use my own paint method */ - void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment); + void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment); /** * use my own backgroundColor method */ - const QColor backgroundColor(); + const TQColor backgroundColor(); private: - QString m_transactionId; - QString m_accountId; + TQString m_transactionId; + TQString m_accountId; }; class KPayeesView : public KPayeesViewDecl { Q_OBJECT + TQ_OBJECT public: - KPayeesView(QWidget *parent=0, const char *name=0); + KPayeesView(TQWidget *tqparent=0, const char *name=0); ~KPayeesView(); void show(void); public slots: - void slotSelectPayeeAndTransaction(const QString& payeeId, const QString& accountId = QString(), const QString& transactionId = QString()); + void slotSelectPayeeAndTransaction(const TQString& payeeId, const TQString& accountId = TQString(), const TQString& transactionId = TQString()); void slotLoadPayees(void); void slotStartRename(void); void slotHelp(void); protected: - void resizeEvent(QResizeEvent*); + void resizeEvent(TQResizeEvent*); void loadPayees(void); - void selectedPayees(QValueList& payeesList) const; - void ensurePayeeVisible(const QString& id); + void selectedPayees(TQValueList& payeesList) const; + void ensurePayeeVisible(const TQString& id); void clearItemData(void); protected slots: @@ -244,7 +245,7 @@ protected slots: * This slot is called when the name of a payee is changed inside * the payee list view and only a single payee is selected. */ - void slotRenamePayee(QListViewItem *p, int col, const QString& txt); + void slotRenamePayee(TQListViewItem *p, int col, const TQString& txt); /** * Updates the payee data in m_payee from the information in the @@ -252,7 +253,7 @@ protected slots: */ void slotUpdatePayee(void); - void slotTransactionDoubleClicked(QListViewItem *); + void slotTransactionDoubleClicked(TQListViewItem *); private slots: void rearrange(void); @@ -265,7 +266,7 @@ private slots: * @param item the item on which the cursor resides * @param p position of the pointer device */ - void slotOpenContextMenu(KListView* lv, QListViewItem* item, const QPoint& p); + void slotOpenContextMenu(KListView* lv, TQListViewItem* item, const TQPoint& p); void slotQueueUpdate(void); @@ -277,20 +278,20 @@ private: void readConfig(void); signals: - void transactionSelected(const QString& accountId, const QString& transactionId); + void transactionSelected(const TQString& accountId, const TQString& transactionId); void openContextMenu(const MyMoneyObject& obj); - void selectObjects(const QValueList& payees); + void selectObjects(const TQValueList& payees); private: MyMoneyPayee m_payee; - QString m_newName; + TQString m_newName; - QSplitter* m_splitter; + TQSplitter* m_splitter; /** * This member holds a list of all transactions */ - QValueList m_transactionList; + TQValueList m_transactionList; /** * This member keeps a vector of pointers to all visible (filtered) diff --git a/kmymoney2/views/kpayeesviewdecl.ui b/kmymoney2/views/kpayeesviewdecl.ui index 3584e6f..0c2705e 100644 --- a/kmymoney2/views/kpayeesviewdecl.ui +++ b/kmymoney2/views/kpayeesviewdecl.ui @@ -1,6 +1,6 @@ KPayeesViewDecl - + KPayeesViewDecl @@ -19,9 +19,9 @@ 0 - + - layout10 + tqlayout10 @@ -52,7 +52,7 @@ false - + m_tabWidget @@ -64,7 +64,7 @@ 1 - + tab @@ -75,7 +75,7 @@ unnamed - + transactionGroup @@ -92,7 +92,7 @@ 6 - + Layout11 @@ -161,14 +161,14 @@ false - + m_balanceLabel Balance: - + AlignVCenter|AlignRight @@ -178,7 +178,7 @@ - + tab @@ -189,7 +189,7 @@ unnamed - + detailsGroup @@ -206,7 +206,7 @@ 6 - + TextLabel7 @@ -218,7 +218,7 @@ 0 - + 90 0 @@ -228,7 +228,7 @@ E-Mail: - + TextLabel5 @@ -240,7 +240,7 @@ 0 - + 90 0 @@ -250,7 +250,7 @@ Postal Code: - + TextLabel6 @@ -262,7 +262,7 @@ 0 - + 90 0 @@ -272,7 +272,7 @@ Telephone/Fax: - + TextLabel4_2 @@ -284,7 +284,7 @@ 0 - + 90 0 @@ -293,26 +293,26 @@ Notes - + AlignTop|AlignLeft - + postcodeEdit - + telephoneEdit - + emailEdit - + addressEdit @@ -325,7 +325,7 @@ - + notesEdit @@ -338,7 +338,7 @@ - + TextLabel4 @@ -350,7 +350,7 @@ 0 - + 90 0 @@ -359,7 +359,7 @@ Address: - + AlignTop|AlignLeft @@ -375,7 +375,7 @@ Expanding - + 21 20 @@ -384,7 +384,7 @@ - + TabPage @@ -395,14 +395,14 @@ unnamed - + buttonGroup1 Transaction Matching - + m_matchType @@ -426,7 +426,7 @@ true - + radioNoMatch @@ -445,7 +445,7 @@ true - + radioNameMatch @@ -461,7 +461,7 @@ Match on Payee name - + radioKeyMatch @@ -498,7 +498,7 @@ This list contains the names that will match this payee if a transaction is imported from an external source. Keep in mind, that you can specify regular expressions here. - + checkMatchIgnoreCase @@ -516,7 +516,7 @@ Expanding - + 20 20 @@ -525,7 +525,7 @@ - + TabPage2 @@ -536,7 +536,7 @@ unnamed - + checkEnableDefaultAccount @@ -545,15 +545,15 @@ new transactions with this payee - + - layout5 + tqlayout5 unnamed - + labelDefaultAccount @@ -586,7 +586,7 @@ new transactions with this payee Expanding - + 20 31 @@ -598,9 +598,9 @@ new transactions with this payee - + - layout10 + tqlayout10 @@ -632,7 +632,7 @@ new transactions with this payee Expanding - + 260 21 @@ -662,5 +662,5 @@ new transactions with this payee ../widgets/kmymoneyaccountcombo.h - + diff --git a/kmymoney2/views/kreportsview.cpp b/kmymoney2/views/kreportsview.cpp index 6c7da52..36de4c9 100755 --- a/kmymoney2/views/kreportsview.cpp +++ b/kmymoney2/views/kreportsview.cpp @@ -30,22 +30,22 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -86,12 +86,12 @@ using namespace reports; * KReportsView::KReportTab Implementation */ -KReportsView::KReportTab::KReportTab(KTabWidget* parent, const MyMoneyReport& report ): - QWidget( parent, "reporttab" ), +KReportsView::KReportTab::KReportTab(KTabWidget* tqparent, const MyMoneyReport& report ): + TQWidget( tqparent, "reporttab" ), m_part( new KHTMLPart( this, "reporttabpart" ) ), m_chartView( new KReportChartView( this, "reportchart" ) ), m_control( new kMyMoneyReportControlDecl( this, "reportcontrol" ) ), - m_layout( new QVBoxLayout( this, 11, 6, "reporttablayout" ) ), + m_layout( new TQVBoxLayout( this, 11, 6, "reporttabtqlayout" ) ), m_report( report ), m_deleteMe( false ), m_showingChart( false ), @@ -105,20 +105,20 @@ KReportsView::KReportTab::KReportTab(KTabWidget* parent, const MyMoneyReport& re m_control->buttonChart->hide(); } - m_chartView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + m_chartView->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); m_chartView->hide(); - m_layout->addWidget( m_control ); //, 0, Qt::AlignTop ); + m_layout->addWidget( m_control ); //, 0, TQt::AlignTop ); m_layout->addWidget( m_part->view() ); m_layout->addWidget( m_chartView ); // I like this icon... - QString icon = KGlobal::dirs()->findResource("icon", "default.kde/16x16/mimetypes/spreadsheet.png"); + TQString icon = KGlobal::dirs()->findResource("icon", "default.kde/16x16/mimetypes/spreadsheet.png"); // but if it's not there, we'll use ye ol' standard icon - if ( icon == QString::null ) + if ( icon == TQString() ) icon = KGlobal::dirs()->findResource("icon", "hicolor/16x16/apps/kmymoney2.png"); - parent->insertTab( this, QIconSet(QPixmap(icon)), report.name() ); - parent->setTabEnabled( this, true ); + tqparent->insertTab( this, TQIconSet(TQPixmap(icon)), report.name() ); + tqparent->setTabEnabled( this, true ); #ifdef HAVE_KDCHART if ( m_report.isChartByDefault() ) @@ -139,29 +139,29 @@ void KReportsView::KReportTab::print(void) void KReportsView::KReportTab::copyToClipboard(void) { - QTextDrag* pdrag = new QTextDrag( createTable() ); + TQTextDrag* pdrag = new TQTextDrag( createTable() ); pdrag->setSubtype("html"); - QApplication::clipboard()->setData(pdrag); + TQApplication::tqclipboard()->setData(pdrag); } -void KReportsView::KReportTab::saveAs( const QString& filename, bool includeCSS ) +void KReportsView::KReportTab::saveAs( const TQString& filename, bool includeCSS ) { - QFile file( filename ); + TQFile file( filename ); if ( file.open( IO_WriteOnly ) ) { - if ( QFileInfo(filename).extension(false).lower() == "csv") + if ( TQFileInfo(filename).extension(false).lower() == "csv") { - QTextStream(&file) << m_table->renderCSV(); + TQTextStream(&file) << m_table->renderCSV(); } else { - QTextStream stream(&file); + TQTextStream stream(&file); - QRegExp exp(QString("(.*)(()(.*)").arg(KGlobal::locale()->encoding())); - QString table = createTable(); + TQRegExp exp(TQString("(.*)(()(.*)").tqarg(KGlobal::locale()->encoding())); + TQString table = createTable(); if(exp.search(table) != -1 && includeCSS) { - QFile cssFile(exp.cap(3)); + TQFile cssFile(exp.cap(3)); if(cssFile.open(IO_ReadOnly)) { - QTextStream cssStream(&cssFile); + TQTextStream cssStream(&cssFile); stream << exp.cap(1); stream << exp.cap(4); stream << endl << "