• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • sources
  • kde-4.14
  • kdelibs
  • kde3support
  • kio
  • kfile
k3filetreeviewitem.cpp
Go to the documentation of this file.
1 /* This file is part of the KDEproject
2  Copyright (C) 2000 David Faure <faure@kde.org>
3  2000 Carsten Pfeiffer <pfeiffer@kde.org>
4 
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 version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "k3filetreeviewitem.h"
21 
22 #include <kdebug.h>
23 #include <kfileitem.h>
24 #include <kicontheme.h>
25 
26 /* --- K3FileTreeViewItem --- */
27 /*
28  */
29 K3FileTreeViewItem::K3FileTreeViewItem( K3FileTreeViewItem *parent,
30  const KFileItem &item,
31  KFileTreeBranch *brnch )
32  : K3ListViewItem( parent ),
33  m_kfileitem( item ),
34  m_branch( brnch ),
35  m_wasListed(false)
36 {
37  setPixmap(0, item.pixmap( KIconLoader::SizeSmall ));
38  setText( 0, item.text());
39 
40  m_kfileitem.setExtraData( m_branch, this );
41 }
42 
43 K3FileTreeViewItem::K3FileTreeViewItem( K3FileTreeView* parent,
44  const KFileItem &item,
45  KFileTreeBranch *brnch )
46  :K3ListViewItem( (Q3ListView*)parent ),
47  m_kfileitem(item ),
48  m_branch( brnch ),
49  m_wasListed(false)
50 {
51  setPixmap(0, item.pixmap( KIconLoader::SizeSmall ));
52  setText( 0, item.text());
53 
54  m_kfileitem.setExtraData( m_branch, this );
55 }
56 
57 K3FileTreeViewItem::~K3FileTreeViewItem()
58 {
59  if ( !m_kfileitem.isNull() )
60  m_kfileitem.removeExtraData( m_branch );
61 }
62 
63 bool K3FileTreeViewItem::alreadyListed() const
64 {
65  return m_wasListed;
66 }
67 
68 void K3FileTreeViewItem::setListed( bool wasListed )
69 {
70  m_wasListed = wasListed;
71 }
72 
73 KUrl K3FileTreeViewItem::url() const
74 {
75  return !m_kfileitem.isNull() ? m_kfileitem.url() : KUrl();
76 }
77 
78 QString K3FileTreeViewItem::path() const
79 {
80  return !m_kfileitem.isNull() ? m_kfileitem.url().path() : QString();
81 }
82 
83 bool K3FileTreeViewItem::isDir() const
84 {
85  return !m_kfileitem.isNull() ? m_kfileitem.isDir() : false;
86 }
KFileItem::isDir
bool isDir() const
kdebug.h
KFileItem::setExtraData
void setExtraData(const void *key, void *value)
KFileItem::isNull
bool isNull() const
KFileItem::removeExtraData
void removeExtraData(const void *key)
KFileTreeBranch
This is the branch class of the K3FileTreeView, which represents one branch in the treeview...
Definition: kfiletreebranch.h:49
K3FileTreeViewItem::~K3FileTreeViewItem
~K3FileTreeViewItem()
Definition: k3filetreeviewitem.cpp:57
KUrl
K3ListViewItem
A listview item with support for alternate background colors.
Definition: k3listview.h:986
Q3ListViewItem::setText
virtual void setText(int column, const QString &text)
K3FileTreeViewItem::setListed
void setListed(bool wasListed)
set the flag if the directory was already listed.
Definition: k3filetreeviewitem.cpp:68
K3FileTreeViewItem::alreadyListed
bool alreadyListed() const
Definition: k3filetreeviewitem.cpp:63
k3filetreeviewitem.h
K3FileTreeViewItem::isDir
bool isDir() const
Definition: k3filetreeviewitem.cpp:83
QString
KUrl::path
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const
KFileItem::text
QString text() const
kicontheme.h
K3FileTreeViewItem
An item for a K3FileTreeView that knows about its own KFileItem.
Definition: k3filetreeviewitem.h:41
KIconLoader::SizeSmall
K3FileTreeView
The filetreeview offers a treeview on the file system which behaves like a QTreeView showing files an...
Definition: k3filetreeview.h:53
K3FileTreeViewItem::K3FileTreeViewItem
K3FileTreeViewItem(K3FileTreeViewItem *, const KFileItem &, KFileTreeBranch *)
Definition: k3filetreeviewitem.cpp:29
K3FileTreeViewItem::url
KUrl url() const
Definition: k3filetreeviewitem.cpp:73
Q3ListViewItem::setPixmap
virtual void setPixmap(int column, const QPixmap &pm)
K3FileTreeViewItem::path
QString path() const
Definition: k3filetreeviewitem.cpp:78
kfileitem.h
KFileItem::url
KUrl url() const
KFileItem
Q3ListView
KFileItem::pixmap
QPixmap pixmap(int _size, int _state=0) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:47 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal