KDir

Harri Porten porten at kde.org
Sat Apr 12 17:14:28 BST 2003


On Sat, 12 Apr 2003, buzzlinux wrote:

> I've made a new class called KDir, which is an extension of QDir.
> KDir has one more interesting method: resursiveList ( see urls below
> ). This method work similar to entryList from QDir but returns a
> recursive list from the given dir (QStringList). I think this sync
> method can be very usable and practice.

Design recommendation:

Don't let your class inherit from QDir. That just forces you to duplicate
all constructors. Just imlement your functionality in static functions
like

class KDir {
  static recursiveList(....);
};

The member variables like fileList and dirnumber can be "static" variables
in the .cpp file.

Harri.






More information about the kde-core-devel mailing list