• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kio

KDirSize Class Reference

Computes a directory size (similar to "du", but doesn't give the same results since we simply sum up the dir and file sizes, whereas du speaks disk blocks). More...

#include <kdirsize.h>

Inheritance diagram for KDirSize:

Inheritance graph
[legend]

List of all members.


Public Member Functions

KIO::filesize_t totalFiles () const
KIO::filesize_t totalSize () const
KIO::filesize_t totalSubdirs () const

Static Public Member Functions

static KIO::filesize_t dirSize (const KURL &directory)
static KDirSize * dirSizeJob (const KFileItemList &lstItems)
static KDirSize * dirSizeJob (const KURL &directory)

Protected Slots

void processList ()
void slotEntries (KIO::Job *, const KIO::UDSEntryList &)
virtual void slotResult (KIO::Job *job)

Protected Member Functions

 KDirSize (const KFileItemList &lstItems)
 KDirSize (const KURL &directory)
void setSync ()
void startNextJob (const KURL &url)
virtual void virtual_hook (int id, void *data)
 ~KDirSize ()

Detailed Description

Computes a directory size (similar to "du", but doesn't give the same results since we simply sum up the dir and file sizes, whereas du speaks disk blocks).

Definition at line 30 of file kdirsize.h.


Constructor & Destructor Documentation

KDirSize::KDirSize ( const KURL &  directory  )  [protected]

Definition at line 29 of file kdirsize.cpp.

KDirSize::KDirSize ( const KFileItemList &  lstItems  )  [protected]

Definition at line 35 of file kdirsize.cpp.

KDirSize::~KDirSize (  )  [inline, protected]

Definition at line 36 of file kdirsize.h.


Member Function Documentation

KIO::filesize_t KDirSize::dirSize ( const KURL &  directory  )  [static]

Synchronous method - you get the result as soon as the call returns.

Definition at line 138 of file kdirsize.cpp.

KDirSize * KDirSize::dirSizeJob ( const KFileItemList &  lstItems  )  [static]

Asynchronous method.

Connect to the result signal. This one lists the items from lstItems. The reason we asks for items instead of just urls, is so that we directly know if the item is a file or a directory, and in case of a file, we already have its size.

Definition at line 132 of file kdirsize.cpp.

KDirSize * KDirSize::dirSizeJob ( const KURL &  directory  )  [static]

Asynchronous method.

Connect to the result signal. This one lists a single directory.

Definition at line 126 of file kdirsize.cpp.

void KDirSize::processList (  )  [protected, slot]

Definition at line 41 of file kdirsize.cpp.

void KDirSize::setSync (  )  [inline, protected]

For internal use only.

Definition at line 84 of file kdirsize.h.

void KDirSize::slotEntries ( KIO::Job *  ,
const KIO::UDSEntryList &  list 
) [protected, slot]

Definition at line 80 of file kdirsize.cpp.

void KDirSize::slotResult ( KIO::Job *  job  )  [protected, virtual, slot]

Called whenever a subjob finishes.

Default implementation checks for errors and propagates to parent job, then calls removeSubjob. Override if you don't want subjobs errors to be propagated.

Parameters:
job the subjob
See also:
result()

Reimplemented from KIO::Job.

Definition at line 147 of file kdirsize.cpp.

void KDirSize::startNextJob ( const KURL &  url  )  [protected]

Definition at line 70 of file kdirsize.cpp.

KIO::filesize_t KDirSize::totalFiles (  )  const [inline]

Returns:
the total number of files (counting symlinks to files, sockets and character devices as files) in this directory and all sub-directories
Since:
3.3

Definition at line 49 of file kdirsize.h.

KIO::filesize_t KDirSize::totalSize (  )  const [inline]

Returns:
the size we found

Definition at line 42 of file kdirsize.h.

KIO::filesize_t KDirSize::totalSubdirs (  )  const [inline]

Returns:
the total number of sub-directories found (not including the directory the search started from and treating symlinks to directories as directories)
Since:
3.3

Definition at line 57 of file kdirsize.h.

void KDirSize::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Reimplemented from KIO::Job.

Definition at line 163 of file kdirsize.cpp.


The documentation for this class was generated from the following files:
  • kdirsize.h
  • kdirsize.cpp

kio

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal