00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#include <kdebug.h>
00021
#include <kfileitem.h>
00022
#include <kicontheme.h>
00023
00024
#include "kfiletreeviewitem.h"
00025
00026
00027
00028
00029 KFileTreeViewItem::KFileTreeViewItem(
KFileTreeViewItem *parent,
00030
KFileItem* item,
00031
KFileTreeBranch *brnch )
00032 :
KListViewItem( parent ),
00033 m_kfileitem( item ),
00034 m_branch( brnch ),
00035 m_wasListed(false)
00036 {
00037 setPixmap(0, item->
pixmap( KIcon::SizeSmall ));
00038 setText( 0, item->
text());
00039
00040 }
00041
00042 KFileTreeViewItem::KFileTreeViewItem(
KFileTreeView* parent,
00043
KFileItem* item,
00044
KFileTreeBranch *brnch )
00045 :
KListViewItem( (
QListView*)parent ),
00046 m_kfileitem(item ),
00047 m_branch( brnch ),
00048 m_wasListed(false)
00049 {
00050 setPixmap(0, item->
pixmap( KIcon::SizeSmall ));
00051 setText( 0, item->
text());
00052 }
00053
00054 KFileTreeViewItem::~KFileTreeViewItem()
00055 {
00056
if ( m_kfileitem )
00057 m_kfileitem->
removeExtraData( m_branch );
00058 }
00059
00060 bool KFileTreeViewItem::alreadyListed()
const
00061
{
00062
return m_wasListed;
00063 }
00064
00065 void KFileTreeViewItem::setListed(
bool wasListed )
00066 {
00067 m_wasListed = wasListed;
00068 }
00069
00070 KURL KFileTreeViewItem::url()
const
00071
{
00072
return m_kfileitem ? m_kfileitem->
url() :
KURL();
00073 }
00074
00075 QString KFileTreeViewItem::path() const
00076 {
00077
return m_kfileitem ? m_kfileitem->
url().
path() : QString::null;
00078 }
00079
00080 bool KFileTreeViewItem::isDir()
const
00081
{
00082
return m_kfileitem ? m_kfileitem->
isDir() :
false;
00083 }