diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /parts/abbrev | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/abbrev')
-rw-r--r-- | parts/abbrev/abbrevconfigwidget.cpp | 28 | ||||
-rw-r--r-- | parts/abbrev/abbrevconfigwidget.h | 2 | ||||
-rw-r--r-- | parts/abbrev/abbrevpart.cpp | 216 | ||||
-rw-r--r-- | parts/abbrev/abbrevpart.h | 48 | ||||
-rw-r--r-- | parts/abbrev/addtemplatedlg.cpp | 16 | ||||
-rw-r--r-- | parts/abbrev/addtemplatedlg.h | 8 |
6 files changed, 159 insertions, 159 deletions
diff --git a/parts/abbrev/abbrevconfigwidget.cpp b/parts/abbrev/abbrevconfigwidget.cpp index d7729249..6e174603 100644 --- a/parts/abbrev/abbrevconfigwidget.cpp +++ b/parts/abbrev/abbrevconfigwidget.cpp @@ -18,25 +18,25 @@ #include <kconfig.h> #include <kiconloader.h> -#include <qlistview.h> -#include <qmultilineedit.h> -#include <qcheckbox.h> +#include <tqlistview.h> +#include <tqmultilineedit.h> +#include <tqcheckbox.h> #include "addtemplatedlg.h" #include "abbrevpart.h" -AbbrevConfigWidget::AbbrevConfigWidget(AbbrevPart *part, QWidget *parent, const char *name) +AbbrevConfigWidget::AbbrevConfigWidget(AbbrevPart *part, TQWidget *parent, const char *name) : AbbrevConfigWidgetBase(parent, name) { m_part = part; qWarning("creating abbrevconfigwidget for %d abbrevs", part->templates().allTemplates().count()); - QPtrList<CodeTemplate> templates = part->templates().allTemplates(); + TQPtrList<CodeTemplate> templates = part->templates().allTemplates(); CodeTemplate *templ; for (templ = templates.first(); templ; templ = templates.next()) { qWarning("creating item for code template "); - QListViewItem *it = new QListViewItem( listTemplates, + TQListViewItem *it = new TQListViewItem( listTemplates, templ->name, templ->description, templ->suffixes, @@ -56,15 +56,15 @@ AbbrevConfigWidget::~AbbrevConfigWidget() void AbbrevConfigWidget::addTemplate() { - QStringList suffixesList = m_part->templates().suffixes(); + TQStringList suffixesList = m_part->templates().suffixes(); AddTemplateDialog dlg( suffixesList, this ); if( dlg.exec() ){ - QString templ = dlg.templ(); - QString description = dlg.description(); - QString suffixes = dlg.suffixes(); + TQString templ = dlg.templ(); + TQString description = dlg.description(); + TQString suffixes = dlg.suffixes(); if( !(templ.isEmpty() || description.isEmpty()) || suffixes.isEmpty()) { - QListViewItem* item = new QListViewItem( listTemplates, templ, description, suffixes ); + TQListViewItem* item = new TQListViewItem( listTemplates, templ, description, suffixes ); listTemplates->setSelected( item, true ); editCode->setFocus(); } @@ -82,7 +82,7 @@ void AbbrevConfigWidget::removeTemplate() void AbbrevConfigWidget::selectionChanged() { - QListViewItem* item = listTemplates->selectedItem(); + TQListViewItem* item = listTemplates->selectedItem(); if( item ){ editCode->setText( item->text(3) ); } @@ -91,7 +91,7 @@ void AbbrevConfigWidget::selectionChanged() void AbbrevConfigWidget::codeChanged() { - QListViewItem* item = listTemplates->selectedItem(); + TQListViewItem* item = listTemplates->selectedItem(); if( item ){ item->setText( 3, editCode->text() ); if (item->text(3) == item->text(4)) @@ -106,7 +106,7 @@ void AbbrevConfigWidget::accept() { m_part->clearTemplates(); - QListViewItem* item = listTemplates->firstChild(); + TQListViewItem* item = listTemplates->firstChild(); while( item ){ m_part->addTemplate( item->text(0), item->text(1), diff --git a/parts/abbrev/abbrevconfigwidget.h b/parts/abbrev/abbrevconfigwidget.h index b8cc1983..818aa3ba 100644 --- a/parts/abbrev/abbrevconfigwidget.h +++ b/parts/abbrev/abbrevconfigwidget.h @@ -25,7 +25,7 @@ class AbbrevConfigWidget : public AbbrevConfigWidgetBase Q_OBJECT public: - AbbrevConfigWidget(AbbrevPart *part, QWidget *parent=0, const char *name=0); + AbbrevConfigWidget(AbbrevPart *part, TQWidget *parent=0, const char *name=0); ~AbbrevConfigWidget(); public slots: diff --git a/parts/abbrev/abbrevpart.cpp b/parts/abbrev/abbrevpart.cpp index 181606f4..a86d98f8 100644 --- a/parts/abbrev/abbrevpart.cpp +++ b/parts/abbrev/abbrevpart.cpp @@ -15,10 +15,10 @@ #include "abbrevpart.h" -#include <qfile.h> -#include <qfileinfo.h> -#include <qregexp.h> -#include <qvbox.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqvbox.h> #include <kdebug.h> #include <kdialogbase.h> #include <klocale.h> @@ -65,26 +65,26 @@ public: K_EXPORT_COMPONENT_FACTORY( libkdevabbrev, AbbrevFactory ) -AbbrevPart::AbbrevPart(QObject *parent, const char *name, const QStringList &) +AbbrevPart::AbbrevPart(TQObject *parent, const char *name, const TQStringList &) : KDevPlugin(&data, parent, name ? name : "AbbrevPart") { setInstance(AbbrevFactory::instance()); setXMLFile("kdevabbrev.rc"); - connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), - this, SLOT(slotActivePartChanged(KParts::Part*)) ); + connect(partController(), TQT_SIGNAL(activePartChanged(KParts::Part*)), + this, TQT_SLOT(slotActivePartChanged(KParts::Part*)) ); - connect(core(), SIGNAL(configWidget(KDialogBase*)), this, SLOT(configWidget(KDialogBase*))); + connect(core(), TQT_SIGNAL(configWidget(KDialogBase*)), this, TQT_SLOT(configWidget(KDialogBase*))); KAction *action; action = new KAction( i18n("Expand Text"), CTRL + Key_J, - this, SLOT(slotExpandText()), + this, TQT_SLOT(slotExpandText()), actionCollection(), "edit_expandtext" ); action->setToolTip( i18n("Expand current word") ); action->setWhatsThis( i18n("<b>Expand current word</b><p>Current word can be completed using the list of similar words in source files.") ); action = new KAction( i18n("Expand Abbreviation"), CTRL + Key_L, - this, SLOT(slotExpandAbbrev()), + this, TQT_SLOT(slotExpandAbbrev()), actionCollection(), "edit_expandabbrev" ); action->setToolTip( i18n("Expand abbreviation") ); action->setWhatsThis( i18n("<b>Expand abbreviation</b><p>Enable and configure abbreviations in <b>KDevelop Settings</b>, <b>Abbreviations</b> tab.") ); @@ -140,56 +140,56 @@ void AbbrevPart::setAutoWordCompletionEnabled( bool enabled ) disconnect( docIface->widget(), 0, this, 0 ); if( m_autoWordCompletionEnabled ){ - connect( docIface->widget(), SIGNAL(completionAborted()), - this, SLOT(slotCompletionAborted()) ); - connect( docIface->widget(), SIGNAL(completionDone()), - this, SLOT(slotCompletionDone()) ); - connect( docIface->widget(), SIGNAL(aboutToShowCompletionBox()), - this, SLOT(slotAboutToShowCompletionBox()) ); - - connect( docIface, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) ); + connect( docIface->widget(), TQT_SIGNAL(completionAborted()), + this, TQT_SLOT(slotCompletionAborted()) ); + connect( docIface->widget(), TQT_SIGNAL(completionDone()), + this, TQT_SLOT(slotCompletionDone()) ); + connect( docIface->widget(), TQT_SIGNAL(aboutToShowCompletionBox()), + this, TQT_SLOT(slotAboutToShowCompletionBox()) ); + + connect( docIface, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged()) ); } } void AbbrevPart::load() { KStandardDirs *dirs = AbbrevFactory::instance()->dirs(); - QString localTemplatesFile = locateLocal("codetemplates", "templates", AbbrevFactory::instance()); - QStringList files; - if (QFileInfo(localTemplatesFile).exists()) + TQString localTemplatesFile = locateLocal("codetemplates", "templates", AbbrevFactory::instance()); + TQStringList files; + if (TQFileInfo(localTemplatesFile).exists()) files << localTemplatesFile; else - files = dirs->findAllResources("codetemplates", QString::null, false, true); + files = dirs->findAllResources("codetemplates", TQString::null, false, true); - QString localSourcesFile = locateLocal("sources", "sources", AbbrevFactory::instance()); - QStringList sourceFiles; - if (QFileInfo(localSourcesFile).exists()) + TQString localSourcesFile = locateLocal("sources", "sources", AbbrevFactory::instance()); + TQStringList sourceFiles; + if (TQFileInfo(localSourcesFile).exists()) sourceFiles << localSourcesFile; else - sourceFiles = dirs->findAllResources("sources", QString::null, false, true); + sourceFiles = dirs->findAllResources("sources", TQString::null, false, true); kdDebug(9028) << "=========> sourceFiles: " << sourceFiles.join(" ") << endl; - this->m_completionFile = QString::null; - for( QStringList::Iterator it=sourceFiles.begin(); it!=sourceFiles.end(); ++it ) { - QString fn = *it; + this->m_completionFile = TQString::null; + for( TQStringList::Iterator it=sourceFiles.begin(); it!=sourceFiles.end(); ++it ) { + TQString fn = *it; kdDebug(9028) << "===> load file: " << fn << endl; - QFile f( fn ); + TQFile f( fn ); if ( f.open(IO_ReadOnly) ) { - QTextStream stream( &f ); - m_completionFile += ( stream.read() + QString("\n") ); + TQTextStream stream( &f ); + m_completionFile += ( stream.read() + TQString("\n") ); f.close(); } } - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = files.begin(); it != files.end(); ++it) { - QString fn = *it; + TQString fn = *it; kdDebug(9028) << "fn = " << fn << endl; - QFile f( fn ); + TQFile f( fn ); if ( f.open(IO_ReadOnly) ) { - QDomDocument doc; + TQDomDocument doc; doc.setContent( &f ); - QDomElement root = doc.firstChild().toElement(); - QDomElement e = root.firstChild().toElement(); + TQDomElement root = doc.firstChild().toElement(); + TQDomElement e = root.firstChild().toElement(); while ( !e.isNull() ){ addTemplate( e.attribute("name"), e.attribute("description"), @@ -205,18 +205,18 @@ void AbbrevPart::load() void AbbrevPart::save() { - QString fn = AbbrevFactory::instance()->dirs()->saveLocation("codetemplates", "", true); + TQString fn = AbbrevFactory::instance()->dirs()->saveLocation("codetemplates", "", true); kdDebug(9028) << "fn = " << fn << endl; - QDomDocument doc( "Templates" ); - QDomElement root = doc.createElement( "Templates" ); + TQDomDocument doc( "Templates" ); + TQDomElement root = doc.createElement( "Templates" ); doc.appendChild( root ); - QPtrList<CodeTemplate> templates = m_templates.allTemplates(); + TQPtrList<CodeTemplate> templates = m_templates.allTemplates(); CodeTemplate *templ; for (templ = templates.first(); templ; templ = templates.next()) { - QDomElement e = doc.createElement( "Template" ); + TQDomElement e = doc.createElement( "Template" ); e.setAttribute( "name", templ->name ); e.setAttribute( "description", templ->description ); e.setAttribute( "suffixes", templ->suffixes ); @@ -224,16 +224,16 @@ void AbbrevPart::save() root.appendChild( e ); } - QFile f( fn + "templates" ); + TQFile f( fn + "templates" ); if( f.open(IO_WriteOnly) ){ - QTextStream stream( &f ); + TQTextStream stream( &f ); stream << doc.toString(); f.close(); } } -QString AbbrevPart::currentWord() const +TQString AbbrevPart::currentWord() const { return KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) ); } @@ -241,9 +241,9 @@ QString AbbrevPart::currentWord() const void AbbrevPart::configWidget(KDialogBase *dlg) { - QVBox *vbox = dlg->addVBoxPage(i18n("Abbreviations"), i18n("Abbreviations"), BarIcon( info()->icon(), KIcon::SizeMedium) ); + TQVBox *vbox = dlg->addVBoxPage(i18n("Abbreviations"), i18n("Abbreviations"), BarIcon( info()->icon(), KIcon::SizeMedium) ); AbbrevConfigWidget *w = new AbbrevConfigWidget(this, vbox, "abbrev config widget"); - connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + connect(dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept())); } @@ -252,17 +252,17 @@ void AbbrevPart::slotExpandText() if( !editIface || !completionIface || !viewCursorIface ) return; - QString word = currentWord(); + TQString word = currentWord(); if (word.isEmpty()) return; - QValueList<KTextEditor::CompletionEntry> entries = findAllWords(editIface->text(), word); + TQValueList<KTextEditor::CompletionEntry> entries = findAllWords(editIface->text(), word); if (entries.count() == 0) { ; // some statusbar message? // } else if (entries.count() == 1) { // uint line, col; // viewCursorIface->cursorPositionReal(&line, &col); -// QString txt = entries[0].text.mid(word.length()); +// TQString txt = entries[0].text.mid(word.length()); // editIface->insertText( line, col, txt ); // viewCursorIface->setCursorPositionReal( line, col + txt.length() ); } else { @@ -272,32 +272,32 @@ void AbbrevPart::slotExpandText() } -QValueList<KTextEditor::CompletionEntry> AbbrevPart::findAllWords(const QString &text, const QString &prefix) +TQValueList<KTextEditor::CompletionEntry> AbbrevPart::findAllWords(const TQString &text, const TQString &prefix) { - QValueList<KTextEditor::CompletionEntry> entries; + TQValueList<KTextEditor::CompletionEntry> entries; KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart()); - QWidget *view = partController()->activeWidget(); + TQWidget *view = partController()->activeWidget(); if (!part || !view) { kdDebug(9028) << "no rw part" << endl; return entries; } - QString suffix = part->url().url(); + TQString suffix = part->url().url(); int pos = suffix.findRev('.'); if (pos != -1) suffix.remove(0, pos+1); kdDebug(9028) << "AbbrevPart::findAllWords with suffix " << suffix << endl; - QMap<QString, bool> map; - QRegExp rx( QString("\\b") + prefix + "[a-zA-Z0-9_]+\\b" ); + TQMap<TQString, bool> map; + TQRegExp rx( TQString("\\b") + prefix + "[a-zA-Z0-9_]+\\b" ); int idx = 0; pos = 0; int len = 0; while ( (pos = rx.search(text, idx)) != -1 ) { len = rx.matchedLength(); - QString word = text.mid(pos, len); + TQString word = text.mid(pos, len); if (map.find(word) == map.end()) { KTextEditor::CompletionEntry e; e.text = word; @@ -312,7 +312,7 @@ QValueList<KTextEditor::CompletionEntry> AbbrevPart::findAllWords(const QString len = 0; while ( (pos = rx.search(m_completionFile, idx)) != -1 ) { len = rx.matchedLength(); - QString word = m_completionFile.mid(pos, len); + TQString word = m_completionFile.mid(pos, len); if (map.find(word) == map.end()) { KTextEditor::CompletionEntry e; e.text = word; @@ -323,8 +323,8 @@ QValueList<KTextEditor::CompletionEntry> AbbrevPart::findAllWords(const QString } - QMap<QString, CodeTemplate*> m = m_templates[suffix]; - for (QMap<QString, CodeTemplate*>::const_iterator it = m.begin(); it != m.end() ; ++it) { + TQMap<TQString, CodeTemplate*> m = m_templates[suffix]; + for (TQMap<TQString, CodeTemplate*>::const_iterator it = m.begin(); it != m.end() ; ++it) { KTextEditor::CompletionEntry e; e.text = it.data()->description + " <abbrev>"; e.userdata = it.key(); @@ -338,13 +338,13 @@ QValueList<KTextEditor::CompletionEntry> AbbrevPart::findAllWords(const QString void AbbrevPart::slotExpandAbbrev() { KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart()); - QWidget *view = partController()->activeWidget(); + TQWidget *view = partController()->activeWidget(); if (!part || !view) { kdDebug(9028) << "no rw part" << endl; return; } - QString suffix = part->url().url(); + TQString suffix = part->url().url(); int pos = suffix.findRev('.'); if (pos != -1) suffix.remove(0, pos+1); @@ -362,18 +362,18 @@ void AbbrevPart::slotExpandAbbrev() return; } - QString word = currentWord(); + TQString word = currentWord(); kdDebug(9028) << "Expanding word " << word << " with suffix " << suffix << "." << endl; - QMap<QString, CodeTemplate*> m = m_templates[suffix]; - for (QMap<QString, CodeTemplate*>::const_iterator it = m.begin(); it != m.end() ; ++it) { + TQMap<TQString, CodeTemplate*> m = m_templates[suffix]; + for (TQMap<TQString, CodeTemplate*>::const_iterator it = m.begin(); it != m.end() ; ++it) { if (it.key() != word) continue; uint line, col; cursoriface->cursorPositionReal(&line, &col); - QString linestr = editIface->textLine(line); + TQString linestr = editIface->textLine(line); int startPos = QMAX( QMIN( (int)col, (int)linestr.length()-1 ), 0 ); int endPos = startPos; startPos--; @@ -388,15 +388,15 @@ void AbbrevPart::slotExpandAbbrev() } -void AbbrevPart::insertChars( const QString &chars ) +void AbbrevPart::insertChars( const TQString &chars ) { unsigned line=0, col=0; viewCursorIface->cursorPositionReal( &line, &col ); unsigned int currentLine=line, currentCol=col; - QString spaces; - QString s = editIface->textLine( currentLine ); + TQString spaces; + TQString s = editIface->textLine( currentLine ); uint i=0; while( i<s.length() && s[ i ].isSpace() ){ spaces += s[ i ]; @@ -404,13 +404,13 @@ void AbbrevPart::insertChars( const QString &chars ) } bool foundPipe = false; - QString str; - QTextStream stream( &str, IO_WriteOnly ); - QStringList lines = QStringList::split( "\n", chars ); - QStringList::Iterator it = lines.begin(); + TQString str; + TQTextStream stream( &str, IO_WriteOnly ); + TQStringList lines = TQStringList::split( "\n", chars ); + TQStringList::Iterator it = lines.begin(); line = currentLine; while( it != lines.end() ){ - QString lineText = *it; + TQString lineText = *it; if( it != lines.begin() ){ stream << spaces; if( !foundPipe ) @@ -444,16 +444,16 @@ void AbbrevPart::insertChars( const QString &chars ) viewCursorIface->setCursorPositionReal( currentLine, currentCol ); } -void AbbrevPart::addTemplate( const QString& templ, - const QString& descr, - const QString& suffixes, - const QString& code) +void AbbrevPart::addTemplate( const TQString& templ, + const TQString& descr, + const TQString& suffixes, + const TQString& code) { m_templates.insert(templ, descr, code, suffixes); } -void AbbrevPart::removeTemplate( const QString &suffixes, const QString &name ) +void AbbrevPart::removeTemplate( const TQString &suffixes, const TQString &name ) { m_templates.remove( suffixes, name ); } @@ -502,14 +502,14 @@ void AbbrevPart::slotActivePartChanged( KParts::Part* part ) disconnect( part->widget(), 0, this, 0 ); disconnect( doc, 0, this, 0 ); - connect( part->widget(), SIGNAL(filterInsertString(KTextEditor::CompletionEntry*, QString*)), - this, SLOT(slotFilterInsertString(KTextEditor::CompletionEntry*, QString*)) ); + connect( part->widget(), TQT_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*, TQString*)), + this, TQT_SLOT(slotFilterInsertString(KTextEditor::CompletionEntry*, TQString*)) ); if( autoWordCompletionEnabled() ){ - connect( part->widget(), SIGNAL(completionAborted()), this, SLOT(slotCompletionAborted()) ); - connect( part->widget(), SIGNAL(completionDone()), this, SLOT(slotCompletionDone()) ); - connect( part->widget(), SIGNAL(aboutToShowCompletionBox()), this, SLOT(slotAboutToShowCompletionBox()) ); - connect( doc, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) ); + connect( part->widget(), TQT_SIGNAL(completionAborted()), this, TQT_SLOT(slotCompletionAborted()) ); + connect( part->widget(), TQT_SIGNAL(completionDone()), this, TQT_SLOT(slotCompletionDone()) ); + connect( part->widget(), TQT_SIGNAL(aboutToShowCompletionBox()), this, TQT_SLOT(slotAboutToShowCompletionBox()) ); + connect( doc, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged()) ); } m_prevLine = -1; @@ -533,11 +533,11 @@ void AbbrevPart::slotTextChanged() return; } - QString textLine = editIface->textLine( line ); - QChar ch = textLine[ col-1 ]; - QChar currentChar = textLine[ col ]; + TQString textLine = editIface->textLine( line ); + TQChar ch = textLine[ col-1 ]; + TQChar currentChar = textLine[ col ]; - if( currentChar.isLetterOrNumber() || currentChar == QChar('_') || !(ch.isLetterOrNumber() || ch == QChar('_')) ){ + if( currentChar.isLetterOrNumber() || currentChar == TQChar('_') || !(ch.isLetterOrNumber() || ch == TQChar('_')) ){ // reset m_prevLine = -1; return; @@ -551,17 +551,17 @@ void AbbrevPart::slotTextChanged() m_prevColumn = col; } -void AbbrevPart::slotFilterInsertString( KTextEditor::CompletionEntry* entry, QString* text ) +void AbbrevPart::slotFilterInsertString( KTextEditor::CompletionEntry* entry, TQString* text ) { kdDebug(9028) << "AbbrevPart::slotFilterInsertString()" << endl; KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart()); - QWidget *view = partController()->activeWidget(); + TQWidget *view = partController()->activeWidget(); if (!part || !view) { kdDebug(9028) << "no rw part" << endl; return; } - QString suffix = part->url().url(); + TQString suffix = part->url().url(); int pos = suffix.findRev('.'); if (pos != -1) suffix.remove(0, pos+1); @@ -570,9 +570,9 @@ void AbbrevPart::slotFilterInsertString( KTextEditor::CompletionEntry* entry, QS if( !entry || !text || !viewCursorIface || !editIface ) return; - QString expand( " <abbrev>" ); + TQString expand( " <abbrev>" ); if( !entry->userdata.isNull() && entry->text.endsWith(expand) ){ - QString macro = entry->text.left( entry->text.length() - expand.length() ); + TQString macro = entry->text.left( entry->text.length() - expand.length() ); *text = ""; uint line, col; viewCursorIface->cursorPositionReal( &line, &col ); @@ -614,19 +614,19 @@ CodeTemplateList::~ CodeTemplateList( ) { } -QMap< QString, CodeTemplate * > CodeTemplateList::operator [ ]( QString suffix ) +TQMap< TQString, CodeTemplate * > CodeTemplateList::operator [ ]( TQString suffix ) { kdDebug(9028) << "CodeTemplateList::operator []" << endl; - QMap< QString, CodeTemplate * > selectedTemplates; - for (QMap<QString, QMap<QString, CodeTemplate* > >::const_iterator it = templates.begin(); it != templates.end(); ++it) + TQMap< TQString, CodeTemplate * > selectedTemplates; + for (TQMap<TQString, TQMap<TQString, CodeTemplate* > >::const_iterator it = templates.begin(); it != templates.end(); ++it) { kdDebug(9028) << "CodeTemplateList::operator [] - suffixes " << it.key() << endl; - if (QStringList::split(",", it.key()).contains(suffix)) + if (TQStringList::split(",", it.key()).contains(suffix)) { kdDebug(9028) << "CodeTemplateList::operator [] - suffixes " << it.key() << " contains " << suffix << endl; - QMap<QString, CodeTemplate* > m = it.data(); - for (QMap<QString, CodeTemplate* >::const_iterator itt = m.begin(); itt != m.end(); ++itt) + TQMap<TQString, CodeTemplate* > m = it.data(); + for (TQMap<TQString, CodeTemplate* >::const_iterator itt = m.begin(); itt != m.end(); ++itt) { kdDebug(9028) << "x" << endl; selectedTemplates[itt.key()] = itt.data(); @@ -636,10 +636,10 @@ QMap< QString, CodeTemplate * > CodeTemplateList::operator [ ]( QString suffix ) return selectedTemplates; } -void CodeTemplateList::insert( QString name, QString description, QString code, QString suffixes ) +void CodeTemplateList::insert( TQString name, TQString description, TQString code, TQString suffixes ) { - QString origSuffixes = suffixes; -// QStringList suffixList; + TQString origSuffixes = suffixes; +// TQStringList suffixList; int pos = suffixes.find('('); if (pos == -1) return; @@ -648,7 +648,7 @@ void CodeTemplateList::insert( QString name, QString description, QString code, if (pos == -1) return; suffixes.remove(pos, suffixes.length()-pos); -// suffixList = QStringList::split(",", suffixes); +// suffixList = TQStringList::split(",", suffixes); CodeTemplate *t; if (templates.contains(suffixes) && templates[suffixes].contains(name)) @@ -671,12 +671,12 @@ void CodeTemplateList::insert( QString name, QString description, QString code, m_suffixes.append(origSuffixes); } -QPtrList< CodeTemplate > CodeTemplateList::allTemplates( ) const +TQPtrList< CodeTemplate > CodeTemplateList::allTemplates( ) const { return allCodeTemplates; } -void CodeTemplateList::remove( const QString & suffixes, const QString & name ) +void CodeTemplateList::remove( const TQString & suffixes, const TQString & name ) { allCodeTemplates.remove(templates[suffixes][name]); templates[suffixes].remove(name); @@ -688,7 +688,7 @@ void CodeTemplateList::clear( ) allCodeTemplates.clear(); } -QStringList CodeTemplateList::suffixes( ) +TQStringList CodeTemplateList::suffixes( ) { return m_suffixes; } diff --git a/parts/abbrev/abbrevpart.h b/parts/abbrev/abbrevpart.h index f0029b51..d1c1bc7c 100644 --- a/parts/abbrev/abbrevpart.h +++ b/parts/abbrev/abbrevpart.h @@ -16,8 +16,8 @@ #ifndef _ABBREVPART_H_ #define _ABBREVPART_H_ -#include <qmap.h> -#include <qptrlist.h> +#include <tqmap.h> +#include <tqptrlist.h> #include "kdevplugin.h" #include <ktexteditor/codecompletioninterface.h> @@ -35,10 +35,10 @@ namespace KTextEditor{ } struct CodeTemplate { - QString name; - QString description; - QString code; - QString suffixes; + TQString name; + TQString description; + TQString code; + TQString suffixes; }; class CodeTemplateList { @@ -46,18 +46,18 @@ public: CodeTemplateList(); ~CodeTemplateList(); - QMap<QString, CodeTemplate* > operator[](QString suffix); - void insert(QString name, QString description, QString code, QString suffixes); - void remove(const QString &suffixes, const QString &name); + TQMap<TQString, CodeTemplate* > operator[](TQString suffix); + void insert(TQString name, TQString description, TQString code, TQString suffixes); + void remove(const TQString &suffixes, const TQString &name); void clear(); - QStringList suffixes(); + TQStringList suffixes(); - QPtrList<CodeTemplate> allTemplates() const; + TQPtrList<CodeTemplate> allTemplates() const; private: - QMap<QString, QMap<QString, CodeTemplate* > > templates; - QPtrList<CodeTemplate> allCodeTemplates; - QStringList m_suffixes; + TQMap<TQString, TQMap<TQString, CodeTemplate* > > templates; + TQPtrList<CodeTemplate> allCodeTemplates; + TQStringList m_suffixes; }; class AbbrevPart : public KDevPlugin @@ -65,15 +65,15 @@ class AbbrevPart : public KDevPlugin Q_OBJECT public: - AbbrevPart( QObject *parent, const char *name, const QStringList & ); + AbbrevPart( TQObject *parent, const char *name, const TQStringList & ); ~AbbrevPart(); bool autoWordCompletionEnabled() const; void setAutoWordCompletionEnabled( bool enabled ); - void addTemplate(const QString &templ, const QString &descr, - const QString &suffixes, const QString &code); - void removeTemplate(const QString &suffixes, const QString &name); + void addTemplate(const TQString &templ, const TQString &descr, + const TQString &suffixes, const TQString &code); + void removeTemplate(const TQString &suffixes, const TQString &name); void clearTemplates(); CodeTemplateList templates() const; @@ -85,24 +85,24 @@ private slots: void slotTextChanged(); void slotCompletionAborted(); void slotCompletionDone(); - void slotFilterInsertString( KTextEditor::CompletionEntry*, QString* ); + void slotFilterInsertString( KTextEditor::CompletionEntry*, TQString* ); void slotAboutToShowCompletionBox(); private: void updateActions(); void load(); void save(); - QString currentWord() const; - QValueList<KTextEditor::CompletionEntry> findAllWords(const QString &text, const QString &prefix); - void insertChars( const QString &chars ); -// QAsciiDict<CodeTemplate> m_templates; + TQString currentWord() const; + TQValueList<KTextEditor::CompletionEntry> findAllWords(const TQString &text, const TQString &prefix); + void insertChars( const TQString &chars ); +// TQAsciiDict<CodeTemplate> m_templates; CodeTemplateList m_templates; bool m_inCompletion; int m_prevLine; int m_prevColumn; int m_sequenceLength; bool m_autoWordCompletionEnabled; - QString m_completionFile; + TQString m_completionFile; KTextEditor::Document* docIface; KTextEditor::EditInterface* editIface; diff --git a/parts/abbrev/addtemplatedlg.cpp b/parts/abbrev/addtemplatedlg.cpp index 35342ffe..a837c08a 100644 --- a/parts/abbrev/addtemplatedlg.cpp +++ b/parts/abbrev/addtemplatedlg.cpp @@ -18,17 +18,17 @@ * */ #include "addtemplatedlg.h" -#include <qcombobox.h> +#include <tqcombobox.h> #include <klineedit.h> -#include <qpushbutton.h> +#include <tqpushbutton.h> -AddTemplateDialog::AddTemplateDialog( QStringList suffixesList, QWidget *parent, const char *name ) +AddTemplateDialog::AddTemplateDialog( TQStringList suffixesList, TQWidget *parent, const char *name ) : AddTemplateDialogBase( parent, name ) { setFocusProxy( editTemplate ); comboSuffixes->insertStringList(suffixesList); - connect( editTemplate, SIGNAL(textChanged ( const QString & )), this, SLOT( textChanged())); - connect( editDescription, SIGNAL(textChanged ( const QString & )), this, SLOT( textChanged())); + connect( editTemplate, TQT_SIGNAL(textChanged ( const TQString & )), this, TQT_SLOT( textChanged())); + connect( editDescription, TQT_SIGNAL(textChanged ( const TQString & )), this, TQT_SLOT( textChanged())); buttonOk->setEnabled(false); } @@ -41,17 +41,17 @@ void AddTemplateDialog::textChanged() buttonOk->setEnabled( !editTemplate->text().isEmpty() && !editDescription->text().isEmpty() ); } -QString AddTemplateDialog::templ() const +TQString AddTemplateDialog::templ() const { return editTemplate->text(); } -QString AddTemplateDialog::description() const +TQString AddTemplateDialog::description() const { return editDescription->text(); } -QString AddTemplateDialog::suffixes() const +TQString AddTemplateDialog::suffixes() const { return comboSuffixes->currentText(); } diff --git a/parts/abbrev/addtemplatedlg.h b/parts/abbrev/addtemplatedlg.h index 9a20479e..64bcc24e 100644 --- a/parts/abbrev/addtemplatedlg.h +++ b/parts/abbrev/addtemplatedlg.h @@ -28,12 +28,12 @@ class AddTemplateDialog: public AddTemplateDialogBase Q_OBJECT public: - AddTemplateDialog( QStringList suffixesList, QWidget *parent=0, const char *name=0 ); + AddTemplateDialog( TQStringList suffixesList, TQWidget *parent=0, const char *name=0 ); virtual ~AddTemplateDialog(); - QString templ() const; - QString description() const; - QString suffixes() const; + TQString templ() const; + TQString description() const; + TQString suffixes() const; private slots: void textChanged(); }; |