From e69e8b1d09fb579316595b4e6a850e717358a8b1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 19 Jun 2011 19:03:33 +0000 Subject: TQt4 port kdegraphics This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../presenter/config/kviewpresenterconfig.cpp | 8 ++--- .../presenter/config/kviewpresenterconfig.h | 3 +- kview/modules/presenter/imagelistdialog.ui | 22 ++++++------ kview/modules/presenter/imagelistdialog.ui.h | 2 +- kview/modules/presenter/imagelistitem.cpp | 12 +++---- kview/modules/presenter/imagelistitem.h | 2 +- kview/modules/presenter/kviewpresenter.cpp | 42 +++++++++++----------- kview/modules/presenter/kviewpresenter.h | 3 +- .../modules/presenter/kviewpresenterconfmodule.cpp | 8 ++--- kview/modules/presenter/kviewpresenterconfmodule.h | 3 +- 10 files changed, 54 insertions(+), 51 deletions(-) (limited to 'kview/modules/presenter') diff --git a/kview/modules/presenter/config/kviewpresenterconfig.cpp b/kview/modules/presenter/config/kviewpresenterconfig.cpp index e44889ed..edcf157d 100644 --- a/kview/modules/presenter/config/kviewpresenterconfig.cpp +++ b/kview/modules/presenter/config/kviewpresenterconfig.cpp @@ -31,11 +31,11 @@ typedef KGenericFactory KViewPresenterConfigFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kviewpresenterconfig, KViewPresenterConfigFactory( "kcm_kviewpresenterconfig" ) ) -KViewPresenterConfig::KViewPresenterConfig( TQWidget * parent, const char *, const TQStringList & args ) - : KCModule( KViewPresenterConfigFactory::instance(), parent, args ) +KViewPresenterConfig::KViewPresenterConfig( TQWidget * tqparent, const char *, const TQStringList & args ) + : KCModule( KViewPresenterConfigFactory::instance(), tqparent, args ) { - TQBoxLayout * layout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); - layout->setAutoAdd( true ); + TQBoxLayout * tqlayout = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + tqlayout->setAutoAdd( true ); m_pCheckBox = new TQCheckBox( "This is only for testing...", this ); connect( m_pCheckBox, TQT_SIGNAL( clicked() ), this, TQT_SLOT( checkChanged() ) ); diff --git a/kview/modules/presenter/config/kviewpresenterconfig.h b/kview/modules/presenter/config/kviewpresenterconfig.h index ae257cea..d07c1506 100644 --- a/kview/modules/presenter/config/kviewpresenterconfig.h +++ b/kview/modules/presenter/config/kviewpresenterconfig.h @@ -26,8 +26,9 @@ class TQCheckBox; class KViewPresenterConfig : public KCModule { Q_OBJECT + TQ_OBJECT public: - KViewPresenterConfig( TQWidget * parent, const char * name = 0, const TQStringList & args = TQStringList() ); + KViewPresenterConfig( TQWidget * tqparent, const char * name = 0, const TQStringList & args = TQStringList() ); ~KViewPresenterConfig(); virtual void load(); diff --git a/kview/modules/presenter/imagelistdialog.ui b/kview/modules/presenter/imagelistdialog.ui index 66d9e9b5..2bc7206a 100644 --- a/kview/modules/presenter/imagelistdialog.ui +++ b/kview/modules/presenter/imagelistdialog.ui @@ -60,7 +60,7 @@ m_pListView - + 400 0 @@ -79,7 +79,7 @@ true - + Layout4 @@ -87,7 +87,7 @@ unnamed - + Layout2 @@ -140,7 +140,7 @@ Fixed - + 16 20 @@ -188,7 +188,7 @@ MinimumExpanding - + 20 80 @@ -206,7 +206,7 @@ false - + Layout4 @@ -259,7 +259,7 @@ kio/netaccess.h kurl.h kfiledialog.h - qstring.h + tqstring.h kmessagebox.h imagelistitem.h imagelistdialog.ui.h @@ -267,12 +267,12 @@ class KURL - + init() noSort() - - - + + + kdialog.h klistview.h diff --git a/kview/modules/presenter/imagelistdialog.ui.h b/kview/modules/presenter/imagelistdialog.ui.h index ce97754e..5c391549 100644 --- a/kview/modules/presenter/imagelistdialog.ui.h +++ b/kview/modules/presenter/imagelistdialog.ui.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** -** If you wish to add, delete or rename slots use Qt Designer which will +** If you wish to add, delete or rename slots use TQt Designer which will ** update this file, preserving your code. Create an init() slot in place of ** a constructor, and a destroy() slot in place of a destructor. *****************************************************************************/ diff --git a/kview/modules/presenter/imagelistitem.cpp b/kview/modules/presenter/imagelistitem.cpp index 547de656..b31c65b2 100644 --- a/kview/modules/presenter/imagelistitem.cpp +++ b/kview/modules/presenter/imagelistitem.cpp @@ -24,10 +24,10 @@ #include -ImageListItem::ImageListItem( KListView * parent, const KURL & url ) - : KListViewItem( parent, parent->lastItem(), url.prettyURL() ) +ImageListItem::ImageListItem( KListView * tqparent, const KURL & url ) + : KListViewItem( tqparent, tqparent->lastItem(), url.prettyURL() ) , m_pImage( 0 ) - , m_filename( TQString::null ) + , m_filename( TQString() ) , m_url( url ) { setDragEnabled( true ); @@ -41,11 +41,11 @@ ImageListItem::ImageListItem( KListView * parent, const KURL & url ) /* TQString extension; TQString fileName = m_url.fileName(); - int extensionPos = fileName.findRev( '.' ); + int extensionPos = fileName.tqfindRev( '.' ); if ( extensionPos != -1 ) extension = fileName.mid( extensionPos ); // keep the '.' delete m_pTempFile; - m_pTempFile = new KTempFile( TQString::null, extension ); + m_pTempFile = new KTempFile( TQString(), extension ); m_filename = m_pTempFile->name(); m_pJob = KIO::get( m_url, m_pExtension->urlArgs().reload, false ); @@ -70,7 +70,7 @@ const TQImage * ImageListItem::image() const const TQString & ImageListItem::file() const { if( m_url.isLocalFile() ) - return TQString::null; + return TQString(); return m_filename; } diff --git a/kview/modules/presenter/imagelistitem.h b/kview/modules/presenter/imagelistitem.h index ee143a90..e54f84a4 100644 --- a/kview/modules/presenter/imagelistitem.h +++ b/kview/modules/presenter/imagelistitem.h @@ -30,7 +30,7 @@ class TQImage; class ImageListItem : public KListViewItem { public: - ImageListItem( KListView * parent, const KURL & url ); + ImageListItem( KListView * tqparent, const KURL & url ); ~ImageListItem(); const TQImage * image() const; diff --git a/kview/modules/presenter/kviewpresenter.cpp b/kview/modules/presenter/kviewpresenter.cpp index 3cf54d15..d85748c1 100644 --- a/kview/modules/presenter/kviewpresenter.cpp +++ b/kview/modules/presenter/kviewpresenter.cpp @@ -51,8 +51,8 @@ typedef KGenericFactory KViewPresenterFactory; K_EXPORT_COMPONENT_FACTORY( kview_presenterplugin, KViewPresenterFactory( "kviewpresenterplugin" ) ) -KViewPresenter::KViewPresenter( TQObject* parent, const char* name, const TQStringList & ) - : Plugin( parent, name ) +KViewPresenter::KViewPresenter( TQObject* tqparent, const char* name, const TQStringList & ) + : Plugin( tqparent, name ) , m_pImageList( new ImageListDialog() ) , m_paFileOpen( 0 ) , m_bDontAdd( false ) @@ -62,7 +62,7 @@ KViewPresenter::KViewPresenter( TQObject* parent, const char* name, const TQStri kdDebug( 4630 ) << k_funcinfo << endl; m_imagelist.setAutoDelete( true ); - TQObjectList * viewerList = parent->queryList( 0, "KImageViewer Part", false, false ); + TQObjectList * viewerList = tqparent->queryList( 0, "KImageViewer Part", false, false ); m_pViewer = static_cast( viewerList->getFirst() ); delete viewerList; if( m_pViewer ) @@ -82,17 +82,17 @@ KViewPresenter::KViewPresenter( TQObject* parent, const char* name, const TQStri connect( m_pImageList->m_pSlideshow, TQT_SIGNAL( toggled( bool ) ), m_paSlideshow, TQT_SLOT( setChecked( bool ) ) ); // search for file_open action - KXMLGUIClient * parentClient = static_cast( parent->qt_cast( "KXMLGUIClient" ) ); - if( parentClient ) + KXMLGUIClient * tqparentClient = static_cast( tqparent->qt_cast( "KXMLGUIClient" ) ); + if( tqparentClient ) { - m_paFileOpen = parentClient->actionCollection()->action( "file_open" ); - m_paFileClose = parentClient->actionCollection()->action( "file_close" ); + m_paFileOpen = tqparentClient->actionCollection()->action( "file_open" ); + m_paFileClose = tqparentClient->actionCollection()->action( "file_close" ); } if( m_paFileClose ) connect( m_paFileClose, TQT_SIGNAL( activated() ), this, TQT_SLOT( slotClose() ) ); if( m_paFileOpen ) { - disconnect( m_paFileOpen, TQT_SIGNAL( activated() ), parent, TQT_SLOT( slotOpenFile() ) ); + disconnect( m_paFileOpen, TQT_SIGNAL( activated() ), tqparent, TQT_SLOT( slotOpenFile() ) ); connect( m_paFileOpen, TQT_SIGNAL( activated() ), this, TQT_SLOT( slotOpenFiles() ) ); } else @@ -150,18 +150,18 @@ KViewPresenter::~KViewPresenter() if( m_paFileOpen ) { disconnect( m_paFileOpen, TQT_SIGNAL( activated() ), this, TQT_SLOT( slotOpenFiles() ) ); - // If the parent() doesn't exist we either leave the "File Open" action + // If the tqparent() doesn't exist we either leave the "File Open" action // in an unusable state or KView was just shutting down and therefor we // can ignore this. I've only seen the second one happening and to get - // rid of the TQObject::connect warning we do the parent() check. - if( parent() ) - connect( m_paFileOpen, TQT_SIGNAL( activated() ), parent(), TQT_SLOT( slotOpenFile() ) ); + // rid of the TQObject::connect warning we do the tqparent() check. + if( tqparent() ) + connect( m_paFileOpen, TQT_SIGNAL( activated() ), tqparent(), TQT_SLOT( slotOpenFile() ) ); } } bool KViewPresenter::eventFilter( TQObject *obj, TQEvent *ev ) { - if( obj == m_pImageList || obj == m_pImageList->m_pListView || obj == m_pImageList->m_pListView->viewport() || obj == m_pViewer->widget() ) + if( TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_pImageList) || TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_pImageList->m_pListView) || TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_pImageList->m_pListView->viewport()) || TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(m_pViewer->widget()) ) { switch( ev->type() ) { @@ -191,7 +191,7 @@ bool KViewPresenter::eventFilter( TQObject *obj, TQEvent *ev ) for( TQStringList::const_iterator it = l.begin(); it != l.end(); ++it ) { ImageInfo * info = new ImageInfo( KURL( *it ) ); - if( ! m_imagelist.contains( info ) ) + if( ! m_imagelist.tqcontains( info ) ) { m_imagelist.inSort( info ); ( void )new ImageListItem( m_pImageList->m_pListView, KURL( *it ) ); @@ -218,7 +218,7 @@ void KViewPresenter::slotImageOpened( const KURL & url ) { kdDebug( 4630 ) << k_funcinfo << "imagelist:" << endl; ImageInfo * info = new ImageInfo( url ); - if( ! m_imagelist.contains( info ) ) + if( ! m_imagelist.tqcontains( info ) ) { m_imagelist.inSort( info ); TQListViewItem * item = new ImageListItem( m_pImageList->m_pListView, url ); @@ -248,7 +248,7 @@ void KViewPresenter::slotOpenFiles() for( ++it; it != urls.end(); ++it ) { ImageInfo * info = new ImageInfo( *it ); - if( ! m_imagelist.contains( info ) ) + if( ! m_imagelist.tqcontains( info ) ) { m_imagelist.inSort( info ); ( void )new ImageListItem( m_pImageList->m_pListView, *it ); @@ -405,14 +405,14 @@ void KViewPresenter::closeAll() void KViewPresenter::loadList() { - KURL url = KFileDialog::getOpenURL( ":load_list", TQString::null, m_pImageList ); + KURL url = KFileDialog::getOpenURL( ":load_list", TQString(), m_pImageList ); if( url.isEmpty() ) return; TQString tempfile; if( ! KIO::NetAccess::download( url, tempfile, m_pViewer->widget() ) ) { - KMessageBox::error( m_pImageList, i18n( "Could not load\n%1" ).arg( url.prettyURL() ) ); + KMessageBox::error( m_pImageList, i18n( "Could not load\n%1" ).tqarg( url.prettyURL() ) ); return; } TQFile file( tempfile ); @@ -431,7 +431,7 @@ void KViewPresenter::loadList() { KURL url ( t.readLine() ); ImageInfo * info = new ImageInfo( url ); - if( ! m_imagelist.contains( info ) ) + if( ! m_imagelist.tqcontains( info ) ) { m_imagelist.inSort( info ); ( void )new ImageListItem( m_pImageList->m_pListView, url ); @@ -442,7 +442,7 @@ void KViewPresenter::loadList() } else { - KMessageBox::error( m_pImageList, i18n( "Wrong format\n%1" ).arg( url.prettyURL() ) ); + KMessageBox::error( m_pImageList, i18n( "Wrong format\n%1" ).tqarg( url.prettyURL() ) ); } file.close(); } @@ -451,7 +451,7 @@ void KViewPresenter::loadList() void KViewPresenter::saveList() { - KURL url = KFileDialog::getSaveURL( ":save_list", TQString::null, m_pImageList ); + KURL url = KFileDialog::getSaveURL( ":save_list", TQString(), m_pImageList ); if( url.isEmpty() ) return; diff --git a/kview/modules/presenter/kviewpresenter.h b/kview/modules/presenter/kviewpresenter.h index e607f92b..ba3198b2 100644 --- a/kview/modules/presenter/kviewpresenter.h +++ b/kview/modules/presenter/kviewpresenter.h @@ -38,8 +38,9 @@ class KAction; class KViewPresenter : public KParts::Plugin { Q_OBJECT + TQ_OBJECT public: - KViewPresenter( TQObject* parent, const char* name, const TQStringList & ); + KViewPresenter( TQObject* tqparent, const char* name, const TQStringList & ); virtual ~KViewPresenter(); protected: diff --git a/kview/modules/presenter/kviewpresenterconfmodule.cpp b/kview/modules/presenter/kviewpresenterconfmodule.cpp index 1c79ee15..ef051c28 100644 --- a/kview/modules/presenter/kviewpresenterconfmodule.cpp +++ b/kview/modules/presenter/kviewpresenterconfmodule.cpp @@ -29,8 +29,8 @@ #include #include -KViewPresenterConfModule::KViewPresenterConfModule( TQObject * parent ) - : KPreferencesModule( "kviewpresenter", parent, "KView Presenter Config Module" ) +KViewPresenterConfModule::KViewPresenterConfModule( TQObject * tqparent ) + : KPreferencesModule( "kviewpresenter", tqparent, "KView Presenter Config Module" ) { } @@ -49,8 +49,8 @@ void KViewPresenterConfModule::reset() void KViewPresenterConfModule::createPage( TQFrame * page ) { - TQBoxLayout * layout = new TQVBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() ); - layout->setAutoAdd( true ); + TQBoxLayout * tqlayout = new TQVBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() ); + tqlayout->setAutoAdd( true ); m_pCheckBox = new TQCheckBox( "This is only for testing...", page ); } diff --git a/kview/modules/presenter/kviewpresenterconfmodule.h b/kview/modules/presenter/kviewpresenterconfmodule.h index 6e3dcb46..8ecaa345 100644 --- a/kview/modules/presenter/kviewpresenterconfmodule.h +++ b/kview/modules/presenter/kviewpresenterconfmodule.h @@ -28,8 +28,9 @@ class TQCheckBox; class KViewPresenterConfModule : public KPreferencesModule { Q_OBJECT + TQ_OBJECT public: - KViewPresenterConfModule( TQObject * parent ); + KViewPresenterConfModule( TQObject * tqparent ); ~KViewPresenterConfModule(); signals: -- cgit v1.2.1