diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
commit | e985f7e545f4739493965aad69bbecb136dc9346 (patch) | |
tree | 54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/messages | |
parent | f7670c198945adc3b95ad69a959fe5f8ae55b493 (diff) | |
download | tdewebdev-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/messages')
-rw-r--r-- | quanta/messages/annotationoutput.cpp | 52 | ||||
-rw-r--r-- | quanta/messages/annotationoutput.h | 7 | ||||
-rw-r--r-- | quanta/messages/messageitem.cpp | 6 | ||||
-rw-r--r-- | quanta/messages/messageitem.h | 2 | ||||
-rw-r--r-- | quanta/messages/messageoutput.cpp | 16 | ||||
-rw-r--r-- | quanta/messages/messageoutput.h | 3 |
6 files changed, 44 insertions, 42 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); } } diff --git a/quanta/messages/annotationoutput.h b/quanta/messages/annotationoutput.h index 51c08ead..ac87d705 100644 --- a/quanta/messages/annotationoutput.h +++ b/quanta/messages/annotationoutput.h @@ -37,13 +37,14 @@ enum AnnotationScope class AnnotationOutput : public KTabWidget { Q_OBJECT + TQ_OBJECT public: - AnnotationOutput(TQWidget *parent = 0, const char *name = 0); + AnnotationOutput(TQWidget *tqparent = 0, const char *name = 0); ~AnnotationOutput(); MessageOutput *currentFileAnnotations() const {return m_currentFileAnnotations;} KListView *allAnnotations() const {return m_allAnnotations;} - void writeAnnotations(const TQString &fileName, const TQMap<uint, QPair<TQString, TQString> > &annotations); + void writeAnnotations(const TQString &fileName, const TQMap<uint, TQPair<TQString, TQString> > &annotations); public slots: /** @@ -52,7 +53,7 @@ public slots: void updateAnnotations(); void readAnnotations(); void clearAnnotations(); - void insertAnnotation(uint line, const TQString& fileName, const QPair<TQString, TQString>& annotation); + void insertAnnotation(uint line, const TQString& fileName, const TQPair<TQString, TQString>& annotation); private slots: void tabChanged(TQWidget *w); diff --git a/quanta/messages/messageitem.cpp b/quanta/messages/messageitem.cpp index dc1c7ad8..ab8c1ef1 100644 --- a/quanta/messages/messageitem.cpp +++ b/quanta/messages/messageitem.cpp @@ -31,7 +31,7 @@ int MessageItem::line() } else { // try to find first number in text TQString s = text(); - int pos = s.find( TQRegExp("[0-9]")); + int pos = s.tqfind( TQRegExp("[0-9]")); if ( pos == -1 ) return lineNumber; int pos2 = pos; @@ -70,10 +70,10 @@ TQString MessageItem::fileName() { TQString fname; TQString s = text(); - int pos = s.find(i18n("File: ")); + int pos = s.tqfind(i18n("File: ")); if (pos != -1) { - int pos2 = s.find(i18n(", "), pos); + int pos2 = s.tqfind(i18n(", "), pos); if (pos2 != -1) fname = s.mid(pos, pos2-pos); else diff --git a/quanta/messages/messageitem.h b/quanta/messages/messageitem.h index 64894e25..82653fab 100644 --- a/quanta/messages/messageitem.h +++ b/quanta/messages/messageitem.h @@ -28,7 +28,7 @@ class MessageItem : public TQListBoxText { public: - MessageItem( TQListBox *listbox, const TQString &text = TQString::null, int line = -1, int column = -1, const TQString &fname = TQString::null); + MessageItem( TQListBox *listbox, const TQString &text = TQString(), int line = -1, int column = -1, const TQString &fname = TQString()); /** return line number for file , associated with this message */ int line(); diff --git a/quanta/messages/messageoutput.cpp b/quanta/messages/messageoutput.cpp index de4627ca..666d98d3 100644 --- a/quanta/messages/messageoutput.cpp +++ b/quanta/messages/messageoutput.cpp @@ -24,7 +24,7 @@ #include <kpopupmenu.h> #include <kiconloader.h> -// Qt includes +// TQt includes #include <tqclipboard.h> #include <tqfile.h> #include <tqtextstream.h> @@ -32,8 +32,8 @@ #include "messageoutput.h" #include "messageitem.h" -MessageOutput::MessageOutput(TQWidget *parent, const char *name ) - : TQListBox(parent,name) +MessageOutput::MessageOutput(TQWidget *tqparent, const char *name ) + : TQListBox(tqparent,name) { m_maxItems = 2000; @@ -41,7 +41,7 @@ MessageOutput::MessageOutput(TQWidget *parent, const char *name ) pal.setColor(TQColorGroup::HighlightedText, pal.color(TQPalette::Normal, TQColorGroup::Text)); pal.setColor(TQColorGroup::Highlight, pal.color(TQPalette::Normal, TQColorGroup::Mid)); setPalette(pal); - setFocusPolicy( NoFocus ); + setFocusPolicy( TQ_NoFocus ); m_popupMenu = new KPopupMenu(this); connect(this, TQT_SIGNAL(contextMenuRequested(TQListBoxItem*, const TQPoint&)), @@ -85,7 +85,7 @@ void MessageOutput::showMessage(int line, int col, const TQString &fileName, con int endPos; if ( !count() || (!append && !text(count()-1).stripWhiteSpace().isEmpty()) ) it = insertItem(""); - while ( ( endPos = message.find('\n') ) != -1 ) { + while ( ( endPos = message.tqfind('\n') ) != -1 ) { if (it) { it->setLine(line); @@ -146,7 +146,7 @@ TQString MessageOutput::content() void MessageOutput::copyContent() { - kapp->clipboard()->setText(content(), QClipboard::Clipboard); + kapp->tqclipboard()->setText(content(), TQClipboard::Clipboard); } void MessageOutput::saveContent() @@ -159,13 +159,13 @@ void MessageOutput::saveContent() TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::warningContinueCancel(0, i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") - .arg(url.path()), TQString::null, i18n("Overwrite")) == KMessageBox::Cancel) + .tqarg(url.path()), TQString(), i18n("Overwrite")) == KMessageBox::Cancel) return; TQFile file(url.path()); if (!file.open(IO_WriteOnly)) { KMessageBox::error(0, i18n("<qt>Cannot save log file<br><b>%1</b></qt>") - .arg(url.url())); + .tqarg(url.url())); return; } diff --git a/quanta/messages/messageoutput.h b/quanta/messages/messageoutput.h index 125b85e2..b90198f7 100644 --- a/quanta/messages/messageoutput.h +++ b/quanta/messages/messageoutput.h @@ -32,8 +32,9 @@ weblint output class MessageOutput : public TQListBox { Q_OBJECT + TQ_OBJECT public: - MessageOutput(TQWidget *parent=0, const char *name=0); + MessageOutput(TQWidget *tqparent=0, const char *name=0); ~MessageOutput(); // Return whole content as a single string with EOLs TQString content(); |