summaryrefslogtreecommitdiffstats
path: root/quanta/messages/annotationoutput.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/messages/annotationoutput.cpp
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz
tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/messages/annotationoutput.cpp')
-rw-r--r--quanta/messages/annotationoutput.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/quanta/messages/annotationoutput.cpp b/quanta/messages/annotationoutput.cpp
index 8c8d7d90..48ebb7fd 100644
--- a/quanta/messages/annotationoutput.cpp
+++ b/quanta/messages/annotationoutput.cpp
@@ -10,15 +10,15 @@
//
//
-#include <qdict.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qheader.h>
-#include <qmap.h>
-#include <qregexp.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
-#include <qtimer.h>
+#include <tqdict.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqheader.h>
+#include <tqmap.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <kio/netaccess.h>
@@ -35,7 +35,7 @@
#include "quantacommon.h"
#include "viewmanager.h"
-AnnotationOutput::AnnotationOutput(QWidget *parent, const char *name)
+AnnotationOutput::AnnotationOutput(TQWidget *parent, const char *name)
: KTabWidget(parent, name)
{
m_currentFileAnnotations = new MessageOutput(this);
@@ -50,7 +50,7 @@ AnnotationOutput::AnnotationOutput(QWidget *parent, const char *name)
m_yourAnnotations->setLineWidth(2);
addTab(m_yourAnnotations, i18n("For You"));
- connect(m_yourAnnotations, SIGNAL(executed(QListViewItem*)), SLOT(yourAnnotationsItemExecuted(QListViewItem *)));
+ connect(m_yourAnnotations, TQT_SIGNAL(executed(TQListViewItem*)), TQT_SLOT(yourAnnotationsItemExecuted(TQListViewItem *)));
m_allAnnotations = new KListView(this);
m_allAnnotations->addColumn("1", -1);
@@ -59,14 +59,14 @@ AnnotationOutput::AnnotationOutput(QWidget *parent, const char *name)
m_allAnnotations->header()->hide();
m_allAnnotations->setSorting(1);
m_allAnnotations->setLineWidth(2);
- connect(m_allAnnotations, SIGNAL(executed(QListViewItem*)), SLOT(allAnnotationsItemExecuted(QListViewItem *)));
+ connect(m_allAnnotations, TQT_SIGNAL(executed(TQListViewItem*)), TQT_SLOT(allAnnotationsItemExecuted(TQListViewItem *)));
addTab(m_allAnnotations, i18n("All Files"));
- connect(this, SIGNAL(currentChanged(QWidget*)), SLOT(tabChanged(QWidget*)));
+ connect(this, TQT_SIGNAL(currentChanged(TQWidget*)), TQT_SLOT(tabChanged(TQWidget*)));
- m_updateTimer = new QTimer(this);
- connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(slotUpdateNextFile()));
+ m_updateTimer = new TQTimer(this);
+ connect(m_updateTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotUpdateNextFile()));
m_yourAnnotationsNum = 0;
}
@@ -75,16 +75,16 @@ AnnotationOutput::~AnnotationOutput()
{
}
-void AnnotationOutput::tabChanged(QWidget *w)
+void AnnotationOutput::tabChanged(TQWidget *w)
{
if (w == m_allAnnotations || w == m_yourAnnotations)
readAnnotations();
}
-void AnnotationOutput::insertAnnotation(uint line, const QString& fileName, const QPair<QString, QString>& annotation)
+void AnnotationOutput::insertAnnotation(uint line, const TQString& fileName, const QPair<TQString, TQString>& annotation)
{
line++;
- QString s = i18n("Line %1: %2").arg(line).arg(annotation.first);
+ TQString s = i18n("Line %1: %2").arg(line).arg(annotation.first);
s.replace('\n', ' ');
m_currentFileAnnotations->showMessage(line, 1, fileName, s);
}
@@ -106,8 +106,8 @@ void AnnotationOutput::readAnnotations()
}
KURL baseURL = Project::ref()->projectBaseURL();
- QStringList openedItems;
- QListViewItem *item = m_allAnnotations->firstChild();
+ TQStringList openedItems;
+ TQListViewItem *item = m_allAnnotations->firstChild();
while (item)
{
if (item->isOpen())
@@ -119,7 +119,7 @@ void AnnotationOutput::readAnnotations()
m_fileNames.clear();
m_lines.clear();
- QStringList yourOpenedItems;
+ TQStringList yourOpenedItems;
item = m_yourAnnotations->firstChild();
while (item)
{
@@ -134,17 +134,17 @@ void AnnotationOutput::readAnnotations()
m_yourLines.clear();
m_yourAnnotationsNum = 0;
- QDomElement annotationElement = Project::ref()->dom()->firstChild().firstChild().namedItem("annotations").toElement();
+ TQDomElement annotationElement = Project::ref()->dom()->firstChild().firstChild().namedItem("annotations").toElement();
if (annotationElement.isNull())
return;
- QString yourself = Project::ref()->yourself().lower();
- QStringList roles = Project::ref()->yourRoles();
- QDomNodeList nodes = annotationElement.childNodes();
+ TQString yourself = Project::ref()->yourself().lower();
+ TQStringList roles = Project::ref()->yourRoles();
+ TQDomNodeList nodes = annotationElement.childNodes();
int count = nodes.count();
for (int i = 0; i < count; i++)
{
- QDomElement el = nodes.item(i).toElement();
- QString fileName = el.attribute("url");
+ TQDomElement el = nodes.item(i).toElement();
+ TQString fileName = el.attribute("url");
KURL u = baseURL;
QuantaCommon::setUrl(u, fileName);
u = QExtFileInfo::toAbsolute(u, baseURL);
@@ -152,13 +152,13 @@ void AnnotationOutput::readAnnotations()
{
bool ok;
int line = el.attribute("line").toInt(&ok, 10);
- QString text = el.attribute("text");
- QString receiver = el.attribute("receiver");
+ TQString text = el.attribute("text");
+ TQString receiver = el.attribute("receiver");
text.replace('\n',' ');
- QString lineText = QString("%1").arg(line);
+ TQString lineText = TQString("%1").arg(line);
if (lineText.length() < 20)
{
- QString s;
+ TQString s;
s.fill('0', 20 - lineText.length());
lineText.prepend(s);
}
@@ -205,7 +205,7 @@ void AnnotationOutput::readAnnotations()
}
}
-void AnnotationOutput::writeAnnotations(const QString &fileName, const QMap<uint, QPair<QString, QString> > &a_annotations)
+void AnnotationOutput::writeAnnotations(const TQString &fileName, const TQMap<uint, QPair<TQString, TQString> > &a_annotations)
{
m_annotatedFileItems.clear();
m_fileNames.clear();
@@ -215,23 +215,23 @@ void AnnotationOutput::writeAnnotations(const QString &fileName, const QMap<uint
m_yourLines.clear();
bool modified = false;
- QMap<uint, QPair<QString, QString> > annotations = a_annotations;
- QDomDocument *dom = Project::ref()->dom();
- QDomElement annotationElement = dom->firstChild().firstChild().namedItem("annotations").toElement();
+ TQMap<uint, QPair<TQString, TQString> > annotations = a_annotations;
+ TQDomDocument *dom = Project::ref()->dom();
+ TQDomElement annotationElement = dom->firstChild().firstChild().namedItem("annotations").toElement();
if (annotationElement.isNull())
{
annotationElement = dom->createElement("annotations");
dom->firstChild().firstChild().appendChild(annotationElement);
}
- QDomNode n = annotationElement.firstChild();
+ TQDomNode n = annotationElement.firstChild();
while ( !n.isNull() )
{
- QDomElement el = n.toElement();
- QString fName = el.attribute("url");
- QDomNode n2 = n.nextSibling();
+ TQDomElement el = n.toElement();
+ TQString fName = el.attribute("url");
+ TQDomNode n2 = n.nextSibling();
if (fileName == fName)
{
- QString text = el.attribute("text");
+ TQString text = el.attribute("text");
bool ok;
int line = el.attribute("line").toInt(&ok, 10);
if (!annotations.contains(line) || (annotations[line].first != text))
@@ -243,9 +243,9 @@ void AnnotationOutput::writeAnnotations(const QString &fileName, const QMap<uint
}
n = n2;
}
- for (QMap<uint, QPair<QString, QString> >::ConstIterator it = annotations.constBegin(); it != annotations.constEnd(); ++it)
+ for (TQMap<uint, QPair<TQString, TQString> >::ConstIterator it = annotations.constBegin(); it != annotations.constEnd(); ++it)
{
- QDomElement el = dom->createElement("annotation");
+ TQDomElement el = dom->createElement("annotation");
el.setAttribute("url", fileName);
el.setAttribute("line", it.key());
el.setAttribute("text", it.data().first);
@@ -259,7 +259,7 @@ void AnnotationOutput::writeAnnotations(const QString &fileName, const QMap<uint
readAnnotations();
}
-void AnnotationOutput::allAnnotationsItemExecuted(QListViewItem *item)
+void AnnotationOutput::allAnnotationsItemExecuted(TQListViewItem *item)
{
if (dynamic_cast<KListView*> (item->parent()) != m_allAnnotations)
{
@@ -268,7 +268,7 @@ void AnnotationOutput::allAnnotationsItemExecuted(QListViewItem *item)
emit clicked(m_fileNames[item], 0, 0);
}
-void AnnotationOutput::yourAnnotationsItemExecuted(QListViewItem *item)
+void AnnotationOutput::yourAnnotationsItemExecuted(TQListViewItem *item)
{
if (dynamic_cast<KListView*> (item->parent()) != m_yourAnnotations)
{
@@ -292,25 +292,25 @@ void AnnotationOutput::updateAnnotations()
void AnnotationOutput::updateAnnotationForFile(const KURL& url)
{
- static const QRegExp rx("-->|\\*/");
+ static const TQRegExp rx("-->|\\*/");
if (!ViewManager::ref()->isOpened(url) && QuantaCommon::checkMimeGroup(url, "text" ))
{
// kdDebug(24000) << "Testing " << url << endl;
- QFile f(url.path());
+ TQFile f(url.path());
if (f.open(IO_ReadOnly))
{
- QMap<uint, QPair<QString, QString> > annotations;
+ TQMap<uint, QPair<TQString, TQString> > annotations;
uint i = 0;
- QTextStream stream(&f);
- stream.setEncoding(QTextStream::UnicodeUTF8);
- QString line;
+ TQTextStream stream(&f);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString line;
while (!stream.atEnd())
{
line = stream.readLine();
int pos = line.find("@annotation");
if (pos != -1)
{
- QString receiver;
+ TQString receiver;
pos += 11;
if (line[pos] == '(')
{