summaryrefslogtreecommitdiffstats
path: root/kate/xmltools
diff options
context:
space:
mode:
Diffstat (limited to 'kate/xmltools')
-rw-r--r--kate/xmltools/plugin_katexmltools.cpp236
-rw-r--r--kate/xmltools/plugin_katexmltools.h56
-rw-r--r--kate/xmltools/pseudo_dtd.cpp158
-rw-r--r--kate/xmltools/pseudo_dtd.h36
4 files changed, 243 insertions, 243 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;
diff --git a/kate/xmltools/plugin_katexmltools.h b/kate/xmltools/plugin_katexmltools.h
index 9be61c7..843ab15 100644
--- a/kate/xmltools/plugin_katexmltools.h
+++ b/kate/xmltools/plugin_katexmltools.h
@@ -25,11 +25,11 @@
#include "pseudo_dtd.h"
-#include <qdict.h>
-#include <qstring.h>
-#include <qlistbox.h>
-#include <qprogressdialog.h>
-#include <qintdict.h>
+#include <tqdict.h>
+#include <tqstring.h>
+#include <tqlistbox.h>
+#include <tqprogressdialog.h>
+#include <tqintdict.h>
#include <kate/plugin.h>
#include <kate/application.h>
@@ -52,7 +52,7 @@ class PluginKateXMLTools : public Kate::Plugin, Kate::PluginViewInterface
public:
- PluginKateXMLTools( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() );
+ PluginKateXMLTools( TQObject* parent = 0, const char* name = 0, const TQStringList& = TQStringList() );
virtual ~PluginKateXMLTools();
void addView ( Kate::MainWindow *win );
void removeView( Kate::MainWindow *win );
@@ -64,52 +64,52 @@ class PluginKateXMLTools : public Kate::Plugin, Kate::PluginViewInterface
void slotInsertElement();
void slotCloseElement();
- void filterInsertString( KTextEditor::CompletionEntry *ce, QString *str );
+ void filterInsertString( KTextEditor::CompletionEntry *ce, TQString *str );
void completionDone( KTextEditor::CompletionEntry completionEntry );
void completionAborted();
void slotFinished( KIO::Job *job );
- void slotData( KIO::Job *, const QByteArray &data );
+ void slotData( KIO::Job *, const TQByteArray &data );
void backspacePressed();
void emptyKeyEvent();
- void keyEvent( int, int, const QString & );
+ void keyEvent( int, int, const TQString & );
/// Connected to the document manager, to manage the dtd collection.
void slotDocumentDeleted( uint n );
protected:
- static QStringList sortQStringList( QStringList list );
- //bool eventFilter( QObject *object, QEvent *event );
+ static TQStringList sortQStringList( TQStringList list );
+ //bool eventFilter( TQObject *object, TQEvent *event );
- QString insideTag( Kate::View &kv );
- QString insideAttribute( Kate::View &kv );
+ TQString insideTag( Kate::View &kv );
+ TQString insideAttribute( Kate::View &kv );
- bool isOpeningTag( QString tag );
- bool isClosingTag( QString tag );
- bool isEmptyTag( QString tag );
- bool isQuote( QString ch );
+ bool isOpeningTag( TQString tag );
+ bool isClosingTag( TQString tag );
+ bool isEmptyTag( TQString tag );
+ bool isQuote( TQString ch );
- QString getParentElement( Kate::View &view, bool ignoreSingleBracket );
+ TQString getParentElement( Kate::View &view, bool ignoreSingleBracket );
enum Mode {none, entities, attributevalues, attributes, elements};
enum PopupMode {noPopup, tagname, attributename, attributevalue, entityname};
- QValueList<KTextEditor::CompletionEntry> stringListToCompletionEntryList( QStringList list );
+ TQValueList<KTextEditor::CompletionEntry> stringListToCompletionEntryList( TQStringList list );
/// Assign the PseudoDTD @p dtd to the Kate::Document @p doc
void assignDTD( PseudoDTD *dtd, KTextEditor::Document *doc );
/// temporary placeholder for the metaDTD file
- QString m_dtdString;
+ TQString m_dtdString;
/// temporary placeholder for the document to assign a DTD to while the file is loaded
KTextEditor::Document *m_docToAssignTo;
/// URL of the last loaded meta DTD
- QString m_urlString;
+ TQString m_urlString;
uint m_lastLine, m_lastCol;
- QStringList m_lastAllowed;
+ TQStringList m_lastAllowed;
int m_popupOpenCol;
Mode m_mode;
@@ -119,12 +119,12 @@ class PluginKateXMLTools : public Kate::Plugin, Kate::PluginViewInterface
KTextEditor::CodeCompletionInterface* m_codeInterface;
/// maps KTE::Document::docNumber -> DTD
- QIntDict<PseudoDTD> m_docDtds;
+ TQIntDict<PseudoDTD> m_docDtds;
/// maps DTD filename -> DTD
- QDict<PseudoDTD> m_dtds;
+ TQDict<PseudoDTD> m_dtds;
- QPtrList<class PluginView> m_views;
+ TQPtrList<class PluginView> m_views;
void connectSlots( Kate::View *kv );
void disconnectSlots( Kate::View *kv );
@@ -138,11 +138,11 @@ class InsertElement : public KDialogBase
Q_OBJECT
public:
- InsertElement( QWidget *parent, const char *name );
+ InsertElement( TQWidget *parent, const char *name );
~InsertElement();
- QString showDialog( QStringList &completions );
+ TQString showDialog( TQStringList &completions );
private slots:
- void slotHistoryTextChanged( const QString& );
+ void slotHistoryTextChanged( const TQString& );
};
diff --git a/kate/xmltools/pseudo_dtd.cpp b/kate/xmltools/pseudo_dtd.cpp
index b5c9cd1..05ac58a 100644
--- a/kate/xmltools/pseudo_dtd.cpp
+++ b/kate/xmltools/pseudo_dtd.cpp
@@ -24,8 +24,8 @@
#include <assert.h>
-#include <qdom.h>
-#include <qregexp.h>
+#include <tqdom.h>
+#include <tqregexp.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -40,9 +40,9 @@ PseudoDTD::~PseudoDTD()
{
}
-void PseudoDTD::analyzeDTD( QString &metaDtdUrl, QString &metaDtd )
+void PseudoDTD::analyzeDTD( TQString &metaDtdUrl, TQString &metaDtd )
{
- QDomDocument doc( "dtdIn_xml" );
+ TQDomDocument doc( "dtdIn_xml" );
if ( ! doc.setContent( metaDtd) )
{
KMessageBox::error(0, i18n("The file '%1' could not be parsed. "
@@ -68,7 +68,7 @@ void PseudoDTD::analyzeDTD( QString &metaDtdUrl, QString &metaDtd )
// count this twice, as it will be iterated twice ( TODO: optimize that? ):
listLength += doc.elementsByTagName( "attlist" ).count() * 2;
- QProgressDialog progress( i18n("Analyzing meta DTD..."), i18n("Cancel"), listLength,
+ TQProgressDialog progress( i18n("Analyzing meta DTD..."), i18n("Cancel"), listLength,
0, "progress", TRUE );
progress.setMinimumDuration( 400 );
progress.setProgress(0);
@@ -97,16 +97,16 @@ void PseudoDTD::analyzeDTD( QString &metaDtdUrl, QString &metaDtd )
* Iterate through the XML to get a mapping which sub-elements are allowed for
* all elements.
*/
-bool PseudoDTD::parseElements( QDomDocument *doc, QProgressDialog *progress )
+bool PseudoDTD::parseElements( TQDomDocument *doc, TQProgressDialog *progress )
{
m_elementsList.clear();
// We only display a list, i.e. we pretend that the content model is just
// a set, so we use a map. This is necessay e.g. for xhtml 1.0's head element,
// which would otherwise display some elements twice.
- QMap<QString,bool> subelementList; // the bool is not used
+ TQMap<TQString,bool> subelementList; // the bool is not used
- QDomNodeList list = doc->elementsByTagName( "element" );
+ TQDomNodeList list = doc->elementsByTagName( "element" );
uint listLength = list.count(); // speedup (really! )
for( uint i = 0; i < listLength; i++ )
@@ -119,57 +119,57 @@ bool PseudoDTD::parseElements( QDomDocument *doc, QProgressDialog *progress )
//qApp->processEvents();
subelementList.clear();
- QDomNode node = list.item( i );
- QDomElement elem = node.toElement();
+ TQDomNode node = list.item( i );
+ TQDomElement elem = node.toElement();
if( !elem.isNull() )
{
// Enter the expanded content model, which may also include stuff not allowed.
// We do not care if it's a <sequence-group> or whatever.
- QDomNodeList contentModelList = elem.elementsByTagName( "content-model-expanded" );
- QDomNode contentModelNode = contentModelList.item(0);
- QDomElement contentModelElem = contentModelNode.toElement();
+ TQDomNodeList contentModelList = elem.elementsByTagName( "content-model-expanded" );
+ TQDomNode contentModelNode = contentModelList.item(0);
+ TQDomElement contentModelElem = contentModelNode.toElement();
if( ! contentModelElem.isNull() )
{
// check for <pcdata/>:
- QDomNodeList pcdataList = contentModelElem.elementsByTagName( "pcdata" );
+ TQDomNodeList pcdataList = contentModelElem.elementsByTagName( "pcdata" );
// check for other sub elements:
- QDomNodeList subList = contentModelElem.elementsByTagName( "element-name" );
+ TQDomNodeList subList = contentModelElem.elementsByTagName( "element-name" );
uint subListLength = subList.count();
for( uint l = 0; l < subListLength; l++ )
{
- QDomNode subNode = subList.item(l);
- QDomElement subElem = subNode.toElement();
+ TQDomNode subNode = subList.item(l);
+ TQDomElement subElem = subNode.toElement();
if( !subElem.isNull() )
subelementList[subElem.attribute( "name" )] = true;
}
// anders: check if this is an EMPTY element, and put "__EMPTY" in the
// sub list, so that we can insert tags in empty form if required.
- QDomNodeList emptyList = elem.elementsByTagName( "empty" );
+ TQDomNodeList emptyList = elem.elementsByTagName( "empty" );
if ( emptyList.count() )
subelementList["__EMPTY"] = true;
}
// Now remove the elements not allowed (e.g. <a> is explicitely not allowed in <a>
// in the HTML 4.01 Strict DTD):
- QDomNodeList exclusionsList = elem.elementsByTagName( "exclusions" );
+ TQDomNodeList exclusionsList = elem.elementsByTagName( "exclusions" );
if( exclusionsList.length() > 0 )
{ // sometimes there are no exclusions ( e.g. in XML DTDs there are never exclusions )
- QDomNode exclusionsNode = exclusionsList.item(0);
- QDomElement exclusionsElem = exclusionsNode.toElement();
+ TQDomNode exclusionsNode = exclusionsList.item(0);
+ TQDomElement exclusionsElem = exclusionsNode.toElement();
if( ! exclusionsElem.isNull() )
{
- QDomNodeList subList = exclusionsElem.elementsByTagName( "element-name" );
+ TQDomNodeList subList = exclusionsElem.elementsByTagName( "element-name" );
uint subListLength = subList.count();
for( uint l = 0; l < subListLength; l++ )
{
- QDomNode subNode = subList.item(l);
- QDomElement subElem = subNode.toElement();
+ TQDomNode subNode = subList.item(l);
+ TQDomElement subElem = subNode.toElement();
if( !subElem.isNull() )
{
- QMap<QString,bool>::Iterator it = subelementList.find( subElem.attribute( "name" ) );
+ TQMap<TQString,bool>::Iterator it = subelementList.find( subElem.attribute( "name" ) );
if( it != subelementList.end() )
subelementList.remove(it);
}
@@ -178,8 +178,8 @@ bool PseudoDTD::parseElements( QDomDocument *doc, QProgressDialog *progress )
}
// turn the map into a list:
- QStringList subelementListTmp;
- QMap<QString,bool>::Iterator it;
+ TQStringList subelementListTmp;
+ TQMap<TQString,bool>::Iterator it;
for( it = subelementList.begin(); it != subelementList.end(); ++it )
subelementListTmp.append( it.key() );
@@ -196,12 +196,12 @@ bool PseudoDTD::parseElements( QDomDocument *doc, QProgressDialog *progress )
* a list of allowed elements, but it doesn't care about order or if only a certain
* number of occurences is allowed.
*/
-QStringList PseudoDTD::allowedElements( QString parentElement )
+TQStringList PseudoDTD::allowedElements( TQString parentElement )
{
if( m_sgmlSupport )
{
// find the matching element, ignoring case:
- QMap<QString,QStringList>::Iterator it;
+ TQMap<TQString,TQStringList>::Iterator it;
for( it = m_elementsList.begin(); it != m_elementsList.end(); ++it )
{
if( it.key().lower() == parentElement.lower() )
@@ -211,18 +211,18 @@ QStringList PseudoDTD::allowedElements( QString parentElement )
else if( m_elementsList.contains(parentElement) )
return m_elementsList[parentElement];
- return QStringList();
+ return TQStringList();
}
/**
* Iterate through the XML to get a mapping which attributes are allowed inside
* all elements.
*/
-bool PseudoDTD::parseAttributes( QDomDocument *doc, QProgressDialog *progress )
+bool PseudoDTD::parseAttributes( TQDomDocument *doc, TQProgressDialog *progress )
{
m_attributesList.clear();
-// QStringList allowedAttributes;
- QDomNodeList list = doc->elementsByTagName( "attlist" );
+// TQStringList allowedAttributes;
+ TQDomNodeList list = doc->elementsByTagName( "attlist" );
uint listLength = list.count();
for( uint i = 0; i < listLength; i++ )
@@ -235,16 +235,16 @@ bool PseudoDTD::parseAttributes( QDomDocument *doc, QProgressDialog *progress )
//qApp->processEvents();
ElementAttributes attrs;
- QDomNode node = list.item(i);
- QDomElement elem = node.toElement();
+ TQDomNode node = list.item(i);
+ TQDomElement elem = node.toElement();
if( !elem.isNull() )
{
- QDomNodeList attributeList = elem.elementsByTagName( "attribute" );
+ TQDomNodeList attributeList = elem.elementsByTagName( "attribute" );
uint attributeListLength = attributeList.count();
for( uint l = 0; l < attributeListLength; l++ )
{
- QDomNode attributeNode = attributeList.item(l);
- QDomElement attributeElem = attributeNode.toElement();
+ TQDomNode attributeNode = attributeList.item(l);
+ TQDomElement attributeElem = attributeNode.toElement();
if( ! attributeElem.isNull() )
{
@@ -263,12 +263,12 @@ bool PseudoDTD::parseAttributes( QDomDocument *doc, QProgressDialog *progress )
/** Check which attributes are allowed for an element.
*/
-QStringList PseudoDTD::allowedAttributes( QString element )
+TQStringList PseudoDTD::allowedAttributes( TQString element )
{
if( m_sgmlSupport )
{
// find the matching element, ignoring case:
- QMap<QString,ElementAttributes>::Iterator it;
+ TQMap<TQString,ElementAttributes>::Iterator it;
for( it = m_attributesList.begin(); it != m_attributesList.end(); ++it ) {
if( it.key().lower() == element.lower() ) {
return it.data().optionalAttributes + it.data().requiredAttributes;
@@ -278,14 +278,14 @@ QStringList PseudoDTD::allowedAttributes( QString element )
else if( m_attributesList.contains(element) )
return m_attributesList[element].optionalAttributes + m_attributesList[element].requiredAttributes;
- return QStringList();
+ return TQStringList();
}
-QStringList PseudoDTD::requiredAttributes( const QString &element ) const
+TQStringList PseudoDTD::requiredAttributes( const TQString &element ) const
{
if ( m_sgmlSupport )
{
- QMap<QString,ElementAttributes>::ConstIterator it;
+ TQMap<TQString,ElementAttributes>::ConstIterator it;
for( it = m_attributesList.begin(); it != m_attributesList.end(); ++it )
{
if( it.key().lower() == element.lower() )
@@ -295,18 +295,18 @@ QStringList PseudoDTD::requiredAttributes( const QString &element ) const
else if( m_attributesList.contains(element) )
return m_attributesList[element].requiredAttributes;
- return QStringList();
+ return TQStringList();
}
/**
* Iterate through the XML to get a mapping which attribute values are allowed
* for all attributes inside all elements.
*/
-bool PseudoDTD::parseAttributeValues( QDomDocument *doc, QProgressDialog *progress )
+bool PseudoDTD::parseAttributeValues( TQDomDocument *doc, TQProgressDialog *progress )
{
m_attributevaluesList.clear(); // 1 element : n possible attributes
- QMap<QString,QStringList> attributevaluesTmp; // 1 attribute : n possible values
- QDomNodeList list = doc->elementsByTagName( "attlist" );
+ TQMap<TQString,TQStringList> attributevaluesTmp; // 1 attribute : n possible values
+ TQDomNodeList list = doc->elementsByTagName( "attlist" );
uint listLength = list.count();
for( uint i = 0; i < listLength; i++ )
@@ -319,21 +319,21 @@ bool PseudoDTD::parseAttributeValues( QDomDocument *doc, QProgressDialog *progre
//qApp->processEvents();
attributevaluesTmp.clear();
- QDomNode node = list.item(i);
- QDomElement elem = node.toElement();
+ TQDomNode node = list.item(i);
+ TQDomElement elem = node.toElement();
if( !elem.isNull() )
{
// Enter the list of <attribute>:
- QDomNodeList attributeList = elem.elementsByTagName( "attribute" );
+ TQDomNodeList attributeList = elem.elementsByTagName( "attribute" );
uint attributeListLength = attributeList.count();
for( uint l = 0; l < attributeListLength; l++ )
{
- QDomNode attributeNode = attributeList.item(l);
- QDomElement attributeElem = attributeNode.toElement();
+ TQDomNode attributeNode = attributeList.item(l);
+ TQDomElement attributeElem = attributeNode.toElement();
if( ! attributeElem.isNull() )
{
- QString value = attributeElem.attribute( "value" );
- attributevaluesTmp.insert( attributeElem.attribute("name"), QStringList::split(QRegExp(" "), value) );
+ TQString value = attributeElem.attribute( "value" );
+ attributevaluesTmp.insert( attributeElem.attribute("name"), TQStringList::split(TQRegExp(" "), value) );
}
}
m_attributevaluesList.insert( elem.attribute("name"), attributevaluesTmp );
@@ -347,19 +347,19 @@ bool PseudoDTD::parseAttributeValues( QDomDocument *doc, QProgressDialog *progre
* (the element is necessary because e.g. "href" inside <a> could be different
* to an "href" inside <link>):
*/
-QStringList PseudoDTD::attributeValues( QString element, QString attribute )
+TQStringList PseudoDTD::attributeValues( TQString element, TQString attribute )
{
// Direct access would be faster than iteration of course but not always correct,
// because we need to be case-insensitive.
if( m_sgmlSupport ) {
// first find the matching element, ignoring case:
- QMap< QString,QMap<QString,QStringList> >::Iterator it;
+ TQMap< TQString,TQMap<TQString,TQStringList> >::Iterator it;
for( it = m_attributevaluesList.begin(); it != m_attributevaluesList.end(); ++it )
{
if( it.key().lower() == element.lower() )
{
- QMap<QString,QStringList> attrVals = it.data();
- QMap<QString,QStringList>::Iterator itV;
+ TQMap<TQString,TQStringList> attrVals = it.data();
+ TQMap<TQString,TQStringList>::Iterator itV;
// then find the matching attribute for that element, ignoring case:
for( itV = attrVals.begin(); itV != attrVals.end(); ++itV )
{
@@ -371,23 +371,23 @@ QStringList PseudoDTD::attributeValues( QString element, QString attribute )
}
else if( m_attributevaluesList.contains(element) )
{
- QMap<QString,QStringList> attrVals = m_attributevaluesList[element];
+ TQMap<TQString,TQStringList> attrVals = m_attributevaluesList[element];
if( attrVals.contains(attribute) )
return attrVals[attribute];
}
// no predefined values available:
- return QStringList();
+ return TQStringList();
}
/**
* Iterate through the XML to get a mapping of all entity names and their expanded
* version, e.g. nbsp => &#160;. Parameter entities are ignored.
*/
-bool PseudoDTD::parseEntities( QDomDocument *doc, QProgressDialog *progress )
+bool PseudoDTD::parseEntities( TQDomDocument *doc, TQProgressDialog *progress )
{
m_entityList.clear();
- QDomNodeList list = doc->elementsByTagName( "entity" );
+ TQDomNodeList list = doc->elementsByTagName( "entity" );
uint listLength = list.count();
for( uint i = 0; i < listLength; i++ )
@@ -398,36 +398,36 @@ bool PseudoDTD::parseEntities( QDomDocument *doc, QProgressDialog *progress )
progress->setProgress( progress->progress()+1 );
//FIXME!!
//qApp->processEvents();
- QDomNode node = list.item(i);
- QDomElement elem = node.toElement();
+ TQDomNode node = list.item(i);
+ TQDomElement elem = node.toElement();
if( !elem.isNull()
&& elem.attribute( "type" ) != "param" )
{ // TODO: what's cdata <-> gen ?
- QDomNodeList expandedList = elem.elementsByTagName( "text-expanded" );
- QDomNode expandedNode = expandedList.item(0);
- QDomElement expandedElem = expandedNode.toElement();
+ TQDomNodeList expandedList = elem.elementsByTagName( "text-expanded" );
+ TQDomNode expandedNode = expandedList.item(0);
+ TQDomElement expandedElem = expandedNode.toElement();
if( ! expandedElem.isNull() )
{
- QString exp = expandedElem.text();
+ TQString exp = expandedElem.text();
// TODO: support more than one &#...; in the expanded text
/* TODO include do this when the unicode font problem is solved:
- if( exp.contains(QRegExp("^&#x[a-zA-Z0-9]+;$")) ) {
+ if( exp.contains(TQRegExp("^&#x[a-zA-Z0-9]+;$")) ) {
// hexadecimal numbers, e.g. "&#x236;"
uint end = exp.find( ";" );
exp = exp.mid( 3, end-3 );
- exp = QChar();
- } else if( exp.contains(QRegExp("^&#[0-9]+;$")) ) {
+ exp = TQChar();
+ } else if( exp.contains(TQRegExp("^&#[0-9]+;$")) ) {
// decimal numbers, e.g. "&#236;"
uint end = exp.find( ";" );
exp = exp.mid( 2, end-2 );
- exp = QChar( exp.toInt() );
+ exp = TQChar( exp.toInt() );
}
*/
m_entityList.insert( elem.attribute("name"), exp );
}
else
{
- m_entityList.insert( elem.attribute("name"), QString() );
+ m_entityList.insert( elem.attribute("name"), TQString() );
}
}
}
@@ -437,21 +437,21 @@ bool PseudoDTD::parseEntities( QDomDocument *doc, QProgressDialog *progress )
/**
* Get a list of all ( non-parameter ) entities that start with a certain string.
*/
-QStringList PseudoDTD::entities( QString start )
+TQStringList PseudoDTD::entities( TQString start )
{
- QStringList entities;
- QMap<QString,QString>::Iterator it;
+ TQStringList entities;
+ TQMap<TQString,TQString>::Iterator it;
for( it = m_entityList.begin(); it != m_entityList.end(); ++it ) {
if( (*it).startsWith(start) )
{
- QString str = it.key();
+ TQString str = it.key();
/* TODO: show entities as unicode character
if( !it.data().isEmpty() ) {
//str += " -- " + it.data();
- QRegExp re( "&#(\\d+);" );
+ TQRegExp re( "&#(\\d+);" );
if( re.search(it.data()) != -1 ) {
uint ch = re.cap( 1).toUInt();
- str += " -- " + QChar( ch).decomposition();
+ str += " -- " + TQChar( ch).decomposition();
}
//kdDebug() << "#" << it.data() << endl;
}
diff --git a/kate/xmltools/pseudo_dtd.h b/kate/xmltools/pseudo_dtd.h
index f5cf37e..5da444c 100644
--- a/kate/xmltools/pseudo_dtd.h
+++ b/kate/xmltools/pseudo_dtd.h
@@ -23,8 +23,8 @@
#ifndef _PLUGIN_KANT_XMLTOOLS_DTD_H
#define _PLUGIN_KANT_XMLTOOLS_DTD_H
-#include <qdom.h>
-#include <qprogressdialog.h>
+#include <tqdom.h>
+#include <tqprogressdialog.h>
/**
* This class contains the attributes for one element.
@@ -33,8 +33,8 @@
class ElementAttributes
{
public:
- QStringList optionalAttributes;
- QStringList requiredAttributes;
+ TQStringList optionalAttributes;
+ TQStringList requiredAttributes;
};
class PseudoDTD
@@ -44,31 +44,31 @@ class PseudoDTD
PseudoDTD();
~PseudoDTD();
- void analyzeDTD( QString &metaDtdUrl, QString &metaDtd );
+ void analyzeDTD( TQString &metaDtdUrl, TQString &metaDtd );
- QStringList allowedElements( QString parentElement );
- QStringList allowedAttributes( QString parentElement );
- QStringList attributeValues( QString element, QString attribute );
- QStringList entities( QString start );
- QStringList requiredAttributes( const QString &parentElement ) const;
+ TQStringList allowedElements( TQString parentElement );
+ TQStringList allowedAttributes( TQString parentElement );
+ TQStringList attributeValues( TQString element, TQString attribute );
+ TQStringList entities( TQString start );
+ TQStringList requiredAttributes( const TQString &parentElement ) const;
protected:
- bool parseElements( QDomDocument *doc, QProgressDialog *progress );
- bool parseAttributes( QDomDocument *doc, QProgressDialog *progress );
- bool parseAttributeValues( QDomDocument *doc, QProgressDialog *progress );
- bool parseEntities( QDomDocument *doc, QProgressDialog *progress );
+ bool parseElements( TQDomDocument *doc, TQProgressDialog *progress );
+ bool parseAttributes( TQDomDocument *doc, TQProgressDialog *progress );
+ bool parseAttributeValues( TQDomDocument *doc, TQProgressDialog *progress );
+ bool parseEntities( TQDomDocument *doc, TQProgressDialog *progress );
bool m_sgmlSupport;
// Entities, e.g. <"nbsp", "160">
- QMap<QString,QString> m_entityList;
+ TQMap<TQString,TQString> m_entityList;
// Elements, e.g. <"a", ( "b", "i", "em", "strong" )>
- QMap<QString,QStringList> m_elementsList;
+ TQMap<TQString,TQStringList> m_elementsList;
// Attributes e.g. <"a", ( "href", "lang", "title" )>
- QMap<QString,ElementAttributes> m_attributesList;
+ TQMap<TQString,ElementAttributes> m_attributesList;
// Attribute values e.g. <"td", <"align", ( "left", "right", "justify" )>>
- QMap< QString,QMap<QString,QStringList> > m_attributevaluesList;
+ TQMap< TQString,TQMap<TQString,TQStringList> > m_attributevaluesList;
};