diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/docmanager.cpp | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip |
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
Diffstat (limited to 'src/docmanager.cpp')
-rw-r--r-- | src/docmanager.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/docmanager.cpp b/src/docmanager.cpp index bf49985..facedac 100644 --- a/src/docmanager.cpp +++ b/src/docmanager.cpp @@ -24,7 +24,7 @@ #include <klocale.h> #include <kmessagebox.h> #include <ktabwidget.h> -#include <qfile.h> +#include <tqfile.h> #include <assert.h> @@ -42,7 +42,7 @@ DocManager * DocManager::self( KTechlab * ktechlab ) DocManager::DocManager( KTechlab * ktechlab ) - : QObject( ktechlab ), + : TQObject( ktechlab ), p_ktechlab(ktechlab) { p_focusedView = 0l; @@ -96,10 +96,10 @@ Document* DocManager::openURL( const KURL &url, ViewArea *viewArea ) if ( url.isLocalFile() ) { - QFile file(url.path()); + TQFile file(url.path()); if ( file.open(IO_ReadOnly) == false ) { - KMessageBox::sorry( 0l, i18n("Could not open '%1'").arg( url.prettyURL() ) ); + KMessageBox::sorry( 0l, i18n("Could not open '%1'").tqarg( url.prettyURL() ) ); return 0l; } file.close(); @@ -118,8 +118,8 @@ Document* DocManager::openURL( const KURL &url, ViewArea *viewArea ) return document; } - QString fileName = url.fileName(); - QString extension = fileName.right( fileName.length() - fileName.findRev('.') ); + TQString fileName = url.fileName(); + TQString extension = fileName.right( fileName.length() - fileName.tqfindRev('.') ); if ( extension == ".circuit" ) return openCircuitFile( url, viewArea ); @@ -158,15 +158,15 @@ void DocManager::giveDocumentFocus( Document * toFocus, ViewArea * viewAreaForNe } -QString DocManager::untitledName( int type ) +TQString DocManager::untitledName( int type ) { - QString name; + TQString name; switch(type) { case Document::dt_circuit: { if ( m_countCircuit>1 ) - name = i18n("Untitled (Circuit %1)").arg(QString::number(m_countCircuit)); + name = i18n("Untitled (Circuit %1)").tqarg(TQString::number(m_countCircuit)); else name = i18n("Untitled (Circuit)"); m_countCircuit++; @@ -175,7 +175,7 @@ QString DocManager::untitledName( int type ) case Document::dt_flowcode: { if ( m_countFlowCode>1 ) - name = i18n("Untitled (FlowCode %1)").arg(QString::number(m_countFlowCode)); + name = i18n("Untitled (FlowCode %1)").tqarg(TQString::number(m_countFlowCode)); else name = i18n("Untitled (FlowCode)"); m_countFlowCode++; @@ -184,7 +184,7 @@ QString DocManager::untitledName( int type ) case Document::dt_mechanics: { if ( m_countMechanics>1 ) - name = i18n("Untitled (Mechanics %1)").arg(QString::number(m_countMechanics)); + name = i18n("Untitled (Mechanics %1)").tqarg(TQString::number(m_countMechanics)); else name = i18n("Untitled (Mechanics)"); m_countMechanics++; @@ -193,7 +193,7 @@ QString DocManager::untitledName( int type ) default: { if ( m_countOther>1 ) - name = i18n("Untitled (%1)").arg(QString::number(m_countOther)); + name = i18n("Untitled (%1)").tqarg(TQString::number(m_countOther)); else name = i18n("Untitled"); m_countOther++; @@ -207,7 +207,7 @@ QString DocManager::untitledName( int type ) Document *DocManager::findDocument( const KURL &url ) const { // First, look in the associated documents - if ( m_associatedDocuments.contains(url) ) + if ( m_associatedDocuments.tqcontains(url) ) return m_associatedDocuments[url]; // Not found, so look in the known documents @@ -254,18 +254,18 @@ void DocManager::removeDocumentAssociations( Document *document ) void DocManager::handleNewDocument( Document *document, ViewArea *viewArea ) { - if ( !document || m_documentList.contains(document) ) + if ( !document || m_documentList.tqcontains(document) ) return; m_documentList.append(document); document->setDCOPID(m_nextDocumentID++); - connect( document, SIGNAL(modifiedStateChanged()), p_ktechlab, SLOT(slotDocModifiedChanged()) ); - connect( document, SIGNAL(fileNameChanged(const KURL&)), p_ktechlab, SLOT(slotDocModifiedChanged()) ); - connect( document, SIGNAL(fileNameChanged(const KURL&)), p_ktechlab, SLOT(addRecentFile(const KURL&)) ); - connect( document, SIGNAL(destroyed(QObject* )), this, SLOT(documentDestroyed(QObject* )) ); - connect( document, SIGNAL(viewFocused(View* )), this, SLOT(slotViewFocused(View* )) ); - connect( document, SIGNAL(viewUnfocused()), this, SLOT(slotViewUnfocused()) ); + connect( document, TQT_SIGNAL(modifiedStateChanged()), p_ktechlab, TQT_SLOT(slotDocModifiedChanged()) ); + connect( document, TQT_SIGNAL(fileNameChanged(const KURL&)), p_ktechlab, TQT_SLOT(slotDocModifiedChanged()) ); + connect( document, TQT_SIGNAL(fileNameChanged(const KURL&)), p_ktechlab, TQT_SLOT(addRecentFile(const KURL&)) ); + connect( document, TQT_SIGNAL(destroyed(TQObject* )), this, TQT_SLOT(documentDestroyed(TQObject* )) ); + connect( document, TQT_SIGNAL(viewFocused(View* )), this, TQT_SLOT(slotViewFocused(View* )) ); + connect( document, TQT_SIGNAL(viewUnfocused()), this, TQT_SLOT(slotViewUnfocused()) ); createNewView( document, viewArea ); } @@ -293,7 +293,7 @@ View *DocManager::createNewView( Document *document, ViewArea *viewArea ) } -void DocManager::documentDestroyed( QObject *obj ) +void DocManager::documentDestroyed( TQObject *obj ) { Document *doc = static_cast<Document*>(obj); m_documentList.remove(doc); @@ -332,7 +332,7 @@ void DocManager::slotViewFocused( View *view ) Document *document = view->document(); - connect( document, SIGNAL(undoRedoStateChanged()), p_ktechlab, SLOT(slotDocUndoRedoChanged()) ); + connect( document, TQT_SIGNAL(undoRedoStateChanged()), p_ktechlab, TQT_SLOT(slotDocUndoRedoChanged()) ); p_connectedDocument = document; if ( document->type() == Document::dt_circuit || @@ -359,7 +359,7 @@ void DocManager::slotViewUnfocused() if (p_connectedDocument) { - disconnect( p_connectedDocument, SIGNAL(undoRedoStateChanged()), p_ktechlab, SLOT(slotDocUndoRedoChanged()) ); + disconnect( p_connectedDocument, TQT_SIGNAL(undoRedoStateChanged()), p_ktechlab, TQT_SLOT(slotDocUndoRedoChanged()) ); p_connectedDocument = 0l; } @@ -431,7 +431,7 @@ CircuitDocument *DocManager::openCircuitFile( const KURL &url, ViewArea *viewAre if ( !document->openURL(url) ) { - KMessageBox::sorry( 0l, i18n("Could not open Circuit file \"%1\"").arg(url.prettyURL()) ); + KMessageBox::sorry( 0l, i18n("Could not open Circuit file \"%1\"").tqarg(url.prettyURL()) ); document->deleteLater(); return 0l; } @@ -448,7 +448,7 @@ FlowCodeDocument *DocManager::openFlowCodeFile( const KURL &url, ViewArea *viewA if ( !document->openURL(url) ) { - KMessageBox::sorry( 0l, i18n("Could not open FlowCode file \"%1\"").arg(url.prettyURL()) ); + KMessageBox::sorry( 0l, i18n("Could not open FlowCode file \"%1\"").tqarg(url.prettyURL()) ); document->deleteLater(); return 0l; } @@ -465,7 +465,7 @@ MechanicsDocument *DocManager::openMechanicsFile( const KURL &url, ViewArea *vie if ( !document->openURL(url) ) { - KMessageBox::sorry( 0l, i18n("Could not open Mechanics file \"%1\"").arg(url.prettyURL()) ); + KMessageBox::sorry( 0l, i18n("Could not open Mechanics file \"%1\"").tqarg(url.prettyURL()) ); document->deleteLater(); return 0l; } @@ -486,7 +486,7 @@ TextDocument *DocManager::openTextFile( const KURL &url, ViewArea *viewArea ) if ( !document->openURL(url) ) { - KMessageBox::sorry( 0l, i18n("Could not open text file \"%1\"").arg(url.prettyURL()) ); + KMessageBox::sorry( 0l, i18n("Could not open text file \"%1\"").tqarg(url.prettyURL()) ); document->deleteLater(); return 0l; } |