summaryrefslogtreecommitdiffstats
path: root/quanta/src/quanta.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit36c36b53a129509d56fdaa0a7c9fcbcacd0c5826 (patch)
tree629d3942958745660e36c30b0d6139af9459c0f8 /quanta/src/quanta.cpp
parent929d7ae4f69d62b8f1f6d3506adf75f017753935 (diff)
downloadtdewebdev-36c36b53a129509d56fdaa0a7c9fcbcacd0c5826.tar.gz
tdewebdev-36c36b53a129509d56fdaa0a7c9fcbcacd0c5826.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/src/quanta.cpp')
-rw-r--r--quanta/src/quanta.cpp114
1 files changed, 57 insertions, 57 deletions
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( "&", "&amp;" );
- text.tqreplace( "<", "&lt;" );
- text.tqreplace( "\"", "&quot;" );
- text.tqreplace( ">", "&gt;" );
+ text.replace( "&", "&amp;" );
+ text.replace( "<", "&lt;" );
+ text.replace( "\"", "&quot;" );
+ text.replace( ">", "&gt;" );
//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());
}