kmail
kmfoldernode.cpp
Go to the documentation of this file.00001 // kmfoldernode.cpp 00002 00003 #ifdef HAVE_CONFIG_H 00004 #include <config.h> 00005 #endif 00006 00007 #include "kmfolderdir.h" 00008 00009 //----------------------------------------------------------------------------- 00010 KMFolderNode::KMFolderNode( KMFolderDir * parent, const QString & name ) 00011 : mName( name ), 00012 mParent( parent ), 00013 mDir( false ), 00014 mId( 0 ) 00015 { 00016 } 00017 00018 00019 //----------------------------------------------------------------------------- 00020 KMFolderNode::~KMFolderNode() 00021 { 00022 } 00023 00024 //----------------------------------------------------------------------------- 00025 bool KMFolderNode::isDir(void) const 00026 { 00027 return mDir; 00028 } 00029 00030 00031 //----------------------------------------------------------------------------- 00032 QString KMFolderNode::path() const 00033 { 00034 if (parent()) return parent()->path(); 00035 return QString::null; 00036 } 00037 00038 //----------------------------------------------------------------------------- 00039 QString KMFolderNode::label(void) const 00040 { 00041 return name(); 00042 } 00043 00044 //----------------------------------------------------------------------------- 00045 KMFolderDir* KMFolderNode::parent(void) const 00046 { 00047 return mParent; 00048 } 00049 00050 //----------------------------------------------------------------------------- 00051 void KMFolderNode::setParent( KMFolderDir* aParent ) 00052 { 00053 mParent = aParent; 00054 } 00055 00056 //----------------------------------------------------------------------------- 00057 uint KMFolderNode::id() const 00058 { 00059 if (mId > 0) 00060 return mId; 00061 // compatibility, returns 0 on error 00062 return name().toUInt(); 00063 } 00064 00065 #include "kmfoldernode.moc"