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/src/quantaview.cpp | |
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/src/quantaview.cpp')
-rw-r--r-- | quanta/src/quantaview.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/quanta/src/quantaview.cpp b/quanta/src/quantaview.cpp index 51f93294..e0c761e9 100644 --- a/quanta/src/quantaview.cpp +++ b/quanta/src/quantaview.cpp @@ -15,7 +15,7 @@ * * ***************************************************************************/ -// include files for Qt +// include files for TQt #include <tqprinter.h> #include <tqpainter.h> #include <tqtabbar.h> @@ -76,8 +76,8 @@ extern int NN; extern TQValueList<Node*> nodes; -QuantaView::QuantaView(TQWidget *parent, const char *name, const TQString &caption ) - : KMdiChildView(parent, name) +QuantaView::QuantaView(TQWidget *tqparent, const char *name, const TQString &caption ) + : KMdiChildView(tqparent, name) , m_document(0L) , m_plugin(0L) , m_customWidget(0L) @@ -95,7 +95,7 @@ QuantaView::QuantaView(TQWidget *parent, const char *name, const TQString &capti //get the reference to the user toolbar holding widget ToolbarTabWidget *m_toolbarTab = ToolbarTabWidget::ref(); m_toolbarTab->reparent(this, 0, TQPoint(), true); - m_toolbarTab ->setFocusPolicy( TQWidget::NoFocus ); + m_toolbarTab ->setFocusPolicy( TQ_NoFocus ); //create a splitter to separate the VPL and document area m_splitter = new TQSplitter(Qt::Vertical, this); @@ -159,7 +159,7 @@ bool QuantaView::mayRemove() KURL url = m_document->url(); Project::ref()->saveBookmarks(url, dynamic_cast<KTextEditor::MarkInterface*>(m_document->doc())); if (!unmodifiedUntitled) - emit eventHappened("before_close", url.url(), TQString::null); + emit eventHappened("before_close", url.url(), TQString()); m_currentViewsLayout = -1; // m_document->closeTempFile(); if (!m_document->isUntitled() && url.isLocalFile()) @@ -172,7 +172,7 @@ bool QuantaView::mayRemove() quantaApp->menuBar()->activateItemAt(-1); quantaApp->guiFactory()->removeClient(m_document->view()); if (!unmodifiedUntitled) - emit eventHappened("after_close", url.url(), TQString::null); + emit eventHappened("after_close", url.url(), TQString()); } /* kdDebug(24000) << "Calling reparse from close " << endl; parser->setSAParserEnabled(true); @@ -208,7 +208,7 @@ void QuantaView::addDocument(Document *document) reloadUpdateTimers(); - m_currentViewsLayout = -1; //force loading of this layout + m_currentViewsLayout = -1; //force loading of this tqlayout slotSetSourceLayout(); } @@ -263,7 +263,7 @@ void QuantaView::addCustomWidget(TQWidget *widget, const TQString &label) void QuantaView::reloadLayout() { int currentViewsLayout = m_currentViewsLayout; - m_currentViewsLayout = -1; //force loading of this layout + m_currentViewsLayout = -1; //force loading of this tqlayout switch (currentViewsLayout) { case SourceOnly: @@ -290,7 +290,7 @@ void QuantaView::updateTab() TQIconSet mimeIcon (KMimeType::pixmapForURL(m_document->url(), 0, KIcon::Small)); if (mimeIcon.isNull()) mimeIcon = TQIconSet(SmallIcon("document")); - TQString urlStr = QExtFileInfo::shortName(m_document->url().path()); + TQString urlStr = TQExtFileInfo::shortName(m_document->url().path()); if (m_document->isModified()) { if (qConfig.showCloseButtons == "ShowAlways") @@ -393,9 +393,9 @@ void QuantaView::slotSetSourceAndVPLLayout() KToggleAction *ta = (KToggleAction *) quantaApp->actionCollection()->action( "show_kafka_and_quanta" ); - if (m_document->defaultDTD()->name.contains("HTML", false) == 0) + if (m_document->defaultDTD()->name.tqcontains("HTML", false) == 0) { - KMessageBox::information(this, i18n("The VPL Mode does not support the current DTD, at the moment: %1").arg(m_document->defaultDTD()->nickName)); + KMessageBox::information(this, i18n("The VPL Mode does not support the current DTD, at the moment: %1").tqarg(m_document->defaultDTD()->nickName)); KToggleAction *ta2 = (KToggleAction *) quantaApp->actionCollection()->action( "show_quanta_editor" ); if (ta2) ta2->setChecked(true); @@ -442,9 +442,9 @@ void QuantaView::slotSetVPLOnlyLayout() KToggleAction *ta = (KToggleAction *) quantaApp->actionCollection()->action( "show_kafka_view" ); - if (m_document->defaultDTD()->name.contains("HTML", false) == 0) + if (m_document->defaultDTD()->name.tqcontains("HTML", false) == 0) { - KMessageBox::information(this, i18n("The VPL Mode does not support the current DTD, at the moment: %1").arg(m_document->defaultDTD()->nickName)); + KMessageBox::information(this, i18n("The VPL Mode does not support the current DTD, at the moment: %1").tqarg(m_document->defaultDTD()->nickName)); KToggleAction *ta2 = (KToggleAction *) quantaApp->actionCollection()->action( "show_quanta_editor" ); if (ta2) ta2->setChecked(true); @@ -786,9 +786,9 @@ void QuantaView::insertOutputInTheNodeTree(const TQString &str1, const TQString NodeModifsSet *modifs; DOM::Node domNode, domStartContainer, domEndContainer; TQString tagName; - QTag *nodeQTag, *qTag, *nodeParentQTag; + TQTag *nodeTQTag, *qTag, *nodeParentTQTag; Node *nodeCursor, *startContainer, *endContainer, *nodeParent, *dummy; - TQPtrList<QTag> qTagList; + TQPtrList<TQTag> qTagList; int startCol, startLine, endCol, endLine; bool specialTagInsertion = false; long nodeOffset, startOffset, endOffset, domNodeOffset; @@ -833,24 +833,24 @@ void QuantaView::insertOutputInTheNodeTree(const TQString &str1, const TQString nodeParent = nodeCursor; if (nodeParent->tag->type == Tag::Text) - nodeParent = nodeParent->parent; + nodeParent = nodeParent->tqparent; - //Checking if at least one parent of node can have a Text Node as child, otherwise + //Checking if at least one tqparent of node can have a Text Node as child, otherwise //it is impossible for the - //user to add this node. In that case, try to insert the Node in the closest parent accepting it. + //user to add this node. In that case, try to insert the Node in the closest tqparent accepting it. //e.g. TR : a normal insertion would require to have the caret in the TABLE Node, but it is //impossible - nodeQTag = QuantaCommon::tagFromDTD(m_document->defaultDTD(), + nodeTQTag = QuantaCommon::tagFromDTD(m_document->defaultDTD(), node->tag->name); - if (!nodeQTag) + if (!nodeTQTag) return; - qTagList = nodeQTag->parents(); + qTagList = nodeTQTag->tqparents(); #ifdef HEAVY_DEBUG - kdDebug(25001)<< "nodeQTag name : " << nodeQTag->name() << endl; - /**kdDebug(25001)<< nodeQTag->isChild("#text", false) << endl; - kdDebug(25001)<< nodeQTag->isChild("#text", true) << endl;*/ + kdDebug(25001)<< "nodeTQTag name : " << nodeTQTag->name() << endl; + /**kdDebug(25001)<< nodeTQTag->isChild("#text", false) << endl; + kdDebug(25001)<< nodeTQTag->isChild("#text", true) << endl;*/ #endif for (qTag = qTagList.first(); qTag; qTag = qTagList.next()) { @@ -904,13 +904,13 @@ void QuantaView::insertOutputInTheNodeTree(const TQString &str1, const TQString nodeTreeModified = false; if (specialTagInsertion) { - //let's try to insert this node in the closest parent accepting it. + //let's try to insert this node in the closest tqparent accepting it. while (nodeParent) { - nodeParentQTag = + nodeParentTQTag = QuantaCommon::tagFromDTD(m_document->defaultDTD(), nodeParent->tag->name); - if (nodeParentQTag && nodeParentQTag->isChild(node)) + if (nodeParentTQTag && nodeParentTQTag->isChild(node)) { nodeCursor = kafkaCommon::createMandatoryNodeSubtree(node, m_document); @@ -919,10 +919,10 @@ void QuantaView::insertOutputInTheNodeTree(const TQString &str1, const TQString nodeTreeModified = true; break; } - nodeParent = nodeParent->parent; + nodeParent = nodeParent->tqparent; } } - else if (hasSelection && !nodeQTag->isSingle()) + else if (hasSelection && !nodeTQTag->isSingle()) { //If some text is selected in kafka, surround the selection with the new Node. if(!startContainer || !endContainer) @@ -934,7 +934,7 @@ void QuantaView::insertOutputInTheNodeTree(const TQString &str1, const TQString else { //Nothing is selected, simply inserting the Node if it is not an inline. -/* if(!kafkaCommon::isInline(node->tag->name) || nodeQTag->isSingle()) +/* if(!kafkaCommon::isInline(node->tag->name) || nodeTQTag->isSingle()) {*/ nodeTreeModified = kafkaCommon::DTDinsertRemoveNode(node, nodeCursor, (int)nodeOffset, nodeCursor, (int)nodeOffset, m_document, &nodeCursor, nodeOffset, modifs); @@ -1021,14 +1021,14 @@ void QuantaView::activated() ToolbarTabWidget::ref()->reparent(this, 0, TQPoint(), qConfig.enableDTDToolbar); m_viewLayout->addWidget(ToolbarTabWidget::ref(), 0 , 0); quantaApp->partManager()->setActivePart(m_document->doc(), m_document->view()); - m_document->checkDirtyStatus(); + m_document->checkDirtytqStatus(); StructTreeView::ref()->useOpenLevelSetting = true; quantaApp->slotLoadToolbarForDTD(m_document->getDTDIdentifier()); //TEMP : If the activated document is not a (X)HTML document, disable smartTagInsertion //Will be removed when VPL will support every DTD KAction *action = quantaApp->actionCollection()->action("smart_tag_insertion"); - if(action && m_document->defaultDTD()->name.contains("HTML", false) == 0) + if(action && m_document->defaultDTD()->name.tqcontains("HTML", false) == 0) { qConfig.smartTagInsertion = false; (static_cast<KToggleAction* >(action))->setChecked(false); @@ -1064,7 +1064,7 @@ bool QuantaView::saveModified(bool ask) int want_save; if (ask) want_save = KMessageBox::warningYesNoCancel(this, - i18n("The file \"%1\" has been modified.\nDo you want to save it?").arg(fileName), + i18n("The file \"%1\" has been modified.\nDo you want to save it?").tqarg(fileName), i18n("Warning"), KStdGuiItem::save(), KStdGuiItem::discard()); else want_save = KMessageBox::Yes; @@ -1108,7 +1108,7 @@ bool QuantaView::saveDocument(const KURL& url) if (url.isEmpty()) return false; - emit eventHappened("before_save", url.url(), TQString::null); + emit eventHappened("before_save", url.url(), TQString()); m_saveResult = true; KURL oldURL = m_document->url(); if (!m_document->isUntitled() && oldURL.isLocalFile()) @@ -1125,7 +1125,7 @@ bool QuantaView::saveDocument(const KURL& url) return false; //saving to a local file failed } else //successful saving to a local file { - m_document->setDirtyStatus(false); + m_document->setDirtytqStatus(false); m_document->removeBackup(quantaApp->config()); fileWatcher->addFile(m_document->url().path()); // kdDebug(24000) << "addFile[saveDocument, 2]: " << m_document->url().path() << endl; @@ -1140,7 +1140,7 @@ bool QuantaView::saveDocument(const KURL& url) if (m_saveResult) { //start an event loop and wait until the saving finished - QExtFileInfo internalFileInfo; + TQExtFileInfo internalFileInfo; m_eventLoopStarted = true; internalFileInfo.enter_loop(); } @@ -1161,7 +1161,7 @@ bool QuantaView::saveDocument(const KURL& url) { setCaption(m_document->url().fileName()); } - emit eventHappened("after_save", m_document->url().url(), TQString::null); + emit eventHappened("after_save", m_document->url().url(), TQString()); return true; } @@ -1170,16 +1170,16 @@ void QuantaView::slotSavingFailed(const TQString &error) Q_UNUSED(error); m_saveResult = false; if (m_eventLoopStarted) - qApp->exit_loop(); + tqApp->exit_loop(); } void QuantaView::slotSavingCompleted() { m_saveResult = true; - m_document->setDirtyStatus(false); + m_document->setDirtytqStatus(false); m_document->removeBackup(quantaApp->config()); if (m_eventLoopStarted) - qApp->exit_loop(); + tqApp->exit_loop(); } #include "quantaview.moc" |