summaryrefslogtreecommitdiffstats
path: root/quanta/parts/kafka/wkafkapart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/parts/kafka/wkafkapart.cpp')
-rw-r--r--quanta/parts/kafka/wkafkapart.cpp178
1 files changed, 89 insertions, 89 deletions
diff --git a/quanta/parts/kafka/wkafkapart.cpp b/quanta/parts/kafka/wkafkapart.cpp
index 5641bb36..73e2a019 100644
--- a/quanta/parts/kafka/wkafkapart.cpp
+++ b/quanta/parts/kafka/wkafkapart.cpp
@@ -32,12 +32,12 @@
#include <kglobal.h>
#include <kcharsets.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qdatetime.h>
-#include <qclipboard.h>
-#include <qptrvector.h>
+#include <tqregexp.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqdatetime.h>
+#include <tqclipboard.h>
+#include <tqptrvector.h>
#include "document.h"
#include "viewmanager.h"
@@ -61,25 +61,25 @@
KafkaWidget *kafkaWidget;
KafkaDocument *kafkaDoc;
-KafkaDocument::KafkaDocument(QWidget *parent, QWidget *widgetParent, const char *name)
+KafkaDocument::KafkaDocument(TQWidget *parent, TQWidget *widgetParent, const char *name)
:domNodeProps(1021), _docLoaded(false)
{
// i18n reserve
-QString a = i18n("Selector");QString b = i18n("Attribute");QString c = i18n("Class");
-QString d = i18n("Pseudo-class");QString e = i18n("CSS rules");QString f = i18n("Universal selector");
-QString g = i18n("Linked stylesheets");QString h = i18n("Embedded stylesheets");QString i = i18n("Inline style attribute");
-QString j = i18n("Link");QString k = i18n("Priority");QString l = i18n("ID");
-QString m = i18n("Browser support");QString n = i18n("Pseudo-element");QString o = i18n("Imported");
-QString p = i18n("Inheritance");QString q = i18n("Inherited");QString r = "";
-
-QString s = i18n("Name");QString tt = i18n("Undo");QString u = i18n("Redo");
-QString v = i18n("Undo/Redo history");QString w = i18n("CSS styles");
-
-QString x = i18n("Sorry, VPL does not support this functionality yet.");
-QString y = i18n("Merge cells");
-QString z = i18n("Split cells");
-QString aa = i18n("Edit CSS style of this Tag");
-QString ab = i18n("Ident all");
+TQString a = i18n("Selector");TQString b = i18n("Attribute");TQString c = i18n("Class");
+TQString d = i18n("Pseudo-class");TQString e = i18n("CSS rules");TQString f = i18n("Universal selector");
+TQString g = i18n("Linked stylesheets");TQString h = i18n("Embedded stylesheets");TQString i = i18n("Inline style attribute");
+TQString j = i18n("Link");TQString k = i18n("Priority");TQString l = i18n("ID");
+TQString m = i18n("Browser support");TQString n = i18n("Pseudo-element");TQString o = i18n("Imported");
+TQString p = i18n("Inheritance");TQString q = i18n("Inherited");TQString r = "";
+
+TQString s = i18n("Name");TQString tt = i18n("Undo");TQString u = i18n("Redo");
+TQString v = i18n("Undo/Redo history");TQString w = i18n("CSS styles");
+
+TQString x = i18n("Sorry, VPL does not support this functionality yet.");
+TQString y = i18n("Merge cells");
+TQString z = i18n("Split cells");
+TQString aa = i18n("Edit CSS style of this Tag");
+TQString ab = i18n("Ident all");
//end
#ifdef LIGHT_DEBUG
@@ -96,13 +96,13 @@ QString ab = i18n("Ident all");
domNodeProps.setAutoDelete(false);
KStandardDirs *m_stddirs = new KStandardDirs();
- QFile file( m_stddirs->findResource("data", "kafkapart/entities" )/**locate("appdata","chars") */);
+ TQFile file( m_stddirs->findResource("data", "kafkapart/entities" )/**locate("appdata","chars") */);
delete m_stddirs;
- QString tmp;
+ TQString tmp;
if ( file.open(IO_ReadOnly) )
{
- QTextStream t( &file ); // use a text stream
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t( &file ); // use a text stream
+ t.setEncoding(TQTextStream::UnicodeUTF8);
while ( !t.eof() )
{
tmp = t.readLine();
@@ -116,17 +116,17 @@ QString ab = i18n("Ident all");
file.close();
}
- connect(m_kafkaPart, SIGNAL(domNodeInserted(DOM::Node, bool, NodeModifsSet*)),
- this, SLOT(slotDomNodeInserted(DOM::Node, bool, NodeModifsSet*)));
- connect(m_kafkaPart, SIGNAL(domNodeModified(DOM::Node, NodeModifsSet*)),
- this, SLOT(slotDomNodeModified(DOM::Node, NodeModifsSet*)));
- connect(m_kafkaPart, SIGNAL(domNodeIsAboutToBeRemoved(DOM::Node, bool, NodeModifsSet*)),
- this, SLOT(slotDomNodeAboutToBeRemoved(DOM::Node, bool, NodeModifsSet*)));
- connect(m_kafkaPart, SIGNAL(domNodeIsAboutToBeMoved(DOM::Node, DOM::Node, DOM::Node, NodeModifsSet*)),
- this, SLOT(slotDomNodeIsAboutToBeMoved(DOM::Node, DOM::Node, DOM::Node, NodeModifsSet*)));
+ connect(m_kafkaPart, TQT_SIGNAL(domNodeInserted(DOM::Node, bool, NodeModifsSet*)),
+ this, TQT_SLOT(slotDomNodeInserted(DOM::Node, bool, NodeModifsSet*)));
+ connect(m_kafkaPart, TQT_SIGNAL(domNodeModified(DOM::Node, NodeModifsSet*)),
+ this, TQT_SLOT(slotDomNodeModified(DOM::Node, NodeModifsSet*)));
+ connect(m_kafkaPart, TQT_SIGNAL(domNodeIsAboutToBeRemoved(DOM::Node, bool, NodeModifsSet*)),
+ this, TQT_SLOT(slotDomNodeAboutToBeRemoved(DOM::Node, bool, NodeModifsSet*)));
+ connect(m_kafkaPart, TQT_SIGNAL(domNodeIsAboutToBeMoved(DOM::Node, DOM::Node, DOM::Node, NodeModifsSet*)),
+ this, TQT_SLOT(slotDomNodeIsAboutToBeMoved(DOM::Node, DOM::Node, DOM::Node, NodeModifsSet*)));
- connect(m_kafkaPart, SIGNAL(domNodeNewCursorPos(DOM::Node, int)),
- this, SLOT(slotdomNodeNewCursorPos(DOM::Node, int)));
+ connect(m_kafkaPart, TQT_SIGNAL(domNodeNewCursorPos(DOM::Node, int)),
+ this, TQT_SLOT(slotdomNodeNewCursorPos(DOM::Node, int)));
}
@@ -152,7 +152,7 @@ void KafkaDocument::loadDocument(Document *doc)
if(!m_kafkaPart) return;
if(!doc) return;
#ifdef LIGHT_DEBUG
- QTime t;
+ TQTime t;
t.start();
#endif
m_currentDoc = doc;
@@ -336,7 +336,7 @@ Node *KafkaDocument::getNode(DOM::Node _domNode)
kNodeAttrs* KafkaDocument::connectDomNodeToQuantaNode(DOM::Node domNode, Node *node)
{
- QString name;
+ TQString name;
kNodeAttrs *props;
if(domNode.isNull())
@@ -512,7 +512,7 @@ bool KafkaDocument::buildKafkaNodeFromNode(Node *node, bool insertNode)
#endif
DOM::Node newNode, newNode2, attr, nextNode, parentNode, *ptDomNode;
bool removeLeftWhitespaces, removeRightWhitespaces;
- QString str, nodeValue;
+ TQString str, nodeValue;
Node *n, *parent;
int i;
@@ -686,7 +686,7 @@ bool KafkaDocument::buildKafkaNodeFromNode(Node *node, bool insertNode)
if(!attr.isNull())
{
//TODO: create a createAttr function and add this (setNodeValue sometimes
- //don't like null QString)
+ //don't like null TQString)
if(!node->tag->attributeValue(i).isNull())
attr.setNodeValue(node->tag->attributeValue(i));
kafkaCommon::insertDomNodeAttribute(newNode, attr);
@@ -806,7 +806,7 @@ void KafkaDocument::buildNodeFromKafkaNode(Node *node, DOM::Node domNode)
node->tag->setIndentationDone(false);
if(domNode.nodeType() == DOM::Node::TEXT_NODE)
{
- QString text = domNode.nodeValue().string();
+ TQString text = domNode.nodeValue().string();
text.replace("<", "&lt;");
text.replace(">", "&gt;");
node->tag->setStr(text);
@@ -873,9 +873,9 @@ Node * KafkaDocument::buildNodeFromKafkaNode(DOM::Node domNode, Node *nodeParent
return node;
}
-QString KafkaDocument::getDecodedChar(const QString &encodedChar)
+TQString KafkaDocument::getDecodedChar(const TQString &encodedChar)
{
- QMap<QString, QString>::Iterator it = encodedChars.find(encodedChar);
+ TQMap<TQString, TQString>::Iterator it = encodedChars.find(encodedChar);
if(it == encodedChars.end())
{
//try this
@@ -884,16 +884,16 @@ QString KafkaDocument::getDecodedChar(const QString &encodedChar)
return it.data();
}
-QString KafkaDocument::getDecodedText(const QString &a_encodedText, bool translateWhiteSpacesAndLineBreaks,
+TQString KafkaDocument::getDecodedText(const TQString &a_encodedText, bool translateWhiteSpacesAndLineBreaks,
bool removeLeftWhitespaces, bool removeRightWhitespaces)
{
- QString encodedText = a_encodedText;
+ TQString encodedText = a_encodedText;
if (encodedText.isEmpty())
encodedText = " ";
- QString decodedChar;
+ TQString decodedChar;
int i, j;
#ifdef LIGHT_DEBUG
- QString oldEncodedText = encodedText;
+ TQString oldEncodedText = encodedText;
#endif
i = -1;
@@ -913,11 +913,11 @@ QString KafkaDocument::getDecodedText(const QString &a_encodedText, bool transla
i = -1;
while((unsigned)++i < encodedText.length())
{
- if(QString(encodedText[i]) == "&")
+ if(TQString(encodedText[i]) == "&")
{
j = i;
while((unsigned)++i < encodedText.length() &&
- QString(encodedText[i]) != ";")
+ TQString(encodedText[i]) != ";")
{}
decodedChar = getDecodedChar(encodedText.mid(j, i - j + 1));
encodedText.remove(j, i - j + 1);
@@ -943,28 +943,28 @@ QString KafkaDocument::getDecodedText(const QString &a_encodedText, bool transla
//return KGlobal::charsets()->resolveEntities(encodedText); =>nice but not sufficient
}
-QString KafkaDocument::getEncodedChar(const QString &decodedChar, const QString &previousDecodedChar)
+TQString KafkaDocument::getEncodedChar(const TQString &decodedChar, const TQString &previousDecodedChar)
{
if(decodedChar[0].isSpace() && !previousDecodedChar[0].isSpace())
return " ";
else if(decodedChar[0].isSpace())
//FIXME:for an unknown reason, by default it return &iquest; instead of &nbsp;
return "&nbsp;";
- QMap<QString, QString>::Iterator it = decodedChars.find(decodedChar);
+ TQMap<TQString, TQString>::Iterator it = decodedChars.find(decodedChar);
if(it == decodedChars.end())
return decodedChar;
return it.data();
}
-QString KafkaDocument::getEncodedText(const QString &a_decodedText, int bLine, int bCol, int &eLine, int &eCol,
+TQString KafkaDocument::getEncodedText(const TQString &a_decodedText, int bLine, int bCol, int &eLine, int &eCol,
bool translateWhiteSpaces)
{
- QString decodedText = a_decodedText;
- QString Encodedchar;
- QString decodedChar, previousDecodedChar;
+ TQString decodedText = a_decodedText;
+ TQString Encodedchar;
+ TQString decodedChar, previousDecodedChar;
#ifdef LIGHT_DEBUG
- QString oldDecodedText = decodedText;
+ TQString oldDecodedText = decodedText;
#endif
int i;
#ifdef LIGHT_DEBUG
@@ -975,11 +975,11 @@ QString KafkaDocument::getEncodedText(const QString &a_decodedText, int bLine, i
while((unsigned)++i < decodedText.length())
{
previousDecodedChar = decodedChar;
- decodedChar = QString(decodedText[i]);
+ decodedChar = TQString(decodedText[i]);
if(translateWhiteSpaces || !decodedText[i].isSpace())
- Encodedchar = getEncodedChar(QString(decodedText[i]),
- (i>=1)?previousDecodedChar:QString(""));
+ Encodedchar = getEncodedChar(TQString(decodedText[i]),
+ (i>=1)?previousDecodedChar:TQString(""));
else
Encodedchar = decodedChar;
bCol += Encodedchar.length();
@@ -997,15 +997,15 @@ QString KafkaDocument::getEncodedText(const QString &a_decodedText, int bLine, i
return decodedText;
}
-QString KafkaDocument::getEncodedText(const QString& decodedText)
+TQString KafkaDocument::getEncodedText(const TQString& decodedText)
{
int a = 0, b = 0, c, d;
return getEncodedText(decodedText, a, b, c, d);
}
-QString KafkaDocument::generateCodeFromNode(Node *node, int bLine, int bCol, int &eLine, int &eCol, bool encodeText)
+TQString KafkaDocument::generateCodeFromNode(Node *node, int bLine, int bCol, int &eLine, int &eCol, bool encodeText)
{
- QString text, _char;
+ TQString text, _char;
Node *openingNode;
int bLineAttr, bColAttr;
int j = 0;
@@ -1102,7 +1102,7 @@ QString KafkaDocument::generateCodeFromNode(Node *node, int bLine, int bCol, int
/** Can't use KGlobal::charsets()->toEntity() :
* It translate all chars into entities! */
else if(!hasPreParent)
- text = node->tag->tagStr().replace(QRegExp("\\s+"), " ");
+ text = node->tag->tagStr().replace(TQRegExp("\\s+"), " ");
else
text = node->tag->tagStr();
}
@@ -1142,7 +1142,7 @@ void KafkaDocument::translateQuantaIntoKafkaCursorPosition(uint curLine, uint cu
{
Node *node;
int bCol, bLine, eCol, eLine, col, line;
- QString curChar, decodedChar, currentLine;
+ TQString curChar, decodedChar, currentLine;
bool lookForEntity, lookForSpaces, found;
node = baseNode;
@@ -1248,7 +1248,7 @@ void KafkaDocument::translateQuantaIntoKafkaCursorPosition(uint curLine, uint cu
void KafkaDocument::translateQuantaIntoNodeCursorPosition(uint line, uint col, Node **node, long &offset)
{
int curCol, curLine, beginCol, beginLine;
- QString currentLine;
+ TQString currentLine;
*node = parser->nodeAt(line, col, false);
@@ -1288,8 +1288,8 @@ void KafkaDocument::translateQuantaIntoNodeCursorPosition(uint line, uint col, N
void KafkaDocument::translateKafkaIntoNodeCursorPosition(DOM::Node domNode, long domNodeOffset, Node **node, long &offset)
{
- QString decodedText, encodedChar, encodedText, currentChar;
- QChar curChar, oldChar;
+ TQString decodedText, encodedChar, encodedText, currentChar;
+ TQChar curChar, oldChar;
long currentOffset;
bool waitForSpace = false, found = false;
int curNodeOffset, bLine = 0, bCol = 0, eLine, eCol;
@@ -1356,10 +1356,10 @@ void KafkaDocument::translateKafkaIntoNodeCursorPosition(DOM::Node domNode, long
{
curChar = decodedText.at(domNodeOffset - currentOffset);
#ifdef HEAVY_DEBUG
- //kdDebug(24000)<< "CurChar:" << QString(curChar) << ": oldChar:" <<
- // QString(oldChar) << endl;
+ //kdDebug(24000)<< "CurChar:" << TQString(curChar) << ": oldChar:" <<
+ // TQString(oldChar) << endl;
#endif
- encodedChar = getEncodedChar(QString(curChar), QString(oldChar));
+ encodedChar = getEncodedChar(TQString(curChar), TQString(oldChar));
if(encodedChar == "&nbsp;")
encodedChar = " ";
found = false;
@@ -1409,8 +1409,8 @@ void KafkaDocument::translateKafkaIntoQuantaCursorPosition(DOM::Node _currentDom
{
Node *_currentNode, *closingNode, *node;
kNodeAttrs *attrs;
- QString decodedText, encodedChar, currentLine, currentChar;
- QChar curChar, oldChar;
+ TQString decodedText, encodedChar, currentLine, currentChar;
+ TQChar curChar, oldChar;
int currentOffset;
int curLine, curCol, endLine, endCol;
int i;
@@ -1504,9 +1504,9 @@ void KafkaDocument::translateKafkaIntoQuantaCursorPosition(DOM::Node _currentDom
{
curChar = decodedText[offset - currentOffset];
#ifdef HEAVY_DEBUG
-// kdDebug(24000)<< "CurChar:" << QString(curChar) << ": oldChar:" << QString(oldChar) << endl;
+// kdDebug(24000)<< "CurChar:" << TQString(curChar) << ": oldChar:" << TQString(oldChar) << endl;
#endif
- encodedChar = getEncodedChar(QString(curChar), QString(oldChar));
+ encodedChar = getEncodedChar(TQString(curChar), TQString(oldChar));
if(encodedChar == "&nbsp;")
encodedChar = " ";
found = false;
@@ -1631,7 +1631,7 @@ void KafkaDocument::translateKafkaIntoQuantaCursorPosition(DOM::Node _currentDom
void KafkaDocument::translateNodeIntoKafkaCursorPosition(Node *node, int offset, DOM::Node &domNode,
long &domNodeOffset)
{
- QString textNode, curChar;
+ TQString textNode, curChar;
int col;
bool lookForEntity, lookForSpaces, found;
@@ -1820,7 +1820,7 @@ void KafkaDocument::coutLinkTree(Node *, int)
#endif
{
#ifdef HEAVY_DEBUG
- QString output, dots;
+ TQString output, dots;
DOM::Node domNode;
Node *n = 0L;
if(!node)
@@ -1869,7 +1869,7 @@ void KafkaDocument::slotDomNodeInserted(DOM::Node domNode, bool insertChilds, No
bool b = false;
#ifdef LIGHT_DEBUG
- QTime t;
+ TQTime t;
t.start();
#endif
@@ -1935,7 +1935,7 @@ void KafkaDocument::slotDomNodeModified(DOM::Node domNode, NodeModifsSet* modifs
QTag *qTag;
#ifdef LIGHT_DEBUG
- QTime t;
+ TQTime t;
t.start();
#endif
@@ -2065,7 +2065,7 @@ void KafkaDocument::slotDomNodeAboutToBeRemoved(DOM::Node _domNode, bool deleteC
NodeModif *modif;
#ifdef LIGHT_DEBUG
- QTime t;
+ TQTime t;
t.start();
#endif
@@ -2285,7 +2285,7 @@ void KafkaDocument::slotdomNodeNewCursorPos(DOM::Node, int)
void KafkaDocument::slotCut()
{
- QString text = m_kafkaPart->selectedText();
+ TQString text = m_kafkaPart->selectedText();
NodeSelectionInd selection_ind;
selection_ind.fillWithVPLCursorSelection();
@@ -2305,7 +2305,7 @@ void KafkaDocument::slotCut()
}
void KafkaDocument::slotCut(Node* startNode, int startOffset, Node* endNode, int endOffset,
- Node** cursorNode, long cursorOffset, QString const& text)
+ Node** cursorNode, long cursorOffset, TQString const& text)
{
if(!startNode || !endNode)
return;
@@ -2323,12 +2323,12 @@ void KafkaDocument::slotCut(Node* startNode, int startOffset, Node* endNode, int
if(subtree_root)
{
KafkaDragObject* node_drag = new KafkaDragObject(subtree_root);
- QTextDrag* text_drag = new QTextDrag(text);
+ TQTextDrag* text_drag = new TQTextDrag(text);
KMultipleDrag* drag_object = new KMultipleDrag();
drag_object->addDragObject(node_drag);
drag_object->addDragObject(text_drag);
- QApplication::clipboard()->setData(drag_object);
+ TQApplication::clipboard()->setData(drag_object);
#ifdef LIGHT_DEBUG
kafkaCommon::coutTree(subtree_root, 3);
#endif
@@ -2337,7 +2337,7 @@ void KafkaDocument::slotCut(Node* startNode, int startOffset, Node* endNode, int
void KafkaDocument::slotCopy()
{
- QString text = m_kafkaPart->selectedText();
+ TQString text = m_kafkaPart->selectedText();
NodeSelectionInd selection_ind;
selection_ind.fillWithVPLCursorSelection();
@@ -2350,7 +2350,7 @@ void KafkaDocument::slotCopy()
slotCopy(startNode, startOffset, endNode, endOffset, text);
}
-void KafkaDocument::slotCopy(Node* startNode, int startOffset, Node* endNode, int endOffset, QString const& text)
+void KafkaDocument::slotCopy(Node* startNode, int startOffset, Node* endNode, int endOffset, TQString const& text)
{
if(!startNode || !endNode)
return;
@@ -2360,12 +2360,12 @@ void KafkaDocument::slotCopy(Node* startNode, int startOffset, Node* endNode, in
if(subtree_root)
{
KafkaDragObject* node_drag = new KafkaDragObject(subtree_root);
- QTextDrag* text_drag = new QTextDrag(text);
+ TQTextDrag* text_drag = new TQTextDrag(text);
KMultipleDrag* drag_object = new KMultipleDrag();
drag_object->addDragObject(node_drag);
drag_object->addDragObject(text_drag);
- QApplication::clipboard()->setData(drag_object);
+ TQApplication::clipboard()->setData(drag_object);
// FIXME delete the subtree
#ifdef LIGHT_DEBUG
kafkaCommon::coutTree(subtree_root, 3);
@@ -2375,8 +2375,8 @@ void KafkaDocument::slotCopy(Node* startNode, int startOffset, Node* endNode, in
void KafkaDocument::slotPaste()
{
- QClipboard *cb = QApplication::clipboard();
- QMimeSource* e = cb->data();
+ QClipboard *cb = TQApplication::clipboard();
+ TQMimeSource* e = cb->data();
Node* node = new Node(0);
if(KafkaDragObject::decode(e, node))