diff options
Diffstat (limited to 'kmymoney2/views/kinstitutionsview.cpp')
-rw-r--r-- | kmymoney2/views/kinstitutionsview.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
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 <qheader.h> -#include <qlabel.h> -#include <qtabwidget.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqtabwidget.h> // ---------------------------------------------------------------------------- // 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<QString, bool> isOpen; + TQMap<TQString, bool> 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<KMyMoneyAccountTreeItem*>(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<MyMoneyAccount> alist; + TQValueList<MyMoneyAccount> alist; file->accountList(alist); - QValueList<MyMoneyAccount>::const_iterator it_a; + TQValueList<MyMoneyAccount>::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<QString, MyMoneyAccount>::iterator it_am; + // under the right institution (the one of the tqparent account) + TQMap<TQString, MyMoneyAccount>::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<MyMoneySecurity> slist = file->currencyList(); + TQValueList<MyMoneySecurity> slist = file->currencyList(); slist += file->securityList(); - QValueList<MyMoneySecurity>::const_iterator it_s; + TQValueList<MyMoneySecurity>::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<MyMoneyInstitution> list = file->institutionList(); - QValueList<MyMoneyInstitution>::const_iterator it_i; + TQValueList<MyMoneyInstitution> list = file->institutionList(); + TQValueList<MyMoneyInstitution>::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<KMyMoneyAccountTreeItem*>(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<const MyMoneyAccount&>(parent->itemObject()); - QValueList<QString>::const_iterator it_a; + const MyMoneyAccount& account = dynamic_cast<const MyMoneyAccount&>(tqparent->itemObject()); + TQValueList<TQString>::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<MyMoneyPrice> prices; + TQValueList<MyMoneyPrice> 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<QString, MyMoneyAccount>::const_iterator it_a; + TQMap<TQString, MyMoneyAccount>::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<MyMoneyPrice> prices; + TQValueList<MyMoneyPrice> 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<KMyMoneyAccountTreeItem*>(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 += "<b><font color=\"red\">"; } 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 += "</font></b>"; } @@ -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<KMyMoneyAccountTreeItem*>(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<KMyMoneyAccountTreeItem*>(it_lvi.current()); if(item && item->itemObject().id() == acc.id()) { |