diff options
Diffstat (limited to 'kate/xmltools/plugin_katexmltools.cpp')
-rw-r--r-- | kate/xmltools/plugin_katexmltools.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/kate/xmltools/plugin_katexmltools.cpp b/kate/xmltools/plugin_katexmltools.cpp index 182aeaf..fe5c9f4 100644 --- a/kate/xmltools/plugin_katexmltools.cpp +++ b/kate/xmltools/plugin_katexmltools.cpp @@ -52,7 +52,7 @@ FIXME: TODO: -check for mem leaks --add "Go to opening/parent tag"? +-add "Go to opening/tqparent tag"? -check doctype to get top-level element -can undo behaviour be improved?, e.g. the plugins internal deletions of text don't have to be an extra step @@ -63,7 +63,7 @@ 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 TQChar::TQChar( int rc ) + unicode font +-Show expanded entities with TQChar::TQChar( int rc ) + tqunicode 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, ... ) @@ -113,8 +113,8 @@ class PluginView : public KXMLGUIClient Kate::MainWindow *win; }; -PluginKateXMLTools::PluginKateXMLTools( TQObject* parent, const char* name, const TQStringList& ) - : Kate::Plugin ( (Kate::Application*)parent, name ) +PluginKateXMLTools::PluginKateXMLTools( TQObject* tqparent, const char* name, const TQStringList& ) + : Kate::Plugin ( (Kate::Application*)tqparent, name ) { //kdDebug() << "PluginKateXMLTools constructor called" << endl; @@ -132,7 +132,7 @@ PluginKateXMLTools::PluginKateXMLTools( TQObject* parent, const char* name, cons m_dtds.setAutoDelete( true ); - m_documentManager = ((Kate::Application*)parent)->documentManager(); + m_documentManager = ((Kate::Application*)tqparent)->documentManager(); // connect( m_documentManager, TQT_SIGNAL(documentCreated()), // this, TQT_SLOT(slotDocumentCreated()) ); @@ -239,7 +239,7 @@ void PluginKateXMLTools::backspacePressed() void PluginKateXMLTools::emptyKeyEvent() { - keyEvent( 0, 0, TQString::null ); + keyEvent( 0, 0, TQString() ); } void PluginKateXMLTools::keyEvent( int, int, const TQString &/*s*/ ) @@ -282,12 +282,12 @@ void PluginKateXMLTools::keyEvent( int, int, const TQString &/*s*/ ) else if( leftCh == "<" ) { kdDebug() << "*outside tag -> get elements" << endl; - TQString parentElement = getParentElement( *kv, true ); - kdDebug() << "parent: " << parentElement << endl; - allowed = m_docDtds[docNumber]->allowedElements(parentElement ); + TQString tqparentElement = getParentElement( *kv, true ); + kdDebug() << "tqparent: " << tqparentElement << endl; + allowed = m_docDtds[docNumber]->allowedElements(tqparentElement ); m_mode = elements; } - // TODO: optionally close parent tag if not left=="/>" + // TODO: optionally close tqparent tag if not left=="/>" else if( leftCh == " " || (isQuote(leftCh) && secondLeftCh == "=") ) { // TODO: check secondLeftChar, too?! then you don't need to trigger @@ -330,7 +330,7 @@ void PluginKateXMLTools::keyEvent( int, int, const TQString &/*s*/ ) if( allowed.count() >= 1 && allowed[0] != "__EMPTY" ) { - allowed = sortQStringList( allowed ); + allowed = sortTQStringList( allowed ); connectSlots( kv ); kv->showCompletionBox( stringListToCompletionEntryList( allowed ), 0, false ); m_popupOpenCol = col; @@ -440,8 +440,8 @@ void PluginKateXMLTools::getDTD() else if ( doctype == "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" ) filename = "kde-docbook.dtd.xml"; } - else if( documentStart.find("<xsl:stylesheet" ) != -1 && - documentStart.find( "xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"") != -1 ) + else if( documentStart.tqfind("<xsl:stylesheet" ) != -1 && + documentStart.tqfind( "xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"") != -1 ) { /* XSLT doesn't have a doctype/DTD. We look for an xsl:stylesheet tag instead. Example: @@ -466,9 +466,9 @@ void PluginKateXMLTools::getDTD() url.setFileName( defaultDir + filename ); KMessageBox::information(0, i18n("The current file has been identified " "as a document of type \"%1\". The meta DTD for this document type " - "will now be loaded.").arg( doctype ), + "will now be loaded.").tqarg( doctype ), i18n( "Loading XML Meta DTD" ), - TQString::fromLatin1( "DTDAssigned") ); + TQString::tqfromLatin1( "DTDAssigned") ); } if( url.isEmpty() ) @@ -503,7 +503,7 @@ void PluginKateXMLTools::slotFinished( KIO::Job *job ) { // catch failed loading loading via http: KMessageBox::error(0, i18n("The file '%1' could not be opened. " - "The server returned an error.").arg( m_urlString ), + "The server returned an error.").tqarg( m_urlString ), i18n( "XML Plugin Error") ); } else @@ -528,7 +528,7 @@ void PluginKateXMLTools::slotData( KIO::Job *, const TQByteArray &data ) void PluginKateXMLTools::assignDTD( PseudoDTD *dtd, KTextEditor::Document *doc ) { - m_docDtds.replace( doc->documentNumber(), dtd ); + m_docDtds.tqreplace( doc->documentNumber(), dtd ); connect( doc, TQT_SIGNAL(charactersInteractivelyInserted(int,int,const TQString&) ), this, TQT_SLOT(keyEvent(int,int,const TQString&)) ); @@ -555,11 +555,11 @@ void PluginKateXMLTools::slotInsertElement() } PseudoDTD *dtd = m_docDtds[kv->document()->documentNumber()]; - TQString parentElement = getParentElement( *kv, false ); + TQString tqparentElement = getParentElement( *kv, false ); TQStringList allowed; if( dtd ) - allowed = dtd->allowedElements(parentElement ); + allowed = dtd->allowedElements(tqparentElement ); InsertElement *dialog = new InsertElement( ( TQWidget *)application()->activeMainWindow()->viewManager()->activeView(), "insertXml" ); @@ -579,7 +579,7 @@ void PluginKateXMLTools::slotInsertElement() if ( dtd && dtd->allowedAttributes(list[0]).count() ) adjust++; // the ">" - if ( dtd && dtd->allowedElements(list[0]).contains("__EMPTY") ) + if ( dtd && dtd->allowedElements(list[0]).tqcontains("__EMPTY") ) { pre = "<" + text + "/>"; if ( adjust ) @@ -603,7 +603,7 @@ void PluginKateXMLTools::slotInsertElement() } /** - * Insert a closing tag for the nearest not-closed parent element. + * Insert a closing tag for the nearest not-closed tqparent element. */ void PluginKateXMLTools::slotCloseElement() { @@ -616,11 +616,11 @@ void PluginKateXMLTools::slotCloseElement() kdDebug() << "Warning: no Kate::View" << endl; return; } - TQString parentElement = getParentElement( *kv, false ); + TQString tqparentElement = getParentElement( *kv, false ); - //kdDebug() << "parentElement: '" << parentElement << "'" << endl; - TQString closeTag = "</" + parentElement + ">"; - if( ! parentElement.isEmpty() ) + //kdDebug() << "tqparentElement: '" << tqparentElement << "'" << endl; + TQString closeTag = "</" + tqparentElement + ">"; + if( ! tqparentElement.isEmpty() ) kv->insertText( closeTag ); } @@ -708,7 +708,7 @@ void PluginKateXMLTools::filterInsertString( KTextEditor::CompletionEntry *ce, T // anders: if the tag is marked EMPTY, insert in form <tagname/> TQString str; int docNumber = kv->document()->documentNumber(); - bool isEmptyTag =m_docDtds[docNumber]->allowedElements(ce->text).contains( "__EMPTY" ); + bool isEmptyTag =m_docDtds[docNumber]->allowedElements(ce->text).tqcontains( "__EMPTY" ); if ( isEmptyTag ) str = "/>"; else @@ -895,10 +895,10 @@ TQString PluginKateXMLTools::insideAttribute( Kate::View &kv ) } /** - * Find the parent element for the current cursor position. That is, + * Find the tqparent element for the current cursor position. That is, * go left and find the first opening element that's not closed yet, * ignoring empty elements. - * Examples: If cursor is at "X", the correct parent element is "p": + * Examples: If cursor is at "X", the correct tqparent element is "p": * <p> <a x="xyz"> foo <i> test </i> bar </a> X * <p> <a x="xyz"> foo bar </a> X * <p> foo <img/> bar X @@ -930,14 +930,14 @@ TQString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingle { do { - if( !line-- ) return TQString::null; // reached start of document + if( !line-- ) return TQString(); // reached start of document str = kv.getDoc()->textLine(line ); col = str.length(); } while( !col ); --col; } - ushort ch = str.at( col).unicode(); + ushort ch = str.tqat( col).tqunicode(); switch( parseState ) { @@ -950,7 +950,7 @@ TQString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingle { case '<': // hmm... we were actually inside an element - return TQString::null; + return TQString(); case '>': // we just hit an element boundary @@ -981,7 +981,7 @@ TQString PluginKateXMLTools::getParentElement( Kate::View &kv, bool ignoreSingle TQString tag = str.mid( col + 1 ); for( uint pos = 0, len = tag.length(); pos < len; ++pos ) { - ch = tag.at( pos).unicode(); + ch = tag.tqat( pos).tqunicode(); if( ch == ' ' || ch == '\t' || ch == '>' ) { tag.truncate( pos ); break; @@ -1069,14 +1069,14 @@ bool PluginKateXMLTools::isQuote( TQString ch ) // Tools: /** 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. +TQStringList PluginKateXMLTools::sortTQStringList( TQStringList list ) { + // Sort list case-insensitive. This looks complicated but using a TQMap + // is even suggested by the TQt documentation. TQMap<TQString,TQString> mapList; for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { TQString str = *it; - if( mapList.contains(str.lower()) ) + if( mapList.tqcontains(str.lower()) ) { // do not override a previous value, e.g. "Auml" and "auml" are two different // entities, but they should be sorted next to each other. @@ -1091,7 +1091,7 @@ TQStringList PluginKateXMLTools::sortQStringList( TQStringList list ) { list.clear(); TQMap<TQString,TQString>::Iterator it; - // Qt doc: "the items are alphabetically sorted [by key] when iterating over the map": + // TQt doc: "the items are alphabetically sorted [by key] when iterating over the map": for( it = mapList.begin(); it != mapList.end(); ++it ) list.append( it.data() ); @@ -1099,8 +1099,8 @@ TQStringList PluginKateXMLTools::sortQStringList( TQStringList list ) { } //BEGIN InsertElement dialog -InsertElement::InsertElement( TQWidget *parent, const char *name ) - :KDialogBase( parent, name, true, i18n("Insert XML Element" ), +InsertElement::InsertElement( TQWidget *tqparent, const char *name ) + :KDialogBase( tqparent, name, true, i18n("Insert XML Element" ), KDialogBase::Ok|KDialogBase::Cancel) { } @@ -1135,7 +1135,7 @@ TQString InsertElement::showDialog( TQStringList &completions ) if( exec() ) return combo->currentText(); - return TQString::null; + return TQString(); } //END InsertElement dialog -// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; mixed-indent off; |