diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 21:28:42 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 21:28:42 +0000 |
commit | e8d62395de6c1b3844294c5b6c09428c315ac42a (patch) | |
tree | f94a43e157b5b4607f3a8d5b9b7be873d458fafa /kdirstat/kdirstatapp.cpp | |
parent | 1ed26cd2c4d896ae560dc7dddb570fe14ef573f3 (diff) | |
download | kdirstat-e8d62395de6c1b3844294c5b6c09428c315ac42a.tar.gz kdirstat-e8d62395de6c1b3844294c5b6c09428c315ac42a.zip |
TQt4 port kdirstat
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdirstat@1239296 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdirstat/kdirstatapp.cpp')
-rw-r--r-- | kdirstat/kdirstatapp.cpp | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/kdirstat/kdirstatapp.cpp b/kdirstat/kdirstatapp.cpp index 22726e9..81fce60 100644 --- a/kdirstat/kdirstatapp.cpp +++ b/kdirstat/kdirstatapp.cpp @@ -10,9 +10,9 @@ */ -#include <qclipboard.h> -#include <qpopupmenu.h> -#include <qsplitter.h> +#include <tqclipboard.h> +#include <tqpopupmenu.h> +#include <tqsplitter.h> #include <kaccel.h> #include <kaction.h> @@ -54,7 +54,7 @@ using namespace KDirStat; -KDirStatApp::KDirStatApp( QWidget* , const char* name ) +KDirStatApp::KDirStatApp( TQWidget* , const char* name ) : KMainWindow( 0, name ) { // Simple inits @@ -73,39 +73,39 @@ KDirStatApp::KDirStatApp( QWidget* , const char* name ) // Set up internal (mainWin -> mainWin) connections - connect( this, SIGNAL( readConfig ( void ) ), - this, SLOT ( readMainWinConfig( void ) ) ); + connect( this, TQT_SIGNAL( readConfig ( void ) ), + this, TQT_SLOT ( readMainWinConfig( void ) ) ); - connect( this, SIGNAL( saveConfig ( void ) ), - this, SLOT ( saveMainWinConfig( void ) ) ); + connect( this, TQT_SIGNAL( saveConfig ( void ) ), + this, TQT_SLOT ( saveMainWinConfig( void ) ) ); // Create main window - _splitter = new QSplitter( QSplitter::Vertical, this ); + _splitter = new TQSplitter( Qt::Vertical, this ); setCentralWidget( _splitter ); _treeView = new KDirTreeView( _splitter ); - connect( _treeView, SIGNAL( progressInfo( const QString & ) ), - this, SLOT ( statusMsg ( const QString & ) ) ); + connect( _treeView, TQT_SIGNAL( progressInfo( const TQString & ) ), + this, TQT_SLOT ( statusMsg ( const TQString & ) ) ); - connect( _treeView, SIGNAL( selectionChanged( KFileInfo * ) ), - this, SLOT ( selectionChanged( KFileInfo * ) ) ); + connect( _treeView, TQT_SIGNAL( selectionChanged( KFileInfo * ) ), + this, TQT_SLOT ( selectionChanged( KFileInfo * ) ) ); - connect( _treeView, SIGNAL( contextMenu( KDirTreeViewItem *, const QPoint & ) ), - this, SLOT ( contextMenu( KDirTreeViewItem *, const QPoint & ) ) ); + connect( _treeView, TQT_SIGNAL( contextMenu( KDirTreeViewItem *, const TQPoint & ) ), + this, TQT_SLOT ( contextMenu( KDirTreeViewItem *, const TQPoint & ) ) ); - connect( this, SIGNAL( readConfig() ), _treeView, SLOT ( readConfig() ) ); - connect( this, SIGNAL( saveConfig() ), _treeView, SLOT ( saveConfig() ) ); + connect( this, TQT_SIGNAL( readConfig() ), _treeView, TQT_SLOT ( readConfig() ) ); + connect( this, TQT_SIGNAL( saveConfig() ), _treeView, TQT_SLOT ( saveConfig() ) ); - connect( _treeView, SIGNAL( finished() ), this, SLOT( createTreemapView() ) ); - connect( _treeView, SIGNAL( aborted() ), this, SLOT( createTreemapView() ) ); - connect( _treeView, SIGNAL( startingReading() ), this, SLOT( deleteTreemapView() ) ); + connect( _treeView, TQT_SIGNAL( finished() ), TQT_TQOBJECT(this), TQT_SLOT( createTreemapView() ) ); + connect( _treeView, TQT_SIGNAL( aborted() ), TQT_TQOBJECT(this), TQT_SLOT( createTreemapView() ) ); + connect( _treeView, TQT_SIGNAL( startingReading() ), TQT_TQOBJECT(this), TQT_SLOT( deleteTreemapView() ) ); - connect( _treeView, SIGNAL( startingReading() ), this, SLOT( updateActions() ) ); - connect( _treeView, SIGNAL( finished() ), this, SLOT( updateActions() ) ); - connect( _treeView, SIGNAL( aborted() ), this, SLOT( updateActions() ) ); + connect( _treeView, TQT_SIGNAL( startingReading() ), TQT_TQOBJECT(this), TQT_SLOT( updateActions() ) ); + connect( _treeView, TQT_SIGNAL( finished() ), TQT_TQOBJECT(this), TQT_SLOT( updateActions() ) ); + connect( _treeView, TQT_SIGNAL( aborted() ), TQT_TQOBJECT(this), TQT_SLOT( updateActions() ) ); // Call inits to invoke all other construction parts @@ -115,8 +115,8 @@ KDirStatApp::KDirStatApp( QWidget* , const char* name ) createGUI(); initActivityTracker(); - _treeViewContextMenu = (QPopupMenu *) factory()->container( "treeViewContextMenu", this ); - _treemapContextMenu = (QPopupMenu *) factory()->container( "treemapContextMenu", this ); + _treeViewContextMenu = (TQPopupMenu *) factory()->container( "treeViewContextMenu", this ); + _treemapContextMenu = (TQPopupMenu *) factory()->container( "treemapContextMenu", this ); readMainWinConfig(); @@ -141,72 +141,72 @@ KDirStatApp::~KDirStatApp() void 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, - this, SLOT( fileAskOpenUrl() ), + TQT_TQOBJECT(this), TQT_SLOT( fileAskOpenUrl() ), actionCollection(), "file_open_url" ); - _fileOpenRecent = KStdAction::openRecent ( this, SLOT( fileOpenRecent( const KURL& ) ), actionCollection() ); - _fileCloseDir = KStdAction::close ( this, SLOT( fileCloseDir() ), actionCollection() ); + _fileOpenRecent = KStdAction::openRecent ( TQT_TQOBJECT(this), TQT_SLOT( fileOpenRecent( const KURL& ) ), actionCollection() ); + _fileCloseDir = KStdAction::close ( TQT_TQOBJECT(this), TQT_SLOT( fileCloseDir() ), actionCollection() ); _fileRefreshAll = new KAction( i18n( "Refresh &All" ), "reload", 0, - this, SLOT( refreshAll() ), + TQT_TQOBJECT(this), TQT_SLOT( refreshAll() ), actionCollection(), "file_refresh_all" ); _fileRefreshSelected = new KAction( i18n( "Refresh &Selected" ), 0, - this, SLOT( refreshSelected() ), + TQT_TQOBJECT(this), TQT_SLOT( refreshSelected() ), actionCollection(), "file_refresh_selected" ); _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" ); _fileStopReading = new KAction( i18n( "Stop Rea&ding" ), "stop", 0, - this, SLOT( stopReading() ), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT( stopReading() ), actionCollection(), "file_stop_reading" ); - _fileQuit = KStdAction::quit ( kapp, SLOT( quit() ), actionCollection() ); - _editCopy = KStdAction::copy ( this, SLOT( editCopy() ), actionCollection() ); - _showToolBar = KStdAction::showToolbar ( this, SLOT( toggleToolBar() ), actionCollection() ); - _showStatusBar = KStdAction::showStatusbar ( this, SLOT( toggleStatusBar() ), actionCollection() ); + _fileQuit = KStdAction::quit ( TQT_TQOBJECT(kapp), TQT_SLOT( quit() ), actionCollection() ); + _editCopy = KStdAction::copy ( TQT_TQOBJECT(this), TQT_SLOT( editCopy() ), actionCollection() ); + _showToolBar = KStdAction::showToolbar ( TQT_TQOBJECT(this), TQT_SLOT( toggleToolBar() ), actionCollection() ); + _showStatusBar = KStdAction::showStatusbar ( TQT_TQOBJECT(this), TQT_SLOT( toggleStatusBar() ), actionCollection() ); _cleanupOpenWith = new KAction( i18n( "Open With" ), 0, - this, SLOT( cleanupOpenWith() ), + TQT_TQOBJECT(this), TQT_SLOT( cleanupOpenWith() ), actionCollection(), "cleanup_open_with" ); _treemapZoomIn = new KAction( i18n( "Zoom in" ), "viewmag+", Key_Plus, - this, SLOT( treemapZoomIn() ), + TQT_TQOBJECT(this), TQT_SLOT( treemapZoomIn() ), actionCollection(), "treemap_zoom_in" ); _treemapZoomOut = new KAction( i18n( "Zoom out" ), "viewmag-", Key_Minus, - this, SLOT( treemapZoomOut() ), + TQT_TQOBJECT(this), TQT_SLOT( treemapZoomOut() ), actionCollection(), "treemap_zoom_out" ); _treemapSelectParent= new KAction( i18n( "Select Parent" ), "up", Key_Asterisk, - this, SLOT( treemapSelectParent() ), + TQT_TQOBJECT(this), TQT_SLOT( treemapSelectParent() ), actionCollection(), "treemap_select_parent" ); _treemapRebuild = new KAction( i18n( "Rebuild Treemap" ), 0, - this, SLOT( treemapRebuild() ), + TQT_TQOBJECT(this), TQT_SLOT( treemapRebuild() ), actionCollection(), "treemap_rebuild" ); _showTreemapView = new KToggleAction( i18n( "Show Treemap" ), Key_F9, - this, SLOT( toggleTreemapView() ), + TQT_TQOBJECT(this), TQT_SLOT( toggleTreemapView() ), actionCollection(), "options_show_treemap" ); new KAction( i18n( "Help about Treemaps" ), "help", 0, - this, SLOT( treemapHelp() ), + TQT_TQOBJECT(this), TQT_SLOT( treemapHelp() ), 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, - _treeView, SLOT( sendMailToOwner() ), + TQT_TQOBJECT(_treeView), TQT_SLOT( sendMailToOwner() ), actionCollection(), "report_mail_to_owner" ); _helpSendFeedbackMail = new KAction( i18n( "Send &Feedback Mail..." ), 0, - this, SLOT( sendFeedbackMail() ), + TQT_TQOBJECT(this), TQT_SLOT( sendFeedbackMail() ), actionCollection(), "help_send_feedback_mail" ); @@ -226,7 +226,7 @@ KDirStatApp::initActions() _showTreemapView->setStatusText ( i18n( "Enables/disables the treemap view" ) ); _treemapZoomIn->setStatusText ( i18n( "Zoom treemap in" ) ); _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" ) ); pref->setStatusText ( i18n( "Opens the preferences dialog" ) ); _reportMailToOwner->setStatusText ( i18n( "Sends a mail to the owner of the selected subtree" ) ); @@ -242,14 +242,14 @@ KDirStatApp::initCleanups() _cleanupCollection->addUserCleanups( USER_CLEANUPS ); _cleanupCollection->slotReadConfig(); - connect( _treeView, SIGNAL( selectionChanged( KFileInfo * ) ), - _cleanupCollection, SIGNAL( selectionChanged( KFileInfo * ) ) ); + connect( _treeView, TQT_SIGNAL( selectionChanged( KFileInfo * ) ), + _cleanupCollection, TQT_SIGNAL( selectionChanged( KFileInfo * ) ) ); - connect( this, SIGNAL( readConfig( void ) ), - _cleanupCollection, SIGNAL( readConfig( void ) ) ); + connect( this, TQT_SIGNAL( readConfig( void ) ), + _cleanupCollection, TQT_SIGNAL( readConfig( void ) ) ); - connect( this, SIGNAL( saveConfig( void ) ), - _cleanupCollection, SIGNAL( saveConfig( void ) ) ); + connect( this, TQT_SIGNAL( saveConfig( void ) ), + _cleanupCollection, TQT_SIGNAL( saveConfig( void ) ) ); } @@ -276,12 +276,12 @@ KDirStatApp::initPacMan( bool enablePacMan ) toolBar()->insertWidget( id, PACMAN_WIDTH, _pacMan ); toolBar()->setItemAutoSized( id, false ); - _pacManDelimiter = new QWidget( toolBar() ); + _pacManDelimiter = new TQWidget( toolBar() ); toolBar()->insertWidget( ++id, 1, _pacManDelimiter ); - connect( _treeView, SIGNAL( startingReading() ), _pacMan, SLOT( start() ) ); - connect( _treeView, SIGNAL( finished() ), _pacMan, SLOT( stop () ) ); - connect( _treeView, SIGNAL( aborted() ), _pacMan, SLOT( stop () ) ); + connect( _treeView, TQT_SIGNAL( startingReading() ), _pacMan, TQT_SLOT( start() ) ); + connect( _treeView, TQT_SIGNAL( finished() ), _pacMan, TQT_SLOT( stop () ) ); + connect( _treeView, TQT_SIGNAL( aborted() ), _pacMan, TQT_SLOT( stop () ) ); } } else @@ -314,17 +314,17 @@ KDirStatApp::initActivityTracker() if ( ! doFeedbackReminder() ) return; - _activityTracker = new KActivityTracker( this, "Feedback", + _activityTracker = new KActivityTracker( TQT_TQOBJECT(this), "Feedback", INITIAL_FEEDBACK_REMINDER ); - connect( _activityTracker, SIGNAL( thresholdReached() ), - this, SLOT ( askForFeedback() ) ); + connect( _activityTracker, TQT_SIGNAL( thresholdReached() ), + this, TQT_SLOT ( askForFeedback() ) ); - connect( _treeView, SIGNAL( userActivity( int ) ), - _activityTracker, SLOT ( trackActivity( int ) ) ); + connect( _treeView, TQT_SIGNAL( userActivity( int ) ), + _activityTracker, TQT_SLOT ( trackActivity( int ) ) ); - connect( _cleanupCollection, SIGNAL( userActivity( int ) ), - _activityTracker, SLOT ( trackActivity( int ) ) ); + connect( _cleanupCollection, TQT_SIGNAL( userActivity( int ) ), + _activityTracker, TQT_SLOT ( trackActivity( int ) ) ); } @@ -348,7 +348,7 @@ void KDirStatApp::readMainWinConfig() KConfig * config = kapp->config(); 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 ) ); toggleToolBar(); @@ -371,7 +371,7 @@ void KDirStatApp::readMainWinConfig() // initialize the recent file list _fileOpenRecent->loadEntries( config,"Recent Files" ); - QSize size = config->readSizeEntry( "Geometry" ); + TQSize size = config->readSizeEntry( "Geometry" ); if( ! size.isEmpty() ) resize( size ); @@ -443,7 +443,7 @@ KDirStatApp::fileAskOpenDir() { 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() ) openURL( fixedUrl( url.url() ) ); @@ -457,7 +457,7 @@ KDirStatApp::fileAskOpenUrl() { statusMsg( i18n( "Opening URL..." ) ); - KURL url = KURLRequesterDlg::getURL( QString::null, // startDir + KURL url = KURLRequesterDlg::getURL( TQString(), // startDir this, i18n( "Open URL..." ) ); if( ! url.isEmpty() ) @@ -524,7 +524,7 @@ void KDirStatApp::editCopy() { if ( _treeView->selection() ) - kapp->clipboard()->setText( QString::fromLocal8Bit(_treeView->selection()->orig()->url()) ); + kapp->clipboard()->setText( TQString::fromLocal8Bit(_treeView->selection()->orig()->url()) ); #if 0 #warning debug @@ -568,7 +568,7 @@ KDirStatApp::selectionChanged( KFileInfo *selection ) else _fileContinueReadingAtMountPoint->setEnabled( false ); - statusMsg( QString::fromLocal8Bit(selection->url()) ); + statusMsg( TQString::fromLocal8Bit(selection->url()) ); } else { @@ -767,7 +767,7 @@ KDirStatApp::doFeedbackReminder() void -KDirStatApp::statusMsg( const QString &text ) +KDirStatApp::statusMsg( const TQString &text ) { // Change status message permanently @@ -777,7 +777,7 @@ KDirStatApp::statusMsg( const QString &text ) void -KDirStatApp::contextMenu( KDirTreeViewItem * item, const QPoint &pos ) +KDirStatApp::contextMenu( KDirTreeViewItem * item, const TQPoint &pos ) { NOT_USED( item ); @@ -787,7 +787,7 @@ KDirStatApp::contextMenu( KDirTreeViewItem * item, const QPoint &pos ) void -KDirStatApp::contextMenu( KTreemapTile * tile, const QPoint &pos ) +KDirStatApp::contextMenu( KTreemapTile * tile, const TQPoint &pos ) { NOT_USED( tile ); @@ -806,25 +806,25 @@ KDirStatApp::createTreemapView() delete _treemapView; _treemapView = new KTreemapView( _treeView->tree(), _splitter, - QSize( _splitter->width(), _treemapViewHeight ) ); + TQSize( _splitter->width(), _treemapViewHeight ) ); CHECK_PTR( _treemapView ); - connect( _treemapView, SIGNAL( contextMenu( KTreemapTile *, const QPoint & ) ), - this, SLOT ( contextMenu( KTreemapTile *, const QPoint & ) ) ); + connect( _treemapView, TQT_SIGNAL( contextMenu( KTreemapTile *, const TQPoint & ) ), + this, TQT_SLOT ( contextMenu( KTreemapTile *, const TQPoint & ) ) ); - connect( _treemapView, SIGNAL( treemapChanged() ), - this, SLOT ( updateActions() ) ); + connect( _treemapView, TQT_SIGNAL( treemapChanged() ), + this, TQT_SLOT ( updateActions() ) ); - connect( _treemapView, SIGNAL( selectionChanged( KFileInfo * ) ), - this, SLOT ( selectionChanged( KFileInfo * ) ) ); + connect( _treemapView, TQT_SIGNAL( selectionChanged( KFileInfo * ) ), + this, TQT_SLOT ( selectionChanged( KFileInfo * ) ) ); if ( _activityTracker ) { - connect( _treemapView, SIGNAL( userActivity ( int ) ), - _activityTracker, SLOT ( trackActivity( int ) ) ); + connect( _treemapView, TQT_SIGNAL( userActivity ( 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(); } |