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
v3.5.13-sru
tpearson 13 years ago
parent 1ed26cd2c4
commit e8d62395de

@ -15,10 +15,10 @@
#include "kactivitytracker.h" #include "kactivitytracker.h"
KActivityTracker::KActivityTracker( QObject * parent, KActivityTracker::KActivityTracker( TQObject * tqparent,
const QString & id, const TQString & id,
long initialThreshold ) long initialThreshold )
: QObject( parent ) : TQObject( tqparent )
{ {
_id = id; _id = id;

@ -15,7 +15,7 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qobject.h> #include <tqobject.h>
/** /**
@ -29,9 +29,10 @@
* *
* @short User activity tracker * @short User activity tracker
**/ **/
class KActivityTracker: public QObject class KActivityTracker: public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. The ID is a name for the KConfig object to look in for * Constructor. The ID is a name for the KConfig object to look in for
@ -39,8 +40,8 @@ public:
* the application's @ref KConfig object doesn't contain a corresponding * the application's @ref KConfig object doesn't contain a corresponding
* entry yet. * entry yet.
**/ **/
KActivityTracker( QObject * parent, KActivityTracker( TQObject * tqparent,
const QString & id, const TQString & id,
long initialThreshold ); long initialThreshold );
/** /**
@ -100,7 +101,7 @@ protected:
long _sum; long _sum;
long _threshold; long _threshold;
long _lastSignal; long _lastSignal;
QString _id; TQString _id;
}; };
#endif // KActivityTracker_h #endif // KActivityTracker_h

@ -9,8 +9,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qregexp.h> #include <tqregexp.h>
#include <kapp.h> #include <kapp.h>
#include <kprocess.h> #include <kprocess.h>
@ -28,14 +28,14 @@
using namespace KDirStat; using namespace KDirStat;
KCleanup::KCleanup( QString id, KCleanup::KCleanup( TQString id,
QString command, TQString command,
QString title, TQString title,
KActionCollection * parent ) KActionCollection * tqparent )
: KAction( title, : KAction( title,
0, // accel 0, // accel
parent, tqparent,
id ) id )
, _id ( id ) , _id ( id )
@ -91,7 +91,7 @@ KCleanup::copy( const KCleanup &src )
void void
KCleanup::setTitle( const QString &title ) KCleanup::setTitle( const TQString &title )
{ {
_title = title; _title = title;
KAction::setText( _title ); KAction::setText( _title );
@ -162,18 +162,18 @@ KCleanup::executeWithSelection()
bool bool
KCleanup::confirmation( KFileInfo * item ) KCleanup::confirmation( KFileInfo * item )
{ {
QString msg; TQString msg;
if ( item->isDir() || item->isDotEntry() ) if ( item->isDir() || item->isDotEntry() )
{ {
msg = i18n( "%1\nin directory %2" ).arg( cleanTitle() ).arg( item->url() ); msg = i18n( "%1\nin directory %2" ).tqarg( cleanTitle() ).tqarg( item->url() );
} }
else else
{ {
msg = i18n( "%1\nfor file %2" ).arg( cleanTitle() ).arg( item->url() ); msg = i18n( "%1\nfor file %2" ).tqarg( cleanTitle() ).tqarg( item->url() );
} }
if ( KMessageBox::warningContinueCancel( 0, // parentWidget if ( KMessageBox::warningContinueCancel( 0, // tqparentWidget
msg, // message msg, // message
i18n( "Please Confirm" ), // caption i18n( "Please Confirm" ), // caption
i18n( "Confirm" ) // confirmButtonLabel i18n( "Confirm" ) // confirmButtonLabel
@ -209,7 +209,7 @@ KCleanup::execute( KFileInfo *item )
case refreshParent: case refreshParent:
tree->refresh( item->parent() ); tree->refresh( item->tqparent() );
break; break;
@ -252,7 +252,7 @@ KCleanup::executeRecursive( KFileInfo *item )
{ {
/** /**
* Recursively execute in this subdirectory, but only if it * Recursively execute in this subdirectory, but only if it
* really is a directory: File children might have been * really is a directory: File tqchildren might have been
* reparented to the directory (normally, they reside in * reparented to the directory (normally, they reside in
* the dot entry) if there are no real subdirectories on * the dot entry) if there are no real subdirectories on
* this directory level. * this directory level.
@ -271,26 +271,26 @@ KCleanup::executeRecursive( KFileInfo *item )
} }
const QString const TQString
KCleanup::itemDir( const KFileInfo *item ) const KCleanup::itemDir( const KFileInfo *item ) const
{ {
QString dir = item->url(); TQString dir = item->url();
if ( ! item->isDir() && ! item->isDotEntry() ) if ( ! item->isDir() && ! item->isDotEntry() )
{ {
dir.replace ( QRegExp ( "/[^/]*$" ), "" ); dir.tqreplace ( TQRegExp ( "/[^/]*$" ), "" );
} }
return dir; return dir;
} }
QString TQString
KCleanup::cleanTitle() const KCleanup::cleanTitle() const
{ {
// Use the cleanup action's title, if possible. // Use the cleanup action's title, if possible.
QString title = _title; TQString title = _title;
if ( title.isEmpty() ) if ( title.isEmpty() )
{ {
@ -299,45 +299,45 @@ KCleanup::cleanTitle() const
// Get rid of any "&" characters in the text that denote keyboard // Get rid of any "&" characters in the text that denote keyboard
// shortcuts in menus. // shortcuts in menus.
title.replace( QRegExp( "&" ), "" ); title.tqreplace( TQRegExp( "&" ), "" );
return title; return title;
} }
QString TQString
KCleanup::expandVariables( const KFileInfo * item, KCleanup::expandVariables( const KFileInfo * item,
const QString & unexpanded ) const const TQString & unexpanded ) const
{ {
QString expanded = unexpanded; TQString expanded = unexpanded;
expanded.replace( QRegExp( "%p" ), expanded.tqreplace( TQRegExp( "%p" ),
"\"" + QString::fromLocal8Bit( item->url() ) + "\"" ); "\"" + TQString::fromLocal8Bit( item->url() ) + "\"" );
expanded.replace( QRegExp( "%n" ), expanded.tqreplace( TQRegExp( "%n" ),
"\"" + QString::fromLocal8Bit( item->name() ) + "\"" ); "\"" + TQString::fromLocal8Bit( item->name() ) + "\"" );
if ( KDE::versionMajor() >= 3 && KDE::versionMinor() >= 4 ) if ( KDE::versionMajor() >= 3 && KDE::versionMinor() >= 4 )
expanded.replace( QRegExp( "%t" ), "trash:/" ); expanded.tqreplace( TQRegExp( "%t" ), "trash:/" );
else else
expanded.replace( QRegExp( "%t" ), KGlobalSettings::trashPath() ); expanded.tqreplace( TQRegExp( "%t" ), KGlobalSettings::trashPath() );
return expanded; return expanded;
} }
#include <qtextcodec.h> #include <tqtextcodec.h>
void void
KCleanup::runCommand ( const KFileInfo * item, KCleanup::runCommand ( const KFileInfo * item,
const QString & command ) const const TQString & command ) const
{ {
KProcess proc; KProcess proc;
KDirSaver dir( itemDir( item ) ); KDirSaver dir( itemDir( item ) );
QString cmd( expandVariables( item, command )); TQString cmd( expandVariables( item, command ));
#if VERBOSE_RUN_COMMAND #if VERBOSE_RUN_COMMAND
printf( "\ncd " ); printf( "\ncd " );
fflush( stdout ); fflush( stdout );
system( "pwd" ); system( "pwd" );
QTextCodec * codec = QTextCodec::codecForLocale(); TQTextCodec * codec = TQTextCodec::codecForLocale();
printf( "%s\n", (const char *) codec->fromUnicode( cmd ) ); printf( "%s\n", (const char *) codec->fromUnicode( cmd ) );
fflush( stdout ); fflush( stdout );
#endif #endif
@ -368,9 +368,9 @@ KCleanup::runCommand ( const KFileInfo * item,
// performing the update prematurely, so we are starting this // performing the update prematurely, so we are starting this
// process in blocking mode. // process in blocking mode.
QApplication::setOverrideCursor( waitCursor ); TQApplication::setOverrideCursor( waitCursor );
proc.start( KProcess::Block ); proc.start( KProcess::Block );
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
break; break;
} }

@ -17,9 +17,9 @@
#endif #endif
#include <qdict.h> #include <tqdict.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <qintdict.h> #include <tqintdict.h>
#include <kaction.h> #include <kaction.h>
#include <kdebug.h> #include <kdebug.h>
#include "kdirtree.h" #include "kdirtree.h"
@ -36,6 +36,7 @@ namespace KDirStat
class KCleanup: public KAction class KCleanup: public KAction
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -49,13 +50,13 @@ namespace KDirStat
* 'command' is the shell command to execute. * 'command' is the shell command to execute.
* *
* Most applications will want to pass KMainWindow::actionCollection() * Most applications will want to pass KMainWindow::actionCollection()
* for 'parent' so the menus and toolbars can be created using the XML * for 'tqparent' so the menus and toolbars can be created using the XML
* UI description ('kdirstatui.rc' for KDirStat). * UI description ('kdirstatui.rc' for KDirStat).
**/ **/
KCleanup( QString id = "", KCleanup( TQString id = "",
QString command = "", TQString command = "",
QString title = "", TQString title = "",
KActionCollection * parent = 0 ); KActionCollection * tqparent = 0 );
/** /**
* Copy Constructor. * Copy Constructor.
@ -84,7 +85,7 @@ namespace KDirStat
* and the XML UI description. This ID should be unique within the * and the XML UI description. This ID should be unique within the
* application. * application.
**/ **/
const QString & id() const { return _id; } const TQString & id() const { return _id; }
/** /**
* Return the command line that will be executed upon calling @ref * Return the command line that will be executed upon calling @ref
@ -92,20 +93,20 @@ namespace KDirStat
* complete path of the directory or file concerned or %n for the pure * complete path of the directory or file concerned or %n for the pure
* file or directory name without path. * file or directory name without path.
**/ **/
const QString & command() const { return _command; } const TQString & command() const { return _command; }
/** /**
* Return the user title of this command as displayed in menus. * Return the user title of this command as displayed in menus.
* This may include '&' characters for keyboard shortcuts. * This may include '&' characters for keyboard shortcuts.
* See also @ref cleanTitle() . * See also @ref cleanTitle() .
**/ **/
const QString & title() const { return _title; } const TQString & title() const { return _title; }
/** /**
* Returns the cleanup action's title without '&' keyboard shortcuts. * Returns the cleanup action's title without '&' keyboard shortcuts.
* Uses the ID as fallback if the name is empty. * Uses the ID as fallback if the name is empty.
**/ **/
QString cleanTitle() const; TQString cleanTitle() const;
/** /**
* Return whether or not this cleanup action is generally enabled. * Return whether or not this cleanup action is generally enabled.
@ -181,8 +182,8 @@ namespace KDirStat
* refreshThis: Refresh the KDirTree from the item on that was passed * refreshThis: Refresh the KDirTree from the item on that was passed
* to KCleanup::execute(). * to KCleanup::execute().
* *
* refreshParent: Refresh the KDirTree from the parent of the item on * refreshParent: Refresh the KDirTree from the tqparent of the item on
* that was passed to KCleanup::execute(). If there is no such parent, * that was passed to KCleanup::execute(). If there is no such tqparent,
* refresh the entire tree. * refresh the entire tree.
* *
* assumeDeleted: Do not actually refresh the KDirTree. Instead, * assumeDeleted: Do not actually refresh the KDirTree. Instead,
@ -200,9 +201,9 @@ namespace KDirStat
enum RefreshPolicy refreshPolicy() const { return _refreshPolicy; } enum RefreshPolicy refreshPolicy() const { return _refreshPolicy; }
void setTitle ( const QString &title ); void setTitle ( const TQString &title );
void setId ( const QString &id ) { _id = id; } void setId ( const TQString &id ) { _id = id; }
void setCommand ( const QString &command) { _command = command; } void setCommand ( const TQString &command) { _command = command; }
void setEnabled ( bool enabled ) { _enabled = enabled; } void setEnabled ( bool enabled ) { _enabled = enabled; }
void setWorksForDir ( bool canDo ) { _worksForDir = canDo; } void setWorksForDir ( bool canDo ) { _worksForDir = canDo; }
void setWorksForFile ( bool canDo ) { _worksForFile = canDo; } void setWorksForFile ( bool canDo ) { _worksForFile = canDo; }
@ -282,7 +283,7 @@ namespace KDirStat
/** /**
* Retrieve the directory part of a KFileInfo's path. * Retrieve the directory part of a KFileInfo's path.
**/ **/
const QString itemDir( const KFileInfo *item ) const; const TQString itemDir( const KFileInfo *item ) const;
/** /**
* Expand some variables in string 'unexpanded' to information from * Expand some variables in string 'unexpanded' to information from
@ -307,14 +308,14 @@ namespace KDirStat
* "kfmclient openURL %p" * "kfmclient openURL %p"
* "tar czvf %{name}.tgz && rm -rf %{name}" * "tar czvf %{name}.tgz && rm -rf %{name}"
**/ **/
QString expandVariables ( const KFileInfo * item, TQString expandVariables ( const KFileInfo * item,
const QString & unexpanded ) const; const TQString & unexpanded ) const;
/** /**
* Run a command with 'item' as base to expand variables. * Run a command with 'item' as base to expand variables.
**/ **/
void runCommand ( const KFileInfo * item, void runCommand ( const KFileInfo * item,
const QString & command ) const; const TQString & command ) const;
/** /**
* Internal implementation of the copy constructor and assignment * Internal implementation of the copy constructor and assignment
@ -328,9 +329,9 @@ namespace KDirStat
// //
KFileInfo * _selection; KFileInfo * _selection;
QString _id; TQString _id;
QString _command; TQString _command;
QString _title; TQString _title;
bool _enabled; bool _enabled;
bool _worksForDir; bool _worksForDir;
bool _worksForFile; bool _worksForFile;

@ -18,14 +18,14 @@ using namespace KDirStat;
KCleanupCollection::KCleanupCollection( KActionCollection * actionCollection ) KCleanupCollection::KCleanupCollection( KActionCollection * actionCollection )
: QObject() : TQObject()
, _actionCollection( actionCollection ) , _actionCollection( actionCollection )
{ {
/** /**
* All cleanups beloningt to this collection are stored in two separate Qt * All cleanups beloningt to this collection are stored in two separate TQt
* collections, a QList and a QDict. Make _one_ of them manage the cleanup * collections, a TQList and a TQDict. Make _one_ of them manage the cleanup
* objects, i.e. have them clear the KCleanup objects upon deleting. The * objects, i.e. have them clear the KCleanup objects upon deleting. The
* QList is the master collection, the QDict the slave. * TQList is the master collection, the TQDict the slave.
**/ **/
_cleanupList.setAutoDelete( true ); _cleanupList.setAutoDelete( true );
@ -36,7 +36,7 @@ KCleanupCollection::KCleanupCollection( KActionCollection * actionCollection )
KCleanupCollection::KCleanupCollection( const KCleanupCollection &src ) KCleanupCollection::KCleanupCollection( const KCleanupCollection &src )
: QObject() : TQObject()
{ {
deepCopy( src ); deepCopy( src );
@ -80,7 +80,7 @@ KCleanupCollection::operator= ( const KCleanupCollection &src )
* limitations of the KCleanup copy constructor: It doesn't make a * limitations of the KCleanup copy constructor: It doesn't make a
* truly identical copy of the entire KCleanup object. Rather, it * truly identical copy of the entire KCleanup object. Rather, it
* copies only the KCleanup members and leaves most of the KAction * copies only the KCleanup members and leaves most of the KAction
* members (the parent class) untouched. * members (the tqparent class) untouched.
* *
* The behaviour implemented here comes handy in the most common * The behaviour implemented here comes handy in the most common
* situation where this assignment operator is used: * situation where this assignment operator is used:
@ -190,17 +190,17 @@ KCleanupCollection::add( KCleanup *newCleanup )
_cleanupList.append( newCleanup ); _cleanupList.append( newCleanup );
_cleanupDict.insert( newCleanup->id(), newCleanup ); _cleanupDict.insert( newCleanup->id(), newCleanup );
connect( this, SIGNAL( selectionChanged( KFileInfo * ) ), connect( this, TQT_SIGNAL( selectionChanged( KFileInfo * ) ),
newCleanup, SLOT ( selectionChanged( KFileInfo * ) ) ); newCleanup, TQT_SLOT ( selectionChanged( KFileInfo * ) ) );
connect( this, SIGNAL( readConfig() ), connect( this, TQT_SIGNAL( readConfig() ),
newCleanup, SLOT ( readConfig() ) ); newCleanup, TQT_SLOT ( readConfig() ) );
connect( this, SIGNAL( saveConfig() ), connect( this, TQT_SIGNAL( saveConfig() ),
newCleanup, SLOT ( saveConfig() ) ); newCleanup, TQT_SLOT ( saveConfig() ) );
connect( newCleanup, SIGNAL( executed() ), connect( newCleanup, TQT_SIGNAL( executed() ),
this, SLOT ( cleanupExecuted() ) ); this, TQT_SLOT ( cleanupExecuted() ) );
} }
@ -222,16 +222,16 @@ KCleanupCollection::addUserCleanups( int number )
{ {
for ( int i=0; i < number; i++ ) for ( int i=0; i < number; i++ )
{ {
QString id; TQString id;
id.sprintf( "cleanup_user_defined_%d", _nextUserCleanupNo ); id.sprintf( "cleanup_user_defined_%d", _nextUserCleanupNo );
QString title; TQString title;
if ( _nextUserCleanupNo <= 9 ) if ( _nextUserCleanupNo <= 9 )
// Provide a keyboard shortcut for cleanup #0..#9 // Provide a keyboard shortcut for cleanup #0..#9
title=i18n( "User Defined Cleanup #&%1" ).arg(_nextUserCleanupNo); title=i18n( "User Defined Cleanup #&%1" ).tqarg(_nextUserCleanupNo);
else else
// No keyboard shortcuts for cleanups #10.. - they would be duplicates // No keyboard shortcuts for cleanups #10.. - they would be duplicates
title=i18n( "User Defined Cleanup #%1" ).arg(_nextUserCleanupNo); title=i18n( "User Defined Cleanup #%1" ).tqarg(_nextUserCleanupNo);
_nextUserCleanupNo++; _nextUserCleanupNo++;
@ -242,7 +242,7 @@ KCleanupCollection::addUserCleanups( int number )
if ( i <= 9 ) if ( i <= 9 )
{ {
// Provide an application-wide keyboard accelerator for cleanup #0..#9 // Provide an application-wide keyboard accelerator for cleanup #0..#9
cleanup->setShortcut( Qt::CTRL + Qt::Key_0 + i ); cleanup->setShortcut( TQt::CTRL + TQt::Key_0 + i );
} }
add( cleanup ); add( cleanup );
@ -251,7 +251,7 @@ KCleanupCollection::addUserCleanups( int number )
KCleanup * KCleanup *
KCleanupCollection::cleanup( const QString & id ) KCleanupCollection::cleanup( const TQString & id )
{ {
return _cleanupDict[ id ]; return _cleanupDict[ id ];
} }

@ -25,11 +25,11 @@ class KActionCollection;
namespace KDirStat namespace KDirStat
{ {
typedef QDict<KCleanup> KCleanupDict; typedef TQDict<KCleanup> KCleanupDict;
typedef QDictIterator<KCleanup> KCleanupDictIterator; typedef TQDictIterator<KCleanup> KCleanupDictIterator;
typedef QPtrList<KCleanup> KCleanupList; typedef TQPtrList<KCleanup> KCleanupList;
typedef QPtrListIterator<KCleanup> KCleanupListIterator; typedef TQPtrListIterator<KCleanup> KCleanupListIterator;
/** /**
@ -43,9 +43,10 @@ namespace KDirStat
* @short KDirStat cleanup action collection * @short KDirStat cleanup action collection
**/ **/
class KCleanupCollection: public QObject class KCleanupCollection: public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -57,7 +58,7 @@ namespace KDirStat
* using the XML UI description ('kdirstatui.rc' for KDirStat). * using the XML UI description ('kdirstatui.rc' for KDirStat).
* *
* All @ref KCleanup actions ever added to this collection will get * All @ref KCleanup actions ever added to this collection will get
* this as their parent. * this as their tqparent.
**/ **/
KCleanupCollection( KActionCollection * actionCollection = 0 ); KCleanupCollection( KActionCollection * actionCollection = 0 );
@ -110,13 +111,13 @@ namespace KDirStat
* Retrieve a cleanup by its ID (internal name). * Retrieve a cleanup by its ID (internal name).
* Returns 0 if there is no such cleanup. * Returns 0 if there is no such cleanup.
**/ **/
KCleanup * cleanup( const QString & id ); KCleanup * cleanup( const TQString & id );
/** /**
* An alias to @ref cleanup() for convenience: Thus, you can use * An alias to @ref cleanup() for convenience: Thus, you can use
* collection[ "cleanup_id" ] to access any particular cleanup. * collection[ "cleanup_id" ] to access any particular cleanup.
**/ **/
KCleanup * operator[] ( const QString & id ) KCleanup * operator[] ( const TQString & id )
{ return cleanup( id ); } { return cleanup( id ); }
/** /**

@ -13,11 +13,11 @@
#include "kdirsaver.h" #include "kdirsaver.h"
KDirSaver::KDirSaver( const QString & newPath ) KDirSaver::KDirSaver( const TQString & newPath )
{ {
/* /*
* No need to actually save the current working directory: This object * No need to actually save the current working directory: This object
* includes a QDir whose default constructor constructs a directory object * includes a TQDir whose default constructor constructs a directory object
* that contains the current working directory. Just what is needed here. * that contains the current working directory. Just what is needed here.
*/ */
@ -45,7 +45,7 @@ KDirSaver::~KDirSaver()
void void
KDirSaver::cd( const QString & newPath ) KDirSaver::cd( const TQString & newPath )
{ {
if ( ! newPath.isEmpty() ) if ( ! newPath.isEmpty() )
{ {
@ -54,10 +54,10 @@ KDirSaver::cd( const QString & newPath )
} }
QString TQString
KDirSaver::currentDirPath() const KDirSaver::currentDirPath() const
{ {
return QDir::currentDirPath(); return TQDir::currentDirPath();
} }

@ -16,7 +16,7 @@
#endif #endif
#include <kurl.h> #include <kurl.h>
#include <qdir.h> #include <tqdir.h>
/** /**
@ -33,7 +33,7 @@ public:
* path supplied. The old working directory will be restored when this * path supplied. The old working directory will be restored when this
* object is destroyed. * object is destroyed.
**/ **/
KDirSaver( const QString & newPath = "" ); KDirSaver( const TQString & newPath = "" );
/** /**
* Constructor from a KURL. Will issue error messages on stdout for * Constructor from a KURL. Will issue error messages on stdout for
@ -47,17 +47,17 @@ public:
virtual ~KDirSaver(); virtual ~KDirSaver();
/** /**
* Change directory. Unlike @ref QDir::cd(), this method really performs a * Change directory. Unlike @ref TQDir::cd(), this method really performs a
* system chdir() so subsequent system calls will have the directory * system chdir() so subsequent system calls will have the directory
* specified as the new current working directory. * specified as the new current working directory.
**/ **/
void cd( const QString & newPath ); void cd( const TQString & newPath );
/** /**
* Obtain the current working directory's absolute path. * Obtain the current working directory's absolute path.
* This is useful for resolving/simplifying relative paths. * This is useful for resolving/simplifying relative paths.
**/ **/
QString currentDirPath() const; TQString currentDirPath() const;
/** /**
* (Prematurely) restore the working directory. Unnecessary when this * (Prematurely) restore the working directory. Unnecessary when this
@ -66,7 +66,7 @@ public:
void restore(); void restore();
protected: protected:
QDir oldWorkingDir; TQDir oldWorkingDir;
}; };
#endif // KDirSaver_h #endif // KDirSaver_h

@ -10,9 +10,9 @@
*/ */
#include <qclipboard.h> #include <tqclipboard.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qsplitter.h> #include <tqsplitter.h>
#include <kaccel.h> #include <kaccel.h>
#include <kaction.h> #include <kaction.h>
@ -54,7 +54,7 @@
using namespace KDirStat; using namespace KDirStat;
KDirStatApp::KDirStatApp( QWidget* , const char* name ) KDirStatApp::KDirStatApp( TQWidget* , const char* name )
: KMainWindow( 0, name ) : KMainWindow( 0, name )
{ {
// Simple inits // Simple inits
@ -73,39 +73,39 @@ KDirStatApp::KDirStatApp( QWidget* , const char* name )
// Set up internal (mainWin -> mainWin) connections // Set up internal (mainWin -> mainWin) connections
connect( this, SIGNAL( readConfig ( void ) ), connect( this, TQT_SIGNAL( readConfig ( void ) ),
this, SLOT ( readMainWinConfig( void ) ) ); this, TQT_SLOT ( readMainWinConfig( void ) ) );
connect( this, SIGNAL( saveConfig ( void ) ), connect( this, TQT_SIGNAL( saveConfig ( void ) ),
this, SLOT ( saveMainWinConfig( void ) ) ); this, TQT_SLOT ( saveMainWinConfig( void ) ) );
// Create main window // Create main window
_splitter = new QSplitter( QSplitter::Vertical, this ); _splitter = new TQSplitter( Qt::Vertical, this );
setCentralWidget( _splitter ); setCentralWidget( _splitter );
_treeView = new KDirTreeView( _splitter ); _treeView = new KDirTreeView( _splitter );
connect( _treeView, SIGNAL( progressInfo( const QString & ) ), connect( _treeView, TQT_SIGNAL( progressInfo( const TQString & ) ),
this, SLOT ( statusMsg ( const QString & ) ) ); this, TQT_SLOT ( statusMsg ( const TQString & ) ) );
connect( _treeView, SIGNAL( selectionChanged( KFileInfo * ) ), connect( _treeView, TQT_SIGNAL( selectionChanged( KFileInfo * ) ),
this, SLOT ( selectionChanged( KFileInfo * ) ) ); this, TQT_SLOT ( selectionChanged( KFileInfo * ) ) );
connect( _treeView, SIGNAL( contextMenu( KDirTreeViewItem *, const QPoint & ) ), connect( _treeView, TQT_SIGNAL( contextMenu( KDirTreeViewItem *, const TQPoint & ) ),
this, SLOT ( contextMenu( KDirTreeViewItem *, const QPoint & ) ) ); this, TQT_SLOT ( contextMenu( KDirTreeViewItem *, const TQPoint & ) ) );
connect( this, SIGNAL( readConfig() ), _treeView, SLOT ( readConfig() ) ); connect( this, TQT_SIGNAL( readConfig() ), _treeView, TQT_SLOT ( readConfig() ) );
connect( this, SIGNAL( saveConfig() ), _treeView, SLOT ( saveConfig() ) ); connect( this, TQT_SIGNAL( saveConfig() ), _treeView, TQT_SLOT ( saveConfig() ) );
connect( _treeView, SIGNAL( finished() ), this, SLOT( createTreemapView() ) ); connect( _treeView, TQT_SIGNAL( finished() ), TQT_TQOBJECT(this), TQT_SLOT( createTreemapView() ) );
connect( _treeView, SIGNAL( aborted() ), this, SLOT( createTreemapView() ) ); connect( _treeView, TQT_SIGNAL( aborted() ), TQT_TQOBJECT(this), TQT_SLOT( createTreemapView() ) );
connect( _treeView, SIGNAL( startingReading() ), this, SLOT( deleteTreemapView() ) ); connect( _treeView, TQT_SIGNAL( startingReading() ), TQT_TQOBJECT(this), TQT_SLOT( deleteTreemapView() ) );
connect( _treeView, SIGNAL( startingReading() ), this, SLOT( updateActions() ) ); connect( _treeView, TQT_SIGNAL( startingReading() ), TQT_TQOBJECT(this), TQT_SLOT( updateActions() ) );
connect( _treeView, SIGNAL( finished() ), this, SLOT( updateActions() ) ); connect( _treeView, TQT_SIGNAL( finished() ), TQT_TQOBJECT(this), TQT_SLOT( updateActions() ) );
connect( _treeView, SIGNAL( aborted() ), this, SLOT( updateActions() ) ); connect( _treeView, TQT_SIGNAL( aborted() ), TQT_TQOBJECT(this), TQT_SLOT( updateActions() ) );
// Call inits to invoke all other construction parts // Call inits to invoke all other construction parts
@ -115,8 +115,8 @@ KDirStatApp::KDirStatApp( QWidget* , const char* name )
createGUI(); createGUI();
initActivityTracker(); initActivityTracker();
_treeViewContextMenu = (QPopupMenu *) factory()->container( "treeViewContextMenu", this ); _treeViewContextMenu = (TQPopupMenu *) factory()->container( "treeViewContextMenu", this );
_treemapContextMenu = (QPopupMenu *) factory()->container( "treemapContextMenu", this ); _treemapContextMenu = (TQPopupMenu *) factory()->container( "treemapContextMenu", this );
readMainWinConfig(); readMainWinConfig();
@ -141,72 +141,72 @@ KDirStatApp::~KDirStatApp()
void void
KDirStatApp::initActions() KDirStatApp::initActions()
{ {
_fileAskOpenDir = KStdAction::open ( this, SLOT( fileAskOpenDir() ), actionCollection() ); _fileAskOpenDir = KStdAction::open ( TQT_TQOBJECT(this), TQT_SLOT( fileAskOpenDir() ), actionCollection() );
_fileAskOpenUrl = new KAction( i18n( "Open &URL..." ), "konqueror", 0, _fileAskOpenUrl = new KAction( i18n( "Open &URL..." ), "konqueror", 0,
this, SLOT( fileAskOpenUrl() ), TQT_TQOBJECT(this), TQT_SLOT( fileAskOpenUrl() ),
actionCollection(), "file_open_url" ); actionCollection(), "file_open_url" );
_fileOpenRecent = KStdAction::openRecent ( this, SLOT( fileOpenRecent( const KURL& ) ), actionCollection() ); _fileOpenRecent = KStdAction::openRecent ( TQT_TQOBJECT(this), TQT_SLOT( fileOpenRecent( const KURL& ) ), actionCollection() );
_fileCloseDir = KStdAction::close ( this, SLOT( fileCloseDir() ), actionCollection() ); _fileCloseDir = KStdAction::close ( TQT_TQOBJECT(this), TQT_SLOT( fileCloseDir() ), actionCollection() );
_fileRefreshAll = new KAction( i18n( "Refresh &All" ), "reload", 0, _fileRefreshAll = new KAction( i18n( "Refresh &All" ), "reload", 0,
this, SLOT( refreshAll() ), TQT_TQOBJECT(this), TQT_SLOT( refreshAll() ),
actionCollection(), "file_refresh_all" ); actionCollection(), "file_refresh_all" );
_fileRefreshSelected = new KAction( i18n( "Refresh &Selected" ), 0, _fileRefreshSelected = new KAction( i18n( "Refresh &Selected" ), 0,
this, SLOT( refreshSelected() ), TQT_TQOBJECT(this), TQT_SLOT( refreshSelected() ),
actionCollection(), "file_refresh_selected" ); actionCollection(), "file_refresh_selected" );
_fileContinueReadingAtMountPoint = new KAction( i18n( "Continue Reading at &Mount Point" ), "hdd_mount", 0, _fileContinueReadingAtMountPoint = new KAction( i18n( "Continue Reading at &Mount Point" ), "hdd_mount", 0,
this, SLOT( refreshSelected() ), actionCollection(), TQT_TQOBJECT(this), TQT_SLOT( refreshSelected() ), actionCollection(),
"file_continue_reading_at_mount_point" ); "file_continue_reading_at_mount_point" );
_fileStopReading = new KAction( i18n( "Stop Rea&ding" ), "stop", 0, _fileStopReading = new KAction( i18n( "Stop Rea&ding" ), "stop", 0,
this, SLOT( stopReading() ), actionCollection(), TQT_TQOBJECT(this), TQT_SLOT( stopReading() ), actionCollection(),
"file_stop_reading" ); "file_stop_reading" );
_fileQuit = KStdAction::quit ( kapp, SLOT( quit() ), actionCollection() ); _fileQuit = KStdAction::quit ( TQT_TQOBJECT(kapp), TQT_SLOT( quit() ), actionCollection() );
_editCopy = KStdAction::copy ( this, SLOT( editCopy() ), actionCollection() ); _editCopy = KStdAction::copy ( TQT_TQOBJECT(this), TQT_SLOT( editCopy() ), actionCollection() );
_showToolBar = KStdAction::showToolbar ( this, SLOT( toggleToolBar() ), actionCollection() ); _showToolBar = KStdAction::showToolbar ( TQT_TQOBJECT(this), TQT_SLOT( toggleToolBar() ), actionCollection() );
_showStatusBar = KStdAction::showStatusbar ( this, SLOT( toggleStatusBar() ), actionCollection() ); _showStatusBar = KStdAction::showStatusbar ( TQT_TQOBJECT(this), TQT_SLOT( toggleStatusBar() ), actionCollection() );
_cleanupOpenWith = new KAction( i18n( "Open With" ), 0, _cleanupOpenWith = new KAction( i18n( "Open With" ), 0,
this, SLOT( cleanupOpenWith() ), TQT_TQOBJECT(this), TQT_SLOT( cleanupOpenWith() ),
actionCollection(), "cleanup_open_with" ); actionCollection(), "cleanup_open_with" );
_treemapZoomIn = new KAction( i18n( "Zoom in" ), "viewmag+", Key_Plus, _treemapZoomIn = new KAction( i18n( "Zoom in" ), "viewmag+", Key_Plus,
this, SLOT( treemapZoomIn() ), TQT_TQOBJECT(this), TQT_SLOT( treemapZoomIn() ),
actionCollection(), "treemap_zoom_in" ); actionCollection(), "treemap_zoom_in" );
_treemapZoomOut = new KAction( i18n( "Zoom out" ), "viewmag-", Key_Minus, _treemapZoomOut = new KAction( i18n( "Zoom out" ), "viewmag-", Key_Minus,
this, SLOT( treemapZoomOut() ), TQT_TQOBJECT(this), TQT_SLOT( treemapZoomOut() ),
actionCollection(), "treemap_zoom_out" ); actionCollection(), "treemap_zoom_out" );
_treemapSelectParent= new KAction( i18n( "Select Parent" ), "up", Key_Asterisk, _treemapSelectParent= new KAction( i18n( "Select Parent" ), "up", Key_Asterisk,
this, SLOT( treemapSelectParent() ), TQT_TQOBJECT(this), TQT_SLOT( treemapSelectParent() ),
actionCollection(), "treemap_select_parent" ); actionCollection(), "treemap_select_parent" );
_treemapRebuild = new KAction( i18n( "Rebuild Treemap" ), 0, _treemapRebuild = new KAction( i18n( "Rebuild Treemap" ), 0,
this, SLOT( treemapRebuild() ), TQT_TQOBJECT(this), TQT_SLOT( treemapRebuild() ),
actionCollection(), "treemap_rebuild" ); actionCollection(), "treemap_rebuild" );
_showTreemapView = new KToggleAction( i18n( "Show Treemap" ), Key_F9, _showTreemapView = new KToggleAction( i18n( "Show Treemap" ), Key_F9,
this, SLOT( toggleTreemapView() ), TQT_TQOBJECT(this), TQT_SLOT( toggleTreemapView() ),
actionCollection(), "options_show_treemap" ); actionCollection(), "options_show_treemap" );
new KAction( i18n( "Help about Treemaps" ), "help", 0, new KAction( i18n( "Help about Treemaps" ), "help", 0,
this, SLOT( treemapHelp() ), TQT_TQOBJECT(this), TQT_SLOT( treemapHelp() ),
actionCollection(), "treemap_help" ); actionCollection(), "treemap_help" );
KAction * pref = KStdAction::preferences( this, SLOT( preferences() ), actionCollection() ); KAction * pref = KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT( preferences() ), actionCollection() );
_reportMailToOwner = new KAction( i18n( "Send &Mail to Owner" ), "mail_generic", 0, _reportMailToOwner = new KAction( i18n( "Send &Mail to Owner" ), "mail_generic", 0,
_treeView, SLOT( sendMailToOwner() ), TQT_TQOBJECT(_treeView), TQT_SLOT( sendMailToOwner() ),
actionCollection(), "report_mail_to_owner" ); actionCollection(), "report_mail_to_owner" );
_helpSendFeedbackMail = new KAction( i18n( "Send &Feedback Mail..." ), 0, _helpSendFeedbackMail = new KAction( i18n( "Send &Feedback Mail..." ), 0,
this, SLOT( sendFeedbackMail() ), TQT_TQOBJECT(this), TQT_SLOT( sendFeedbackMail() ),
actionCollection(), "help_send_feedback_mail" ); actionCollection(), "help_send_feedback_mail" );
@ -226,7 +226,7 @@ KDirStatApp::initActions()
_showTreemapView->setStatusText ( i18n( "Enables/disables the treemap view" ) ); _showTreemapView->setStatusText ( i18n( "Enables/disables the treemap view" ) );
_treemapZoomIn->setStatusText ( i18n( "Zoom treemap in" ) ); _treemapZoomIn->setStatusText ( i18n( "Zoom treemap in" ) );
_treemapZoomOut->setStatusText ( i18n( "Zoom treemap out" ) ); _treemapZoomOut->setStatusText ( i18n( "Zoom treemap out" ) );
_treemapSelectParent->setStatusText ( i18n( "Select parent" ) ); _treemapSelectParent->setStatusText ( i18n( "Select tqparent" ) );
_treemapRebuild->setStatusText ( i18n( "Rebuild treemap to fit into available space" ) ); _treemapRebuild->setStatusText ( i18n( "Rebuild treemap to fit into available space" ) );
pref->setStatusText ( i18n( "Opens the preferences dialog" ) ); pref->setStatusText ( i18n( "Opens the preferences dialog" ) );
_reportMailToOwner->setStatusText ( i18n( "Sends a mail to the owner of the selected subtree" ) ); _reportMailToOwner->setStatusText ( i18n( "Sends a mail to the owner of the selected subtree" ) );
@ -242,14 +242,14 @@ KDirStatApp::initCleanups()
_cleanupCollection->addUserCleanups( USER_CLEANUPS ); _cleanupCollection->addUserCleanups( USER_CLEANUPS );
_cleanupCollection->slotReadConfig(); _cleanupCollection->slotReadConfig();
connect( _treeView, SIGNAL( selectionChanged( KFileInfo * ) ), connect( _treeView, TQT_SIGNAL( selectionChanged( KFileInfo * ) ),
_cleanupCollection, SIGNAL( selectionChanged( KFileInfo * ) ) ); _cleanupCollection, TQT_SIGNAL( selectionChanged( KFileInfo * ) ) );
connect( this, SIGNAL( readConfig( void ) ), connect( this, TQT_SIGNAL( readConfig( void ) ),
_cleanupCollection, SIGNAL( readConfig( void ) ) ); _cleanupCollection, TQT_SIGNAL( readConfig( void ) ) );
connect( this, SIGNAL( saveConfig( void ) ), connect( this, TQT_SIGNAL( saveConfig( void ) ),
_cleanupCollection, SIGNAL( saveConfig( void ) ) ); _cleanupCollection, TQT_SIGNAL( saveConfig( void ) ) );
} }
@ -276,12 +276,12 @@ KDirStatApp::initPacMan( bool enablePacMan )
toolBar()->insertWidget( id, PACMAN_WIDTH, _pacMan ); toolBar()->insertWidget( id, PACMAN_WIDTH, _pacMan );
toolBar()->setItemAutoSized( id, false ); toolBar()->setItemAutoSized( id, false );
_pacManDelimiter = new QWidget( toolBar() ); _pacManDelimiter = new TQWidget( toolBar() );
toolBar()->insertWidget( ++id, 1, _pacManDelimiter ); toolBar()->insertWidget( ++id, 1, _pacManDelimiter );
connect( _treeView, SIGNAL( startingReading() ), _pacMan, SLOT( start() ) ); connect( _treeView, TQT_SIGNAL( startingReading() ), _pacMan, TQT_SLOT( start() ) );
connect( _treeView, SIGNAL( finished() ), _pacMan, SLOT( stop () ) ); connect( _treeView, TQT_SIGNAL( finished() ), _pacMan, TQT_SLOT( stop () ) );
connect( _treeView, SIGNAL( aborted() ), _pacMan, SLOT( stop () ) ); connect( _treeView, TQT_SIGNAL( aborted() ), _pacMan, TQT_SLOT( stop () ) );
} }
} }
else else
@ -314,17 +314,17 @@ KDirStatApp::initActivityTracker()
if ( ! doFeedbackReminder() ) if ( ! doFeedbackReminder() )
return; return;
_activityTracker = new KActivityTracker( this, "Feedback", _activityTracker = new KActivityTracker( TQT_TQOBJECT(this), "Feedback",
INITIAL_FEEDBACK_REMINDER ); INITIAL_FEEDBACK_REMINDER );
connect( _activityTracker, SIGNAL( thresholdReached() ), connect( _activityTracker, TQT_SIGNAL( thresholdReached() ),
this, SLOT ( askForFeedback() ) ); this, TQT_SLOT ( askForFeedback() ) );
connect( _treeView, SIGNAL( userActivity( int ) ), connect( _treeView, TQT_SIGNAL( userActivity( int ) ),
_activityTracker, SLOT ( trackActivity( int ) ) ); _activityTracker, TQT_SLOT ( trackActivity( int ) ) );
connect( _cleanupCollection, SIGNAL( userActivity( int ) ), connect( _cleanupCollection, TQT_SIGNAL( userActivity( int ) ),
_activityTracker, SLOT ( trackActivity( int ) ) ); _activityTracker, TQT_SLOT ( trackActivity( int ) ) );
} }
@ -348,7 +348,7 @@ void KDirStatApp::readMainWinConfig()
KConfig * config = kapp->config(); KConfig * config = kapp->config();
config->setGroup( "General Options" ); config->setGroup( "General Options" );
// Status settings of the various bars and views // tqStatus settings of the various bars and views
_showToolBar->setChecked( config->readBoolEntry( "Show Toolbar", true ) ); _showToolBar->setChecked( config->readBoolEntry( "Show Toolbar", true ) );
toggleToolBar(); toggleToolBar();
@ -371,7 +371,7 @@ void KDirStatApp::readMainWinConfig()
// initialize the recent file list // initialize the recent file list
_fileOpenRecent->loadEntries( config,"Recent Files" ); _fileOpenRecent->loadEntries( config,"Recent Files" );
QSize size = config->readSizeEntry( "Geometry" ); TQSize size = config->readSizeEntry( "Geometry" );
if( ! size.isEmpty() ) if( ! size.isEmpty() )
resize( size ); resize( size );
@ -443,7 +443,7 @@ KDirStatApp::fileAskOpenDir()
{ {
statusMsg( i18n( "Opening directory..." ) ); statusMsg( i18n( "Opening directory..." ) );
KURL url = KFileDialog::getExistingDirectory( QString::null, this, i18n( "Open Directory..." ) ); KURL url = KFileDialog::getExistingDirectory( TQString(), this, i18n( "Open Directory..." ) );
if( ! url.isEmpty() ) if( ! url.isEmpty() )
openURL( fixedUrl( url.url() ) ); openURL( fixedUrl( url.url() ) );
@ -457,7 +457,7 @@ KDirStatApp::fileAskOpenUrl()
{ {
statusMsg( i18n( "Opening URL..." ) ); statusMsg( i18n( "Opening URL..." ) );
KURL url = KURLRequesterDlg::getURL( QString::null, // startDir KURL url = KURLRequesterDlg::getURL( TQString(), // startDir
this, i18n( "Open URL..." ) ); this, i18n( "Open URL..." ) );
if( ! url.isEmpty() ) if( ! url.isEmpty() )
@ -524,7 +524,7 @@ void
KDirStatApp::editCopy() KDirStatApp::editCopy()
{ {
if ( _treeView->selection() ) if ( _treeView->selection() )
kapp->clipboard()->setText( QString::fromLocal8Bit(_treeView->selection()->orig()->url()) ); kapp->clipboard()->setText( TQString::fromLocal8Bit(_treeView->selection()->orig()->url()) );
#if 0 #if 0
#warning debug #warning debug
@ -568,7 +568,7 @@ KDirStatApp::selectionChanged( KFileInfo *selection )
else else
_fileContinueReadingAtMountPoint->setEnabled( false ); _fileContinueReadingAtMountPoint->setEnabled( false );
statusMsg( QString::fromLocal8Bit(selection->url()) ); statusMsg( TQString::fromLocal8Bit(selection->url()) );
} }
else else
{ {
@ -767,7 +767,7 @@ KDirStatApp::doFeedbackReminder()
void void
KDirStatApp::statusMsg( const QString &text ) KDirStatApp::statusMsg( const TQString &text )
{ {
// Change status message permanently // Change status message permanently
@ -777,7 +777,7 @@ KDirStatApp::statusMsg( const QString &text )
void void
KDirStatApp::contextMenu( KDirTreeViewItem * item, const QPoint &pos ) KDirStatApp::contextMenu( KDirTreeViewItem * item, const TQPoint &pos )
{ {
NOT_USED( item ); NOT_USED( item );
@ -787,7 +787,7 @@ KDirStatApp::contextMenu( KDirTreeViewItem * item, const QPoint &pos )
void void
KDirStatApp::contextMenu( KTreemapTile * tile, const QPoint &pos ) KDirStatApp::contextMenu( KTreemapTile * tile, const TQPoint &pos )
{ {
NOT_USED( tile ); NOT_USED( tile );
@ -806,25 +806,25 @@ KDirStatApp::createTreemapView()
delete _treemapView; delete _treemapView;
_treemapView = new KTreemapView( _treeView->tree(), _splitter, _treemapView = new KTreemapView( _treeView->tree(), _splitter,
QSize( _splitter->width(), _treemapViewHeight ) ); TQSize( _splitter->width(), _treemapViewHeight ) );
CHECK_PTR( _treemapView ); CHECK_PTR( _treemapView );
connect( _treemapView, SIGNAL( contextMenu( KTreemapTile *, const QPoint & ) ), connect( _treemapView, TQT_SIGNAL( contextMenu( KTreemapTile *, const TQPoint & ) ),
this, SLOT ( contextMenu( KTreemapTile *, const QPoint & ) ) ); this, TQT_SLOT ( contextMenu( KTreemapTile *, const TQPoint & ) ) );
connect( _treemapView, SIGNAL( treemapChanged() ), connect( _treemapView, TQT_SIGNAL( treemapChanged() ),
this, SLOT ( updateActions() ) ); this, TQT_SLOT ( updateActions() ) );
connect( _treemapView, SIGNAL( selectionChanged( KFileInfo * ) ), connect( _treemapView, TQT_SIGNAL( selectionChanged( KFileInfo * ) ),
this, SLOT ( selectionChanged( KFileInfo * ) ) ); this, TQT_SLOT ( selectionChanged( KFileInfo * ) ) );
if ( _activityTracker ) if ( _activityTracker )
{ {
connect( _treemapView, SIGNAL( userActivity ( int ) ), connect( _treemapView, TQT_SIGNAL( userActivity ( int ) ),
_activityTracker, SLOT ( trackActivity( int ) ) ); _activityTracker, TQT_SLOT ( trackActivity( int ) ) );
} }
_treemapView->show(); // QSplitter needs explicit show() for new children _treemapView->show(); // TQSplitter needs explicit show() for new tqchildren
updateActions(); updateActions();
} }

@ -24,8 +24,8 @@
// Forward declarations // Forward declarations
class QPopupMenu; class TQPopupMenu;
class QSplitter; class TQSplitter;
class KAction; class KAction;
class KActivityTracker; class KActivityTracker;
@ -71,6 +71,7 @@ using namespace KDirStat;
class KDirStatApp : public KMainWindow class KDirStatApp : public KMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -78,7 +79,7 @@ public:
* Construtor of KDirStatApp, calls all init functions to create the * Construtor of KDirStatApp, calls all init functions to create the
* application. * application.
**/ **/
KDirStatApp( QWidget* parent=0, const char* name=0 ); KDirStatApp( TQWidget* tqparent=0, const char* name=0 );
/** /**
* Destructor. * Destructor.
@ -184,7 +185,7 @@ public slots:
void treemapZoomOut(); void treemapZoomOut();
/** /**
* Select the parent of the currently selected treemap tile. * Select the tqparent of the currently selected treemap tile.
**/ **/
void treemapSelectParent(); void treemapSelectParent();
@ -209,17 +210,17 @@ public slots:
* *
* @param text the text that is displayed in the statusbar * @param text the text that is displayed in the statusbar
**/ **/
void statusMsg( const QString &text ); void statusMsg( const TQString &text );
/** /**
* Opens a context menu for tree view items. * Opens a context menu for tree view items.
**/ **/
void contextMenu( KDirTreeViewItem * item, const QPoint &pos ); void contextMenu( KDirTreeViewItem * item, const TQPoint &pos );
/** /**
* Opens a context menu for treemap tiles. * Opens a context menu for treemap tiles.
**/ **/
void contextMenu( KTreemapTile * tile, const QPoint &pos ); void contextMenu( KTreemapTile * tile, const TQPoint &pos );
/** /**
* Create a treemap view. This makes only sense after a directory tree is * Create a treemap view. This makes only sense after a directory tree is
@ -373,13 +374,13 @@ protected:
// Widgets // Widgets
QSplitter * _splitter; TQSplitter * _splitter;
KDirTreeView * _treeView; KDirTreeView * _treeView;
KTreemapView * _treemapView; KTreemapView * _treemapView;
KPacMan * _pacMan; KPacMan * _pacMan;
QWidget * _pacManDelimiter; TQWidget * _pacManDelimiter;
QPopupMenu * _treeViewContextMenu; TQPopupMenu * _treeViewContextMenu;
QPopupMenu * _treemapContextMenu; TQPopupMenu * _treemapContextMenu;
KDirStat::KSettingsDialog * _settingsDialog; KDirStat::KSettingsDialog * _settingsDialog;
KFeedbackDialog * _feedbackDialog; KFeedbackDialog * _feedbackDialog;
KActivityTracker * _activityTracker; KActivityTracker * _activityTracker;

@ -24,8 +24,8 @@ KDirStatApp::sendFeedbackMail()
_feedbackDialog = new KFeedbackDialog( "sh@suse.de", "feedback_mail" ); _feedbackDialog = new KFeedbackDialog( "sh@suse.de", "feedback_mail" );
CHECK_PTR( _feedbackDialog ); CHECK_PTR( _feedbackDialog );
connect( _feedbackDialog->form(), SIGNAL( mailSent() ), connect( _feedbackDialog->form(), TQT_SIGNAL( mailSent() ),
this, SLOT( feedbackMailSent() ) ); this, TQT_SLOT( feedbackMailSent() ) );
KFeedbackQuestionList * list = _feedbackDialog->form()->questionList(); KFeedbackQuestionList * list = _feedbackDialog->form()->questionList();

@ -8,17 +8,17 @@
*/ */
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qslider.h> #include <tqslider.h>
#include <qvbox.h> #include <tqvbox.h>
#include <qhgroupbox.h> #include <tqhgroupbox.h>
#include <qvgroupbox.h> #include <tqvgroupbox.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <kcolorbutton.h> #include <kcolorbutton.h>
#include <klocale.h> #include <klocale.h>
@ -37,31 +37,31 @@ KSettingsDialog::KSettingsDialog( KDirStatApp *mainWin )
i18n( "Settings" ), // caption i18n( "Settings" ), // caption
Ok | Apply | Default | Cancel | Help, // buttonMask Ok | Apply | Default | Cancel | Help, // buttonMask
Ok, // defaultButton Ok, // defaultButton
0, // parent 0, // tqparent
0, // name 0, // name
false ) // modal false ) // modal
, _mainWin( mainWin ) , _mainWin( mainWin )
{ {
/** /**
* This may seem like overkill, but I didn't find any other way to get * This may seem like overkill, but I didn't find any other way to get
* geometry management right with KDialogBase, yet maintain a modular and * tqgeometry management right with KDialogBase, yet maintain a modular and
* object-oriented design: * object-oriented design:
* *
* Each individual settings page is added with 'addVBoxPage()' to get some * Each individual settings page is added with 'addVBoxPage()' to get some
* initial geometry management. Only then can some generic widget be added * initial tqgeometry management. Only then can some generic widget be added
* into this - and I WANT my settings pages to be generic widgets. I want * into this - and I WANT my settings pages to be generic widgets. I want
* them to be self-sufficient - no monolithic mess of widget creation in my * them to be self-sufficient - no monolithic mess of widget creation in my
* code, intermixed with all kinds of layout objects. * code, intermixed with all kinds of tqlayout objects.
* *
* The ordinary KDialogBase::addPage() just creates a QFrame which is too * The ordinary KDialogBase::addPage() just creates a TQFrame which is too
* dumb for any kind of geometry management - it cannot even handle one * dumb for any kind of tqgeometry management - it cannot even handle one
* single child right. So, let's have KDialogBase create something more * single child right. So, let's have KDialogBase create something more
* intelligent: A QVBox (which is derived from QFrame anyway). This QVBox * intelligent: A TQVBox (which is derived from TQFrame anyway). This TQVBox
* gets only one child - the KSettingsPage. This KSettingsPage handles its * gets only one child - the KSettingsPage. This KSettingsPage handles its
* own layout. * own tqlayout.
**/ **/
QWidget * page; TQWidget * page;
page = addVBoxPage( i18n( "&Cleanups" ) ); page = addVBoxPage( i18n( "&Cleanups" ) );
_cleanupsPageIndex = pageIndex( page ); _cleanupsPageIndex = pageIndex( page );
@ -79,7 +79,7 @@ KSettingsDialog::KSettingsDialog( KDirStatApp *mainWin )
_generalSettingsPageIndex = pageIndex( page ); _generalSettingsPageIndex = pageIndex( page );
new KGeneralSettingsPage( this, page, _mainWin ); new KGeneralSettingsPage( this, page, _mainWin );
// resize( sizeHint() ); // resize( tqsizeHint() );
} }
@ -116,7 +116,7 @@ KSettingsDialog::slotDefault()
void void
KSettingsDialog::slotHelp() KSettingsDialog::slotHelp()
{ {
QString helpTopic = ""; TQString helpTopic = "";
if ( activePageIndex() == _cleanupsPageIndex ) helpTopic = "configuring_cleanups"; if ( activePageIndex() == _cleanupsPageIndex ) helpTopic = "configuring_cleanups";
else if ( activePageIndex() == _treeColorsPageIndex ) helpTopic = "tree_colors"; else if ( activePageIndex() == _treeColorsPageIndex ) helpTopic = "tree_colors";
@ -132,20 +132,20 @@ KSettingsDialog::slotHelp()
KSettingsPage::KSettingsPage( KSettingsDialog * dialog, KSettingsPage::KSettingsPage( KSettingsDialog * dialog,
QWidget * parent ) TQWidget * tqparent )
: QWidget( parent ) : TQWidget( tqparent )
{ {
connect( dialog, SIGNAL( aboutToShow ( void ) ), connect( dialog, TQT_SIGNAL( aboutToShow ( void ) ),
this, SLOT ( setup ( void ) ) ); this, TQT_SLOT ( setup ( void ) ) );
connect( dialog, SIGNAL( okClicked ( void ) ), connect( dialog, TQT_SIGNAL( okClicked ( void ) ),
this, SLOT ( apply ( void ) ) ); this, TQT_SLOT ( apply ( void ) ) );
connect( dialog, SIGNAL( applyClicked ( void ) ), connect( dialog, TQT_SIGNAL( applyClicked ( void ) ),
this, SLOT ( apply ( void ) ) ); this, TQT_SLOT ( apply ( void ) ) );
connect( dialog, SIGNAL( defaultClicked ( void ) ), connect( dialog, TQT_SIGNAL( defaultClicked ( void ) ),
this, SLOT ( revertToDefaults( void ) ) ); this, TQT_SLOT ( revertToDefaults( void ) ) );
} }
@ -159,23 +159,23 @@ KSettingsPage::~KSettingsPage()
KTreeColorsPage::KTreeColorsPage( KSettingsDialog * dialog, KTreeColorsPage::KTreeColorsPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ) KDirStatApp * mainWin )
: KSettingsPage( dialog, parent ) : KSettingsPage( dialog, tqparent )
, _mainWin( mainWin ) , _mainWin( mainWin )
, _treeView( mainWin->treeView() ) , _treeView( mainWin->treeView() )
, _maxButtons( KDirStatSettingsMaxColorButton ) , _maxButtons( KDirStatSettingsMaxColorButton )
{ {
// Outer layout box // Outer tqlayout box
QHBoxLayout * outerBox = new QHBoxLayout( this, TQHBoxLayout * outerBox = new TQHBoxLayout( this,
0, // border 0, // border
dialog->spacingHint() ); dialog->spacingHint() );
// Inner layout box with a column of color buttons // Inner tqlayout box with a column of color buttons
QGridLayout *grid = new QGridLayout( _maxButtons, // rows TQGridLayout *grid = new TQGridLayout( _maxButtons, // rows
_maxButtons + 1, // cols _maxButtons + 1, // cols
dialog->spacingHint() ); dialog->spacingHint() );
outerBox->addLayout( grid, 1 ); outerBox->addLayout( grid, 1 );
@ -188,32 +188,32 @@ KTreeColorsPage::KTreeColorsPage( KSettingsDialog * dialog,
for ( int i=0; i < _maxButtons; i++ ) for ( int i=0; i < _maxButtons; i++ )
{ {
QString labelText; TQString labelText;
labelText=i18n( "Tree Level %1" ).arg(i+1); labelText=i18n( "Tree Level %1" ).tqarg(i+1);
_colorLabel[i] = new QLabel( labelText, this ); _colorLabel[i] = new TQLabel( labelText, this );
grid->addWidget( _colorLabel [i], i, 0 ); grid->addWidget( _colorLabel [i], i, 0 );
_colorButton[i] = new KColorButton( this ); _colorButton[i] = new KColorButton( this );
_colorButton[i]->setMinimumSize( QSize( 80, 10 ) ); _colorButton[i]->setMinimumSize( TQSize( 80, 10 ) );
grid->addMultiCellWidget( _colorButton [i], i, i, i+1, _maxButtons ); grid->addMultiCellWidget( _colorButton [i], i, i, i+1, _maxButtons );
grid->setRowStretch( i, 1 ); grid->setRowStretch( i, 1 );
} }
// Vertical slider //Qt::Vertical slider
_slider = new QSlider( 1, // minValue _slider = new TQSlider( 1, // minValue
_maxButtons, // maxValue _maxButtons, // maxValue
1, // pageStep 1, // pageStep
1, // value 1, // value
QSlider::Vertical, Qt::Vertical,
this ); this );
outerBox->addWidget( _slider, 0 ); outerBox->addWidget( _slider, 0 );
outerBox->activate(); outerBox->activate();
connect( _slider, SIGNAL( valueChanged( int ) ), connect( _slider, TQT_SIGNAL( valueChanged( int ) ),
this, SLOT ( enableColors( int ) ) ); this, TQT_SLOT ( enableColors( int ) ) );
} }
@ -274,9 +274,9 @@ KTreeColorsPage::enableColors( int maxColors )
KCleanupPage::KCleanupPage( KSettingsDialog * dialog, KCleanupPage::KCleanupPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ) KDirStatApp * mainWin )
: KSettingsPage( dialog, parent ) : KSettingsPage( dialog, tqparent )
, _mainWin( mainWin ) , _mainWin( mainWin )
, _currentCleanup( 0 ) , _currentCleanup( 0 )
{ {
@ -284,9 +284,9 @@ KCleanupPage::KCleanupPage( KSettingsDialog * dialog,
_workCleanupCollection = *mainWin->cleanupCollection(); _workCleanupCollection = *mainWin->cleanupCollection();
// Create layout and widgets. // Create tqlayout and widgets.
QHBoxLayout * layout = new QHBoxLayout( this, TQHBoxLayout * tqlayout = new TQHBoxLayout( this,
0, // border 0, // border
dialog->spacingHint() ); // spacing dialog->spacingHint() ); // spacing
_listBox = new KCleanupListBox( this ); _listBox = new KCleanupListBox( this );
@ -298,21 +298,21 @@ KCleanupPage::KCleanupPage( KSettingsDialog * dialog,
// clicks on a different cleanup in the list, the properties page // clicks on a different cleanup in the list, the properties page
// will display that cleanup's values. // will display that cleanup's values.
connect( _listBox, SIGNAL( selectCleanup( KCleanup * ) ), connect( _listBox, TQT_SIGNAL( selectCleanup( KCleanup * ) ),
this, SLOT ( changeCleanup( KCleanup * ) ) ); this, TQT_SLOT ( changeCleanup( KCleanup * ) ) );
// Fill list box so it can determine a reasonable startup geometry - that // Fill list box so it can determine a reasonable startup tqgeometry - that
// doesn't work if it happens only later. // doesn't work if it happens only later.
setup(); setup();
// Now that _listBox will (hopefully) have determined a reasonable // Now that _listBox will (hopefully) have determined a reasonable
// default geometry, add the widgets to the layout. // default tqgeometry, add the widgets to the tqlayout.
layout->addWidget( _listBox, 0 ); tqlayout->addWidget( _listBox, 0 );
layout->addWidget( _props , 1 ); tqlayout->addWidget( _props , 1 );
layout->activate(); tqlayout->activate();
} }
@ -370,7 +370,7 @@ KCleanupPage::setup()
// (Re-) Initialize list box. // (Re-) Initialize list box.
// _listBox->resize( _listBox->sizeHint() ); // _listBox->resize( _listBox->tqsizeHint() );
_listBox->setSelected( 0, true ); _listBox->setSelected( 0, true );
} }
@ -425,34 +425,34 @@ KCleanupPage::storeProps( KCleanup * cleanup )
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
KCleanupListBox::KCleanupListBox( QWidget *parent ) KCleanupListBox::KCleanupListBox( TQWidget *tqparent )
: QListBox( parent ) : TQListBox( tqparent )
{ {
_selection = 0; _selection = 0;
connect( this, connect( this,
SIGNAL( selectionChanged( QListBoxItem *) ), TQT_SIGNAL( selectionChanged( TQListBoxItem *) ),
SLOT ( selectCleanup ( QListBoxItem *) ) ); TQT_SLOT ( selectCleanup ( TQListBoxItem *) ) );
} }
QSize TQSize
KCleanupListBox::sizeHint() const KCleanupListBox::tqsizeHint() const
{ {
// FIXME: Is this still needed with Qt 2.x? // FIXME: Is this still needed with TQt 2.x?
if ( count() < 1 ) if ( count() < 1 )
{ {
// As long as the list is empty, sizeHint() would default to // As long as the list is empty, tqsizeHint() would default to
// (0,0) which is ALWAYS just a pain in the ass. We'd rather // (0,0) which is ALWAYS just a pain in the ass. We'd rather
// have an absolutely random value than this. // have an absolutely random value than this.
return QSize( 100, 100 ); return TQSize( 100, 100 );
} }
else else
{ {
// Calculate the list contents and take 3D frames (2*2 pixels) // Calculate the list contents and take 3D frames (2*2 pixels)
// into account. // into account.
return QSize ( maxItemWidth() + 5, return TQSize ( maxItemWidth() + 5,
count() * itemHeight( 0 ) + 4 ); count() * itemHeight( 0 ) + 4 );
} }
} }
@ -470,7 +470,7 @@ KCleanupListBox::insert( KCleanup * cleanup )
void void
KCleanupListBox::selectCleanup( QListBoxItem * listBoxItem ) KCleanupListBox::selectCleanup( TQListBoxItem * listBoxItem )
{ {
KCleanupListBoxItem * item = (KCleanupListBoxItem *) listBoxItem; KCleanupListBoxItem * item = (KCleanupListBoxItem *) listBoxItem;
@ -499,7 +499,7 @@ KCleanupListBox::updateTitle( KCleanup * cleanup )
KCleanupListBoxItem::KCleanupListBoxItem( KCleanupListBox * listBox, KCleanupListBoxItem::KCleanupListBoxItem( KCleanupListBox * listBox,
KCleanup * cleanup ) KCleanup * cleanup )
: QListBoxText( listBox ) : TQListBoxText( listBox )
, _cleanup( cleanup ) , _cleanup( cleanup )
{ {
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
@ -517,37 +517,37 @@ KCleanupListBoxItem::updateTitle()
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent, KCleanupPropertiesPage::KCleanupPropertiesPage( TQWidget * tqparent,
KDirStatApp * mainWin ) KDirStatApp * mainWin )
: QWidget( parent ) : TQWidget( tqparent )
, _mainWin( mainWin ) , _mainWin( mainWin )
{ {
QVBoxLayout *outerBox = new QVBoxLayout( this, 0, 0 ); // border, spacing TQVBoxLayout *outerBox = new TQVBoxLayout( this, 0, 0 ); // border, spacing
// The topmost check box: "Enabled". // The topmost check box: "Enabled".
_enabled = new QCheckBox( i18n( "&Enabled" ), this ); _enabled = new TQCheckBox( i18n( "&Enabled" ), this );
outerBox->addWidget( _enabled, 0 ); outerBox->addWidget( _enabled, 0 );
outerBox->addSpacing( 7 ); outerBox->addSpacing( 7 );
outerBox->addStretch(); outerBox->addStretch();
connect( _enabled, SIGNAL( toggled ( bool ) ), connect( _enabled, TQT_SIGNAL( toggled ( bool ) ),
this, SLOT ( enableFields( bool ) ) ); this, TQT_SLOT ( enableFields( bool ) ) );
// All other widgets of this page are grouped together in a // All other widgets of this page are grouped together in a
// separate subwidget so they can all be enabled / disabled // separate subwidget so they can all be enabled / disabled
// together. // together.
_fields = new QWidget( this ); _fields = new TQWidget( this );
outerBox->addWidget( _fields, 1 ); outerBox->addWidget( _fields, 1 );
QVBoxLayout *fieldsBox = new QVBoxLayout( _fields ); TQVBoxLayout *fieldsBox = new TQVBoxLayout( _fields );
// Grid layout for the edit fields, their labels, some // Grid tqlayout for the edit fields, their labels, some
// explanatory text and the "recurse?" check box. // explanatory text and the "recurse?" check box.
QGridLayout *grid = new QGridLayout( 7, // rows TQGridLayout *grid = new TQGridLayout( 7, // rows
2, // cols 2, // cols
4 ); // spacing 4 ); // spacing
fieldsBox->addLayout( grid, 0 ); fieldsBox->addLayout( grid, 0 );
@ -560,60 +560,60 @@ KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent,
// Edit fields for cleanup action title and command line. // Edit fields for cleanup action title and command line.
QLabel *label; TQLabel *label;
_title = new QLineEdit( _fields ); grid->addWidget( _title, 0, 1 ); _title = new TQLineEdit( _fields ); grid->addWidget( _title, 0, 1 );
_command = new QLineEdit( _fields ); grid->addWidget( _command, 1, 1 ); _command = new TQLineEdit( _fields ); grid->addWidget( _command, 1, 1 );
label = new QLabel( _title, i18n( "&Title:" ), _fields ); grid->addWidget( label, 0, 0 ); label = new TQLabel( _title, i18n( "&Title:" ), _fields ); grid->addWidget( label, 0, 0 );
label = new QLabel( _command, i18n( "&Command Line:" ), _fields ); grid->addWidget( label, 1, 0 ); label = new TQLabel( _command, i18n( "&Command Line:" ), _fields ); grid->addWidget( label, 1, 0 );
label = new QLabel( i18n( "%p Full Path" ), _fields ); label = new TQLabel( i18n( "%p Full Path" ), _fields );
grid->addWidget( label, 2, 1 ); grid->addWidget( label, 2, 1 );
label = new QLabel( i18n( "%n File / Directory Name Without Path" ), _fields ); label = new TQLabel( i18n( "%n File / Directory Name Without Path" ), _fields );
grid->addWidget( label, 3, 1 ); grid->addWidget( label, 3, 1 );
label = new QLabel( i18n( "%t KDE Trash Directory" ), _fields ); label = new TQLabel( i18n( "%t KDE Trash Directory" ), _fields );
grid->addWidget( label, 4, 1 ); grid->addWidget( label, 4, 1 );
// "Recurse into subdirs" check box // "Recurse into subdirs" check box
_recurse = new QCheckBox( i18n( "&Recurse into Subdirectories" ), _fields ); _recurse = new TQCheckBox( i18n( "&Recurse into Subdirectories" ), _fields );
grid->addWidget( _recurse, 5, 1 ); grid->addWidget( _recurse, 5, 1 );
// "Ask for confirmation" check box // "Ask for confirmation" check box
_askForConfirmation = new QCheckBox( i18n( "&Ask for Confirmation" ), _fields ); _askForConfirmation = new TQCheckBox( i18n( "&Ask for Confirmation" ), _fields );
grid->addWidget( _askForConfirmation, 6, 1 ); grid->addWidget( _askForConfirmation, 6, 1 );
// The "Works for..." check boxes, grouped together in a button group. // The "Works for..." check boxes, grouped together in a button group.
QButtonGroup *worksFor = new QButtonGroup( i18n( "Works for..." ), _fields ); TQButtonGroup *worksFor = new TQButtonGroup( i18n( "Works for..." ), _fields );
QVBoxLayout *worksForBox = new QVBoxLayout( worksFor, 15, 2 ); TQVBoxLayout *worksForBox = new TQVBoxLayout( worksFor, 15, 2 );
fieldsBox->addWidget( worksFor, 0 ); fieldsBox->addWidget( worksFor, 0 );
fieldsBox->addSpacing( 5 ); fieldsBox->addSpacing( 5 );
fieldsBox->addStretch(); fieldsBox->addStretch();
_worksForDir = new QCheckBox( i18n( "&Directories" ), worksFor ); _worksForDir = new TQCheckBox( i18n( "&Directories" ), worksFor );
_worksForFile = new QCheckBox( i18n( "&Files" ), worksFor ); _worksForFile = new TQCheckBox( i18n( "&Files" ), worksFor );
_worksForDotEntry = new QCheckBox( i18n( "<Files> P&seudo Entries"), worksFor ); _worksForDotEntry = new TQCheckBox( i18n( "<Files> P&seudo Entries"), worksFor );
worksForBox->addWidget( _worksForDir , 1 ); worksForBox->addWidget( _worksForDir , 1 );
worksForBox->addWidget( _worksForFile , 1 ); worksForBox->addWidget( _worksForFile , 1 );
worksForBox->addWidget( _worksForDotEntry , 1 ); worksForBox->addWidget( _worksForDotEntry , 1 );
worksForBox->addSpacing( 5 ); worksForBox->addSpacing( 5 );
_worksForProtocols = new QComboBox( false, worksFor ); _worksForProtocols = new TQComboBox( false, worksFor );
worksForBox->addWidget( _worksForProtocols, 1 ); worksForBox->addWidget( _worksForProtocols, 1 );
_worksForProtocols->insertItem( i18n( "On Local Machine Only ('file:/' Protocol)" ) ); _worksForProtocols->insertItem( i18n( "On Local Machine Only ('file:/' Protocol)" ) );
_worksForProtocols->insertItem( i18n( "Network Transparent (ftp, smb, tar, ...)" ) ); _worksForProtocols->insertItem( i18n( "Network Transparent (ftp, smb, tar, ...)" ) );
// Grid layout for combo boxes at the bottom // Grid tqlayout for combo boxes at the bottom
grid = new QGridLayout( 1, // rows grid = new TQGridLayout( 1, // rows
2, // cols 2, // cols
4 ); // spacing 4 ); // spacing
@ -625,10 +625,10 @@ KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent,
// The "Refresh policy" combo box // The "Refresh policy" combo box
_refreshPolicy = new QComboBox( false, _fields ); _refreshPolicy = new TQComboBox( false, _fields );
grid->addWidget( _refreshPolicy, row, 1 ); grid->addWidget( _refreshPolicy, row, 1 );
label = new QLabel( _refreshPolicy, i18n( "Refresh &Policy:" ), _fields ); label = new TQLabel( _refreshPolicy, i18n( "Refresh &Policy:" ), _fields );
grid->addWidget( label, row++, 0 ); grid->addWidget( label, row++, 0 );
@ -646,7 +646,7 @@ KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent,
outerBox->activate(); outerBox->activate();
setMinimumSize( sizeHint() ); setMinimumSize( tqsizeHint() );
} }
@ -700,34 +700,34 @@ KCleanupPropertiesPage::fields() const
KGeneralSettingsPage::KGeneralSettingsPage( KSettingsDialog * dialog, KGeneralSettingsPage::KGeneralSettingsPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ) KDirStatApp * mainWin )
: KSettingsPage( dialog, parent ) : KSettingsPage( dialog, tqparent )
, _mainWin( mainWin ) , _mainWin( mainWin )
, _treeView( mainWin->treeView() ) , _treeView( mainWin->treeView() )
{ {
// Create layout and widgets. // Create tqlayout and widgets.
QVBoxLayout * layout = new QVBoxLayout( this, 5, // border TQVBoxLayout * tqlayout = new TQVBoxLayout( this, 5, // border
dialog->spacingHint() ); // spacing dialog->spacingHint() ); // spacing
QVGroupBox * gbox = new QVGroupBox( i18n( "Directory Reading" ), this ); TQVGroupBox * gbox = new TQVGroupBox( i18n( "Directory Reading" ), this );
layout->addWidget( gbox ); tqlayout->addWidget( gbox );
_crossFileSystems = new QCheckBox( i18n( "Cross &File System Boundaries" ), gbox ); _crossFileSystems = new TQCheckBox( i18n( "Cross &File System Boundaries" ), gbox );
_enableLocalDirReader = new QCheckBox( i18n( "Use Optimized &Local Directory Read Methods" ), gbox ); _enableLocalDirReader = new TQCheckBox( i18n( "Use Optimized &Local Directory Read Methods" ), gbox );
connect( _enableLocalDirReader, SIGNAL( stateChanged( int ) ), connect( _enableLocalDirReader, TQT_SIGNAL( stateChanged( int ) ),
this, SLOT ( checkEnabledState() ) ); this, TQT_SLOT ( checkEnabledState() ) );
layout->addSpacing( 10 ); tqlayout->addSpacing( 10 );
gbox = new QVGroupBox( i18n( "Animation" ), this ); gbox = new TQVGroupBox( i18n( "Animation" ), this );
layout->addWidget( gbox ); tqlayout->addWidget( gbox );
_enableToolBarAnimation = new QCheckBox( i18n( "P@cM@n Animation in Tool &Bar" ), gbox ); _enableToolBarAnimation = new TQCheckBox( i18n( "P@cM@n Animation in Tool &Bar" ), gbox );
_enableTreeViewAnimation = new QCheckBox( i18n( "P@cM@n Animation in Directory &Tree" ), gbox ); _enableTreeViewAnimation = new TQCheckBox( i18n( "P@cM@n Animation in Directory &Tree" ), gbox );
} }
@ -793,95 +793,95 @@ KGeneralSettingsPage::checkEnabledState()
KTreemapPage::KTreemapPage( KSettingsDialog * dialog, KTreemapPage::KTreemapPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ) KDirStatApp * mainWin )
: KSettingsPage( dialog, parent ) : KSettingsPage( dialog, tqparent )
, _mainWin( mainWin ) , _mainWin( mainWin )
{ {
// kdDebug() << k_funcinfo << endl; // kdDebug() << k_funcinfo << endl;
QVBoxLayout * layout = new QVBoxLayout( this, 0, 0 ); // parent, border, spacing TQVBoxLayout * tqlayout = new TQVBoxLayout( this, 0, 0 ); // tqparent, border, spacing
QVBox * vbox = new QVBox( this ); TQVBox * vbox = new TQVBox( this );
vbox->setSpacing( dialog->spacingHint() ); vbox->setSpacing( dialog->spacingHint() );
layout->addWidget( vbox ); tqlayout->addWidget( vbox );
_squarify = new QCheckBox( i18n( "S&quarify Treemap" ), vbox ); _squarify = new TQCheckBox( i18n( "S&quarify Treemap" ), vbox );
_doCushionShading = new QCheckBox( i18n( "Use C&ushion Shading" ), vbox ); _doCushionShading = new TQCheckBox( i18n( "Use C&ushion Shading" ), vbox );
// Cushion parameters // Cushion parameters
QVGroupBox * gbox = new QVGroupBox( i18n( "Cushion Parameters" ), vbox ); TQVGroupBox * gbox = new TQVGroupBox( i18n( "Cushion Parameters" ), vbox );
_cushionParams = gbox; _cushionParams = gbox;
gbox->addSpace( 7 ); gbox->addSpace( 7 );
gbox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); gbox->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) );
QLabel * label = new QLabel( i18n( "Ambient &Light" ), gbox ); TQLabel * label = new TQLabel( i18n( "Ambient &Light" ), gbox );
QHBox * hbox = new QHBox( gbox ); TQHBox * hbox = new TQHBox( gbox );
_ambientLight = new QSlider ( MinAmbientLight, MaxAmbientLight, 10, // min, max, pageStep _ambientLight = new TQSlider ( MinAmbientLight, MaxAmbientLight, 10, // min, max, pageStep
DefaultAmbientLight, Horizontal, hbox ); DefaultAmbientLight,Qt::Horizontal, hbox );
_ambientLightSB = new QSpinBox( MinAmbientLight, MaxAmbientLight, 1, // min, max, step _ambientLightSB = new TQSpinBox( MinAmbientLight, MaxAmbientLight, 1, // min, max, step
hbox ); hbox );
_ambientLightSB->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); _ambientLightSB->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
label->setBuddy( _ambientLightSB ); label->setBuddy( _ambientLightSB );
gbox->addSpace( 7 ); gbox->addSpace( 7 );
label = new QLabel( i18n( "&Height Scale" ), gbox ); label = new TQLabel( i18n( "&Height Scale" ), gbox );
hbox = new QHBox( gbox ); hbox = new TQHBox( gbox );
_heightScalePercent = new QSlider( MinHeightScalePercent, MaxHeightScalePercent, 10, // min, max, pageStep _heightScalePercent = new TQSlider( MinHeightScalePercent, MaxHeightScalePercent, 10, // min, max, pageStep
DefaultHeightScalePercent, Horizontal, hbox ); DefaultHeightScalePercent,Qt::Horizontal, hbox );
_heightScalePercentSB = new QSpinBox( MinHeightScalePercent, MaxHeightScalePercent, 1, // min, max, step _heightScalePercentSB = new TQSpinBox( MinHeightScalePercent, MaxHeightScalePercent, 1, // min, max, step
hbox ); hbox );
_heightScalePercentSB->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); _heightScalePercentSB->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Minimum ) );
label->setBuddy( _heightScalePercentSB ); label->setBuddy( _heightScalePercentSB );
gbox->addSpace( 10 ); gbox->addSpace( 10 );
_ensureContrast = new QCheckBox( i18n( "Draw Lines if Lo&w Contrast" ), gbox ); _ensureContrast = new TQCheckBox( i18n( "Draw Lines if Lo&w Contrast" ), gbox );
hbox = new QHBox( gbox ); hbox = new TQHBox( gbox );
_forceCushionGrid = new QCheckBox( i18n( "Always Draw &Grid" ), hbox ); _forceCushionGrid = new TQCheckBox( i18n( "Always Draw &Grid" ), hbox );
addHStretch( hbox ); addHStretch( hbox );
_cushionGridColorL = new QLabel( " " + i18n( "Gr&id Color: " ), hbox ); _cushionGridColorL = new TQLabel( " " + i18n( "Gr&id Color: " ), hbox );
_cushionGridColor = new KColorButton( hbox ); _cushionGridColor = new KColorButton( hbox );
_cushionGridColorL->setBuddy( _cushionGridColor ); _cushionGridColorL->setBuddy( _cushionGridColor );
_cushionGridColorL->setAlignment( AlignRight | AlignVCenter ); _cushionGridColorL->tqsetAlignment( AlignRight | AlignVCenter );
// addVStretch( vbox ); // addVStretch( vbox );
// Plain treemaps parameters // Plain treemaps parameters
_plainTileParams = new QHGroupBox( i18n( "Colors for Plain Treemaps" ), vbox ); _plainTileParams = new TQHGroupBox( i18n( "Colors for Plain Treemaps" ), vbox );
_plainTileParams->addSpace( 7 ); _plainTileParams->addSpace( 7 );
label = new QLabel( i18n( "&Files: " ), _plainTileParams ); label = new TQLabel( i18n( "&Files: " ), _plainTileParams );
_fileFillColor = new KColorButton( _plainTileParams ); _fileFillColor = new KColorButton( _plainTileParams );
label->setBuddy( _fileFillColor ); label->setBuddy( _fileFillColor );
label->setAlignment( AlignRight | AlignVCenter ); label->tqsetAlignment( AlignRight | AlignVCenter );
label = new QLabel( " " + i18n( "&Directories: " ), _plainTileParams ); label = new TQLabel( " " + i18n( "&Directories: " ), _plainTileParams );
_dirFillColor = new KColorButton( _plainTileParams ); _dirFillColor = new KColorButton( _plainTileParams );
label->setBuddy( _dirFillColor ); label->setBuddy( _dirFillColor );
label->setAlignment( AlignRight | AlignVCenter ); label->tqsetAlignment( AlignRight | AlignVCenter );
label = new QLabel( i18n( "Gr&id: " ), _plainTileParams ); label = new TQLabel( i18n( "Gr&id: " ), _plainTileParams );
_outlineColor = new KColorButton( _plainTileParams ); _outlineColor = new KColorButton( _plainTileParams );
label->setBuddy( _outlineColor ); label->setBuddy( _outlineColor );
label->setAlignment( AlignRight | AlignVCenter ); label->tqsetAlignment( AlignRight | AlignVCenter );
// Misc // Misc
QWidget * gridBox = new QWidget( vbox ); TQWidget * gridBox = new TQWidget( vbox );
QGridLayout * grid = new QGridLayout( gridBox, 2, 3, dialog->spacingHint() ); // rows, cols, spacing TQGridLayout * grid = new TQGridLayout( gridBox, 2, 3, dialog->spacingHint() ); // rows, cols, spacing
grid->setColStretch( 0, 0 ); // (col, stretch) don't stretch this column grid->setColStretch( 0, 0 ); // (col, stretch) don't stretch this column
grid->setColStretch( 1, 0 ); // don't stretch grid->setColStretch( 1, 0 ); // don't stretch
grid->setColStretch( 2, 1 ); // stretch this as you like grid->setColStretch( 2, 1 ); // stretch this as you like
label = new QLabel( i18n( "Hi&ghlight R&ectangle: " ), gridBox ); label = new TQLabel( i18n( "Hi&ghlight R&ectangle: " ), gridBox );
_highlightColor = new KColorButton( gridBox ); _highlightColor = new KColorButton( gridBox );
label->setBuddy( _highlightColor ); label->setBuddy( _highlightColor );
@ -889,35 +889,35 @@ KTreemapPage::KTreemapPage( KSettingsDialog * dialog,
grid->addWidget( _highlightColor, 0, 1 ); grid->addWidget( _highlightColor, 0, 1 );
label = new QLabel( i18n( "Minim&um Treemap Tile Size: " ), gridBox ); label = new TQLabel( i18n( "Minim&um Treemap Tile Size: " ), gridBox );
_minTileSize = new QSpinBox( 0, 30, 1, gridBox ); // min, max, step, parent _minTileSize = new TQSpinBox( 0, 30, 1, gridBox ); // min, max, step, tqparent
label->setBuddy( _minTileSize ); label->setBuddy( _minTileSize );
grid->addWidget( label, 1, 0 ); grid->addWidget( label, 1, 0 );
grid->addWidget( _minTileSize, 1, 1 ); grid->addWidget( _minTileSize, 1, 1 );
_autoResize = new QCheckBox( i18n( "Auto-&Resize Treemap" ), vbox ); _autoResize = new TQCheckBox( i18n( "Auto-&Resize Treemap" ), vbox );
// Connections // Connections
connect( _ambientLight, SIGNAL( valueChanged(int) ), connect( _ambientLight, TQT_SIGNAL( valueChanged(int) ),
_ambientLightSB, SLOT ( setValue (int) ) ); _ambientLightSB, TQT_SLOT ( setValue (int) ) );
connect( _ambientLightSB, SIGNAL( valueChanged(int) ), connect( _ambientLightSB, TQT_SIGNAL( valueChanged(int) ),
_ambientLight, SLOT ( setValue (int) ) ); _ambientLight, TQT_SLOT ( setValue (int) ) );
connect( _heightScalePercent, SIGNAL( valueChanged(int) ), connect( _heightScalePercent, TQT_SIGNAL( valueChanged(int) ),
_heightScalePercentSB, SLOT ( setValue (int) ) ); _heightScalePercentSB, TQT_SLOT ( setValue (int) ) );
connect( _heightScalePercentSB, SIGNAL( valueChanged(int) ), connect( _heightScalePercentSB, TQT_SIGNAL( valueChanged(int) ),
_heightScalePercent, SLOT ( setValue (int) ) ); _heightScalePercent, TQT_SLOT ( setValue (int) ) );
connect( _doCushionShading, SIGNAL( stateChanged( int ) ), this, SLOT( checkEnabledState() ) ); connect( _doCushionShading, TQT_SIGNAL( stateChanged( int ) ), this, TQT_SLOT( checkEnabledState() ) );
connect( _forceCushionGrid, SIGNAL( stateChanged( int ) ), this, SLOT( checkEnabledState() ) ); connect( _forceCushionGrid, TQT_SIGNAL( stateChanged( int ) ), this, TQT_SLOT( checkEnabledState() ) );
checkEnabledState(); checkEnabledState();
} }
@ -971,10 +971,10 @@ KTreemapPage::revertToDefaults()
_minTileSize->setValue( DefaultMinTileSize ); _minTileSize->setValue( DefaultMinTileSize );
_autoResize->setChecked( true ); _autoResize->setChecked( true );
_cushionGridColor->setColor ( QColor( 0x80, 0x80, 0x80 ) ); _cushionGridColor->setColor ( TQColor( 0x80, 0x80, 0x80 ) );
_outlineColor->setColor ( black ); _outlineColor->setColor ( black );
_fileFillColor->setColor ( QColor( 0xde, 0x8d, 0x53 ) ); _fileFillColor->setColor ( TQColor( 0xde, 0x8d, 0x53 ) );
_dirFillColor->setColor ( QColor( 0x10, 0x7d, 0xb4 ) ); _dirFillColor->setColor ( TQColor( 0x10, 0x7d, 0xb4 ) );
_highlightColor->setColor ( red ); _highlightColor->setColor ( red );
} }
@ -995,10 +995,10 @@ KTreemapPage::setup()
_minTileSize->setValue ( config->readNumEntry ( "MinTileSize" , DefaultMinTileSize ) ); _minTileSize->setValue ( config->readNumEntry ( "MinTileSize" , DefaultMinTileSize ) );
_autoResize->setChecked ( config->readBoolEntry( "AutoResize" , true ) ); _autoResize->setChecked ( config->readBoolEntry( "AutoResize" , true ) );
_cushionGridColor->setColor ( readColorEntry( config, "CushionGridColor" , QColor( 0x80, 0x80, 0x80 ) ) ); _cushionGridColor->setColor ( readColorEntry( config, "CushionGridColor" , TQColor( 0x80, 0x80, 0x80 ) ) );
_outlineColor->setColor ( readColorEntry( config, "OutlineColor" , black ) ); _outlineColor->setColor ( readColorEntry( config, "OutlineColor" , black ) );
_fileFillColor->setColor ( readColorEntry( config, "FileFillColor" , QColor( 0xde, 0x8d, 0x53 ) ) ); _fileFillColor->setColor ( readColorEntry( config, "FileFillColor" , TQColor( 0xde, 0x8d, 0x53 ) ) );
_dirFillColor->setColor ( readColorEntry( config, "DirFillColor" , QColor( 0x10, 0x7d, 0xb4 ) ) ); _dirFillColor->setColor ( readColorEntry( config, "DirFillColor" , TQColor( 0x10, 0x7d, 0xb4 ) ) );
_highlightColor->setColor ( readColorEntry( config, "HighlightColor" , red ) ); _highlightColor->setColor ( readColorEntry( config, "HighlightColor" , red ) );
_ambientLightSB->setValue( _ambientLight->value() ); _ambientLightSB->setValue( _ambientLight->value() );
@ -1023,8 +1023,8 @@ KTreemapPage::checkEnabledState()
} }
QColor TQColor
KTreemapPage::readColorEntry( KConfig * config, const char * entryName, QColor defaultColor ) KTreemapPage::readColorEntry( KConfig * config, const char * entryName, TQColor defaultColor )
{ {
return config->readColorEntry( entryName, &defaultColor ); return config->readColorEntry( entryName, &defaultColor );
} }
@ -1032,22 +1032,22 @@ KTreemapPage::readColorEntry( KConfig * config, const char * entryName, QColor d
void void
addHStretch( QWidget * parent ) addHStretch( TQWidget * tqparent )
{ {
QWidget * stretch = new QWidget( parent ); TQWidget * stretch = new TQWidget( tqparent );
stretch->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, // hor stretch->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, // hor
QSizePolicy::Minimum, // vert TQSizePolicy::Minimum, // vert
1, // hstretch 1, // hstretch
0 ) ); // vstretch 0 ) ); // vstretch
} }
void void
addVStretch( QWidget * parent ) addVStretch( TQWidget * tqparent )
{ {
QWidget * stretch = new QWidget( parent ); TQWidget * stretch = new TQWidget( tqparent );
stretch->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, // hor stretch->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, // hor
QSizePolicy::Expanding, // vert TQSizePolicy::Expanding, // vert
0, // hstretch 0, // hstretch
1 ) ); // vstretch 1 ) ); // vstretch
} }

