diff options
Diffstat (limited to 'quanta/src')
-rw-r--r-- | quanta/src/dcopquanta.cpp | 12 | ||||
-rw-r--r-- | quanta/src/dcopsettings.cpp | 6 | ||||
-rw-r--r-- | quanta/src/document.cpp | 142 | ||||
-rw-r--r-- | quanta/src/document.h | 4 | ||||
-rw-r--r-- | quanta/src/dtds.cpp | 42 | ||||
-rw-r--r-- | quanta/src/dtds.h | 10 | ||||
-rw-r--r-- | quanta/src/kqapp.cpp | 2 | ||||
-rw-r--r-- | quanta/src/quanta.cpp | 114 | ||||
-rw-r--r-- | quanta/src/quanta_init.cpp | 26 | ||||
-rw-r--r-- | quanta/src/quantadoc.cpp | 8 | ||||
-rw-r--r-- | quanta/src/quantaview.cpp | 6 | ||||
-rw-r--r-- | quanta/src/viewmanager.cpp | 8 |
12 files changed, 190 insertions, 190 deletions
diff --git a/quanta/src/dcopquanta.cpp b/quanta/src/dcopquanta.cpp index 8dde34bc..149240d6 100644 --- a/quanta/src/dcopquanta.cpp +++ b/quanta/src/dcopquanta.cpp @@ -40,11 +40,11 @@ TQStringList DCOPQuanta::selectors(const TQString& tag) if (key.startsWith("Selectors|")) { TQString selectorName = key.mid(10); - int index = selectorName.tqfind(':'); + int index = selectorName.find(':'); if (index != -1) selectorName = selectorName.mid(0, index); TQString tmpStr; - index = selectorName.tqfind(rx); + index = selectorName.find(rx); if (index != -1) { tmpStr = selectorName.left(index).lower(); @@ -54,8 +54,8 @@ TQStringList DCOPQuanta::selectors(const TQString& tag) } if (tmpStr.isEmpty() || tag.lower() == tmpStr || tmpStr == "*") { - tmpStr = selectorName.mid(index + 1).tqreplace('.',' '); - if (!tmpStr.isEmpty() && !selectorList.tqcontains(tmpStr)) + tmpStr = selectorName.mid(index + 1).replace('.',' '); + if (!tmpStr.isEmpty() && !selectorList.contains(tmpStr)) selectorList << tmpStr; } } @@ -93,11 +93,11 @@ TQStringList DCOPQuanta::groupElements(const TQString& group) if (key.startsWith(group + "|")) { TQString name = key.mid(10); - int index = name.tqfind(':'); + int index = name.find(':'); if (index != -1) name = name.mid(0, index); TQString tmpStr; - index = name.tqfind("|"); + index = name.find("|"); if (index != -1) { tmpStr = name.left(index).lower(); diff --git a/quanta/src/dcopsettings.cpp b/quanta/src/dcopsettings.cpp index c640b956..504eca84 100644 --- a/quanta/src/dcopsettings.cpp +++ b/quanta/src/dcopsettings.cpp @@ -28,9 +28,9 @@ DCOPSettings::DCOPSettings() : DCOPObject("SettingsIf") TQString DCOPSettings::encoding() { TQString encoding = quantaApp->defaultEncoding(); - encoding.tqreplace("iso ", "iso-"); //it's said that "iso-8859-x" is the valid format - encoding.tqreplace("utf", "utf-"); //it's said that "utf-x" is the valid format - encoding.tqreplace("cp ", "windows-"); + encoding.replace("iso ", "iso-"); //it's said that "iso-8859-x" is the valid format + encoding.replace("utf", "utf-"); //it's said that "utf-x" is the valid format + encoding.replace("cp ", "windows-"); return encoding; } diff --git a/quanta/src/document.cpp b/quanta/src/document.cpp index 9b136e58..4e715a4a 100644 --- a/quanta/src/document.cpp +++ b/quanta/src/document.cpp @@ -461,8 +461,8 @@ void Document::insertText(const TQString &a_text, bool adjustCursor, bool repars } if (insideQuotes && closeQuotationFound) { - text.tqreplace("\\\"", "\""); - text.tqreplace("\"", "\\\""); + text.replace("\\\"", "\""); + text.replace("\"", "\\\""); } } @@ -669,8 +669,8 @@ TQString Document::getTagNameAt(int line, int col ) while (line >= 0) { QuantaCommon::removeCommentsAndQuotes(textLine, completionDTD); - int pos = textLine.tqfindRev("<"); - int pos2 = textLine.tqfindRev(">"); + int pos = textLine.findRev("<"); + int pos2 = textLine.findRev(">"); 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.tqfind(":"); + pos = name.find(":"); if (pos != -1) name = name.mid(pos + 1); break; @@ -778,7 +778,7 @@ void Document::slotFilterCompletion( KTextEditor::CompletionEntry *completion ,T { kdDebug(24000) << *string << endl; kdDebug(24000) << completion->userdata << endl; - int pos = completion->userdata.tqfind("|"); + int pos = completion->userdata.find("|"); 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.tqfindRev('&'); + int pos = s2.findRev('&'); 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()->tqfind(DTDs::ref()->getDTDNameFromNickName(s)); + const DTDStruct *dtd = DTDs::ref()->find(DTDs::ref()->getDTDNameFromNickName(s)); if (dtd && !dtd->url.isEmpty()) { s2 += " \""+dtd->url+"\""; @@ -942,7 +942,7 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string) tagName = getTagNameAt(line, column); tag = QuantaCommon::tagFromDTD(completionDTD, tagName); if (!tag && !tagName.isEmpty()) - tag = userTagList.tqfind(tagName.lower()); + tag = userTagList.find(tagName.lower()); TQString s = editIf->textLine(line).left(column + 1); bool namespacecompletion = false; @@ -984,7 +984,7 @@ bool Document::xmlAutoCompletion(int line, int column, const TQString & string) if (node->tag->type == Tag::XmlTag && (!node->next || !QuantaCommon::closesTag(node->tag, node->next->tag))) { TQString name = node->tag->name; - name = name.left(name.tqfind(" | ")); + name = name.left(name.find(" | ")); if (!node->tag->nameSpace.isEmpty()) name.prepend(node->tag->nameSpace + ":"); editIf->insertText(line, column + 1, name + ">"); @@ -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.tqfindRev(' ')+1); - if (attribute == "style" && completionDTD->insideDTDs.tqcontains("css")) + TQString attribute = textLine.mid(textLine.findRev(' ')+1); + if (attribute == "style" && completionDTD->insideDTDs.contains("css")) { - completionDTD = DTDs::ref()->tqfind("text/css"); + completionDTD = DTDs::ref()->find("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.tqfindRev('"'); + int pos = textLine.findRev('"'); if (pos != -1) { - pos = textLine.tqfindRev(' ', pos); + pos = textLine.findRev(' ', pos); if (pos != -1) { textLine = textLine.mid(pos + 1); - pos = textLine.tqfind('='); + pos = textLine.find('='); if (pos != -1) { TQString attribute = textLine.left(pos); - if (attribute == "style" && completionDTD->insideDTDs.tqcontains("css")) + if (attribute == "style" && completionDTD->insideDTDs.contains("css")) { - completionDTD = DTDs::ref()->tqfind("text/css"); + completionDTD = DTDs::ref()->find("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.tqfindRev('&'); + pos = s.findRev('&'); if (pos != -1) { //complete character codes @@ -1169,7 +1169,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getGroupCompletions(Node *n bool Document::isDerivatedFrom(const TQString& className, const TQString &baseClass) { - if (className.isEmpty() || !completionDTD->classInheritance.tqcontains(className)) + if (className.isEmpty() || !completionDTD->classInheritance.contains(className)) return false; TQString parentClass = completionDTD->classInheritance[className]; @@ -1179,7 +1179,7 @@ bool Document::isDerivatedFrom(const TQString& className, const TQString &baseCl result = 1; //className extends baseClass else { - if (completionDTD->classInheritance.tqcontains(parentClass)) + if (completionDTD->classInheritance.contains(parentClass)) parentClass = completionDTD->classInheritance[parentClass]; else result = -1;//nothing was found in the inheritance list @@ -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.tqcontains("variable")) + if(completion.type.contains("variable")) { // Insert after the last variable variableIt++; @@ -1374,7 +1374,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getTagCompletions(int line, } else { - if(completion.type.tqcontains("script")) + if(completion.type.contains("script")) { //Scripts can go at the end of the list completions->append(completion); @@ -1407,7 +1407,7 @@ TQValueList<KTextEditor::CompletionEntry>* Document::getAttributeCompletions(con TQTag *tag = QuantaCommon::tagFromDTD(completionDTD, tagName); if (!tag) { - tag = userTagList.tqfind(tagName.lower()); + tag = userTagList.find(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->tqfind(*it); + AttributeList *attrs = tag->parentDTD->commonAttrs->find(*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().tqcontains("!doctype",false)) //special case, list all the known document types + if (tag->name().contains("!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.tqfind('&'); + int andSignPos = startsWith.find('&'); 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()->tqfind("dtd"); + const DTDStruct *dtdDTD = DTDs::ref()->find("dtd"); if (dtdDTD) { StructTreeGroup group; @@ -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.tqfind("(&") + 2; + int begin = completion.text.find("(&") + 2; if (begin == 1) continue; - int length = completion.text.tqfind(";)") - begin + 1; + int length = completion.text.find(";)") - 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()->tqfind(dtdName); - if (!dtd) dtd = DTDs::ref()->tqfind(Project::ref()->defaultDTD()); - if (!dtd) dtd = DTDs::ref()->tqfind(qConfig.defaultDocType); //this will always exists + 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 return dtd; } @@ -1682,17 +1682,17 @@ TQString Document::findDTDName(Tag **tag) { text = editIf->textLine(i); //search for !DOCTYPE tags - pos = text.tqfind("!doctype",0,false); + pos = text.find("!doctype",0,false); if (pos != -1) //parse the found !DOCTYPE tag { int bl, bc, el, ec; line = i; bl = line; - startPos = text.tqfindRev('<',pos); + startPos = text.findRev('<',pos); while (startPos == -1 && line >=0) { text = editIf->textLine(line); - startPos = text.tqfindRev('<'); + startPos = text.findRev('<'); bl = line; line--; } @@ -1704,12 +1704,12 @@ TQString Document::findDTDName(Tag **tag) bc = startPos; line = i; text = editIf->textLine(i); - startPos = text.tqfind('>',pos); + startPos = text.find('>',pos); el = line; while (startPos == -1 && line < endLine) { text = editIf->textLine(line); - startPos = text.tqfind('>'); + startPos = text.find('>'); 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.tqreplace("\\\"", "\""); - pos = text.tqfind("public",0,false); + text.replace("\\\"", "\""); + pos = text.find("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.tqfind("\"", pos+1); + pos = text.find("\"", pos+1); if (pos !=-1) { - int endPos = text.tqfind("\"",pos+1); + int endPos = text.find("\"",pos+1); foundText = text.mid(pos+1, endPos-pos-1); } } @@ -1797,7 +1797,7 @@ bool Document::scriptAutoCompletion(int line, int column, const TQString& insert TQValueList<TQTag *> tags; if (!word.isEmpty()) { - tags.append(userTagList.tqfind(word.lower())); + tags.append(userTagList.find(word.lower())); TQDictIterator<TQTag> it(*(completionDTD->tagsList)); for( ; it.current(); ++it ) { @@ -1907,7 +1907,7 @@ TQString Document::text(const AreaStruct &area) const return text(area.bLine, area.bCol, area.eLine, area.eCol); } -TQString Document::tqfind(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol) +TQString Document::find(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol) { TQRegExp rx = regExp; @@ -1937,11 +1937,11 @@ TQString Document::tqfind(const TQRegExp& regExp, int sLine, int sCol, int& fbLi { foundText = rx.cap(); TQString s = textToSearch.left(pos); - int linesUntilFound = s.tqcontains("\n"); + int linesUntilFound = s.contains("\n"); fbLine = sLine + linesUntilFound; - fbCol = s.length()-s.tqfindRev("\n")-1; - int linesInFound = foundText.tqcontains("\n"); - feCol = foundText.length()-foundText.tqfindRev("\n")-2; + fbCol = s.length()-s.findRev("\n")-1; + int linesInFound = foundText.contains("\n"); + feCol = foundText.length()-foundText.findRev("\n")-2; feLine = fbLine + linesInFound; if (linesUntilFound == 0) { @@ -1965,7 +1965,7 @@ TQString Document::tqfind(const TQRegExp& regExp, int sLine, int sCol, int& fbLi return foundText; } -TQString Document::tqfindRev(const TQRegExp& regExp, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol) +TQString Document::findRev(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::tqfindRev(const TQRegExp& regExp, int sLine, int sCol, int& f foundText = rx.cap(); fbLine = line; fbCol = pos; - int linesInFound = foundText.tqcontains("\n"); - feCol = foundText.length()-foundText.tqfindRev("\n")-2; + int linesInFound = foundText.contains("\n"); + feCol = foundText.length()-foundText.findRev("\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.tqfindRev("<") != -1) + if (s.findRev("<") != -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.tqfindRev("("); -// int pos2 = textLine.tqfindRev(")"); +// int pos = textLine.findRev("("); +// int pos2 = textLine.findRev(")"); //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.tqfindRev(TQRegExp("\\W"), col); - int endPos = textLine.tqfind(TQRegExp("\\W"), col); + int startPos = textLine.findRev(TQRegExp("\\W"), col); + int endPos = textLine.find(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.tqfindRev(TQRegExp("\\W"), startPos); + pos = t.findRev(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.tqcontains("css")) + if (s == "style" && completionDTD->insideDTDs.contains("css")) { - completionDTD = DTDs::ref()->tqfind("text/css"); + completionDTD = DTDs::ref()->find("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.tqfindRev('&'); + int pos = s.findRev('&'); if (pos != -1) { s = s.mid(pos + 1); @@ -2338,7 +2338,7 @@ void Document::enableGroupsForDTEP(const TQString& dtepName, bool enable) m_groupsForDTEPs = m_DTEPList; if (enable) { - if (m_groupsForDTEPs.tqcontains(dtepName) == 0) + if (m_groupsForDTEPs.contains(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.tqcontains(TQRegExp("[^\\\\]\"")); + int num = text.contains(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()->tqfind(dtdName); + const DTDStruct* dtd = DTDs::ref()->find(dtdName); if (dtd) { TQString searchForAttr = (dtd->caseSensitive) ? attribute : attribute.upper(); @@ -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.tqcontains(backupPathValueURL)) //not yet backed up, add an entry for this file + if (!autosavedFilesEntryList.contains(backupPathValueURL)) //not yet backed up, add an entry for this file { autosavedFilesEntryList.append(backupPathValueURL); config->writePathEntry("List of autosaved files", autosavedFilesEntryList); @@ -2943,11 +2943,11 @@ void Document::processDTD(const TQString& documentType) } } - if (!DTDs::ref()->tqfind(foundName)) + if (!DTDs::ref()->find(foundName)) { //try to find the closest matching DTD TQString s = foundName.lower(); - uint spaceNum = s.tqcontains(' '); + uint spaceNum = s.contains(' '); 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()->tqfind(dtdName); + const DTDStruct *dtd = DTDs::ref()->find(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()->tqfind(projectDTD); + const DTDStruct * dtd = DTDs::ref()->find(projectDTD); if (DTDs::canHandle(dtd, u)) dtdId = projectDTD; else { - dtd = DTDs::ref()->tqfind(qConfig.defaultDocType); + dtd = DTDs::ref()->find(qConfig.defaultDocType); if (DTDs::canHandle(dtd, u)) dtdId = qConfig.defaultDocType; } @@ -3083,7 +3083,7 @@ void Document::resetDTEPs() void Document::addDTEP(const TQString &dtepName) { - if (m_DTEPList.tqcontains(dtepName) == 0) + if (m_DTEPList.contains(dtepName) == 0) { m_DTEPList.append(dtepName); } @@ -3099,7 +3099,7 @@ TQStringList Document::groupsForDTEPs() TQString Document::annotationText(uint line) { - TQMap<uint, TQPair<TQString, TQString> >::Iterator it = m_annotations.tqfind(line); + TQMap<uint, TQPair<TQString, TQString> >::Iterator it = m_annotations.find(line); if (it != m_annotations.end()) return it.data().first; else diff --git a/quanta/src/document.h b/quanta/src/document.h index 639ff27d..360b9a4c 100644 --- a/quanta/src/document.h +++ b/quanta/src/document.h @@ -103,8 +103,8 @@ public: bool insertChildTags(TQTag *tag, TQTag* lastTag = 0L); TQPoint getGlobalCursorPos(); - TQString tqfind(const TQRegExp& rx, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol); - TQString tqfindRev(const TQRegExp& rx, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol); + TQString find(const TQRegExp& rx, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol); + TQString findRev(const TQRegExp& rx, int sLine, int sCol, int& fbLine, int&fbCol, int &feLine, int&feCol); /** Get the view of the document */ KTextEditor::View* view(); /** Get the KTextEditor::Document of the document */ diff --git a/quanta/src/dtds.cpp b/quanta/src/dtds.cpp index d6bdd9e1..7b26bc7a 100644 --- a/quanta/src/dtds.cpp +++ b/quanta/src/dtds.cpp @@ -120,9 +120,9 @@ DTDs::DTDs(TQObject *tqparent) DTDStruct * dtd = it.current(); for (uint i = 0; i < dtd->insideDTDs.count(); i++) { - const DTDStruct *insideDTD = m_dict->tqfind(dtd->insideDTDs[i]); // search but don't load + const DTDStruct *insideDTD = m_dict->find(dtd->insideDTDs[i]); // search but don't load if (!insideDTD) - insideDTD = m_dict->tqfind(getDTDNameFromNickName(dtd->insideDTDs[i])); // search but don't load + insideDTD = m_dict->find(getDTDNameFromNickName(dtd->insideDTDs[i])); // search but don't load if (insideDTD && !insideDTD->toplevel) dtd->mimeTypes += insideDTD->mimeTypes; } @@ -168,7 +168,7 @@ bool DTDs::readTagDir(const TQString &dirName, bool loadAll) KConfig *dtdConfig = new KConfig(tmpStr, true); dtdConfig->setGroup("General"); TQString dtdName = dtdConfig->readEntry("Name", "Unknown"); - if (m_dict->tqfind(dtdName.lower())) + if (m_dict->find(dtdName.lower())) { delete dtdConfig; kdDebug(24000) << "dtds::readTagDir from " << dirName @@ -205,8 +205,8 @@ bool DTDs::readTagDir(const TQString &dirName, bool loadAll) for (uint i = 0; i < tmpStrList.count(); i++) { tmpStr = tmpStrList[i].stripWhiteSpace(); - int pos = tmpStr.tqfind('('); - dtd->definitionTags[tmpStr.left(pos).stripWhiteSpace()] = tmpStr.mid(pos+1, tmpStr.tqfindRev(')')-pos-1).stripWhiteSpace(); + int pos = tmpStr.find('('); + dtd->definitionTags[tmpStr.left(pos).stripWhiteSpace()] = tmpStr.mid(pos+1, tmpStr.findRev(')')-pos-1).stripWhiteSpace(); } //Which DTD can be present in this one? dtd->insideDTDs = dtdConfig->readListEntry("MayContain"); @@ -317,7 +317,7 @@ bool DTDs::readTagDir2(DTDStruct *dtd) tag->setName(TQString(extraTagsList.at(i)).stripWhiteSpace()); tmpStr = (dtd->caseSensitive) ? tag->name() : tag->name().upper(); - if (tagList->tqfind(tmpStr)) //the tag is already defined in a .tag file + if (tagList->find(tmpStr)) //the tag is already defined in a .tag file { delete tag; continue; //skip this tag @@ -422,8 +422,8 @@ bool DTDs::readTagDir2(DTDStruct *dtd) for (uint i = 0; i < tmpStrList.count(); i++) { tmpStr = tmpStrList[i].stripWhiteSpace(); - int pos = tmpStr.tqfind('('); - dtd->specialTags[tmpStr.left(pos).stripWhiteSpace()] = tmpStr.mid(pos+1, tmpStr.tqfindRev(')')-pos-1).stripWhiteSpace(); + int pos = tmpStr.find('('); + dtd->specialTags[tmpStr.left(pos).stripWhiteSpace()] = tmpStr.mid(pos+1, tmpStr.findRev(')')-pos-1).stripWhiteSpace(); } //static const TQString quotationStr = "\\\\\"|\\\\'"; @@ -595,7 +595,7 @@ bool DTDs::readTagDir2(DTDStruct *dtd) attrRx.search(tagStr); tmpStr = attrRx.cap(); tmpStrList = TQStringList::split(',', tmpStr.mid(1, tmpStr.length()-2)); - tagName = tagStr.left(tagStr.tqfind('(')).lower(); + tagName = tagStr.left(tagStr.find('(')).lower(); group.attributes.clear(); for (uint i = 0; i < tmpStrList.count(); i++) group.attributes += tmpStrList[i].stripWhiteSpace(); @@ -620,13 +620,13 @@ void DTDs::resolveInherited (DTDStruct *dtd) //Resolve the inheritence if (!dtd->inheritsTagsFrom.isEmpty()) { - DTDStruct *tqparent = (DTDStruct *) tqfind(dtd->inheritsTagsFrom); // this loads the dtd, if not present in memory + DTDStruct *tqparent = (DTDStruct *) find(dtd->inheritsTagsFrom); // this loads the dtd, if not present in memory TQDictIterator<TQTag> tag_it(*(tqparent->tagsList)); for ( ; tag_it.current(); ++tag_it) { TQTag *tag = tag_it.current(); TQString searchForTag = (dtd->caseSensitive) ? tag->name() : tag->name().upper(); - if (!dtd->tagsList->tqfind(searchForTag)) + if (!dtd->tagsList->find(searchForTag)) { TQTag *newTag = new TQTag(*tag); dtd->tagsList->insert(searchForTag, newTag); @@ -642,9 +642,9 @@ void DTDs::resolveInherited (DTDStruct *dtd) specialAreaStartRxStr += "|"; for (uint i = 0; i < dtd->insideDTDs.count(); i++) { - const DTDStruct *insideDTD = m_dict->tqfind(dtd->insideDTDs[i]); // search but don't load + const DTDStruct *insideDTD = m_dict->find(dtd->insideDTDs[i]); // search but don't load if (!insideDTD) - insideDTD = m_dict->tqfind(getDTDNameFromNickName(dtd->insideDTDs[i])); // search but don't load + insideDTD = m_dict->find(getDTDNameFromNickName(dtd->insideDTDs[i])); // search but don't load if (insideDTD) { for (mapIt = insideDTD->definitionAreas.begin(); mapIt != insideDTD->definitionAreas.end(); ++mapIt) @@ -725,10 +725,10 @@ uint DTDs::readTagFile(const TQString& fileName, DTDStruct* parentDTD, TQTagList { if (parentDTD->caseSensitive) { - tagList->tqreplace(tag->name(), tag); //append the tag to the list for this DTD + tagList->replace(tag->name(), tag); //append the tag to the list for this DTD } else { - tagList->tqreplace(tag->name().upper(), tag); + tagList->replace(tag->name().upper(), tag); } } } @@ -912,7 +912,7 @@ void DTDs::slotLoadDTD() dtdcfg.setGroup("General"); TQString dtdName = dtdcfg.readEntry("Name"); TQString nickName = dtdcfg.readEntry("NickName", dtdName); - DTDStruct * dtd = m_dict->tqfind(dtdName) ; + DTDStruct * dtd = m_dict->find(dtdName) ; if (dtd && KMessageBox::warningYesNo(0L, i18n("<qt>Do you want to replace the existing <b>%1</b> DTD?</qt>").tqarg(nickName), TQString(), i18n("Replace"), i18n("Do Not Replace")) == KMessageBox::No) { @@ -944,7 +944,7 @@ void DTDs::slotLoadDTEP(const TQString &_dirName, bool askForAutoload) dtdcfg.setGroup("General"); TQString dtdName = dtdcfg.readEntry("Name"); TQString nickName = dtdcfg.readEntry("NickName", dtdName); - DTDStruct * dtd = m_dict->tqfind(dtdName) ; + DTDStruct * dtd = m_dict->find(dtdName) ; if ( dtd && KMessageBox::warningYesNo(0L, i18n("<qt>Do you want to replace the existing <b>%1</b> DTD?</qt>").tqarg(nickName), TQString(), i18n("Replace"), i18n("Do Not Replace")) == KMessageBox::No) { @@ -987,12 +987,12 @@ void DTDs::slotLoadEntities() if (w) { TQString nickName = DTDs::ref()->getDTDNickNameFromName(w->getDTDIdentifier()); - entitiesWidget.targetDTEPCombo->setCurrentItem(lst.tqfindIndex(nickName)); + entitiesWidget.targetDTEPCombo->setCurrentItem(lst.findIndex(nickName)); } dlg.setMainWidget(&entitiesWidget); if (dlg.exec()) { - DTDStruct * dtd = m_dict->tqfind(getDTDNameFromNickName(entitiesWidget.targetDTEPCombo->currentText())); + DTDStruct * dtd = m_dict->find(getDTDNameFromNickName(entitiesWidget.targetDTEPCombo->currentText())); DTDParser dtdParser(KURL::fromPathOrURL(entitiesWidget.sourceDTDRequester->url()), KGlobal::dirs()->saveLocation("data") + resourceDir + "dtep"); TQString dtdDir = TQFileInfo(dtd->fileName).dirPath(); if (dtdParser.parse(dtdDir, true)) @@ -1077,7 +1077,7 @@ const DTDStruct * DTDs::DTDforURL(const KURL &url) } } if (foundList.isEmpty()) - return tqfind("empty"); + return find("empty"); else { TQString path = url.path(); @@ -1093,7 +1093,7 @@ const DTDStruct * DTDs::DTDforURL(const KURL &url) bool DTDs::canHandle(const DTDStruct *dtd, const KURL &url) { TQString mimetype = KMimeType::findByURL(url)->name(); - if (dtd->mimeTypes.tqcontains(mimetype)) + if (dtd->mimeTypes.contains(mimetype)) return true; if (url.path().endsWith('.' + dtd->defaultExtension)) return true; diff --git a/quanta/src/dtds.h b/quanta/src/dtds.h index 4f351182..0ecf30cb 100644 --- a/quanta/src/dtds.h +++ b/quanta/src/dtds.h @@ -44,7 +44,7 @@ struct DTDStruct; /** @short This class manages the DTD's for Quanta. * * The constructor only loads the necessary information from the description.rc file. - * The rest is later loaded on demand of the tqfind() function. + * The rest is later loaded on demand of the find() function. */ class DTDs : public TQObject { @@ -73,10 +73,10 @@ public: * @param dtdName name of the dtd, will be converted to lowercase inside * @return the found dtd structure */ - const DTDStruct * tqfind (const TQString &dtdName) + const DTDStruct * find (const TQString &dtdName) { -// kdDebug(24000) << "dtds::tqfind " << dtdName << endl; - DTDStruct *dtd = m_dict->tqfind(dtdName.lower()) ; +// kdDebug(24000) << "dtds::find " << dtdName << endl; + DTDStruct *dtd = m_dict->find(dtdName.lower()) ; if (dtd && ! dtd->loaded ) readTagDir2(dtd); return dtd; } @@ -93,7 +93,7 @@ public: */ TQString getDTDNickNameFromName(const TQString& name) { - DTDStruct *dtd = m_dict->tqfind(name); + DTDStruct *dtd = m_dict->find(name); if ( dtd ) return dtd->nickName; else diff --git a/quanta/src/kqapp.cpp b/quanta/src/kqapp.cpp index 0323d2c0..07ac5a1e 100644 --- a/quanta/src/kqapp.cpp +++ b/quanta/src/kqapp.cpp @@ -203,7 +203,7 @@ void KQApplicationPrivate::init() { TQString arg = args->url(i).url(); - if(arg.tqfindRev(TQRegExp(".+\\.webprj")) != -1) + if(arg.findRev(TQRegExp(".+\\.webprj")) != -1) initialProject = arg; else initialFiles += arg; diff --git a/quanta/src/quanta.cpp b/quanta/src/quanta.cpp index cb4795a3..27391537 100644 --- a/quanta/src/quanta.cpp +++ b/quanta/src/quanta.cpp @@ -320,7 +320,7 @@ QuantaApp::~QuantaApp() tmpDir = tmpDirs[0]; for (uint i = 0; i < tmpDirs.count(); i++) { - if (tmpDirs[i].tqcontains("kde-")) + if (tmpDirs[i].contains("kde-")) tmpDir = tmpDirs[i]; } TQString infoCss = tmpDir; @@ -522,7 +522,7 @@ bool QuantaApp::slotFileSaveAs(QuantaView *viewToSave) if (QuantaCommon::checkOverwrite(saveUrl, this) && view->saveDocument(saveUrl)) { oldURL = saveUrl; - if (Project::ref()->hasProject() && !Project::ref()->tqcontains(saveUrl) && + if (Project::ref()->hasProject() && !Project::ref()->contains(saveUrl) && KMessageBox::Yes == KMessageBox::questionYesNo(0,i18n("<qt>Do you want to add the<br><b>%1</b><br>file to project?</qt>").tqarg(saveUrl.prettyURL(0, KURL::StripFileProtocol)), TQString(), KStdGuiItem::add(), i18n("Do Not Add")) ) { @@ -761,7 +761,7 @@ void QuantaApp::slotRepaintPreview() TQString noFramesText = w->text(0,0, bl, bc - 1); noFramesText += noframearea[0]; noFramesText += w->text(el, ec + 1, w->editIf->numLines() - 1, w->editIf->lineLength(w->editIf->numLines() - 1)); - noFramesText.tqreplace(TQRegExp("</?noframes[^>]*>", false), ""); + noFramesText.replace(TQRegExp("</?noframes[^>]*>", false), ""); //kdDebug(24000) << "NOFRAMES: " << noFramesText << endl; if (w->isUntitled()) m_htmlPart->begin(Project::ref()->projectBaseURL(), xOffset, yOffset); @@ -876,7 +876,7 @@ void QuantaApp::slotInsertTag(const KURL& url, DirInfo dirInfo) } else { TQString mimetype = KMimeType::findByURL(url)->name(); - if (mimetype.tqcontains("image")) + if (mimetype.contains("image")) { TQString imgFileName; KIO::NetAccess::download(url, imgFileName, this); @@ -965,7 +965,7 @@ void QuantaApp::slotOptionsConfigureKeys() for( TQPtrListIterator<KXMLGUIClient> it( clients ); it.current(); ++it ) { - if (toolbarGuiClients.tqcontains(*it) <= 0) //no need to insert the collections of the toolbars as they are present in the main actionCollection + if (toolbarGuiClients.contains(*it) <= 0) //no need to insert the collections of the toolbars as they are present in the main actionCollection dlg.insert((*it)->actionCollection()); } if (dlg.configure() == KKeyDialog::Accepted) @@ -1911,14 +1911,14 @@ void QuantaApp::slotContextMenuAboutToShow() name = tagStr.mid(pos, group.definitionRx.matchedLength()); node->tag->beginPos(bl, bc); TQString tmpStr = tagStr.left(pos); - int newLines = tmpStr.tqcontains('\n'); + int newLines = tmpStr.contains('\n'); bl += newLines; - int l = tmpStr.tqfindRev('\n'); //the last EOL + int l = tmpStr.findRev('\n'); //the last EOL bc = (l == -1) ? bc+pos : pos - l - 1; - newLines = name.tqcontains('\n'); + newLines = name.contains('\n'); l = name.length(); el = bl + newLines; - ec = (newLines > 0) ? l - name.tqfindRev('\n') : bc + l - 1; + ec = (newLines > 0) ? l - name.findRev('\n') : bc + l - 1; pos += l; int p = group.definitionRx.search(cleanName); if (p != -1) @@ -1942,7 +1942,7 @@ void QuantaApp::slotContextMenuAboutToShow() } } else { - TQMap<TQString, XMLStructGroup>::ConstIterator it = node->tag->dtd()->xmlStructTreeGroups.tqfind(node->tag->name.lower()); + TQMap<TQString, XMLStructGroup>::ConstIterator it = node->tag->dtd()->xmlStructTreeGroups.find(node->tag->name.lower()); if (it != node->tag->dtd()->xmlStructTreeGroups.constEnd()) { @@ -1979,7 +1979,7 @@ void QuantaApp::slotContextMenuAboutToShow() action = actionCollection()->action("upload_file"); if (action) { - action->setEnabled(Project::ref()->tqcontains(w->url())); + action->setEnabled(Project::ref()->contains(w->url())); } // If we have a debugger session active... @@ -1997,16 +1997,16 @@ void QuantaApp::slotContextMenuAboutToShow() { // Otherwise, find the word under the cursor word = w->editIf->textLine(w->viewCursorIf->cursorLine()); - startpos = word.tqfindRev(TQRegExp("$|[^a-zA-Z0-9_]"), w->viewCursorIf->cursorColumn()); + startpos = word.findRev(TQRegExp("$|[^a-zA-Z0-9_]"), w->viewCursorIf->cursorColumn()); word.remove(0, startpos); if(word.left(1) != "$") word.remove(0, 1); - word = word.left(word.tqfind(TQRegExp("[^a-zA-Z0-9_]"), 1)); + word = word.left(word.find(TQRegExp("[^a-zA-Z0-9_]"), 1)); } // If we have a linebreak, take everything before the break - startpos = word.tqfind("\n"); + startpos = word.find("\n"); if(startpos > 0) word = word.left(startpos); @@ -2195,12 +2195,12 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url) TQString s = i18nName.lower(); TQString toolbarId = s; TQRegExp rx("\\s|\\."); - toolbarId.tqreplace(rx, "_"); + toolbarId.replace(rx, "_"); int n = 1; - while (m_toolbarList.tqfind(toolbarId) != 0L) + while (m_toolbarList.find(toolbarId) != 0L) { toolbarId = s + TQString("%1").tqarg(n); - toolbarId.tqreplace(rx, "_"); + toolbarId.replace(rx, "_"); n++; } @@ -2250,7 +2250,7 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url) //Compatility code (read the action shortcuts from quantaui.rc) //TODO: Remove after upgrade from 3.1 is not supported - if (oldShortcuts.tqcontains(actionName)) + if (oldShortcuts.contains(actionName)) { tagAction->setModified(true); tagAction->data().setAttribute("shortcut", oldShortcuts[actionName]); @@ -2598,7 +2598,7 @@ void QuantaApp::slotAddToolbar() TQString toolbarId = name; int n = 1; - while (m_toolbarList.tqfind(toolbarId) != 0L) + while (m_toolbarList.find(toolbarId) != 0L) { toolbarId = name + TQString("%1").tqarg(n); n++; @@ -2936,7 +2936,7 @@ void QuantaApp::slotRemoveAction(const TQString& toolbarName, const TQString& a_ { KAction *action = 0L; TQString actionName = a_actionName; - actionName.tqreplace('&',"&&"); + actionName.replace('&',"&&"); KActionCollection *ac = actionCollection(); uint actionCount = ac->count(); TQString str; @@ -3014,10 +3014,10 @@ void QuantaApp::setDtep(const TQString& dtepName, bool convert) if (w) { TQString dtep = DTDs::ref()->getDTDNameFromNickName(dtepName); - if (!DTDs::ref()->tqfind(dtep)) + if (!DTDs::ref()->find(dtep)) return; w->setDTDIdentifier(dtep); - const DTDStruct *dtd = DTDs::ref()->tqfind(w->getDTDIdentifier()); + const DTDStruct *dtd = DTDs::ref()->find(w->getDTDIdentifier()); if (convert && dtd->family == Xml) { Tag *tag = 0L; @@ -3096,7 +3096,7 @@ void QuantaApp::slotEditDTD() bool ok = false; TQString res = KInputDialog::getItem( i18n( "Edit DTD" ), - i18n( "Please select a DTD:" ), lst, lst.tqfindIndex(nickName), false, &ok, this ); + i18n( "Please select a DTD:" ), lst, lst.findIndex(nickName), false, &ok, this ); TQString s = i18n("Create a new DTEP description"); s = i18n("Load DTEP description from disk"); @@ -3106,7 +3106,7 @@ void QuantaApp::slotEditDTD() TQString dtdName = DTDs::ref()->getDTDNameFromNickName(res); KDialogBase editDlg(this, "edit_dtep", true, i18n("Configure DTEP"), KDialogBase::Ok | KDialogBase::Cancel); - DTEPEditDlg dtepDlg(DTDs::ref()->tqfind(dtdName)->fileName, &editDlg); + DTEPEditDlg dtepDlg(DTDs::ref()->find(dtdName)->fileName, &editDlg); editDlg.setMainWidget(&dtepDlg); if (editDlg.exec()) { @@ -3166,17 +3166,17 @@ void QuantaApp::slotLoadToolbarForDTD(const TQString& dtdName) if (!currentToolbarDTD.isEmpty()) { - oldDtd = DTDs::ref()->tqfind(currentToolbarDTD); + oldDtd = DTDs::ref()->find(currentToolbarDTD); if (!oldDtd) - oldDtd = DTDs::ref()->tqfind(Project::ref()->defaultDTD()); + oldDtd = DTDs::ref()->find(Project::ref()->defaultDTD()); } TQString fileName; - const DTDStruct *newDtd = DTDs::ref()->tqfind(dtdName); + const DTDStruct *newDtd = DTDs::ref()->find(dtdName); if (!newDtd) { - newDtd = DTDs::ref()->tqfind(Project::ref()->defaultDTD()); + newDtd = DTDs::ref()->find(Project::ref()->defaultDTD()); if (!newDtd) - newDtd = DTDs::ref()->tqfind(qConfig.defaultDocType); //extreme case + newDtd = DTDs::ref()->find(qConfig.defaultDocType); //extreme case } ToolbarEntry *p_toolbar; @@ -3225,7 +3225,7 @@ void QuantaApp::slotLoadToolbarForDTD(const TQString& dtdName) KURL urlLocal; fileName = locateLocal("data", resourceDir + "toolbars/"+oldDtd->toolbars[i]); QuantaCommon::setUrl(urlLocal, fileName); - if (newToolbars.tqcontains(url) == 0) + if (newToolbars.contains(url) == 0) { TQDictIterator<ToolbarEntry> iter(m_toolbarList); for( ; iter.current(); ++iter ) @@ -3309,8 +3309,8 @@ bool QuantaApp::slotRemoveToolbar(const TQString& a_name) name1.remove(" tab"); TQString name2 = name1; name2.remove(TQRegExp("[\\s]\\([0-9]+\\)")); - s2.tqreplace(name1, name2); - s2.tqreplace(name1.lower(), name2.lower()); + s2.replace(name1, name2); + s2.replace(name1.lower(), name2.lower()); } bool useToolbarGUI = true; if ( s1 != s2 /*|| actionsModified */) @@ -3559,7 +3559,7 @@ TQString QuantaApp::createDTEPTarball() bool ok = false; TQString res = KInputDialog::getItem( i18n( "Send DTD" ), - i18n( "Please select a DTD:" ), lst, lst.tqfindIndex(nickName), false, &ok, this ); + i18n( "Please select a DTD:" ), lst, lst.findIndex(nickName), false, &ok, this ); if (!ok) return TQString(); @@ -3570,14 +3570,14 @@ TQString QuantaApp::createDTEPTarball() KTempDir* tempDir = new KTempDir(tmpDir); tempDir->setAutoDelete(true); tempDirList.append(tempDir); - TQString tempFileName=tempDir->name() +"/"+ DTDs::ref()->getDTDNickNameFromName(dtdName).tqreplace(TQRegExp("\\s|\\."), "_") + ".tgz"; + TQString tempFileName=tempDir->name() +"/"+ DTDs::ref()->getDTDNickNameFromName(dtdName).replace(TQRegExp("\\s|\\."), "_") + ".tgz"; //pack the .tag files and the description.rc into a .tgz file KTar tar(tempFileName, "application/x-gzip"); tar.open(IO_WriteOnly); KURL dirURL; - dirURL.setPath(DTDs::ref()->tqfind(dtdName)->fileName); + dirURL.setPath(DTDs::ref()->find(dtdName)->fileName); dirURL.setPath(dirURL.directory(false)); KURL::List files = QExtFileInfo::allFilesRelative(dirURL, "*", this); @@ -3664,7 +3664,7 @@ void QuantaApp::slotSmartTagInsertion() if(!action) return; if(!ViewManager::ref()->activeDocument() || !ViewManager::ref()->activeView() || - ViewManager::ref()->activeDocument()->defaultDTD()->name.tqcontains("HTML", false) == 0) + ViewManager::ref()->activeDocument()->defaultDTD()->name.contains("HTML", false) == 0) { KMessageBox::error(this, "Smart Tag Insertion is available only for (X)HTML for the moment."); qConfig.smartTagInsertion = false; @@ -3736,7 +3736,7 @@ void QuantaApp::documentProperties(bool forceInsertionOfMinimalTree) Document *w = ViewManager::ref()->activeDocument(); if (w) { - if (w->defaultDTD()->name.tqcontains("HTML", false) == 0) + if (w->defaultDTD()->name.contains("HTML", false) == 0) { KMessageBox::information(this, i18n("The Document Properties Dialog is only for HTML and XHTML.")); return; @@ -3808,7 +3808,7 @@ void QuantaApp::slotExpandAbbreviation() { bool found = false; Abbreviation abbrev = it.data(); - if (abbrev.dteps.tqcontains(dtd->name)) + if (abbrev.dteps.contains(dtd->name)) { TQMap<TQString, TQString>::ConstIterator it2; for (it2 = abbrev.abbreviations.constBegin(); it2 != abbrev.abbreviations.constEnd(); ++it2) @@ -3830,20 +3830,20 @@ void QuantaApp::slotExpandAbbreviation() w->editIf->removeText(line, col - text.length() + 1, line, col); w->activateParser(true); col -= (text.length() - 1); - int pos = textToInsert.tqfind('|'); + int pos = textToInsert.find('|'); if (pos != -1) { text = textToInsert.left(pos); - if (text.tqcontains('\n')) + if (text.contains('\n')) { - line += text.tqcontains('\n'); - col = text.length() - text.tqfindRev('\n') - 1; + line += text.contains('\n'); + col = text.length() - text.findRev('\n') - 1; } else { col += pos; } } - textToInsert.tqreplace('|',""); + textToInsert.replace('|',""); w->insertText(textToInsert, false); w->viewCursorIf->setCursorPositionReal(line, col); } @@ -4040,7 +4040,7 @@ void QuantaApp::slotReloadStructTreeView(bool groupOnly) } Tag *commentTag = n->tag; TQString text = commentTag->tagStr(); - int pos = text.tqfind("@annotation"); + int pos = text.find("@annotation"); if (pos != -1) { pos += 11; @@ -4048,7 +4048,7 @@ void QuantaApp::slotReloadStructTreeView(bool groupOnly) if (text[pos] == '(') { int p = pos; - pos = text.tqfind(')'); + pos = text.find(')'); if (pos != -1) { receiver = text.mid(p + 1, pos - p - 1); @@ -4297,10 +4297,10 @@ void QuantaApp::slotEditCurrentTag() if (dtd->family == Xml) { TQString currentLine = w->editIf->textLine(line); - int sPos = currentLine.tqfindRev('<', col); + int sPos = currentLine.findRev('<', col); if (sPos != -1) { - int ePos = currentLine.tqfind('>', col); + int ePos = currentLine.find('>', col); if (ePos != -1) { AreaStruct area(line, sPos, line, ePos); @@ -4469,7 +4469,7 @@ void QuantaApp::slotInsertCSS() styleNode->next->tag->beginPos(eLine, eCol); TQString styleTagContent(w->text(bLine, bCol+1, eLine, eCol-1).remove("<!--").remove("-->"));// <style></style> block content - kdDebug(24000) << "Style tag tqcontains: " << endl << styleTagContent << endl; + kdDebug(24000) << "Style tag contains: " << endl << styleTagContent << endl; CSSSelector *dlg = new CSSSelector; dlg->setCallingFrom("XHTML"); @@ -4845,10 +4845,10 @@ void QuantaApp::slotPasteHTMLQuoted() if ( ( !text.isNull() ) && (!text.isEmpty() ) ) { - text.tqreplace( "&", "&" ); - text.tqreplace( "<", "<" ); - text.tqreplace( "\"", """ ); - text.tqreplace( ">", ">" ); + text.replace( "&", "&" ); + text.replace( "<", "<" ); + text.replace( "\"", """ ); + text.replace( ">", ">" ); //TODO: Replace only the chars not present in the current encoding. TQString encoding = defaultEncoding(); @@ -4860,16 +4860,16 @@ void QuantaApp::slotPasteHTMLQuoted() for ( TQStringList::Iterator it = charList.begin(); it != charList.end(); ++it ) { TQString s = *it; - int begin = s.tqfind("(&#") + 3; + int begin = s.find("(&#") + 3; if (begin == 1) continue; - int length = s.tqfind(";)") - begin + 1; + int length = s.find(";)") - begin + 1; s = s.mid(begin, length - 1); bool ok; int code = s.toInt(&ok); if (!ok || code < 191) continue; - text.tqreplace(TQChar(code), TQString("&#%1;").tqarg(s)); + text.replace(TQChar(code), TQString("&#%1;").tqarg(s)); } } unsigned int line, col; @@ -5120,7 +5120,7 @@ void QuantaApp::slotFileClosed(Document *w) if (w) { KURL url = w->url(); - if (Project::ref()->hasProject() && Project::ref()->tqcontains(url)) + if (Project::ref()->hasProject() && Project::ref()->contains(url)) { KURL u = QExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()); m_annotationOutput->writeAnnotations(QuantaCommon::qUrl(u), w->annotations()); @@ -5134,7 +5134,7 @@ void QuantaApp::slotCVSCommandExecuted(const TQString& command, const TQStringLi for (uint i = 0; i < files.count(); i++) { file = files[i]; - if (Project::ref()->tqcontains(KURL::fromPathOrURL(file))) + if (Project::ref()->contains(KURL::fromPathOrURL(file))) { emit eventHappened("after_" + command, file, TQString()); } diff --git a/quanta/src/quanta_init.cpp b/quanta/src/quanta_init.cpp index d188adee..15e1abdd 100644 --- a/quanta/src/quanta_init.cpp +++ b/quanta/src/quanta_init.cpp @@ -138,7 +138,7 @@ void QuantaInit::initQuanta() tmpDir = tmpDirs[0]; for (uint i = 0; i < tmpDirs.count(); i++) { - if (tmpDirs[i].tqcontains("kde-")) + if (tmpDirs[i].contains("kde-")) tmpDir = tmpDirs[i]; } dir.mkdir(tmpDir + "quanta"); @@ -154,9 +154,9 @@ void QuantaInit::initQuanta() //defaultDocType must be read before the Project object is created!! m_config->setGroup("General Options"); qConfig.defaultDocType = m_config->readEntry("Default DTD",DEFAULT_DTD); - if (! DTDs::ref()->tqfind(qConfig.defaultDocType)) + if (! DTDs::ref()->find(qConfig.defaultDocType)) qConfig.defaultDocType = DEFAULT_DTD; - DTDs::ref()->tqfind("dtd"); //load on startup + DTDs::ref()->find("dtd"); //load on startup initView(); initDocument(); // after initView because of init of treeViews @@ -296,10 +296,10 @@ void QuantaInit::initQuanta() { s = t.readLine(); charList << i18n(s.utf8()); // line excluding '\n' - int begin = s.tqfind("(&") + 1; + int begin = s.find("(&") + 1; if (begin == 1) continue; - int length = s.tqfind(";)") - begin + 1; + int length = s.find(";)") - begin + 1; TQString s2 = s.mid(begin, length - 1); replacementMap[s[0].tqunicode()] = s2; } @@ -307,7 +307,7 @@ void QuantaInit::initQuanta() } TQString infoCss = tmpDir; - infoCss.tqreplace(TQRegExp("/quanta$"),""); + infoCss.replace(TQRegExp("/quanta$"),""); infoCss += "/info.css"; QExtFileInfo::copy(KURL().fromPathOrURL(qConfig.globalDataDir + resourceDir + "scripts/info.css"), KURL().fromPathOrURL(infoCss)); @@ -772,7 +772,7 @@ void QuantaInit::initActions() // Edit actions (void) new KAction( i18n( "Find in Files..." ), - SmallIcon("filetqfind"), CTRL+ALT+Key_F, + SmallIcon("filefind"), CTRL+ALT+Key_F, TQT_TQOBJECT(m_quanta), TQT_SLOT( slotEditFindInFiles() ), TQT_TQOBJECT(ac), "find_in_files" ); @@ -1140,7 +1140,7 @@ void QuantaInit::recoverCrashed(TQStringList& recoveredFileNameList) { // when quanta crashes and file autoreloading option is on // then if user restarts quanta, the backup copies will reload - TQString backedUpFileName = (*backedUpUrlsIt).left((*backedUpUrlsIt).tqfindRev(".")); //the filename without the PID + TQString backedUpFileName = (*backedUpUrlsIt).left((*backedUpUrlsIt).findRev(".")); //the filename without the PID bool notFound; TQString autosavedPath = searchPathListEntry(backedUpFileName, autosavedUrlsList, notFound); if (!autosavedPath.isEmpty()) //the current item was autosaved and is not in use by another Quanta @@ -1347,8 +1347,8 @@ void QuantaInit::recoverCrashed(TQStringList& recoveredFileNameList) /** Retrieves hashed path from the name of a backup file */ TQString QuantaInit::retrieveHashedPath(const TQString& filename) { - int lastPoint = filename.tqfindRev("."); - int Ppos = filename.tqfind("P", lastPoint); + int lastPoint = filename.findRev("."); + int Ppos = filename.find("P", lastPoint); return filename.mid(lastPoint + 1, Ppos - lastPoint); } @@ -1358,10 +1358,10 @@ TQString QuantaInit::retrieveHashedPath(const TQString& filename) TQString QuantaInit::retrievePID(const TQString& filename) { TQString strPID = TQString(); - strPID = filename.mid(filename.tqfindRev("P") + 1); + strPID = filename.mid(filename.findRev("P") + 1); if (strPID.isEmpty()) - strPID = filename.mid(filename.tqfindRev("N") + 1); + strPID = filename.mid(filename.findRev("N") + 1); if (strPID.endsWith("U")) strPID = strPID.left(strPID.length() - 1); @@ -1569,7 +1569,7 @@ void QuantaInit::readAbbreviations() TQStringList::Iterator it; for (it = filenameList.begin(); it != filenameList.end(); ++it) { - int pos =(*it).tqfind('|'); + int pos =(*it).find('|'); TQString dirName = (*it).mid(pos + 1); TQString dtepName = (*it).left(pos); KURL dirURL(dirName); diff --git a/quanta/src/quantadoc.cpp b/quanta/src/quantadoc.cpp index 4bebfcc3..aba09d7d 100644 --- a/quanta/src/quantadoc.cpp +++ b/quanta/src/quantadoc.cpp @@ -281,7 +281,7 @@ void QuantaDoc::slotAttribPopup() { name = list->at(i)->name; attribMenu->insertItem( name , i);//list->findIndex(*item) ); - if (attrList.tqcontains(name.ascii())) + if (attrList.contains(name.ascii())) { attribMenu->setItemEnabled( i , false ); } @@ -292,12 +292,12 @@ void QuantaDoc::slotAttribPopup() for (TQStringList::Iterator it = qtag->commonGroups.begin(); it != qtag->commonGroups.end(); ++it) { TQPopupMenu* popUpMenu = new TQPopupMenu(attribMenu, (*it).latin1()); - AttributeList *attrs = qtag->parentDTD->commonAttrs->tqfind(*it); + AttributeList *attrs = qtag->parentDTD->commonAttrs->find(*it); for (uint j = 0; j < attrs->count(); j++) { name = attrs->at(j)->name; popUpMenu->insertItem(name, ++menuId); - if (attrList.tqcontains(name.ascii())) + if (attrList.contains(name.ascii())) { popUpMenu->setItemEnabled( menuId , false ); } @@ -348,7 +348,7 @@ void QuantaDoc::slotInsertAttrib( int id ) TQTag* qtag = QuantaCommon::tagFromDTD(w->getDTDIdentifier(), tagName); for (TQStringList::Iterator it = qtag->commonGroups.begin(); it != qtag->commonGroups.end(); ++it) { - AttributeList *attrs = qtag->parentDTD->commonAttrs->tqfind(*it); + AttributeList *attrs = qtag->parentDTD->commonAttrs->find(*it); menuId += attrs->count(); if (id <= menuId) { diff --git a/quanta/src/quantaview.cpp b/quanta/src/quantaview.cpp index 45b06603..dbbb6578 100644 --- a/quanta/src/quantaview.cpp +++ b/quanta/src/quantaview.cpp @@ -393,7 +393,7 @@ void QuantaView::slotSetSourceAndVPLLayout() KToggleAction *ta = (KToggleAction *) quantaApp->actionCollection()->action( "show_kafka_and_quanta" ); - if (m_document->defaultDTD()->name.tqcontains("HTML", false) == 0) + if (m_document->defaultDTD()->name.contains("HTML", false) == 0) { KMessageBox::information(this, i18n("The VPL Mode does not support the current DTD, at the moment: %1").tqarg(m_document->defaultDTD()->nickName)); KToggleAction *ta2 = (KToggleAction *) quantaApp->actionCollection()->action( "show_quanta_editor" ); @@ -442,7 +442,7 @@ void QuantaView::slotSetVPLOnlyLayout() KToggleAction *ta = (KToggleAction *) quantaApp->actionCollection()->action( "show_kafka_view" ); - if (m_document->defaultDTD()->name.tqcontains("HTML", false) == 0) + if (m_document->defaultDTD()->name.contains("HTML", false) == 0) { KMessageBox::information(this, i18n("The VPL Mode does not support the current DTD, at the moment: %1").tqarg(m_document->defaultDTD()->nickName)); KToggleAction *ta2 = (KToggleAction *) quantaApp->actionCollection()->action( "show_quanta_editor" ); @@ -1028,7 +1028,7 @@ void QuantaView::activated() //TEMP : If the activated document is not a (X)HTML document, disable smartTagInsertion //Will be removed when VPL will support every DTD KAction *action = quantaApp->actionCollection()->action("smart_tag_insertion"); - if(action && m_document->defaultDTD()->name.tqcontains("HTML", false) == 0) + if(action && m_document->defaultDTD()->name.contains("HTML", false) == 0) { qConfig.smartTagInsertion = false; (static_cast<KToggleAction* >(action))->setChecked(false); diff --git a/quanta/src/viewmanager.cpp b/quanta/src/viewmanager.cpp index b2c598c6..eb7ef971 100644 --- a/quanta/src/viewmanager.cpp +++ b/quanta/src/viewmanager.cpp @@ -295,7 +295,7 @@ void ViewManager::slotCloseOtherTabs() Document *w = qView->document(); if (w) { - if (filesToSave.tqcontains(w->url())) + if (filesToSave.contains(w->url())) if (!qView->saveModified(false)) { return; //save aborted @@ -463,7 +463,7 @@ bool ViewManager::closeAll(bool createNew) Document *w = view->document(); if (w) { - if (filesToSave.tqcontains(w->url())) + if (filesToSave.contains(w->url())) if (!view->saveModified(false)) { emit filesClosed(false); @@ -604,7 +604,7 @@ void ViewManager::slotTabContextMenu(TQWidget *widget, const TQPoint& point) m_separatorVisible = true; m_tabPopup->insertSeparator(SEPARATOR_INDEX); } - if (Project::ref()->hasProject() && Project::ref()->tqcontains(w->url())) + if (Project::ref()->hasProject() && Project::ref()->contains(w->url())) m_tabPopup->setItemVisible(UPLOAD_ID, true); else m_tabPopup->setItemVisible(UPLOAD_ID, false); @@ -647,7 +647,7 @@ void ViewManager::slotTabContextMenu(TQWidget *widget, const TQPoint& point) m_tabPopup->insertSeparator(); m_cvsMenuId = m_tabPopup->insertItem(SmallIcon("cervisia"), i18n("CVS"), CVSService::ref()->menu()); } - if (Project::ref()->tqcontains(w->url())) + if (Project::ref()->contains(w->url())) CVSService::ref()->setRepository(Project::ref()->projectBaseURL().path()); else CVSService::ref()->setRepository(w->url().directory()); |