summaryrefslogtreecommitdiffstats
path: root/kdirstat/kdirtree.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 21:28:42 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 21:28:42 +0000
commite8d62395de6c1b3844294c5b6c09428c315ac42a (patch)
treef94a43e157b5b4607f3a8d5b9b7be873d458fafa /kdirstat/kdirtree.h
parent1ed26cd2c4d896ae560dc7dddb570fe14ef573f3 (diff)
downloadkdirstat-e8d62395de6c1b3844294c5b6c09428c315ac42a.tar.gz
kdirstat-e8d62395de6c1b3844294c5b6c09428c315ac42a.zip
TQt4 port kdirstat
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdirstat@1239296 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdirstat/kdirtree.h')
-rw-r--r--kdirstat/kdirtree.h136
1 files changed, 69 insertions, 67 deletions
diff --git a/kdirstat/kdirtree.h b/kdirstat/kdirtree.h
index d4155a9..0de058f 100644
--- a/kdirstat/kdirtree.h
+++ b/kdirstat/kdirtree.h
@@ -19,7 +19,7 @@
#include <sys/types.h>
#include <limits.h>
#include <dirent.h>
-#include <qptrqueue.h>
+#include <tqptrqueue.h>
#include <kdebug.h>
#include <kfileitem.h>
#include <kio/jobclasses.h>
@@ -51,7 +51,7 @@ namespace KDirStat
/**
- * Status of a directory read job.
+ * tqStatus of a directory read job.
**/
typedef enum
{
@@ -93,8 +93,8 @@ namespace KDirStat
* easily has 150,000+ file system objects, and at least one entry of this
* sort is required for each of them.
*
- * This class provides stubs for children management, yet those stubs all
- * are default implementations that don't really deal with children.
+ * This class provides stubs for tqchildren management, yet those stubs all
+ * are default implementations that don't really deal with tqchildren.
* Derived classes need to take care of that.
*
* @short Basic file information (like obtained by the lstat() sys call)
@@ -106,23 +106,23 @@ namespace KDirStat
* Default constructor.
**/
KFileInfo( KDirTree * tree,
- KDirInfo * parent = 0,
+ KDirInfo * tqparent = 0,
const char * name = 0 );
/**
* Constructor from a stat buffer (i.e. based on an lstat() call).
**/
- KFileInfo( const QString & filenameWithoutPath,
+ KFileInfo( const TQString & filenameWithoutPath,
struct stat * statInfo,
KDirTree * tree,
- KDirInfo * parent = 0 );
+ KDirInfo * tqparent = 0 );
/**
* Constructor from a KFileItem, i.e. from a @ref KIO::StatJob
**/
KFileInfo( const KFileItem * fileItem,
KDirTree * tree,
- KDirInfo * parent = 0 );
+ KDirInfo * tqparent = 0 );
/**
* Destructor.
@@ -149,7 +149,7 @@ namespace KDirStat
* for "/usr/share/man". Notice, however, that the entry for
* "/usr/share/man/man1" will only return "man1" in this example.
**/
- QString name() const { return _name; }
+ TQString name() const { return _name; }
/**
* Returns the full URL of this object with full path and protocol
@@ -158,7 +158,7 @@ namespace KDirStat
* This is a (somewhat) expensive operation since it will recurse up
* to the top of the tree.
**/
- QString url() const;
+ TQString url() const;
/**
* Very much like @ref KFileInfo::url(), but with "/<Files>" appended
@@ -168,7 +168,7 @@ namespace KDirStat
*
* kdDebug() << "Found fileInfo " << info << endl;
**/
- QString debugUrl() const;
+ TQString debugUrl() const;
/**
* Returns part no. "level" of this object's URL, i.e. traverses up the
@@ -176,7 +176,7 @@ namespace KDirStat
* @ref name() . This is useful for tree searches in symmetrical trees
* to find an item's counterpart in the other tree.
**/
- QString urlPart( int level ) const;
+ TQString urlPart( int level ) const;
/**
* Returns the major and minor device numbers of the device this file
@@ -250,39 +250,39 @@ namespace KDirStat
/**
* Returns the total size in bytes of this subtree.
- * Derived classes that have children should overwrite this.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual KFileSize totalSize() { return size(); }
/**
* Returns the total size in blocks of this subtree.
- * Derived classes that have children should overwrite this.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual KFileSize totalBlocks() { return _blocks; }
/**
- * Returns the total number of children in this subtree, excluding this item.
- * Derived classes that have children should overwrite this.
+ * Returns the total number of tqchildren in this subtree, excluding this item.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual int totalItems() { return 0; }
/**
* Returns the total number of subdirectories in this subtree,
* excluding this item. Dot entries and "." or ".." are not counted.
- * Derived classes that have children should overwrite this.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual int totalSubDirs() { return 0; }
/**
- * Returns the total number of plain file children in this subtree,
+ * Returns the total number of plain file tqchildren in this subtree,
* excluding this item.
- * Derived classes that have children should overwrite this.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual int totalFiles() { return 0; }
/**
* Returns the latest modification time of this subtree.
- * Derived classes that have children should overwrite this.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual time_t latestMtime() { return _mtime; }
@@ -322,7 +322,7 @@ namespace KDirStat
/**
* Returns the number of pending read jobs in this subtree. When this
* number reaches zero, the entire subtree is done.
- * Derived classes that have children should overwrite this.
+ * Derived classes that have tqchildren should overwrite this.
**/
virtual int pendingReadJobs() { return 0; }
@@ -337,13 +337,13 @@ namespace KDirStat
KDirTree * tree() const { return _tree; }
/**
- * Returns a pointer to this entry's parent entry or 0 if there is
+ * Returns a pointer to this entry's tqparent entry or 0 if there is
* none.
**/
- KDirInfo * parent() const { return _parent; }
+ KDirInfo * tqparent() const { return _parent; }
/**
- * Set the "parent" pointer.
+ * Set the "tqparent" pointer.
**/
void setParent( KDirInfo *newParent ) { _parent = newParent; }
@@ -377,7 +377,7 @@ namespace KDirStat
{ NOT_USED( newFirstChild ); }
/**
- * Returns true if this entry has any children.
+ * Returns true if this entry has any tqchildren.
**/
virtual bool hasChildren() const;
@@ -396,17 +396,17 @@ namespace KDirStat
*
* Derived classes might or might not wish to overwrite this method;
* it's only advisable to do so if a derived class comes up with a
- * different method than brute-force search all children.
+ * different method than brute-force search all tqchildren.
*
* 'findDotEntries' specifies if locating "dot entries" (".../<Files>")
* is desired.
**/
- virtual KFileInfo * locate( QString url, bool findDotEntries = false );
+ virtual KFileInfo * locate( TQString url, bool findDotEntries = false );
/**
- * Insert a child into the children list.
+ * Insert a child into the tqchildren list.
*
- * The order of children in this list is absolutely undefined;
+ * The order of tqchildren in this list is absolutely undefined;
* don't rely on any implementation-specific order.
*
* This default implementation does nothing.
@@ -416,7 +416,7 @@ namespace KDirStat
/**
* Return the "Dot Entry" for this node if there is one (or 0
* otherwise): This is a pseudo entry that directory nodes use to store
- * non-directory children separately from directories. This way the end
+ * non-directory tqchildren separately from directories. This way the end
* user can easily tell which summary fields belong to the directory
* itself and which are the accumulated values of the entire subtree.
*
@@ -456,7 +456,7 @@ namespace KDirStat
virtual void childAdded( KFileInfo *newChild ) { NOT_USED( newChild ); }
/**
- * Remove a child from the children list.
+ * Remove a child from the tqchildren list.
*
* IMPORTANT: This MUST be called just prior to deleting an object of
* this class. Regrettably, this cannot simply be moved to the
@@ -464,7 +464,7 @@ namespace KDirStat
* (e.g., the virtual table - no more virtual methods).
*
* This default implementation does nothing.
- * Derived classes that can handle children should overwrite this.
+ * Derived classes that can handle tqchildren should overwrite this.
**/
virtual void unlinkChild( KFileInfo *deletedChild ) { NOT_USED( deletedChild ); }
@@ -562,7 +562,7 @@ namespace KDirStat
// Keep this short in order to use as little memory as possible -
// there will be a _lot_ of entries of this kind!
- QString _name; // the file name (without path!)
+ TQString _name; // the file name (without path!)
bool _isLocalFile :1; // flag: local or remote file?
bool _isSparseFile :1; // (cache) flag: sparse file (file with "holes")?
dev_t _device; // device this object resides on
@@ -572,15 +572,15 @@ namespace KDirStat
KFileSize _blocks; // 512 bytes blocks
time_t _mtime; // modification time
- KDirInfo * _parent; // pointer to the parent entry
+ KDirInfo * _parent; // pointer to the tqparent entry
KFileInfo * _next; // pointer to the next entry
- KDirTree * _tree; // pointer to the parent tree
+ KDirTree * _tree; // pointer to the tqparent tree
}; // class KFileInfo
/**
* A more specialized version of @ref KFileInfo: This class can actually
- * manage children. The base class (@ref KFileInfo) has only stubs for the
+ * manage tqchildren. The base class (@ref KFileInfo) has only stubs for the
* respective methods to integrate seamlessly with the abstraction of a
* file / directory tree; this class fills those stubs with life.
*
@@ -592,29 +592,29 @@ namespace KDirStat
/**
* Default constructor.
*
- * If "asDotEntry" is set, this will be used as the parent's
- * "dot entry", i.e. the pseudo directory that holds all the parent's
- * non-directory children. This is the only way to create a "dot
+ * If "asDotEntry" is set, this will be used as the tqparent's
+ * "dot entry", i.e. the pseudo directory that holds all the tqparent's
+ * non-directory tqchildren. This is the only way to create a "dot
* entry"!
**/
KDirInfo( KDirTree * tree,
- KDirInfo * parent = 0,
+ KDirInfo * tqparent = 0,
bool asDotEntry = false );
/**
* Constructor from a stat buffer (i.e. based on an lstat() call).
**/
- KDirInfo( const QString & filenameWithoutPath,
+ KDirInfo( const TQString & filenameWithoutPath,
struct stat * statInfo,
KDirTree * tree,
- KDirInfo * parent = 0 );
+ KDirInfo * tqparent = 0 );
/**
* Constructor from a KFileItem, i.e. from a @ref KIO::StatJob
**/
KDirInfo( const KFileItem * fileItem,
KDirTree * tree,
- KDirInfo * parent = 0 );
+ KDirInfo * tqparent = 0 );
/**
* Destructor.
@@ -637,7 +637,7 @@ namespace KDirStat
virtual KFileSize totalBlocks();
/**
- * Returns the total number of children in this subtree, excluding this item.
+ * Returns the total number of tqchildren in this subtree, excluding this item.
*
* Reimplemented - inherited from @ref KFileInfo.
**/
@@ -652,7 +652,7 @@ namespace KDirStat
virtual int totalSubDirs();
/**
- * Returns the total number of plain file children in this subtree,
+ * Returns the total number of plain file tqchildren in this subtree,
* excluding this item.
*
* Reimplemented - inherited from @ref KFileInfo.
@@ -723,9 +723,9 @@ namespace KDirStat
{ _firstChild = newfirstChild; }
/**
- * Insert a child into the children list.
+ * Insert a child into the tqchildren list.
*
- * The order of children in this list is absolutely undefined;
+ * The order of tqchildren in this list is absolutely undefined;
* don't rely on any implementation-specific order.
**/
virtual void insertChild( KFileInfo *newChild );
@@ -733,7 +733,7 @@ namespace KDirStat
/**
* Get the "Dot Entry" for this node if there is one (or 0 otherwise):
* This is a pseudo entry that directory nodes use to store
- * non-directory children separately from directories. This way the end
+ * non-directory tqchildren separately from directories. This way the end
* user can easily tell which summary fields belong to the directory
* itself and which are the accumulated values of the entire subtree.
**/
@@ -760,7 +760,7 @@ namespace KDirStat
virtual void childAdded( KFileInfo *newChild );
/**
- * Remove a child from the children list.
+ * Remove a child from the tqchildren list.
*
* IMPORTANT: This MUST be called just prior to deleting an object of
* this class. Regrettably, this cannot simply be moved to the
@@ -848,8 +848,8 @@ namespace KDirStat
/**
* Clean up unneeded / undesired dot entries:
- * Delete dot entries that don't have any children,
- * reparent dot entry children to the "real" (parent) directory if
+ * Delete dot entries that don't have any tqchildren,
+ * reparent dot entry tqchildren to the "real" (tqparent) directory if
* there are not subdirectory siblings at the level of the dot entry.
**/
void cleanupDotEntries();
@@ -862,7 +862,7 @@ namespace KDirStat
// Children management
KFileInfo * _firstChild; // pointer to the first child
- KFileInfo * _dotEntry; // pseudo entry to hold non-dir children
+ KFileInfo * _dotEntry; // pseudo entry to hold non-dir tqchildren
// Some cached values
@@ -897,7 +897,7 @@ namespace KDirStat
* KDirTree.
*
* For each entry automatically a @ref KFileInfo or @ref KDirInfo will be
- * created and added to the parent @ref KDirInfo. For each directory a new
+ * created and added to the tqparent @ref KDirInfo. For each directory a new
* @ref KDirReadJob will be created and added to the @ref KDirTree 's job
* queue.
*
@@ -1007,7 +1007,7 @@ namespace KDirStat
**/
static KFileInfo * stat( const KURL & url,
KDirTree * tree,
- KDirInfo * parent = 0 );
+ KDirInfo * tqparent = 0 );
protected:
DIR * _diskDir;
@@ -1026,9 +1026,10 @@ namespace KDirStat
*
* @short Generic directory reader that reads one directory, remote or local.
**/
- class KAnyDirReadJob: public QObject, public KDirReadJob
+ class KAnyDirReadJob: public TQObject, public KDirReadJob
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -1057,7 +1058,7 @@ namespace KDirStat
**/
static KFileInfo * stat( const KURL & url,
KDirTree * tree,
- KDirInfo * parent = 0 );
+ KDirInfo * tqparent = 0 );
/**
* Obtain the owner of the URL specified.
@@ -1065,7 +1066,7 @@ namespace KDirStat
* This is a moderately expensive operation since it involves a network
* transparent stat() call.
**/
- static QString owner( KURL url );
+ static TQString owner( KURL url );
protected slots:
@@ -1096,9 +1097,10 @@ namespace KDirStat
*
* @short Directory tree global data and infrastructure
**/
- class KDirTree: public QObject
+ class KDirTree: public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -1122,7 +1124,7 @@ namespace KDirStat
*
* It's not very pretty this is required as an extra method, but this
* cannot simply be done in the constructor: We need to give the caller
- * a chance to set up Qt signal connections, and for this the
+ * a chance to set up TQt signal connections, and for this the
* constructor must return before any signals are sent, i.e. before
* anything is read.
**/
@@ -1183,7 +1185,7 @@ namespace KDirStat
* This is just a convenience method that maps to
* KDirTree::root()->locate( url, findDotEntries )
**/
- KFileInfo * locate( QString url, bool findDotEntries = false )
+ KFileInfo * locate( TQString url, bool findDotEntries = false )
{ return _root ? _root->locate( url, findDotEntries ) : 0; }
/**
@@ -1250,10 +1252,10 @@ namespace KDirStat
virtual void deletingChildNotify( KFileInfo *deletedChild );
/**
- * Notification that one or more children have been deleted.
+ * Notification that one or more tqchildren have been deleted.
*
* Directory read jobs are required to call this when one or more
- * children are deleted so the tree can emit the corresponding @ref
+ * tqchildren are deleted so the tree can emit the corresponding @ref
* deletingChild() signal. For multiple deletions (e.g. entire
* subtrees) this should only happen once at the end.
**/
@@ -1263,7 +1265,7 @@ namespace KDirStat
* Send a @ref progressInfo() signal to keep the user entertained while
* directories are being read.
**/
- void sendProgressInfo( const QString &infoLine );
+ void sendProgressInfo( const TQString &infoLine );
/**
* Send a @ref finalizeLocal() signal to give views a chance to
@@ -1347,7 +1349,7 @@ namespace KDirStat
* changes - typically when a new directory is being read. Connect to a
* status bar etc. to keep the user entertained.
**/
- void progressInfo( const QString &infoLine );
+ void progressInfo( const TQString &infoLine );
protected slots:
@@ -1373,7 +1375,7 @@ namespace KDirStat
KFileInfo * _root;
KFileInfo * _selection;
- QPtrQueue<KDirReadJob> _jobQueue;
+ TQPtrQueue<KDirReadJob> _jobQueue;
KDirReadMethod _readMethod;
bool _crossFileSystems;
bool _enableLocalDirReader;
@@ -1390,7 +1392,7 @@ namespace KDirStat
* Make a valid, fixed and cleaned URL from a (possibly dirty) URL or maybe
* a path.
**/
- KURL fixedUrl( const QString & dirtyUrl );
+ KURL fixedUrl( const TQString & dirtyUrl );
/**
@@ -1401,7 +1403,7 @@ namespace KDirStat
*
* kdDebug() << "Size: " << x->totalSize() << endl;
**/
- QString formatSize ( KFileSize lSize );
+ TQString formatSize ( KFileSize lSize );
/**