From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/fileselector/fileselector_part.cpp | 4 +- parts/fileselector/fileselector_part.h | 3 +- parts/fileselector/fileselector_widget.cpp | 64 +++++++++++++++--------------- parts/fileselector/fileselector_widget.h | 23 ++++++----- parts/fileselector/kactionselector.cpp | 8 ++-- parts/fileselector/kactionselector.h | 19 ++++----- parts/fileselector/kbookmarkhandler.cpp | 8 ++-- parts/fileselector/kbookmarkhandler.h | 3 +- 8 files changed, 70 insertions(+), 62 deletions(-) (limited to 'parts/fileselector') diff --git a/parts/fileselector/fileselector_part.cpp b/parts/fileselector/fileselector_part.cpp index 4e30fe50..baf4dc86 100644 --- a/parts/fileselector/fileselector_part.cpp +++ b/parts/fileselector/fileselector_part.cpp @@ -34,8 +34,8 @@ typedef KDevGenericFactory FileSelectorFactory; static const KDevPluginInfo data("kdevfileselector"); K_EXPORT_COMPONENT_FACTORY( libkdevfileselector, FileSelectorFactory( data ) ) -FileSelectorPart::FileSelectorPart(TQObject *parent, const char *name, const TQStringList &) - : KDevPlugin(&data, parent, name ? name : "FileSelectorPart") +FileSelectorPart::FileSelectorPart(TQObject *tqparent, const char *name, const TQStringList &) + : KDevPlugin(&data, tqparent, name ? name : "FileSelectorPart") { setInstance(FileSelectorFactory::instance()); diff --git a/parts/fileselector/fileselector_part.h b/parts/fileselector/fileselector_part.h index ae8012ea..d2e8d9ec 100644 --- a/parts/fileselector/fileselector_part.h +++ b/parts/fileselector/fileselector_part.h @@ -14,8 +14,9 @@ class KDialogBase; class FileSelectorPart : public KDevPlugin { Q_OBJECT + TQ_OBJECT public: - FileSelectorPart(TQObject *parent, const char *name, const TQStringList &); + FileSelectorPart(TQObject *tqparent, const char *name, const TQStringList &); virtual ~FileSelectorPart(); KAction *newFileAction() const { return m_newFileAction; } diff --git a/parts/fileselector/fileselector_widget.cpp b/parts/fileselector/fileselector_widget.cpp index 804270e1..e9e60f47 100644 --- a/parts/fileselector/fileselector_widget.cpp +++ b/parts/fileselector/fileselector_widget.cpp @@ -72,12 +72,12 @@ // from kfiledialog.cpp - avoid qt warning in STDERR (~/.xsessionerrors) -static void silenceQToolBar(QtMsgType, const char *) +static void silenceTQToolBar(TQtMsgType, const char *) {} -KDevFileSelectorToolBar::KDevFileSelectorToolBar(TQWidget *parent) - : KToolBar( parent, "KDev FileSelector Toolbar", true ) +KDevFileSelectorToolBar::KDevFileSelectorToolBar(TQWidget *tqparent) + : KToolBar( tqparent, "KDev FileSelector Toolbar", true ) { setMinimumWidth(10); } @@ -91,8 +91,8 @@ void KDevFileSelectorToolBar::setMovingEnabled( bool) } -KDevFileSelectorToolBarParent::KDevFileSelectorToolBarParent(TQWidget *parent) - :TQFrame(parent),m_tb(0) +KDevFileSelectorToolBarParent::KDevFileSelectorToolBarParent(TQWidget *tqparent) + :TQFrame(tqparent),m_tb(0) {} KDevFileSelectorToolBarParent::~KDevFileSelectorToolBarParent() {} @@ -105,7 +105,7 @@ void KDevFileSelectorToolBarParent::resizeEvent ( TQResizeEvent * ) { if (m_tb) { - setMinimumHeight(m_tb->sizeHint().height()); + setMinimumHeight(m_tb->tqsizeHint().height()); m_tb->resize(width(),height()); } } @@ -115,8 +115,8 @@ void KDevFileSelectorToolBarParent::resizeEvent ( TQResizeEvent * ) KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *mainWindow, KDevPartController *partController, - TQWidget * parent, const char * name ) - : TQWidget(parent, name), + TQWidget * tqparent, const char * name ) + : TQWidget(tqparent, name), m_part(part), mainwin(mainWindow), partController(partController) @@ -125,7 +125,7 @@ KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *main TQVBoxLayout* lo = new TQVBoxLayout(this); - QtMsgHandler oldHandler = qInstallMsgHandler( silenceQToolBar ); + TQtMsgHandler oldHandler = tqInstallMsgHandler( silenceTQToolBar ); KDevFileSelectorToolBarParent *tbp=new KDevFileSelectorToolBarParent(this); toolbar = new KDevFileSelectorToolBar(tbp); @@ -133,10 +133,10 @@ KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *main lo->addWidget(tbp); toolbar->setMovingEnabled(false); toolbar->setFlat(true); - qInstallMsgHandler( oldHandler ); + tqInstallMsgHandler( oldHandler ); cmbPath = new KURLComboBox( KURLComboBox::Directories, true, this, "path combo" ); - cmbPath->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed )); + cmbPath->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed )); KURLCompletion* cmpl = new KURLCompletion(KURLCompletion::DirCompletion); cmbPath->setCompletionObject( cmpl ); lo->addWidget(cmbPath); @@ -171,7 +171,7 @@ KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *main btnFilter->setIconSet( SmallIconSet("filter" ) ); btnFilter->setToggleButton( true ); filter = new KHistoryCombo( true, filterBox, "filter"); - filter->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed )); + filter->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed )); filterBox->setStretchFactor(filter, 2); connect( btnFilter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( btnFilterClick() ) ); lo->addWidget(filterBox); @@ -186,7 +186,7 @@ KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *main // kaction for the dir sync method acSyncDir = new KAction( i18n("Current Document Directory"), "dirsynch", 0, - this, TQT_SLOT( setActiveDocumentDir() ), mActionCollection, "sync_dir" ); + TQT_TQOBJECT(this), TQT_SLOT( setActiveDocumentDir() ), mActionCollection, "sync_dir" ); toolbar->setIconText( KToolBar::IconOnly ); toolbar->setIconSize( 16 ); toolbar->setEnableContextMenu( false ); @@ -209,7 +209,7 @@ KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *main connect( bookmarkHandler, TQT_SIGNAL( openURL( const TQString& )), this, TQT_SLOT( setDir( const TQString& ) ) ); - waitingUrl = TQString::null; + waitingUrl = TQString(); // whatsthis help TQWhatsThis::add @@ -349,10 +349,10 @@ void KDevFileSelector::slotFilterChange( const TQString & nf ) if ( empty ) { dir->clearFilter(); - filter->lineEdit()->setText( TQString::null ); + filter->lineEdit()->setText( TQString() ); TQToolTip::add ( btnFilter, - TQString( i18n("Apply last filter (\"%1\")") ).arg( lastFilter ) ); + TQString( i18n("Apply last filter (\"%1\")") ).tqarg( lastFilter ) ); } else { @@ -415,7 +415,7 @@ void KDevFileSelector::btnFilterClick() { if ( !btnFilter->isOn() ) { - slotFilterChange( TQString::null ); + slotFilterChange( TQString() ); } else { @@ -432,7 +432,7 @@ void KDevFileSelector::autoSync() if ( isVisible() ) { setActiveDocumentDir(); - waitingUrl = TQString::null; + waitingUrl = TQString(); } // else set waiting url else @@ -454,13 +454,13 @@ void KDevFileSelector::autoSync( KParts::Part *part ) KURL u ( doc->url() ); if ( u.isEmpty() ) { - waitingUrl = TQString::null; + waitingUrl = TQString(); return; } if ( isVisible() ) { setDir( u.directory() ); - waitingUrl = TQString::null; + waitingUrl = TQString(); } else { @@ -499,13 +499,13 @@ void KDevFileSelector::showEvent( TQShowEvent * ) { kdDebug()<<"syncing fs on show"<listBox(); - if ( o == lb && e->type() == TQEvent::Show ) + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(lb) && e->type() == TQEvent::Show ) { int add = lb->height() < lb->contentsHeight() ? lb->verticalScrollBar()->width() : 0; - int w = QMIN( mainwin->main()->width(), lb->contentsWidth() + add ); + int w = TQMIN( mainwin->main()->width(), lb->contentsWidth() + add ); lb->resize( w, lb->height() ); /// @todo - move the listbox to a suitable place if nessecary /// @todo - decide if it is worth caching the size while untill the contents @@ -537,16 +537,16 @@ bool KDevFileSelector::eventFilter( TQObject* o, TQEvent *e ) //BEGIN ACtionLBItem /* - QListboxItem that can store and return a string, + TQListboxItem that can store and return a string, used for the toolbar action selector. */ -class ActionLBItem : public QListBoxPixmap +class ActionLBItem : public TQListBoxPixmap { public: ActionLBItem( TQListBox *lb=0, const TQPixmap &pm = TQPixmap(), - const TQString &text=TQString::null, - const TQString &str=TQString::null ) : + const TQString &text=TQString(), + const TQString &str=TQString() ) : TQListBoxPixmap( lb, pm, text ), _str(str) {} @@ -575,8 +575,8 @@ KURL KDevFileSelector::activeDocumentUrl( ) //////////////////////////////////////////////////////////////////////////////// // KFSConfigPage implementation //////////////////////////////////////////////////////////////////////////////// -KFSConfigPage::KFSConfigPage( TQWidget *parent, const char *name, KDevFileSelector *kfs ) - : TQWidget( parent, name ), +KFSConfigPage::KFSConfigPage( TQWidget *tqparent, const char *name, KDevFileSelector *kfs ) + : TQWidget( tqparent, name ), fileSelector( kfs ), bDirty( false ) { @@ -762,13 +762,13 @@ void KFSConfigPage::init() TQListBox *lb; for ( TQStringList::Iterator it=allActions.begin(); it != allActions.end(); ++it ) { - lb = l.contains( *it ) ? acSel->selectedListBox() : acSel->availableListBox(); + lb = l.tqcontains( *it ) ? acSel->selectedListBox() : acSel->availableListBox(); if ( *it == "bookmarks" || *it == "sync_dir" ) ac = fileSelector->actionCollection()->action( (*it).latin1() ); else ac = fileSelector->dirOperator()->actionCollection()->action( (*it).latin1() ); if ( ac ) - new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().replace( re, "" ), *it ); + new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().tqreplace( re, "" ), *it ); } // sync diff --git a/parts/fileselector/fileselector_widget.h b/parts/fileselector/fileselector_widget.h index 4811c398..cf06d42a 100644 --- a/parts/fileselector/fileselector_widget.h +++ b/parts/fileselector/fileselector_widget.h @@ -60,18 +60,20 @@ namespace KTextEditor class KDevFileSelectorToolBar: public KToolBar { Q_OBJECT + TQ_OBJECT public: - KDevFileSelectorToolBar(TQWidget *parent); + KDevFileSelectorToolBar(TQWidget *tqparent); virtual ~KDevFileSelectorToolBar(); virtual void setMovingEnabled( bool b ); }; -class KDevFileSelectorToolBarParent: public QFrame +class KDevFileSelectorToolBarParent: public TQFrame { Q_OBJECT + TQ_OBJECT public: - KDevFileSelectorToolBarParent(TQWidget *parent); + KDevFileSelectorToolBarParent(TQWidget *tqparent); ~KDevFileSelectorToolBarParent(); void setToolBar(KDevFileSelectorToolBar *tb); @@ -85,9 +87,10 @@ protected: class KDevDirOperator: public KDirOperator { Q_OBJECT + TQ_OBJECT public: - KDevDirOperator(FileSelectorPart *part, const KURL &urlName=KURL(), TQWidget *parent=0, const char *name=0) - :KDirOperator(urlName, parent, name), m_part(part) + KDevDirOperator(FileSelectorPart *part, const KURL &urlName=KURL(), TQWidget *tqparent=0, const char *name=0) + :KDirOperator(urlName, tqparent, name), m_part(part) { } @@ -98,9 +101,10 @@ private: FileSelectorPart *m_part; }; -class KDevFileSelector : public QWidget +class KDevFileSelector : public TQWidget { Q_OBJECT + TQ_OBJECT friend class KFSConfigPage; @@ -109,7 +113,7 @@ public: enum AutoSyncEvent { DocumentChanged=1, DocumentOpened=2, GotVisible=4 }; KDevFileSelector( FileSelectorPart *part, KDevMainWindow *mainWindow=0, KDevPartController *partController=0, - TQWidget * parent = 0, const char * name = 0 ); + TQWidget * tqparent = 0, const char * name = 0 ); ~KDevFileSelector(); void readConfig( KConfig *, const TQString & ); @@ -174,11 +178,12 @@ private: of the path and file filter combos, and how to handle user closed session. */ -class KFSConfigPage : public QWidget +class KFSConfigPage : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KFSConfigPage( TQWidget* parent=0, const char *name=0, KDevFileSelector *kfs=0); + KFSConfigPage( TQWidget* tqparent=0, const char *name=0, KDevFileSelector *kfs=0); virtual ~KFSConfigPage() {}; public slots: diff --git a/parts/fileselector/kactionselector.cpp b/parts/fileselector/kactionselector.cpp index 0534901b..3bf21922 100644 --- a/parts/fileselector/kactionselector.cpp +++ b/parts/fileselector/kactionselector.cpp @@ -46,8 +46,8 @@ class KActionSelectorPrivate { //BEGIN Constructor/destructor -KActionSelector::KActionSelector( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +KActionSelector::KActionSelector( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { d = new KActionSelectorPrivate(); d->moveOnDoubleClick = true; @@ -342,7 +342,7 @@ void KActionSelector::polish() void KActionSelector::keyPressEvent( TQKeyEvent *e ) { if ( ! d->keyboardEnabled ) return; - if ( (e->state() & Qt::ControlButton) ) + if ( (e->state() & TQt::ControlButton) ) { switch ( e->key() ) { @@ -369,7 +369,7 @@ bool KActionSelector::eventFilter( TQObject *o, TQEvent *e ) { if ( d->keyboardEnabled && e->type() == TQEvent::KeyPress ) { - if ( (((TQKeyEvent*)e)->state() & Qt::ControlButton) ) + if ( (((TQKeyEvent*)e)->state() & TQt::ControlButton) ) { switch ( ((TQKeyEvent*)e)->key() ) { diff --git a/parts/fileselector/kactionselector.h b/parts/fileselector/kactionselector.h index 2b49114f..9bcbeeea 100644 --- a/parts/fileselector/kactionselector.h +++ b/parts/fileselector/kactionselector.h @@ -75,18 +75,19 @@ class KActionSelectorPrivate; class KActionSelector : public TQWidget { Q_OBJECT + TQ_OBJECT Q_ENUMS( ButtonIconSize InsertionPolicy ) - Q_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick ) - Q_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled ) - Q_PROPERTY( TQString availableLabel READ availableLabel WRITE setAvailableLabel ) - Q_PROPERTY( TQString selectedLabel READ selectedLabel WRITE setSelectedLabel ) - Q_PROPERTY( ButtonIconSize buttonIconSize READ buttonIconSize WRITE setButtonIconSize ) - Q_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy ) - Q_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy ) - Q_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons ) + TQ_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick ) + TQ_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled ) + TQ_PROPERTY( TQString availableLabel READ availableLabel WRITE setAvailableLabel ) + TQ_PROPERTY( TQString selectedLabel READ selectedLabel WRITE setSelectedLabel ) + TQ_PROPERTY( ButtonIconSize buttonIconSize READ buttonIconSize WRITE setButtonIconSize ) + TQ_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy ) + TQ_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy ) + TQ_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons ) public: - KActionSelector( TQWidget *parent=0, const char *name=0 ); + KActionSelector( TQWidget *tqparent=0, const char *name=0 ); ~KActionSelector(); /** diff --git a/parts/fileselector/kbookmarkhandler.cpp b/parts/fileselector/kbookmarkhandler.cpp index 6467b83f..68ce3189 100644 --- a/parts/fileselector/kbookmarkhandler.cpp +++ b/parts/fileselector/kbookmarkhandler.cpp @@ -35,15 +35,15 @@ #include "kbookmarkhandler.moc" -KBookmarkHandler::KBookmarkHandler( KDevFileSelector *parent, KPopupMenu* kpopupmenu ) - : TQObject( parent, "KBookmarkHandler" ), +KBookmarkHandler::KBookmarkHandler( KDevFileSelector *tqparent, KPopupMenu* kpopupmenu ) + : TQObject( tqparent, "KBookmarkHandler" ), KBookmarkOwner(), - mParent( parent ), + mParent( tqparent ), m_menu( kpopupmenu ), m_importStream( 0L ) { if (!m_menu) - m_menu = new KPopupMenu( parent, "bookmark menu" ); + m_menu = new KPopupMenu( tqparent, "bookmark menu" ); TQString file = locate( "data", "kdevfileselector/fsbookmarks.xml" ); if ( file.isEmpty() ) diff --git a/parts/fileselector/kbookmarkhandler.h b/parts/fileselector/kbookmarkhandler.h index 86fa5031..a9ec5ad1 100644 --- a/parts/fileselector/kbookmarkhandler.h +++ b/parts/fileselector/kbookmarkhandler.h @@ -31,9 +31,10 @@ class KActionMenu; class KBookmarkHandler : public TQObject, public KBookmarkOwner { Q_OBJECT + TQ_OBJECT public: - KBookmarkHandler( KDevFileSelector *parent, KPopupMenu *kpopupmenu=0 ); + KBookmarkHandler( KDevFileSelector *tqparent, KPopupMenu *kpopupmenu=0 ); ~KBookmarkHandler(); // KBookmarkOwner interface: -- cgit v1.2.1