From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kate/part/katesyntaxdocument.cpp | 86 ++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'kate/part/katesyntaxdocument.cpp') diff --git a/kate/part/katesyntaxdocument.cpp b/kate/part/katesyntaxdocument.cpp index e5c18c8ef..8e391b620 100644 --- a/kate/part/katesyntaxdocument.cpp +++ b/kate/part/katesyntaxdocument.cpp @@ -29,10 +29,10 @@ #include #include -#include +#include KateSyntaxDocument::KateSyntaxDocument(bool force) - : QDomDocument() + : TQDomDocument() { // Let's build the Mode List (katesyntaxhighlightingrc) setupModeList(force); @@ -48,20 +48,20 @@ KateSyntaxDocument::~KateSyntaxDocument() the new one and assign some other things. identifier = File name and path of the new xml needed */ -bool KateSyntaxDocument::setIdentifier(const QString& identifier) +bool KateSyntaxDocument::setIdentifier(const TQString& identifier) { // if the current file is the same as the new one don't do anything. if(currentFile != identifier) { // let's open the new file - QFile f( identifier ); + TQFile f( identifier ); if ( f.open(IO_ReadOnly) ) { // Let's parse the contets of the xml file /* The result of this function should be check for robustness, a false returned means a parse error */ - QString errorMsg; + TQString errorMsg; int line, col; bool success=setContent(&f,&errorMsg,&line,&col); @@ -100,7 +100,7 @@ bool KateSyntaxDocument::nextGroup( KateSyntaxContextData* data) if (data->currentGroup.isNull()) { // Skip over non-elements. So far non-elements are just comments - QDomNode node = data->parent.firstChild(); + TQDomNode node = data->parent.firstChild(); while (node.isComment()) node = node.nextSibling(); @@ -109,7 +109,7 @@ bool KateSyntaxDocument::nextGroup( KateSyntaxContextData* data) else { // common case, iterate over siblings, skipping comments as we go - QDomNode node = data->currentGroup.nextSibling(); + TQDomNode node = data->currentGroup.nextSibling(); while (node.isComment()) node = node.nextSibling(); @@ -129,7 +129,7 @@ bool KateSyntaxDocument::nextItem( KateSyntaxContextData* data) if (data->item.isNull()) { - QDomNode node = data->currentGroup.firstChild(); + TQDomNode node = data->currentGroup.firstChild(); while (node.isComment()) node = node.nextSibling(); @@ -137,7 +137,7 @@ bool KateSyntaxDocument::nextItem( KateSyntaxContextData* data) } else { - QDomNode node = data->item.nextSibling(); + TQDomNode node = data->item.nextSibling(); while (node.isComment()) node = node.nextSibling(); @@ -150,9 +150,9 @@ bool KateSyntaxDocument::nextItem( KateSyntaxContextData* data) /** * This function is used to fetch the atributes of the tags of the item in a KateSyntaxContextData. */ -QString KateSyntaxDocument::groupItemData( const KateSyntaxContextData* data, const QString& name){ +TQString KateSyntaxDocument::groupItemData( const KateSyntaxContextData* data, const TQString& name){ if(!data) - return QString::null; + return TQString::null; // If there's no name just return the tag name of data->item if ( (!data->item.isNull()) && (name.isEmpty())) @@ -166,14 +166,14 @@ QString KateSyntaxDocument::groupItemData( const KateSyntaxContextData* data, co return data->item.attribute(name); } - return QString::null; + return TQString::null; } -QString KateSyntaxDocument::groupData( const KateSyntaxContextData* data,const QString& name) +TQString KateSyntaxDocument::groupData( const KateSyntaxContextData* data,const TQString& name) { if(!data) - return QString::null; + return TQString::null; if (!data->currentGroup.isNull()) { @@ -181,7 +181,7 @@ QString KateSyntaxDocument::groupData( const KateSyntaxContextData* data,const Q } else { - return QString::null; + return TQString::null; } } @@ -204,25 +204,25 @@ KateSyntaxContextData* KateSyntaxDocument::getSubItems(KateSyntaxContextData* da return retval; } -bool KateSyntaxDocument::getElement (QDomElement &element, const QString &mainGroupName, const QString &config) +bool KateSyntaxDocument::getElement (TQDomElement &element, const TQString &mainGroupName, const TQString &config) { kdDebug(13010) << "Looking for \"" << mainGroupName << "\" -> \"" << config << "\"." << endl; - QDomNodeList nodes = documentElement().childNodes(); + TQDomNodeList nodes = documentElement().childNodes(); // Loop over all these child nodes looking for mainGroupName for (unsigned int i=0; ifindAllResources("data","katepart/syntax/*.xml",false,true); + TQStringList list = KGlobal::dirs()->findAllResources("data","katepart/syntax/*.xml",false,true); // Let's iterate through the list and build the Mode List - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // Each file has a group called: - QString Group="Cache "+ *it; + TQString Group="Cache "+ *it; // Let's go to this group config.setGroup(Group); @@ -360,7 +360,7 @@ void KateSyntaxDocument::setupModeList (bool force) // stat the file struct stat sbuf; memset (&sbuf, 0, sizeof(sbuf)); - stat(QFile::encodeName(*it), &sbuf); + stat(TQFile::encodeName(*it), &sbuf); // If the group exist and we're not forced to read the xml file, let's build myModeList for katesyntax..rc if (!force && config.hasGroup(Group) && (sbuf.st_mtime == config.readNumEntry("lastModified"))) @@ -387,13 +387,13 @@ void KateSyntaxDocument::setupModeList (bool force) kdDebug (13010) << "UPDATE hl cache for: " << *it << endl; // We're forced to read the xml files or the mode doesn't exist in the katesyntax...rc - QFile f(*it); + TQFile f(*it); if (f.open(IO_ReadOnly)) { // Ok we opened the file, let's read the contents and close the file /* the return of setContent should be checked because a false return shows a parsing error */ - QString errMsg; + TQString errMsg; int line, col; bool success = setContent(&f,&errMsg,&line,&col); @@ -402,7 +402,7 @@ void KateSyntaxDocument::setupModeList (bool force) if (success) { - QDomElement root = documentElement(); + TQDomElement root = documentElement(); if (!root.isNull()) { @@ -421,7 +421,7 @@ void KateSyntaxDocument::setupModeList (bool force) mli->author = root.attribute("author"); mli->license = root.attribute("license"); - QString hidden = root.attribute("hidden"); + TQString hidden = root.attribute("hidden"); mli->hidden = (hidden == "true" || hidden == "TRUE"); mli->identifier = *it; @@ -458,7 +458,7 @@ void KateSyntaxDocument::setupModeList (bool force) emli->mimetype="invalid_file/invalid_file"; emli->extension="invalid_file.invalid_file"; emli->version="1."; - emli->name=QString ("Error: %1").arg(*it); // internal + emli->name=TQString ("Error: %1").arg(*it); // internal emli->nameTranslated=i18n("Error: %1").arg(*it); // translated emli->identifier=(*it); -- cgit v1.2.1