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/views/kscheduledview.cpp | 118 ++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'kmymoney2/views/kscheduledview.cpp') diff --git a/kmymoney2/views/kscheduledview.cpp b/kmymoney2/views/kscheduledview.cpp index 42c09db..7f6ebe0 100644 --- a/kmymoney2/views/kscheduledview.cpp +++ b/kmymoney2/views/kscheduledview.cpp @@ -23,12 +23,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -55,15 +55,15 @@ #include "../kmymoney2.h" -KScheduledView::KScheduledView(QWidget *parent, const char *name ) : - KScheduledViewDecl(parent,name, false), +KScheduledView::KScheduledView(TQWidget *tqparent, const char *name ) : + KScheduledViewDecl(tqparent,name, false), m_openBills(true), m_openDeposits(true), m_openTransfers(true), m_openLoans(true) { // create the searchline widget - // and insert it into the existing layout + // and insert it into the existing tqlayout m_searchWidget = new KListViewSearchLineWidget(m_qlistviewScheduled, m_listTab); m_listTabLayout->insertWidget(0, m_searchWidget); @@ -74,7 +74,7 @@ KScheduledView::KScheduledView(QWidget *parent, const char *name ) : m_qlistviewScheduled->addColumn(i18n("Next Due Date")); m_qlistviewScheduled->addColumn(i18n("Frequency")); m_qlistviewScheduled->addColumn(i18n("Payment Method")); - m_qlistviewScheduled->setColumnAlignment(3, Qt::AlignRight); + m_qlistviewScheduled->setColumnAlignment(3, TQt::AlignRight); readConfig(); @@ -83,37 +83,37 @@ KScheduledView::KScheduledView(QWidget *parent, const char *name ) : if(m_qlistviewScheduled->sortColumn() == -1) m_qlistviewScheduled->setSorting(0); - connect(m_qbuttonNew, SIGNAL(clicked()), kmymoney2->action("schedule_new"), SLOT(activate())); + connect(m_qbuttonNew, TQT_SIGNAL(clicked()), kmymoney2->action("schedule_new"), TQT_SLOT(activate())); // attach popup to 'Filter...' button m_kaccPopup = new KPopupMenu(this); m_kaccPopup->setCheckable(true); m_accountsCombo->setPopup(m_kaccPopup); - connect(m_kaccPopup, SIGNAL(activated(int)), this, SLOT(slotAccountActivated(int))); + connect(m_kaccPopup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotAccountActivated(int))); m_qbuttonNew->setGuiItem(KMyMoneyUtils::scheduleNewGuiItem()); m_accountsCombo->setGuiItem(KMyMoneyUtils::accountsFilterGuiItem()); KIconLoader *il = KGlobal::iconLoader(); - m_tabWidget->setTabIconSet(m_listTab, QIconSet(il->loadIcon("contents", KIcon::Small, KIcon::SizeSmall))); - m_tabWidget->setTabIconSet(m_calendarTab, QIconSet(il->loadIcon("calendartab", KIcon::User, KIcon::SizeSmall))); + m_tabWidget->setTabIconSet(m_listTab, TQIconSet(il->loadIcon("contents", KIcon::Small, KIcon::SizeSmall))); + m_tabWidget->setTabIconSet(m_calendarTab, TQIconSet(il->loadIcon("calendartab", KIcon::User, KIcon::SizeSmall))); - connect(m_qlistviewScheduled, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotListViewContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(m_qlistviewScheduled, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(slotSetSelectedItem(QListViewItem*))); + connect(m_qlistviewScheduled, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + this, TQT_SLOT(slotListViewContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(m_qlistviewScheduled, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(slotSetSelectedItem(TQListViewItem*))); - connect(m_qlistviewScheduled, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), - this, SLOT(slotListItemExecuted(QListViewItem*, const QPoint&, int))); - connect(m_qlistviewScheduled, SIGNAL(expanded(QListViewItem*)), - this, SLOT(slotListViewExpanded(QListViewItem*))); - connect(m_qlistviewScheduled, SIGNAL(collapsed(QListViewItem*)), - this, SLOT(slotListViewCollapsed(QListViewItem*))); + connect(m_qlistviewScheduled, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(slotListItemExecuted(TQListViewItem*, const TQPoint&, int))); + connect(m_qlistviewScheduled, TQT_SIGNAL(expanded(TQListViewItem*)), + this, TQT_SLOT(slotListViewExpanded(TQListViewItem*))); + connect(m_qlistviewScheduled, TQT_SIGNAL(collapsed(TQListViewItem*)), + this, TQT_SLOT(slotListViewCollapsed(TQListViewItem*))); - connect(m_calendar, SIGNAL(enterClicked(const MyMoneySchedule&, const QDate&)), this, SLOT(slotBriefEnterClicked(const MyMoneySchedule&, const QDate&))); - connect(m_calendar, SIGNAL(skipClicked(const MyMoneySchedule&, const QDate&)), this, SLOT(slotBriefSkipClicked(const MyMoneySchedule&, const QDate&))); + connect(m_calendar, TQT_SIGNAL(enterClicked(const MyMoneySchedule&, const TQDate&)), this, TQT_SLOT(slotBriefEnterClicked(const MyMoneySchedule&, const TQDate&))); + connect(m_calendar, TQT_SIGNAL(skipClicked(const MyMoneySchedule&, const TQDate&)), this, TQT_SLOT(slotBriefSkipClicked(const MyMoneySchedule&, const TQDate&))); - connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotReloadView())); + connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadView())); } KScheduledView::~KScheduledView() @@ -121,11 +121,11 @@ KScheduledView::~KScheduledView() writeConfig(); } -void KScheduledView::refresh(bool full, const QString& schedId) +void KScheduledView::refresh(bool full, const TQString& schedId) { m_qlistviewScheduled->header()->setFont(KMyMoneyGlobalSettings::listHeaderFont()); - QPoint startPoint = QPoint(m_qlistviewScheduled->contentsX(), m_qlistviewScheduled->contentsY()); + TQPoint startPoint = TQPoint(m_qlistviewScheduled->contentsX(), m_qlistviewScheduled->contentsY()); m_qlistviewScheduled->clear(); @@ -141,7 +141,7 @@ void KScheduledView::refresh(bool full, const QString& schedId) MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount acc; - QStringList::ConstIterator it_s; + TQStringList::ConstIterator it_s; acc = file->asset(); for(it_s = acc.accountList().begin(); it_s != acc.accountList().end(); ++it_s) @@ -163,7 +163,7 @@ void KScheduledView::refresh(bool full, const QString& schedId) m_calendar->refresh(); MyMoneyFile *file = MyMoneyFile::instance(); - QValueList scheduledItems = file->scheduleList(); + TQValueList scheduledItems = file->scheduleList(); if (scheduledItems.count() == 0) return; @@ -173,7 +173,7 @@ void KScheduledView::refresh(bool full, const QString& schedId) KScheduledListItem *itemLoans = new KScheduledListItem(m_qlistviewScheduled, i18n("Loans"), KMyMoneyUtils::transferScheduleIcon(KIcon::Small), "2"); KScheduledListItem *itemTransfers = new KScheduledListItem(m_qlistviewScheduled, i18n("Transfers"), KMyMoneyUtils::transferScheduleIcon(KIcon::Small), "3"); - QValueList::Iterator it; + TQValueList::Iterator it; KScheduledListItem *openItem=0; @@ -183,7 +183,7 @@ void KScheduledView::refresh(bool full, const QString& schedId) KScheduledListItem* item=0; bool bContinue=true; - QStringList::iterator accIt; + TQStringList::iterator accIt; for (accIt=m_filterAccounts.begin(); accIt!=m_filterAccounts.end(); ++accIt) { if (*accIt == schedData.account().id()) @@ -196,7 +196,7 @@ void KScheduledView::refresh(bool full, const QString& schedId) if (!bContinue) continue; - KScheduledListItem* parent = 0; + KScheduledListItem* tqparent = 0; switch (schedData.type()) { case MyMoneySchedule::TYPE_ANY: @@ -204,25 +204,25 @@ void KScheduledView::refresh(bool full, const QString& schedId) // We just sort it as bill and fall through here case MyMoneySchedule::TYPE_BILL: - parent = itemBills; + tqparent = itemBills; break; case MyMoneySchedule::TYPE_DEPOSIT: - parent = itemDeposits; + tqparent = itemDeposits; break; case MyMoneySchedule::TYPE_TRANSFER: - parent = itemTransfers; + tqparent = itemTransfers; break; case MyMoneySchedule::TYPE_LOANPAYMENT: - parent = itemLoans; + tqparent = itemLoans; break; } - if(parent) { + if(tqparent) { if(!KMyMoneyGlobalSettings::hideFinishedSchedules() || !schedData.isFinished()) { - item = new KScheduledListItem(parent, schedData); + item = new KScheduledListItem(tqparent, schedData); if (schedData.id() == schedId) openItem = item; } @@ -237,11 +237,11 @@ void KScheduledView::refresh(bool full, const QString& schedId) // working when coming from hidden form to visible form. I assume, this // has something to do with the delayed update of the display somehow. resize(width(), height()-1); - QTimer::singleShot(10, this, SLOT(slotTimerDone())); + TQTimer::singleShot(10, this, TQT_SLOT(slotTimerDone())); m_qlistviewScheduled->update(); - // force repaint in case the filter is set - m_searchWidget->searchLine()->updateSearch(QString::null); + // force tqrepaint in case the filter is set + m_searchWidget->searchLine()->updateSearch(TQString()); if (m_openBills) itemBills->setOpen(true); @@ -266,16 +266,16 @@ void KScheduledView::refresh(bool full, const QString& schedId) void KScheduledView::slotTimerDone(void) { - QListViewItem* item; + TQListViewItem* item; item = m_qlistviewScheduled->selectedItem(); if(item) { m_qlistviewScheduled->ensureItemVisible(item); } - // force a repaint of all items to update the branches + // force a tqrepaint of all items to update the branches for(item = m_qlistviewScheduled->firstChild(); item != 0; item = item->itemBelow()) { - m_qlistviewScheduled->repaintItem(item); + m_qlistviewScheduled->tqrepaintItem(item); } resize(width(), height()+1); } @@ -290,7 +290,7 @@ void KScheduledView::slotReloadView(void) refresh(true, m_selectedSchedule); m_needReload = false; - QTimer::singleShot(50, this, SLOT(slotRearrange())); + TQTimer::singleShot(50, this, TQT_SLOT(slotRearrange())); } } @@ -304,7 +304,7 @@ void KScheduledView::show() void KScheduledView::slotRearrange(void) { - resizeEvent(0); + resizeEvent((TQResizeEvent*)0); } void KScheduledView::readConfig(void) @@ -336,14 +336,14 @@ void KScheduledView::writeConfig(void) m_qlistviewScheduled->saveLayout(KGlobal::config(), "Schedule View Settings"); } -void KScheduledView::slotListViewContextMenu(KListView* /* view */, QListViewItem *item, const QPoint& /* pos */) +void KScheduledView::slotListViewContextMenu(KListView* /* view */, TQListViewItem *item, const TQPoint& /* pos */) { KScheduledListItem *scheduleItem = dynamic_cast(item); if (scheduleItem) { try { - QString scheduleId = scheduleItem->scheduleId(); + TQString scheduleId = scheduleItem->scheduleId(); if (!scheduleId.isEmpty()) // Top level item { @@ -364,7 +364,7 @@ void KScheduledView::slotListViewContextMenu(KListView* /* view */, QListViewIte } } -void KScheduledView::slotListItemExecuted(QListViewItem* item, const QPoint&, int) +void KScheduledView::slotListItemExecuted(TQListViewItem* item, const TQPoint&, int) { KScheduledListItem* scheduleItem = (KScheduledListItem*)item; if (!scheduleItem) @@ -372,7 +372,7 @@ void KScheduledView::slotListItemExecuted(QListViewItem* item, const QPoint&, in try { - QString scheduleId = scheduleItem->scheduleId(); + TQString scheduleId = scheduleItem->scheduleId(); if (!scheduleId.isEmpty()) // Top level item { @@ -398,7 +398,7 @@ void KScheduledView::slotAccountActivated(int id) int accountCount=0; MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount acc; - QStringList::ConstIterator it_s; + TQStringList::ConstIterator it_s; acc = file->asset(); for(it_s = acc.accountList().begin(); it_s != acc.accountList().end(); ++it_s) @@ -421,7 +421,7 @@ void KScheduledView::slotAccountActivated(int id) } } -void KScheduledView::slotListViewExpanded(QListViewItem* item) +void KScheduledView::slotListViewExpanded(TQListViewItem* item) { KScheduledListItem *scheduleItem = (KScheduledListItem*)item; if (scheduleItem) @@ -437,7 +437,7 @@ void KScheduledView::slotListViewExpanded(QListViewItem* item) } } -void KScheduledView::slotListViewCollapsed(QListViewItem* item) +void KScheduledView::slotListViewCollapsed(TQListViewItem* item) { KScheduledListItem *scheduleItem = (KScheduledListItem*)item; if (scheduleItem) @@ -453,12 +453,12 @@ void KScheduledView::slotListViewCollapsed(QListViewItem* item) } } -void KScheduledView::slotSelectSchedule(const QString& schedule) +void KScheduledView::slotSelectSchedule(const TQString& schedule) { refresh(true, schedule); } -void KScheduledView::slotBriefEnterClicked(const MyMoneySchedule& schedule, const QDate& date) +void KScheduledView::slotBriefEnterClicked(const MyMoneySchedule& schedule, const TQDate& date) { Q_UNUSED(date); @@ -466,7 +466,7 @@ void KScheduledView::slotBriefEnterClicked(const MyMoneySchedule& schedule, cons emit enterSchedule(); } -void KScheduledView::slotBriefSkipClicked(const MyMoneySchedule& schedule, const QDate& date) +void KScheduledView::slotBriefSkipClicked(const MyMoneySchedule& schedule, const TQDate& date) { Q_UNUSED(date); @@ -474,7 +474,7 @@ void KScheduledView::slotBriefSkipClicked(const MyMoneySchedule& schedule, const emit skipSchedule(); } -void KScheduledView::slotSetSelectedItem(QListViewItem* item) +void KScheduledView::slotSetSelectedItem(TQListViewItem* item) { emit scheduleSelected(MyMoneySchedule()); KScheduledListItem* schedItem = static_cast(item); -- cgit v1.2.1