summaryrefslogtreecommitdiffstats
path: root/kate/xmltools/plugin_katexmltools.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kate/xmltools/plugin_katexmltools.cpp
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/xmltools/plugin_katexmltools.cpp')
-rw-r--r--kate/xmltools/plugin_katexmltools.cpp236
1 files changed, 118 insertions, 118 deletions
diff --git a/kate/xmltools/plugin_katexmltools.cpp b/kate/xmltools/plugin_katexmltools.cpp
index 05f7802..182aeaf 100644
--- a/kate/xmltools/plugin_katexmltools.cpp
+++ b/kate/xmltools/plugin_katexmltools.cpp
@@ -63,12 +63,12 @@ TODO:
but then at <xsl:template match="/"><html> it will only show you HTML elements!
=>So better "Assign meta DTD" and "Add meta DTD", the latter will expand the current meta DTD
-Option to insert empty element in <empty/> form
--Show expanded entities with QChar::QChar( int rc ) + unicode font
+-Show expanded entities with TQChar::TQChar( int rc ) + unicode font
-Don't ignore entities defined in the document's prologue
-Only offer 'valid' elements, i.e. don't take the elements as a set but check
if the DTD is matched ( order, number of occurences, ... )
--Maybe only read the meta DTD file once, then store the resulting QMap on disk ( using QDataStream )?
+-Maybe only read the meta DTD file once, then store the resulting TQMap on disk ( using TQDataStream )?
We'll then have to compare timeOf_cacheFile <-> timeOf_metaDtd.
-Try to use libxml
*/
@@ -78,16 +78,16 @@ TODO:
#include <assert.h>
-#include <qdatetime.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qprogressdialog.h>
-#include <qpushbutton.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qtimer.h>
+#include <tqdatetime.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqprogressdialog.h>
+#include <tqpushbutton.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <kbuttonbox.h>
@@ -113,13 +113,13 @@ class PluginView : public KXMLGUIClient
Kate::MainWindow *win;
};
-PluginKateXMLTools::PluginKateXMLTools( QObject* parent, const char* name, const QStringList& )
+PluginKateXMLTools::PluginKateXMLTools( TQObject* parent, const char* name, const TQStringList& )
: Kate::Plugin ( (Kate::Application*)parent, name )
{
//kdDebug() << "PluginKateXMLTools constructor called" << endl;
- m_dtdString = QString();
- m_urlString = QString();
+ m_dtdString = TQString();
+ m_urlString = TQString();
m_docToAssignTo = 0L;
m_mode = none;
@@ -127,17 +127,17 @@ PluginKateXMLTools::PluginKateXMLTools( QObject* parent, const char* name, const
m_lastLine = 0;
m_lastCol = 0;
- m_lastAllowed = QStringList();
+ m_lastAllowed = TQStringList();
m_popupOpenCol = -1;
m_dtds.setAutoDelete( true );
m_documentManager = ((Kate::Application*)parent)->documentManager();
-// connect( m_documentManager, SIGNAL(documentCreated()),
-// this, SLOT(slotDocumentCreated()) );
- connect( m_documentManager, SIGNAL(documentDeleted(uint)),
- this, SLOT(slotDocumentDeleted(uint)) );
+// connect( m_documentManager, TQT_SIGNAL(documentCreated()),
+// this, TQT_SLOT(slotDocumentCreated()) );
+ connect( m_documentManager, TQT_SIGNAL(documentDeleted(uint)),
+ this, TQT_SLOT(slotDocumentDeleted(uint)) );
}
PluginKateXMLTools::~PluginKateXMLTools()
@@ -150,11 +150,11 @@ void PluginKateXMLTools::addView( Kate::MainWindow *win )
// TODO: doesn't this have to be deleted?
PluginView *view = new PluginView ();
( void) new KAction ( i18n("&Insert Element..."), CTRL+Key_Return, this,
- SLOT( slotInsertElement()), view->actionCollection(), "xml_tool_insert_element" );
+ TQT_SLOT( slotInsertElement()), view->actionCollection(), "xml_tool_insert_element" );
( void) new KAction ( i18n("&Close Element"), CTRL+Key_Less, this,
- SLOT( slotCloseElement()), view->actionCollection(), "xml_tool_close_element" );
+ TQT_SLOT( slotCloseElement()), view->actionCollection(), "xml_tool_close_element" );
( void) new KAction ( i18n("Assign Meta &DTD..." ), 0, this,
- SLOT( getDTD()), view->actionCollection(), "xml_tool_assign" );
+ TQT_SLOT( getDTD()), view->actionCollection(), "xml_tool_assign" );
view->setInstance( new KInstance("kate") );
view->setXMLFile( "plugins/katexmltools/ui.rc" );
@@ -187,14 +187,14 @@ void PluginKateXMLTools::slotDocumentDeleted( uint documentNumber )
kdDebug()<<"XMLTools:slotDocumentDeleted: documents: "<<m_docDtds.count()<<", DTDs: "<<m_dtds.count()<<endl;
PseudoDTD *dtd = m_docDtds.take( documentNumber );
- QIntDictIterator<PseudoDTD> it ( m_docDtds );
+ TQIntDictIterator<PseudoDTD> it ( m_docDtds );
for ( ; it.current(); ++it )
{
if ( it.current() == dtd )
return;
}
- QDictIterator<PseudoDTD> it1( m_dtds );
+ TQDictIterator<PseudoDTD> it1( m_dtds );
for ( ; it1.current() ; ++it1 )
{
if ( it1.current() == dtd )
@@ -239,10 +239,10 @@ void PluginKateXMLTools::backspacePressed()
void PluginKateXMLTools::emptyKeyEvent()
{
- keyEvent( 0, 0, QString::null );
+ keyEvent( 0, 0, TQString::null );
}
-void PluginKateXMLTools::keyEvent( int, int, const QString &/*s*/ )
+void PluginKateXMLTools::keyEvent( int, int, const TQString &/*s*/ )
{
//kdDebug() << "xml tools keyEvent: '" << s << endl;
@@ -262,16 +262,16 @@ void PluginKateXMLTools::keyEvent( int, int, const QString &/*s*/ )
return;
// debug to test speed:
- //QTime t; t.start();
+ //TQTime t; t.start();
- QStringList allowed = QStringList();
+ TQStringList allowed = TQStringList();
// get char on the left of the cursor:
uint line, col;
kv->cursorPositionReal( &line, &col );
- QString lineStr = kv->getDoc()->textLine( line );
- QString leftCh = lineStr.mid( col-1, 1 );
- QString secondLeftCh = lineStr.mid( col-2, 1 );
+ TQString lineStr = kv->getDoc()->textLine( line );
+ TQString leftCh = lineStr.mid( col-1, 1 );
+ TQString secondLeftCh = lineStr.mid( col-2, 1 );
if( leftCh == "&" )
{
@@ -282,7 +282,7 @@ void PluginKateXMLTools::keyEvent( int, int, const QString &/*s*/ )
else if( leftCh == "<" )
{
kdDebug() << "*outside tag -> get elements" << endl;
- QString parentElement = getParentElement( *kv, true );
+ TQString parentElement = getParentElement( *kv, true );
kdDebug() << "parent: " << parentElement << endl;
allowed = m_docDtds[docNumber]->allowedElements(parentElement );
m_mode = elements;
@@ -292,8 +292,8 @@ void PluginKateXMLTools::keyEvent( int, int, const QString &/*s*/ )
{
// TODO: check secondLeftChar, too?! then you don't need to trigger
// with space and we yet save CPU power
- QString currentElement = insideTag( *kv );
- QString currentAttribute;
+ TQString currentElement = insideTag( *kv );
+ TQString currentAttribute;
if( ! currentElement.isEmpty() )
currentAttribute = insideAttribute( *kv );
@@ -341,12 +341,12 @@ void PluginKateXMLTools::keyEvent( int, int, const QString &/*s*/ )
//}
}
-QValueList<KTextEditor::CompletionEntry>
-PluginKateXMLTools::stringListToCompletionEntryList( QStringList list )
+TQValueList<KTextEditor::CompletionEntry>
+PluginKateXMLTools::stringListToCompletionEntryList( TQStringList list )
{
- QValueList<KTextEditor::CompletionEntry> compList;
+ TQValueList<KTextEditor::CompletionEntry> compList;
KTextEditor::CompletionEntry entry;
- for( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ for( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
entry.text = ( *it );
compList << entry;
@@ -361,9 +361,9 @@ PluginKateXMLTools::stringListToCompletionEntryList( QStringList list )
*/
void PluginKateXMLTools::disconnectSlots( Kate::View *kv )
{
- disconnect( kv, SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,QString*)), this, 0 );
- disconnect( kv, SIGNAL(completionDone(KTextEditor::CompletionEntry)), this, 0 );
- disconnect( kv, SIGNAL(completionAborted()), this, 0 );
+ disconnect( kv, TQT_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,TQString*)), this, 0 );
+ disconnect( kv, TQT_SIGNAL(completionDone(KTextEditor::CompletionEntry)), this, 0 );
+ disconnect( kv, TQT_SIGNAL(completionAborted()), this, 0 );
}
/**
@@ -372,11 +372,11 @@ void PluginKateXMLTools::disconnectSlots( Kate::View *kv )
*/
void PluginKateXMLTools::connectSlots( Kate::View *kv )
{
- connect( kv, SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,QString*) ),
- this, SLOT(filterInsertString(KTextEditor::CompletionEntry*,QString*)) );
- connect( kv, SIGNAL(completionDone(KTextEditor::CompletionEntry) ),
- this, SLOT(completionDone(KTextEditor::CompletionEntry)) );
- connect( kv, SIGNAL(completionAborted()), this, SLOT(completionAborted()) );
+ connect( kv, TQT_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,TQString*) ),
+ this, TQT_SLOT(filterInsertString(KTextEditor::CompletionEntry*,TQString*)) );
+ connect( kv, TQT_SIGNAL(completionDone(KTextEditor::CompletionEntry) ),
+ this, TQT_SLOT(completionDone(KTextEditor::CompletionEntry)) );
+ connect( kv, TQT_SIGNAL(completionAborted()), this, TQT_SLOT(completionAborted()) );
}
/**
@@ -399,7 +399,7 @@ void PluginKateXMLTools::getDTD()
// Start where the supplied XML-DTDs are fed by default unless
// user changed directory last time:
- QString defaultDir = KGlobal::dirs()->findResourceDir("data", "katexmltools/" ) + "katexmltools/";
+ TQString defaultDir = KGlobal::dirs()->findResourceDir("data", "katexmltools/" ) + "katexmltools/";
if( m_urlString.isNull() ) {
m_urlString = defaultDir;
}
@@ -411,13 +411,13 @@ void PluginKateXMLTools::getDTD()
// Example syntax:
// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
uint checkMaxLines = 200;
- QString documentStart = kv->getDoc()->text(0, 0, checkMaxLines+1, 0 );
- QRegExp re( "<!DOCTYPE\\s+(.*)\\s+PUBLIC\\s+[\"'](.*)[\"']", false );
+ TQString documentStart = kv->getDoc()->text(0, 0, checkMaxLines+1, 0 );
+ TQRegExp re( "<!DOCTYPE\\s+(.*)\\s+PUBLIC\\s+[\"'](.*)[\"']", false );
re.setMinimal( true );
int matchPos = re.search( documentStart );
- QString filename;
- QString doctype;
- QString topElement;
+ TQString filename;
+ TQString doctype;
+ TQString topElement;
if( matchPos != -1 ) {
topElement = re.cap( 1 );
@@ -468,7 +468,7 @@ void PluginKateXMLTools::getDTD()
"as a document of type \"%1\". The meta DTD for this document type "
"will now be loaded.").arg( doctype ),
i18n( "Loading XML Meta DTD" ),
- QString::fromLatin1( "DTDAssigned") );
+ TQString::fromLatin1( "DTDAssigned") );
}
if( url.isEmpty() )
@@ -483,11 +483,11 @@ void PluginKateXMLTools::getDTD()
m_dtdString = "";
m_docToAssignTo = kv->document();
- QApplication::setOverrideCursor( KCursor::waitCursor() );
+ TQApplication::setOverrideCursor( KCursor::waitCursor() );
KIO::Job *job = KIO::get( url );
- connect( job, SIGNAL(result(KIO::Job *)), this, SLOT(slotFinished(KIO::Job *)) );
- connect( job, SIGNAL(data(KIO::Job *, const QByteArray &)),
- this, SLOT(slotData(KIO::Job *, const QByteArray &)) );
+ connect( job, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotFinished(KIO::Job *)) );
+ connect( job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)),
+ this, TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)) );
}
kdDebug()<<"XMLTools::getDTD: Documents: "<<m_docDtds.count()<<", DTDs: "<<m_dtds.count()<<endl;
}
@@ -518,23 +518,23 @@ void PluginKateXMLTools::slotFinished( KIO::Job *job )
m_docToAssignTo = 0;
m_dtdString = "";
}
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
-void PluginKateXMLTools::slotData( KIO::Job *, const QByteArray &data )
+void PluginKateXMLTools::slotData( KIO::Job *, const TQByteArray &data )
{
- m_dtdString += QString( data );
+ m_dtdString += TQString( data );
}
void PluginKateXMLTools::assignDTD( PseudoDTD *dtd, KTextEditor::Document *doc )
{
m_docDtds.replace( doc->documentNumber(), dtd );
- connect( doc, SIGNAL(charactersInteractivelyInserted(int,int,const QString&) ),
- this, SLOT(keyEvent(int,int,const QString&)) );
+ connect( doc, TQT_SIGNAL(charactersInteractivelyInserted(int,int,const TQString&) ),
+ this, TQT_SLOT(keyEvent(int,int,const TQString&)) );
- disconnect( doc, SIGNAL(backspacePressed()), this, 0 );
- connect( doc, SIGNAL(backspacePressed() ),
- this, SLOT(backspacePressed()) );
+ disconnect( doc, TQT_SIGNAL(backspacePressed()), this, 0 );
+ connect( doc, TQT_SIGNAL(backspacePressed() ),
+ this, TQT_SLOT(backspacePressed()) );
}
/**
@@ -555,22 +555,22 @@ void PluginKateXMLTools::slotInsertElement()
}
PseudoDTD *dtd = m_docDtds[kv->document()->documentNumber()];
- QString parentElement = getParentElement( *kv, false );
- QStringList allowed;
+ TQString parentElement = getParentElement( *kv, false );
+ TQStringList allowed;
if( dtd )
allowed = dtd->allowedElements(parentElement );
InsertElement *dialog = new InsertElement(
- ( QWidget *)application()->activeMainWindow()->viewManager()->activeView(), "insertXml" );
- QString text = dialog->showDialog( allowed );
+ ( TQWidget *)application()->activeMainWindow()->viewManager()->activeView(), "insertXml" );
+ TQString text = dialog->showDialog( allowed );
delete dialog;
if( !text.isEmpty() )
{
- QStringList list = QStringList::split( ' ', text );
- QString pre;
- QString post;
+ TQStringList list = TQStringList::split( ' ', text );
+ TQString pre;
+ TQString post;
// anders: use <tagname/> if the tag is required to be empty.
// In that case maybe we should not remove the selection? or overwrite it?
int adjust = 0; // how much to move cursor.
@@ -591,7 +591,7 @@ void PluginKateXMLTools::slotInsertElement()
post ="</" + list[0] + ">";
}
- QString marked;
+ TQString marked;
if ( ! post.isEmpty() )
marked = kv->getDoc()->selection();
@@ -616,16 +616,16 @@ void PluginKateXMLTools::slotCloseElement()
kdDebug() << "Warning: no Kate::View" << endl;
return;
}
- QString parentElement = getParentElement( *kv, false );
+ TQString parentElement = getParentElement( *kv, false );
//kdDebug() << "parentElement: '" << parentElement << "'" << endl;
- QString closeTag = "</" + parentElement + ">";
+ TQString closeTag = "</" + parentElement + ">";
if( ! parentElement.isEmpty() )
kv->insertText( closeTag );
}
// modify the completion string before it gets inserted
-void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, QString *text )
+void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, TQString *text )
{
kdDebug() << "filterInsertString str: " << *text << endl;
kdDebug() << "filterInsertString text: " << ce->text << endl;
@@ -642,9 +642,9 @@ void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, Q
uint line, col;
kv->cursorPositionReal( &line, &col );
- QString lineStr = kv->getDoc()->textLine(line );
- QString leftCh = lineStr.mid( col-1, 1 );
- QString rightCh = lineStr.mid( col, 1 );
+ TQString lineStr = kv->getDoc()->textLine(line );
+ TQString leftCh = lineStr.mid( col-1, 1 );
+ TQString rightCh = lineStr.mid( col, 1 );
m_correctPos = 0; // where to move the cursor after completion ( >0 = move right )
if( m_mode == entities )
@@ -677,7 +677,7 @@ void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, Q
// find left quote:
for( startAttValue = col; startAttValue > 0; startAttValue-- )
{
- QString ch = lineStr.mid( startAttValue-1, 1 );
+ TQString ch = lineStr.mid( startAttValue-1, 1 );
if( isQuote(ch) )
break;
}
@@ -685,7 +685,7 @@ void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, Q
// find right quote:
for( endAttValue = col; endAttValue <= lineStr.length(); endAttValue++ )
{
- QString ch = lineStr.mid( endAttValue-1, 1 );
+ TQString ch = lineStr.mid( endAttValue-1, 1 );
if( isQuote(ch) )
break;
}
@@ -706,7 +706,7 @@ void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, Q
else if( m_mode == elements )
{
// anders: if the tag is marked EMPTY, insert in form <tagname/>
- QString str;
+ TQString str;
int docNumber = kv->document()->documentNumber();
bool isEmptyTag =m_docDtds[docNumber]->allowedElements(ce->text).contains( "__EMPTY" );
if ( isEmptyTag )
@@ -782,7 +782,7 @@ void PluginKateXMLTools::completionDone( KTextEditor::CompletionEntry )
if( m_mode == attributes )
{
// immediately show attribute values:
- QTimer::singleShot( 10, this, SLOT(emptyKeyEvent()) );
+ TQTimer::singleShot( 10, this, TQT_SLOT(emptyKeyEvent()) );
}
}
@@ -795,23 +795,23 @@ void PluginKateXMLTools::completionDone( KTextEditor::CompletionEntry )
* if "<" occurs before ">" occurs ( on the left side of the cursor ).
* Return the tag name, return "" if we cursor is outside a tag.
*/
-QString PluginKateXMLTools::insideTag( Kate::View &kv )
+TQString PluginKateXMLTools::insideTag( Kate::View &kv )
{
uint line = 0, col = 0;
kv.cursorPositionReal( &line, &col );
int y = line; // another variable because uint <-> int
do {
- QString lineStr = kv.getDoc()->textLine(y );
+ TQString lineStr = kv.getDoc()->textLine(y );
for( uint x = col; x > 0; x-- )
{
- QString ch = lineStr.mid( x-1, 1 );
+ TQString ch = lineStr.mid( x-1, 1 );
if( ch == ">" ) // cursor is outside tag
return "";
if( ch == "<" )
{
- QString tag;
+ TQString tag;
// look for white space on the right to get the tag name
for( uint z = x; z <= lineStr.length() ; z++ )
{
@@ -846,21 +846,21 @@ QString PluginKateXMLTools::insideTag( Kate::View &kv )
* Note: only call when insideTag() == true.
* TODO: allow whitespace around "="
*/
-QString PluginKateXMLTools::insideAttribute( Kate::View &kv )
+TQString PluginKateXMLTools::insideAttribute( Kate::View &kv )
{
uint line = 0, col = 0;
kv.cursorPositionReal( &line, &col );
int y = line; // another variable because uint <-> int
uint x = 0;
- QString lineStr = "";
- QString ch = "";
+ TQString lineStr = "";
+ TQString ch = "";
do {
lineStr = kv.getDoc()->textLine(y );
for( x = col; x > 0; x-- )
{
ch = lineStr.mid( x-1, 1 );
- QString chLeft = lineStr.mid( x-2, 1 );
+ TQString chLeft = lineStr.mid( x-2, 1 );
// TODO: allow whitespace
if( isQuote(ch) && chLeft == "=" )
break;
@@ -874,7 +874,7 @@ QString PluginKateXMLTools::insideAttribute( Kate::View &kv )
} while( !isQuote(ch) );
// look for next white space on the left to get the tag name
- QString attr = "";
+ TQString attr = "";
for( int z = x; z >= 0; z-- )
{
ch = lineStr.mid( z-1, 1 );
@@ -904,7 +904,7 @@ QString PluginKateXMLTools::insideAttribute( Kate::View &kv )
* <p> foo <img/> bar X
* <p> foo bar X
*/
-QString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleChar )
+TQString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleChar )
{
enum {
parsingText,
@@ -921,7 +921,7 @@ QString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleC
uint line, col;
kv.cursorPositionReal( &line, &col );
- QString str = kv.getDoc()->textLine(line );
+ TQString str = kv.getDoc()->textLine(line );
while( true )
{
@@ -930,7 +930,7 @@ QString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleC
{
do
{
- if( !line-- ) return QString::null; // reached start of document
+ if( !line-- ) return TQString::null; // reached start of document
str = kv.getDoc()->textLine(line );
col = str.length();
} while( !col );
@@ -950,7 +950,7 @@ QString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleC
{
case '<':
// hmm... we were actually inside an element
- return QString::null;
+ return TQString::null;
case '>':
// we just hit an element boundary
@@ -979,7 +979,7 @@ QString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleC
// we just hit the start of the element...
if( nestingLevel-- ) break;
- QString tag = str.mid( col + 1 );
+ TQString tag = str.mid( col + 1 );
for( uint pos = 0, len = tag.length(); pos < len; ++pos ) {
ch = tag.at( pos).unicode();
if( ch == ' ' || ch == '\t' || ch == '>' ) {
@@ -1036,7 +1036,7 @@ QString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingleC
* Return true if the tag is neither a closing tag
* nor an empty tag, nor a comment, nor processing instruction.
*/
-bool PluginKateXMLTools::isOpeningTag( QString tag )
+bool PluginKateXMLTools::isOpeningTag( TQString tag )
{
return ( !isClosingTag(tag) && !isEmptyTag(tag ) &&
!tag.startsWith( "<?") && !tag.startsWith("<!") );
@@ -1046,12 +1046,12 @@ bool PluginKateXMLTools::isOpeningTag( QString tag )
* Return true if the tag is a closing tag. Return false
* if the tag is an opening tag or an empty tag ( ! )
*/
-bool PluginKateXMLTools::isClosingTag( QString tag )
+bool PluginKateXMLTools::isClosingTag( TQString tag )
{
return ( tag.startsWith("</") );
}
-bool PluginKateXMLTools::isEmptyTag( QString tag )
+bool PluginKateXMLTools::isEmptyTag( TQString tag )
{
return ( tag.right(2) == "/>" );
}
@@ -1059,7 +1059,7 @@ bool PluginKateXMLTools::isEmptyTag( QString tag )
/**
* Return true if ch is a single or double quote. Expects ch to be of length 1.
*/
-bool PluginKateXMLTools::isQuote( QString ch )
+bool PluginKateXMLTools::isQuote( TQString ch )
{
return ( ch == "\"" || ch == "'" );
}
@@ -1068,14 +1068,14 @@ bool PluginKateXMLTools::isQuote( QString ch )
// ========================================================================
// Tools:
-/** Sort a QStringList case-insensitively. Static. TODO: make it more simple. */
-QStringList PluginKateXMLTools::sortQStringList( QStringList list ) {
+/** Sort a TQStringList case-insensitively. Static. TODO: make it more simple. */
+TQStringList PluginKateXMLTools::sortQStringList( TQStringList list ) {
// Sort list case-insensitive. This looks complicated but using a QMap
// is even suggested by the Qt documentation.
- QMap<QString,QString> mapList;
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ TQMap<TQString,TQString> mapList;
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
- QString str = *it;
+ TQString str = *it;
if( mapList.contains(str.lower()) )
{
// do not override a previous value, e.g. "Auml" and "auml" are two different
@@ -1089,7 +1089,7 @@ QStringList PluginKateXMLTools::sortQStringList( QStringList list ) {
}
list.clear();
- QMap<QString,QString>::Iterator it;
+ TQMap<TQString,TQString>::Iterator it;
// Qt doc: "the items are alphabetically sorted [by key] when iterating over the map":
for( it = mapList.begin(); it != mapList.end(); ++it )
@@ -1099,7 +1099,7 @@ QStringList PluginKateXMLTools::sortQStringList( QStringList list ) {
}
//BEGIN InsertElement dialog
-InsertElement::InsertElement( QWidget *parent, const char *name )
+InsertElement::InsertElement( TQWidget *parent, const char *name )
:KDialogBase( parent, name, true, i18n("Insert XML Element" ),
KDialogBase::Ok|KDialogBase::Cancel)
{
@@ -1109,23 +1109,23 @@ InsertElement::~InsertElement()
{
}
-void InsertElement::slotHistoryTextChanged( const QString& text )
+void InsertElement::slotHistoryTextChanged( const TQString& text )
{
enableButtonOK( !text.isEmpty() );
}
-QString InsertElement::showDialog( QStringList &completions )
+TQString InsertElement::showDialog( TQStringList &completions )
{
- QWidget *page = new QWidget( this );
+ TQWidget *page = new TQWidget( this );
setMainWidget( page );
- QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() );
KHistoryCombo *combo = new KHistoryCombo( page, "value" );
combo->setHistoryItems( completions, true );
- connect( combo->lineEdit(), SIGNAL(textChanged ( const QString & )),
- this, SLOT(slotHistoryTextChanged(const QString &)) );
- QString text = i18n( "Enter XML tag name and attributes (\"<\", \">\" and closing tag will be supplied):" );
- QLabel *label = new QLabel( text, page, "insert" );
+ connect( combo->lineEdit(), TQT_SIGNAL(textChanged ( const TQString & )),
+ this, TQT_SLOT(slotHistoryTextChanged(const TQString &)) );
+ TQString text = i18n( "Enter XML tag name and attributes (\"<\", \">\" and closing tag will be supplied):" );
+ TQLabel *label = new TQLabel( text, page, "insert" );
topLayout->addWidget( label );
topLayout->addWidget( combo );
@@ -1135,7 +1135,7 @@ QString InsertElement::showDialog( QStringList &completions )
if( exec() )
return combo->currentText();
- return QString::null;
+ return TQString::null;
}
//END InsertElement dialog
// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;