summaryrefslogtreecommitdiffstats
path: root/src/textdocument.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/textdocument.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-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/textdocument.cpp')
-rw-r--r--src/textdocument.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/textdocument.cpp b/src/textdocument.cpp
index ba03c04..41caf94 100644
--- a/src/textdocument.cpp
+++ b/src/textdocument.cpp
@@ -34,9 +34,9 @@
#include <ktempfile.h>
-TextDocument *TextDocument::constructTextDocument( const QString& caption, KTechlab *parent, const char *name )
+TextDocument *TextDocument::constructTextDocument( const TQString& caption, KTechlab *tqparent, const char *name )
{
- TextDocument *textDocument = new TextDocument( caption, parent, name);
+ TextDocument *textDocument = new TextDocument( caption, tqparent, name);
if( textDocument->m_constructorSuccessful )
return textDocument;
delete textDocument;
@@ -44,7 +44,7 @@ TextDocument *TextDocument::constructTextDocument( const QString& caption, KTech
}
-TextDocument::TextDocument( const QString &caption, KTechlab *ktechlab, const char *name )
+TextDocument::TextDocument( const TQString &caption, KTechlab *ktechlab, const char *name )
: Document( caption, ktechlab, name ),
m_doc(0)
{
@@ -73,11 +73,11 @@ TextDocument::TextDocument( const QString &caption, KTechlab *ktechlab, const ch
guessScheme();
- connect( m_doc, SIGNAL(undoChanged()), this, SIGNAL(undoRedoStateChanged()) );
- connect( m_doc, SIGNAL(undoChanged()), this, SLOT(slotSyncModifiedStates()) );
- connect( m_doc, SIGNAL(textChanged()), this, SLOT(slotSyncModifiedStates()) );
- connect( m_doc, SIGNAL(marksChanged()), this, SLOT(slotUpdateMarksInfo()) );
- connect( m_doc, SIGNAL(selectionChanged()), this, SLOT(slotSelectionmChanged()) );
+ connect( m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SIGNAL(undoRedoStateChanged()) );
+ connect( m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SLOT(slotSyncModifiedStates()) );
+ connect( m_doc, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotSyncModifiedStates()) );
+ connect( m_doc, TQT_SIGNAL(marksChanged()), this, TQT_SLOT(slotUpdateMarksInfo()) );
+ connect( m_doc, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionmChanged()) );
m_doc->setDescription((KTextEditor::MarkInterface::MarkTypes)Breakpoint, i18n("Breakpoint"));
m_doc->setPixmap((KTextEditor::MarkInterface::MarkTypes)Breakpoint, *inactiveBreakpointPixmap());
@@ -118,7 +118,7 @@ TextDocument::~TextDocument()
bool TextDocument::fileClose()
{
- const QString path = url().prettyURL();
+ const TQString path = url().prettyURL();
if ( !path.isEmpty() )
fileMetaInfo()->grabMetaInfo( path, this );
@@ -143,9 +143,9 @@ View * TextDocument::createView( ViewContainer *viewContainer, uint viewAreaId,
}
-Kate::View* TextDocument::createKateView( QWidget *parent, const char *name )
+Kate::View* TextDocument::createKateView( TQWidget *tqparent, const char *name )
{
- return static_cast<Kate::View*>((m_doc->createView( parent, name ))->qt_cast("Kate::View"));
+ return static_cast<Kate::View*>((m_doc->createView( tqparent, name ))->qt_cast("Kate::View"));
}
@@ -166,13 +166,13 @@ void TextDocument::paste()
}
-void TextDocument::setText( const QString & text, bool asInitial )
+void TextDocument::setText( const TQString & text, bool asInitial )
{
if ( asInitial )
{
- disconnect( m_doc, SIGNAL(undoChanged()), this, SIGNAL(undoRedoStateChanged()) );
- disconnect( m_doc, SIGNAL(undoChanged()), this, SLOT(slotSyncModifiedStates()) );
- disconnect( m_doc, SIGNAL(textChanged()), this, SLOT(slotSyncModifiedStates()) );
+ disconnect( m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SIGNAL(undoRedoStateChanged()) );
+ disconnect( m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SLOT(slotSyncModifiedStates()) );
+ disconnect( m_doc, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotSyncModifiedStates()) );
}
const ViewList::iterator end = m_viewList.end();
@@ -190,9 +190,9 @@ void TextDocument::setText( const QString & text, bool asInitial )
m_doc->clearRedo();
setModified(false);
- connect( m_doc, SIGNAL(undoChanged()), this, SIGNAL(undoRedoStateChanged()) );
- connect( m_doc, SIGNAL(undoChanged()), this, SLOT(slotSyncModifiedStates()) );
- connect( m_doc, SIGNAL(textChanged()), this, SLOT(slotSyncModifiedStates()) );
+ connect( m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SIGNAL(undoRedoStateChanged()) );
+ connect( m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SLOT(slotSyncModifiedStates()) );
+ connect( m_doc, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotSyncModifiedStates()) );
}
}
@@ -230,8 +230,8 @@ void TextDocument::setModified( bool modified )
void TextDocument::guessScheme( bool allowDisable )
{
// And specific file actions depending on the current type of file
- QString fileName = url().fileName();
- QString extension = fileName.right( fileName.length() - fileName.findRev('.') - 1 );
+ TQString fileName = url().fileName();
+ TQString extension = fileName.right( fileName.length() - fileName.tqfindRev('.') - 1 );
if ( extension == "asm" || extension == "src" || extension == "inc" )
slotInitLanguage(ct_asm);
@@ -255,7 +255,7 @@ void TextDocument::guessScheme( bool allowDisable )
void TextDocument::slotInitLanguage( CodeType type )
{
- QString hlName;
+ TQString hlName;
switch (type)
{
@@ -302,7 +302,7 @@ void TextDocument::slotInitLanguage( CodeType type )
void TextDocument::formatAssembly()
{
AsmFormatter formatter;
- QStringList lines = QStringList::split( "\n", m_doc->text(), true );
+ TQStringList lines = TQStringList::split( "\n", m_doc->text(), true );
setText( formatter.tidyAsm(lines), false );
setModified(true);
}
@@ -363,12 +363,12 @@ void TextDocument::setLastTextOutputTarget( TextDocument * target )
}
-QString TextDocument::outputFilePath( const QString &ext )
+TQString TextDocument::outputFilePath( const TQString &ext )
{
- QString filePath = url().path();
+ TQString filePath = url().path();
if ( filePath.isEmpty() )
{
- KTempFile f( QString::null, ext );
+ KTempFile f( TQString(), ext );
(*f.textStream()) << m_doc->text();
f.close();
DocManager::self()->associateDocument( f.name(), this );
@@ -406,7 +406,7 @@ void TextDocument::slotConvertTo( int target )
void TextDocument::convertToAssembly()
{
- QString filePath;
+ TQString filePath;
bool showPICSelect = false;
ProcessOptions::ProcessPath::MediaType toType;
@@ -447,7 +447,7 @@ void TextDocument::convertToAssembly()
return;
ProcessOptions o( dlg.info() );
- o.setTextOutputTarget( m_pLastTextOutputTarget, this, SLOT(setLastTextOutputTarget( TextDocument* )) );
+ o.setTextOutputTarget( m_pLastTextOutputTarget, this, TQT_SLOT(setLastTextOutputTarget( TextDocument* )) );
o.setInputFiles(filePath);
o.setProcessPath( ProcessOptions::ProcessPath::path( ProcessOptions::guessMediaType(filePath), toType ) );
LanguageManager::self()->compile(o);
@@ -456,7 +456,7 @@ void TextDocument::convertToAssembly()
void TextDocument::convertToHex()
{
- QString filePath;
+ TQString filePath;
bool showPICSelect = false;
if ( m_guessedCodeType == TextDocument::ct_microbe )
@@ -489,7 +489,7 @@ void TextDocument::convertToHex()
return;
ProcessOptions o( dlg.info() );
- o.setTextOutputTarget( m_pLastTextOutputTarget, this, SLOT(setLastTextOutputTarget( TextDocument* )) );
+ o.setTextOutputTarget( m_pLastTextOutputTarget, this, TQT_SLOT(setLastTextOutputTarget( TextDocument* )) );
o.setInputFiles(filePath);
o.setProcessPath( ProcessOptions::ProcessPath::path( ProcessOptions::guessMediaType(filePath), ProcessOptions::ProcessPath::Program ) );
LanguageManager::self()->compile(o);
@@ -498,9 +498,9 @@ void TextDocument::convertToHex()
void TextDocument::convertToPIC()
{
- QString filePath;
+ TQString filePath;
- QString picID;
+ TQString picID;
switch ( m_guessedCodeType )
{
@@ -530,7 +530,7 @@ void TextDocument::convertToPIC()
return;
}
- ProgrammerDlg * dlg = new ProgrammerDlg( picID, (QWidget*)p_ktechlab, "Programmer Dlg" );
+ ProgrammerDlg * dlg = new ProgrammerDlg( picID, (TQWidget*)p_ktechlab, "Programmer Dlg" );
if ( m_guessedCodeType == TextDocument::ct_c )
dlg->microSelect()->setAllowedAsmSet( AsmInfo::PIC14 | AsmInfo::PIC16 );
@@ -569,7 +569,7 @@ IntList TextDocument::bookmarkList() const
{
IntList bookmarkList;
- typedef QPtrList<KTextEditor::Mark> MarkList;
+ typedef TQPtrList<KTextEditor::Mark> MarkList;
MarkList markList = m_doc->marks();
// Find out what marks need adding to our internal lists
@@ -596,16 +596,16 @@ void TextDocument::slotUpdateMarksInfo()
p_ktechlab->unplugActionList("bookmark_actionlist");
m_bookmarkActions.clear();
- QPtrList<KTextEditor::Mark> markList = m_doc->marks();
+ TQPtrList<KTextEditor::Mark> markList = m_doc->marks();
// Find out what marks need adding to our internal lists
for ( KTextEditor::Mark * mark = markList.first(); mark; mark = markList.next() )
{
if ( mark->type & Bookmark )
{
- KAction * a = new KAction( i18n("%1 - %2").arg( QString::number( mark->line+1 ) ).arg( m_doc->textLine(mark->line) ),
- 0, this, SLOT(slotBookmarkRequested()), this,
- QString("bookmark_%1").arg(QString::number(mark->line).ascii()) );
+ KAction * a = new KAction( i18n("%1 - %2").tqarg( TQString::number( mark->line+1 ) ).tqarg( m_doc->textLine(mark->line) ),
+ 0, this, TQT_SLOT(slotBookmarkRequested()), this,
+ TQString("bookmark_%1").tqarg(TQString::number(mark->line).ascii()) );
m_bookmarkActions.append(a);
}
}
@@ -616,10 +616,10 @@ void TextDocument::slotUpdateMarksInfo()
void TextDocument::slotBookmarkRequested()
{
- const QObject * s = sender();
+ const TQObject * s = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()));
if (!s) return;
- QString name = s->name();
+ TQString name = s->name();
if ( !name.startsWith("bookmark_") )
return;
@@ -643,7 +643,7 @@ void TextDocument::setBookmarks( const IntList &lines )
void TextDocument::clearBookmarks()
{
- QPtrList<KTextEditor::Mark> markList = m_doc->marks();
+ TQPtrList<KTextEditor::Mark> markList = m_doc->marks();
// Find out what marks need adding to our internal lists
for ( KTextEditor::Mark * mark = markList.first(); mark; mark = markList.next() )
@@ -682,7 +682,7 @@ IntList TextDocument::breakpointList() const
IntList breakpointList;
#ifndef NO_GPSIM
- typedef QPtrList<KTextEditor::Mark> MarkList;
+ typedef TQPtrList<KTextEditor::Mark> MarkList;
MarkList markList = m_doc->marks();
// Find out what marks need adding to our internal lists
@@ -752,7 +752,7 @@ void TextDocument::debugRun()
break;
}
- m_symbolFile = GpsimProcessor::generateSymbolFile( m_debugFile, this, SLOT(slotCODCreationSucceeded()), SLOT(slotCODCreationFailed()) );
+ m_symbolFile = GpsimProcessor::generateSymbolFile( m_debugFile, this, TQT_SLOT(slotCODCreationSucceeded()), TQT_SLOT(slotCODCreationFailed()) );
#endif // !NO_GPSIM
}
@@ -868,8 +868,8 @@ void TextDocument::slotCODCreationSucceeded()
void TextDocument::slotCODCreationFailed()
{
#ifndef NO_GPSIM
- m_debugFile = QString::null;
- m_symbolFile = QString::null;
+ m_debugFile = TQString();
+ m_symbolFile = TQString();
#endif // !NO_GPSIM
}
@@ -879,7 +879,7 @@ void TextDocument::slotDebuggerDestroyed()
#ifndef NO_GPSIM
slotDebugSetCurrentLine( SourceLine() );
m_pDebugger = 0l;
- m_debugFile = QString::null;
+ m_debugFile = TQString();
slotInitDebugActions();
#endif // !NO_GPSIM
}
@@ -888,7 +888,7 @@ void TextDocument::slotDebuggerDestroyed()
#ifndef NO_GPSIM
void TextDocument::clearBreakpoints()
{
- QPtrList<KTextEditor::Mark> markList = m_doc->marks();
+ TQPtrList<KTextEditor::Mark> markList = m_doc->marks();
// Find out what marks need adding to our internal lists
for ( KTextEditor::Mark * mark = markList.first(); mark; mark = markList.next() )
@@ -912,7 +912,7 @@ void TextDocument::syncBreakpoints()
b_lockSyncBreakpoints = true;
- typedef QPtrList<KTextEditor::Mark> MarkList;
+ typedef TQPtrList<KTextEditor::Mark> MarkList;
MarkList markList = m_doc->marks();
IntList bpList;
@@ -959,7 +959,7 @@ void TextDocument::setDebugger( GpsimDebugger * debugger, bool ownDebugger )
return;
// Reset it for use next time
- m_symbolFile = QString::null;
+ m_symbolFile = TQString();
if (m_bOwnDebugger)
delete m_pDebugger;
@@ -973,9 +973,9 @@ void TextDocument::setDebugger( GpsimDebugger * debugger, bool ownDebugger )
if ( m_debugFile.isEmpty() )
m_debugFile = url().path();
- connect( m_pDebugger, SIGNAL(destroyed()), this, SLOT(slotDebuggerDestroyed()) );
- connect( m_pDebugger->gpsim(), SIGNAL(runningStatusChanged(bool )), this, SLOT(slotInitDebugActions()) );
- connect( m_pDebugger, SIGNAL(lineReached(const SourceLine &)), this, SLOT(slotDebugSetCurrentLine(const SourceLine &)) );
+ connect( m_pDebugger, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotDebuggerDestroyed()) );
+ connect( m_pDebugger->gpsim(), TQT_SIGNAL(runningStatusChanged(bool )), this, TQT_SLOT(slotInitDebugActions()) );
+ connect( m_pDebugger, TQT_SIGNAL(lineReached(const SourceLine &)), this, TQT_SLOT(slotDebugSetCurrentLine(const SourceLine &)) );
m_pDebugger->setBreakpoints( m_debugFile, breakpointList() );
slotInitDebugActions();
@@ -988,7 +988,7 @@ void TextDocument::setDebugger( GpsimDebugger * debugger, bool ownDebugger )
#endif // !NO_GPSIM
-const QPixmap* TextDocument::inactiveBreakpointPixmap()
+const TQPixmap* TextDocument::inactiveBreakpointPixmap()
{
const char*breakpoint_gr_xpm[]={
"11 16 6 1",
@@ -1014,12 +1014,12 @@ const QPixmap* TextDocument::inactiveBreakpointPixmap()
"...........",
"...........",
"..........."};
- static QPixmap pixmap( breakpoint_gr_xpm );
+ static TQPixmap pixmap( breakpoint_gr_xpm );
return &pixmap;
}
-const QPixmap* TextDocument::activeBreakpointPixmap()
+const TQPixmap* TextDocument::activeBreakpointPixmap()
{
const char* breakpoint_xpm[]={
"11 16 6 1",
@@ -1045,13 +1045,13 @@ const QPixmap* TextDocument::activeBreakpointPixmap()
"...........",
"...........",
"..........."};
- static QPixmap pixmap( breakpoint_xpm );
+ static TQPixmap pixmap( breakpoint_xpm );
return &pixmap;
}
-const QPixmap* TextDocument::reachedBreakpointPixmap()
+const TQPixmap* TextDocument::reachedBreakpointPixmap()
{
const char*breakpoint_bl_xpm[]={
"11 16 7 1",
@@ -1078,12 +1078,12 @@ const QPixmap* TextDocument::reachedBreakpointPixmap()
"...........",
"...........",
"..........."};
- static QPixmap pixmap( breakpoint_bl_xpm );
+ static TQPixmap pixmap( breakpoint_bl_xpm );
return &pixmap;
}
-const QPixmap* TextDocument::disabledBreakpointPixmap()
+const TQPixmap* TextDocument::disabledBreakpointPixmap()
{
const char*breakpoint_wh_xpm[]={
"11 16 7 1",
@@ -1110,12 +1110,12 @@ const QPixmap* TextDocument::disabledBreakpointPixmap()
"...........",
"...........",
"..........."};
- static QPixmap pixmap( breakpoint_wh_xpm );
+ static TQPixmap pixmap( breakpoint_wh_xpm );
return &pixmap;
}
-const QPixmap* TextDocument::executionPointPixmap()
+const TQPixmap* TextDocument::executionPointPixmap()
{
const char*exec_xpm[]={
"11 16 4 1",
@@ -1139,7 +1139,7 @@ const QPixmap* TextDocument::executionPointPixmap()
"...........",
"...........",
"..........."};
- static QPixmap pixmap( exec_xpm );
+ static TQPixmap pixmap( exec_xpm );
return &pixmap;
}