kmail

kmfoldernode.cpp
1 // kmfoldernode.cpp
2 
3 #ifdef HAVE_CONFIG_H
4 #include <config.h>
5 #endif
6 
7 #include "kmfolderdir.h"
8 
9 //-----------------------------------------------------------------------------
10 KMFolderNode::KMFolderNode( KMFolderDir * parent, const TQString & name )
11  : mName( name ),
12  mParent( parent ),
13  mDir( false ),
14  mId( 0 )
15 {
16 }
17 
18 
19 //-----------------------------------------------------------------------------
20 KMFolderNode::~KMFolderNode()
21 {
22 }
23 
24 //-----------------------------------------------------------------------------
25 bool KMFolderNode::isDir(void) const
26 {
27  return mDir;
28 }
29 
30 
31 //-----------------------------------------------------------------------------
32 TQString KMFolderNode::path() const
33 {
34  if (parent()) return parent()->path();
35  return TQString();
36 }
37 
38 //-----------------------------------------------------------------------------
39 TQString KMFolderNode::label(void) const
40 {
41  return name();
42 }
43 
44 //-----------------------------------------------------------------------------
45 KMFolderDir* KMFolderNode::parent(void) const
46 {
47  return mParent;
48 }
49 
50 //-----------------------------------------------------------------------------
51 void KMFolderNode::setParent( KMFolderDir* aParent )
52 {
53  mParent = aParent;
54 }
55 
56 //-----------------------------------------------------------------------------
57 uint KMFolderNode::id() const
58 {
59  if (mId > 0)
60  return mId;
61  // compatibility, returns 0 on error
62  return name().toUInt();
63 }
64 
65 #include "kmfoldernode.moc"
KMail list that manages the contents of one directory that may contain folders and/or other directori...
Definition: kmfolderdir.h:16