From 89d8c2baa9b51d8da8511a54b9962155aa29c4c0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 17:25:32 -0600 Subject: Fix FTBFS --- kmymoney2/widgets/kmymoneychecklistitem.cpp | 151 ---------------------------- 1 file changed, 151 deletions(-) delete mode 100644 kmymoney2/widgets/kmymoneychecklistitem.cpp (limited to 'kmymoney2/widgets/kmymoneychecklistitem.cpp') diff --git a/kmymoney2/widgets/kmymoneychecklistitem.cpp b/kmymoney2/widgets/kmymoneychecklistitem.cpp deleted file mode 100644 index b292567..0000000 --- a/kmymoney2/widgets/kmymoneychecklistitem.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/*************************************************************************** - kmymoneychecklistitem - ------------------- - begin : Wed Jun 28 2006 - copyright : (C) 2006 by Thomas Baumgart - email : Thomas Baumgart - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -// ---------------------------------------------------------------------------- -// QT Includes - -#include -#include - -// ---------------------------------------------------------------------------- -// KDE Includes - -// ---------------------------------------------------------------------------- -// Project Includes - -#include "kmymoneychecklistitem.h" -#include "kmymoneylistviewitem.h" -#include "../kmymoneyglobalsettings.h" - -KMyMoneyCheckListItem::KMyMoneyCheckListItem(TQListView* parent, const TQString& txt, const TQString& key, const TQString& id, Type type) : - TQCheckListItem(parent, txt, type), - m_key(key), - m_id(id), - m_isOdd(0), - m_isKnown(0) -{ - setOn(true); - if(key.isEmpty()) - m_key = txt; -} - -KMyMoneyCheckListItem::KMyMoneyCheckListItem(TQListViewItem* parent, const TQString& txt, const TQString& key, const TQString& id, Type type) : - TQCheckListItem(parent, txt, type), - m_key(key), - m_id(id), - m_isOdd(0), - m_isKnown(0) -{ - setOn(true); - if(key.isEmpty()) - m_key = txt; -} - -KMyMoneyCheckListItem::KMyMoneyCheckListItem(TQListView* parent, TQListViewItem* after, const TQString& txt, const TQString& key, const TQString& id, Type type) : - TQCheckListItem(parent, after, txt, type), - m_key(key), - m_id(id), - m_isOdd(0), - m_isKnown(0) -{ - setOn(true); - if(key.isEmpty()) - m_key = txt; -} - -KMyMoneyCheckListItem::~KMyMoneyCheckListItem() -{ -} - -TQString KMyMoneyCheckListItem::key(int column, bool ascending) const -{ - Q_UNUSED(ascending); - - if(column == 0) - return m_key[0] + text(0); - return m_key.mid(1); -} - -void KMyMoneyCheckListItem::stateChange(bool state) -{ - emit stateChanged(state); -} - -void KMyMoneyCheckListItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int alignment) -{ - TQColorGroup _cg = cg; - _cg.setColor(TQColorGroup::Base, backgroundColor()); - - // write the groups in bold - TQFont f = p->font(); - f.setBold(!isSelectable()); - p->setFont(f); - - TQCheckListItem::paintCell(p, _cg, column, width, alignment); -} - -const TQColor KMyMoneyCheckListItem::backgroundColor() -{ - return isAlternate() ? KMyMoneyGlobalSettings::listBGColor() : KMyMoneyGlobalSettings::listColor(); -} - -bool KMyMoneyCheckListItem::isAlternate(void) -{ -// logic taken from TDEListViewItem::isAlternate() - KMyMoneyCheckListItem* ciAbove; - KMyMoneyListViewItem* liAbove; - ciAbove = dynamic_cast (itemAbove()); - liAbove = dynamic_cast (itemAbove()); - - m_isKnown = ciAbove ? ciAbove->m_isKnown : (liAbove ? liAbove->m_isKnown : true); - if(m_isKnown) { - m_isOdd = ciAbove ? !ciAbove->m_isOdd : (liAbove ? !liAbove->m_isOdd : false); - } else { - KMyMoneyCheckListItem* clItem; - KMyMoneyListViewItem* liItem; - bool previous = true; - if(TQListViewItem::parent()) { - clItem = dynamic_cast(TQListViewItem::parent()); - liItem = dynamic_cast(TQListViewItem::parent()); - if(clItem) - previous = clItem->m_isOdd; - else - previous = liItem->m_isOdd; - clItem = dynamic_cast(TQListViewItem::parent()->firstChild()); - liItem = dynamic_cast(TQListViewItem::parent()->firstChild()); - } else { - clItem = dynamic_cast(listView()->firstChild()); - liItem = dynamic_cast(listView()->firstChild()); - } - while(clItem || liItem) { - if(clItem) { - clItem->m_isOdd = previous = !previous; - clItem->m_isKnown = true; - liItem = dynamic_cast(clItem->nextSibling()); - clItem = dynamic_cast(clItem->nextSibling()); - } else if(liItem) { - liItem->m_isOdd = previous = !previous; - liItem->m_isKnown = true; - clItem = dynamic_cast(liItem->nextSibling()); - liItem = dynamic_cast(liItem->nextSibling()); - } - } - } - return m_isOdd; -} - -#include "kmymoneychecklistitem.moc" -- cgit v1.2.1