@ -16,23 +16,23 @@
# include <config.h> # include <config.h>
#endif #endif
#include <qlistbox.h> #include <tqlistbox.h>
#include <kdialogbase.h> #include <kdialogbase.h>
#include "kcleanup.h" #include "kcleanup.h"
#include "kcleanupcollection.h" #include "kcleanupcollection.h"
#include "kdirstatapp.h" #include "kdirstatapp.h"
class QCheckBox; class TQCheckBox;
class QComboBox; class TQComboBox;
class QHGroupBox; class TQHGroupBox;
class QLabel; class TQLabel;
class QLineEdit; class TQLineEdit;
class QRadioButton; class TQRadioButton;
class QSlider; class TQSlider;
class QSpinBox; class TQSpinBox;
class QVGroupBox; class TQVGroupBox;
class QWidget; class TQWidget;
class KColorButton; class KColorButton;
@ -56,14 +56,15 @@ namespace KDirStat
class KSettingsDialog: public KDialogBase class KSettingsDialog: public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
* *
* Notice there is no parent widget passed but the application's main * Notice there is no tqparent widget passed but the application's main
* window so its functions can be accessed. The parent of this widget * window so its functions can be accessed. The tqparent of this widget
* is always 0 since this is a dialog. * is always 0 since this is a dialog.
**/ **/
@ -76,11 +77,11 @@ namespace KDirStat
/** /**
* Overwritten from @ref QDialog() to get any chance to set up the * Overwritten from @ref TQDialog() to get any chance to set up the
* dialog contents when the dialog gets shown - every time, not just at * dialog contents when the dialog gets shown - every time, not just at
* program startup when the settings dialog is created (!). * program startup when the settings dialog is created (!).
* *
* QTabDialog used to have 'aboutToShow()' for a good reason, but the * TQTabDialog used to have 'aboutToShow()' for a good reason, but the
* creators of @ref KDialogBase in their infinite wisdom chose not to * creators of @ref KDialogBase in their infinite wisdom chose not to
* include anything similar. How is that supposed to work, anyway? * include anything similar. How is that supposed to work, anyway?
* Everything I saw in any other KDE sources looked to me like ugly * Everything I saw in any other KDE sources looked to me like ugly
@ -89,7 +90,7 @@ namespace KDirStat
* certainly not be the way to go. * certainly not be the way to go.
* *
* This overwritten show() method sends that @ref aboutToShow() signal * This overwritten show() method sends that @ref aboutToShow() signal
* before calling the parent class show() method. * before calling the tqparent class show() method.
**/ **/
virtual void show(); virtual void show();
@ -138,9 +139,10 @@ namespace KDirStat
* Note: This class contains pure virtuals - it cannot be * Note: This class contains pure virtuals - it cannot be
* instantiated. Rather, derive your own classes from this one. * instantiated. Rather, derive your own classes from this one.
**/ **/
class KSettingsPage: public QWidget class KSettingsPage: public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -151,7 +153,7 @@ namespace KDirStat
* e.g., apply(), setup(), revertToDefaults(). * e.g., apply(), setup(), revertToDefaults().
**/ **/
KSettingsPage( KSettingsDialog * dialog, KSettingsPage( KSettingsDialog * dialog,
QWidget * parent ); TQWidget * tqparent );
/** /**
* Destructor. * Destructor.
@ -217,6 +219,7 @@ namespace KDirStat
class KTreeColorsPage: public KSettingsPage class KTreeColorsPage: public KSettingsPage
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -224,7 +227,7 @@ namespace KDirStat
* Constructor * Constructor
**/ **/
KTreeColorsPage( KSettingsDialog * dialog, KTreeColorsPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ); KDirStatApp * mainWin );
/** /**
@ -270,9 +273,9 @@ namespace KDirStat
KDirStatApp * _mainWin; KDirStatApp * _mainWin;
KDirTreeView * _treeView; KDirTreeView * _treeView;
QSlider * _slider; TQSlider * _slider;
KColorButton * _colorButton [ KDirStatSettingsMaxColorButton ]; KColorButton * _colorButton [ KDirStatSettingsMaxColorButton ];
QLabel * _colorLabel [ KDirStatSettingsMaxColorButton ]; TQLabel * _colorLabel [ KDirStatSettingsMaxColorButton ];
int _maxButtons; int _maxButtons;
@ -295,6 +298,7 @@ namespace KDirStat
class KCleanupPage: public KSettingsPage class KCleanupPage: public KSettingsPage
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -302,7 +306,7 @@ namespace KDirStat
* Constructor * Constructor
**/ **/
KCleanupPage( KSettingsDialog * dialog, KCleanupPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ); KDirStatApp * mainWin );
/** /**
@ -392,24 +396,25 @@ namespace KDirStat
* *
* This is meant as a substitute for a tabbed dialog inside the tabbed * This is meant as a substitute for a tabbed dialog inside the tabbed
* dialog which would be much too wide and possibly confusing. Plus, this * dialog which would be much too wide and possibly confusing. Plus, this
* list box is supposed to take care of its own geometry - the normal * list box is supposed to take care of its own tqgeometry - the normal
* dumbass list box obviously cannot do that. It just uses some random * dumbass list box obviously cannot do that. It just uses some random
* geometry, relying on scroll bars for everything else. But in this * tqgeometry, relying on scroll bars for everything else. But in this
* special case we want all items to be visible at all times without scroll * special case we want all items to be visible at all times without scroll
* bars. * bars.
* *
* @short cleanup list box * @short cleanup list box
**/ **/
class KCleanupListBox: public QListBox class KCleanupListBox: public TQListBox
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
**/ **/
KCleanupListBox( QWidget * parent = 0 ); KCleanupListBox( TQWidget * tqparent = 0 );
/** /**
* Destructor. * Destructor.
@ -421,7 +426,7 @@ namespace KDirStat
* without scrolling. In fact, we never want to see a scroll bar with * without scrolling. In fact, we never want to see a scroll bar with
* this kind of list box. * this kind of list box.
**/ **/
virtual QSize sizeHint() const; virtual TQSize tqsizeHint() const;
/** /**
* Insert an entry for a cleanup action into the list box. Uses the * Insert an entry for a cleanup action into the list box. Uses the
@ -454,7 +459,7 @@ namespace KDirStat
/** /**
* Select an item. * Select an item.
**/ **/
void selectCleanup( QListBoxItem * item ); void selectCleanup( TQListBoxItem * item );
protected: protected:
@ -468,7 +473,7 @@ namespace KDirStat
/** /**
* List box item for a KCleanupListBox. * List box item for a KCleanupListBox.
**/ **/
class KCleanupListBoxItem: public QListBoxText class KCleanupListBoxItem: public TQListBoxText
{ {
public: public:
@ -504,16 +509,17 @@ namespace KDirStat
/** /**
* Properties page for one cleanup action. * Properties page for one cleanup action.
**/ **/
class KCleanupPropertiesPage: public QWidget class KCleanupPropertiesPage: public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor * Constructor
**/ **/
KCleanupPropertiesPage( QWidget * parent, KCleanupPropertiesPage( TQWidget * tqparent,
KDirStatApp * mainWin ); KDirStatApp * mainWin );
/** /**
@ -540,18 +546,18 @@ namespace KDirStat
protected: protected:
QString _id; TQString _id;
QCheckBox * _enabled; TQCheckBox * _enabled;
QWidget * _fields; TQWidget * _fields;
QLineEdit * _title; TQLineEdit * _title;
QLineEdit * _command; TQLineEdit * _command;
QCheckBox * _recurse; TQCheckBox * _recurse;
QCheckBox * _askForConfirmation; TQCheckBox * _askForConfirmation;
QCheckBox * _worksForDir; TQCheckBox * _worksForDir;
QCheckBox * _worksForFile; TQCheckBox * _worksForFile;
QCheckBox * _worksForDotEntry; TQCheckBox * _worksForDotEntry;
QComboBox * _worksForProtocols; TQComboBox * _worksForProtocols;
QComboBox * _refreshPolicy; TQComboBox * _refreshPolicy;
KDirStatApp * _mainWin; KDirStatApp * _mainWin;
@ -565,6 +571,7 @@ namespace KDirStat
class KGeneralSettingsPage: public KSettingsPage class KGeneralSettingsPage: public KSettingsPage
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -572,7 +579,7 @@ namespace KDirStat
* Constructor * Constructor
**/ **/
KGeneralSettingsPage( KSettingsDialog * dialog, KGeneralSettingsPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ); KDirStatApp * mainWin );
/** /**
@ -618,11 +625,11 @@ namespace KDirStat
KDirStatApp * _mainWin; KDirStatApp * _mainWin;
KDirTreeView * _treeView; KDirTreeView * _treeView;
QCheckBox * _crossFileSystems; TQCheckBox * _crossFileSystems;
QCheckBox * _enableLocalDirReader; TQCheckBox * _enableLocalDirReader;
QCheckBox * _enableToolBarAnimation; TQCheckBox * _enableToolBarAnimation;
QCheckBox * _enableTreeViewAnimation; TQCheckBox * _enableTreeViewAnimation;
}; // class KGeneralSettingsPage }; // class KGeneralSettingsPage
@ -634,6 +641,7 @@ namespace KDirStat
class KTreemapPage: public KSettingsPage class KTreemapPage: public KSettingsPage
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -641,7 +649,7 @@ namespace KDirStat
* Constructor * Constructor
**/ **/
KTreemapPage( KSettingsDialog * dialog, KTreemapPage( KSettingsDialog * dialog,
QWidget * parent, TQWidget * tqparent,
KDirStatApp * mainWin ); KDirStatApp * mainWin );
/** /**
@ -691,9 +699,9 @@ namespace KDirStat
/** /**
* Convenience method to read a color from 'config'. * Convenience method to read a color from 'config'.
**/ **/
QColor readColorEntry( KConfig * config, TQColor readColorEntry( KConfig * config,
const char * entryName, const char * entryName,
QColor defaultColor ); TQColor defaultColor );
// Data members // Data members
@ -702,24 +710,24 @@ namespace KDirStat
// Widgets // Widgets
QCheckBox * _squarify; TQCheckBox * _squarify;
QCheckBox * _doCushionShading; TQCheckBox * _doCushionShading;
QVGroupBox * _cushionParams; TQVGroupBox * _cushionParams;
QSlider * _ambientLight; TQSlider * _ambientLight;
QSpinBox * _ambientLightSB; TQSpinBox * _ambientLightSB;
QSlider * _heightScalePercent; TQSlider * _heightScalePercent;
QSpinBox * _heightScalePercentSB; TQSpinBox * _heightScalePercentSB;
QCheckBox * _ensureContrast; TQCheckBox * _ensureContrast;
QCheckBox * _forceCushionGrid; TQCheckBox * _forceCushionGrid;
KColorButton * _cushionGridColor; KColorButton * _cushionGridColor;
QLabel * _cushionGridColorL; TQLabel * _cushionGridColorL;
QHGroupBox * _plainTileParams; TQHGroupBox * _plainTileParams;
KColorButton * _fileFillColor; KColorButton * _fileFillColor;
KColorButton * _dirFillColor; KColorButton * _dirFillColor;
KColorButton * _outlineColor; KColorButton * _outlineColor;
KColorButton * _highlightColor; KColorButton * _highlightColor;
QSpinBox * _minTileSize; TQSpinBox * _minTileSize;
QCheckBox * _autoResize; TQCheckBox * _autoResize;
}; // class KTreemapPage }; // class KTreemapPage
@ -729,12 +737,12 @@ namespace KDirStat
/** /**
* Add a horizontal stretch widget to take all excess space. * Add a horizontal stretch widget to take all excess space.
**/ **/
void addHStretch( QWidget * parent ); void addHStretch( TQWidget * tqparent );
/** /**
* Add a vertical stretch widget to take all excess space. * Add a vertical stretch widget to take all excess space.
**/ **/
void addVStretch( QWidget * parent ); void addVStretch( TQWidget * tqparent );

