diff options
Diffstat (limited to 'quanta/messages/annotationoutput.cpp')
-rw-r--r-- | quanta/messages/annotationoutput.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/quanta/messages/annotationoutput.cpp b/quanta/messages/annotationoutput.cpp index 48ebb7fd..b666f7b6 100644 --- a/quanta/messages/annotationoutput.cpp +++ b/quanta/messages/annotationoutput.cpp @@ -35,8 +35,8 @@ #include "quantacommon.h" #include "viewmanager.h" -AnnotationOutput::AnnotationOutput(TQWidget *parent, const char *name) - : KTabWidget(parent, name) +AnnotationOutput::AnnotationOutput(TQWidget *tqparent, const char *name) + : KTabWidget(tqparent, name) { m_currentFileAnnotations = new MessageOutput(this); addTab(m_currentFileAnnotations, i18n("Current File")); @@ -81,11 +81,11 @@ void AnnotationOutput::tabChanged(TQWidget *w) readAnnotations(); } -void AnnotationOutput::insertAnnotation(uint line, const TQString& fileName, const QPair<TQString, TQString>& annotation) +void AnnotationOutput::insertAnnotation(uint line, const TQString& fileName, const TQPair<TQString, TQString>& annotation) { line++; - TQString s = i18n("Line %1: %2").arg(line).arg(annotation.first); - s.replace('\n', ' '); + TQString s = i18n("Line %1: %2").tqarg(line).tqarg(annotation.first); + s.tqreplace('\n', ' '); m_currentFileAnnotations->showMessage(line, 1, fileName, s); } @@ -147,15 +147,15 @@ void AnnotationOutput::readAnnotations() TQString fileName = el.attribute("url"); KURL u = baseURL; QuantaCommon::setUrl(u, fileName); - u = QExtFileInfo::toAbsolute(u, baseURL); - if (Project::ref()->contains(u)) + u = TQExtFileInfo::toAbsolute(u, baseURL); + if (Project::ref()->tqcontains(u)) { bool ok; int line = el.attribute("line").toInt(&ok, 10); TQString text = el.attribute("text"); TQString receiver = el.attribute("receiver"); - text.replace('\n',' '); - TQString lineText = TQString("%1").arg(line); + text.tqreplace('\n',' '); + TQString lineText = TQString("%1").tqarg(line); if (lineText.length() < 20) { TQString s; @@ -170,12 +170,12 @@ void AnnotationOutput::readAnnotations() m_fileNames[fileIt] = u.url(); } KListViewItem *it = new KListViewItem(fileIt, fileIt, text, lineText); - if (openedItems.contains(fileName)) + if (openedItems.tqcontains(fileName)) fileIt->setOpen(true); m_fileNames[it] = u.url(); m_lines[it] = line; - if (!yourself.isEmpty() && (receiver == yourself || roles.contains(receiver))) + if (!yourself.isEmpty() && (receiver == yourself || roles.tqcontains(receiver))) { m_yourAnnotationsNum++; KListViewItem *fileIt = m_yourFileItems[fileName]; @@ -186,7 +186,7 @@ void AnnotationOutput::readAnnotations() m_yourFileNames[fileIt] = u.url(); } KListViewItem *it = new KListViewItem(fileIt, fileIt, text, lineText); - if (yourOpenedItems.contains(fileName)) + if (yourOpenedItems.tqcontains(fileName)) fileIt->setOpen(true); m_yourFileNames[it] = u.url(); m_yourLines[it] = line; @@ -198,14 +198,14 @@ void AnnotationOutput::readAnnotations() } if (m_yourAnnotationsNum > 0) { - setTabLabel(m_yourAnnotations, i18n("For You: %1").arg(m_yourAnnotationsNum)); + setTabLabel(m_yourAnnotations, i18n("For You: %1").tqarg(m_yourAnnotationsNum)); } else { setTabLabel(m_yourAnnotations, i18n("For You")); } } -void AnnotationOutput::writeAnnotations(const TQString &fileName, const TQMap<uint, QPair<TQString, TQString> > &a_annotations) +void AnnotationOutput::writeAnnotations(const TQString &fileName, const TQMap<uint, TQPair<TQString, TQString> > &a_annotations) { m_annotatedFileItems.clear(); m_fileNames.clear(); @@ -215,7 +215,7 @@ void AnnotationOutput::writeAnnotations(const TQString &fileName, const TQMap<ui m_yourLines.clear(); bool modified = false; - TQMap<uint, QPair<TQString, TQString> > annotations = a_annotations; + TQMap<uint, TQPair<TQString, TQString> > annotations = a_annotations; TQDomDocument *dom = Project::ref()->dom(); TQDomElement annotationElement = dom->firstChild().firstChild().namedItem("annotations").toElement(); if (annotationElement.isNull()) @@ -234,16 +234,16 @@ void AnnotationOutput::writeAnnotations(const TQString &fileName, const TQMap<ui TQString text = el.attribute("text"); bool ok; int line = el.attribute("line").toInt(&ok, 10); - if (!annotations.contains(line) || (annotations[line].first != text)) + if (!annotations.tqcontains(line) || (annotations[line].first != text)) { - n.parentNode().removeChild(n); + n.tqparentNode().removeChild(n); modified = true; } else annotations.remove(line); } n = n2; } - for (TQMap<uint, QPair<TQString, TQString> >::ConstIterator it = annotations.constBegin(); it != annotations.constEnd(); ++it) + for (TQMap<uint, TQPair<TQString, TQString> >::ConstIterator it = annotations.constBegin(); it != annotations.constEnd(); ++it) { TQDomElement el = dom->createElement("annotation"); el.setAttribute("url", fileName); @@ -261,7 +261,7 @@ void AnnotationOutput::writeAnnotations(const TQString &fileName, const TQMap<ui void AnnotationOutput::allAnnotationsItemExecuted(TQListViewItem *item) { - if (dynamic_cast<KListView*> (item->parent()) != m_allAnnotations) + if (dynamic_cast<KListView*> (item->tqparent()) != m_allAnnotations) { emit clicked(m_fileNames[item], m_lines[item], 0); } else @@ -270,7 +270,7 @@ void AnnotationOutput::allAnnotationsItemExecuted(TQListViewItem *item) void AnnotationOutput::yourAnnotationsItemExecuted(TQListViewItem *item) { - if (dynamic_cast<KListView*> (item->parent()) != m_yourAnnotations) + if (dynamic_cast<KListView*> (item->tqparent()) != m_yourAnnotations) { emit clicked(m_yourFileNames[item], m_yourLines[item], 0); } else @@ -299,7 +299,7 @@ void AnnotationOutput::updateAnnotationForFile(const KURL& url) TQFile f(url.path()); if (f.open(IO_ReadOnly)) { - TQMap<uint, QPair<TQString, TQString> > annotations; + TQMap<uint, TQPair<TQString, TQString> > annotations; uint i = 0; TQTextStream stream(&f); stream.setEncoding(TQTextStream::UnicodeUTF8); @@ -307,7 +307,7 @@ void AnnotationOutput::updateAnnotationForFile(const KURL& url) while (!stream.atEnd()) { line = stream.readLine(); - int pos = line.find("@annotation"); + int pos = line.tqfind("@annotation"); if (pos != -1) { TQString receiver; @@ -315,7 +315,7 @@ void AnnotationOutput::updateAnnotationForFile(const KURL& url) if (line[pos] == '(') { int p = pos; - pos = line.find(')'); + pos = line.tqfind(')'); if (pos != -1) { receiver = line.mid(p + 1, pos - p - 1); @@ -323,15 +323,15 @@ void AnnotationOutput::updateAnnotationForFile(const KURL& url) } } else pos++; - int pos2 = line.find(rx); - annotations.insert(i, qMakePair(line.mid(pos, pos2 - pos).stripWhiteSpace(), receiver)); + int pos2 = line.tqfind(rx); + annotations.insert(i, tqMakePair(line.mid(pos, pos2 - pos).stripWhiteSpace(), receiver)); } ++i; } f.close(); if (!annotations.isEmpty()) { - KURL u = QExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()); + KURL u = TQExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()); writeAnnotations(QuantaCommon::qUrl(u), annotations); } } |