1
/* This file is part of the KDE project
2
Copyright (C) 2002-2003 Lucijan Busch <lucijan@gmx.at>
3
Copyright (C) 2003-2004 Jarosław Staniek <staniek@kde.org>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
21
#include "KexiProjectListViewItem.h"
23
#include <core/kexipartinfo.h>
26
#include <kiconloader.h>
28
KexiProjectListViewItem::KexiProjectListViewItem(K3ListView *parent, KexiPart::Info *i)
29
: K3ListViewItem(parent, i->groupName())
33
setPixmap(0, SmallIcon(i->itemIcon()));
35
//ugly setSelectable(false);
37
m_fifoSorting = 1; //because this is top level item
40
KexiProjectListViewItem::KexiProjectListViewItem(K3ListViewItem *parent, KexiPart::Info *i, KexiPart::Item *item)
41
: K3ListViewItem(parent, item->name())
45
setPixmap(0, SmallIcon(i->itemIcon()));
49
KexiProjectListViewItem::KexiProjectListViewItem(K3ListView *parent, KexiPart::Info *i, KexiPart::Item *item)
50
: K3ListViewItem(parent, item->name())
54
setPixmap(0, SmallIcon(i->itemIcon()));
58
KexiProjectListViewItem::~KexiProjectListViewItem()
62
void KexiProjectListViewItem::initItem()
66
// set sorting key with FIFO order
68
sortKey = parent()->childCount();
69
} else if (listView()) {
70
sortKey = listView()->childCount();
72
m_sortKey.sprintf("%2.2d", sortKey);
73
// kDebug() << "m_sortKey=" << m_sortKey;
77
KexiProjectListViewItem::clearChildren()
79
KexiProjectListViewItem* child;
81
while ((child = static_cast<KexiProjectListViewItem*>(firstChild()))) {
86
QString KexiProjectListViewItem::key(int column, bool ascending) const
88
// kDebug() << "KexiBrowserItem::key() : " << (m_fifoSorting ? m_sortKey : K3ListViewItem::key(column,ascending));
89
return m_fifoSorting ? m_sortKey : K3ListViewItem::key(column, ascending);