From 87a016680e3677da3993f333561e79eb0cead7d5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 29 Jun 2011 16:05:55 +0000 Subject: TQt4 port ktechlab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/document.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index cc43f00..0610af1 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -20,8 +20,8 @@ #include #include -Document::Document( const QString &caption, KTechlab *ktechlab, const char *name ) - : QObject( ktechlab, name ), +Document::Document( const TQString &caption, KTechlab *ktechlab, const char *name ) + : TQObject( ktechlab, name ), b_modified(false), p_ktechlab(ktechlab), p_activeView(0l), @@ -33,7 +33,7 @@ Document::Document( const QString &caption, KTechlab *ktechlab, const char *name m_bDeleted(false) { if (p_ktechlab) - connect( p_ktechlab, SIGNAL(configurationChanged()), this, SLOT(slotUpdateConfiguration()) ); + connect( p_ktechlab, TQT_SIGNAL(configurationChanged()), this, TQT_SLOT(slotUpdateConfiguration()) ); } @@ -50,27 +50,27 @@ Document::~Document() void Document::handleNewView( View *view ) { - if ( !view || m_viewList.contains(view) ) + if ( !view || m_viewList.tqcontains(view) ) return; m_viewList.append(view); view->setDCOPID(m_nextViewID++); view->setCaption(m_caption); - connect( view, SIGNAL(destroyed(QObject* )), this, SLOT(slotViewDestroyed(QObject* )) ); - connect( view, SIGNAL(viewFocused(View* )), this, SLOT(slotViewFocused(View* )) ); - connect( view, SIGNAL(viewUnfocused()), this, SIGNAL(viewUnfocused()) ); + connect( view, TQT_SIGNAL(destroyed(TQObject* )), this, TQT_SLOT(slotViewDestroyed(TQObject* )) ); + connect( view, TQT_SIGNAL(viewFocused(View* )), this, TQT_SLOT(slotViewFocused(View* )) ); + connect( view, TQT_SIGNAL(viewUnfocused()), this, TQT_SIGNAL(viewUnfocused()) ); view->show(); view->setFocused(); } -void Document::slotViewDestroyed( QObject *obj ) +void Document::slotViewDestroyed( TQObject *obj ) { - View *view = static_cast(obj); + View *view = static_cast(TQT_TQWIDGET(obj)); m_viewList.remove(view); - if ( p_activeView == (QGuardedPtr)view ) + if ( p_activeView == (TQGuardedPtr)view ) { p_activeView = 0l; emit viewUnfocused(); @@ -91,7 +91,7 @@ void Document::slotViewFocused(View *view) } -void Document::setCaption( const QString &caption ) +void Document::setCaption( const TQString &caption ) { m_caption = caption; const ViewList::iterator end = m_viewList.end(); @@ -100,17 +100,17 @@ void Document::setCaption( const QString &caption ) } -bool Document::getURL( const QString &types ) +bool Document::getURL( const TQString &types ) { - KURL url = KFileDialog::getSaveURL( QString::null, types, p_ktechlab, i18n("Save Location")); + KURL url = KFileDialog::getSaveURL( TQString(), types, p_ktechlab, i18n("Save Location")); if ( url.isEmpty() ) return false; - if ( QFile::exists( url.path() ) ) + if ( TQFile::exists( url.path() ) ) { int query = KMessageBox::warningYesNo( p_ktechlab, - i18n( "A file named \"%1\" already exists. Are you sure you want to overwrite it?" ).arg( url.fileName() ), + i18n( "A file named \"%1\" already exists. Are you sure you want to overwrite it?" ).tqarg( url.fileName() ), i18n( "Overwrite File?" ), i18n( "Overwrite" ), KStdGuiItem::cancel() ); @@ -129,13 +129,13 @@ bool Document::fileClose() if ( isModified() ) { // If the filename is empty then it must be an untitled file. - QString name = m_url.fileName().isEmpty() ? caption() : m_url.fileName(); + TQString name = m_url.fileName().isEmpty() ? caption() : m_url.fileName(); if ( ViewContainer * viewContainer = (activeView() ? activeView()->viewContainer() : 0l) ) p_ktechlab->tabWidget()->setCurrentPage( p_ktechlab->tabWidget()->indexOf(viewContainer) ); int choice = KMessageBox::warningYesNoCancel( p_ktechlab, - i18n("The document \'%1\' has been modified.\nDo you want to save it?").arg(name), + i18n("The document \'%1\' has been modified.\nDo you want to save it?").tqarg(name), i18n("Save Document?"), i18n("Save"), i18n("Discard") ); @@ -196,7 +196,7 @@ void Document::setDCOPID( unsigned id ) m_dcopID = id; if ( m_pDocumentIface ) { - QCString docID; + TQCString docID; docID.setNum( dcopID() ); m_pDocumentIface->setObjId( "Document#" + docID ); } -- cgit v1.2.1