summaryrefslogtreecommitdiffstats
path: root/quanta/src/document.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/src/document.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/src/document.cpp')
-rw-r--r--quanta/src/document.cpp290
1 files changed, 145 insertions, 145 deletions
diff --git a/quanta/src/document.cpp b/quanta/src/document.cpp
index f42986ab..70fce267 100644
--- a/quanta/src/document.cpp
+++ b/quanta/src/document.cpp
@@ -93,8 +93,8 @@
extern GroupElementMapList globalGroupMap;
Document::Document(KTextEditor::Document *doc,
- TQWidget *parent, const char *name, WFlags f )
- : TQWidget(parent, name, f)
+ TQWidget *tqparent, const char *name, WFlags f )
+ : TQWidget(tqparent, name, f)
{
m_dirty = false;
busy = false;
@@ -102,7 +102,7 @@ Document::Document(KTextEditor::Document *doc,
m_md5sum = "";
m_doc = doc;
m_view = 0L; //needed, because createView() calls processEvents() and the "this" may be deleted before m_view gets a value => crash on delete m_view;
- m_view = m_doc->createView(parent, 0L);
+ m_view = m_doc->createView(tqparent, 0L);
completionInProgress = false;
argHintVisible = false;
completionRequested = false;
@@ -142,11 +142,11 @@ Document::Document(KTextEditor::Document *doc,
//conflicting shortcuts, so change them
a = m_view->actionCollection()->action("view_border");
if (a)
- a->setShortcut(Qt::SHIFT + Qt::Key_F9);
+ a->setShortcut(TQt::SHIFT + TQt::Key_F9);
a = m_view->actionCollection()->action("view_folding_markers");
if (a)
- a->setShortcut(Qt::SHIFT + Qt::Key_F11);
+ a->setShortcut(TQt::SHIFT + TQt::Key_F11);
KActionMenu *bookmarkAction = dynamic_cast<KActionMenu*>(m_view->actionCollection()->action( "bookmarks" ));
if (bookmarkAction)
@@ -190,15 +190,15 @@ Document::Document(KTextEditor::Document *doc,
}
tempFile = 0;
- m_tempFileName = TQString::null;
+ m_tempFileName = TQString();
dtdName = Project::ref()->defaultDTD();
reparseEnabled = true;
- repaintEnabled = true;
+ tqrepaintEnabled = true;
delayedTextChangedEnabled = true;
docUndoRedo = new undoRedo(this);
//path of the backup copy file of the document
- m_backupPathValue = TQString::null;
+ m_backupPathValue = TQString();
connect( m_doc, TQT_SIGNAL(charactersInteractivelyInserted (int ,int ,const TQString&)),
this, TQT_SLOT(slotCharactersInserted(int ,int ,const TQString&)) );
@@ -409,7 +409,7 @@ void Document::insertFile(const KURL& url)
{
if (!KIO::NetAccess::download(url, fileName, this))
{
- KMessageBox::error(this, i18n("<qt>Cannot download <b>%1</b>.</qt>").arg( url.prettyURL(0, KURL::StripFileProtocol)));
+ KMessageBox::error(this, i18n("<qt>Cannot download <b>%1</b>.</qt>").tqarg( url.prettyURL(0, KURL::StripFileProtocol)));
return;
}
}
@@ -421,7 +421,7 @@ void Document::insertFile(const KURL& url)
insertText(stream.read());
file.close();
} else
- KMessageBox::error(this, i18n("<qt>Cannot open <b>%1</b> for reading.</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol)));
+ KMessageBox::error(this, i18n("<qt>Cannot open <b>%1</b> for reading.</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol)));
}
/** Inserts text at the current cursor position */
@@ -461,8 +461,8 @@ void Document::insertText(const TQString &a_text, bool adjustCursor, bool repars
}
if (insideQuotes && closeQuotationFound)
{
- text.replace("\\\"", "\"");
- text.replace("\"", "\\\"");
+ text.tqreplace("\\\"", "\"");
+ text.tqreplace("\"", "\\\"");
}
}
@@ -552,7 +552,7 @@ void Document::insertText(const TQString &a_text, bool adjustCursor, bool repars
}
}
-bool Document::insertChildTags(QTag *tag, QTag *lastTag)
+bool Document::insertChildTags(TQTag *tag, TQTag *lastTag)
{
bool childInserted = false;
if (!tag || tag == lastTag) //avoid infinite recursion
@@ -565,9 +565,9 @@ bool Document::insertChildTags(QTag *tag, QTag *lastTag)
if (it.data())
{
childInserted = true;
- QTag *childTag = QuantaCommon::tagFromDTD(tag->parentDTD, it.key());
+ TQTag *childTag = QuantaCommon::tagFromDTD(tag->tqparentDTD, it.key());
TQString tagStr =QuantaCommon::tagCase(it.key());
- if ( tag->parentDTD->singleTagStyle == "xml" &&
+ if ( tag->tqparentDTD->singleTagStyle == "xml" &&
( childTag->isSingle() ||
(childTag->isOptional() && !qConfig.closeOptionalTags)) )
{
@@ -648,7 +648,7 @@ void Document::closeTempFile()
if (TQFileInfo(m_tempFileName).exists())
TQFile::remove(m_tempFileName);
- m_tempFileName = TQString::null;
+ m_tempFileName = TQString();
}
TQString Document::tempFileName()
@@ -669,8 +669,8 @@ TQString Document::getTagNameAt(int line, int col )
while (line >= 0)
{
QuantaCommon::removeCommentsAndQuotes(textLine, completionDTD);
- int pos = textLine.findRev("<");
- int pos2 = textLine.findRev(">");
+ int pos = textLine.tqfindRev("<");
+ int pos2 = textLine.tqfindRev(">");
if (pos != -1 && pos2 < pos)
{
textLine.remove(0, pos + 1);
@@ -680,7 +680,7 @@ TQString Document::getTagNameAt(int line, int col )
textLine[pos] != '>')
pos++;
name = textLine.left(pos).stripWhiteSpace();
- pos = name.find(":");
+ pos = name.tqfind(":");
if (pos != -1)
name = name.mid(pos + 1);
break;
@@ -732,7 +732,7 @@ void Document::slotCompletionDone( KTextEditor::CompletionEntry completion )
viewCursorIf->setCursorPositionReal(line,col-1);
if (dtd)
{
- QTag *tag = QuantaCommon::tagFromDTD(dtd,completion.userdata);
+ TQTag *tag = QuantaCommon::tagFromDTD(dtd,completion.userdata);
if (tag)
{
m_lastCompletionList = getAttributeValueCompletions(tag->name(), completion.text);
@@ -778,7 +778,7 @@ void Document::slotFilterCompletion( KTextEditor::CompletionEntry *completion ,T
{
kdDebug(24000) << *string << endl;
kdDebug(24000) << completion->userdata << endl;
- int pos = completion->userdata.find("|");
+ int pos = completion->userdata.tqfind("|");
TQString s = completion->userdata.left(pos);
completion->userdata.remove(0,pos+1);
string->remove(0, s.length());
@@ -791,7 +791,7 @@ void Document::slotFilterCompletion( KTextEditor::CompletionEntry *completion ,T
viewCursorIf->cursorPositionReal(&line, &col);
TQString s2 = editIf->textLine(line).left(col);
kdDebug(24000) << s2 << endl;
- int pos = s2.findRev('&');
+ int pos = s2.tqfindRev('&');
if (pos != -1)
{
s2 = s2.mid(pos + 1);
@@ -820,7 +820,7 @@ void Document::slotFilterCompletion( KTextEditor::CompletionEntry *completion ,T
s = *string;
string->remove(0, string->length());
TQString s2 = TQString("public \""+DTDs::ref()->getDTDNameFromNickName(s)+"\"");
- const DTDStruct *dtd = DTDs::ref()->find(DTDs::ref()->getDTDNameFromNickName(s));
+ const DTDStruct *dtd = DTDs::ref()->tqfind(DTDs::ref()->getDTDNameFromNickName(s));
if (dtd && !dtd->url.isEmpty())
{
s2 += " \""+dtd->url+"\"";
@@ -858,7 +858,7 @@ void Document::slotCharactersInserted(int line, int column, const TQString& stri
{
m_replaceLine = line;
m_replaceCol = column;
- m_replaceStr = QuantaCommon::encodedChar(string[0].unicode());
+ m_replaceStr = QuantaCommon::encodedChar(string[0].tqunicode());
TQTimer::singleShot(0, this, TQT_SLOT(slotReplaceChar()));
return;
}
@@ -866,7 +866,7 @@ void Document::slotCharactersInserted(int line, int column, const TQString& stri
}
if (qConfig.replaceAccented)
{
- uint c = string[0].unicode();
+ uint c = string[0].tqunicode();
if (c > 191)
{
m_replaceLine = line;
@@ -936,13 +936,13 @@ void Document::slotCharactersInserted(int line, int column, const TQString& stri
*/
bool Document::xmlAutoCompletion(int line, int column, const TQString & string)
{
- QTag *tag;
+ TQTag *tag;
TQString tagName;
bool handled = false;
tagName = getTagNameAt(line, column);
tag = QuantaCommon::tagFromDTD(completionDTD, tagName);
if (!tag && !tagName.isEmpty())
- tag = userTagList.find(tagName.lower());
+ tag = userTagList.tqfind(tagName.lower());
TQString s = editIf->textLine(line).left(column + 1);
bool namespacecompletion = false;
@@ -978,13 +978,13 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string)
if (string == "/" && s.endsWith("</") && tagName.isEmpty())
{
Node *node = parser->nodeAt(line, column, false);
- if (node && node->parent )
+ if (node && node->tqparent )
{
- node = node->parent;
+ node = node->tqparent;
if (node->tag->type == Tag::XmlTag && (!node->next || !QuantaCommon::closesTag(node->tag, node->next->tag)))
{
TQString name = node->tag->name;
- name = name.left(name.find(" | "));
+ name = name.left(name.tqfind(" | "));
if (!node->tag->nameSpace.isEmpty())
name.prepend(node->tag->nameSpace + ":");
editIf->insertText(line, column + 1, name + ">");
@@ -1000,7 +1000,7 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string)
if ( string == ">" && tagName[0] != '/' && !tagName.endsWith("/") &&
!s.endsWith("/>") && tag)
{
- if ( tag->parentDTD->singleTagStyle == "xml" &&
+ if ( tag->tqparentDTD->singleTagStyle == "xml" &&
(tag->isSingle() || (!qConfig.closeOptionalTags && tag->isOptional()))
)
{
@@ -1052,10 +1052,10 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string)
{
//we need to find the attribute name
TQString textLine = editIf->textLine(line).left(column-1);
- TQString attribute = textLine.mid(textLine.findRev(' ')+1);
- if (attribute == "style" && completionDTD->insideDTDs.contains("css"))
+ TQString attribute = textLine.mid(textLine.tqfindRev(' ')+1);
+ if (attribute == "style" && completionDTD->insideDTDs.tqcontains("css"))
{
- completionDTD = DTDs::ref()->find("text/css");
+ completionDTD = DTDs::ref()->tqfind("text/css");
completionRequested = true;
return scriptAutoCompletion(line, column + 1, string);
}
@@ -1068,20 +1068,20 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string)
//check if we are inside a style attribute, and use css autocompletion if we are
TQString textLine = editIf->textLine(line);
textLine = textLine.left(column);
- int pos = textLine.findRev('"');
+ int pos = textLine.tqfindRev('"');
if (pos != -1)
{
- pos = textLine.findRev(' ', pos);
+ pos = textLine.tqfindRev(' ', pos);
if (pos != -1)
{
textLine = textLine.mid(pos + 1);
- pos = textLine.find('=');
+ pos = textLine.tqfind('=');
if (pos != -1)
{
TQString attribute = textLine.left(pos);
- if (attribute == "style" && completionDTD->insideDTDs.contains("css"))
+ if (attribute == "style" && completionDTD->insideDTDs.tqcontains("css"))
{
- completionDTD = DTDs::ref()->find("text/css");
+ completionDTD = DTDs::ref()->tqfind("text/css");
completionRequested = true;
return scriptAutoCompletion(line, column + 1, string);
}
@@ -1089,7 +1089,7 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string)
}
}
TQString s = editIf->textLine(line).left(column + 1);
- pos = s.findRev('&');
+ pos = s.tqfindRev('&');
if (pos != -1)
{
//complete character codes
@@ -1125,7 +1125,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getGroupCompletions(Node *n
GroupElementList elementList = it.data();
for (uint i = 0; i < elementList.count(); i++)
{
- if (elementList[i]->parentNode == 0L || elementList[i]->global)
+ if (elementList[i]->tqparentNode == 0L || elementList[i]->global)
{
completion.text = it.key().section('|', -1).stripWhiteSpace();
completions->append(completion);
@@ -1133,11 +1133,11 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getGroupCompletions(Node *n
} else
{
Node *n = node;
- while (n && n != elementList[i]->parentNode)
+ while (n && n != elementList[i]->tqparentNode)
{
- n = n->parent;
+ n = n->tqparent;
}
- if (n == elementList[i]->parentNode)
+ if (n == elementList[i]->tqparentNode)
{
completion.text = it.key().section('|', -1).stripWhiteSpace();
completions->append(completion);
@@ -1169,18 +1169,18 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getGroupCompletions(Node *n
bool Document::isDerivatedFrom(const TQString& className, const TQString &baseClass)
{
- if (className.isEmpty() || !completionDTD->classInheritance.contains(className))
+ if (className.isEmpty() || !completionDTD->classInheritance.tqcontains(className))
return false;
- TQString parentClass = completionDTD->classInheritance[className];
+ TQString tqparentClass = completionDTD->classInheritance[className];
int result = 0;
do {
- if (parentClass == baseClass)
+ if (tqparentClass == baseClass)
result = 1; //className extends baseClass
else
{
- if (completionDTD->classInheritance.contains(parentClass))
- parentClass = completionDTD->classInheritance[parentClass];
+ if (completionDTD->classInheritance.tqcontains(tqparentClass))
+ tqparentClass = completionDTD->classInheritance[tqparentClass];
else
result = -1;//nothing was found in the inheritance list
}
@@ -1205,12 +1205,12 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
}
Node *node = parser->nodeAt(line, col);
if (node && node->tag->type != Tag::XmlTag)
- node = node->parent;
+ node = node->tqparent;
if (node && node->tag->type != Tag::XmlTag)
node = 0L;
- QTag *parentQTag= 0L;
- if (node && node->parent)
- parentQTag = QuantaCommon::tagFromDTD(node->parent);
+ TQTag *tqparentTQTag= 0L;
+ if (node && node->tqparent)
+ tqparentTQTag = QuantaCommon::tagFromDTD(node->tqparent);
TQString textLine = editIf->textLine(line).left(col);
TQString word = findWordRev(textLine, completionDTD).upper();
TQString classStr = "";
@@ -1229,7 +1229,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
objStr = r->cap(1);
if (objStr == "this")
{
- TQString parentGroupStr = "";
+ TQString tqparentGroupStr = "";
bool classFound = false;
parser->synchParseInDetail();
Node *n = parser->nodeAt(line, col);
@@ -1244,11 +1244,11 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
while (it != n->m_groupElements.end())
{
GroupElement *e = *it;
- if (parentGroupStr.isEmpty() && e->group->appendToTags)
+ if (tqparentGroupStr.isEmpty() && e->group->appendToTags)
{
- parentGroupStr = e->group->parentGroup;
+ tqparentGroupStr = e->group->tqparentGroup;
}
- if (!parentGroupStr.isEmpty() && e->group->name == parentGroupStr)
+ if (!tqparentGroupStr.isEmpty() && e->group->name == tqparentGroupStr)
{
classStr = e->tag->name;
classFound = true;
@@ -1260,7 +1260,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
it = n->m_groupElements.erase(it);
}
delete gParser;
- n = n->parent;
+ n = n->tqparent;
}
} else
{
@@ -1290,20 +1290,20 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
//A TQMap to hold the completion type (function/string/class/etc)
TQMap<TQString, TQString> type;
TQString tagName;
- TQDictIterator<QTag> it(*(completionDTD->tagsList));
+ TQDictIterator<TQTag> it(*(completionDTD->tagsList));
int i = 0;
for( ; it.current(); ++it )
{
- QTag *tag = it.current();
+ TQTag *tag = it.current();
if ((tag->type != "entity") && (tag->className == classStr ||
isDerivatedFrom(classStr, tag->className)))
{
tagName = tag->name();
if (!tagName.isEmpty() && tagName.upper().startsWith(word))
{
- if (!parentQTag || (parentQTag && parentQTag->isChild(tagName)))
+ if (!tqparentTQTag || (tqparentTQTag && tqparentTQTag->isChild(tagName)))
{
- tagName = tag->name() + TQString("%1").arg(i, 10);
+ tagName = tag->name() + TQString("%1").tqarg(i, 10);
tagNameList += tagName;
comments.insert(tagName, tag->comment);
i++;
@@ -1312,14 +1312,14 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
}
}
- TQDictIterator<QTag> it2(userTagList);
+ TQDictIterator<TQTag> it2(userTagList);
for( ; it2.current(); ++it2 )
{
- QTag *tag = it2.current();
+ TQTag *tag = it2.current();
if ((tag->className == classStr ||
isDerivatedFrom(classStr, tag->className)) && tag->name().upper().startsWith(word))
{
- tagName = tag->name() + TQString("%1").arg(i, 10);
+ tagName = tag->name() + TQString("%1").tqarg(i, 10);
tagNameList += tagName;
comments.insert(tagName, tag->comment);
@@ -1366,7 +1366,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
// Here we actually append the completion type
completion.type = type[tagNameList[i]];
// And here is out sorting...
- if(completion.type.contains("variable"))
+ if(completion.type.tqcontains("variable"))
{
// Insert after the last variable
variableIt++;
@@ -1374,7 +1374,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line,
}
else
{
- if(completion.type.contains("script"))
+ if(completion.type.tqcontains("script"))
{
//Scripts can go at the end of the list
completions->append(completion);
@@ -1404,10 +1404,10 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getAttributeCompletions(con
{
TQValueList<KTextEditor::CompletionEntry> *completions = new TQValueList<KTextEditor::CompletionEntry>();
KTextEditor::CompletionEntry completion;
- QTag *tag = QuantaCommon::tagFromDTD(completionDTD, tagName);
+ TQTag *tag = QuantaCommon::tagFromDTD(completionDTD, tagName);
if (!tag)
{
- tag = userTagList.find(tagName.lower());
+ tag = userTagList.tqfind(tagName.lower());
}
TQString startsWith = a_startsWith.upper();
if (tag)
@@ -1438,7 +1438,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getAttributeCompletions(con
//list common attributes for this tag
for (TQStringList::Iterator it = tag->commonGroups.begin(); it != tag->commonGroups.end(); ++it)
{
- AttributeList *attrs = tag->parentDTD->commonAttrs->find(*it);
+ AttributeList *attrs = tag->tqparentDTD->commonAttrs->tqfind(*it);
for (uint j = 0; j < attrs->count(); j++)
{
TQString name = attrs->at(j)->name;
@@ -1452,7 +1452,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getAttributeCompletions(con
}
}
- if (tag->name().contains("!doctype",false)) //special case, list all the known document types
+ if (tag->name().tqcontains("!doctype",false)) //special case, list all the known document types
{
TQStringList nickNames = DTDs::ref()->nickNameList(true);
for ( TQStringList::Iterator it = nickNames.begin(); it != nickNames.end(); ++it )
@@ -1538,7 +1538,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getAttributeValueCompletion
}
if (deleteValues)
delete values;
- int andSignPos = startsWith.find('&');
+ int andSignPos = startsWith.tqfind('&');
if (andSignPos != -1)
{
TQValueList<KTextEditor::CompletionEntry> *charCompletions = getCharacterCompletions(startsWith.mid(andSignPos + 1));
@@ -1557,7 +1557,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getCharacterCompletions(con
TQMap<TQString, KTextEditor::CompletionEntry> completionMap;
//first search for entities defined in the document
- const DTDStruct *dtdDTD = DTDs::ref()->find("dtd");
+ const DTDStruct *dtdDTD = DTDs::ref()->tqfind("dtd");
if (dtdDTD)
{
StructTreeGroup group;
@@ -1588,10 +1588,10 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getCharacterCompletions(con
KTextEditor::CompletionEntry completion;
completion.type = "charCompletion";
//add the entities from the tag files
- TQDictIterator<QTag> it(*(completionDTD->tagsList));
+ TQDictIterator<TQTag> it(*(completionDTD->tagsList));
for( ; it.current(); ++it )
{
- QTag *tag = it.current();
+ TQTag *tag = it.current();
if (tag->type == "entity")
{
TQString tagName = tag->name(true);
@@ -1616,10 +1616,10 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getCharacterCompletions(con
for ( TQStringList::Iterator it = charList.begin(); it != charList.end(); ++it )
{
completion.text = *it;
- int begin = completion.text.find("(&") + 2;
+ int begin = completion.text.tqfind("(&") + 2;
if (begin == 1)
continue;
- int length = completion.text.find(";)") - begin + 1;
+ int length = completion.text.tqfind(";)") - begin + 1;
TQString s = completion.text.mid(begin, length - 1);
completion.text = s + " : " + completion.text.left(begin -2) + " - " + completion.text.mid(begin + length + 1);
if (s.startsWith(startsWith))
@@ -1661,9 +1661,9 @@ const DTDStruct* Document::currentDTD(bool fallback)
/** Get a pointer to the default DTD (document, or app). */
const DTDStruct* Document::defaultDTD() const
{
- const DTDStruct* dtd = DTDs::ref()->find(dtdName);
- if (!dtd) dtd = DTDs::ref()->find(Project::ref()->defaultDTD());
- if (!dtd) dtd = DTDs::ref()->find(qConfig.defaultDocType); //this will always exists
+ const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName);
+ if (!dtd) dtd = DTDs::ref()->tqfind(Project::ref()->defaultDTD());
+ if (!dtd) dtd = DTDs::ref()->tqfind(qConfig.defaultDocType); //this will always exists
return dtd;
}
@@ -1682,17 +1682,17 @@ TQString Document::findDTDName(Tag **tag)
{
text = editIf->textLine(i);
//search for !DOCTYPE tags
- pos = text.find("!doctype",0,false);
+ pos = text.tqfind("!doctype",0,false);
if (pos != -1) //parse the found !DOCTYPE tag
{
int bl, bc, el, ec;
line = i;
bl = line;
- startPos = text.findRev('<',pos);
+ startPos = text.tqfindRev('<',pos);
while (startPos == -1 && line >=0)
{
text = editIf->textLine(line);
- startPos = text.findRev('<');
+ startPos = text.tqfindRev('<');
bl = line;
line--;
}
@@ -1704,12 +1704,12 @@ TQString Document::findDTDName(Tag **tag)
bc = startPos;
line = i;
text = editIf->textLine(i);
- startPos = text.find('>',pos);
+ startPos = text.tqfind('>',pos);
el = line;
while (startPos == -1 && line < endLine)
{
text = editIf->textLine(line);
- startPos = text.find('>');
+ startPos = text.tqfind('>');
el = line;
line++;
}
@@ -1724,17 +1724,17 @@ TQString Document::findDTDName(Tag **tag)
text = this->text(bl, bc, el, ec);
(*tag)->parse(text, this);
(*tag)->type = Tag::XmlTag;
- text.replace("\\\"", "\"");
- pos = text.find("public",0,false);
+ text.tqreplace("\\\"", "\"");
+ pos = text.tqfind("public",0,false);
if (pos == -1) //if no PUBLIC info, use the word after !DOCTYPE as the doc.type
{
foundText = (*tag)->attribute(0);
} else
{ //use the quoted string after PUBLIC as doc. type
- pos = text.find("\"", pos+1);
+ pos = text.tqfind("\"", pos+1);
if (pos !=-1)
{
- int endPos = text.find("\"",pos+1);
+ int endPos = text.tqfind("\"",pos+1);
foundText = text.mid(pos+1, endPos-pos-1);
}
}
@@ -1759,8 +1759,8 @@ bool Document::scriptAutoCompletion(int line, int column, const TQString& insert
if (node->prev)
node = node->prev;
else
- if (node->parent)
- node = node->parent;
+ if (node->tqparent)
+ node = node->tqparent;
int bl, bc;
node->tag->beginPos(bl, bc);
@@ -1794,11 +1794,11 @@ bool Document::scriptAutoCompletion(int line, int column, const TQString& insert
{
TQString textLine = s.left(i);
TQString word = findWordRev(textLine, completionDTD);
- TQValueList<QTag *> tags;
+ TQValueList<TQTag *> tags;
if (!word.isEmpty())
{
- tags.append(userTagList.find(word.lower()));
- TQDictIterator<QTag> it(*(completionDTD->tagsList));
+ tags.append(userTagList.tqfind(word.lower()));
+ TQDictIterator<TQTag> it(*(completionDTD->tagsList));
for( ; it.current(); ++it )
{
if (it.currentKey() == word)
@@ -1806,9 +1806,9 @@ bool Document::scriptAutoCompletion(int line, int column, const TQString& insert
}
}
TQStringList argList;
- for (TQValueList<QTag*>::ConstIterator it = tags.constBegin(); it != tags.constEnd(); ++it)
+ for (TQValueList<TQTag*>::ConstIterator it = tags.constBegin(); it != tags.constEnd(); ++it)
{
- QTag *tag = *it;
+ TQTag *tag = *it;
if (!tag)
continue;
TQString arguments;
@@ -1907,7 +1907,7 @@ TQString Document::text(const AreaStruct &area) const
return text(area.bLine, area.bCol, area.eLine, area.eCol);
}
-TQString Document::find(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol)
+TQString Document::tqfind(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol)
{
TQRegExp rx = regExp;
@@ -1937,11 +1937,11 @@ TQString Document::find(const TQRegExp& regExp, int sLine, int sCol, int& fbLine
{
foundText = rx.cap();
TQString s = textToSearch.left(pos);
- int linesUntilFound = s.contains("\n");
+ int linesUntilFound = s.tqcontains("\n");
fbLine = sLine + linesUntilFound;
- fbCol = s.length()-s.findRev("\n")-1;
- int linesInFound = foundText.contains("\n");
- feCol = foundText.length()-foundText.findRev("\n")-2;
+ fbCol = s.length()-s.tqfindRev("\n")-1;
+ int linesInFound = foundText.tqcontains("\n");
+ feCol = foundText.length()-foundText.tqfindRev("\n")-2;
feLine = fbLine + linesInFound;
if (linesUntilFound == 0)
{
@@ -1965,7 +1965,7 @@ TQString Document::find(const TQRegExp& regExp, int sLine, int sCol, int& fbLine
return foundText;
}
-TQString Document::findRev(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol)
+TQString Document::tqfindRev(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol)
{
TQRegExp rx = regExp;
TQString foundText = "";
@@ -1993,8 +1993,8 @@ TQString Document::findRev(const TQRegExp& regExp, int sLine, int sCol, int& fbL
foundText = rx.cap();
fbLine = line;
fbCol = pos;
- int linesInFound = foundText.contains("\n");
- feCol = foundText.length()-foundText.findRev("\n")-2;
+ int linesInFound = foundText.tqcontains("\n");
+ feCol = foundText.length()-foundText.tqfindRev("\n")-2;
feLine = fbLine + linesInFound;
if (linesInFound == 0)
{
@@ -2047,7 +2047,7 @@ void Document::handleCodeCompletion()
{
completionDTD = defaultDTD();
TQString s = text(line, 0, line, col).stripWhiteSpace();
- if (s.findRev("<") != -1)
+ if (s.tqfindRev("<") != -1)
{
//showCodeCompletions(getTagCompletions(line, col + 1));
@@ -2079,8 +2079,8 @@ void Document::codeCompletionHintRequested()
if (completionDTD->family == Script)
{
// TQString textLine = editIf->textLine(line).left(col);
-// int pos = textLine.findRev("(");
-// int pos2 = textLine.findRev(")");
+// int pos = textLine.tqfindRev("(");
+// int pos2 = textLine.tqfindRev(")");
//if (pos > pos2 )
hintRequested = true;
scriptAutoCompletion(line, col - 1, "");
@@ -2093,8 +2093,8 @@ TQString Document::currentWord()
uint line, col;
viewCursorIf->cursorPositionReal(&line, &col);
TQString textLine = editIf->textLine(line);
- int startPos = textLine.findRev(TQRegExp("\\W"), col);
- int endPos = textLine.find(TQRegExp("\\W"), col);
+ int startPos = textLine.tqfindRev(TQRegExp("\\W"), col);
+ int endPos = textLine.tqfind(TQRegExp("\\W"), col);
if (startPos == -1)
startPos = 0;
else
@@ -2114,7 +2114,7 @@ TQString Document::findWordRev(const TQString& textToSearch, const DTDStruct *dt
int pos;
bool end = false;
do{
- pos = t.findRev(TQRegExp("\\W"), startPos);
+ pos = t.tqfindRev(TQRegExp("\\W"), startPos);
if (t[pos] == '_' ||
(dtd && dtd->minusAllowedInWord && t[pos] == '-'))
{
@@ -2155,9 +2155,9 @@ bool Document::xmlCodeCompletion(int line, int col)
if (index != -1) //inside a value
{
s = tag->attribute(index);
- if (s == "style" && completionDTD->insideDTDs.contains("css"))
+ if (s == "style" && completionDTD->insideDTDs.tqcontains("css"))
{
- completionDTD = DTDs::ref()->find("text/css");
+ completionDTD = DTDs::ref()->tqfind("text/css");
return scriptAutoCompletion(line, col, "");
} else
{
@@ -2190,7 +2190,7 @@ bool Document::xmlCodeCompletion(int line, int col)
if (!handled)
{
TQString s = editIf->textLine(line).left(col);
- int pos = s.findRev('&');
+ int pos = s.tqfindRev('&');
if (pos != -1)
{
s = s.mid(pos + 1);
@@ -2212,7 +2212,7 @@ void Document::slotCompletionAborted()
}
/** Ask for user confirmation if the file was changed outside. */
-void Document::checkDirtyStatus()
+void Document::checkDirtytqStatus()
{
TQString fileName;
if (url().isLocalFile())
@@ -2236,7 +2236,7 @@ void Document::checkDirtyStatus()
const char* c = "";
KMD5 context(c);
context.reset();
- context.update(f);
+ context.update(*TQT_TQIODEVICE(&f));
m_md5sum = context.hexDigest();
f.close();
}
@@ -2252,7 +2252,7 @@ void Document::checkDirtyStatus()
const char* c = "";
KMD5 context(c);
context.reset();
- context.update(f);
+ context.update(*TQT_TQIODEVICE(&f));
md5sum = context.hexDigest();
kdDebug(24000) << "MD5 sum of current doc: " << m_md5sum << endl;
kdDebug(24000) << "MD5 sum of doc on disc : " << md5sum << endl;
@@ -2323,7 +2323,7 @@ bool Document::saveAs(const KURL& url)
const char* c = "";
KMD5 context(c);
context.reset();
- context.update(f);
+ context.update(*TQT_TQIODEVICE(&f));
m_md5sum = context.hexDigest();
f.close();
}
@@ -2338,7 +2338,7 @@ void Document::enableGroupsForDTEP(const TQString& dtepName, bool enable)
m_groupsForDTEPs = m_DTEPList;
if (enable)
{
- if (m_groupsForDTEPs.contains(dtepName) == 0)
+ if (m_groupsForDTEPs.tqcontains(dtepName) == 0)
m_groupsForDTEPs.append(dtepName);
} else
{
@@ -2354,7 +2354,7 @@ void Document::resetGroupsForDTEPList()
/** Returns true if the number of " (excluding \") inside text is even. */
bool Document::evenQuotes(const TQString &text)
{
- int num = text.contains(TQRegExp("[^\\\\]\""));
+ int num = text.tqcontains(TQRegExp("[^\\\\]\""));
return (num /2 *2 == num);
}
@@ -2521,7 +2521,7 @@ TQStringList* Document::tagAttributeValues(const TQString& dtdName, const TQStri
{
TQStringList *values = 0L;
deleteResult = true;
- const DTDStruct* dtd = DTDs::ref()->find(dtdName);
+ const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName);
if (dtd)
{
TQString searchForAttr = (dtd->caseSensitive) ? attribute : attribute.upper();
@@ -2546,7 +2546,7 @@ TQStringList* Document::tagAttributeValues(const TQString& dtdName, const TQStri
for (uint i = 0; i < values->count(); i++)
{
u = (*values)[i];
- u = QExtFileInfo::toRelative(u, base);
+ u = TQExtFileInfo::toRelative(u, base);
(*values)[i] = u.path();
}
values->remove(values->at(0));
@@ -2576,9 +2576,9 @@ bool Document::hasChanged()
return b;
}
-void Document::setChanged(bool newStatus)
+void Document::setChanged(bool newtqStatus)
{
- changed = newStatus;
+ changed = newtqStatus;
}
void Document::paste()
@@ -2614,7 +2614,7 @@ TQStringList Document::tagAreas(const TQString& tag, bool includeCoordinates, bo
TQString s = text(bl, bc, el, ec);
if (includeCoordinates)
{
- s.prepend(TQString("%1,%2,%3,%4\n").arg(bl).arg(bc).arg(el).arg(ec));
+ s.prepend(TQString("%1,%2,%3,%4\n").tqarg(bl).tqarg(bc).tqarg(el).tqarg(ec));
}
result += s;
if (skipFoundContent)
@@ -2632,7 +2632,7 @@ TQStringList Document::tagAreas(const TQString& tag, bool includeCoordinates, bo
void Document::activateRepaintView(bool activation)
{
- repaintEnabled = activation;
+ tqrepaintEnabled = activation;
m_view->setUpdatesEnabled(activation);
}
@@ -2691,7 +2691,7 @@ void Document::createBackup(KConfig* config)
config->setGroup("General Options");
TQStringList backedupFilesEntryList = QuantaCommon::readPathListEntry(config, "List of backedup files"); //the files that were backedup
TQStringList autosavedFilesEntryList = QuantaCommon::readPathListEntry(config, "List of autosaved files"); //the list of actual backup files inside $KDEHOME/share/apps/quanta/backups
- if (!autosavedFilesEntryList.contains(backupPathValueURL)) //not yet backed up, add an entry for this file
+ if (!autosavedFilesEntryList.tqcontains(backupPathValueURL)) //not yet backed up, add an entry for this file
{
autosavedFilesEntryList.append(backupPathValueURL);
config->writePathEntry("List of autosaved files", autosavedFilesEntryList);
@@ -2875,10 +2875,10 @@ void Document::open(const KURL &url, const TQString &encoding)
connect(m_doc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotOpeningCompleted()));
connect(m_doc, TQT_SIGNAL(canceled(const TQString&)), this, TQT_SLOT(slotOpeningFailed(const TQString&)));
if (!openURL(url))
- slotOpeningFailed(TQString::null);
+ slotOpeningFailed(TQString());
if (!url.isLocalFile())
{
- QExtFileInfo internalFileInfo;
+ TQExtFileInfo internalFileInfo;
internalFileInfo.enter_loop();
}
}
@@ -2889,7 +2889,7 @@ void Document::slotOpeningCompleted()
if (!u.isLocalFile())
{
m_modifTime = TQDateTime();
- qApp->exit_loop();
+ tqApp->exit_loop();
}
else
{
@@ -2910,7 +2910,7 @@ void Document::slotOpeningFailed(const TQString &errorMessage)
m_md5sum = "";
Q_UNUSED(errorMessage); //TODO: append the error message to our own error message
if (!url().isLocalFile())
- qApp->exit_loop();
+ tqApp->exit_loop();
disconnect(m_doc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotOpeningCompleted()));
disconnect(m_doc, TQT_SIGNAL(canceled(const TQString&)), this, TQT_SLOT(slotOpeningFailed(const TQString&)));
emit openingFailed(url());
@@ -2943,11 +2943,11 @@ void Document::processDTD(const TQString& documentType)
}
}
- if (!DTDs::ref()->find(foundName))
+ if (!DTDs::ref()->tqfind(foundName))
{
//try to find the closest matching DTD
TQString s = foundName.lower();
- uint spaceNum = s.contains(' ');
+ uint spaceNum = s.tqcontains(' ');
TQStringList dtdList = DTDs::ref()->nameList();
TQStringList lastDtdList;
for (uint i = 0; i <= spaceNum && !dtdList.empty(); i++)
@@ -3006,7 +3006,7 @@ void Document::processDTD(const TQString& documentType)
{
qConfig.showDTDSelectDialog = !dtdWidget->useClosestMatching->isChecked();
setDTDIdentifier(DTDs::ref()->getDTDNameFromNickName(dtdWidget->dtdCombo->currentText()));
- const DTDStruct *dtd = DTDs::ref()->find(dtdName);
+ const DTDStruct *dtd = DTDs::ref()->tqfind(dtdName);
if (dtdWidget->convertDTD->isChecked() && dtd->family == Xml)
{
int bLine, bCol, eLine, eCol;
@@ -3024,12 +3024,12 @@ void Document::processDTD(const TQString& documentType)
TQString dtdId = DTDs::ref()->DTDforURL(u)->name;
// if (dtdId == "empty")
{
- const DTDStruct * dtd = DTDs::ref()->find(projectDTD);
+ const DTDStruct * dtd = DTDs::ref()->tqfind(projectDTD);
if (DTDs::canHandle(dtd, u))
dtdId = projectDTD;
else
{
- dtd = DTDs::ref()->find(qConfig.defaultDocType);
+ dtd = DTDs::ref()->tqfind(qConfig.defaultDocType);
if (DTDs::canHandle(dtd, u))
dtdId = qConfig.defaultDocType;
}
@@ -3043,7 +3043,7 @@ void Document::processDTD(const TQString& documentType)
if (!isUntitled())
{
- quantaApp->messageOutput()->showMessage(i18n("\"%1\" is used for \"%2\".\n").arg(DTDs::ref()->getDTDNickNameFromName(dtdName)).arg(url().prettyURL(0, KURL::StripFileProtocol)));
+ quantaApp->messageOutput()->showMessage(i18n("\"%1\" is used for \"%2\".\n").tqarg(DTDs::ref()->getDTDNickNameFromName(dtdName)).tqarg(url().prettyURL(0, KURL::StripFileProtocol)));
}
quantaApp->slotLoadToolbarForDTD(dtdName);
StructTreeView::ref()->useOpenLevelSetting = true;
@@ -3056,10 +3056,10 @@ void Document::slotFileDirty(const TQString& fileName)
{
if ( url().path() == fileName && !dirty() )
{
- setDirtyStatus(true);
+ setDirtytqStatus(true);
if (this == ViewManager::ref()->activeDocument())
{
- checkDirtyStatus();
+ checkDirtytqStatus();
}
}
}
@@ -3083,7 +3083,7 @@ void Document::resetDTEPs()
void Document::addDTEP(const TQString &dtepName)
{
- if (m_DTEPList.contains(dtepName) == 0)
+ if (m_DTEPList.tqcontains(dtepName) == 0)
{
m_DTEPList.append(dtepName);
}
@@ -3099,11 +3099,11 @@ TQStringList Document::groupsForDTEPs()
TQString Document::annotationText(uint line)
{
- TQMap<uint, QPair<TQString, TQString> >::Iterator it = m_annotations.find(line);
+ TQMap<uint, TQPair<TQString, TQString> >::Iterator it = m_annotations.tqfind(line);
if (it != m_annotations.end())
return it.data().first;
else
- return TQString::null;
+ return TQString();
}
void Document::setAnnotationText(uint line, const TQString& text)
@@ -3115,7 +3115,7 @@ void Document::setAnnotationText(uint line, const TQString& text)
markIf->removeMark(line, KTextEditor::MarkInterface::markType08);
} else
{
- m_annotations.insert(line, qMakePair(text, TQString("")));
+ m_annotations.insert(line, tqMakePair(text, TQString("")));
if (markIf)
markIf->setMark(line, KTextEditor::MarkInterface::markType08);
uint line, column;
@@ -3147,11 +3147,11 @@ void Document::setAnnotationText(uint line, const TQString& text)
s.prepend(commentBegin + " ");
s.append(" " + commentEnd + "\n");
insertText(s, true, true);
- emit showAnnotation(line, "", qMakePair(text, TQString("")));
+ emit showAnnotation(line, "", tqMakePair(text, TQString("")));
}
}
-void Document::addAnnotation(uint line, const QPair<TQString, TQString>& annotation)
+void Document::addAnnotation(uint line, const TQPair<TQString, TQString>& annotation)
{
m_annotations.insert(line, annotation);
if (markIf)
@@ -3181,7 +3181,7 @@ bool Document::openURL(const KURL& url)
const char* c = "";
KMD5 context(c);
context.reset();
- context.update(f);
+ context.update(*TQT_TQIODEVICE(&f));
m_md5sum = context.hexDigest();
f.close();
}