@ -11,7 +11,7 @@
#include "config.h" #include "config.h"
#include <string.h> #include <string.h>
#include <sys/errno.h> #include <sys/errno.h>
#include <qtimer.h> #include <tqtimer.h>
#include <kapp.h> #include <kapp.h>
#include <klocale.h> #include <klocale.h>
#include <kconfig.h> #include <kconfig.h>
@ -29,9 +29,9 @@ using namespace KDirStat;
KFileInfo::KFileInfo( KDirTree * tree, KFileInfo::KFileInfo( KDirTree * tree,
KDirInfo * parent, KDirInfo * tqparent,
const char * name ) const char * name )
: _parent( parent ) : _parent( tqparent )
, _next( 0 ) , _next( 0 )
, _tree( tree ) , _tree( tree )
{ {
@ -47,11 +47,11 @@ KFileInfo::KFileInfo( KDirTree * tree,
} }
KFileInfo::KFileInfo( const QString & filenameWithoutPath, KFileInfo::KFileInfo( const TQString & filenameWithoutPath,
struct stat * statInfo, struct stat * statInfo,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent ) KDirInfo * tqparent )
: _parent( parent ) : _parent( tqparent )
, _next( 0 ) , _next( 0 )
, _tree( tree ) , _tree( tree )
{ {
@ -102,15 +102,15 @@ KFileInfo::KFileInfo( const QString & filenameWithoutPath,
KFileInfo::KFileInfo( const KFileItem * fileItem, KFileInfo::KFileInfo( const KFileItem * fileItem,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent ) KDirInfo * tqparent )
: _parent( parent ) : _parent( tqparent )
, _next( 0 ) , _next( 0 )
, _tree( tree ) , _tree( tree )
{ {
CHECK_PTR( fileItem ); CHECK_PTR( fileItem );
_isLocalFile = fileItem->isLocalFile(); _isLocalFile = fileItem->isLocalFile();
_name = parent ? fileItem->name() : fileItem->url().url(); _name = tqparent ? fileItem->name() : fileItem->url().url();
_device = 0; _device = 0;
_mode = fileItem->mode(); _mode = fileItem->mode();
_links = 1; _links = 1;
@ -151,7 +151,7 @@ KFileInfo::~KFileInfo()
/** /**
* The destructor should also take care about unlinking this object from * The destructor should also take care about unlinking this object from
* its parent's children list, but regrettably that just doesn't work: At * its tqparent's tqchildren list, but regrettably that just doesn't work: At
* this point (within the destructor) parts of the object are already * this point (within the destructor) parts of the object are already
* destroyed, e.g., the virtual table - virtual methods don't work any * destroyed, e.g., the virtual table - virtual methods don't work any
* more. Thus, somebody from outside must call deletingChild() just prior * more. Thus, somebody from outside must call deletingChild() just prior
@ -181,34 +181,34 @@ KFileInfo::size() const
} }
QString TQString
KFileInfo::url() const KFileInfo::url() const
{ {
if ( _parent ) if ( _parent )
{ {
QString parentUrl = _parent->url(); TQString tqparentUrl = _parent->url();
if ( isDotEntry() ) // don't append "/." for dot entries if ( isDotEntry() ) // don't append "/." for dot entries
return parentUrl; return tqparentUrl;
if ( parentUrl == "/" ) // avoid duplicating slashes if ( tqparentUrl == "/" ) // avoid duplicating slashes
return parentUrl + _name; return tqparentUrl + _name;
else else
return parentUrl + "/" + _name; return tqparentUrl + "/" + _name;
} }
else else
return _name; return _name;
} }
QString TQString
KFileInfo::debugUrl() const KFileInfo::debugUrl() const
{ {
return url() + ( isDotEntry() ? "/<Files>" : "" ); return url() + ( isDotEntry() ? "/<Files>" : "" );
} }
QString TQString
KFileInfo::urlPart( int targetLevel ) const KFileInfo::urlPart( int targetLevel ) const
{ {
int level = treeLevel(); // Cache this - it's expensive! int level = treeLevel(); // Cache this - it's expensive!
@ -225,7 +225,7 @@ KFileInfo::urlPart( int targetLevel ) const
while ( level > targetLevel ) while ( level > targetLevel )
{ {
level--; level--;
item = item->parent(); item = item->tqparent();
} }
return item->name(); return item->name();
@ -236,12 +236,12 @@ int
KFileInfo::treeLevel() const KFileInfo::treeLevel() const
{ {
int level = 0; int level = 0;
KFileInfo * parent = _parent; KFileInfo * tqparent = _parent;
while ( parent ) while ( tqparent )
{ {
level++; level++;
parent = parent->parent(); tqparent = tqparent->tqparent();
} }
return level; return level;
@ -271,7 +271,7 @@ KFileInfo::isInSubtree( const KFileInfo *subtree ) const
if ( ancestor == subtree ) if ( ancestor == subtree )
return true; return true;
ancestor = ancestor->parent(); ancestor = ancestor->tqparent();
} }
return false; return false;
@ -279,7 +279,7 @@ KFileInfo::isInSubtree( const KFileInfo *subtree ) const
KFileInfo * KFileInfo *
KFileInfo::locate( QString url, bool findDotEntries ) KFileInfo::locate( TQString url, bool findDotEntries )
{ {
if ( ! url.startsWith( _name ) ) if ( ! url.startsWith( _name ) )
return 0; return 0;
@ -296,11 +296,11 @@ KFileInfo::locate( QString url, bool findDotEntries )
{ {
if ( _name.right(1) != "/" && // and this is not the root directory if ( _name.right(1) != "/" && // and this is not the root directory
! isDotEntry() ) // or a dot entry: ! isDotEntry() ) // or a dot entry:
return 0; // This can't be any of our children. return 0; // This can't be any of our tqchildren.
} }
// Search all children // Search all tqchildren
KFileInfo *child = firstChild(); KFileInfo *child = firstChild();
@ -323,12 +323,12 @@ KFileInfo::locate( QString url, bool findDotEntries )
// Search the dot entry if there is one - but only if there is no more // Search the dot entry if there is one - but only if there is no more
// path delimiter left in the URL. The dot entry contains files only, // path delimiter left in the URL. The dot entry contains files only,
// and their names may not contain the path delimiter, nor can they // and their names may not contain the path delimiter, nor can they
// have children. This check is not strictly necessary, but it may // have tqchildren. This check is not strictly necessary, but it may
// speed up things a bit if we don't search the non-directory children // speed up things a bit if we don't search the non-directory tqchildren
// if the rest of the URL consists of several pathname components. // if the rest of the URL consists of several pathname components.
if ( dotEntry() && if ( dotEntry() &&
url.find ( "/" ) < 0 ) // No (more) "/" in this URL url.tqfind ( "/" ) < 0 ) // No (more) "/" in this URL
{ {
return dotEntry()->locate( url, findDotEntries ); return dotEntry()->locate( url, findDotEntries );
} }
@ -343,9 +343,9 @@ KFileInfo::locate( QString url, bool findDotEntries )
KDirInfo::KDirInfo( KDirTree * tree, KDirInfo::KDirInfo( KDirTree * tree,
KDirInfo * parent, KDirInfo * tqparent,
bool asDotEntry ) bool asDotEntry )
: KFileInfo( tree, parent ) : KFileInfo( tree, tqparent )
{ {
init(); init();
@ -363,14 +363,14 @@ KDirInfo::KDirInfo( KDirTree * tree,
} }
KDirInfo::KDirInfo( const QString & filenameWithoutPath, KDirInfo::KDirInfo( const TQString & filenameWithoutPath,
struct stat * statInfo, struct stat * statInfo,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent ) KDirInfo * tqparent )
: KFileInfo( filenameWithoutPath, : KFileInfo( filenameWithoutPath,
statInfo, statInfo,
tree, tree,
parent ) tqparent )
{ {
init(); init();
_dotEntry = new KDirInfo( tree, this, true ); _dotEntry = new KDirInfo( tree, this, true );
@ -379,10 +379,10 @@ KDirInfo::KDirInfo( const QString & filenameWithoutPath,
KDirInfo::KDirInfo( const KFileItem * fileItem, KDirInfo::KDirInfo( const KFileItem * fileItem,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent ) KDirInfo * tqparent )
: KFileInfo( fileItem, : KFileInfo( fileItem,
tree, tree,
parent ) tqparent )
{ {
init(); init();
_dotEntry = new KDirInfo( tree, this, true ); _dotEntry = new KDirInfo( tree, this, true );
@ -415,7 +415,7 @@ KDirInfo::~KDirInfo()
KFileInfo *child = _firstChild; KFileInfo *child = _firstChild;
// Recursively delete all children. // Recursively delete all tqchildren.
while ( child ) while ( child )
{ {
@ -585,7 +585,7 @@ KDirInfo::insertChild( KFileInfo *newChild )
* unless something went terribly wrong, e.g. there is no dot entry to use. * unless something went terribly wrong, e.g. there is no dot entry to use.
* If this is a dot entry, store everything it gets directly within it. * If this is a dot entry, store everything it gets directly within it.
* *
* In any of those cases, insert the new child in the children list. * In any of those cases, insert the new child in the tqchildren list.
* *
* We don't bother with this list's order - it's explicitly declared to * We don't bother with this list's order - it's explicitly declared to
* be unordered, so be warned! We simply insert this new child at the * be unordered, so be warned! We simply insert this new child at the
@ -597,7 +597,7 @@ KDirInfo::insertChild( KFileInfo *newChild )
**/ **/
newChild->setNext( _firstChild ); newChild->setNext( _firstChild );
_firstChild = newChild; _firstChild = newChild;
newChild->setParent( this ); // make sure the parent pointer is correct newChild->setParent( this ); // make sure the tqparent pointer is correct
childAdded( newChild ); // update summaries childAdded( newChild ); // update summaries
} }
@ -652,7 +652,7 @@ void
KDirInfo::deletingChild( KFileInfo *deletedChild ) KDirInfo::deletingChild( KFileInfo *deletedChild )
{ {
/** /**
* When children are deleted, things go downhill: Marking the summary * When tqchildren are deleted, things go downhill: Marking the summary
* fields as dirty (i.e. outdated) is the only thing that can be done here. * fields as dirty (i.e. outdated) is the only thing that can be done here.
* *
* The accumulated sizes could be updated (by subtracting this deleted * The accumulated sizes could be updated (by subtracting this deleted
@ -669,12 +669,12 @@ KDirInfo::deletingChild( KFileInfo *deletedChild )
if ( _parent ) if ( _parent )
_parent->deletingChild( deletedChild ); _parent->deletingChild( deletedChild );
if ( ! _beingDestroyed && deletedChild->parent() == this ) if ( ! _beingDestroyed && deletedChild->tqparent() == this )
{ {
/** /**
* Unlink the child from the children's list - but only if this doesn't * Unlink the child from the tqchildren's list - but only if this doesn't
* happen recursively in the destructor of this object: No use * happen recursively in the destructor of this object: No use
* bothering about the validity of the children's list if this will all * bothering about the validity of the tqchildren's list if this will all
* be history anyway in a moment. * be history anyway in a moment.
**/ **/
@ -686,10 +686,10 @@ KDirInfo::deletingChild( KFileInfo *deletedChild )
void void
KDirInfo::unlinkChild( KFileInfo *deletedChild ) KDirInfo::unlinkChild( KFileInfo *deletedChild )
{ {
if ( deletedChild->parent() != this ) if ( deletedChild->tqparent() != this )
{ {
kdError() << deletedChild << " is not a child of " << this kdError() << deletedChild << " is not a child of " << this
<< " - cannot unlink from children list!" << endl; << " - cannot unlink from tqchildren list!" << endl;
return; return;
} }
@ -716,7 +716,7 @@ KDirInfo::unlinkChild( KFileInfo *deletedChild )
} }
kdError() << "Couldn't unlink " << deletedChild << " from " kdError() << "Couldn't unlink " << deletedChild << " from "
<< this << " children list" << endl; << this << " tqchildren list" << endl;
} }
@ -773,14 +773,14 @@ KDirInfo::cleanupDotEntries()
if ( ! _dotEntry || _isDotEntry ) if ( ! _dotEntry || _isDotEntry )
return; return;
// Reparent dot entry children if there are no subdirectories on this level // Retqparent dot entry tqchildren if there are no subdirectories on this level
if ( ! _firstChild ) if ( ! _firstChild )
{ {
// kdDebug() << "Removing solo dot entry " << this << " " << endl; // kdDebug() << "Removing solo dot entry " << this << " " << endl;
KFileInfo *child = _dotEntry->firstChild(); KFileInfo *child = _dotEntry->firstChild();
_firstChild = child; // Move the entire children chain here. _firstChild = child; // Move the entire tqchildren chain here.
_dotEntry->setFirstChild( 0 ); // _dotEntry will be deleted below. _dotEntry->setFirstChild( 0 ); // _dotEntry will be deleted below.
while ( child ) while ( child )
@ -791,7 +791,7 @@ KDirInfo::cleanupDotEntries()
} }
// Delete dot entries without any children // Delete dot entries without any tqchildren
if ( ! _dotEntry->firstChild() ) if ( ! _dotEntry->firstChild() )
{ {
@ -857,7 +857,7 @@ KLocalDirReadJob::startReading()
{ {
struct dirent * entry; struct dirent * entry;
struct stat statInfo; struct stat statInfo;
QString dirName = _dir->url(); TQString dirName = _dir->url();
if ( ( _diskDir = opendir( dirName ) ) ) if ( ( _diskDir = opendir( dirName ) ) )
{ {
@ -866,12 +866,12 @@ KLocalDirReadJob::startReading()
while ( ( entry = readdir( _diskDir ) ) ) while ( ( entry = readdir( _diskDir ) ) )
{ {
QString entryName = entry->d_name; TQString entryName = entry->d_name;
if ( entryName != "." && if ( entryName != "." &&
entryName != ".." ) entryName != ".." )
{ {
QString fullName = dirName + "/" + entryName; TQString fullName = dirName + "/" + entryName;
if ( lstat( fullName, &statInfo ) == 0 ) // lstat() OK if ( lstat( fullName, &statInfo ) == 0 ) // lstat() OK
{ {
@ -953,25 +953,25 @@ KLocalDirReadJob::startReading()
KFileInfo * KFileInfo *
KLocalDirReadJob::stat( const KURL & url, KLocalDirReadJob::stat( const KURL & url,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent ) KDirInfo * tqparent )
{ {
struct stat statInfo; struct stat statInfo;
if ( lstat( url.path(), &statInfo ) == 0 ) // lstat() OK if ( lstat( url.path(), &statInfo ) == 0 ) // lstat() OK
{ {
QString name = parent ? url.filename() : url.path(); TQString name = tqparent ? url.filename() : url.path();
if ( S_ISDIR( statInfo.st_mode ) ) // directory? if ( S_ISDIR( statInfo.st_mode ) ) // directory?
{ {
KDirInfo * dir = new KDirInfo( name, &statInfo, tree, parent ); KDirInfo * dir = new KDirInfo( name, &statInfo, tree, tqparent );
if ( dir && parent && dir->device() != parent->device() ) if ( dir && tqparent && dir->device() != tqparent->device() )
dir->setMountPoint(); dir->setMountPoint();
return dir; return dir;
} }
else // no directory else // no directory
return new KFileInfo( name, &statInfo, tree, parent ); return new KFileInfo( name, &statInfo, tree, tqparent );
} }
else // lstat() failed else // lstat() failed
return 0; return 0;
@ -984,7 +984,7 @@ KLocalDirReadJob::stat( const KURL & url,
KAnyDirReadJob::KAnyDirReadJob( KDirTree * tree, KAnyDirReadJob::KAnyDirReadJob( KDirTree * tree,
KDirInfo * dir ) KDirInfo * dir )
: QObject() : TQObject()
, KDirReadJob( tree, dir ) , KDirReadJob( tree, dir )
{ {
_job = 0; _job = 0;
@ -1013,14 +1013,14 @@ KAnyDirReadJob::startReading()
_job = KIO::listDir( url, _job = KIO::listDir( url,
false ); // showProgressInfo false ); // showProgressInfo
connect( _job, SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ), connect( _job, TQT_SIGNAL( entries( KIO::Job *, const KIO::UDSEntryList& ) ),
this, SLOT ( entries( KIO::Job *, const KIO::UDSEntryList& ) ) ); this, TQT_SLOT ( entries( KIO::Job *, const KIO::UDSEntryList& ) ) );
connect( _job, SIGNAL( result ( KIO::Job * ) ), connect( _job, TQT_SIGNAL( result ( KIO::Job * ) ),
this, SLOT ( finished( KIO::Job * ) ) ); this, TQT_SLOT ( finished( KIO::Job * ) ) );
connect( _job, SIGNAL( canceled( KIO::Job * ) ), connect( _job, TQT_SIGNAL( canceled( KIO::Job * ) ),
this, SLOT ( finished( KIO::Job * ) ) ); this, TQT_SLOT ( finished( KIO::Job * ) ) );
} }
@ -1043,7 +1043,7 @@ KAnyDirReadJob::entries ( KIO::Job * job,
KFileItem entry( *it, KFileItem entry( *it,
url, url,
true, // determineMimeTypeOnDemand true, // determineMimeTypeOnDemand
true ); // URL is parent directory true ); // URL is tqparent directory
if ( entry.name() != "." && if ( entry.name() != "." &&
entry.name() != ".." ) entry.name() != ".." )
@ -1097,17 +1097,17 @@ KAnyDirReadJob::finished( KIO::Job * job )
KFileInfo * KFileInfo *
KAnyDirReadJob::stat( const KURL & url, KAnyDirReadJob::stat( const KURL & url,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent ) KDirInfo * tqparent )
{ {
KIO::UDSEntry uds_entry; KIO::UDSEntry uds_entry;
if ( KIO::NetAccess::stat( url, uds_entry, qApp->mainWidget() ) ) // remote stat() OK? if ( KIO::NetAccess::stat( url, uds_entry, tqApp->mainWidget() ) ) // remote stat() OK?
{ {
KFileItem entry( uds_entry, url, KFileItem entry( uds_entry, url,
true, // determine MIME type on demand true, // determine MIME type on demand
false ); // URL specifies parent directory false ); // URL specifies tqparent directory
return entry.isDir() ? new KDirInfo ( &entry, tree, parent ) : new KFileInfo( &entry, tree, parent ); return entry.isDir() ? new KDirInfo ( &entry, tree, tqparent ) : new KFileInfo( &entry, tree, tqparent );
} }
else // remote stat() failed else // remote stat() failed
return 0; return 0;
@ -1125,21 +1125,21 @@ KAnyDirReadJob::stat( const KURL & url,
} }
QString TQString
KAnyDirReadJob::owner( KURL url ) KAnyDirReadJob::owner( KURL url )
{ {
KIO::UDSEntry uds_entry; KIO::UDSEntry uds_entry;
if ( KIO::NetAccess::stat( url, uds_entry, qApp->mainWidget() ) ) // remote stat() OK? if ( KIO::NetAccess::stat( url, uds_entry, tqApp->mainWidget() ) ) // remote stat() OK?
{ {
KFileItem entry( uds_entry, url, KFileItem entry( uds_entry, url,
true, // determine MIME type on demand true, // determine MIME type on demand
false ); // URL specifies parent directory false ); // URL specifies tqparent directory
return entry.user(); return entry.user();
} }
return QString(); return TQString();
} }
@ -1148,7 +1148,7 @@ KAnyDirReadJob::owner( KURL url )
KDirTree::KDirTree() KDirTree::KDirTree()
: QObject() : TQObject()
{ {
_root = 0; _root = 0;
_selection = 0; _selection = 0;
@ -1266,7 +1266,7 @@ KDirTree::startReading( const KURL & url )
} }
if ( ! _jobQueue.isEmpty() ) if ( ! _jobQueue.isEmpty() )
QTimer::singleShot( 0, this, SLOT( timeSlicedRead() ) ); TQTimer::singleShot( 0, this, TQT_SLOT( timeSlicedRead() ) );
} }
@ -1276,7 +1276,7 @@ KDirTree::refresh( KFileInfo *subtree )
if ( ! _root ) if ( ! _root )
return; return;
if ( ! subtree || ! subtree->parent() ) // Refresh all (from root) if ( ! subtree || ! subtree->tqparent() ) // Refresh all (from root)
{ {
startReading( fixedUrl( _root->url() ) ); startReading( fixedUrl( _root->url() ) );
} }
@ -1285,7 +1285,7 @@ KDirTree::refresh( KFileInfo *subtree )
// Save some values from the old subtree. // Save some values from the old subtree.
KURL url = subtree->url(); KURL url = subtree->url();
KDirInfo * parent = subtree->parent(); KDirInfo * tqparent = subtree->tqparent();
// Select nothing if the current selection is to be deleted // Select nothing if the current selection is to be deleted
@ -1300,15 +1300,15 @@ KDirTree::refresh( KFileInfo *subtree )
// kdDebug() << "Deleting subtree " << subtree << endl; // kdDebug() << "Deleting subtree " << subtree << endl;
/** /**
* This may sound stupid, but the parent must be told to unlink its * This may sound stupid, but the tqparent must be told to unlink its
* child from the children list. The child cannot simply do this by * child from the tqchildren list. The child cannot simply do this by
* itself in its destructor since at this point important parts of the * itself in its destructor since at this point important parts of the
* object may already be destroyed, e.g., the virtual table - * object may already be destroyed, e.g., the virtual table -
* i.e. virtual methods won't work any more. * i.e. virtual methods won't work any more.
* *
* I just found that out the hard way by several hours of debugging. ;-} * I just found that out the hard way by several hours of debugging. ;-}
**/ **/
parent->deletingChild( subtree ); tqparent->deletingChild( subtree );
delete subtree; delete subtree;
emit childDeleted(); emit childDeleted();
@ -1316,7 +1316,7 @@ KDirTree::refresh( KFileInfo *subtree )
// Create new subtree root. // Create new subtree root.
subtree = ( _readMethod == KDirReadLocal ) ? subtree = ( _readMethod == KDirReadLocal ) ?
KLocalDirReadJob::stat( url, this, parent ) : KAnyDirReadJob::stat( url, this, parent ); KLocalDirReadJob::stat( url, this, tqparent ) : KAnyDirReadJob::stat( url, this, tqparent );
// kdDebug() << "New subtree: " << subtree << endl; // kdDebug() << "New subtree: " << subtree << endl;
@ -1324,7 +1324,7 @@ KDirTree::refresh( KFileInfo *subtree )
{ {
// Insert new subtree root into the tree hierarchy. // Insert new subtree root into the tree hierarchy.
parent->insertChild( subtree ); tqparent->insertChild( subtree );
childAddedNotify( subtree ); childAddedNotify( subtree );
if ( subtree->isDir() ) if ( subtree->isDir() )
@ -1348,7 +1348,7 @@ KDirTree::refresh( KFileInfo *subtree )
// Trigger reading as soon as the event loop continues. // Trigger reading as soon as the event loop continues.
if ( ! _jobQueue.isEmpty() ) if ( ! _jobQueue.isEmpty() )
QTimer::singleShot( 0, this, SLOT( timeSlicedRead() ) ); TQTimer::singleShot( 0, this, TQT_SLOT( timeSlicedRead() ) );
} }
} }
} }
@ -1402,7 +1402,7 @@ KDirTree::jobFinishedNotify( KDirReadJob *job )
{ {
// Set up zero-duration timer for the new job. // Set up zero-duration timer for the new job.
QTimer::singleShot( 0, this, SLOT( timeSlicedRead() ) ); TQTimer::singleShot( 0, this, TQT_SLOT( timeSlicedRead() ) );
} }
} }
@ -1444,48 +1444,48 @@ void
KDirTree::deleteSubtree( KFileInfo *subtree ) KDirTree::deleteSubtree( KFileInfo *subtree )
{ {
// kdDebug() << "Deleting subtree " << subtree << endl; // kdDebug() << "Deleting subtree " << subtree << endl;
KDirInfo *parent = subtree->parent(); KDirInfo *tqparent = subtree->tqparent();
if ( parent ) if ( tqparent )
{ {
// Give the parent of the child to be deleted a chance to unlink the // Give the tqparent of the child to be deleted a chance to unlink the
// child from its children list and take care of internal summary // child from its tqchildren list and take care of internal summary
// fields // fields
parent->deletingChild( subtree ); tqparent->deletingChild( subtree );
} }
// Send notification to anybody interested (e.g., to attached views) // Send notification to anybody interested (e.g., to attached views)
deletingChildNotify( subtree ); deletingChildNotify( subtree );
if ( parent ) if ( tqparent )
{ {
if ( parent->isDotEntry() && ! parent->hasChildren() ) if ( tqparent->isDotEntry() && ! tqparent->hasChildren() )
// This was the last child of a dot entry // This was the last child of a dot entry
{ {
// Get rid of that now empty and useless dot entry // Get rid of that now empty and useless dot entry
if ( parent->parent() ) if ( tqparent->tqparent() )
{ {
if ( parent->parent()->isFinished() ) if ( tqparent->tqparent()->isFinished() )
{ {
// kdDebug() << "Removing empty dot entry " << parent << endl; // kdDebug() << "Removing empty dot entry " << tqparent << endl;
deletingChildNotify( parent ); deletingChildNotify( tqparent );
parent->parent()->setDotEntry( 0 ); tqparent->tqparent()->setDotEntry( 0 );
delete parent; delete tqparent;
} }
} }
else // no parent - this should never happen (?) else // no tqparent - this should never happen (?)
{ {
kdError() << "Internal error: Killing dot entry without parent " << parent << endl; kdError() << "Internal error: Killing dot entry without tqparent " << tqparent << endl;
// Better leave that dot entry alone - we shouldn't have come // Better leave that dot entry alone - we shouldn't have come
// here in the first place. Who knows what will happen if this // here in the first place. Who knows what will happen if this
// thing is deleted now?! // thing is deleted now?!
// //
// Intentionally NOT calling: // Intentionally NOT calling:
// delete parent; // delete tqparent;
} }
} }
} }
@ -1505,7 +1505,7 @@ KDirTree::addJob( KDirReadJob * job )
void void
KDirTree::sendProgressInfo( const QString &infoLine ) KDirTree::sendProgressInfo( const TQString &infoLine )
{ {
emit progressInfo( infoLine ); emit progressInfo( infoLine );
} }
@ -1541,7 +1541,7 @@ KDirTree::selectItem( KFileInfo *newSelection )
KURL KURL
KDirStat::fixedUrl( const QString & dirtyUrl ) KDirStat::fixedUrl( const TQString & dirtyUrl )
{ {
KURL url = dirtyUrl; KURL url = dirtyUrl;
@ -1558,7 +1558,7 @@ KDirStat::fixedUrl( const QString & dirtyUrl )
// Strip off the rightmost slash - some kioslaves (e.g. 'tar') can't handle that. // Strip off the rightmost slash - some kioslaves (e.g. 'tar') can't handle that.
QString path = url.path(); TQString path = url.path();
if ( path.length() > 1 && path.right(1) == "/" ) if ( path.length() > 1 && path.right(1) == "/" )
{ {
@ -1582,12 +1582,12 @@ KDirStat::fixedUrl( const QString & dirtyUrl )
QString TQString
KDirStat::formatSize( KFileSize lSize ) KDirStat::formatSize( KFileSize lSize )
{ {
QString sizeString; TQString sizeString;
double size; double size;
QString unit; TQString unit;
if ( lSize < 1024 ) if ( lSize < 1024 )
{ {

@ -19,7 +19,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <limits.h> #include <limits.h>
#include <dirent.h> #include <dirent.h>
#include <qptrqueue.h> #include <tqptrqueue.h>
#include <kdebug.h> #include <kdebug.h>
#include <kfileitem.h> #include <kfileitem.h>
#include <kio/jobclasses.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 typedef enum
{ {
@ -93,8 +93,8 @@ namespace KDirStat
* easily has 150,000+ file system objects, and at least one entry of this * easily has 150,000+ file system objects, and at least one entry of this
* sort is required for each of them. * sort is required for each of them.
* *
* This class provides stubs for children management, yet those stubs all * This class provides stubs for tqchildren management, yet those stubs all
* are default implementations that don't really deal with children. * are default implementations that don't really deal with tqchildren.
* Derived classes need to take care of that. * Derived classes need to take care of that.
* *
* @short Basic file information (like obtained by the lstat() sys call) * @short Basic file information (like obtained by the lstat() sys call)
@ -106,23 +106,23 @@ namespace KDirStat
* Default constructor. * Default constructor.
**/ **/
KFileInfo( KDirTree * tree, KFileInfo( KDirTree * tree,
KDirInfo * parent = 0, KDirInfo * tqparent = 0,
const char * name = 0 ); const char * name = 0 );
/** /**
* Constructor from a stat buffer (i.e. based on an lstat() call). * Constructor from a stat buffer (i.e. based on an lstat() call).
**/ **/
KFileInfo( const QString & filenameWithoutPath, KFileInfo( const TQString & filenameWithoutPath,
struct stat * statInfo, struct stat * statInfo,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent = 0 ); KDirInfo * tqparent = 0 );
/** /**
* Constructor from a KFileItem, i.e. from a @ref KIO::StatJob * Constructor from a KFileItem, i.e. from a @ref KIO::StatJob
**/ **/
KFileInfo( const KFileItem * fileItem, KFileInfo( const KFileItem * fileItem,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent = 0 ); KDirInfo * tqparent = 0 );
/** /**
* Destructor. * Destructor.
@ -149,7 +149,7 @@ namespace KDirStat
* for "/usr/share/man". Notice, however, that the entry for * for "/usr/share/man". Notice, however, that the entry for
* "/usr/share/man/man1" will only return "man1" in this example. * "/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 * 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 * This is a (somewhat) expensive operation since it will recurse up
* to the top of the tree. * to the top of the tree.
**/ **/
QString url() const; TQString url() const;
/** /**
* Very much like @ref KFileInfo::url(), but with "/<Files>" appended * Very much like @ref KFileInfo::url(), but with "/<Files>" appended
@ -168,7 +168,7 @@ namespace KDirStat
* *
* kdDebug() << "Found fileInfo " << info << endl; * 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 * 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 * @ref name() . This is useful for tree searches in symmetrical trees
* to find an item's counterpart in the other tree. * 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 * 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. * 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(); } virtual KFileSize totalSize() { return size(); }
/** /**
* Returns the total size in blocks of this subtree. * 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; } virtual KFileSize totalBlocks() { return _blocks; }
/** /**
* Returns the total number of children in this subtree, excluding this item. * Returns the total number of 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 totalItems() { return 0; } virtual int totalItems() { return 0; }
/** /**
* Returns the total number of subdirectories in this subtree, * Returns the total number of subdirectories in this subtree,
* excluding this item. Dot entries and "." or ".." are not counted. * 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; } 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. * excluding this item.
* Derived classes that have children should overwrite this. * Derived classes that have tqchildren should overwrite this.
**/ **/
virtual int totalFiles() { return 0; } virtual int totalFiles() { return 0; }
/** /**
* Returns the latest modification time of this subtree. * 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; } virtual time_t latestMtime() { return _mtime; }
@ -322,7 +322,7 @@ namespace KDirStat
/** /**
* Returns the number of pending read jobs in this subtree. When this * Returns the number of pending read jobs in this subtree. When this
* number reaches zero, the entire subtree is done. * 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; } virtual int pendingReadJobs() { return 0; }
@ -337,13 +337,13 @@ namespace KDirStat
KDirTree * tree() const { return _tree; } 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. * 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; } void setParent( KDirInfo *newParent ) { _parent = newParent; }
@ -377,7 +377,7 @@ namespace KDirStat
{ NOT_USED( newFirstChild ); } { NOT_USED( newFirstChild ); }
/** /**
* Returns true if this entry has any children. * Returns true if this entry has any tqchildren.
**/ **/
virtual bool hasChildren() const; virtual bool hasChildren() const;
@ -396,17 +396,17 @@ namespace KDirStat
* *
* Derived classes might or might not wish to overwrite this method; * 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 * 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>") * 'findDotEntries' specifies if locating "dot entries" (".../<Files>")
* is desired. * 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. * don't rely on any implementation-specific order.
* *
* This default implementation does nothing. * This default implementation does nothing.
@ -416,7 +416,7 @@ namespace KDirStat
/** /**
* Return the "Dot Entry" for this node if there is one (or 0 * 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 * 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 * user can easily tell which summary fields belong to the directory
* itself and which are the accumulated values of the entire subtree. * 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 ); } 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 * IMPORTANT: This MUST be called just prior to deleting an object of
* this class. Regrettably, this cannot simply be moved to the * 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). * (e.g., the virtual table - no more virtual methods).
* *
* This default implementation does nothing. * 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 ); } 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 - // Keep this short in order to use as little memory as possible -
// there will be a _lot_ of entries of this kind! // 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 _isLocalFile :1; // flag: local or remote file?
bool _isSparseFile :1; // (cache) flag: sparse file (file with "holes")? bool _isSparseFile :1; // (cache) flag: sparse file (file with "holes")?
dev_t _device; // device this object resides on dev_t _device; // device this object resides on
@ -572,15 +572,15 @@ namespace KDirStat
KFileSize _blocks; // 512 bytes blocks KFileSize _blocks; // 512 bytes blocks
time_t _mtime; // modification time 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 KFileInfo * _next; // pointer to the next entry
KDirTree * _tree; // pointer to the parent tree KDirTree * _tree; // pointer to the tqparent tree
}; // class KFileInfo }; // class KFileInfo
/** /**
* A more specialized version of @ref KFileInfo: This class can actually * 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 * respective methods to integrate seamlessly with the abstraction of a
* file / directory tree; this class fills those stubs with life. * file / directory tree; this class fills those stubs with life.
* *
@ -592,29 +592,29 @@ namespace KDirStat
/** /**
* Default constructor. * Default constructor.
* *
* If "asDotEntry" is set, this will be used as the parent's * If "asDotEntry" is set, this will be used as the tqparent's
* "dot entry", i.e. the pseudo directory that holds all the parent's * "dot entry", i.e. the pseudo directory that holds all the tqparent's
* non-directory children. This is the only way to create a "dot * non-directory tqchildren. This is the only way to create a "dot
* entry"! * entry"!
**/ **/
KDirInfo( KDirTree * tree, KDirInfo( KDirTree * tree,
KDirInfo * parent = 0, KDirInfo * tqparent = 0,
bool asDotEntry = false ); bool asDotEntry = false );
/** /**
* Constructor from a stat buffer (i.e. based on an lstat() call). * Constructor from a stat buffer (i.e. based on an lstat() call).
**/ **/
KDirInfo( const QString & filenameWithoutPath, KDirInfo( const TQString & filenameWithoutPath,
struct stat * statInfo, struct stat * statInfo,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent = 0 ); KDirInfo * tqparent = 0 );
/** /**
* Constructor from a KFileItem, i.e. from a @ref KIO::StatJob * Constructor from a KFileItem, i.e. from a @ref KIO::StatJob
**/ **/
KDirInfo( const KFileItem * fileItem, KDirInfo( const KFileItem * fileItem,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent = 0 ); KDirInfo * tqparent = 0 );
/** /**
* Destructor. * Destructor.
@ -637,7 +637,7 @@ namespace KDirStat
virtual KFileSize totalBlocks(); 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. * Reimplemented - inherited from @ref KFileInfo.
**/ **/
@ -652,7 +652,7 @@ namespace KDirStat
virtual int totalSubDirs(); 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. * excluding this item.
* *
* Reimplemented - inherited from @ref KFileInfo. * Reimplemented - inherited from @ref KFileInfo.
@ -723,9 +723,9 @@ namespace KDirStat
{ _firstChild = newfirstChild; } { _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. * don't rely on any implementation-specific order.
**/ **/
virtual void insertChild( KFileInfo *newChild ); 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): * 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 * 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 * user can easily tell which summary fields belong to the directory
* itself and which are the accumulated values of the entire subtree. * itself and which are the accumulated values of the entire subtree.
**/ **/
@ -760,7 +760,7 @@ namespace KDirStat
virtual void childAdded( KFileInfo *newChild ); 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 * IMPORTANT: This MUST be called just prior to deleting an object of
* this class. Regrettably, this cannot simply be moved to the * this class. Regrettably, this cannot simply be moved to the
@ -848,8 +848,8 @@ namespace KDirStat
/** /**
* Clean up unneeded / undesired dot entries: * Clean up unneeded / undesired dot entries:
* Delete dot entries that don't have any children, * Delete dot entries that don't have any tqchildren,
* reparent dot entry children to the "real" (parent) directory if * reparent dot entry tqchildren to the "real" (tqparent) directory if
* there are not subdirectory siblings at the level of the dot entry. * there are not subdirectory siblings at the level of the dot entry.
**/ **/
void cleanupDotEntries(); void cleanupDotEntries();
@ -862,7 +862,7 @@ namespace KDirStat
// Children management // Children management
KFileInfo * _firstChild; // pointer to the first child 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 // Some cached values
@ -897,7 +897,7 @@ namespace KDirStat
* KDirTree. * KDirTree.
* *
* For each entry automatically a @ref KFileInfo or @ref KDirInfo will be * 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 * @ref KDirReadJob will be created and added to the @ref KDirTree 's job
* queue. * queue.
* *
@ -1007,7 +1007,7 @@ namespace KDirStat
**/ **/
static KFileInfo * stat( const KURL & url, static KFileInfo * stat( const KURL & url,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent = 0 ); KDirInfo * tqparent = 0 );
protected: protected:
DIR * _diskDir; DIR * _diskDir;
@ -1026,9 +1026,10 @@ namespace KDirStat
* *
* @short Generic directory reader that reads one directory, remote or local. * @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 Q_OBJECT
TQ_OBJECT
public: public:
/** /**
@ -1057,7 +1058,7 @@ namespace KDirStat
**/ **/
static KFileInfo * stat( const KURL & url, static KFileInfo * stat( const KURL & url,
KDirTree * tree, KDirTree * tree,
KDirInfo * parent = 0 ); KDirInfo * tqparent = 0 );
/** /**
* Obtain the owner of the URL specified. * Obtain the owner of the URL specified.
@ -1065,7 +1066,7 @@ namespace KDirStat
* This is a moderately expensive operation since it involves a network * This is a moderately expensive operation since it involves a network
* transparent stat() call. * transparent stat() call.
**/ **/
static QString owner( KURL url ); static TQString owner( KURL url );
protected slots: protected slots:
@ -1096,9 +1097,10 @@ namespace KDirStat
* *
* @short Directory tree global data and infrastructure * @short Directory tree global data and infrastructure
**/ **/
class KDirTree: public QObject class KDirTree: public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
@ -1122,7 +1124,7 @@ namespace KDirStat
* *
* It's not very pretty this is required as an extra method, but this * 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 * 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 * constructor must return before any signals are sent, i.e. before
* anything is read. * anything is read.
**/ **/
@ -1183,7 +1185,7 @@ namespace KDirStat
* This is just a convenience method that maps to * This is just a convenience method that maps to
* KDirTree::root()->locate( url, findDotEntries ) * 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; } { return _root ? _root->locate( url, findDotEntries ) : 0; }
/** /**
@ -1250,10 +1252,10 @@ namespace KDirStat
virtual void deletingChildNotify( KFileInfo *deletedChild ); 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 * 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 * deletingChild() signal. For multiple deletions (e.g. entire
* subtrees) this should only happen once at the end. * 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 * Send a @ref progressInfo() signal to keep the user entertained while
* directories are being read. * 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 * 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 * changes - typically when a new directory is being read. Connect to a
* status bar etc. to keep the user entertained. * status bar etc. to keep the user entertained.
**/ **/
void progressInfo( const QString &infoLine ); void progressInfo( const TQString &infoLine );
protected slots: protected slots:
@ -1373,7 +1375,7 @@ namespace KDirStat
KFileInfo * _root; KFileInfo * _root;
KFileInfo * _selection; KFileInfo * _selection;
QPtrQueue<KDirReadJob> _jobQueue; TQPtrQueue<KDirReadJob> _jobQueue;
KDirReadMethod _readMethod; KDirReadMethod _readMethod;
bool _crossFileSystems; bool _crossFileSystems;
bool _enableLocalDirReader; bool _enableLocalDirReader;
@ -1390,7 +1392,7 @@ namespace KDirStat
* Make a valid, fixed and cleaned URL from a (possibly dirty) URL or maybe * Make a valid, fixed and cleaned URL from a (possibly dirty) URL or maybe
* a path. * a path.
**/ **/
KURL fixedUrl( const QString & dirtyUrl ); KURL fixedUrl( const TQString & dirtyUrl );
/** /**
@ -1401,7 +1403,7 @@ namespace KDirStat
* *
* kdDebug() << "Size: " << x->totalSize() << endl; * kdDebug() << "Size: " << x->totalSize() << endl;
**/ **/
QString formatSize ( KFileSize lSize ); TQString formatSize ( KFileSize lSize );
/** /**

@ -15,29 +15,29 @@
using namespace KDirStat; using namespace KDirStat;
KFileInfoIterator::KFileInfoIterator( KFileInfo * parent, KFileInfoIterator::KFileInfoIterator( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy ) KDotEntryPolicy dotEntryPolicy )
{ {
init( parent, init( tqparent,
dotEntryPolicy, dotEntryPolicy,
true ); // callNext true ); // callNext
} }
KFileInfoIterator::KFileInfoIterator( KFileInfo * parent, KFileInfoIterator::KFileInfoIterator( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy, KDotEntryPolicy dotEntryPolicy,
bool callNext ) bool callNext )
{ {
init( parent, dotEntryPolicy, callNext ); init( tqparent, dotEntryPolicy, callNext );
} }
void void
KFileInfoIterator::init( KFileInfo * parent, KFileInfoIterator::init( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy, KDotEntryPolicy dotEntryPolicy,
bool callNext ) bool callNext )
{ {
_parent = parent; _parent = tqparent;
_policy = dotEntryPolicy; _policy = dotEntryPolicy;
_current = 0; _current = 0;
@ -60,7 +60,7 @@ void KFileInfoIterator::next()
{ {
if ( ! _directChildrenProcessed ) if ( ! _directChildrenProcessed )
{ {
// Process direct children // Process direct tqchildren
_current = _current ? _current->next() : _parent->firstChild(); _current = _current ? _current->next() : _parent->firstChild();
@ -98,7 +98,7 @@ void KFileInfoIterator::next()
{ {
if ( _policy == KDotEntryTransparent ) if ( _policy == KDotEntryTransparent )
{ {
// Process dot entry children // Process dot entry tqchildren
_current = _current ? _current = _current ?
_current->next() : _current->next() :
@ -129,7 +129,7 @@ KFileInfoIterator::count()
{ {
int cnt = 0; int cnt = 0;
// Count direct children // Count direct tqchildren
KFileInfo *child = _parent->firstChild(); KFileInfo *child = _parent->firstChild();
@ -144,7 +144,7 @@ KFileInfoIterator::count()
switch ( _policy ) switch ( _policy )
{ {
case KDotEntryTransparent: // Count the dot entry's children as well. case KDotEntryTransparent: // Count the dot entry's tqchildren as well.
if ( _parent->dotEntry() ) if ( _parent->dotEntry() )
{ {
child = _parent->dotEntry()->firstChild(); child = _parent->dotEntry()->firstChild();
@ -174,16 +174,16 @@ KFileInfoIterator::count()
KFileInfoSortedIterator::KFileInfoSortedIterator( KFileInfo * parent, KFileInfoSortedIterator::KFileInfoSortedIterator( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy, KDotEntryPolicy dotEntryPolicy,
KFileInfoSortOrder sortOrder, KFileInfoSortOrder sortOrder,
bool ascending ) bool ascending )
: KFileInfoIterator( parent, dotEntryPolicy, false ) : KFileInfoIterator( tqparent, dotEntryPolicy, false )
{ {
_sortOrder = sortOrder; _sortOrder = sortOrder;
_ascending = ascending; _ascending = ascending;
_initComplete = false; _initComplete = false;
_childrenList = 0; _tqchildrenList = 0;
_current = 0; _current = 0;
} }
@ -191,8 +191,8 @@ KFileInfoSortedIterator::KFileInfoSortedIterator( KFileInfo * parent,
void void
KFileInfoSortedIterator::delayedInit() KFileInfoSortedIterator::delayedInit()
{ {
_childrenList = new KFileInfoList( _sortOrder, _ascending ); _tqchildrenList = new KFileInfoList( _sortOrder, _ascending );
CHECK_PTR( _childrenList ); CHECK_PTR( _tqchildrenList );
if ( _sortOrder == KSortByName ) if ( _sortOrder == KSortByName )
{ {
@ -203,45 +203,45 @@ KFileInfoSortedIterator::delayedInit()
makeChildrenList(); makeChildrenList();
} }
_current = _childrenList->first(); _current = _tqchildrenList->first();
_initComplete = true; _initComplete = true;
} }
KFileInfoSortedIterator::~KFileInfoSortedIterator() KFileInfoSortedIterator::~KFileInfoSortedIterator()
{ {
if ( _childrenList ) if ( _tqchildrenList )
delete _childrenList; delete _tqchildrenList;
} }
void KFileInfoSortedIterator::makeDefaultOrderChildrenList() void KFileInfoSortedIterator::makeDefaultOrderChildrenList()
{ {
// Fill children list with direct children // Fill tqchildren list with direct tqchildren
KFileInfo *child = _parent->firstChild(); KFileInfo *child = _parent->firstChild();
while ( child ) while ( child )
{ {
_childrenList->append( child ); _tqchildrenList->append( child );
child = child->next(); child = child->next();
} }
_childrenList->sort(); _tqchildrenList->sort();
if ( _policy == KDotEntryAsSubDir && _parent->dotEntry() ) if ( _policy == KDotEntryAsSubDir && _parent->dotEntry() )
{ {
// Append dot entry to the children list // Append dot entry to the tqchildren list
_childrenList->append( _parent->dotEntry() ); _tqchildrenList->append( _parent->dotEntry() );
} }
// Append the dot entry's children to the children list // Append the dot entry's tqchildren to the tqchildren list
if ( _policy == KDotEntryTransparent && _parent->dotEntry() ) if ( _policy == KDotEntryTransparent && _parent->dotEntry() )
{ {
// Create a temporary list for the dot entry children // Create a temporary list for the dot entry tqchildren
KFileInfoList dotEntryChildrenList( _sortOrder, _ascending ); KFileInfoList dotEntryChildrenList( _sortOrder, _ascending );
child = _parent->dotEntry()->firstChild(); child = _parent->dotEntry()->firstChild();
@ -255,13 +255,13 @@ void KFileInfoSortedIterator::makeDefaultOrderChildrenList()
dotEntryChildrenList.sort(); dotEntryChildrenList.sort();
// Now append all of this dot entry children list to the children list // Now append all of this dot entry tqchildren list to the tqchildren list
child = dotEntryChildrenList.first(); child = dotEntryChildrenList.first();
while ( child ) while ( child )
{ {
_childrenList->append( child ); _tqchildrenList->append( child );
child = dotEntryChildrenList.next(); child = dotEntryChildrenList.next();
} }
} }
@ -275,11 +275,11 @@ KFileInfoSortedIterator::makeChildrenList()
while ( *it ) while ( *it )
{ {
_childrenList->append( *it ); _tqchildrenList->append( *it );
++it; ++it;
} }
_childrenList->sort(); _tqchildrenList->sort();
} }
@ -298,7 +298,7 @@ void KFileInfoSortedIterator::next()
if ( ! _initComplete ) if ( ! _initComplete )
delayedInit(); delayedInit();
_current = _childrenList->next(); _current = _tqchildrenList->next();
} }
@ -316,11 +316,11 @@ KFileInfoSortedIterator::finished()
KFileInfoSortedBySizeIterator::KFileInfoSortedBySizeIterator( KFileInfo * parent, KFileInfoSortedBySizeIterator::KFileInfoSortedBySizeIterator( KFileInfo * tqparent,
KFileSize minSize, KFileSize minSize,
KDotEntryPolicy dotEntryPolicy, KDotEntryPolicy dotEntryPolicy,
bool ascending ) bool ascending )
: KFileInfoSortedIterator( parent, dotEntryPolicy, KSortByTotalSize, ascending ) : KFileInfoSortedIterator( tqparent, dotEntryPolicy, KSortByTotalSize, ascending )
, _minSize( minSize ) , _minSize( minSize )
{ {
} }
@ -334,12 +334,12 @@ KFileInfoSortedBySizeIterator::makeChildrenList()
while ( *it ) while ( *it )
{ {
if ( (*it)->totalSize() >= _minSize ) if ( (*it)->totalSize() >= _minSize )
_childrenList->append( *it ); _tqchildrenList->append( *it );
++it; ++it;
} }
_childrenList->sort(); _tqchildrenList->sort();
} }
@ -348,7 +348,7 @@ KFileInfoSortedBySizeIterator::makeChildrenList()
KFileInfoList::KFileInfoList( KFileInfoSortOrder sortOrder, bool ascending ) KFileInfoList::KFileInfoList( KFileInfoSortOrder sortOrder, bool ascending )
: QPtrList<KFileInfo>() : TQPtrList<KFileInfo>()
{ {
_sortOrder = sortOrder; _sortOrder = sortOrder;
_ascending = ascending; _ascending = ascending;
@ -380,7 +380,7 @@ KFileInfoList::sumTotalSizes()
int int
KFileInfoList::compareItems( QCollection::Item it1, QCollection::Item it2 ) KFileInfoList::compareItems( TQCollection::Item it1, TQCollection::Item it2 )
{ {
if ( it1 == it2 ) if ( it1 == it2 )
return 0; return 0;
@ -396,7 +396,7 @@ KFileInfoList::compareItems( QCollection::Item it1, QCollection::Item it2 )
return 1; return 1;
case KSortByName: case KSortByName:
result = QString::compare( file1->name(), file2->name() ); result = TQString::compare( file1->name(), file2->name() );
break; break;
case KSortByTotalSize: case KSortByTotalSize:

@ -27,9 +27,9 @@ namespace KDirStat
**/ **/
typedef enum typedef enum
{ {
KDotEntryTransparent, // Flatten hierarchy - move dot entry children up KDotEntryTransparent, // Flatten hierarchy - move dot entry tqchildren up
KDotEntryAsSubDir, // Treat dot entry as ordinary subdirectory KDotEntryAsSubDir, // Treat dot entry as ordinary subdirectory
KDotEntryIgnore // Ignore dot entry and its children completely KDotEntryIgnore // Ignore dot entry and its tqchildren completely
} KDotEntryPolicy; } KDotEntryPolicy;
@ -47,8 +47,8 @@ namespace KDirStat
/** /**
* Iterator class for children of a @ref KFileInfo object. For optimum * Iterator class for tqchildren of a @ref KFileInfo object. For optimum
* performance, this iterator class does NOT return children in any * performance, this iterator class does NOT return tqchildren in any
* specific sort order. If you need that, use @ref KFileInfoSortedIterator * specific sort order. If you need that, use @ref KFileInfoSortedIterator
* instead. * instead.
* *
@ -66,40 +66,40 @@ namespace KDirStat
* subdirectory child and each (direct) file child of 'node'. * subdirectory child and each (direct) file child of 'node'.
* Notice: This does not recurse into subdirectories! * Notice: This does not recurse into subdirectories!
* *
* @short (unsorted) iterator for @ref KFileInfo children. * @short (unsorted) iterator for @ref KFileInfo tqchildren.
**/ **/
class KFileInfoIterator class KFileInfoIterator
{ {
public: public:
/** /**
* Constructor: Initialize an iterator object to iterate over the * Constructor: Initialize an iterator object to iterate over the
* children of 'parent' (unsorted!), depending on 'dotEntryPolicy': * tqchildren of 'tqparent' (unsorted!), depending on 'dotEntryPolicy':
* *
* KDotEntryTransparent (default): * KDotEntryTransparent (default):
* *
* Treat the dot entry as if it wasn't there - pretend to move all its * Treat the dot entry as if it wasn't there - pretend to move all its
* children up to the real parent. This makes a directory look very * tqchildren up to the real tqparent. This makes a directory look very
* much like the directory on disk, without the dot entry. 'current()' * much like the directory on disk, without the dot entry. 'current()'
* or 'operator*()' will never return the dot entry, but all of its * or 'operator*()' will never return the dot entry, but all of its
* children. Subdirectories will be processed before any file children. * tqchildren. Subdirectories will be processed before any file tqchildren.
* *
* KDotEntryIsSubDir: * KDotEntryIsSubDir:
* *
* Treat the dot entry just like any other subdirectory. Don't iterate * Treat the dot entry just like any other subdirectory. Don't iterate
* over its children, too (unlike KDotEntryTransparent above). * over its tqchildren, too (unlike KDotEntryTransparent above).
* 'current()' or 'operator*()' will return the dot entry, but none of * 'current()' or 'operator*()' will return the dot entry, but none of
* its children (unless, of course, you create an iterator with the dot * its tqchildren (unless, of course, you create an iterator with the dot
* entry as the parent). * entry as the tqparent).
* *
* KDotEntryIgnore: * KDotEntryIgnore:
* *
* Ignore the dot entry and its children completely. Useful if children * Ignore the dot entry and its tqchildren completely. Useful if tqchildren
* other than subdirectories are not interesting anyway. 'current()' * other than subdirectories are not interesting anyway. 'current()'
* or 'operator*()' will never return the dot entry nor any of its * or 'operator*()' will never return the dot entry nor any of its
* children. * tqchildren.
* *
**/ **/
KFileInfoIterator( KFileInfo * parent, KFileInfoIterator( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy = KDotEntryTransparent ); KDotEntryPolicy dotEntryPolicy = KDotEntryTransparent );
protected: protected:
@ -107,7 +107,7 @@ namespace KDirStat
* Alternate constructor to be called from derived classes: Those can * Alternate constructor to be called from derived classes: Those can
* choose not to call next() in the constructor. * choose not to call next() in the constructor.
**/ **/
KFileInfoIterator ( KFileInfo * parent, KFileInfoIterator ( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy, KDotEntryPolicy dotEntryPolicy,
bool callNext ); bool callNext );
@ -115,7 +115,7 @@ namespace KDirStat
/** /**
* Internal initialization called from any constructor. * Internal initialization called from any constructor.
**/ **/
void init ( KFileInfo * parent, void init ( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy, KDotEntryPolicy dotEntryPolicy,
bool callNext ); bool callNext );
@ -187,13 +187,13 @@ namespace KDirStat
/** /**
* Iterator class for children of a @ref KFileInfo object. This iterator * Iterator class for tqchildren of a @ref KFileInfo object. This iterator
* returns children sorted by name: Subdirectories first, then the dot * returns tqchildren sorted by name: Subdirectories first, then the dot
* entry (if desired - depending on policy), then file children (if * entry (if desired - depending on policy), then file tqchildren (if
* desired). Note: If you don't need the sorting feature, you might want to * desired). Note: If you don't need the sorting feature, you might want to
* use @ref KFileItemIterator instead which has better performance. * use @ref KFileItemIterator instead which has better performance.
* *
* @short sorted iterator for @ref KFileInfo children. * @short sorted iterator for @ref KFileInfo tqchildren.
**/ **/
class KFileInfoSortedIterator: public KFileInfoIterator class KFileInfoSortedIterator: public KFileInfoIterator
{ {
@ -202,7 +202,7 @@ namespace KDirStat
* Constructor. Specify the sorting order with 'sortOrder' and 'ascending'. * Constructor. Specify the sorting order with 'sortOrder' and 'ascending'.
* See @ref KFileInfoIterator for more details. * See @ref KFileInfoIterator for more details.
**/ **/
KFileInfoSortedIterator( KFileInfo * parent, KFileInfoSortedIterator( KFileInfo * tqparent,
KDotEntryPolicy dotEntryPolicy = KDotEntryTransparent, KDotEntryPolicy dotEntryPolicy = KDotEntryTransparent,
KFileInfoSortOrder sortOrder = KSortByName, KFileInfoSortOrder sortOrder = KSortByName,
bool ascending = true ); bool ascending = true );
@ -248,15 +248,15 @@ namespace KDirStat
void delayedInit(); void delayedInit();
/** /**
* Make a 'default order' children list: * Make a 'default order' tqchildren list:
* First all subdirectories sorted by name, * First all subdirectories sorted by name,
* then the dot entry (depending on policy), * then the dot entry (depending on policy),
* then the dot entry's children (depending on policy). * then the dot entry's tqchildren (depending on policy).
**/ **/
virtual void makeDefaultOrderChildrenList(); virtual void makeDefaultOrderChildrenList();
/** /**
* Make a sorted children list according to the current sort * Make a sorted tqchildren list according to the current sort
* criteria - unless KSortByName is requested, in which case * criteria - unless KSortByName is requested, in which case
* makeDefaultOrderChildrenList() above is used. * makeDefaultOrderChildrenList() above is used.
**/ **/
@ -265,7 +265,7 @@ namespace KDirStat
// Data members // Data members
KFileInfoList * _childrenList; KFileInfoList * _tqchildrenList;
KFileInfoSortOrder _sortOrder; KFileInfoSortOrder _sortOrder;
bool _ascending; bool _ascending;
bool _initComplete; bool _initComplete;
@ -276,8 +276,8 @@ namespace KDirStat
/** /**
* Specialized KFileInfo iterator that sorts by (total) size, yet * Specialized KFileInfo iterator that sorts by (total) size, yet
* disregards children below a minimum size. This can considerably improve * disregards tqchildren below a minimum size. This can considerably improve
* performance if the number of children that need to be sorted decreases * performance if the number of tqchildren that need to be sorted decreases
* dramatically. * dramatically.
* *
* For example, treemaps can only display a limited portion of large * For example, treemaps can only display a limited portion of large
@ -293,7 +293,7 @@ namespace KDirStat
/** /**
* Constructor. Children below 'minSize' will be ignored by this iterator. * Constructor. Children below 'minSize' will be ignored by this iterator.
**/ **/
KFileInfoSortedBySizeIterator( KFileInfo * parent, KFileInfoSortedBySizeIterator( KFileInfo * tqparent,
KFileSize minSize = 0, KFileSize minSize = 0,
KDotEntryPolicy dotEntryPolicy = KDotEntryTransparent, KDotEntryPolicy dotEntryPolicy = KDotEntryTransparent,
bool ascending = false ); bool ascending = false );
@ -307,7 +307,7 @@ namespace KDirStat
protected: protected:
/** /**
* Create the (sorted) children list. Disregard children below minSize. * Create the (sorted) tqchildren list. Disregard tqchildren below minSize.
* Reimplemented from KFileInfoSortedIterator. * Reimplemented from KFileInfoSortedIterator.
**/ **/
virtual void makeChildrenList(); virtual void makeChildrenList();
@ -324,7 +324,7 @@ namespace KDirStat
/** /**
* Internal helper class for sorting iterators. * Internal helper class for sorting iterators.
**/ **/
class KFileInfoList: public QPtrList<KFileInfo> class KFileInfoList: public TQPtrList<KFileInfo>
{ {
public: public:
@ -349,14 +349,14 @@ namespace KDirStat
/** /**
* Comparison function. This is why this class is needed at all. * Comparison function. This is why this class is needed at all.
**/ **/
virtual int compareItems( QCollection::Item it1, QCollection::Item it2 ); virtual int compareItems( TQCollection::Item it1, TQCollection::Item it2 );
KFileInfoSortOrder _sortOrder; KFileInfoSortOrder _sortOrder;
bool _ascending; bool _ascending;
}; };
typedef QPtrListIterator<KFileInfo> KFileInfoListIterator; typedef TQPtrListIterator<KFileInfo> KFileInfoListIterator;

File diff suppressed because it is too large Load Diff

@ -12,11 +12,11 @@
#define KDirTreeView_h #define KDirTreeView_h
// Alternative parent class for KDirTreeView. // Alternative tqparent class for KDirTreeView.
// //
// If you change this, don't forget to change the KDirTreeView class // If you change this, don't forget to change the KDirTreeView class
// declaration also. Unfortunately there this 'define' can't be used - // declaration also. Unfortunately there this 'define' can't be used -
// it seems to confuse the 'moc' preprocessor. // it seems to confuse the 'tqmoc' preprocessor.
#define USE_KLISTVIEW 0 #define USE_KLISTVIEW 0
#define DEBUG_COUNTERS 10 #define DEBUG_COUNTERS 10
@ -27,17 +27,17 @@
#endif #endif
#include <qdatetime.h> #include <tqdatetime.h>
#include <qlistview.h> #include <tqlistview.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <klistview.h> #include <klistview.h>
#include "kdirtree.h" #include "kdirtree.h"
// Forward declarations // Forward declarations
class QWidget; class TQWidget;
class QTimer; class TQTimer;
class QPopupMenu; class TQPopupMenu;
class KPacManAnimation; class KPacManAnimation;
@ -53,24 +53,25 @@ namespace KDirStat
#if USE_KLISTVIEW #if USE_KLISTVIEW
# define KDirTreeViewParentClass KListView # define KDirTreeViewParentClass KListView
#else #else
# define KDirTreeViewParentClass QListView # define KDirTreeViewParentClass TQListView
#endif #endif
class KDirTreeViewItem; class KDirTreeViewItem;
class KDirTreeView: public QListView class KDirTreeView: public TQListView
// Using // Using
// class KDirTreeView: public KDirTreeViewParentClass // class KDirTreeView: public KDirTreeViewParentClass
// or some other 'ifdef' ... construct seems to confuse "moc". // or some other 'ifdef' ... construct seems to confuse "tqmoc".
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Default constructor. * Default constructor.
**/ **/
KDirTreeView( QWidget * parent = 0 ); KDirTreeView( TQWidget * tqparent = 0 );
/** /**
* Destructor. * Destructor.
@ -91,7 +92,7 @@ namespace KDirStat
/** /**
* Get the first child of this view or 0 if there is none. * Get the first child of this view or 0 if there is none.
* Use the child's next() method to get the next child. * Use the child's next() method to get the next child.
* Reimplemented from @ref QListView. * Reimplemented from @ref TQListView.
**/ **/
KDirTreeViewItem * firstChild() const KDirTreeViewItem * firstChild() const
{ return (KDirTreeViewItem *) KDirTreeViewParentClass::firstChild(); } { return (KDirTreeViewItem *) KDirTreeViewParentClass::firstChild(); }
@ -135,22 +136,22 @@ namespace KDirStat
* Return the percentage bar fill color for the specified directory * Return the percentage bar fill color for the specified directory
* level (0..MaxInt). Wraps around every usedFillColors() colors. * level (0..MaxInt). Wraps around every usedFillColors() colors.
**/ **/
const QColor & fillColor( int level ) const; const TQColor & fillColor( int level ) const;
/** /**
* Very much like @ref fillColor(), but doesn't wrap around at @ref * Very much like @ref fillColor(), but doesn't wrap around at @ref
* usedFillColors(), but at KDirTreeViewMaxFillColor. * usedFillColors(), but at KDirTreeViewMaxFillColor.
**/ **/
const QColor & rawFillColor( int level ) const; const TQColor & rawFillColor( int level ) const;
/** /**
* Set the fill color of percentage bars of the specified directory * Set the fill color of percentage bars of the specified directory
* level (0..KDirTreeViewMaxFillColor-1). * level (0..KDirTreeViewMaxFillColor-1).
* *
* Calling repaint() after setting all desired colors is the * Calling tqrepaint() after setting all desired colors is the
* caller's responsibility. * caller's responsibility.
**/ **/
void setFillColor( int level, const QColor &color ); void setFillColor( int level, const TQColor &color );
/** /**
* Set all tree colors to default values. * Set all tree colors to default values.
@ -171,20 +172,20 @@ namespace KDirStat
/** /**
* Set the tree background color. * Set the tree background color.
* *
* Calling repaint() after setting all desired colors is the * Calling tqrepaint() after setting all desired colors is the
* caller's responsibility. * caller's responsibility.
**/ **/
void setTreeBackground( const QColor &color ); void setTreeBackground( const TQColor &color );
/** /**
* Returns the tree background color. * Returns the tree background color.
**/ **/
const QColor & treeBackground() const { return _treeBackground; } const TQColor & treeBackground() const { return _treeBackground; }
/** /**
* Returns the background color for percentage bars. * Returns the background color for percentage bars.
**/ **/
const QColor & percentageBarBackground() const { return _percentageBarBackground; } const TQColor & percentageBarBackground() const { return _percentageBarBackground; }
/** /**
* (Try to) ensure good contrast between the tree background and the * (Try to) ensure good contrast between the tree background and the
@ -192,7 +193,7 @@ namespace KDirStat
* inevitably be the case for a white background (which unfortunately * inevitably be the case for a white background (which unfortunately
* is very common): The percentage bars use white and black for 3D * is very common): The percentage bars use white and black for 3D
* borders - like any other widget. But other widgets normally can * borders - like any other widget. But other widgets normally can
* assume their parent widget uses some more neutral color so white and * assume their tqparent widget uses some more neutral color so white and
* black will result in at least some minimal contrast. * black will result in at least some minimal contrast.
* *
* This function automagically sets a reasonable default background * This function automagically sets a reasonable default background
@ -208,7 +209,7 @@ namespace KDirStat
/** /**
* Set the sort column. * Set the sort column.
* *
* Reimplemented from QListView so we can keep track of the sort column. * Reimplemented from TQListView so we can keep track of the sort column.
**/ **/
virtual void setSorting( int column, bool increasing = TRUE ); virtual void setSorting( int column, bool increasing = TRUE );
@ -234,26 +235,26 @@ namespace KDirStat
int readJobsCol() const { return _readJobsCol; } int readJobsCol() const { return _readJobsCol; }
int sortCol() const { return _sortCol; } int sortCol() const { return _sortCol; }
QPixmap openDirIcon() const { return _openDirIcon; } TQPixmap openDirIcon() const { return _openDirIcon; }
QPixmap closedDirIcon() const { return _closedDirIcon; } TQPixmap closedDirIcon() const { return _closedDirIcon; }
QPixmap openDotEntryIcon() const { return _openDotEntryIcon; } TQPixmap openDotEntryIcon() const { return _openDotEntryIcon; }
QPixmap closedDotEntryIcon() const { return _closedDotEntryIcon; } TQPixmap closedDotEntryIcon() const { return _closedDotEntryIcon; }
QPixmap unreadableDirIcon() const { return _unreadableDirIcon; } TQPixmap unreadableDirIcon() const { return _unreadableDirIcon; }
QPixmap mountPointIcon() const { return _mountPointIcon; } TQPixmap mountPointIcon() const { return _mountPointIcon; }
QPixmap fileIcon() const { return _fileIcon; } TQPixmap fileIcon() const { return _fileIcon; }
QPixmap symLinkIcon() const { return _symLinkIcon; } TQPixmap symLinkIcon() const { return _symLinkIcon; }
QPixmap blockDevIcon() const { return _blockDevIcon; } TQPixmap blockDevIcon() const { return _blockDevIcon; }
QPixmap charDevIcon() const { return _charDevIcon; } TQPixmap charDevIcon() const { return _charDevIcon; }
QPixmap fifoIcon() const { return _fifoIcon; } TQPixmap fifoIcon() const { return _fifoIcon; }
QPixmap stopIcon() const { return _stopIcon; } TQPixmap stopIcon() const { return _stopIcon; }
QPixmap workingIcon() const { return _workingIcon; } TQPixmap workingIcon() const { return _workingIcon; }
QPixmap readyIcon() const { return _readyIcon; } TQPixmap readyIcon() const { return _readyIcon; }
/** /**
* Set function name of debug function #i * Set function name of debug function #i
**/ **/
void setDebugFunc( int i, const QString & functionName ); void setDebugFunc( int i, const TQString & functionName );
/** /**
* Increase debug counter #i * Increase debug counter #i
@ -289,15 +290,15 @@ namespace KDirStat
void clear(); void clear();
/** /**
* Select a (QListViewItem) item. Triggers selectionChanged() signals. * Select a (TQListViewItem) item. Triggers selectionChanged() signals.
**/ **/
void selectItem( QListViewItem *item ); void selectItem( TQListViewItem *item );
/** /**
* Select an item. Triggers selectionChanged() signals. * Select an item. Triggers selectionChanged() signals.
* Overloaded for convenience. * Overloaded for convenience.
**/ **/
void selectItem( KDirTreeViewItem *item ) { selectItem( (QListViewItem *) item ); } void selectItem( KDirTreeViewItem *item ) { selectItem( (TQListViewItem *) item ); }
/** /**
* Select a KDirTree item. Used for connecting the @ref * Select a KDirTree item. Used for connecting the @ref
@ -349,9 +350,9 @@ namespace KDirStat
/** /**
* Returns the minimum recommended size for this widget. * Returns the minimum recommended size for this widget.
* Reimplemented from QWidget. * Reimplemented from TQWidget.
**/ **/
virtual QSize minimumSizeHint() const { return QSize( 0, 0 ); } virtual TQSize tqminimumSizeHint() const { return TQSize( 0, 0 ); }
protected slots: protected slots:
@ -396,16 +397,7 @@ namespace KDirStat
* Display progress information in the status bar. Automatically adds * Display progress information in the status bar. Automatically adds
* the elapsed time of a directory scan. * the elapsed time of a directory scan.
**/ **/
void sendProgressInfo( const QString & currentDir = "" ); void sendProgressInfo( const TQString & currentDir = "" );
#if QT_VERSION < 300
/**
* "moc" doesnt't seem to handle default arguments well, so this is an
* overloaded slot that uses the internally stored current directory.
**/
void sendProgressInfo();
#endif
/** /**
* Set up everything prior to reading: Cyclic update timer, display * Set up everything prior to reading: Cyclic update timer, display
@ -430,21 +422,21 @@ namespace KDirStat
* Pop up context menu (i.e. emit the contextMenu() signal) or open a * Pop up context menu (i.e. emit the contextMenu() signal) or open a
* small info popup with exact information, depending on 'column'. * small info popup with exact information, depending on 'column'.
**/ **/
void popupContextMenu ( QListViewItem * listViewItem, void popupContextMenu ( TQListViewItem * listViewItem,
const QPoint & pos, const TQPoint & pos,
int column ); int column );
/** /**
* Pop up info window with exact byte size. * Pop up info window with exact byte size.
**/ **/
void popupContextSizeInfo ( const QPoint & pos, void popupContextSizeInfo ( const TQPoint & pos,
KFileSize size ); KFileSize size );
/** /**
* Pop up info window with arbitrary one-line text. * Pop up info window with arbitrary one-line text.
**/ **/
void popupContextInfo ( const QPoint & pos, void popupContextInfo ( const TQPoint & pos,
const QString & info ); const TQString & info );
protected slots: protected slots:
@ -463,7 +455,7 @@ namespace KDirStat
* changes - typically when a new directory is being read. Connect to a * changes - typically when a new directory is being read. Connect to a
* status bar etc. to keep the user busy. * status bar etc. to keep the user busy.
**/ **/
void progressInfo( const QString &infoLine ); void progressInfo( const TQString &infoLine );
/** /**
* Emitted when reading is started. * Emitted when reading is started.
@ -499,11 +491,11 @@ namespace KDirStat
* *
* NOTE: * NOTE:
* *
* This is _not_ the same as @ref QListView::rightButtonClicked(): * This is _not_ the same as @ref TQListView::rightButtonClicked():
* The context menu may not open on a right click on every column, * The context menu may not open on a right click on every column,
* usually only in the nameCol(). * usually only in the nameCol().
**/ **/
void contextMenu( KDirTreeViewItem *item, const QPoint &pos ); void contextMenu( KDirTreeViewItem *item, const TQPoint &pos );
/** /**
* Emitted at user activity. Some interactive actions are assigned an * Emitted at user activity. Some interactive actions are assigned an
@ -518,11 +510,11 @@ namespace KDirStat
protected: protected:
KDirTree * _tree; KDirTree * _tree;
QTimer * _updateTimer; TQTimer * _updateTimer;
QTime _stopWatch; TQTime _stopWatch;
QString _currentDir; TQString _currentDir;
KDirTreeViewItem * _selection; KDirTreeViewItem * _selection;
QPopupMenu * _contextInfo; TQPopupMenu * _contextInfo;
int _idContextInfo; int _idContextInfo;
int _openLevel; int _openLevel;
@ -530,9 +522,9 @@ namespace KDirStat
bool _doPacManAnimation; bool _doPacManAnimation;
int _updateInterval; // millisec int _updateInterval; // millisec
int _usedFillColors; int _usedFillColors;
QColor _fillColor [ KDirTreeViewMaxFillColor ]; TQColor _fillColor [ KDirTreeViewMaxFillColor ];
QColor _treeBackground; TQColor _treeBackground;
QColor _percentageBarBackground; TQColor _percentageBarBackground;
// The various columns in which to display information // The various columns in which to display information
@ -552,30 +544,30 @@ namespace KDirStat
int _sortCol; int _sortCol;
int _debugCount[ DEBUG_COUNTERS ]; int _debugCount[ DEBUG_COUNTERS ];
QString _debugFunc [ DEBUG_COUNTERS ]; TQString _debugFunc [ DEBUG_COUNTERS ];
// The various icons // The various icons
QPixmap _openDirIcon; TQPixmap _openDirIcon;
QPixmap _closedDirIcon; TQPixmap _closedDirIcon;
QPixmap _openDotEntryIcon; TQPixmap _openDotEntryIcon;
QPixmap _closedDotEntryIcon; TQPixmap _closedDotEntryIcon;
QPixmap _unreadableDirIcon; TQPixmap _unreadableDirIcon;
QPixmap _mountPointIcon; TQPixmap _mountPointIcon;
QPixmap _fileIcon; TQPixmap _fileIcon;
QPixmap _symLinkIcon; TQPixmap _symLinkIcon;
QPixmap _blockDevIcon; TQPixmap _blockDevIcon;
QPixmap _charDevIcon; TQPixmap _charDevIcon;
QPixmap _fifoIcon; TQPixmap _fifoIcon;
QPixmap _stopIcon; TQPixmap _stopIcon;
QPixmap _workingIcon; TQPixmap _workingIcon;
QPixmap _readyIcon; TQPixmap _readyIcon;
}; };
class KDirTreeViewItem: public QListViewItem class KDirTreeViewItem: public TQListViewItem
{ {
public: public:
/** /**
@ -588,7 +580,7 @@ namespace KDirStat
* Constructor for all other items. * Constructor for all other items.
**/ **/
KDirTreeViewItem ( KDirTreeView * view, KDirTreeViewItem ( KDirTreeView * view,
KDirTreeViewItem * parent, KDirTreeViewItem * tqparent,
KFileInfo * orig ); KFileInfo * orig );
/** /**
@ -638,9 +630,9 @@ namespace KDirStat
/** /**
* Returns the parent view item or 0 if this is the root. * Returns the tqparent view item or 0 if this is the root.
**/ **/
KDirTreeViewItem * parent() { return _parent; } KDirTreeViewItem * tqparent() { return _parent; }
/** /**
* Returns the corresponding original item of the "real" (vs. view) * Returns the corresponding original item of the "real" (vs. view)
@ -651,38 +643,38 @@ namespace KDirStat
/** /**
* Returns the first child of this item or 0 if there is none. * Returns the first child of this item or 0 if there is none.
* Use the child's next() method to get the next child. * Use the child's next() method to get the next child.
* Reimplemented from @ref QListViewItem. * Reimplemented from @ref TQListViewItem.
**/ **/
KDirTreeViewItem * firstChild() const KDirTreeViewItem * firstChild() const
{ return (KDirTreeViewItem *) QListViewItem::firstChild(); } { return (KDirTreeViewItem *) TQListViewItem::firstChild(); }
/** /**
* Returns the next sibling of this item or 0 if there is none. * Returns the next sibling of this item or 0 if there is none.
* (Kind of) reimplemented from @ref QListViewItem. * (Kind of) reimplemented from @ref TQListViewItem.
**/ **/
KDirTreeViewItem * next() const KDirTreeViewItem * next() const
{ return (KDirTreeViewItem *) QListViewItem::nextSibling(); } { return (KDirTreeViewItem *) TQListViewItem::nextSibling(); }
/** /**
* Comparison function used for sorting the list. * Comparison function used for sorting the list.
* *
* Using this function is much more efficient than overwriting * Using this function is much more efficient than overwriting
* QListViewItem::key() which operates on QStrings. * TQListViewItem::key() which operates on TQStrings.
* *
* Returns: * Returns:
* -1 if this < other * -1 if this < other
* 0 if this == other * 0 if this == other
* +1 if this > other * +1 if this > other
* *
* Reimplemented from QListViewItem * Reimplemented from TQListViewItem
**/ **/
virtual int compare( QListViewItem * other, virtual int compare( TQListViewItem * other,
int col, int col,
bool ascending ) const; bool ascending ) const;
/** /**
* Perform any necessary pending updates when a branch is opened. * Perform any necessary pending updates when a branch is opened.
* Reimplemented from @ref QListViewItem. * Reimplemented from @ref TQListViewItem.
**/ **/
virtual void setOpen( bool open ); virtual void setOpen( bool open );
@ -716,7 +708,7 @@ namespace KDirStat
* Recursively return an ASCII representation of all open items from * Recursively return an ASCII representation of all open items from
* here on. * here on.
**/ **/
QString asciiDump(); TQString asciiDump();
protected: protected:
@ -728,8 +720,8 @@ namespace KDirStat
void setIcon(); void setIcon();
/** /**
* Remove dot entry if it doesn't have any children. * Remove dot entry if it doesn't have any tqchildren.
* Reparent all of the dot entry's children if there are no * Retqparent all of the dot entry's tqchildren if there are no
* subdirectories on this level. * subdirectories on this level.
**/ **/
void cleanupDotEntries(); void cleanupDotEntries();
@ -747,28 +739,28 @@ namespace KDirStat
/** /**
* Paint method. Reimplemented from @ref QListViewItem so different * Paint method. Reimplemented from @ref TQListViewItem so different
* colors can be used - and of course for painting percentage bars. * colors can be used - and of course for painting percentage bars.
* *
* Reimplemented from @ref QListViewItem. * Reimplemented from @ref TQListViewItem.
**/ **/
virtual void paintCell ( QPainter * painter, virtual void paintCell ( TQPainter * painter,
const QColorGroup & colorGroup, const TQColorGroup & tqcolorGroup,
int column, int column,
int width, int width,
int alignment ); int tqalignment );
/** /**
* Paint a percentage bar into a @ref QListViewItem cell. * Paint a percentage bar into a @ref TQListViewItem cell.
* 'width' is the width of the entire cell. * 'width' is the width of the entire cell.
* 'indent' is the number of pixels to indent the bar. * 'indent' is the number of pixels to indent the bar.
**/ **/
void paintPercentageBar ( float percent, void paintPercentageBar ( float percent,
QPainter * painter, TQPainter * painter,
int indent, int indent,
int width, int width,
const QColor & fillColor, const TQColor & fillColor,
const QColor & barBackground ); const TQColor & barBackground );
/** /**
* Generic comparison function. * Generic comparison function.
@ -787,7 +779,7 @@ namespace KDirStat
* Initializations common to all constructors. * Initializations common to all constructors.
**/ **/
void init ( KDirTreeView * view, void init ( KDirTreeView * view,
KDirTreeViewItem * parent, KDirTreeViewItem * tqparent,
KFileInfo * orig ); KFileInfo * orig );
protected: protected:
@ -833,19 +825,19 @@ namespace KDirStat
* Format a file size with all digits, yet human readable using the current * Format a file size with all digits, yet human readable using the current
* locale's thousand separator, i.e. 12,345,678 rather than 12345678 * locale's thousand separator, i.e. 12,345,678 rather than 12345678
**/ **/
QString formatSizeLong( KFileSize size ); TQString formatSizeLong( KFileSize size );
/** /**
* Format a file size for use within a QListView::key() function: * Format a file size for use within a TQListView::key() function:
* Right-justify and fill with leading zeroes. * Right-justify and fill with leading zeroes.
**/ **/
QString hexKey( KFileSize size ); TQString hexKey( KFileSize size );
/** /**
* Format a millisecond granularity time human readable. * Format a millisecond granularity time human readable.
* Milliseconds will only be inluded if 'showMilliSeconds' is true. * Milliseconds will only be inluded if 'showMilliSeconds' is true.
**/ **/
QString formatTime ( long millisec, TQString formatTime ( long millisec,
bool showMilliSeconds = false ); bool showMilliSeconds = false );
/** /**
@ -854,31 +846,31 @@ namespace KDirStat
* Returns an empty string if 'suppressZero' is 'true' and the value of * Returns an empty string if 'suppressZero' is 'true' and the value of
* 'count' is 0. * 'count' is 0.
**/ **/
QString formatCount( int count, bool suppressZero = false ); TQString formatCount( int count, bool suppressZero = false );
/** /**
* Format percentages. * Format percentages.
**/ **/
QString formatPercent( float percent ); TQString formatPercent( float percent );
/** /**
* Format time and date human-readable as "yyyy-mm-dd hh:mm:ss" * Format time and date human-readable as "yyyy-mm-dd hh:mm:ss"
* - unlike that ctime() crap that is really useless. * - unlike that ctime() crap that is really useless.
* See the source for more about why this format. * See the source for more about why this format.
**/ **/
QString formatTimeDate( time_t rawTime ); TQString formatTimeDate( time_t rawTime );
/** /**
* Format time and date according to the current locale for those who * Format time and date according to the current locale for those who
* really must have that brain-dead ctime() format. * really must have that brain-dead ctime() format.
**/ **/
QString localeTimeDate( time_t rawTime ); TQString localeTimeDate( time_t rawTime );
/** /**
* Return a color that contrasts to 'contrastColor'. * Return a color that contrasts to 'contrastColor'.
**/ **/
QColor contrastingColor ( const QColor &desiredColor, TQColor contrastingColor ( const TQColor &desiredColor,
const QColor &contrastColor ); const TQColor &contrastColor );
} // namespace KDirStat } // namespace KDirStat

@ -9,11 +9,11 @@
*/ */
#include <qheader.h> #include <tqheader.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qmultilineedit.h> #include <tqmultilineedit.h>
#include <qhbox.h> #include <tqhbox.h>
#include <kglobal.h> #include <kglobal.h>
#include <kapp.h> #include <kapp.h>
@ -26,15 +26,15 @@
#include "kfeedback.h" #include "kfeedback.h"
KFeedbackDialog::KFeedbackDialog( const QString & feedbackMailAddress, KFeedbackDialog::KFeedbackDialog( const TQString & feedbackMailAddress,
const QString & helpTopic ) const TQString & helpTopic )
: KDialogBase( Plain, // dialogFace : KDialogBase( Plain, // dialogFace
i18n( "Feedback" ), // caption i18n( "Feedback" ), // caption
Apply | Cancel Apply | Cancel
| ( helpTopic.isEmpty() ? 0 : (int) Help ), // buttonMask | ( helpTopic.isEmpty() ? 0 : (int) Help ), // buttonMask
Apply ) // defaultButton Apply ) // defaultButton
{ {
QVBoxLayout * layout = new QVBoxLayout( plainPage(), 0, spacingHint() ); TQVBoxLayout * tqlayout = new TQVBoxLayout( plainPage(), 0, spacingHint() );
setButtonApply( KGuiItem( i18n( "&Mail this..." ) ) ); setButtonApply( KGuiItem( i18n( "&Mail this..." ) ) );
if ( ! helpTopic.isEmpty() ) if ( ! helpTopic.isEmpty() )
@ -43,20 +43,20 @@ KFeedbackDialog::KFeedbackDialog( const QString & feedbackMailAddress,
_form = new KFeedbackForm( feedbackMailAddress, plainPage() ); _form = new KFeedbackForm( feedbackMailAddress, plainPage() );
CHECK_PTR( _form ); CHECK_PTR( _form );
layout->addWidget( _form ); tqlayout->addWidget( _form );
checkSendButton(); checkSendButton();
connect( this, SIGNAL( applyClicked() ), connect( this, TQT_SIGNAL( applyClicked() ),
_form, SLOT ( sendMail() ) ); _form, TQT_SLOT ( sendMail() ) );
connect( _form, SIGNAL( mailSent() ), connect( _form, TQT_SIGNAL( mailSent() ),
this, SLOT ( hide() ) ); this, TQT_SLOT ( hide() ) );
connect( _form, SIGNAL( mailSent() ), connect( _form, TQT_SIGNAL( mailSent() ),
this, SIGNAL( mailSent() ) ); this, TQT_SIGNAL( mailSent() ) );
connect( _form, SIGNAL( checkComplete() ), connect( _form, TQT_SIGNAL( checkComplete() ),
this, SLOT ( checkSendButton() ) ); this, TQT_SLOT ( checkSendButton() ) );
} }
@ -76,16 +76,16 @@ KFeedbackDialog::checkSendButton()
KFeedbackForm::KFeedbackForm( const QString & feedbackMailAddress, KFeedbackForm::KFeedbackForm( const TQString & feedbackMailAddress,
QWidget * parent ) TQWidget * tqparent )
: QVBox( parent ) : TQVBox( tqparent )
, _feedbackMailAddress( feedbackMailAddress ) , _feedbackMailAddress( feedbackMailAddress )
{ {
// //
// Explanation above the question list // Explanation above the question list
// //
QLabel * label = new QLabel( i18n( "<p><b>Please tell us your opinion about this program.</b></p>" TQLabel * label = new TQLabel( i18n( "<p><b>Please tell us your opinion about this program.</b></p>"
"<p>You will be able to review everything in your mailer " "<p>You will be able to review everything in your mailer "
"before any mail is sent.<br>" "before any mail is sent.<br>"
"Nothing will be sent behind your back.</p>" "Nothing will be sent behind your back.</p>"
@ -97,47 +97,44 @@ KFeedbackForm::KFeedbackForm( const QString & feedbackMailAddress,
_questionList = new KFeedbackQuestionList( this ); _questionList = new KFeedbackQuestionList( this );
CHECK_PTR( _questionList ); CHECK_PTR( _questionList );
connect( _questionList, SIGNAL( checkComplete() ), connect( _questionList, TQT_SIGNAL( checkComplete() ),
this, SLOT ( slotCheckComplete() ) ); this, TQT_SLOT ( slotCheckComplete() ) );
// //
// Explanation below the question list // Explanation below the question list
// //
QHBox * hbox = new QHBox( this ); TQHBox * hbox = new TQHBox( this );
CHECK_PTR( hbox ); CHECK_PTR( hbox );
QSizePolicy pol( QSizePolicy::Fixed, QSizePolicy::Fixed ); // hor / vert TQSizePolicy pol( TQSizePolicy::Fixed, TQSizePolicy::Fixed ); // hor / vert
label = new QLabel( i18n( "Questions marked with " ), hbox ); label = new TQLabel( i18n( "Questions marked with " ), hbox );
CHECK_PTR( label ); CHECK_PTR( label );
label->setSizePolicy( pol ); label->tqsetSizePolicy( pol );
label = new QLabel( hbox ); label = new TQLabel( hbox );
CHECK_PTR( label ); CHECK_PTR( label );
label->setPixmap( KGlobal::iconLoader()->loadIcon( "edit", KIcon::Small ) ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "edit", KIcon::Small ) );
label->setSizePolicy( pol ); label->tqsetSizePolicy( pol );
label = new QLabel( i18n( " must be answered before a mail can be sent.") , hbox ); label = new TQLabel( i18n( " must be answered before a mail can be sent.") , hbox );
CHECK_PTR( label ); CHECK_PTR( label );
label->setSizePolicy( pol ); label->tqsetSizePolicy( pol );
new QWidget( hbox ); // Fill any leftover space to the right. new TQWidget( hbox ); // Fill any leftover space to the right.
// //
// Free-text comment field // Free-text comment field
// //
label = new QLabel( "\n" + i18n( "&Additional Comments:" ), this ); CHECK_PTR( label ); label = new TQLabel( "\n" + i18n( "&Additional Comments:" ), this ); CHECK_PTR( label );
_comment = new QMultiLineEdit( this ); CHECK_PTR( _comment ); _comment = new TQMultiLineEdit( this ); CHECK_PTR( _comment );
label->setBuddy( _comment ); label->setBuddy( _comment );
#if (QT_VERSION < 300) _comment->setWordWrap( TQMultiLineEdit::FixedColumnWidth );
_comment->setFixedVisibleLines( 5 );
#endif
_comment->setWordWrap( QMultiLineEdit::FixedColumnWidth );
_comment->setWrapColumnOrWidth( 70 ); _comment->setWrapColumnOrWidth( 70 );
} }
@ -155,7 +152,7 @@ KFeedbackForm::sendMail()
// Build mail subject // Build mail subject
// //
QString subject; TQString subject;
const KAboutData * aboutData = KGlobal::instance()->aboutData(); const KAboutData * aboutData = KGlobal::instance()->aboutData();
@ -171,7 +168,7 @@ KFeedbackForm::sendMail()
// Build mail body // Build mail body
// //
QString body = subject + "\n\n" TQString body = subject + "\n\n"
+ formatComment() + formatComment()
+ _questionList->result(); + _questionList->result();
@ -210,10 +207,10 @@ KFeedbackForm::slotCheckComplete()
} }
QString TQString
KFeedbackForm::formatComment() KFeedbackForm::formatComment()
{ {
QString result = _comment->text(); TQString result = _comment->text();
if ( ! result.isEmpty() ) if ( ! result.isEmpty() )
{ {
@ -235,8 +232,8 @@ KFeedbackForm::readyToSend()
KFeedbackQuestionList::KFeedbackQuestionList( QWidget *parent ) KFeedbackQuestionList::KFeedbackQuestionList( TQWidget *tqparent )
: QListView( parent ) : TQListView( tqparent )
{ {
addColumn( "" ); addColumn( "" );
header()->hide(); header()->hide();
@ -266,10 +263,10 @@ KFeedbackQuestionList::isComplete()
} }
QString TQString
KFeedbackQuestionList::result() KFeedbackQuestionList::result()
{ {
QString res; TQString res;
KFeedbackQuestion * question = firstQuestion(); KFeedbackQuestion * question = firstQuestion();
while ( question ) while ( question )
@ -284,8 +281,8 @@ KFeedbackQuestionList::result()
KFeedbackQuestion * KFeedbackQuestion *
KFeedbackQuestionList::addQuestion( const QString & text, KFeedbackQuestionList::addQuestion( const TQString & text,
const QString & id, const TQString & id,
bool exclusiveAnswer, bool exclusiveAnswer,
bool required ) bool required )
{ {
@ -299,8 +296,8 @@ KFeedbackQuestionList::addQuestion( const QString & text,
void void
KFeedbackQuestionList::addYesNoQuestion( const QString & text, KFeedbackQuestionList::addYesNoQuestion( const TQString & text,
const QString & id, const TQString & id,
bool required ) bool required )
{ {
@ -332,13 +329,13 @@ KFeedbackQuestionList::questionAdded( KFeedbackQuestion * question)
static int nextNo = 0; static int nextNo = 0;
KFeedbackQuestion::KFeedbackQuestion( KFeedbackQuestionList * parent, KFeedbackQuestion::KFeedbackQuestion( KFeedbackQuestionList * tqparent,
const QString & text, const TQString & text,
const QString & id, const TQString & id,
bool exclusiveAnswer, bool exclusiveAnswer,
bool required, bool required,
bool open ) bool open )
: QCheckListItem( parent, text ) : TQCheckListItem( tqparent, text )
, _id( id ) , _id( id )
, _exclusiveAnswer( exclusiveAnswer ) , _exclusiveAnswer( exclusiveAnswer )
, _required( required ) , _required( required )
@ -351,13 +348,13 @@ KFeedbackQuestion::KFeedbackQuestion( KFeedbackQuestionList * parent,
setOpen( open ); setOpen( open );
_no = nextNo++; _no = nextNo++;
parent->questionAdded( this ); tqparent->questionAdded( this );
} }
void void
KFeedbackQuestion::addAnswer( const QString & text, KFeedbackQuestion::addAnswer( const TQString & text,
const QString & id ) const TQString & id )
{ {
new KFeedbackAnswer( this, text, id, _exclusiveAnswer ); new KFeedbackAnswer( this, text, id, _exclusiveAnswer );
} }
@ -380,7 +377,7 @@ KFeedbackQuestion::isAnswered()
/** /**
* If this question requires an exclusive answer, exactly one of them * If this question requires an exclusive answer, exactly one of them
* should be checked. We don't need to bother about more than one being * should be checked. We don't need to bother about more than one being
* checked here - QListView does that for us. * checked here - TQListView does that for us.
**/ **/
KFeedbackAnswer *answer = firstAnswer(); KFeedbackAnswer *answer = firstAnswer();
@ -397,10 +394,10 @@ KFeedbackQuestion::isAnswered()
} }
QString TQString
KFeedbackQuestion::result() KFeedbackQuestion::result()
{ {
QString res; TQString res;
int answers = 0; int answers = 0;
KFeedbackAnswer *answer = firstAnswer(); KFeedbackAnswer *answer = firstAnswer();
@ -425,17 +422,17 @@ KFeedbackQuestion::result()
} }
QString TQString
KFeedbackQuestion::text() KFeedbackQuestion::text()
{ {
return QCheckListItem::text(0); return TQCheckListItem::text(0);
} }
QString TQString
KFeedbackQuestion::key( int, bool ) const KFeedbackQuestion::key( int, bool ) const
{ {
QString no; TQString no;
no.sprintf( "%08d", _no ); no.sprintf( "%08d", _no );
return no; return no;
@ -454,32 +451,32 @@ KFeedbackQuestion::questionList() const
KFeedbackAnswer::KFeedbackAnswer( KFeedbackQuestion * parent, KFeedbackAnswer::KFeedbackAnswer( KFeedbackQuestion * tqparent,
const QString & text, const TQString & text,
const QString & id, const TQString & id,
bool exclusive ) bool exclusive )
: QCheckListItem( parent, : TQCheckListItem( tqparent,
text, text,
exclusive exclusive
? QCheckListItem::RadioButton ? TQCheckListItem::RadioButton
: QCheckListItem::CheckBox ) : TQCheckListItem::CheckBox )
, _id( id ) , _id( id )
{ {
_no = nextNo++; _no = nextNo++;
} }
QString TQString
KFeedbackAnswer::text() KFeedbackAnswer::text()
{ {
return QCheckListItem::text(0); return TQCheckListItem::text(0);
} }
QString TQString
KFeedbackAnswer::key( int, bool ) const KFeedbackAnswer::key( int, bool ) const
{ {
QString no; TQString no;
no.sprintf( "%08d", _no ); no.sprintf( "%08d", _no );
return no; return no;

@ -15,8 +15,8 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qlistview.h> #include <tqlistview.h>
#include <qvbox.h> #include <tqvbox.h>
#include <kdialogbase.h> #include <kdialogbase.h>
@ -29,7 +29,7 @@ class KFeedbackForm;
class KFeedbackQuestionList; class KFeedbackQuestionList;
class KFeedbackQuestion; class KFeedbackQuestion;
class KFeedbackAnswer; class KFeedbackAnswer;
class QMultiLineEdit; class TQMultiLineEdit;
/** /**
@ -39,14 +39,15 @@ class QMultiLineEdit;
class KFeedbackDialog: public KDialogBase class KFeedbackDialog: public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
**/ **/
KFeedbackDialog( const QString & feedbackMailAddress, KFeedbackDialog( const TQString & feedbackMailAddress,
const QString & helpTopic = QString::null ); const TQString & helpTopic = TQString() );
/** /**
@ -92,16 +93,17 @@ protected:
* User is asked a list of questions, the answers of which will be sent via * User is asked a list of questions, the answers of which will be sent via
* mail back to a feedback mail address. * mail back to a feedback mail address.
**/ **/
class KFeedbackForm: public QVBox class KFeedbackForm: public TQVBox
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
**/ **/
KFeedbackForm( const QString & feedbackMailAddress, KFeedbackForm( const TQString & feedbackMailAddress,
QWidget * parent ); TQWidget * tqparent );
/** /**
* Destructor. * Destructor.
@ -168,29 +170,30 @@ protected:
/** /**
* Format the "personal comments" field for sending mail. * Format the "personal comments" field for sending mail.
**/ **/
QString formatComment(); TQString formatComment();
QString _feedbackMailAddress; TQString _feedbackMailAddress;
KFeedbackQuestionList * _questionList; KFeedbackQuestionList * _questionList;
QMultiLineEdit * _comment; TQMultiLineEdit * _comment;
}; };
/** /**
* List of feedback questions presented in a @ref QListView widget. * List of feedback questions presented in a @ref TQListView widget.
**/ **/
class KFeedbackQuestionList: public QListView class KFeedbackQuestionList: public TQListView
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
**/ **/
KFeedbackQuestionList( QWidget *parent ); KFeedbackQuestionList( TQWidget *tqparent );
/** /**
* Destructor. * Destructor.
@ -206,7 +209,7 @@ public:
/** /**
* The result of all answered questions in ASCII. * The result of all answered questions in ASCII.
**/ **/
QString result(); TQString result();
/** /**
* Add a yes/no question to the list. * Add a yes/no question to the list.
@ -225,16 +228,16 @@ public:
* Returns a pointer to this question so you can add answers. * Returns a pointer to this question so you can add answers.
**/ **/
KFeedbackQuestion * addQuestion( const QString & text, KFeedbackQuestion * addQuestion( const TQString & text,
const QString & id, const TQString & id,
bool exclusiveAnswer = true, bool exclusiveAnswer = true,
bool required = false ); bool required = false );
/** /**
* Add a yes/no question to the list. * Add a yes/no question to the list.
**/ **/
void addYesNoQuestion( const QString & text, void addYesNoQuestion( const TQString & text,
const QString & id, const TQString & id,
bool required = false ); bool required = false );
/** /**
@ -242,7 +245,7 @@ public:
* Use @ref KFeedbackQuestion::next() to get the next one. * Use @ref KFeedbackQuestion::next() to get the next one.
**/ **/
KFeedbackQuestion * firstQuestion() const KFeedbackQuestion * firstQuestion() const
{ return (KFeedbackQuestion *) QListView::firstChild(); } { return (KFeedbackQuestion *) TQListView::firstChild(); }
/** /**
* Notify the list that another question has been answered. * Notify the list that another question has been answered.
@ -269,14 +272,14 @@ signals:
/** /**
* A user feedback question to be inserted into a @ref KFeedbackQuestionList. * A user feedback question to be inserted into a @ref KFeedbackQuestionList.
**/ **/
class KFeedbackQuestion: public QCheckListItem class KFeedbackQuestion: public TQCheckListItem
{ {
public: public:
/** /**
* Constructor. * Constructor.
* *
* The parent @ref KFeedbackQuestionList assumes ownership of this object, * The tqparent @ref KFeedbackQuestionList assumes ownership of this object,
* so don't delete it unless you want to delete it from the question list * so don't delete it unless you want to delete it from the question list
* as well. * as well.
* *
@ -294,9 +297,9 @@ public:
* Set 'exclusiveAnswer' to 'true' if only one of all answers may be * Set 'exclusiveAnswer' to 'true' if only one of all answers may be
* checked at any one time, to 'false' if multiple answers are allowed. * checked at any one time, to 'false' if multiple answers are allowed.
**/ **/
KFeedbackQuestion( KFeedbackQuestionList * parent, KFeedbackQuestion( KFeedbackQuestionList * tqparent,
const QString & text, const TQString & text,
const QString & id, const TQString & id,
bool exclusiveAnswer = true, bool exclusiveAnswer = true,
bool required = false, bool required = false,
bool open = true ); bool open = true );
@ -307,8 +310,8 @@ public:
* the mail. The answer IDs need only be unique for that question; answers * the mail. The answer IDs need only be unique for that question; answers
* to other questions may have the same ID. * to other questions may have the same ID.
**/ **/
void addAnswer( const QString & text, void addAnswer( const TQString & text,
const QString & id ); const TQString & id );
/** /**
* Returns if answering this question is required. * Returns if answering this question is required.
@ -328,17 +331,17 @@ public:
* features_i_like="pink_elephant" * features_i_like="pink_elephant"
* features_i_like="studlycapslyfier" * features_i_like="studlycapslyfier"
**/ **/
QString result(); TQString result();
/** /**
* Return this question's ID. * Return this question's ID.
**/ **/
QString id() { return _id; } TQString id() { return _id; }
/** /**
* Return this question's text. * Return this question's text.
**/ **/
QString text(); TQString text();
/** /**
* Returns whether or not this question requires an exclusive answer. * Returns whether or not this question requires an exclusive answer.
@ -349,40 +352,40 @@ public:
/** /**
* Returns the sort key. * Returns the sort key.
* *
* Reimplemented from @ref QListViewItem to maintain insertion order. * Reimplemented from @ref TQListViewItem to maintain insertion order.
**/ **/
virtual QString key( int column, bool ascending ) const; virtual TQString key( int column, bool ascending ) const;
/** /**
* Returns the next question or 0 if there is no more. * Returns the next question or 0 if there is no more.
**/ **/
KFeedbackQuestion * nextQuestion() const KFeedbackQuestion * nextQuestion() const
{ return (KFeedbackQuestion *) QListViewItem::nextSibling(); } { return (KFeedbackQuestion *) TQListViewItem::nextSibling(); }
/** /**
* Returns the first possible answer to this question. * Returns the first possible answer to this question.
* Use @ref KFeedbackAnswer::nextAnswer() to get the next one. * Use @ref KFeedbackAnswer::nextAnswer() to get the next one.
**/ **/
KFeedbackAnswer * firstAnswer() const KFeedbackAnswer * firstAnswer() const
{ return (KFeedbackAnswer *) QListViewItem::firstChild(); } { return (KFeedbackAnswer *) TQListViewItem::firstChild(); }
/** /**
* Returns the @ref KFeedbackQuestionList this question belongs to or 0 if * Returns the @ref KFeedbackQuestionList this question belongs to or 0 if
* the parent is no @ref KFeedbackQuestionList. * the tqparent is no @ref KFeedbackQuestionList.
**/ **/
KFeedbackQuestionList * questionList() const; KFeedbackQuestionList * questionList() const;
protected: protected:
QString _id; TQString _id;
bool _exclusiveAnswer; bool _exclusiveAnswer;
bool _required; bool _required;
int _no; int _no;
}; };
class KFeedbackAnswer: public QCheckListItem class KFeedbackAnswer: public TQCheckListItem
{ {
public: public:
/** /**
@ -391,20 +394,20 @@ public:
* 'exclusive' tells the type of answer: One of many allowed or any number * 'exclusive' tells the type of answer: One of many allowed or any number
* of many. * of many.
**/ **/
KFeedbackAnswer( KFeedbackQuestion * parent, KFeedbackAnswer( KFeedbackQuestion * tqparent,
const QString & text, const TQString & text,
const QString & id, const TQString & id,
bool exclusive = true ); bool exclusive = true );
/** /**
* Return this answer's ID. * Return this answer's ID.
**/ **/
QString id() { return _id; } TQString id() { return _id; }
/** /**
* Return this answer's text. * Return this answer's text.
**/ **/
QString text(); TQString text();
/** /**
* Returns whether or not this is an exclusive answer. * Returns whether or not this is an exclusive answer.
@ -414,32 +417,32 @@ public:
/** /**
* Returns whether or not this answer is checked. * Returns whether or not this answer is checked.
**/ **/
bool isChecked() { return QCheckListItem::isOn(); } bool isChecked() { return TQCheckListItem::isOn(); }
/** /**
* Returns the next possible answer or 0 if there is no more. * Returns the next possible answer or 0 if there is no more.
**/ **/
KFeedbackAnswer * nextAnswer() const KFeedbackAnswer * nextAnswer() const
{ return (KFeedbackAnswer *) QListViewItem::nextSibling(); } { return (KFeedbackAnswer *) TQListViewItem::nextSibling(); }
/** /**
* Returns the question to this answer. * Returns the question to this answer.
**/ **/
KFeedbackQuestion * question() const KFeedbackQuestion * question() const
{ return (KFeedbackQuestion *) QListViewItem::parent(); } { return (KFeedbackQuestion *) TQListViewItem::tqparent(); }
/** /**
* Returns the sort key. * Returns the sort key.
* *
* Reimplemented from @ref QListViewItem to maintain insertion order. * Reimplemented from @ref TQListViewItem to maintain insertion order.
**/ **/
virtual QString key( int column, bool ascending ) const; virtual TQString key( int column, bool ascending ) const;
/** /**
* On/off change. * On/off change.
* *
* Reimplemented from @ref QCheckListItem to monitor answering required * Reimplemented from @ref TQCheckListItem to monitor answering required
* questions. This method notifies the @ref KFeedbackQuestionList whenever * questions. This method notifies the @ref KFeedbackQuestionList whenever
* a required question is being answered. * a required question is being answered.
**/ **/
@ -447,7 +450,7 @@ public:
protected: protected:
QString _id; TQString _id;
bool _exclusive; bool _exclusive;
int _no; int _no;
}; };

@ -11,21 +11,21 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <kdebug.h> #include <kdebug.h>
#include "kpacman.h" #include "kpacman.h"
KPacManAnimation::KPacManAnimation( QWidget * widget, KPacManAnimation::KPacManAnimation( TQWidget * widget,
int size, int size,
bool randomStart ) bool randomStart )
{ {
_widget = widget; _widget = widget;
_size = size; _size = size;
_randomStart = randomStart; _randomStart = randomStart;
_brush = QBrush( Qt::yellow ); _brush = TQBrush( TQt::yellow );
_pos = 0; _pos = 0;
_speed = 4; _speed = 4;
_interval = 100; _interval = 100;
@ -34,7 +34,7 @@ KPacManAnimation::KPacManAnimation( QWidget * widget,
_maxMouth = 70; _maxMouth = 70;
_mouthInc = ( _maxMouth - _minMouth ) / 3; _mouthInc = ( _maxMouth - _minMouth ) / 3;
_mouth = _minMouth; _mouth = _minMouth;
_pacManRect = QRect( 0, 0, 0, 0 ); _pacManRect = TQRect( 0, 0, 0, 0 );
restart(); restart();
} }
@ -69,8 +69,8 @@ KPacManAnimation::restart()
void void
KPacManAnimation::animate( QPainter * painter, KPacManAnimation::animate( TQPainter * painter,
QRect rect ) TQRect rect )
{ {
if ( _time.elapsed() < _interval ) if ( _time.elapsed() < _interval )
return; return;
@ -137,10 +137,10 @@ KPacManAnimation::animate( QPainter * painter,
// Draw PacMan (double-buffered) // Draw PacMan (double-buffered)
_pacManRect = QRect( 0, 0, size, size ); _pacManRect = TQRect( 0, 0, size, size );
QPixmap pixmap( size, size ); TQPixmap pixmap( size, size );
pixmap.fill( painter->backgroundColor() ); pixmap.fill( painter->backgroundColor() );
QPainter p( &pixmap, _widget ); TQPainter p( &pixmap, _widget );
p.setBrush( _brush ); p.setBrush( _brush );
if ( _goingRight ) if ( _goingRight )
@ -156,14 +156,14 @@ KPacManAnimation::animate( QPainter * painter,
( 360 - 2 * _mouth ) * 16 ); // arc lenght (1/16 degrees) ( 360 - 2 * _mouth ) * 16 ); // arc lenght (1/16 degrees)
} }
_pacManRect = QRect( rect.x() + _pos, // x _pacManRect = TQRect( rect.x() + _pos, // x
( rect.height() - size ) / 2, // y ( rect.height() - size ) / 2, // y
size, size ); // width, height size, size ); // width, height
// Transfer pixmap into widget // Transfer pixmap into widget
#if 0 #if 0
QPoint offset = painter->worldMatrix().map( _pacManRect.topLeft() ); TQPoint offset = painter->tqworldMatrix().map( _pacManRect.topLeft() );
// kdDebug() << "bitBlt() to " << offset.x() << ", " << offset.y() << endl; // kdDebug() << "bitBlt() to " << offset.x() << ", " << offset.y() << endl;
bitBlt( _widget, offset, &pixmap ); bitBlt( _widget, offset, &pixmap );
#endif #endif
@ -200,18 +200,18 @@ KPacManAnimation::animate( QPainter * painter,
KPacMan::KPacMan( QWidget * parent, KPacMan::KPacMan( TQWidget * tqparent,
int pacManSize, int pacManSize,
bool randomStart, bool randomStart,
const char * widgetName ) const char * widgetName )
: QWidget( parent, widgetName ) : TQWidget( tqparent, widgetName )
{ {
_pacManSize = pacManSize; _pacManSize = pacManSize;
_pacMan = new KPacManAnimation( this, _pacManSize, randomStart ); _pacMan = new KPacManAnimation( this, _pacManSize, randomStart );
_timer = 0; _timer = 0;
_interval = 100; // millisec _interval = 100; // millisec
_active = false; _active = false;
_painter = new QPainter( this ); _painter = new TQPainter( this );
_margin = 1; _margin = 1;
} }
@ -231,7 +231,7 @@ KPacMan::start()
{ {
if ( ! _timer ) if ( ! _timer )
{ {
_timer = new QTimer( this ); _timer = new TQTimer( this );
} }
_pacMan->restart(); _pacMan->restart();
@ -240,8 +240,8 @@ KPacMan::start()
{ {
_active = true; _active = true;
_timer->start( _interval ); _timer->start( _interval );
connect( _timer, SIGNAL( timeout() ), connect( _timer, TQT_SIGNAL( timeout() ),
this, SLOT ( animate() ) ); this, TQT_SLOT ( animate() ) );
} }
} }
@ -254,14 +254,14 @@ KPacMan::stop()
if ( _timer ) if ( _timer )
_timer->stop(); _timer->stop();
repaint(); tqrepaint();
} }
void void
KPacMan::animate() KPacMan::animate()
{ {
repaint( false ); tqrepaint( false );
} }
@ -277,32 +277,32 @@ KPacMan::setInterval( int intervalMilliSec )
void void
KPacMan::paintEvent( QPaintEvent *ev ) KPacMan::paintEvent( TQPaintEvent *ev )
{ {
QWidget::paintEvent( ev ); TQWidget::paintEvent( ev );
if ( _active ) if ( _active )
{ {
_pacMan->animate( _painter, QRect( _margin, 0, width() - _margin, height() ) ); _pacMan->animate( _painter, TQRect( _margin, 0, width() - _margin, height() ) );
} }
} }
void void
KPacMan::mouseReleaseEvent ( QMouseEvent *ev ) KPacMan::mouseReleaseEvent ( TQMouseEvent *ev )
{ {
if ( _active ) if ( _active )
{ {
if ( _pacMan->lastPacMan().contains( ev->pos() ) ) if ( _pacMan->lastPacMan().tqcontains( ev->pos() ) )
stop(); stop();
} }
} }
QSize TQSize
KPacMan::sizeHint() const KPacMan::tqsizeHint() const
{ {
return QSize( 16 * _pacManSize, // width - admittedly somewhat random return TQSize( 16 * _pacManSize, // width - admittedly somewhat random
_pacManSize + 2 * _margin ); // height _pacManSize + 2 * _margin ); // height
} }

@ -15,24 +15,24 @@
#include <config.h> #include <config.h>
#endif #endif
#include <qwidget.h> #include <tqwidget.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qcolor.h> #include <tqcolor.h>
#include <qdatetime.h> #include <tqdatetime.h>
#ifndef NOT_USED #ifndef NOT_USED
# define NOT_USED(PARAM) ( (void) (PARAM) ) # define NOT_USED(PARAM) ( (void) (PARAM) )
#endif #endif
class QTimer; class TQTimer;
/** /**
* Helper class to display a PacMan animation inside a widget. * Helper class to display a PacMan animation inside a widget.
* Note that this is not a widget itself, it needs to be placed inside a widget * Note that this is not a widget itself, it needs to be placed inside a widget
* - which fact makes it suitable for use inside non-widget objects such as * - which fact makes it suitable for use inside non-widget objects such as
* @ref QListViewItem. * @ref TQListViewItem.
* *
* If you are looking for a widget that can do all that self-contained, see * If you are looking for a widget that can do all that self-contained, see
* @ref KPacMan. * @ref KPacMan.
@ -48,7 +48,7 @@ public:
* Create a PacMan sprite in 'widget' of 'size' pixels diameter. Start at * Create a PacMan sprite in 'widget' of 'size' pixels diameter. Start at
* a random position and move in random direction if 'randomStart' is true. * a random position and move in random direction if 'randomStart' is true.
**/ **/
KPacManAnimation( QWidget * widget, KPacManAnimation( TQWidget * widget,
int size, int size,
bool randomStart ); bool randomStart );
@ -70,8 +70,8 @@ public:
* *
* My, what is the sex of that thing? ;-) * My, what is the sex of that thing? ;-)
**/ **/
void animate( QPainter * painter, void animate( TQPainter * painter,
QRect rect ); TQRect rect );
/** /**
* Restart - reset to initial position and direction. * Restart - reset to initial position and direction.
@ -81,7 +81,7 @@ public:
/** /**
* Return the rectangle where the last PacMan was painted. * Return the rectangle where the last PacMan was painted.
**/ **/
QRect lastPacMan() { return _pacManRect; } TQRect lastPacMan() { return _pacManRect; }
/** /**
* Set the animation interval in milliseconds. * Set the animation interval in milliseconds.
@ -98,8 +98,8 @@ public:
/** /**
* Brush to draw PacMan's inside. Bright yellow by default. * Brush to draw PacMan's inside. Bright yellow by default.
**/ **/
QBrush brush() const { return _brush; } TQBrush brush() const { return _brush; }
void setBrush( const QBrush & brush ) { _brush = brush; } void setBrush( const TQBrush & brush ) { _brush = brush; }
/** /**
* Number of degrees PacMan's mouth opens or closes for each animation. * Number of degrees PacMan's mouth opens or closes for each animation.
@ -121,10 +121,10 @@ public:
protected: protected:
QWidget * _widget; TQWidget * _widget;
QBrush _brush; TQBrush _brush;
QTime _time; TQTime _time;
QRect _pacManRect; TQRect _pacManRect;
int _size; int _size;
bool _randomStart; bool _randomStart;
int _speed; int _speed;
@ -150,9 +150,10 @@ protected:
* *
* @short PacMan widget * @short PacMan widget
**/ **/
class KPacMan: public QWidget class KPacMan: public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
@ -162,7 +163,7 @@ public:
* @param pacManSize size of the PacMan sprite * @param pacManSize size of the PacMan sprite
* @param randomStart random start position and direction if true * @param randomStart random start position and direction if true
**/ **/
KPacMan( QWidget * parent = 0, KPacMan( TQWidget * tqparent = 0,
int pacManSize = 16, int pacManSize = 16,
bool randomStart = false, bool randomStart = false,
const char * widgetName = 0 ); const char * widgetName = 0 );
@ -179,11 +180,11 @@ public:
KPacManAnimation * pacMan() { return _pacMan; } KPacManAnimation * pacMan() { return _pacMan; }
/** /**
* Access to the internal @ref QPainter to avoid duplicating all its * Access to the internal @ref TQPainter to avoid duplicating all its
* methods. Change this painter in order to change the visual appearance of * methods. Change this painter in order to change the visual appearance of
* the PacMan sprite. * the PacMan sprite.
**/ **/
QPainter * painter() { return _painter; } TQPainter * painter() { return _painter; }
/** /**
* Returns the animation interval in milliseconds. * Returns the animation interval in milliseconds.
@ -208,9 +209,9 @@ public:
/** /**
* Returns the widget's preferred size. * Returns the widget's preferred size.
* *
* Reimplemented from @ref QWidget. * Reimplemented from @ref TQWidget.
**/ **/
virtual QSize sizeHint() const; virtual TQSize tqsizeHint() const;
public slots: public slots:
@ -236,23 +237,23 @@ protected:
/** /**
* Actually do the painting. * Actually do the painting.
* *
* Reimplemented from @ref QWidget. * Reimplemented from @ref TQWidget.
**/ **/
virtual void paintEvent( QPaintEvent *ev ); virtual void paintEvent( TQPaintEvent *ev );
/** /**
* Stop animation on mouse click. * Stop animation on mouse click.
* *
* Reimplemented from @ref QWidget. * Reimplemented from @ref TQWidget.
**/ **/
virtual void mouseReleaseEvent ( QMouseEvent *ev ); virtual void mouseReleaseEvent ( TQMouseEvent *ev );
protected: protected:
KPacManAnimation * _pacMan; KPacManAnimation * _pacMan;
QPainter * _painter; TQPainter * _painter;
QTimer * _timer; TQTimer * _timer;
int _interval; // millisec int _interval; // millisec
bool _active; bool _active;
int _margin; int _margin;

@ -16,12 +16,12 @@ using namespace KDirStat;
KCleanup * KCleanup *
KStdCleanup::openInKonqueror( KActionCollection *parent ) KStdCleanup::openInKonqueror( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_open_in_konqueror", KCleanup *cleanup = new KCleanup( "cleanup_open_in_konqueror",
"kfmclient openURL %p", "kfmclient openURL %p",
i18n( "Open in &Konqueror" ), i18n( "Open in &Konqueror" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( true ); cleanup->setWorksForFile ( true );
@ -29,38 +29,38 @@ KStdCleanup::openInKonqueror( KActionCollection *parent )
cleanup->setWorksLocalOnly ( false ); cleanup->setWorksLocalOnly ( false );
cleanup->setRefreshPolicy( KCleanup::noRefresh ); cleanup->setRefreshPolicy( KCleanup::noRefresh );
cleanup->setIcon( "konqueror.png" ); cleanup->setIcon( "konqueror.png" );
cleanup->setShortcut( Qt::CTRL + Qt::Key_K ); cleanup->setShortcut( TQt::CTRL + TQt::Key_K );
return cleanup; return cleanup;
} }
KCleanup * KCleanup *
KStdCleanup::openInTerminal( KActionCollection *parent ) KStdCleanup::openInTerminal( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_open_in_terminal", KCleanup *cleanup = new KCleanup( "cleanup_open_in_terminal",
"konsole", "konsole",
i18n( "Open in &Terminal" ), i18n( "Open in &Terminal" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( true ); cleanup->setWorksForFile ( true );
cleanup->setWorksForDotEntry( true ); cleanup->setWorksForDotEntry( true );
cleanup->setRefreshPolicy( KCleanup::noRefresh ); cleanup->setRefreshPolicy( KCleanup::noRefresh );
cleanup->setIcon( "konsole.png" ); cleanup->setIcon( "konsole.png" );
cleanup->setShortcut( Qt::CTRL + Qt::Key_T ); cleanup->setShortcut( TQt::CTRL + TQt::Key_T );
return cleanup; return cleanup;
} }
KCleanup * KCleanup *
KStdCleanup::compressSubtree( KActionCollection *parent ) KStdCleanup::compressSubtree( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_compress_subtree", KCleanup *cleanup = new KCleanup( "cleanup_compress_subtree",
"cd ..; tar cjvf %n.tar.bz2 %n && rm -rf %n", "cd ..; tar cjvf %n.tar.bz2 %n && rm -rf %n",
i18n( "&Compress" ), i18n( "&Compress" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( false ); cleanup->setWorksForFile ( false );
@ -73,12 +73,12 @@ KStdCleanup::compressSubtree( KActionCollection *parent )
KCleanup * KCleanup *
KStdCleanup::makeClean( KActionCollection *parent ) KStdCleanup::makeClean( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_make_clean", KCleanup *cleanup = new KCleanup( "cleanup_make_clean",
"make clean", "make clean",
i18n( "&make clean" ), i18n( "&make clean" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( false ); cleanup->setWorksForFile ( false );
@ -90,12 +90,12 @@ KStdCleanup::makeClean( KActionCollection *parent )
KCleanup * KCleanup *
KStdCleanup::deleteTrash( KActionCollection *parent ) KStdCleanup::deleteTrash( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_delete_trash", KCleanup *cleanup = new KCleanup( "cleanup_delete_trash",
"rm -f *.o *~ *.bak *.auto core", "rm -f *.o *~ *.bak *.auto core",
i18n( "Delete T&rash Files" ), i18n( "Delete T&rash Files" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( false ); cleanup->setWorksForFile ( false );
@ -108,31 +108,31 @@ KStdCleanup::deleteTrash( KActionCollection *parent )
KCleanup * KCleanup *
KStdCleanup::moveToTrashBin( KActionCollection *parent ) KStdCleanup::moveToTrashBin( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_move_to_trash_bin", KCleanup *cleanup = new KCleanup( "cleanup_move_to_trash_bin",
"kfmclient move %p %t", "kfmclient move %p %t",
i18n( "Delete (to Trash &Bin)" ), i18n( "Delete (to Trash &Bin)" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( true ); cleanup->setWorksForFile ( true );
cleanup->setWorksForDotEntry( false ); cleanup->setWorksForDotEntry( false );
cleanup->setRefreshPolicy( KCleanup::assumeDeleted ); cleanup->setRefreshPolicy( KCleanup::assumeDeleted );
cleanup->setIcon( "edittrash.png" ); cleanup->setIcon( "edittrash.png" );
cleanup->setShortcut( Qt::CTRL + Qt::Key_X ); cleanup->setShortcut( TQt::CTRL + TQt::Key_X );
return cleanup; return cleanup;
} }
KCleanup * KCleanup *
KStdCleanup::hardDelete( KActionCollection *parent ) KStdCleanup::hardDelete( KActionCollection *tqparent )
{ {
KCleanup *cleanup = new KCleanup( "cleanup_hard_delete", KCleanup *cleanup = new KCleanup( "cleanup_hard_delete",
"rm -rf %p", "rm -rf %p",
i18n( "&Delete (no way to undelete!)" ), i18n( "&Delete (no way to undelete!)" ),
parent ); tqparent );
CHECK_PTR( cleanup ); CHECK_PTR( cleanup );
cleanup->setWorksForDir ( true ); cleanup->setWorksForDir ( true );
cleanup->setWorksForFile ( true ); cleanup->setWorksForFile ( true );
@ -140,7 +140,7 @@ KStdCleanup::hardDelete( KActionCollection *parent )
cleanup->setAskForConfirmation( true ); cleanup->setAskForConfirmation( true );
cleanup->setRefreshPolicy( KCleanup::assumeDeleted ); cleanup->setRefreshPolicy( KCleanup::assumeDeleted );
cleanup->setIcon( "editdelete.png" ); cleanup->setIcon( "editdelete.png" );
cleanup->setShortcut( Qt::CTRL + Qt::Key_Delete ); cleanup->setShortcut( TQt::CTRL + TQt::Key_Delete );
return cleanup; return cleanup;
} }

@ -40,13 +40,13 @@ namespace KDirStat
class KStdCleanup class KStdCleanup
{ {
public: public:
static KCleanup *openInKonqueror ( KActionCollection *parent = 0 ); static KCleanup *openInKonqueror ( KActionCollection *tqparent = 0 );
static KCleanup *openInTerminal ( KActionCollection *parent = 0 ); static KCleanup *openInTerminal ( KActionCollection *tqparent = 0 );
static KCleanup *compressSubtree ( KActionCollection *parent = 0 ); static KCleanup *compressSubtree ( KActionCollection *tqparent = 0 );
static KCleanup *makeClean ( KActionCollection *parent = 0 ); static KCleanup *makeClean ( KActionCollection *tqparent = 0 );
static KCleanup *deleteTrash ( KActionCollection *parent = 0 ); static KCleanup *deleteTrash ( KActionCollection *tqparent = 0 );
static KCleanup *moveToTrashBin ( KActionCollection *parent = 0 ); static KCleanup *moveToTrashBin ( KActionCollection *tqparent = 0 );
static KCleanup *hardDelete ( KActionCollection *parent = 0 ); static KCleanup *hardDelete ( KActionCollection *tqparent = 0 );
private: private:
/** /**

@ -14,8 +14,8 @@
#include <kapp.h> #include <kapp.h>
#include <klocale.h> #include <klocale.h>
#include <kglobal.h> #include <kglobal.h>
#include <qimage.h> #include <tqimage.h>
#include <qpainter.h> #include <tqpainter.h>
#include "ktreemaptile.h" #include "ktreemaptile.h"
#include "ktreemapview.h" #include "ktreemapview.h"
@ -28,40 +28,40 @@ using std::max;
using std::min; using std::min;
KTreemapTile::KTreemapTile( KTreemapView * parentView, KTreemapTile::KTreemapTile( KTreemapView * tqparentView,
KTreemapTile * parentTile, KTreemapTile * tqparentTile,
KFileInfo * orig, KFileInfo * orig,
const QRect & rect, const TQRect & rect,
KOrientation orientation ) KOrientation orientation )
: QCanvasRectangle( rect, parentView->canvas() ) : TQCanvasRectangle( rect, tqparentView->canvas() )
, _parentView( parentView ) , _parentView( tqparentView )
, _parentTile( parentTile ) , _parentTile( tqparentTile )
, _orig( orig ) , _orig( orig )
{ {
init(); init();
if ( parentTile ) if ( tqparentTile )
_cushionSurface = parentTile->cushionSurface(); _cushionSurface = tqparentTile->cushionSurface();
createChildren( rect, orientation ); createChildren( rect, orientation );
} }
KTreemapTile::KTreemapTile( KTreemapView * parentView, KTreemapTile::KTreemapTile( KTreemapView * tqparentView,
KTreemapTile * parentTile, KTreemapTile * tqparentTile,
KFileInfo * orig, KFileInfo * orig,
const QRect & rect, const TQRect & rect,
const KCushionSurface & cushionSurface, const KCushionSurface & cushionSurface,
KOrientation orientation ) KOrientation orientation )
: QCanvasRectangle( rect, parentView->canvas() ) : TQCanvasRectangle( rect, tqparentView->canvas() )
, _parentView( parentView ) , _parentView( tqparentView )
, _parentTile( parentTile ) , _parentTile( tqparentTile )
, _orig( orig ) , _orig( orig )
, _cushionSurface( cushionSurface ) , _cushionSurface( cushionSurface )
{ {
init(); init();
// Intentionally not copying the parent's cushion surface! // Intentionally not copying the tqparent's cushion surface!
createChildren( rect, orientation ); createChildren( rect, orientation );
} }
@ -76,25 +76,25 @@ KTreemapTile::~KTreemapTile()
void void
KTreemapTile::init() KTreemapTile::init()
{ {
// Set up height (z coordinate) - one level higher than the parent so this // Set up height (z coordinate) - one level higher than the tqparent so this
// will be closer to the foreground. // will be closer to the foreground.
// //
// Note that this must happen before any children are created. // Note that this must happen before any tqchildren are created.
// I found that out the hard way. ;-) // I found that out the hard way. ;-)
setZ( _parentTile ? ( _parentTile->z() + 1.0 ) : 0.0 ); setZ( _parentTile ? ( _parentTile->z() + 1.0 ) : 0.0 );
setBrush( QColor( 0x60, 0x60, 0x60 ) ); setBrush( TQColor( 0x60, 0x60, 0x60 ) );
setPen( NoPen ); setPen( Qt::NoPen );
show(); // QCanvasItems are invisible by default! show(); // TQCanvasItems are invisible by default!
// kdDebug() << "Creating treemap tile for " << orig << " " << rect << " size " << orig->totalSize() << endl; // kdDebug() << "Creating treemap tile for " << orig << " " << rect << " size " << orig->totalSize() << endl;
} }
void void
KTreemapTile::createChildren( const QRect & rect, KTreemapTile::createChildren( const TQRect & rect,
KOrientation orientation ) KOrientation orientation )
{ {
if ( _orig->totalSize() == 0 ) // Prevent division by zero if ( _orig->totalSize() == 0 ) // Prevent division by zero
@ -108,7 +108,7 @@ KTreemapTile::createChildren( const QRect & rect,
void void
KTreemapTile::createChildrenSimple( const QRect & rect, KTreemapTile::createChildrenSimple( const TQRect & rect,
KOrientation orientation ) KOrientation orientation )
{ {
@ -140,12 +140,12 @@ KTreemapTile::createChildrenSimple( const QRect & rect,
if ( childSize >= _parentView->minTileSize() ) if ( childSize >= _parentView->minTileSize() )
{ {
QRect childRect; TQRect childRect;
if ( dir == KTreemapHorizontal ) if ( dir == KTreemapHorizontal )
childRect = QRect( rect.x() + offset, rect.y(), childSize, rect.height() ); childRect = TQRect( rect.x() + offset, rect.y(), childSize, rect.height() );
else else
childRect = QRect( rect.x(), rect.y() + offset, rect.width(), childSize ); childRect = TQRect( rect.x(), rect.y() + offset, rect.width(), childSize );
KTreemapTile * tile = new KTreemapTile( _parentView, this, *it, childRect, childDir ); KTreemapTile * tile = new KTreemapTile( _parentView, this, *it, childRect, childDir );
CHECK_PTR( tile ); CHECK_PTR( tile );
@ -164,7 +164,7 @@ KTreemapTile::createChildrenSimple( const QRect & rect,
void void
KTreemapTile::createSquarifiedChildren( const QRect & rect ) KTreemapTile::createSquarifiedChildren( const TQRect & rect )
{ {
if ( _orig->totalSize() == 0 ) if ( _orig->totalSize() == 0 )
{ {
@ -184,18 +184,18 @@ KTreemapTile::createSquarifiedChildren( const QRect & rect )
#endif #endif
KFileInfoSortedBySizeIterator it( _orig, minSize, KDotEntryAsSubDir ); KFileInfoSortedBySizeIterator it( _orig, minSize, KDotEntryAsSubDir );
QRect childrenRect = rect; TQRect tqchildrenRect = rect;
while ( *it ) while ( *it )
{ {
KFileInfoList row = squarify( childrenRect, scale, it ); KFileInfoList row = squarify( tqchildrenRect, scale, it );
childrenRect = layoutRow( childrenRect, scale, row ); tqchildrenRect = tqlayoutRow( tqchildrenRect, scale, row );
} }
} }
KFileInfoList KFileInfoList
KTreemapTile::squarify( const QRect & rect, KTreemapTile::squarify( const TQRect & rect,
double scale, double scale,
KFileInfoSortedBySizeIterator & it ) KFileInfoSortedBySizeIterator & it )
{ {
@ -260,8 +260,8 @@ KTreemapTile::squarify( const QRect & rect,
QRect TQRect
KTreemapTile::layoutRow( const QRect & rect, KTreemapTile::tqlayoutRow( const TQRect & rect,
double scale, double scale,
KFileInfoList & row ) KFileInfoList & row )
{ {
@ -287,7 +287,7 @@ KTreemapTile::layoutRow( const QRect & rect,
return rect; return rect;
// Set up a cushion surface for this layout row: // Set up a cushion surface for this tqlayout row:
// Add another ridge perpendicular to the row's direction // Add another ridge perpendicular to the row's direction
// that optically groups this row's tiles together. // that optically groups this row's tiles together.
@ -312,12 +312,12 @@ KTreemapTile::layoutRow( const QRect & rect,
if ( childSize >= _parentView->minTileSize() ) if ( childSize >= _parentView->minTileSize() )
{ {
QRect childRect; TQRect childRect;
if ( dir == KTreemapHorizontal ) if ( dir == KTreemapHorizontal )
childRect = QRect( rect.x() + offset, rect.y(), childSize, secondary ); childRect = TQRect( rect.x() + offset, rect.y(), childSize, secondary );
else else
childRect = QRect( rect.x(), rect.y() + offset, secondary, childSize ); childRect = TQRect( rect.x(), rect.y() + offset, secondary, childSize );
KTreemapTile * tile = new KTreemapTile( _parentView, this, *it, childRect, rowCushionSurface ); KTreemapTile * tile = new KTreemapTile( _parentView, this, *it, childRect, rowCushionSurface );
CHECK_PTR( tile ); CHECK_PTR( tile );
@ -332,14 +332,14 @@ KTreemapTile::layoutRow( const QRect & rect,
} }
// Subtract the layouted area from the rectangle. // Subtract the tqlayouted area from the rectangle.
QRect newRect; TQRect newRect;
if ( dir == KTreemapHorizontal ) if ( dir == KTreemapHorizontal )
newRect = QRect( rect.x(), rect.y() + secondary, rect.width(), rect.height() - secondary ); newRect = TQRect( rect.x(), rect.y() + secondary, rect.width(), rect.height() - secondary );
else else
newRect = QRect( rect.x() + secondary, rect.y(), rect.width() - secondary, rect.height() ); newRect = TQRect( rect.x() + secondary, rect.y(), rect.width() - secondary, rect.height() );
// kdDebug() << "Left over:" << " " << newRect << " " << _orig << endl; // kdDebug() << "Left over:" << " " << newRect << " " << _orig << endl;
@ -348,11 +348,11 @@ KTreemapTile::layoutRow( const QRect & rect,
void void
KTreemapTile::drawShape( QPainter & painter ) KTreemapTile::drawShape( TQPainter & painter )
{ {
// kdDebug() << k_funcinfo << endl; // kdDebug() << k_funcinfo << endl;
QSize size = rect().size(); TQSize size = rect().size();
if ( size.height() < 1 || size.width() < 1 ) if ( size.height() < 1 || size.width() < 1 )
return; return;
@ -362,14 +362,14 @@ KTreemapTile::drawShape( QPainter & painter )
{ {
if ( _orig->isDir() || _orig->isDotEntry() ) if ( _orig->isDir() || _orig->isDotEntry() )
{ {
QCanvasRectangle::drawShape( painter ); TQCanvasRectangle::drawShape( painter );
} }
else else
{ {
if ( _cushion.isNull() ) if ( _cushion.isNull() )
_cushion = renderCushion(); _cushion = renderCushion();
QRect rect = QCanvasRectangle::rect(); TQRect rect = TQCanvasRectangle::rect();
if ( ! _cushion.isNull() ) if ( ! _cushion.isNull() )
painter.drawPixmap( rect, _cushion ); painter.drawPixmap( rect, _cushion );
@ -378,19 +378,19 @@ KTreemapTile::drawShape( QPainter & painter )
{ {
// Draw a clearly visible boundary // Draw a clearly visible boundary
painter.setPen( QPen( _parentView->cushionGridColor(), 1 ) ); painter.setPen( TQPen( _parentView->cushionGridColor(), 1 ) );
if ( rect.x() > 0 ) if ( rect.x() > 0 )
painter.drawLine( rect.topLeft(), rect.bottomLeft() + QPoint( 0, 1 ) ); painter.drawLine( rect.topLeft(), rect.bottomLeft() + TQPoint( 0, 1 ) );
if ( rect.y() > 0 ) if ( rect.y() > 0 )
painter.drawLine( rect.topLeft(), rect.topRight() + QPoint( 1, 0 ) ); painter.drawLine( rect.topLeft(), rect.topRight() + TQPoint( 1, 0 ) );
} }
} }
} }
else // No cushion shading, use plain tiles else // No cushion shading, use plain tiles
{ {
painter.setPen( QPen( _parentView->outlineColor(), 1 ) ); painter.setPen( TQPen( _parentView->outlineColor(), 1 ) );
if ( _orig->isDir() || _orig->isDotEntry() ) if ( _orig->isDir() || _orig->isDotEntry() )
painter.setBrush( _parentView->dirFillColor() ); painter.setBrush( _parentView->dirFillColor() );
@ -402,18 +402,18 @@ KTreemapTile::drawShape( QPainter & painter )
#endif #endif
} }
QCanvasRectangle::drawShape( painter ); TQCanvasRectangle::drawShape( painter );
} }
} }
QPixmap TQPixmap
KTreemapTile::renderCushion() KTreemapTile::renderCushion()
{ {
QRect rect = QCanvasRectangle::rect(); TQRect rect = TQCanvasRectangle::rect();
if ( rect.width() < 1 || rect.height() < 1 ) if ( rect.width() < 1 || rect.height() < 1 )
return QPixmap(); return TQPixmap();
// kdDebug() << k_funcinfo << endl; // kdDebug() << k_funcinfo << endl;
@ -427,10 +427,10 @@ KTreemapTile::renderCushion()
// Cache some values. They are used for each loop iteration, so let's try // Cache some values. They are used for each loop iteration, so let's try
// to keep multiple indirect references down. // to keep multiple indirect references down.
int ambientLight = parentView()->ambientLight(); int ambientLight = tqparentView()->ambientLight();
double lightX = parentView()->lightX(); double lightX = tqparentView()->lightX();
double lightY = parentView()->lightY(); double lightY = tqparentView()->lightY();
double lightZ = parentView()->lightZ(); double lightZ = tqparentView()->lightZ();
double xx2 = cushionSurface().xx2(); double xx2 = cushionSurface().xx2();
double xx1 = cushionSurface().xx1(); double xx1 = cushionSurface().xx1();
@ -440,12 +440,12 @@ KTreemapTile::renderCushion()
int x0 = rect.x(); int x0 = rect.x();
int y0 = rect.y(); int y0 = rect.y();
QColor color = parentView()->tileColor( _orig ); TQColor color = tqparentView()->tileColor( _orig );
int maxRed = max( 0, color.red() - ambientLight ); int maxRed = max( 0, color.red() - ambientLight );
int maxGreen = max( 0, color.green() - ambientLight ); int maxGreen = max( 0, color.green() - ambientLight );
int maxBlue = max( 0, color.blue() - ambientLight ); int maxBlue = max( 0, color.blue() - ambientLight );
QImage image( rect.width(), rect.height(), 32 ); TQImage image( rect.width(), rect.height(), 32 );
for ( y = 0; y < rect.height(); y++ ) for ( y = 0; y < rect.height(); y++ )
{ {
@ -467,19 +467,19 @@ KTreemapTile::renderCushion()
green += ambientLight; green += ambientLight;
blue += ambientLight; blue += ambientLight;
image.setPixel( x, y, qRgb( red, green, blue) ); image.setPixel( x, y, tqRgb( red, green, blue) );
} }
} }
if ( _parentView->ensureContrast() ) if ( _parentView->ensureContrast() )
ensureContrast( image ); ensureContrast( image );
return QPixmap( image ); return TQPixmap( image );
} }
void void
KTreemapTile::ensureContrast( QImage & image ) KTreemapTile::ensureContrast( TQImage & image )
{ {
if ( image.width() > 5 ) if ( image.width() > 5 )
{ {
@ -507,7 +507,7 @@ KTreemapTile::ensureContrast( QImage & image )
{ {
// Add a line at the right boundary // Add a line at the right boundary
QRgb val = contrastingColor( image.pixel( x2, image.height() / 2 ) ); TQRgb val = contrastingColor( image.pixel( x2, image.height() / 2 ) );
for ( int y = 0; y < image.height(); y++ ) for ( int y = 0; y < image.height(); y++ )
image.setPixel( x2, y, val ); image.setPixel( x2, y, val );
@ -534,7 +534,7 @@ KTreemapTile::ensureContrast( QImage & image )
{ {
// Add a grey line at the bottom boundary // Add a grey line at the bottom boundary
QRgb val = contrastingColor( image.pixel( image.width() / 2, y2 ) ); TQRgb val = contrastingColor( image.pixel( image.width() / 2, y2 ) );
for ( int x = 0; x < image.width(); x++ ) for ( int x = 0; x < image.width(); x++ )
image.setPixel( x, y2, val ); image.setPixel( x, y2, val );
@ -543,13 +543,13 @@ KTreemapTile::ensureContrast( QImage & image )
} }
QRgb TQRgb
KTreemapTile::contrastingColor( QRgb col ) KTreemapTile::contrastingColor( TQRgb col )
{ {
if ( qGray( col ) < 128 ) if ( tqGray( col ) < 128 )
return qRgb( qRed( col ) * 2, qGreen( col ) * 2, qBlue( col ) * 2 ); return tqRgb( tqRed( col ) * 2, tqGreen( col ) * 2, tqBlue( col ) * 2 );
else else
return qRgb( qRed( col ) / 2, qGreen( col ) / 2, qBlue( col ) / 2 ); return tqRgb( tqRed( col ) / 2, tqGreen( col ) / 2, tqBlue( col ) / 2 );
} }
@ -566,7 +566,7 @@ KCushionSurface::KCushionSurface()
void void
KCushionSurface::addRidge( KOrientation dim, double height, const QRect & rect ) KCushionSurface::addRidge( KOrientation dim, double height, const TQRect & rect )
{ {
_height = height; _height = height;

@ -16,8 +16,8 @@
# include <config.h> # include <config.h>
#endif #endif
#include <qcanvas.h> #include <tqcanvas.h>
#include <qrect.h> #include <tqrect.h>
#include "kdirtreeiterators.h" #include "kdirtreeiterators.h"
@ -64,7 +64,7 @@ namespace KDirStat
* If you don't want to get all that involved: The coefficients are * If you don't want to get all that involved: The coefficients are
* changed in some way. * changed in some way.
**/ **/
void addRidge( KOrientation dim, double height, const QRect & rect ); void addRidge( KOrientation dim, double height, const TQRect & rect );
/** /**
* Set the cushion's height. * Set the cushion's height.
@ -125,38 +125,38 @@ namespace KDirStat
/** /**
* This is the basic building block of a treemap view: One single tile of a * This is the basic building block of a treemap view: One single tile of a
* treemap. If it corresponds to a leaf in the tree, it will be visible as * treemap. If it corresponds to a leaf in the tree, it will be visible as
* one tile (one rectangle) of the treemap. If it has children, it will be * one tile (one rectangle) of the treemap. If it has tqchildren, it will be
* subdivided again. * subdivided again.
* *
* @short Basic building block of a treemap * @short Basic building block of a treemap
**/ **/
class KTreemapTile: public QCanvasRectangle class KTreemapTile: public TQCanvasRectangle
{ {
public: public:
/** /**
* Constructor: Create a treemap tile from 'fileinfo' that fits into a * Constructor: Create a treemap tile from 'fileinfo' that fits into a
* rectangle 'rect' inside 'parent'. * rectangle 'rect' inside 'tqparent'.
* *
* 'orientation' is the direction for further subdivision. 'Auto' * 'orientation' is the direction for further subdivision. 'Auto'
* selects the wider direction inside 'rect'. * selects the wider direction inside 'rect'.
**/ **/
KTreemapTile( KTreemapView * parentView, KTreemapTile( KTreemapView * tqparentView,
KTreemapTile * parentTile, KTreemapTile * tqparentTile,
KFileInfo * orig, KFileInfo * orig,
const QRect & rect, const TQRect & rect,
KOrientation orientation = KTreemapAuto ); KOrientation orientation = KTreemapAuto );
protected: protected:
/** /**
* Alternate constructor: Like the above, but explicitly specify a * Alternate constructor: Like the above, but explicitly specify a
* cushion surface rather than using the parent's. * cushion surface rather than using the tqparent's.
**/ **/
KTreemapTile( KTreemapView * parentView, KTreemapTile( KTreemapView * tqparentView,
KTreemapTile * parentTile, KTreemapTile * tqparentTile,
KFileInfo * orig, KFileInfo * orig,
const QRect & rect, const TQRect & rect,
const KCushionSurface & cushionSurface, const KCushionSurface & cushionSurface,
KOrientation orientation = KTreemapAuto ); KOrientation orientation = KTreemapAuto );
@ -174,14 +174,14 @@ namespace KDirStat
KFileInfo * orig() const { return _orig; } KFileInfo * orig() const { return _orig; }
/** /**
* Returns the parent @ref KTreemapView. * Returns the tqparent @ref KTreemapView.
**/ **/
KTreemapView * parentView() const { return _parentView; } KTreemapView * tqparentView() const { return _parentView; }
/** /**
* Returns the parent @ref KTreemapTile or 0 if there is none. * Returns the tqparent @ref KTreemapTile or 0 if there is none.
**/ **/
KTreemapTile * parentTile() const { return _parentTile; } KTreemapTile * tqparentTile() const { return _parentTile; }
/** /**
* Returns this tile's cushion surface parameters. * Returns this tile's cushion surface parameters.
@ -192,95 +192,95 @@ namespace KDirStat
protected: protected:
/** /**
* Create children (sub-tiles) of this tile. * Create tqchildren (sub-tiles) of this tile.
**/ **/
void createChildren ( const QRect & rect, void createChildren ( const TQRect & rect,
KOrientation orientation ); KOrientation orientation );
/** /**
* Create children (sub-tiles) using the simple treemap algorithm: * Create tqchildren (sub-tiles) using the simple treemap algorithm:
* Alternate between horizontal and vertical subdivision in each * Alternate between horizontal and vertical subdivision in each
* level. Each child will get the entire height or width, respectively, * level. Each child will get the entire height or width, respectively,
* of the specified rectangle. This algorithm is very fast, but often * of the specified rectangle. This algorithm is very fast, but often
* results in very thin, elongated tiles. * results in very thin, elongated tiles.
**/ **/
void createChildrenSimple( const QRect & rect, void createChildrenSimple( const TQRect & rect,
KOrientation orientation ); KOrientation orientation );
/** /**
* Create children using the "squarified treemaps" algorithm as * Create tqchildren using the "squarified treemaps" algorithm as
* described by Mark Bruls, Kees Huizing, and Jarke J. van Wijk of the * described by Mark Bruls, Kees Huizing, and Jarke J. van Wijk of the
* TU Eindhoven, NL. * TU Eindhoven, NL.
* *
* This algorithm is not quite so simple and involves more expensive * This algorithm is not quite so simple and involves more expensive
* operations, e.g., sorting the children of each node by size first, * operations, e.g., sorting the tqchildren of each node by size first,
* try some variations of the layout and maybe backtrack to the * try some variations of the tqlayout and maybe backtrack to the
* previous attempt. But it results in tiles that are much more * previous attempt. But it results in tiles that are much more
* square-like, i.e. have more reasonable width-to-height ratios. It is * square-like, i.e. have more reasonable width-to-height ratios. It is
* very much less likely to get thin, elongated tiles that are hard to * very much less likely to get thin, elongated tiles that are hard to
* point at and even harder to compare visually against each other. * point at and even harder to compare visually against each other.
* *
* This implementation includes some improvements to that basic * This implementation includes some improvements to that basic
* algorithm. For example, children below a certain size are * algorithm. For example, tqchildren below a certain size are
* disregarded completely since they will not get an adequate visual * disregarded completely since they will not get an adequate visual
* representation anyway (it would be way too small). They are * representation anyway (it would be way too small). They are
* summarized in some kind of 'misc stuff' area in the parent treemap * summarized in some kind of 'misc stuff' area in the tqparent treemap
* tile - in fact, part of the parent directory's tile can be "seen * tile - in fact, part of the tqparent directory's tile can be "seen
* through". * through".
* *
* In short, a lot of small children that don't have any useful effect * In short, a lot of small tqchildren that don't have any useful effect
* for the user in finding wasted disk space are omitted from handling * for the user in finding wasted disk space are omitted from handling
* and, most important, don't need to be sorted by size (which has a * and, most important, don't need to be sorted by size (which has a
* cost of O(n*ln(n)) in the best case, so reducing n helps a lot). * cost of O(n*ln(n)) in the best case, so reducing n helps a lot).
**/ **/
void createSquarifiedChildren( const QRect & rect ); void createSquarifiedChildren( const TQRect & rect );
/** /**
* Squarify as many children as possible: Try to squeeze members * Squarify as many tqchildren as possible: Try to squeeze members
* referred to by 'it' into 'rect' until the aspect ratio doesn't get * referred to by 'it' into 'rect' until the aspect ratio doesn't get
* better any more. Returns a list of children that should be laid out * better any more. Returns a list of tqchildren that should be laid out
* in 'rect'. Moves 'it' until there is no more improvement or 'it' * in 'rect'. Moves 'it' until there is no more improvement or 'it'
* runs out of items. * runs out of items.
* *
* 'scale' is the scaling factor between file sizes and pixels. * 'scale' is the scaling factor between file sizes and pixels.
**/ **/
KFileInfoList squarify( const QRect & rect, KFileInfoList squarify( const TQRect & rect,
double scale, double scale,
KFileInfoSortedBySizeIterator & it ); KFileInfoSortedBySizeIterator & it );
/** /**
* Lay out all members of 'row' within 'rect' along its longer side. * Lay out all members of 'row' within 'rect' along its longer side.
* Returns the new rectangle with the layouted area subtracted. * Returns the new rectangle with the tqlayouted area subtracted.
**/ **/
QRect layoutRow( const QRect & rect, TQRect tqlayoutRow( const TQRect & rect,
double scale, double scale,
KFileInfoList & row ); KFileInfoList & row );
/** /**
* Draw the tile. * Draw the tile.
* *
* Reimplemented from QCanvasRectangle. * Reimplemented from TQCanvasRectangle.
**/ **/
virtual void drawShape( QPainter & painter ); virtual void drawShape( TQPainter & painter );
/** /**
* Render a cushion as described in "cushioned treemaps" by Jarke * Render a cushion as described in "cushioned treemaps" by Jarke
* J. van Wijk and Huub van de Wetering of the TU Eindhoven, NL. * J. van Wijk and Huub van de Wetering of the TU Eindhoven, NL.
**/ **/
QPixmap renderCushion(); TQPixmap renderCushion();
/** /**
* Check if the contrast of the specified image is sufficient to * Check if the contrast of the specified image is sufficient to
* visually distinguish an outline at the right and bottom borders * visually distinguish an outline at the right and bottom borders
* and add a grey line there, if necessary. * and add a grey line there, if necessary.
**/ **/
void ensureContrast( QImage & image ); void ensureContrast( TQImage & image );
/** /**
* Returns a color that gives a reasonable contrast to 'col': Lighter * Returns a color that gives a reasonable contrast to 'col': Lighter
* if 'col' is dark, darker if 'col' is light. * if 'col' is dark, darker if 'col' is light.
**/ **/
QRgb contrastingColor( QRgb col ); TQRgb contrastingColor( TQRgb col );
private: private:
@ -298,7 +298,7 @@ namespace KDirStat
KTreemapTile * _parentTile; KTreemapTile * _parentTile;
KFileInfo * _orig; KFileInfo * _orig;
KCushionSurface _cushionSurface; KCushionSurface _cushionSurface;
QPixmap _cushion; TQPixmap _cushion;
}; // class KTreemapTile }; // class KTreemapTile
@ -306,7 +306,7 @@ namespace KDirStat
inline kdbgstream & operator<< ( kdbgstream & stream, const QRect & rect ) inline kdbgstream & operator<< ( kdbgstream & stream, const TQRect & rect )
{ {
stream << "(" stream << "("
<< rect.width() << "x" << rect.height() << rect.width() << "x" << rect.height()

@ -10,8 +10,8 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <qevent.h> #include <tqevent.h>
#include <qregexp.h> #include <tqregexp.h>
#include <kapp.h> #include <kapp.h>
#include <kconfig.h> #include <kconfig.h>
@ -29,8 +29,8 @@ using namespace KDirStat;
KTreemapView::KTreemapView( KDirTree * tree, QWidget * parent, const QSize & initialSize ) KTreemapView::KTreemapView( KDirTree * tree, TQWidget * tqparent, const TQSize & initialSize )
: QCanvasView( parent ) : TQCanvasView( tqparent )
, _tree( tree ) , _tree( tree )
, _rootTile( 0 ) , _rootTile( 0 )
, _selectedTile( 0 ) , _selectedTile( 0 )
@ -68,17 +68,17 @@ KTreemapView::KTreemapView( KDirTree * tree, QWidget * parent, const QSize & ini
} }
} }
connect( this, SIGNAL( selectionChanged( KFileInfo * ) ), connect( this, TQT_SIGNAL( selectionChanged( KFileInfo * ) ),
tree, SLOT ( selectItem ( KFileInfo * ) ) ); tree, TQT_SLOT ( selectItem ( KFileInfo * ) ) );
connect( tree, SIGNAL( selectionChanged( KFileInfo * ) ), connect( tree, TQT_SIGNAL( selectionChanged( KFileInfo * ) ),
this, SLOT ( selectTile ( KFileInfo * ) ) ); this, TQT_SLOT ( selectTile ( KFileInfo * ) ) );
connect( tree, SIGNAL( deletingChild ( KFileInfo * ) ), connect( tree, TQT_SIGNAL( deletingChild ( KFileInfo * ) ),
this, SLOT ( deleteNotify ( KFileInfo * ) ) ); this, TQT_SLOT ( deleteNotify ( KFileInfo * ) ) );
connect( tree, SIGNAL( childDeleted() ), connect( tree, TQT_SIGNAL( childDeleted() ),
this, SLOT ( rebuildTreemap() ) ); this, TQT_SLOT ( rebuildTreemap() ) );
} }
@ -100,14 +100,14 @@ KTreemapView::clear()
void void
KTreemapView::deleteAllItems( QCanvas * canvas ) KTreemapView::deleteAllItems( TQCanvas * canvas )
{ {
if ( ! canvas ) if ( ! canvas )
return; return;
QCanvasItemList all = canvas->allItems(); TQCanvasItemList all = canvas->allItems();
for ( QCanvasItemList::Iterator it = all.begin(); it != all.end(); ++it ) for ( TQCanvasItemList::Iterator it = all.begin(); it != all.end(); ++it )
delete *it; delete *it;
} }
@ -129,10 +129,10 @@ KTreemapView::readConfig()
_minTileSize = config->readNumEntry ( "MinTileSize" , DefaultMinTileSize ); _minTileSize = config->readNumEntry ( "MinTileSize" , DefaultMinTileSize );
_highlightColor = readColorEntry( config, "HighlightColor" , red ); _highlightColor = readColorEntry( config, "HighlightColor" , red );
_cushionGridColor = readColorEntry( config, "CushionGridColor" , QColor( 0x80, 0x80, 0x80 ) ); _cushionGridColor = readColorEntry( config, "CushionGridColor" , TQColor( 0x80, 0x80, 0x80 ) );
_outlineColor = readColorEntry( config, "OutlineColor" , black ); _outlineColor = readColorEntry( config, "OutlineColor" , black );
_fileFillColor = readColorEntry( config, "FileFillColor" , QColor( 0xde, 0x8d, 0x53 ) ); _fileFillColor = readColorEntry( config, "FileFillColor" , TQColor( 0xde, 0x8d, 0x53 ) );
_dirFillColor = readColorEntry( config, "DirFillColor" , QColor( 0x10, 0x7d, 0xb4 ) ); _dirFillColor = readColorEntry( config, "DirFillColor" , TQColor( 0x10, 0x7d, 0xb4 ) );
if ( _autoResize ) if ( _autoResize )
{ {
@ -141,26 +141,26 @@ KTreemapView::readConfig()
} }
else else
{ {
setHScrollBarMode( QScrollView::Auto ); setHScrollBarMode( TQScrollView::Auto );
setVScrollBarMode( QScrollView::Auto ); setVScrollBarMode( TQScrollView::Auto );
} }
} }
QColor TQColor
KTreemapView::readColorEntry( KConfig * config, const char * entryName, QColor defaultColor ) KTreemapView::readColorEntry( KConfig * config, const char * entryName, TQColor defaultColor )
{ {
return config->readColorEntry( entryName, &defaultColor ); return config->readColorEntry( entryName, &defaultColor );
} }
KTreemapTile * KTreemapTile *
KTreemapView::tileAt( QPoint pos ) KTreemapView::tileAt( TQPoint pos )
{ {
KTreemapTile * tile = 0; KTreemapTile * tile = 0;
QCanvasItemList coll = canvas()->collisions( pos ); TQCanvasItemList coll = canvas()->collisions( pos );
QCanvasItemList::Iterator it = coll.begin(); TQCanvasItemList::Iterator it = coll.begin();
while ( it != coll.end() && tile == 0 ) while ( it != coll.end() && tile == 0 )
{ {
@ -173,7 +173,7 @@ KTreemapView::tileAt( QPoint pos )
void void
KTreemapView::contentsMousePressEvent( QMouseEvent * event ) KTreemapView::contentsMousePressEvent( TQMouseEvent * event )
{ {
// kdDebug() << k_funcinfo << endl; // kdDebug() << k_funcinfo << endl;
@ -181,19 +181,19 @@ KTreemapView::contentsMousePressEvent( QMouseEvent * event )
switch ( event->button() ) switch ( event->button() )
{ {
case LeftButton: case Qt::LeftButton:
selectTile( tile ); selectTile( tile );
emit userActivity( 1 ); emit userActivity( 1 );
break; break;
case MidButton: case Qt::MidButton:
// Select clicked tile's parent, if available // Select clicked tile's tqparent, if available
if ( _selectedTile && if ( _selectedTile &&
_selectedTile->rect().contains( event->pos() ) ) _selectedTile->rect().tqcontains( event->pos() ) )
{ {
if ( _selectedTile->parentTile() ) if ( _selectedTile->tqparentTile() )
tile = _selectedTile->parentTile(); tile = _selectedTile->tqparentTile();
} }
// Intentionally handling the middle button like the left button if // Intentionally handling the middle button like the left button if
@ -208,12 +208,12 @@ KTreemapView::contentsMousePressEvent( QMouseEvent * event )
emit userActivity( 1 ); emit userActivity( 1 );
break; break;
case RightButton: case Qt::RightButton:
if ( tile ) if ( tile )
{ {
if ( _selectedTile && if ( _selectedTile &&
_selectedTile->rect().contains( event->pos() ) ) _selectedTile->rect().tqcontains( event->pos() ) )
{ {
// If a directory (non-leaf tile) is already selected, // If a directory (non-leaf tile) is already selected,
// don't override this by // don't override this by
@ -239,7 +239,7 @@ KTreemapView::contentsMousePressEvent( QMouseEvent * event )
void void
KTreemapView::contentsMouseDoubleClickEvent( QMouseEvent * event ) KTreemapView::contentsMouseDoubleClickEvent( TQMouseEvent * event )
{ {
// kdDebug() << k_funcinfo << endl; // kdDebug() << k_funcinfo << endl;
@ -247,7 +247,7 @@ KTreemapView::contentsMouseDoubleClickEvent( QMouseEvent * event )
switch ( event->button() ) switch ( event->button() )
{ {
case LeftButton: case Qt::LeftButton:
if ( tile ) if ( tile )
{ {
selectTile( tile ); selectTile( tile );
@ -256,12 +256,12 @@ KTreemapView::contentsMouseDoubleClickEvent( QMouseEvent * event )
} }
break; break;
case MidButton: case Qt::MidButton:
zoomOut(); zoomOut();
emit userActivity( 5 ); emit userActivity( 5 );
break; break;
case RightButton: case Qt::RightButton:
// Double-clicking the right mouse button is pretty useless - the // Double-clicking the right mouse button is pretty useless - the
// first click opens the context menu: Single clicks are always // first click opens the context menu: Single clicks are always
// delivered first. Even if that would be caught by using timers, // delivered first. Even if that would be caught by using timers,
@ -285,10 +285,10 @@ KTreemapView::zoomIn()
KTreemapTile * newRootTile = _selectedTile; KTreemapTile * newRootTile = _selectedTile;
while ( newRootTile->parentTile() != _rootTile && while ( newRootTile->tqparentTile() != _rootTile &&
newRootTile->parentTile() ) // This should never happen, but who knows? newRootTile->tqparentTile() ) // This should never happen, but who knows?
{ {
newRootTile = newRootTile->parentTile(); newRootTile = newRootTile->tqparentTile();
} }
if ( newRootTile ) if ( newRootTile )
@ -308,8 +308,8 @@ KTreemapView::zoomOut()
{ {
KFileInfo * root = _rootTile->orig(); KFileInfo * root = _rootTile->orig();
if ( root->parent() ) if ( root->tqparent() )
root = root->parent(); root = root->tqparent();
rebuildTreemap( root ); rebuildTreemap( root );
} }
@ -319,8 +319,8 @@ KTreemapView::zoomOut()
void void
KTreemapView::selectParent() KTreemapView::selectParent()
{ {
if ( _selectedTile && _selectedTile->parentTile() ) if ( _selectedTile && _selectedTile->tqparentTile() )
selectTile( _selectedTile->parentTile() ); selectTile( _selectedTile->tqparentTile() );
} }
@ -335,10 +335,10 @@ KTreemapView::canZoomIn() const
KTreemapTile * newRootTile = _selectedTile; KTreemapTile * newRootTile = _selectedTile;
while ( newRootTile->parentTile() != _rootTile && while ( newRootTile->tqparentTile() != _rootTile &&
newRootTile->parentTile() ) // This should never happen, but who knows? newRootTile->tqparentTile() ) // This should never happen, but who knows?
{ {
newRootTile = newRootTile->parentTile(); newRootTile = newRootTile->tqparentTile();
} }
if ( newRootTile ) if ( newRootTile )
@ -366,7 +366,7 @@ KTreemapView::canZoomOut() const
bool bool
KTreemapView::canSelectParent() const KTreemapView::canSelectParent() const
{ {
return _selectedTile && _selectedTile->parentTile(); return _selectedTile && _selectedTile->tqparentTile();
} }
@ -392,11 +392,11 @@ KTreemapView::rebuildTreemap()
void void
KTreemapView::rebuildTreemap( KFileInfo * newRoot, KTreemapView::rebuildTreemap( KFileInfo * newRoot,
const QSize & newSz ) const TQSize & newSz )
{ {
// kdDebug() << k_funcinfo << endl; // kdDebug() << k_funcinfo << endl;
QSize newSize = newSz; TQSize newSize = newSz;
if ( newSz.isEmpty() ) if ( newSz.isEmpty() )
newSize = visibleSize(); newSize = visibleSize();
@ -409,7 +409,7 @@ KTreemapView::rebuildTreemap( KFileInfo * newRoot,
if ( ! canvas() ) if ( ! canvas() )
{ {
QCanvas * canv = new QCanvas( this ); TQCanvas * canv = new TQCanvas( TQT_TQOBJECT(this) );
CHECK_PTR( canv ); CHECK_PTR( canv );
setCanvas( canv ); setCanvas( canv );
} }
@ -427,10 +427,10 @@ KTreemapView::rebuildTreemap( KFileInfo * newRoot,
if ( newRoot ) if ( newRoot )
{ {
_rootTile = new KTreemapTile( this, // parentView _rootTile = new KTreemapTile( this, // tqparentView
0, // parentTile 0, // tqparentTile
newRoot, // orig newRoot, // orig
QRect( QPoint( 0, 0), newSize ), TQRect( TQPoint( 0, 0), newSize ),
KTreemapAuto ); KTreemapAuto );
} }
@ -488,9 +488,9 @@ KTreemapView::deleteNotify( KFileInfo * )
void void
KTreemapView::resizeEvent( QResizeEvent * event ) KTreemapView::resizeEvent( TQResizeEvent * event )
{ {
QCanvasView::resizeEvent( event ); TQCanvasView::resizeEvent( event );
if ( _autoResize ) if ( _autoResize )
{ {
@ -563,8 +563,8 @@ KTreemapView::findTile( KFileInfo * node )
if ( ! node ) if ( ! node )
return 0; return 0;
QCanvasItemList itemList = canvas()->allItems(); TQCanvasItemList itemList = canvas()->allItems();
QCanvasItemList::Iterator it = itemList.begin(); TQCanvasItemList::Iterator it = itemList.begin();
while ( it != itemList.end() ) while ( it != itemList.end() )
{ {
@ -580,7 +580,7 @@ KTreemapView::findTile( KFileInfo * node )
} }
QSize TQSize
KTreemapView::visibleSize() KTreemapView::visibleSize()
{ {
ScrollBarMode oldHMode = hScrollBarMode(); ScrollBarMode oldHMode = hScrollBarMode();
@ -589,8 +589,8 @@ KTreemapView::visibleSize()
setHScrollBarMode( AlwaysOff ); setHScrollBarMode( AlwaysOff );
setVScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOff );
QSize size = QSize( QCanvasView::visibleWidth(), TQSize size = TQSize( TQCanvasView::visibleWidth(),
QCanvasView::visibleHeight() ); TQCanvasView::visibleHeight() );
setHScrollBarMode( oldHMode ); setHScrollBarMode( oldHMode );
setVScrollBarMode( oldVMode ); setVScrollBarMode( oldVMode );
@ -599,7 +599,7 @@ KTreemapView::visibleSize()
} }
QColor TQColor
KTreemapView::tileColor( KFileInfo * file ) KTreemapView::tileColor( KFileInfo * file )
{ {
if ( file ) if ( file )
@ -607,76 +607,76 @@ KTreemapView::tileColor( KFileInfo * file )
if ( file->isFile() ) if ( file->isFile() )
{ {
// Find the filename extension: Everything after the first '.' // Find the filename extension: Everything after the first '.'
QString ext = file->name().section( '.', 1 ); TQString ext = file->name().section( '.', 1 );
while ( ! ext.isEmpty() ) while ( ! ext.isEmpty() )
{ {
QString lowerExt = ext.lower(); TQString lowerExt = ext.lower();
// Try case sensitive comparisions first // Try case sensitive comparisions first
if ( ext == "~" ) return Qt::red; if ( ext == "~" ) return TQt::red;
if ( ext == "bak" ) return Qt::red; if ( ext == "bak" ) return TQt::red;
if ( ext == "c" ) return Qt::blue; if ( ext == "c" ) return TQt::blue;
if ( ext == "cpp" ) return Qt::blue; if ( ext == "cpp" ) return TQt::blue;
if ( ext == "cc" ) return Qt::blue; if ( ext == "cc" ) return TQt::blue;
if ( ext == "h" ) return Qt::blue; if ( ext == "h" ) return TQt::blue;
if ( ext == "hpp" ) return Qt::blue; if ( ext == "hpp" ) return TQt::blue;
if ( ext == "el" ) return Qt::blue; if ( ext == "el" ) return TQt::blue;
if ( ext == "o" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "o" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "lo" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "lo" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "Po" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "Po" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "al" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "al" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "moc.cpp" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "tqmoc.cpp" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "moc.cc" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "tqmoc.cc" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "elc" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "elc" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "la" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "la" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "a" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "a" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( ext == "rpm" ) return QColor( 0xff, 0xa0, 0x00 ); if ( ext == "rpm" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( lowerExt == "tar.bz2" ) return Qt::green; if ( lowerExt == "tar.bz2" ) return TQt::green;
if ( lowerExt == "tar.gz" ) return Qt::green; if ( lowerExt == "tar.gz" ) return TQt::green;
if ( lowerExt == "tgz" ) return Qt::green; if ( lowerExt == "tgz" ) return TQt::green;
if ( lowerExt == "bz2" ) return Qt::green; if ( lowerExt == "bz2" ) return TQt::green;
if ( lowerExt == "bz" ) return Qt::green; if ( lowerExt == "bz" ) return TQt::green;
if ( lowerExt == "gz" ) return Qt::green; if ( lowerExt == "gz" ) return TQt::green;
if ( lowerExt == "html" ) return Qt::blue; if ( lowerExt == "html" ) return TQt::blue;
if ( lowerExt == "htm" ) return Qt::blue; if ( lowerExt == "htm" ) return TQt::blue;
if ( lowerExt == "txt" ) return Qt::blue; if ( lowerExt == "txt" ) return TQt::blue;
if ( lowerExt == "doc" ) return Qt::blue; if ( lowerExt == "doc" ) return TQt::blue;
if ( lowerExt == "png" ) return Qt::cyan; if ( lowerExt == "png" ) return TQt::cyan;
if ( lowerExt == "jpg" ) return Qt::cyan; if ( lowerExt == "jpg" ) return TQt::cyan;
if ( lowerExt == "jpeg" ) return Qt::cyan; if ( lowerExt == "jpeg" ) return TQt::cyan;
if ( lowerExt == "gif" ) return Qt::cyan; if ( lowerExt == "gif" ) return TQt::cyan;
if ( lowerExt == "tif" ) return Qt::cyan; if ( lowerExt == "tif" ) return TQt::cyan;
if ( lowerExt == "tiff" ) return Qt::cyan; if ( lowerExt == "tiff" ) return TQt::cyan;
if ( lowerExt == "bmp" ) return Qt::cyan; if ( lowerExt == "bmp" ) return TQt::cyan;
if ( lowerExt == "xpm" ) return Qt::cyan; if ( lowerExt == "xpm" ) return TQt::cyan;
if ( lowerExt == "tga" ) return Qt::cyan; if ( lowerExt == "tga" ) return TQt::cyan;
if ( lowerExt == "wav" ) return Qt::yellow; if ( lowerExt == "wav" ) return TQt::yellow;
if ( lowerExt == "mp3" ) return Qt::yellow; if ( lowerExt == "mp3" ) return TQt::yellow;
if ( lowerExt == "avi" ) return QColor( 0xa0, 0xff, 0x00 ); if ( lowerExt == "avi" ) return TQColor( 0xa0, 0xff, 0x00 );
if ( lowerExt == "mov" ) return QColor( 0xa0, 0xff, 0x00 ); if ( lowerExt == "mov" ) return TQColor( 0xa0, 0xff, 0x00 );
if ( lowerExt == "mpg" ) return QColor( 0xa0, 0xff, 0x00 ); if ( lowerExt == "mpg" ) return TQColor( 0xa0, 0xff, 0x00 );
if ( lowerExt == "mpeg" ) return QColor( 0xa0, 0xff, 0x00 ); if ( lowerExt == "mpeg" ) return TQColor( 0xa0, 0xff, 0x00 );
if ( lowerExt == "pdf" ) return Qt::blue; if ( lowerExt == "pdf" ) return TQt::blue;
if ( lowerExt == "ps" ) return Qt::cyan; if ( lowerExt == "ps" ) return TQt::cyan;
// Some DOS/Windows types // Some DOS/Windows types
if ( lowerExt == "exe" ) return Qt::magenta; if ( lowerExt == "exe" ) return TQt::magenta;
if ( lowerExt == "com" ) return Qt::magenta; if ( lowerExt == "com" ) return TQt::magenta;
if ( lowerExt == "dll" ) return QColor( 0xff, 0xa0, 0x00 ); if ( lowerExt == "dll" ) return TQColor( 0xff, 0xa0, 0x00 );
if ( lowerExt == "zip" ) return Qt::green; if ( lowerExt == "zip" ) return TQt::green;
if ( lowerExt == "arj" ) return Qt::green; if ( lowerExt == "arj" ) return TQt::green;
// No match so far? Try the next extension. Some files might have // No match so far? Try the next extension. Some files might have
@ -687,23 +687,23 @@ KTreemapView::tileColor( KFileInfo * file )
} }
// Shared libs // Shared libs
if ( QRegExp( "lib.*\\.so.*" ).exactMatch( file->name() ) ) if ( TQRegExp( "lib.*\\.so.*" ).exactMatch( file->name() ) )
return QColor( 0xff, 0xa0, 0x00 ); return TQColor( 0xff, 0xa0, 0x00 );
// Very special, but common: Core dumps // Very special, but common: Core dumps
if ( file->name() == "core" ) return Qt::red; if ( file->name() == "core" ) return TQt::red;
// Special case: Executables // Special case: Executables
if ( ( file->mode() & S_IXUSR ) == S_IXUSR ) return Qt::magenta; if ( ( file->mode() & S_IXUSR ) == S_IXUSR ) return TQt::magenta;
} }
else // Directories else // Directories
{ {
// TO DO // TO DO
return Qt::blue; return TQt::blue;
} }
} }
return Qt::white; return TQt::white;
} }
@ -711,10 +711,10 @@ KTreemapView::tileColor( KFileInfo * file )
KTreemapSelectionRect::KTreemapSelectionRect( QCanvas * canvas, const QColor & color ) KTreemapSelectionRect::KTreemapSelectionRect( TQCanvas * canvas, const TQColor & color )
: QCanvasRectangle( canvas ) : TQCanvasRectangle( canvas )
{ {
setPen( QPen( color, 2 ) ); setPen( TQPen( color, 2 ) );
setZ( 1e10 ); // Higher than everything else setZ( 1e10 ); // Higher than everything else
} }
@ -725,7 +725,7 @@ KTreemapSelectionRect::highlight( KTreemapTile * tile )
{ {
if ( tile ) if ( tile )
{ {
QRect tileRect = tile->rect(); TQRect tileRect = tile->rect();
move( tileRect.x(), tileRect.y() ); move( tileRect.x(), tileRect.y() );
setSize( tileRect.width(), tileRect.height() ); setSize( tileRect.width(), tileRect.height() );

@ -11,7 +11,7 @@
#ifndef KTreemapView_h #ifndef KTreemapView_h
#define KTreemapView_h #define KTreemapView_h
#include <qcanvas.h> #include <tqcanvas.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
@ -31,7 +31,7 @@
#define CushionHeight 1.0 #define CushionHeight 1.0
class QMouseEvent; class TQMouseEvent;
class KConfig; class KConfig;
namespace KDirStat namespace KDirStat
@ -41,17 +41,18 @@ namespace KDirStat
class KDirTree; class KDirTree;
class KFileInfo; class KFileInfo;
class KTreemapView: public QCanvasView class KTreemapView: public TQCanvasView
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
**/ **/
KTreemapView( KDirTree * tree, KTreemapView( KDirTree * tree,
QWidget * parent = 0, TQWidget * tqparent = 0,
const QSize & initialSize = QSize() ); const TQSize & initialSize = TQSize() );
/** /**
* Destructor. * Destructor.
@ -62,13 +63,13 @@ namespace KDirStat
* Returns the (topmost) treemap tile at the specified position * Returns the (topmost) treemap tile at the specified position
* or 0 if there is none. * or 0 if there is none.
**/ **/
KTreemapTile * tileAt( QPoint pos ); KTreemapTile * tileAt( TQPoint pos );
/** /**
* Returns the minimum recommended size for this widget. * Returns the minimum recommended size for this widget.
* Reimplemented from QWidget. * Reimplemented from TQWidget.
**/ **/
virtual QSize minimumSizeHint() const { return QSize( 0, 0 ); } virtual TQSize tqminimumSizeHint() const { return TQSize( 0, 0 ); }
/** /**
* Returns this treemap view's currently selected treemap tile or 0 if * Returns this treemap view's currently selected treemap tile or 0 if
@ -100,7 +101,7 @@ namespace KDirStat
* Returns a suitable color for 'file' based on a set of internal rules * Returns a suitable color for 'file' based on a set of internal rules
* (according to filename extension, MIME type or permissions). * (according to filename extension, MIME type or permissions).
**/ **/
QColor tileColor( KFileInfo * file ); TQColor tileColor( KFileInfo * file );
public slots: public slots:
@ -127,18 +128,18 @@ namespace KDirStat
void zoomIn(); void zoomIn();
/** /**
* Zoom out one level: The parent (if there is any) KFileInfo node of * Zoom out one level: The tqparent (if there is any) KFileInfo node of
* the current treemap root becomes the new root. This usually works * the current treemap root becomes the new root. This usually works
* only after zoomIn(). * only after zoomIn().
**/ **/
void zoomOut(); void zoomOut();
/** /**
* Select the parent of the currently selected tile (if possible). * Select the tqparent of the currently selected tile (if possible).
* *
* This is very much the same as clicking with the middle mouse button, * This is very much the same as clicking with the middle mouse button,
* but not quite: The middle mouse button cycles back to the tile * but not quite: The middle mouse button cycles back to the tile
* clicked at if there is no more parent. This method does not (because * clicked at if there is no more tqparent. This method does not (because
* there is no known mouse position). * there is no known mouse position).
**/ **/
void selectParent(); void selectParent();
@ -155,11 +156,11 @@ namespace KDirStat
void clear(); void clear();
/** /**
* Delete all items of a QCanvas. * Delete all items of a TQCanvas.
* *
* Strangely enough, QCanvas itself does not provide such a function. * Strangely enough, TQCanvas itself does not provide such a function.
**/ **/
static void deleteAllItems( QCanvas * canvas ); static void deleteAllItems( TQCanvas * canvas );
/** /**
* Notification that a dir tree node has been deleted. * Notification that a dir tree node has been deleted.
@ -178,14 +179,14 @@ namespace KDirStat
* size. If 'newSize' is (0, 0), visibleSize() is used. * size. If 'newSize' is (0, 0), visibleSize() is used.
**/ **/
void rebuildTreemap( KFileInfo * newRoot, void rebuildTreemap( KFileInfo * newRoot,
const QSize & newSize = QSize() ); const TQSize & newSize = TQSize() );
/** /**
* Returns the visible size of the viewport presuming no scrollbars are * Returns the visible size of the viewport presuming no scrollbars are
* needed - which makes a lot more sense than fiddling with scrollbars * needed - which makes a lot more sense than fiddling with scrollbars
* since treemaps can be scaled to make scrollbars unnecessary. * since treemaps can be scaled to make scrollbars unnecessary.
**/ **/
QSize visibleSize(); TQSize visibleSize();
/** /**
* Returns the visible width of the viewport presuming no scrollbars * Returns the visible width of the viewport presuming no scrollbars
@ -220,7 +221,7 @@ namespace KDirStat
bool canZoomOut() const; bool canZoomOut() const;
/** /**
* Returns true if it is possible to select the parent of the currently * Returns true if it is possible to select the tqparent of the currently
* selected tile, false if not. * selected tile, false if not.
**/ **/
bool canSelectParent() const; bool canSelectParent() const;
@ -263,24 +264,24 @@ namespace KDirStat
/** /**
* Returns the cushion grid color. * Returns the cushion grid color.
**/ **/
const QColor & cushionGridColor() const { return _cushionGridColor; } const TQColor & cushionGridColor() const { return _cushionGridColor; }
/** /**
* Returns the outline color to use if cushion shading is not used. * Returns the outline color to use if cushion shading is not used.
**/ **/
const QColor & outlineColor() const { return _outlineColor; } const TQColor & outlineColor() const { return _outlineColor; }
/** /**
* Returns the fill color for non-directory treemap tiles when cushion * Returns the fill color for non-directory treemap tiles when cushion
* shading is not used. * shading is not used.
**/ **/
const QColor & fileFillColor() const { return _fileFillColor; } const TQColor & fileFillColor() const { return _fileFillColor; }
/** /**
* Returns the fill color for directory (or "dotentry") treemap tiles * Returns the fill color for directory (or "dotentry") treemap tiles
* when cushion shading is not used. * when cushion shading is not used.
**/ **/
const QColor & dirFillColor() const { return _dirFillColor; } const TQColor & dirFillColor() const { return _dirFillColor; }
/** /**
* Returns the intensity of ambient light for cushion shading * Returns the intensity of ambient light for cushion shading
@ -333,7 +334,7 @@ namespace KDirStat
* (usually on right click). 'pos' contains the click's mouse * (usually on right click). 'pos' contains the click's mouse
* coordinates. * coordinates.
**/ **/
void contextMenu( KTreemapTile * tile, const QPoint & pos ); void contextMenu( KTreemapTile * tile, const TQPoint & pos );
/** /**
* Emitted at user activity. Some interactive actions are assigned an * Emitted at user activity. Some interactive actions are assigned an
@ -350,7 +351,7 @@ namespace KDirStat
/** /**
* Catch mouse click - emits a selectionChanged() signal. * Catch mouse click - emits a selectionChanged() signal.
**/ **/
virtual void contentsMousePressEvent( QMouseEvent * event ); virtual void contentsMousePressEvent( TQMouseEvent * event );
/** /**
* Catch mouse double click: * Catch mouse double click:
@ -358,23 +359,23 @@ namespace KDirStat
* right button double-click zooms out, * right button double-click zooms out,
* middle button double-click rebuilds treemap. * middle button double-click rebuilds treemap.
**/ **/
virtual void contentsMouseDoubleClickEvent( QMouseEvent * event ); virtual void contentsMouseDoubleClickEvent( TQMouseEvent * event );
/** /**
* Resize the treemap view. Suppress the treemap contents if the size * Resize the treemap view. Suppress the treemap contents if the size
* falls below a minimum size, redisplay it if it grows above that * falls below a minimum size, redisplay it if it grows above that
* minimum size. * minimum size.
* *
* Reimplemented from QFrame. * Reimplemented from TQFrame.
**/ **/
virtual void resizeEvent( QResizeEvent * event ); virtual void resizeEvent( TQResizeEvent * event );
/** /**
* Convenience method to read a color from 'config'. * Convenience method to read a color from 'config'.
**/ **/
QColor readColorEntry( KConfig * config, TQColor readColorEntry( KConfig * config,
const char * entryName, const char * entryName,
QColor defaultColor ); TQColor defaultColor );
// Data members // Data members
@ -382,7 +383,7 @@ namespace KDirStat
KTreemapTile * _rootTile; KTreemapTile * _rootTile;
KTreemapTile * _selectedTile; KTreemapTile * _selectedTile;
KTreemapSelectionRect * _selectionRect; KTreemapSelectionRect * _selectionRect;
QString _savedRootUrl; TQString _savedRootUrl;
bool _autoResize; bool _autoResize;
bool _squarify; bool _squarify;
@ -391,11 +392,11 @@ namespace KDirStat
bool _ensureContrast; bool _ensureContrast;
int _minTileSize; int _minTileSize;
QColor _highlightColor; TQColor _highlightColor;
QColor _cushionGridColor; TQColor _cushionGridColor;
QColor _outlineColor; TQColor _outlineColor;
QColor _fileFillColor; TQColor _fileFillColor;
QColor _dirFillColor; TQColor _dirFillColor;
int _ambientLight; int _ambientLight;
@ -418,14 +419,14 @@ namespace KDirStat
* on top (i.e., great z-height) of everything else. The rectangle is * on top (i.e., great z-height) of everything else. The rectangle is
* transparent, so the treemap tile contents remain visible. * transparent, so the treemap tile contents remain visible.
**/ **/
class KTreemapSelectionRect: public QCanvasRectangle class KTreemapSelectionRect: public TQCanvasRectangle
{ {
public: public:
/** /**
* Constructor. * Constructor.
**/ **/
KTreemapSelectionRect( QCanvas * canvas, const QColor & color ); KTreemapSelectionRect( TQCanvas * canvas, const TQColor & color );
/** /**
* Highlight the specified treemap tile: Resize this selection * Highlight the specified treemap tile: Resize this selection

Loading…
Cancel
Save