diff options
Diffstat (limited to 'konq-plugins/domtreeviewer/domtreeview.cpp')
-rw-r--r-- | konq-plugins/domtreeviewer/domtreeview.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/konq-plugins/domtreeviewer/domtreeview.cpp b/konq-plugins/domtreeviewer/domtreeview.cpp index d26dbfc..812cb5b 100644 --- a/konq-plugins/domtreeviewer/domtreeview.cpp +++ b/konq-plugins/domtreeviewer/domtreeview.cpp @@ -64,8 +64,8 @@ using namespace domtreeviewer; -DOMTreeView::DOMTreeView(TQWidget *parent, const char* name, bool /*allowSaving*/) - : DOMTreeViewBase(parent, name), m_expansionDepth(5), m_maxDepth(0), +DOMTreeView::DOMTreeView(TQWidget *tqparent, const char* name, bool /*allowSaving*/) + : DOMTreeViewBase(tqparent, name), m_expansionDepth(5), m_maxDepth(0), m_bPure(true), m_bShowAttributes(true), m_bHighlightHTML(true), m_findDialog(0), focused_child(0) { @@ -101,8 +101,8 @@ DOMTreeView::DOMTreeView(TQWidget *parent, const char* name, bool /*allowSaving* installEventFilter(m_listView); - ManipulationCommand::connect(TQT_SIGNAL(nodeChanged(const DOM::Node &)), this, TQT_SLOT(slotRefreshNode(const DOM::Node &))); - ManipulationCommand::connect(TQT_SIGNAL(structureChanged()), this, TQT_SLOT(refresh())); + ManipulationCommand::connect(TQT_SIGNAL(nodeChanged(const DOM::Node &)), TQT_TQOBJECT(this), TQT_SLOT(slotRefreshNode(const DOM::Node &))); + ManipulationCommand::connect(TQT_SIGNAL(structureChanged()), TQT_TQOBJECT(this), TQT_SLOT(refresh())); initDOMNodeInfo(); @@ -124,28 +124,28 @@ void DOMTreeView::setHtmlPart(KHTMLPart *_part) // nothing here yet } - parentWidget()->setCaption( part ? i18n( "DOM Tree for %1" ).arg(part->url().prettyURL()) : i18n("DOM Tree") ); + tqparentWidget()->setCaption( part ? i18n( "DOM Tree for %1" ).tqarg(part->url().prettyURL()) : i18n("DOM Tree") ); TQTimer::singleShot(0, this, TQT_SLOT(slotSetHtmlPartDelayed())); } DOMTreeWindow *DOMTreeView::mainWindow() const { - return static_cast<DOMTreeWindow *>(parentWidget()); + return static_cast<DOMTreeWindow *>(tqparentWidget()); } bool DOMTreeView::eventFilter(TQObject *o, TQEvent *e) { if (e->type() == TQEvent::AccelOverride) { - TQKeyEvent *ke = static_cast<TQKeyEvent *>(e); + TQKeyEvent *ke = TQT_TQKEYEVENT(e); kdDebug(90180) << " acceloverride " << ke->key() << " o " << o->name() << endl; - if (o == m_listView) { // DOM tree + if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_listView)) { // DOM tree KKey ks = mainWindow()->deleteNodeAction()->shortcut().seq(0).key(0); if (ke->key() == ks.keyCodeQt()) return true; - } else if (o == nodeAttributes) { + } else if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(nodeAttributes)) { KKey ks = mainWindow()->deleteAttributeAction()->shortcut().seq(0).key(0); if (ke->key() == ks.keyCodeQt()) return true; @@ -155,14 +155,14 @@ bool DOMTreeView::eventFilter(TQObject *o, TQEvent *e) } else if (e->type() == TQEvent::FocusIn) { kdDebug(90180) << " focusin o " << o->name() << endl; - if (o != this) { + if (TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this)) { focused_child = o; } } else if (e->type() == TQEvent::FocusOut) { kdDebug(90180) << " focusout o " << o->name() << endl; - if (o != this) { + if (TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(this)) { focused_child = 0; } @@ -214,7 +214,7 @@ void DOMTreeView::slotShowTree(const DOM::Node &pNode) void DOMTreeView::showRecursive(const DOM::Node &pNode, const DOM::Node &node, uint depth) { DOMListViewItem *cur_item; - DOMListViewItem *parent_item = m_itemdict[pNode.handle()]; + DOMListViewItem *tqparent_item = m_itemdict[pNode.handle()]; if (depth > m_maxDepth) { m_maxDepth = depth; @@ -224,7 +224,7 @@ void DOMTreeView::showRecursive(const DOM::Node &pNode, const DOM::Node &node, u cur_item = new DOMListViewItem(node, m_listView); m_document = pNode.ownerDocument(); } else { - cur_item = new DOMListViewItem(node, parent_item); + cur_item = new DOMListViewItem(node, tqparent_item); } //kdDebug(90180) << node.nodeName().string() << " [" << depth << "]" << endl; @@ -252,7 +252,7 @@ void DOMTreeView::showRecursive(const DOM::Node &pNode, const DOM::Node &node, u cur_item = new DOMListViewItem(node, m_listView, cur_item); m_document = pNode.ownerDocument(); } else { - cur_item = new DOMListViewItem(node, parent_item, cur_item); + cur_item = new DOMListViewItem(node, tqparent_item, cur_item); } //kdDebug(90180) << "</" << node.nodeName().string() << ">" << endl; addElement(element, cur_item, true); @@ -318,13 +318,13 @@ void DOMTreeView::addElement ( const DOM::Node &node, DOMListViewItem *cur_item m_itemdict.insert(node.handle(), cur_item); } - DOMListViewItem *parent; - if (cur_item->parent()) { - parent = static_cast<DOMListViewItem *>(cur_item->parent()); + DOMListViewItem *tqparent; + if (cur_item->tqparent()) { + tqparent = static_cast<DOMListViewItem *>(cur_item->tqparent()); } else { - parent = cur_item; + tqparent = cur_item; } - cur_item = new DOMListViewItem(node, parent, cur_item); + cur_item = new DOMListViewItem(node, tqparent, cur_item); } // This is one is too much DOMListViewItem *notLastItem = static_cast<DOMListViewItem *>(cur_item->itemAbove()); @@ -343,7 +343,7 @@ void DOMTreeView::highlightHTML(DOMListViewItem *cur_item, const TQString &nodeN * think it's worth it. */ - TQColor namedColor(palette().active().text()); + TQColor namedColor(tqpalette().active().text()); TQString tagName = nodeName.upper(); if ( tagName == "HTML" ) { namedColor = "#0000ff"; @@ -469,13 +469,13 @@ void DOMTreeView::slotMovedItems(TQPtrList<TQListViewItem> &items, TQPtrList<TQL for (; it != items.end(); ++it, ++anit) { DOMListViewItem *item = static_cast<DOMListViewItem *>(*it); DOMListViewItem *anitem = static_cast<DOMListViewItem *>(*anit); - DOM::Node parent = static_cast<DOMListViewItem *>(item->parent())->node(); - Q_ASSERT(!parent.isNull()); + DOM::Node tqparent = static_cast<DOMListViewItem *>(item->tqparent())->node(); + Q_ASSERT(!tqparent.isNull()); // kdDebug(90180) << " afternow " << anitem << " node " << (anitem ? anitem->node().nodeName().string() : TQString()) << "=" << (anitem ? anitem->node().nodeValue().string() : TQString()) << endl; - cmd->addCommand(new MoveNodeCommand(item->node(), parent, - anitem ? anitem->node().nextSibling() : parent.firstChild()) + cmd->addCommand(new MoveNodeCommand(item->node(), tqparent, + anitem ? anitem->node().nextSibling() : tqparent.firstChild()) ); } @@ -503,7 +503,7 @@ void DOMTreeView::searchRecursive(DOMListViewItem* cur_item, const TQString& sea bool caseSensitive) { const TQString text(cur_item->text(0)); - if (text.contains(searchText, caseSensitive) > 0) { + if (text.tqcontains(searchText, caseSensitive) > 0) { cur_item->setUnderline(true); cur_item->setItalic(true); m_listView->setCurrentItem(cur_item); @@ -530,7 +530,7 @@ void DOMTreeView::slotSaveClicked() if (file.exists()) { const TQString title = i18n( "File Exists" ); - const TQString text = i18n( "Do you really want to overwrite: \n%1?" ).arg(url.url()); + const TQString text = i18n( "Do you really want to overwrite: \n%1?" ).tqarg(url.url()); if (KMessageBox::Continue != KMessageBox::warningContinueCancel(this, text, title, i18n("Overwrite") ) ) { return; } @@ -545,12 +545,12 @@ void DOMTreeView::slotSaveClicked() delete m_textStream; } else { const TQString title = i18n( "Unable to Open File" ); - const TQString text = i18n( "Unable to open \n %1 \n for writing" ).arg(url.path()); + const TQString text = i18n( "Unable to open \n %1 \n for writing" ).tqarg(url.path()); KMessageBox::sorry( this, text, title ); } } else { const TQString title = i18n( "Invalid URL" ); - const TQString text = i18n( "This URL \n %1 \n is not valid." ).arg(url.url()); + const TQString text = i18n( "This URL \n %1 \n is not valid." ).tqarg(url.url()); KMessageBox::sorry( this, text, title ); } } @@ -720,8 +720,8 @@ void DOMTreeView::hideMessageLine() void DOMTreeView::moveToParent() { // This is a hypersmart algorithm. - // If infoNode is defined, go to the parent of infoNode, otherwise, go - // to the parent of the tree view's current item. + // If infoNode is defined, go to the tqparent of infoNode, otherwise, go + // to the tqparent of the tree view's current item. // Hope this isn't too smart. DOM::Node cur = infoNode; @@ -773,15 +773,15 @@ void DOMTreeView::deleteNodes() // don't regard node more than once if (item->node() == last) continue; - // check for selected parent + // check for selected tqparent bool has_selected_parent = false; - for (TQListViewItem *p = item->parent(); p; p = p->parent()) { + for (TQListViewItem *p = item->tqparent(); p; p = p->tqparent()) { if (p->isSelected()) { has_selected_parent = true; break; } } if (has_selected_parent) continue; // kdDebug(90180) << " item->node " << item->node().nodeName().string() << ": schedule for removal" << endl; - // remove this node if it isn't already recursively removed by its parent + // remove this node if it isn't already recursively removed by its tqparent cmd->addCommand(new RemoveNodeCommand(item->node(), item->node().parentNode(), item->node().nextSibling())); last = item->node(); } @@ -885,13 +885,13 @@ void DOMTreeView::slotAddElementDlg() DOM::Node curNode = item->node(); try { - DOM::Node parent = addBefore() ? curNode.parentNode() : curNode; + DOM::Node tqparent = addBefore() ? curNode.parentNode() : curNode; DOM::Node after = addBefore() ? curNode : 0; // ### take namespace into account DOM::Node newNode = curNode.ownerDocument().createElement(qname); - ManipulationCommand *cmd = new InsertNodeCommand(newNode, parent, after); + ManipulationCommand *cmd = new InsertNodeCommand(newNode, tqparent, after); mainWindow()->executeAndAddCommand(cmd); if (cmd->isValid()) activateNode(newNode); @@ -921,12 +921,12 @@ void DOMTreeView::slotAddTextDlg() DOM::Node curNode = item->node(); try { - DOM::Node parent = addBefore() ? curNode.parentNode() : curNode; + DOM::Node tqparent = addBefore() ? curNode.parentNode() : curNode; DOM::Node after = addBefore() ? curNode : 0; DOM::Node newNode = curNode.ownerDocument().createTextNode(text); - ManipulationCommand *cmd = new InsertNodeCommand(newNode, parent, after); + ManipulationCommand *cmd = new InsertNodeCommand(newNode, tqparent, after); mainWindow()->executeAndAddCommand(cmd); if (cmd->isValid()) activateNode(newNode); @@ -943,21 +943,21 @@ static TQString *clickToAdd; /** * List view item for attribute list. */ -class AttributeListItem : public QListViewItem +class AttributeListItem : public TQListViewItem { typedef TQListViewItem super; bool _new; public: - AttributeListItem(TQListView *parent, TQListViewItem *prev) - : super(parent, prev), _new(true) + AttributeListItem(TQListView *tqparent, TQListViewItem *prev) + : super(tqparent, prev), _new(true) { } AttributeListItem(const TQString &attrName, const TQString &attrValue, - TQListView *parent, TQListViewItem *prev) - : super(parent, prev), _new(false) + TQListView *tqparent, TQListViewItem *prev) + : super(tqparent, prev), _new(false) { setText(0, attrName); setText(1, attrValue); @@ -973,7 +973,7 @@ public: protected: virtual void paintCell( TQPainter *p, const TQColorGroup &cg, - int column, int width, int alignment ) + int column, int width, int tqalignment ) { bool updates_enabled = listView()->isUpdatesEnabled(); listView()->setUpdatesEnabled(false); @@ -993,7 +993,7 @@ protected: TQColorGroup _cg( cg ); _cg.setColor( TQColorGroup::Text, c ); - super::paintCell( p, _cg, column, width, alignment ); + super::paintCell( p, _cg, column, width, tqalignment ); if (text_changed) setText(column, oldText); listView()->setUpdatesEnabled(updates_enabled); @@ -1015,7 +1015,7 @@ void DOMTreeView::initDOMNodeInfo() connect(applyContent, TQT_SIGNAL(clicked()), TQT_SLOT(slotApplyContent())); - ManipulationCommand::connect(TQT_SIGNAL(nodeChanged(const DOM::Node &)), this, TQT_SLOT(initializeOptionsFromNode(const DOM::Node &))); + ManipulationCommand::connect(TQT_SIGNAL(nodeChanged(const DOM::Node &)), TQT_TQOBJECT(this), TQT_SLOT(initializeOptionsFromNode(const DOM::Node &))); nodeAttributes->setRenameable(0, true); nodeAttributes->setRenameable(1, true); @@ -1168,7 +1168,7 @@ void DOMTreeView::slotEditAttribute(TQListViewItem *lvi, const TQPoint &, int co slotItemRenamed(lvi, attrName, 0); // Reget, item may have been changed - lvi = nodeAttributes->findItem(attrName, 0); + lvi = nodeAttributes->tqfindItem(attrName, 0); } if (lvi && lvi->text(1) != attrValue) |