diff options
Diffstat (limited to 'quanta/utility')
-rw-r--r-- | quanta/utility/myprocess.h | 1 | ||||
-rw-r--r-- | quanta/utility/newstuff.cpp | 44 | ||||
-rw-r--r-- | quanta/utility/newstuff.h | 41 | ||||
-rw-r--r-- | quanta/utility/qpevents.cpp | 48 | ||||
-rw-r--r-- | quanta/utility/qpevents.h | 17 | ||||
-rw-r--r-- | quanta/utility/quantabookmarks.cpp | 28 | ||||
-rw-r--r-- | quanta/utility/quantabookmarks.h | 7 | ||||
-rw-r--r-- | quanta/utility/quantacommon.cpp | 76 | ||||
-rw-r--r-- | quanta/utility/quantacommon.h | 14 | ||||
-rw-r--r-- | quanta/utility/quantanetaccess.cpp | 18 | ||||
-rw-r--r-- | quanta/utility/resource.h | 4 | ||||
-rw-r--r-- | quanta/utility/tagaction.cpp | 150 | ||||
-rw-r--r-- | quanta/utility/tagaction.h | 5 | ||||
-rw-r--r-- | quanta/utility/tagactionmanager.cpp | 14 | ||||
-rw-r--r-- | quanta/utility/tagactionmanager.h | 2 | ||||
-rw-r--r-- | quanta/utility/tagactionset.cpp | 74 | ||||
-rw-r--r-- | quanta/utility/tagactionset.h | 19 | ||||
-rw-r--r-- | quanta/utility/toolbartabwidget.cpp | 64 | ||||
-rw-r--r-- | quanta/utility/toolbartabwidget.h | 12 |
19 files changed, 326 insertions, 312 deletions
diff --git a/quanta/utility/myprocess.h b/quanta/utility/myprocess.h index a495cdf9..13820fb5 100644 --- a/quanta/utility/myprocess.h +++ b/quanta/utility/myprocess.h @@ -21,6 +21,7 @@ class MyProcess:public KProcess { Q_OBJECT + TQ_OBJECT public: MyProcess(); diff --git a/quanta/utility/newstuff.cpp b/quanta/utility/newstuff.cpp index bc3a052f..12eb12c9 100644 --- a/quanta/utility/newstuff.cpp +++ b/quanta/utility/newstuff.cpp @@ -29,7 +29,7 @@ #include "quantacommon.h" #include "qextfileinfo.h" -void QNewDTEPStuff::installResource() +void TQNewDTEPStuff::installResource() { bool ok = true; KTar tar(m_tarName, "application/x-gzip"); @@ -50,64 +50,64 @@ void QNewDTEPStuff::installResource() } else ok = false; if (!ok) - KMessageBox::error(parentWidget(), i18n("There was an error with the downloaded DTEP tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("DTEP Installation Error")); + KMessageBox::error(tqparentWidget(), i18n("There was an error with the downloaded DTEP tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("DTEP Installation Error")); } -QNewToolbarStuff::QNewToolbarStuff(const TQString &type, TQWidget *parentWidget) - :KNewStuffSecure(type, parentWidget) +TQNewToolbarStuff::TQNewToolbarStuff(const TQString &type, TQWidget *tqparentWidget) + :KNewStuffSecure(type, tqparentWidget) { - connect(this, TQT_SIGNAL(loadToolbarFile(const KURL&)), parentWidget, TQT_SLOT(slotLoadToolbarFile(const KURL&))); + connect(this, TQT_SIGNAL(loadToolbarFile(const KURL&)), tqparentWidget, TQT_SLOT(slotLoadToolbarFile(const KURL&))); } -void QNewToolbarStuff::installResource() +void TQNewToolbarStuff::installResource() { KURL destURL = KURL::fromPathOrURL(KGlobal::dirs()->saveLocation("data") + resourceDir + "toolbars/" + TQFileInfo(m_tarName).fileName()); bool ok = true; - if (QuantaCommon::checkOverwrite(destURL, parentWidget())) + if (QuantaCommon::checkOverwrite(destURL, tqparentWidget())) { - if (!QExtFileInfo::copy(KURL::fromPathOrURL(m_tarName), destURL, -1, true, false, parentWidget())) + if (!TQExtFileInfo::copy(KURL::fromPathOrURL(m_tarName), destURL, -1, true, false, tqparentWidget())) ok = false; else { - if (KMessageBox::questionYesNo(parentWidget(), i18n("Do you want to load the newly downloaded toolbar?"), i18n("Load Toolbar"), i18n("Load"), KStdGuiItem::cancel()) == KMessageBox::Yes) + if (KMessageBox::questionYesNo(tqparentWidget(), i18n("Do you want to load the newly downloaded toolbar?"), i18n("Load Toolbar"), i18n("Load"), KStdGuiItem::cancel()) == KMessageBox::Yes) { emit loadToolbarFile(destURL); } } if (!ok) - KMessageBox::error(parentWidget(), i18n("There was an error with the downloaded toolbar tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("Toolbar Installation Error")); + KMessageBox::error(tqparentWidget(), i18n("There was an error with the downloaded toolbar tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("Toolbar Installation Error")); } } -QNewTemplateStuff::QNewTemplateStuff(const TQString &type, TQWidget *parentWidget) - :KNewStuffSecure(type, parentWidget) +TQNewTemplateStuff::TQNewTemplateStuff(const TQString &type, TQWidget *tqparentWidget) + :KNewStuffSecure(type, tqparentWidget) { - connect(this, TQT_SIGNAL(openFile(const KURL&)), parentWidget, TQT_SLOT(slotFileOpen(const KURL&))); + connect(this, TQT_SIGNAL(openFile(const KURL&)), tqparentWidget, TQT_SLOT(slotFileOpen(const KURL&))); } -void QNewTemplateStuff::installResource() +void TQNewTemplateStuff::installResource() { KURL destURL = KURL::fromPathOrURL(KGlobal::dirs()->saveLocation("data") + resourceDir + "templates/" + TQFileInfo(m_tarName).fileName()); bool ok = true; - if (QuantaCommon::checkOverwrite(destURL, parentWidget())) + if (QuantaCommon::checkOverwrite(destURL, tqparentWidget())) { - if (!QExtFileInfo::copy(KURL::fromPathOrURL(m_tarName), destURL, -1, true, false, parentWidget())) + if (!TQExtFileInfo::copy(KURL::fromPathOrURL(m_tarName), destURL, -1, true, false, tqparentWidget())) ok = false; else { - if (KMessageBox::questionYesNo(parentWidget(), i18n("Do you want to open the newly downloaded template?"), i18n("Open Template"), KStdGuiItem::open(), KStdGuiItem::cancel()) == KMessageBox::Yes) + if (KMessageBox::questionYesNo(tqparentWidget(), i18n("Do you want to open the newly downloaded template?"), i18n("Open Template"), KStdGuiItem::open(), KStdGuiItem::cancel()) == KMessageBox::Yes) { emit openFile(destURL); } } if (!ok) - KMessageBox::error(parentWidget(), i18n("There was an error with the downloaded template file."), i18n("Template Installation Error")); + KMessageBox::error(tqparentWidget(), i18n("There was an error with the downloaded template file."), i18n("Template Installation Error")); } } -void QNewScriptStuff::installResource() +void TQNewScriptStuff::installResource() { bool ok = true; KTar tar(m_tarName, "application/x-gzip"); @@ -121,10 +121,10 @@ void QNewScriptStuff::installResource() ok = false; if (!ok) - KMessageBox::error(parentWidget(), i18n("There was an error with the downloaded script tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("Script Installation Error")); + KMessageBox::error(tqparentWidget(), i18n("There was an error with the downloaded script tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("Script Installation Error")); } -void QNewDocStuff::installResource() +void TQNewDocStuff::installResource() { bool ok = true; KTar tar(m_tarName, "application/x-gzip"); @@ -138,7 +138,7 @@ void QNewDocStuff::installResource() ok = false; if (!ok) - KMessageBox::error(parentWidget(), i18n("There was an error with the downloaded script tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("Documentation Installation Error")); + KMessageBox::error(tqparentWidget(), i18n("There was an error with the downloaded script tarball file. Possible causes are damaged archive or invalid directory structure in the archive."), i18n("Documentation Installation Error")); } #include "newstuff.moc" diff --git a/quanta/utility/newstuff.h b/quanta/utility/newstuff.h index bdd49a50..e25639a0 100644 --- a/quanta/utility/newstuff.h +++ b/quanta/utility/newstuff.h @@ -29,14 +29,15 @@ Makes possible downloading and installing a DTEP resource files from a server. class KURL; -class QNewDTEPStuff: public KNewStuffSecure +class TQNewDTEPStuff: public KNewStuffSecure { Q_OBJECT + TQ_OBJECT public: - QNewDTEPStuff(const TQString &type, TQWidget *parentWidget=0) - :KNewStuffSecure(type, parentWidget){}; - ~QNewDTEPStuff() {}; + TQNewDTEPStuff(const TQString &type, TQWidget *tqparentWidget=0) + :KNewStuffSecure(type, tqparentWidget){}; + ~TQNewDTEPStuff() {}; private: virtual void installResource(); @@ -47,13 +48,14 @@ Makes possible downloading and installing a Toolbar resource files from a server @author Andras Mantia */ -class QNewToolbarStuff: public KNewStuffSecure +class TQNewToolbarStuff: public KNewStuffSecure { Q_OBJECT + TQ_OBJECT public: - QNewToolbarStuff(const TQString &type, TQWidget *parentWidget=0); - ~QNewToolbarStuff() {}; + TQNewToolbarStuff(const TQString &type, TQWidget *tqparentWidget=0); + ~TQNewToolbarStuff() {}; signals: void loadToolbarFile(const KURL&); @@ -67,13 +69,14 @@ Makes possible downloading and installing a template resource files from a serve @author Andras Mantia */ -class QNewTemplateStuff: public KNewStuffSecure +class TQNewTemplateStuff: public KNewStuffSecure { Q_OBJECT + TQ_OBJECT public: - QNewTemplateStuff(const TQString &type, TQWidget *parentWidget=0); - ~QNewTemplateStuff() {}; + TQNewTemplateStuff(const TQString &type, TQWidget *tqparentWidget=0); + ~TQNewTemplateStuff() {}; signals: void openFile(const KURL&); @@ -87,14 +90,15 @@ Makes possible downloading and installing a script resource files from a server. @author Andras Mantia */ -class QNewScriptStuff: public KNewStuffSecure +class TQNewScriptStuff: public KNewStuffSecure { Q_OBJECT + TQ_OBJECT public: - QNewScriptStuff(const TQString &type, TQWidget *parentWidget=0) - :KNewStuffSecure(type, parentWidget){}; - ~QNewScriptStuff() {}; + TQNewScriptStuff(const TQString &type, TQWidget *tqparentWidget=0) + :KNewStuffSecure(type, tqparentWidget){}; + ~TQNewScriptStuff() {}; private: virtual void installResource(); @@ -105,14 +109,15 @@ Makes possible downloading and installing a documentation resource files from a @author Andras Mantia */ -class QNewDocStuff: public KNewStuffSecure +class TQNewDocStuff: public KNewStuffSecure { Q_OBJECT + TQ_OBJECT public: - QNewDocStuff(const TQString &type, TQWidget *parentWidget=0) - :KNewStuffSecure(type, parentWidget){}; - ~QNewDocStuff() {}; + TQNewDocStuff(const TQString &type, TQWidget *tqparentWidget=0) + :KNewStuffSecure(type, tqparentWidget){}; + ~TQNewDocStuff() {}; private: virtual void installResource(); diff --git a/quanta/utility/qpevents.cpp b/quanta/utility/qpevents.cpp index 3426b83f..7be8fc66 100644 --- a/quanta/utility/qpevents.cpp +++ b/quanta/utility/qpevents.cpp @@ -36,8 +36,8 @@ #include "tagaction.h" //TODO: Better create a class for each internal event action -QPEvents::QPEvents(TQObject *parent, const char *name) - : TQObject(parent, name) +TQPEvents::TQPEvents(TQObject *tqparent, const char *name) + : TQObject(tqparent, name) { m_eventNames["before_save"] = i18n("Before Document Save"); m_eventNames["after_save"] = i18n("After Document Save"); @@ -66,17 +66,17 @@ QPEvents::QPEvents(TQObject *parent, const char *name) } -QPEvents::~QPEvents() +TQPEvents::~TQPEvents() { } -void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1, const TQString& argument2) +void TQPEvents::slotEventHappened(const TQString& name, const TQString& argument1, const TQString& argument2) { if (!quantaApp || !Project::ref()->eventsEnabled()) return; EventActions *events = Project::ref()->events(); if (!events) return; - if (events->contains(name)) + if (events->tqcontains(name)) { m_eventName = name; TQValueList<EventAction> evList = (*events)[name]; @@ -85,18 +85,18 @@ void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1 EventAction ev = *it; if (ev.type == EventAction::Internal) { - if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An internal action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").arg(ev.action).arg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about internal actions") == KMessageBox::Cancel) + if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An internal action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").tqarg(ev.action).tqarg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about internal actions") == KMessageBox::Cancel) return; } else { - if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An external action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").arg(ev.action).arg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about external actions") == KMessageBox::Cancel) + if (KMessageBox::warningContinueCancel(0L, i18n("<qt>An external action (<i>%1</i>) associated with an event (<i>%2</i>) will be executed. Do you want to allow the execution of this action?</qt>").tqarg(ev.action).tqarg(name), i18n("Event Triggered"), i18n("Execute"), "Warn about external actions") == KMessageBox::Cancel) return; } KURL url = KURL::fromPathOrURL(argument1); KURL url2 = KURL::fromPathOrURL(argument2); if (url.isValid()) { - bool inProject = Project::ref()->contains(url); + bool inProject = Project::ref()->tqcontains(url); if (inProject) { if (name == "upload_requested") @@ -131,7 +131,7 @@ void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1 } } else { - TQString relativePath = QExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()).path(); + TQString relativePath = TQExtFileInfo::toRelative(url, Project::ref()->projectBaseURL()).path(); if (inProject && name == "after_save") { ev.arguments << i18n("Document saved"); @@ -220,11 +220,11 @@ void QPEvents::slotEventHappened(const TQString& name, const TQString& argument1 } } } - if (!m_eventNames.contains(name)) - KMessageBox::sorry(0L, i18n("<qt>Unsupported event <b>%1</b>.</qt>").arg(name), i18n("Event Handling Error")); + if (!m_eventNames.tqcontains(name)) + KMessageBox::sorry(0L, i18n("<qt>Unsupported event <b>%1</b>.</qt>").tqarg(name), i18n("Event Handling Error")); } -bool QPEvents::handleEvent(const EventAction& ev) +bool TQPEvents::handleEvent(const EventAction& ev) { if (ev.type == EventAction::Internal) { @@ -294,7 +294,7 @@ bool QPEvents::handleEvent(const EventAction& ev) TQTextStream stream(&file); stream.setEncoding(TQTextStream::UnicodeUTF8); //Note: the log text should not be translated. - TQString s = TQDateTime::currentDateTime().toString(Qt::ISODate) + ": "; + TQString s = TQDateTime::tqcurrentDateTime().toString(Qt::ISODate) + ": "; s.append( "Event : " + m_eventName + " : "); s.append( "Action: " + ev.action + " : "); if (ev.arguments[1] == "full") @@ -309,11 +309,11 @@ bool QPEvents::handleEvent(const EventAction& ev) } if (!result) { - KMessageBox::sorry(0L, i18n("<qt>Logging failed. Check that you have write access to <i>%1</i>.").arg(url.path())); + KMessageBox::sorry(0L, i18n("<qt>Logging failed. Check that you have write access to <i>%1</i>.").tqarg(url.path())); return false; } } else - KMessageBox::sorry(0L, i18n("<qt>Unsupported internal event action : <b>%1</b>.</qt>").arg(ev.action)); + KMessageBox::sorry(0L, i18n("<qt>Unsupported internal event action : <b>%1</b>.</qt>").tqarg(ev.action)); } else if (ev.type == EventAction::External) { @@ -336,7 +336,7 @@ bool QPEvents::handleEvent(const EventAction& ev) { action->activate(); } else - KMessageBox::sorry(0L, i18n("<qt>The <b>%1</b> script action was not found on your system.</qt>").arg(name), i18n("Action Execution Error")); + KMessageBox::sorry(0L, i18n("<qt>The <b>%1</b> script action was not found on your system.</qt>").tqarg(name), i18n("Action Execution Error")); } else KMessageBox::sorry(0L, i18n("Unsupported external event action.")); } else @@ -344,23 +344,23 @@ bool QPEvents::handleEvent(const EventAction& ev) return false; } -TQString QPEvents::fullEventName(const TQString &name) +TQString TQPEvents::fullEventName(const TQString &name) { - if (m_eventNames.contains(name)) + if (m_eventNames.tqcontains(name)) return m_eventNames[name]; else return name; } -TQString QPEvents::fullActionName(const TQString& name) +TQString TQPEvents::fullActionName(const TQString& name) { - if (m_actionNames.contains(name)) + if (m_actionNames.tqcontains(name)) return m_actionNames[name]; else return name; } -TQString QPEvents::eventName(const TQString &fullName) +TQString TQPEvents::eventName(const TQString &fullName) { for (TQMap<TQString, TQString>::ConstIterator it = m_eventNames.constBegin(); it != m_eventNames.constEnd(); ++it) { @@ -370,7 +370,7 @@ TQString QPEvents::eventName(const TQString &fullName) return fullName; } -TQString QPEvents::actionName(const TQString &fullName) +TQString TQPEvents::actionName(const TQString &fullName) { for (TQMap<TQString, TQString>::ConstIterator it = m_actionNames.constBegin(); it != m_actionNames.constEnd(); ++it) { @@ -380,7 +380,7 @@ TQString QPEvents::actionName(const TQString &fullName) return fullName; } -TQStringList QPEvents::eventNames() +TQStringList TQPEvents::eventNames() { TQStringList names; for (TQMap<TQString, TQString>::ConstIterator it = m_eventNames.constBegin(); it != m_eventNames.constEnd(); ++it) @@ -390,7 +390,7 @@ TQStringList QPEvents::eventNames() return names; } -TQStringList QPEvents::actionNames() +TQStringList TQPEvents::actionNames() { TQStringList names; for (TQMap<TQString, TQString>::ConstIterator it = m_actionNames.constBegin(); it != m_actionNames.constEnd(); ++it) diff --git a/quanta/utility/qpevents.h b/quanta/utility/qpevents.h index 373ae089..31c05235 100644 --- a/quanta/utility/qpevents.h +++ b/quanta/utility/qpevents.h @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#ifndef QPEVENTS_H -#define QPEVENTS_H +#ifndef TQPEVENTS_H +#define TQPEVENTS_H #include <tqobject.h> @@ -50,17 +50,18 @@ after_project_remove, after_commit */ typedef TQMap<TQString, TQValueList<EventAction> > EventActions; -class QPEvents : public QObject +class TQPEvents : public TQObject { Q_OBJECT + TQ_OBJECT public: - static QPEvents* const ref(TQObject *parent = 0L) + static TQPEvents* const ref(TQObject *tqparent = 0L) { - static QPEvents *m_ref; - if (!m_ref) m_ref = new QPEvents(parent); + static TQPEvents *m_ref; + if (!m_ref) m_ref = new TQPEvents(tqparent); return m_ref; } - ~QPEvents(); + ~TQPEvents(); TQString fullEventName(const TQString &name); TQString fullActionName(const TQString &name); TQString eventName(const TQString &fullName); @@ -73,7 +74,7 @@ public slots: void slotEventHappened(const TQString& name, const TQString& argument1, const TQString& argument2); private: - QPEvents(TQObject *parent = 0, const char *name = 0); + TQPEvents(TQObject *tqparent = 0, const char *name = 0); /** Calls the action associated with an event. Returns true if the call succeeded, false otherwise. The call might fail if: - the action type is unknown diff --git a/quanta/utility/quantabookmarks.cpp b/quanta/utility/quantabookmarks.cpp index 12ba69c5..9b91220d 100644 --- a/quanta/utility/quantabookmarks.cpp +++ b/quanta/utility/quantabookmarks.cpp @@ -61,12 +61,12 @@ static void ssort( TQMemArray<uint> &a, int max ) // TODO add a insort() or bubble_sort - more efficient for aboutToShow() ? -QuantaBookmarks::QuantaBookmarks(ViewManager *parent,Sorting sort, bool onlyFromActualDocument ) - : TQObject( parent, "bookmarks" ) +QuantaBookmarks::QuantaBookmarks(ViewManager *tqparent,Sorting sort, bool onlyFromActualDocument ) + : TQObject( tqparent, "bookmarks" ) , m_sorting(sort) , m_onlyFromActualDocument(onlyFromActualDocument) { - m_viewManager = parent; + m_viewManager = tqparent; _tries=0; m_bookmarksMenu = 0L; m_doc = 0L; @@ -182,21 +182,21 @@ int QuantaBookmarks::insertBookmarks(TQPopupMenu& menu, Document *doc, bool inse TQString bText = KStringHandler::rEmSqueeze ( doc->editIf->textLine( (*it)->line ), menu.fontMetrics(), 32 ); - bText.replace(re, "&&"); // kill undesired accellerators! - bText.replace('\t', ' '); // kill tabs, as they are interpreted as shortcuts + bText.tqreplace(re, "&&"); // kill undesired accellerators! + bText.tqreplace('\t', ' '); // kill tabs, as they are interpreted as shortcuts if ( m_sorting == Position ) { sortArray[i] = (*it)->line; ssort( sortArray, i ); - idx = sortArray.find( (*it)->line ); + idx = sortArray.tqfind( (*it)->line ); if (insertNavigationItems) idx += 3; i++; } menu.insertItem( - TQString("%1 - \"%2\"").arg( (*it)->line+1 ).arg( bText ), + TQString("%1 - \"%2\"").tqarg( (*it)->line+1 ).tqarg( bText ), 0, (*it)->line, idx ); insertedItems++; @@ -219,15 +219,15 @@ int QuantaBookmarks::insertBookmarks(TQPopupMenu& menu, Document *doc, bool inse idx = ++old_menu_count; if ( next ) { - m_goNext->setText( i18n("&Next: %1 - \"%2\"").arg( next->line + 1 ) - .arg( KStringHandler::rsqueeze( doc->editIf->textLine( next->line ), 24 ) ) ); + m_goNext->setText( i18n("&Next: %1 - \"%2\"").tqarg( next->line + 1 ) + .tqarg( KStringHandler::rsqueeze( doc->editIf->textLine( next->line ), 24 ) ) ); m_goNext->plug( &menu, idx ); idx++; } if ( prev ) { - m_goPrevious->setText( i18n("&Previous: %1 - \"%2\"").arg(prev->line + 1 ) - .arg( KStringHandler::rsqueeze( doc->editIf->textLine( prev->line ), 24 ) ) ); + m_goPrevious->setText( i18n("&Previous: %1 - \"%2\"").tqarg(prev->line + 1 ) + .tqarg( KStringHandler::rsqueeze( doc->editIf->textLine( prev->line ), 24 ) ) ); m_goPrevious->plug( &menu, idx ); idx++; } @@ -361,10 +361,10 @@ void QuantaBookmarks::gotoLineNumber(int line) Document *doc = m_doc; if (!doc) doc = m_viewManager->activeDocument(); - const TQObject *s = sender(); + TQObject *s = TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender())); for (uint i = 0; i < m_othersMenuList.count(); i++) { - if (s == m_othersMenuList[i]) + if (TQT_BASE_OBJECT(s) == TQT_BASE_OBJECT(m_othersMenuList[i])) { doc = m_others[i]; break; @@ -396,4 +396,4 @@ void QuantaBookmarks::marksChanged () #include "quantabookmarks.moc" -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/quanta/utility/quantabookmarks.h b/quanta/utility/quantabookmarks.h index 440f4fea..7dac33d5 100644 --- a/quanta/utility/quantabookmarks.h +++ b/quanta/utility/quantabookmarks.h @@ -40,13 +40,14 @@ class TQMenuData; -class QuantaBookmarks : public QObject +class QuantaBookmarks : public TQObject { Q_OBJECT + TQ_OBJECT public: enum Sorting { Position, Creation }; - QuantaBookmarks(ViewManager *parent, Sorting sort=Position, bool onlyFromActualDocument = false ); + QuantaBookmarks(ViewManager *tqparent, Sorting sort=Position, bool onlyFromActualDocument = false ); virtual ~QuantaBookmarks(); void createActions( KActionCollection* ); @@ -95,5 +96,5 @@ class QuantaBookmarks : public QObject #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; // vim: noet ts=2 diff --git a/quanta/utility/quantacommon.cpp b/quanta/utility/quantacommon.cpp index 93421764..6b709ca3 100644 --- a/quanta/utility/quantacommon.cpp +++ b/quanta/utility/quantacommon.cpp @@ -41,7 +41,7 @@ #include <ktempdir.h> #include <ktempfile.h> -//remove the below ones when KQPasteAction is removed +//remove the below ones when KTQPasteAction is removed #include <dcopclient.h> #include <kdebug.h> #include <kpopupmenu.h> @@ -60,7 +60,7 @@ //#include "resource.h" -QConfig qConfig; //holds the main configuration settings +TQConfig qConfig; //holds the main configuration settings TQString tmpDir; TQRegExp scriptBeginRx; @@ -144,11 +144,11 @@ bool QuantaCommon::isSingleTag(const TQString& dtdName, const TQString& tag) if(tag.lower() == "!doctype" || tag.lower() == "?xml") return true; - const DTDStruct* dtd = DTDs::ref()->find(dtdName); + const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName); if (dtd && !tag.isEmpty()) { TQString searchForTag = (dtd->caseSensitive) ? tag : tag.upper(); - QTag* qtag = dtd->tagsList->find(searchForTag); + TQTag* qtag = dtd->tagsList->tqfind(searchForTag); if (qtag) single = qtag->isSingle(); } @@ -161,11 +161,11 @@ bool QuantaCommon::isOptionalTag(const TQString& dtdName, const TQString& tag) { bool optional = false; - const DTDStruct* dtd = DTDs::ref()->find(dtdName); + const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName); if (dtd && !tag.isEmpty()) { TQString searchForTag = (dtd->caseSensitive) ? tag : tag.upper(); - QTag* qtag = dtd->tagsList->find(searchForTag); + TQTag* qtag = dtd->tagsList->tqfind(searchForTag); if (qtag) optional = qtag->isOptional(); } @@ -177,11 +177,11 @@ bool QuantaCommon::isKnownTag(const TQString& dtdName, const TQString& tag) { bool known = false; - const DTDStruct* dtd = DTDs::ref()->find(dtdName); + const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName); if (dtd && !tag.isEmpty()) { TQString searchForTag = (dtd->caseSensitive) ? tag : tag.upper(); - if (dtd->tagsList->find(searchForTag)) + if (dtd->tagsList->tqfind(searchForTag)) known = true; } @@ -192,11 +192,11 @@ AttributeList* QuantaCommon::tagAttributes(const TQString& dtdName, const TQStri { AttributeList* attrs = 0L; - const DTDStruct* dtd = DTDs::ref()->find(dtdName); + const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName); if (dtd && !tag.isEmpty()) { TQString searchForTag = (dtd->caseSensitive) ? tag : tag.upper(); - QTag* qtag = dtd->tagsList->find(searchForTag); + TQTag* qtag = dtd->tagsList->tqfind(searchForTag); if (qtag) attrs = qtag->attributes(); } @@ -204,28 +204,28 @@ AttributeList* QuantaCommon::tagAttributes(const TQString& dtdName, const TQStri return attrs; } -/** Returns the QTag object for the tag "tag" from the DTD named "dtdname". */ -QTag* QuantaCommon::tagFromDTD(const TQString& dtdName, const TQString& tag) +/** Returns the TQTag object for the tag "tag" from the DTD named "dtdname". */ +TQTag* QuantaCommon::tagFromDTD(const TQString& dtdName, const TQString& tag) { - const DTDStruct* dtd = DTDs::ref()->find(dtdName); + const DTDStruct* dtd = DTDs::ref()->tqfind(dtdName); return tagFromDTD(dtd, tag); } -/** Returns the QTag object for the tag "tag" from the DTD. */ -QTag* QuantaCommon::tagFromDTD(const DTDStruct *dtd, const TQString& tag) +/** Returns the TQTag object for the tag "tag" from the DTD. */ +TQTag* QuantaCommon::tagFromDTD(const DTDStruct *dtd, const TQString& tag) { - QTag *qtag = 0; + TQTag *qtag = 0; if (dtd && !tag.isEmpty()) { TQString searchForTag = (dtd->caseSensitive) ? tag : tag.upper(); - qtag = dtd->tagsList->find(searchForTag); + qtag = dtd->tagsList->tqfind(searchForTag); } return qtag; } -/** Returns the QTag object for the node "node" from node's DTD. */ -QTag* QuantaCommon::tagFromDTD(Node *node) +/** Returns the TQTag object for the node "node" from node's DTD. */ +TQTag* QuantaCommon::tagFromDTD(Node *node) { if(!node || !node->tag) return 0L; @@ -311,7 +311,7 @@ bool QuantaCommon::checkMimeGroup(const KURL& url, const TQString& group) mimetype = mimetype.section('/',-1); for ( it = list.begin(); it != list.end(); ++it ) { - if ( ((*it)->name().contains(group)) && ((*it)->name().find(mimetype) != -1) + if ( ((*it)->name().tqcontains(group)) && ((*it)->name().tqfind(mimetype) != -1) ) { status = true; break; @@ -381,9 +381,9 @@ TQString QuantaCommon::qUrl(const KURL &url) /** No descriptions */ void QuantaCommon::dirCreationError(TQWidget *widget, const KURL& url) { - KMessageBox::error(widget, i18n("<qt>Cannot create folder<br><b>%1</b>.<br>Check that you have write permission in the parent folder or that the connection to<br><b>%2</b><br> is valid.</qt>") - .arg(url.prettyURL(0, KURL::StripFileProtocol)) - .arg(url.protocol()+"://"+url.user()+"@"+url.host()));} + KMessageBox::error(widget, i18n("<qt>Cannot create folder<br><b>%1</b>.<br>Check that you have write permission in the tqparent folder or that the connection to<br><b>%2</b><br> is valid.</qt>") + .tqarg(url.prettyURL(0, KURL::StripFileProtocol)) + .tqarg(url.protocol()+"://"+url.user()+"@"+url.host()));} /** Adds the backslash before the special chars (like ?, *, . ) so the returned @@ -410,7 +410,7 @@ TQString QuantaCommon::makeRxCompatible(const TQString& s) TQString str = s; for (uint i = 0; i < max - 1; i++) { - str.replace(rxs[i], strs[i]); + str.tqreplace(rxs[i], strs[i]); } return str; @@ -488,7 +488,7 @@ void QuantaCommon::removeCommentsAndQuotes(TQString &str, const DTDStruct *dtd) } else { s = dtd->comments[s]; - l = str.find(s, pos); + l = str.tqfind(s, pos); l = (l == -1) ? str.length() : l; for (int i = pos; i < l ; i++) { @@ -554,7 +554,7 @@ bool QuantaCommon::insideCommentsOrQuotes(int position, const TQString &string, } else { s = dtd->comments[s]; - l = str.find(s, pos); + l = str.tqfind(s, pos); l = (l == -1) ? str.length() : l; for (int i = pos; i < l ; i++) { @@ -596,7 +596,7 @@ DCOPReply QuantaCommon::callDCOPMethod(const TQString& interface, const TQString if (!kapp->inherits("KUniqueApplication")) { pid_t pid = ::getpid(); - app += TQString("-%1").arg(pid); + app += TQString("-%1").tqarg(pid); } DCOPRef quantaRef(app.utf8(), interface.utf8()); DCOPReply reply; @@ -633,12 +633,12 @@ void QuantaCommon::normalizeStructure(TQString f,TQStringList& l) f.remove("\n"); f.remove("\r"); - while(f.contains("<")) + while(f.tqcontains("<")) { TQString z(f); - z.truncate(z.find(">")+1); - z.remove(0,z.find("<")); - f.remove(0,f.find(">")+1); + z.truncate(z.tqfind(">")+1); + z.remove(0,z.tqfind("<")); + f.remove(0,f.tqfind(">")+1); l.append(z); } } @@ -704,10 +704,10 @@ bool QuantaCommon::checkOverwrite(const KURL& url, TQWidget *window) { bool result = true; - if (QExtFileInfo::exists(url, false, window)) + if (TQExtFileInfo::exists(url, false, window)) { if (KMessageBox::warningContinueCancel(window, - i18n( "<qt>The file <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>" ).arg(url.prettyURL(0, KURL::StripFileProtocol)), TQString::null, i18n("Overwrite")) == KMessageBox::Cancel) + i18n( "<qt>The file <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>" ).tqarg(url.prettyURL(0, KURL::StripFileProtocol)), TQString(), i18n("Overwrite")) == KMessageBox::Cancel) result = false; } @@ -723,7 +723,7 @@ TQStringList QuantaCommon::readPathListEntry(KConfig *config, const TQString &pK KURL u = KURL::fromPathOrURL(*it); if (u.isValid() && u.isLocalFile()) { - u.setPath(QExtFileInfo::canonicalPath(u.path())); + u.setPath(TQExtFileInfo::canonicalPath(u.path())); *it = u.url(); } } @@ -736,7 +736,7 @@ TQString QuantaCommon::readPathEntry(KConfig *config, const TQString &pKey) KURL u = KURL::fromPathOrURL(path); if (u.isValid() && u.isLocalFile()) { - u.setPath(QExtFileInfo::canonicalPath(u.path())); + u.setPath(TQExtFileInfo::canonicalPath(u.path())); path = u.url(); } return path; @@ -745,9 +745,9 @@ TQString QuantaCommon::readPathEntry(KConfig *config, const TQString &pKey) TQString QuantaCommon::encodedChar(uint code) { - if (replacementMap.contains(code)) - return TQString("%1;").arg(replacementMap[code]); + if (replacementMap.tqcontains(code)) + return TQString("%1;").tqarg(replacementMap[code]); else - return TQString("&#%1;").arg(code); + return TQString("&#%1;").tqarg(code); } diff --git a/quanta/utility/quantacommon.h b/quanta/utility/quantacommon.h index 915de6fb..61c86f9e 100644 --- a/quanta/utility/quantacommon.h +++ b/quanta/utility/quantacommon.h @@ -48,7 +48,7 @@ public: //Quanta main configuration structure -class QConfig{ +class TQConfig{ public: //Tag style options uint tagCase; @@ -137,12 +137,12 @@ quotation setting*/ static bool isKnownTag(const TQString& dtdName, const TQString& tag); /** No descriptions */ static AttributeList* tagAttributes(const TQString& dtdName, const TQString& tag); - /** Returns the QTag object for the tag "tag" from the DTD named "dtdname". */ - static QTag* tagFromDTD(const TQString& dtdName, const TQString& tag); - /** Returns the QTag object for the tag "tag" from the DTD. */ - static QTag* tagFromDTD(const DTDStruct* dtd, const TQString& tag); - /** Returns the QTag object for the node "node" from node's DTD. */ - static QTag* tagFromDTD(Node *node); + /** Returns the TQTag object for the tag "tag" from the DTD named "dtdname". */ + static TQTag* tagFromDTD(const TQString& dtdName, const TQString& tag); + /** Returns the TQTag object for the tag "tag" from the DTD. */ + static TQTag* tagFromDTD(const DTDStruct* dtd, const TQString& tag); + /** Returns the TQTag object for the node "node" from node's DTD. */ + static TQTag* tagFromDTD(Node *node); /** Returns an XML style string containing the GUI for attributes. */ static TQString xmlFromAttributes(AttributeList* attributes); /** Returns 0 if the (line,col) is inside the area specified by the other arguments, diff --git a/quanta/utility/quantanetaccess.cpp b/quanta/utility/quantanetaccess.cpp index dbaf1ce3..93c664e3 100644 --- a/quanta/utility/quantanetaccess.cpp +++ b/quanta/utility/quantanetaccess.cpp @@ -176,13 +176,13 @@ void QuantaNetAccess::checkProjectInsert(const KURL& target, TQWidget* window, b if ( !Project::ref()->hasProject()) return; KURL saveUrl = adjustURL(target); KURL baseURL = Project::ref()->projectBaseURL(); - if ( baseURL.isParentOf(saveUrl) && !Project::ref()->contains(saveUrl) ) + if ( baseURL.isParentOf(saveUrl) && !Project::ref()->tqcontains(saveUrl) ) { if (confirm) { - TQString nice = QExtFileInfo::toRelative(saveUrl, baseURL).path(); + TQString nice = TQExtFileInfo::toRelative(saveUrl, baseURL).path(); nice = KStringHandler::lsqueeze(nice, 60); - if ( KMessageBox::Yes != KMessageBox::questionYesNo(window, i18n("<qt>Do you want to add <br><b>%1</b><br> to the project?</qt>").arg(nice), i18n("Add to Project"), KStdGuiItem::add(), i18n("Do Not Add"), "AddToProject") ) + if ( KMessageBox::Yes != KMessageBox::questionYesNo(window, i18n("<qt>Do you want to add <br><b>%1</b><br> to the project?</qt>").tqarg(nice), i18n("Add to Project"), KStdGuiItem::add(), i18n("Do Not Add"), "AddToProject") ) { return; } @@ -201,13 +201,13 @@ bool QuantaNetAccess::checkProjectRemove(const KURL& src, TQWidget* window, bool if ( !Project::ref()->hasProject() ) return true; KURL url = adjustURL(src); KURL baseURL = Project::ref()->projectBaseURL(); - if ( baseURL.isParentOf(url) && Project::ref()->contains(url) ) + if ( baseURL.isParentOf(url) && Project::ref()->tqcontains(url) ) { if (confirm) { - TQString nice = QExtFileInfo::toRelative(url, baseURL).path(); + TQString nice = TQExtFileInfo::toRelative(url, baseURL).path(); nice = KStringHandler::lsqueeze(nice, 60); - if ( KMessageBox::Continue != KMessageBox::warningContinueCancel(window, i18n("<qt>Do you really want to remove <br><b>%1</b><br> from the project?</qt>").arg(nice), i18n("Remove From Project"), KStdGuiItem::remove(), "RemoveFromProject") ) + if ( KMessageBox::Continue != KMessageBox::warningContinueCancel(window, i18n("<qt>Do you really want to remove <br><b>%1</b><br> from the project?</qt>").tqarg(nice), i18n("Remove From Project"), KStdGuiItem::remove(), "RemoveFromProject") ) { return false; } @@ -224,13 +224,13 @@ bool QuantaNetAccess::checkProjectDel(const KURL& src, TQWidget* window, bool co KURL url = adjustURL(src); if ( Project::ref()->hasProject() ) { - if ( Project::ref()->projectBaseURL().isParentOf(url) && Project::ref()->contains(url) ) + if ( Project::ref()->projectBaseURL().isParentOf(url) && Project::ref()->tqcontains(url) ) { if (confirm) { TQString nice = url.prettyURL(0, KURL::StripFileProtocol); nice = KStringHandler::csqueeze(nice, 60); - if ( KMessageBox::Continue != KMessageBox::warningContinueCancel(window, i18n("<qt>Do you really want to delete <br><b>%1</b><br> and remove it from the project?</qt>").arg(nice), i18n("Delete & Remove From Project"), KStdGuiItem::del(), "DeleteAndRemoveFromProject") ) + if ( KMessageBox::Continue != KMessageBox::warningContinueCancel(window, i18n("<qt>Do you really want to delete <br><b>%1</b><br> and remove it from the project?</qt>").tqarg(nice), i18n("Delete & Remove From Project"), KStdGuiItem::del(), "DeleteAndRemoveFromProject") ) { return false; } @@ -243,7 +243,7 @@ bool QuantaNetAccess::checkProjectDel(const KURL& src, TQWidget* window, bool co if (confirm) { TQString nice = url.prettyURL(0, KURL::StripFileProtocol); nice = KStringHandler::csqueeze(nice, 60); - return (KMessageBox::Continue == KMessageBox::warningContinueCancel(window, i18n("<qt>Do you really want to delete <br><b>%1</b>?</qt>").arg(nice), i18n("Delete File or Folder"), KStdGuiItem::del(), "DeleteFileOrFolder") ); + return (KMessageBox::Continue == KMessageBox::warningContinueCancel(window, i18n("<qt>Do you really want to delete <br><b>%1</b>?</qt>").tqarg(nice), i18n("Delete File or Folder"), KStdGuiItem::del(), "DeleteFileOrFolder") ); } return true; } diff --git a/quanta/utility/resource.h b/quanta/utility/resource.h index 6e7bf950..8bb344d3 100644 --- a/quanta/utility/resource.h +++ b/quanta/utility/resource.h @@ -28,11 +28,11 @@ class KTempDir; class Node; class Parser; -struct QConfig; +struct TQConfig; struct DTDStruct; -extern QConfig qConfig; +extern TQConfig qConfig; extern TQString tmpDir; extern TQRegExp scriptBeginRx; diff --git a/quanta/utility/tagaction.cpp b/quanta/utility/tagaction.cpp index 9787d047..33bf5313 100644 --- a/quanta/utility/tagaction.cpp +++ b/quanta/utility/tagaction.cpp @@ -72,14 +72,14 @@ int MyProcess::commSetupDoneC() return KProcess::commSetupDoneC(); } -TagAction::TagAction( TQDomElement *element, KMainWindow *parentMainWindow, bool toggle) +TagAction::TagAction( TQDomElement *element, KMainWindow *tqparentMainWindow, bool toggle) : KToggleAction(element->attribute("text").isEmpty() ? TQString("") : i18n(element->attribute("text").utf8()), - KShortcut(element->attribute("shortcut")), 0, 0, parentMainWindow->actionCollection(), element->attribute("name").ascii()), + KShortcut(element->attribute("shortcut")), 0, 0, tqparentMainWindow->actionCollection(), element->attribute("name").ascii()), //disable toggle now m_toggle(toggle) m_toggle(false) { setToolTip(element->attribute("tooltip")); - m_parentMainWindow = parentMainWindow; + m_parentMainWindow = tqparentMainWindow; m_modified = false; m_useInputFile = false; m_useOutputFile = false; @@ -93,8 +93,8 @@ TagAction::TagAction( TQDomElement *element, KMainWindow *parentMainWindow, bool m_file = 0L; loopStarted = false; #if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0) - connect(this, TQT_SIGNAL(activated(KAction::ActivationReason, Qt::ButtonState)), - TQT_SLOT(slotActionActivated(KAction::ActivationReason, Qt::ButtonState))); + connect(this, TQT_SIGNAL(activated(KAction::ActivationReason, TQt::ButtonState)), + TQT_SLOT(slotActionActivated(KAction::ActivationReason, TQt::ButtonState))); #else connect(this, TQT_SIGNAL(activated()), TQT_SLOT(slotActionActivated())); #endif @@ -114,7 +114,7 @@ TQString TagAction::type() } #if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0) -bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::ButtonState /*state*/) +bool TagAction::slotActionActivated(KAction::ActivationReason reason, TQt::ButtonState /*state*/) { QuantaView *view = ViewManager::ref()->activeView(); if ( !view || !view->document()) @@ -162,7 +162,7 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button start_node = end_node = current_node; start_offset = end_offset = current_offset; - QTag* tag_description = QuantaCommon::tagFromDTD(KafkaDocument::ref()->getCurrentDoc()->defaultDTD(), XMLTagName()); + TQTag* tag_description = QuantaCommon::tagFromDTD(KafkaDocument::ref()->getCurrentDoc()->defaultDTD(), XMLTagName()); scope = tag_description->scope(); // Q_ASSERT(!scope.isNull()); if(scope.isNull()) @@ -281,7 +281,7 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button s1 += " "+QuantaCommon::attrCase(attr); if (otag.text().right(1) == ">") { - QTag *dtdTag = QuantaCommon::tagFromDTD(w->defaultDTD(), name); + TQTag *dtdTag = QuantaCommon::tagFromDTD(w->defaultDTD(), name); if ( w->defaultDTD()->singleTagStyle == "xml" && dtdTag && (dtdTag->isSingle() || (!qConfig.closeOptionalTags && dtdTag->isOptional())) ) @@ -332,16 +332,16 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button TQString fname = w->url().url(); if ( w->url().protocol() == "file") fname = w->url().path(); - command.replace("%f", fname ); + command.tqreplace("%f", fname ); } pid_t pid = ::getpid(); if (kapp->inherits("KUniqueApplication")) { - command.replace("%pid", TQString("unique %1").arg(pid)); + command.tqreplace("%pid", TQString("unique %1").tqarg(pid)); } else { - command.replace("%pid", TQString("%1").arg(pid)); + command.tqreplace("%pid", TQString("%1").tqarg(pid)); } TQString buffer; TQString inputType = script.attribute("input","none"); @@ -352,9 +352,9 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button if ( inputType == "selected" && w->selectionIf) { buffer = w->selectionIf->selection(); } - command.replace("%input", buffer); + command.tqreplace("%input", buffer); command = command.stripWhiteSpace(); - int pos = command.find(' '); + int pos = command.tqfind(' '); TQString args; if (pos != -1) { @@ -374,46 +374,46 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button pos = 0; while (pos != -1 ) { - pos = args.find("%scriptdir"); + pos = args.tqfind("%scriptdir"); TQString scriptname; if (pos != -1) { - int begin = args.findRev('"', pos); + int begin = args.tqfindRev('"', pos); int end = -1; if (begin == -1) { - begin = args.findRev('\'', pos); + begin = args.tqfindRev('\'', pos); if (begin != -1) - end = args.find('\'', pos); + end = args.tqfind('\'', pos); } else { - end = args.find('"', pos); + end = args.tqfind('"', pos); } if (begin == -1 || end != -1) { - begin = args.findRev(' ', pos); + begin = args.tqfindRev(' ', pos); if (begin == -1) begin = 0; - end = args.find(' ', pos); + end = args.tqfind(' ', pos); if (end == -1) end = args.length(); } scriptname = args.mid(begin, end - begin).stripWhiteSpace(); - scriptname.replace("%scriptdir","scripts"); + scriptname.tqreplace("%scriptdir","scripts"); // kdDebug(24000) << "Script name is: |" << scriptname << "|" << endl; scriptname = " " + locate("appdata", scriptname); // kdDebug(24000) << "Script found at: " << scriptname << endl; - args.replace(begin, end - begin, scriptname); + args.tqreplace(begin, end - begin, scriptname); // kdDebug(24000) << "Modified argument list: " << args << endl; } } - int pos = args.find("%projectbase"); + int pos = args.tqfind("%projectbase"); if (pos != -1) { TQString s; if (Project::ref()->hasProject()) s = Project::ref()->projectBaseURL().url(); - args.replace("%projectbase", s); + args.tqreplace("%projectbase", s); } TQStringList argsList1 = TQStringList::split(' ', args); TQStringList argsList; @@ -461,7 +461,7 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button if (proc->start(KProcess::NotifyOnExit, KProcess::All)) { emit clearMessages(); - emit showMessage(i18n("The \"%1\" script started.\n").arg(actionText()), false); + emit showMessage(i18n("The \"%1\" script started.\n").tqarg(actionText()), false); if (!m_useInputFile) { if ( inputType == "current" || inputType == "selected" ) @@ -472,11 +472,11 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button proc->closeStdin(); } else { - KMessageBox::error(m_parentMainWindow, i18n("<qt>There was an error running <b>%1</b>.<br>Check that you have the <i>%2</i> executable installed and it is accessible.</qt>").arg(command + " " + args).arg(command), i18n("Script Not Found")); + KMessageBox::error(m_parentMainWindow, i18n("<qt>There was an error running <b>%1</b>.<br>Check that you have the <i>%2</i> executable installed and it is accessible.</qt>").tqarg(command + " " + args).tqarg(command), i18n("Script Not Found")); ViewManager::ref()->activeView()->setFocus(); if (loopStarted) { - qApp->exit_loop(); + tqApp->exit_loop(); loopStarted = false; } return false; @@ -486,9 +486,9 @@ bool TagAction::slotActionActivated(KAction::ActivationReason reason, Qt::Button return true; } #else - // hack to compile. moc doesn't check the "#ifdef" at the declaration and the compiler complains + // hack to compile. tqmoc doesn't check the "#ifdef" at the declaration and the compiler complains // of no matching function. -bool TagAction::slotActionActivated(KAction::ActivationReason /*reason*/, Qt::ButtonState /*state*/) +bool TagAction::slotActionActivated(KAction::ActivationReason /*reason*/, TQt::ButtonState /*state*/) {return true;} #endif @@ -535,7 +535,7 @@ bool TagAction::slotActionActivated() s1 += " "+QuantaCommon::attrCase(attr); if (otag.text().right(1) == ">") { - QTag *dtdTag = QuantaCommon::tagFromDTD(w->defaultDTD(), name); + TQTag *dtdTag = QuantaCommon::tagFromDTD(w->defaultDTD(), name); if ( w->defaultDTD()->singleTagStyle == "xml" && dtdTag && (dtdTag->isSingle() || (!qConfig.closeOptionalTags && dtdTag->isOptional())) ) @@ -586,16 +586,16 @@ bool TagAction::slotActionActivated() TQString fname = w->url().url(); if ( w->url().protocol() == "file") fname = w->url().path(); - command.replace("%f", fname ); + command.tqreplace("%f", fname ); } pid_t pid = ::getpid(); if (kapp->inherits("KUniqueApplication")) { - command.replace("%pid", TQString("unique %1").arg(pid)); + command.tqreplace("%pid", TQString("unique %1").tqarg(pid)); } else { - command.replace("%pid", TQString("%1").arg(pid)); + command.tqreplace("%pid", TQString("%1").tqarg(pid)); } TQString buffer; TQString inputType = script.attribute("input","none"); @@ -606,9 +606,9 @@ bool TagAction::slotActionActivated() if ( inputType == "selected" && w->selectionIf) { buffer = w->selectionIf->selection(); } - command.replace("%input", buffer); + command.tqreplace("%input", buffer); command = command.stripWhiteSpace(); - int pos = command.find(' '); + int pos = command.tqfind(' '); TQString args; if (pos != -1) { @@ -628,46 +628,46 @@ bool TagAction::slotActionActivated() pos = 0; while (pos != -1 ) { - pos = args.find("%scriptdir"); + pos = args.tqfind("%scriptdir"); TQString scriptname; if (pos != -1) { - int begin = args.findRev('"', pos); + int begin = args.tqfindRev('"', pos); int end = -1; if (begin == -1) { - begin = args.findRev('\'', pos); + begin = args.tqfindRev('\'', pos); if (begin != -1) - end = args.find('\'', pos); + end = args.tqfind('\'', pos); } else { - end = args.find('"', pos); + end = args.tqfind('"', pos); } if (begin == -1 || end != -1) { - begin = args.findRev(' ', pos); + begin = args.tqfindRev(' ', pos); if (begin == -1) begin = 0; - end = args.find(' ', pos); + end = args.tqfind(' ', pos); if (end == -1) end = args.length(); } scriptname = args.mid(begin, end - begin).stripWhiteSpace(); - scriptname.replace("%scriptdir","scripts"); + scriptname.tqreplace("%scriptdir","scripts"); // kdDebug(24000) << "Script name is: |" << scriptname << "|" << endl; scriptname = " " + locate("appdata", scriptname); // kdDebug(24000) << "Script found at: " << scriptname << endl; - args.replace(begin, end - begin, scriptname); + args.tqreplace(begin, end - begin, scriptname); // kdDebug(24000) << "Modified argument list: " << args << endl; } } - int pos = args.find("%projectbase"); + int pos = args.tqfind("%projectbase"); if (pos != -1) { TQString s; if (Project::ref()->hasProject()) s = Project::ref()->projectBaseURL().url(); - args.replace("%projectbase", s); + args.tqreplace("%projectbase", s); } TQStringList argsList1 = TQStringList::split(' ', args); TQStringList argsList; @@ -715,7 +715,7 @@ bool TagAction::slotActionActivated() if (proc->start(KProcess::NotifyOnExit, KProcess::All)) { emit clearMessages(); - emit showMessage(i18n("The \"%1\" script started.\n").arg(actionText()), false); + emit showMessage(i18n("The \"%1\" script started.\n").tqarg(actionText()), false); if (!m_useInputFile) { if ( inputType == "current" || inputType == "selected" ) @@ -726,11 +726,11 @@ bool TagAction::slotActionActivated() proc->closeStdin(); } else { - KMessageBox::error(m_parentMainWindow, i18n("<qt>There was an error running <b>%1</b>.<br>Check that you have the <i>%2</i> executable installed and it is accessible.</qt>").arg(command + " " + args).arg(command), i18n("Script Not Found")); + KMessageBox::error(m_parentMainWindow, i18n("<qt>There was an error running <b>%1</b>.<br>Check that you have the <i>%2</i> executable installed and it is accessible.</qt>").tqarg(command + " " + args).tqarg(command), i18n("Script Not Found")); ViewManager::ref()->activeView()->setFocus(); if (loopStarted) { - qApp->exit_loop(); + tqApp->exit_loop(); loopStarted = false; } return false; @@ -767,7 +767,7 @@ void TagAction::slotGetScriptOutput( KProcess *, char *buffer, int buflen ) } w->insertTag( text ); } else - if ( scriptOutputDest == "replace" ) + if ( scriptOutputDest == "tqreplace" ) { if ( firstOutput ) w->editIf->clear(); @@ -787,7 +787,7 @@ void TagAction::slotGetScriptOutput( KProcess *, char *buffer, int buflen ) if ( firstOutput ) { emit showMessagesView(); - emit showMessage(i18n("The \"%1\" script output:\n").arg(actionText()), false); + emit showMessage(i18n("The \"%1\" script output:\n").tqarg(actionText()), false); } emit showMessage(text, true); } else @@ -827,7 +827,7 @@ void TagAction::slotGetScriptError( KProcess *, char *buffer, int buflen ) } w->insertTag( text ); } else - if ( scriptErrorDest == "replace" ) + if ( scriptErrorDest == "tqreplace" ) { if ( firstError ) w->editIf->clear(); @@ -847,7 +847,7 @@ void TagAction::slotGetScriptError( KProcess *, char *buffer, int buflen ) if ( firstError ) { emit showMessagesView(); - emit showMessage(i18n("The \"%1\" script output:\n").arg(actionText()), false); + emit showMessage(i18n("The \"%1\" script output:\n").tqarg(actionText()), false); } emit showMessage(text, true); } @@ -874,7 +874,7 @@ void TagAction::setInputFileName(const TQString& fileName) TQString TagAction::actionText() { TQString t = tag.attribute("text"); - int pos = t.find('&'); + int pos = t.tqfind('&'); if (pos < (int)t.length()-1 && t[pos+1] != '&') return t.remove(pos, 1); else @@ -925,7 +925,7 @@ TQString TagAction::openXMLTagString() const if (otag.text().right(1) == ">") { Document* w = ViewManager::ref()->activeView()->document(); - QTag *dtdTag = QuantaCommon::tagFromDTD(w->defaultDTD(), name); + TQTag *dtdTag = QuantaCommon::tagFromDTD(w->defaultDTD(), name); if ( w->defaultDTD()->singleTagStyle == "xml" && dtdTag && (dtdTag->isSingle() || (!qConfig.closeOptionalTags && dtdTag->isOptional())) ) @@ -967,10 +967,10 @@ void TagAction::slotProcessExited(KProcess *process) { if (loopStarted) { - qApp->exit_loop(); + tqApp->exit_loop(); loopStarted = false; } - emit showMessage(i18n("The \"%1\" script has exited.").arg(actionText()), false); + emit showMessage(i18n("The \"%1\" script has exited.").tqarg(actionText()), false); delete process; } @@ -993,7 +993,7 @@ void TagAction::execute(bool blocking) timer = new TQTimer(this); connect(timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout())); timer->start(180*1000, true); - QExtFileInfo internalFileInfo; + TQExtFileInfo internalFileInfo; loopStarted = true; m_killCount = 0; internalFileInfo.enter_loop(); @@ -1008,7 +1008,7 @@ void TagAction::execute(bool blocking) /** Timeout occurred while waiting for some network function to return. */ void TagAction::slotTimeout() { - if ((m_killCount == 0) && (KMessageBox::questionYesNo(m_parentMainWindow, i18n("<qt>The filtering action <b>%1</b> seems to be locked.<br>Do you want to terminate it?</qt>").arg(actionText()), i18n("Action Not Responding"), i18n("Terminate"), i18n("Keep Running")) == KMessageBox::Yes)) + if ((m_killCount == 0) && (KMessageBox::questionYesNo(m_parentMainWindow, i18n("<qt>The filtering action <b>%1</b> seems to be locked.<br>Do you want to terminate it?</qt>").tqarg(actionText()), i18n("Action Not Responding"), i18n("Terminate"), i18n("Keep Running")) == KMessageBox::Yes)) { if (::kill(-proc->pid(), SIGTERM)) { @@ -1021,7 +1021,7 @@ void TagAction::slotTimeout() ::kill(-proc->pid(), SIGKILL); if (loopStarted) { - qApp->exit_loop(); + tqApp->exit_loop(); loopStarted = false; } return; @@ -1055,19 +1055,19 @@ void TagAction::applyTagInSelection(Node* start_node, int start_offset, Node* en Node* nodeCursor = start_node; Node* nodeParent = start_node; 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 - QTag* nodeQTag = QuantaCommon::tagFromDTD(w->defaultDTD(), node->tag->name); - if (!nodeQTag) return; + TQTag* nodeTQTag = QuantaCommon::tagFromDTD(w->defaultDTD(), node->tag->name); + if (!nodeTQTag) return; bool specialTagInsertion = false; - TQPtrList<QTag> qTagList = nodeQTag->parents(); - QTag* qTag = 0; + TQPtrList<TQTag> qTagList = nodeTQTag->tqparents(); + TQTag* qTag = 0; for (qTag = qTagList.first(); qTag; qTag = qTagList.next()) { if (qTag->isChild("#text", false)) @@ -1080,11 +1080,11 @@ void TagAction::applyTagInSelection(Node* start_node, int start_offset, Node* en if (specialTagInsertion) // Attention: not smartTagInsertion { - //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) { - QTag* nodeParentQTag = QuantaCommon::tagFromDTD(w->defaultDTD(), nodeParent->tag->name); - if (nodeParentQTag && nodeParentQTag->isChild(node)) + TQTag* nodeParentTQTag = QuantaCommon::tagFromDTD(w->defaultDTD(), nodeParent->tag->name); + if (nodeParentTQTag && nodeParentTQTag->isChild(node)) { nodeCursor = kafkaCommon::createMandatoryNodeSubtree(node, w); start_offset = 0; @@ -1092,10 +1092,10 @@ void TagAction::applyTagInSelection(Node* start_node, int start_offset, Node* en nodeTreeModified = true; break; } - nodeParent = nodeParent->parent; + nodeParent = nodeParent->tqparent; } } - else if(!nodeQTag->isSingle()) + else if(!nodeTQTag->isSingle()) { //If some text is selected in kafka, surround the selection with the new Node. if(!start_node|| !end_node) @@ -1248,15 +1248,15 @@ void TagAction::deapplyTagInSelection(Node* start_node, int start_offset, Node* Node* common_parent_start_child = kafkaCommon::getCommonParentChild(start_node, tag_parent); Node* common_parent_end_child = kafkaCommon::getCommonParentChild(end_node, tag_parent); - Node* parent_of_tag_parent = tag_parent->parent; + Node* tqparent_of_tag_parent = tag_parent->tqparent; if(common_parent_end_child == common_parent_start_child) common_parent_end_child = 0; if(!common_parent_start_child) common_parent_start_child = kafkaCommon::getCommonParentChild(start_node, commonParent); - kafkaCommon::moveNode(common_parent_start_child, parent_of_tag_parent, tag_parent, selection, modifs, true, true); + kafkaCommon::moveNode(common_parent_start_child, tqparent_of_tag_parent, tag_parent, selection, modifs, true, true); if(common_parent_end_child) - kafkaCommon::moveNode(common_parent_end_child, parent_of_tag_parent, tag_parent, selection, modifs, true, true); + kafkaCommon::moveNode(common_parent_end_child, tqparent_of_tag_parent, tag_parent, selection, modifs, true, true); // Remove tag_parent node subtree if empty if(!tag_parent->hasChildNodes()) diff --git a/quanta/utility/tagaction.h b/quanta/utility/tagaction.h index b24addac..d940faf7 100644 --- a/quanta/utility/tagaction.h +++ b/quanta/utility/tagaction.h @@ -47,6 +47,7 @@ class NodeSelection; class TagAction : public KToggleAction { Q_OBJECT + TQ_OBJECT public: /** @@ -54,7 +55,7 @@ public: * @param toggle If set to true, the class behaves like a KToggleAction; * Else it behaves like a KAction. This avoids the multi-inheritance problem. */ - TagAction(TQDomElement *element, KMainWindow *parentMainWindow, bool toggle = false); + TagAction(TQDomElement *element, KMainWindow *tqparentMainWindow, bool toggle = false); virtual ~TagAction(); TQDomElement data() const { return tag; } @@ -93,7 +94,7 @@ public slots: * We need this information in order to know if queued actions should be applied. * It's public because it can be activated by other classes if there are any queued actions. */ - virtual bool slotActionActivated(KAction::ActivationReason reason, Qt::ButtonState state); + virtual bool slotActionActivated(KAction::ActivationReason reason, TQt::ButtonState state); protected slots: virtual void slotGetScriptOutput( KProcess *, char *buffer, int buflen ); diff --git a/quanta/utility/tagactionmanager.cpp b/quanta/utility/tagactionmanager.cpp index 3733aaaf..b11525ec 100644 --- a/quanta/utility/tagactionmanager.cpp +++ b/quanta/utility/tagactionmanager.cpp @@ -54,18 +54,18 @@ TagActionManager* TagActionManager::self() return s_mSelf; } -void TagActionManager::initActions(TQWidget* parent) +void TagActionManager::initActions(TQWidget* tqparent) { - Q_ASSERT(parent); + Q_ASSERT(tqparent); - m_actionCollection = new KActionCollection(parent); + m_actionCollection = new KActionCollection(tqparent); TagActionSet* general(new TagActionSet()); - general->initActions(parent); + general->initActions(tqparent); m_tagActionSets.append(general); TableTagActionSet* table(new TableTagActionSet()); - table->initActions(parent); + table->initActions(tqparent); m_tagActionSets.append(table); } @@ -78,6 +78,6 @@ void TagActionManager::fillWithTagActions(TQWidget* widget, DOM::Node const& nod bool TagActionManager::canIndentDTD(TQString const& dtd) { - return (dtd.contains("HTML", false) || - dtd.contains("XML", false)); + return (dtd.tqcontains("HTML", false) || + dtd.tqcontains("XML", false)); } diff --git a/quanta/utility/tagactionmanager.h b/quanta/utility/tagactionmanager.h index 0977d32c..77f7ad23 100644 --- a/quanta/utility/tagactionmanager.h +++ b/quanta/utility/tagactionmanager.h @@ -62,7 +62,7 @@ private: TagActionManager(TagActionManager const&) {} - void initActions(TQWidget* parent); + void initActions(TQWidget* tqparent); private: static TagActionManager* s_mSelf; diff --git a/quanta/utility/tagactionset.cpp b/quanta/utility/tagactionset.cpp index 28f01ef8..dc994716 100644 --- a/quanta/utility/tagactionset.cpp +++ b/quanta/utility/tagactionset.cpp @@ -40,20 +40,20 @@ #include "resource.h" -TagActionSetAbstract::TagActionSetAbstract(TQObject *parent, const char *name) - : TQObject(parent, name), m_currentNode(0) +TagActionSetAbstract::TagActionSetAbstract(TQObject *tqparent, const char *name) + : TQObject(tqparent, name), m_currentNode(0) {} TagActionSetAbstract::~TagActionSetAbstract() {} -Node* TagActionSetAbstract::parentTag(Node* node, TQString const& tagName) +Node* TagActionSetAbstract::tqparentTag(Node* node, TQString const& tagName) { Q_ASSERT(node); Node* aux = node; while(aux && aux->nodeName().lower() != tagName) - aux = aux->parent; + aux = aux->tqparent; return aux; } @@ -81,8 +81,8 @@ bool TagActionSetAbstract::fillWithTagActions(TQWidget* /*widget*/, DOM::Node co //_____________________________________________________________________________ -TagActionSet::TagActionSet(TQObject *parent, const char *name) - : TagActionSetAbstract(parent, name), m_separator(0) +TagActionSet::TagActionSet(TQObject *tqparent, const char *name) + : TagActionSetAbstract(tqparent, name), m_separator(0) { m_separator = new KActionSeparator(); } @@ -96,7 +96,7 @@ void TagActionSet::initActionMenus(TQWidget* /*widget*/) { } -void TagActionSet::initActions(TQWidget* /*parent*/) +void TagActionSet::initActions(TQWidget* /*tqparent*/) { KActionCollection* ac(TagActionManager::self()->actionCollection()); @@ -221,14 +221,14 @@ bool TagActionSet::isInDivArea() const { Q_ASSERT(m_currentNode); - return parentTag(m_currentNode, "div"); + return tqparentTag(m_currentNode, "div"); } void TagActionSet::slotCopyDivElement() { Q_ASSERT(m_currentNode); - Node* divNode = parentTag(m_currentNode, "div"); + Node* divNode = tqparentTag(m_currentNode, "div"); Q_ASSERT(divNode); Node* divClosingNode = divNode->getClosingNode(); @@ -245,7 +245,7 @@ void TagActionSet::slotCutDivElement() { Q_ASSERT(m_currentNode); - Node* divNode = parentTag(m_currentNode, "div"); + Node* divNode = tqparentTag(m_currentNode, "div"); Q_ASSERT(divNode); Node* divClosingNode = divNode->getClosingNode(); @@ -266,31 +266,31 @@ void TagActionSet::slotCutDivElement() //_____________________________________________________________________________ -TableTagActionSet::TableTagActionSet(TQObject *parent, const char *name) - : TagActionSetAbstract(parent, name), m_separator(0), m_tableActionMenu_0(0), m_insertActionMenu_1(0) +TableTagActionSet::TableTagActionSet(TQObject *tqparent, const char *name) + : TagActionSetAbstract(tqparent, name), m_separator(0), m_tableActionMenu_0(0), m_insertActionMenu_1(0) { m_separator = new KActionSeparator(); } bool TableTagActionSet::isInTagContext() const { - return parentTag(m_currentNode, "table"); + return tqparentTag(m_currentNode, "table"); } void TableTagActionSet::initActionMenus(TQWidget* widget) { Q_ASSERT(!m_tableActionMenu_0); - m_tableActionMenu_0 = new KActionMenu(i18n("Table..."), widget); + m_tableActionMenu_0 = new KActionMenu(i18n("Table..."), TQT_TQOBJECT(widget)); m_insertActionMenu_1 = new KActionMenu(i18n("Insert..."), m_tableActionMenu_0); m_removeActionMenu_1 = new KActionMenu(i18n("Remove..."), m_tableActionMenu_0); } -void TableTagActionSet::initActions(TQWidget* parent) +void TableTagActionSet::initActions(TQWidget* tqparent) { if(!m_tableActionMenu_0) - initActionMenus(parent); + initActionMenus(tqparent); KActionCollection* ac(TagActionManager::self()->actionCollection()); @@ -575,19 +575,19 @@ void TableTagActionSet::slotInsertTable() bool TableTagActionSet::canInsertRowAbove() const { - return isInTagContext() && parentTag(m_currentNode, "tbody"); + return isInTagContext() && tqparentTag(m_currentNode, "tbody"); } void TableTagActionSet::slotInsertRowAbove() { Q_ASSERT(m_currentNode); - Node* nearRow = parentTag(m_currentNode, "tr"); + Node* nearRow = tqparentTag(m_currentNode, "tr"); if(!nearRow) return; - Node* nodeParent= nearRow->parent; + Node* nodeParent= nearRow->tqparent; QuantaView* view = ViewManager::ref()->activeView(); NodeModifsSet *modifs = new NodeModifsSet(); @@ -610,16 +610,16 @@ void TableTagActionSet::slotInsertRowBelow() Q_ASSERT(m_currentNode); Node* nearRow = 0; - Node* aux = parentTag(m_currentNode, "thead"); + Node* aux = tqparentTag(m_currentNode, "thead"); if(aux) nearRow= firstChildTag(tableStart(), "tr"); else - nearRow = parentTag(m_currentNode, "tr"); + nearRow = tqparentTag(m_currentNode, "tr"); if(!nearRow) return; - Node* nodeParent= nearRow->parent; + Node* nodeParent= nearRow->tqparent; Node* nextSibling = nearRow->SNext(); QuantaView* view = ViewManager::ref()->activeView(); @@ -781,7 +781,7 @@ void TableTagActionSet::slotRemoveRows() if(!selection.hasSelection()) { - Node* nearTr = parentTag(m_currentNode, "tr"); + Node* nearTr = tqparentTag(m_currentNode, "tr"); kafkaCommon::extractAndDeleteNode(nearTr, modifs, true, true); } else @@ -789,8 +789,8 @@ void TableTagActionSet::slotRemoveRows() Node* startSelection = kafkaCommon::getNodeFromLocation(selection.cursorNode()); Node* endSelection = kafkaCommon::getNodeFromLocation(selection.cursorNodeEndSel()); - Node* startTr = parentTag(startSelection, "tr"); - Node* endTr = parentTag(endSelection, "tr"); + Node* startTr = tqparentTag(startSelection, "tr"); + Node* endTr = tqparentTag(endSelection, "tr"); Node* iteratorNode = startTr; bool loop(true); @@ -844,7 +844,7 @@ void TableTagActionSet::slotRemoveColumns() if(startColumnIndex == -1 || endColumnIndex == -1) return; - m_currentNode = parentTag(m_currentNode, "tbody"); // m_currentNode will become invalid + m_currentNode = tqparentTag(m_currentNode, "tbody"); // m_currentNode will become invalid for(int i = 0; i != numberOfColumnsSelected; ++i) removeColumn(startColumnIndex, modifs); } @@ -880,9 +880,9 @@ void TableTagActionSet::slotRemoveCellsContent() if(!selection.hasSelection()) { Node* aux = m_currentNode; - m_currentNode = parentTag(m_currentNode, "tbody"); + m_currentNode = tqparentTag(m_currentNode, "tbody"); - Node* nearTd = parentTag(aux, "td"); + Node* nearTd = tqparentTag(aux, "td"); clearCellContents(nearTd, modifs); } else @@ -890,8 +890,8 @@ void TableTagActionSet::slotRemoveCellsContent() Node* startSelection = kafkaCommon::getNodeFromLocation(selection.cursorNode()); Node* endSelection = kafkaCommon::getNodeFromLocation(selection.cursorNodeEndSel()); - Node* startTd = parentTag(startSelection, "td"); - Node* endTd = parentTag(endSelection, "td"); + Node* startTd = tqparentTag(startSelection, "td"); + Node* endTd = tqparentTag(endSelection, "td"); if(!startTd || !endTd) return; @@ -933,8 +933,8 @@ void TableTagActionSet::slotMergeSelectedCells() Node* startSelection = kafkaCommon::getNodeFromLocation(selection.cursorNode()); Node* endSelection = kafkaCommon::getNodeFromLocation(selection.cursorNodeEndSel()); - Node* startTd = parentTag(startSelection, "td"); - Node* endTd = parentTag(endSelection, "td"); + Node* startTd = tqparentTag(startSelection, "td"); + Node* endTd = tqparentTag(endSelection, "td"); Node* nodeIterator = startTd->SNext(); Node* stopNode = endTd->SNext(); @@ -975,7 +975,7 @@ Node* TableTagActionSet::tableStart() const Q_ASSERT(isInTagContext()); Q_ASSERT(m_currentNode); - return parentTag(m_currentNode, "table"); + return tqparentTag(m_currentNode, "table"); } int TableTagActionSet::numberOfColumns() const @@ -1004,7 +1004,7 @@ int TableTagActionSet::numberOfColumns() const int TableTagActionSet::currentColumnIndex() const { return columnIndex(m_currentNode); -/* Node* nearTd = parentTag(m_currentNode, "td"); +/* Node* nearTd = tqparentTag(m_currentNode, "td"); if(!nearTd) return -1; @@ -1012,7 +1012,7 @@ int TableTagActionSet::currentColumnIndex() const if(!_tableStart) return -1; - Node* firstTd = firstChildTag(parentTag(m_currentNode, "tr"), "td"); + Node* firstTd = firstChildTag(tqparentTag(m_currentNode, "tr"), "td"); //Node* firstTd = firstChildTag(_tableStart, "td"); if(!firstTd) return -1; @@ -1032,7 +1032,7 @@ int TableTagActionSet::currentColumnIndex() const int TableTagActionSet::columnIndex(Node* node) const { - Node* nearTd = parentTag(node, "td"); + Node* nearTd = tqparentTag(node, "td"); if(!nearTd) return -1; @@ -1040,7 +1040,7 @@ int TableTagActionSet::columnIndex(Node* node) const if(!_tableStart) return -1; - Node* firstTd = firstChildTag(parentTag(node, "tr"), "td"); + Node* firstTd = firstChildTag(tqparentTag(node, "tr"), "td"); if(!firstTd) return -1; diff --git a/quanta/utility/tagactionset.h b/quanta/utility/tagactionset.h index 00d3341f..5b813acb 100644 --- a/quanta/utility/tagactionset.h +++ b/quanta/utility/tagactionset.h @@ -35,20 +35,21 @@ class NodeModifsSet; /** @author Paulo Moura Guedes */ -class TagActionSetAbstract : public QObject +class TagActionSetAbstract : public TQObject { Q_OBJECT + TQ_OBJECT public: - TagActionSetAbstract(TQObject *parent = 0, const char *name = 0); + TagActionSetAbstract(TQObject *tqparent = 0, const char *name = 0); virtual ~TagActionSetAbstract(); DOM::Node const& currentDomNode() const {return m_currentDomNode;} - static Node* parentTag(Node* node, TQString const& tagName); + static Node* tqparentTag(Node* node, TQString const& tagName); static Node* firstChildTag(Node* node, TQString const& tagName); virtual bool isInTagContext(/*DOM::Node const& node*/) const = 0; - virtual void initActions(TQWidget* parent) = 0; + virtual void initActions(TQWidget* tqparent) = 0; virtual bool fillWithTagActions(TQWidget* widget, DOM::Node const& node); virtual void unplugAllActions(TQWidget* widget) const = 0; @@ -66,12 +67,13 @@ private: class TagActionSet : public TagActionSetAbstract { Q_OBJECT + TQ_OBJECT public: - TagActionSet(TQObject *parent = 0, const char *name = 0); + TagActionSet(TQObject *tqparent = 0, const char *name = 0); virtual ~TagActionSet() {} virtual bool isInTagContext() const; - virtual void initActions(TQWidget* parent); + virtual void initActions(TQWidget* tqparent); virtual bool fillWithTagActions(TQWidget* widget, DOM::Node const& node); virtual void unplugAllActions(TQWidget* widget) const; @@ -94,13 +96,14 @@ private: class TableTagActionSet : public TagActionSetAbstract { Q_OBJECT + TQ_OBJECT public: - TableTagActionSet(TQObject *parent = 0, const char *name = 0); + TableTagActionSet(TQObject *tqparent = 0, const char *name = 0); virtual ~TableTagActionSet() {} virtual bool isInTagContext(/*DOM::Node const& node*/) const; - virtual void initActions(TQWidget* parent); + virtual void initActions(TQWidget* tqparent); virtual bool fillWithTagActions(TQWidget* widget, DOM::Node const& node); virtual void unplugAllActions(TQWidget* widget) const; diff --git a/quanta/utility/toolbartabwidget.cpp b/quanta/utility/toolbartabwidget.cpp index 29c7cfa9..cd3ac37e 100644 --- a/quanta/utility/toolbartabwidget.cpp +++ b/quanta/utility/toolbartabwidget.cpp @@ -38,36 +38,36 @@ //app includes #include "toolbartabwidget.h" -ToolbarTabWidget::ToolbarTabWidget(TQWidget * parent, const char * name, WFlags f) -:TQTabWidget(parent, name, f) +ToolbarTabWidget::ToolbarTabWidget(TQWidget * tqparent, const char * name, WFlags f) +:TQTabWidget(tqparent, name, f) { m_popupMenu = new KPopupMenu(this); m_popupMenu->insertTitle(i18n("Toolbar Menu"), 1); - m_popupMenu->insertItem(i18n("New Action..."), parent, TQT_SLOT(slotNewAction())); + m_popupMenu->insertItem(i18n("New Action..."), tqparent, TQT_SLOT(slotNewAction())); m_popupMenu->insertSeparator(); - m_popupMenu->insertItem(i18n("New Toolbar..."), parent, TQT_SLOT(slotAddToolbar())); + m_popupMenu->insertItem(i18n("New Toolbar..."), tqparent, TQT_SLOT(slotAddToolbar())); m_popupMenu->insertItem(i18n("Remove Toolbar"), this, TQT_SLOT(slotRemoveToolbar())); m_popupMenu->insertItem(i18n("Rename Toolbar..."), this, TQT_SLOT(slotRenameToolbar())); m_popupMenu->insertItem(SmallIconSet("configure_toolbars"), i18n("Configure Toolbars..."), this, TQT_SLOT(slotEditToolbar())); connect(this, TQT_SIGNAL(removeToolbar(const TQString&)), - parent, TQT_SLOT(slotRemoveToolbar(const TQString&))); + tqparent, TQT_SLOT(slotRemoveToolbar(const TQString&))); connect(this, TQT_SIGNAL(renameToolbar(const TQString&)), - parent, TQT_SLOT(slotRenameToolbar(const TQString&))); + tqparent, TQT_SLOT(slotRenameToolbar(const TQString&))); connect(this, TQT_SIGNAL(editToolbar(const TQString&)), - parent, TQT_SLOT(slotConfigureToolbars(const TQString&))); + tqparent, TQT_SLOT(slotConfigureToolbars(const TQString&))); connect(this, TQT_SIGNAL(newAction()), - parent, TQT_SLOT(slotNewAction())); + tqparent, TQT_SLOT(slotNewAction())); connect(this, TQT_SIGNAL(addToolbar()), - parent, TQT_SLOT(slotAddToolbar())); + tqparent, TQT_SLOT(slotAddToolbar())); KAcceleratorManager::setNoAccel(this); } void ToolbarTabWidget::insertTab(TQWidget *child, const TQString &label, const TQString &id) { - if (child->inherits("KToolBar") && child->parentWidget()) + if (child->inherits("KToolBar") && child->tqparentWidget()) { - TQTabWidget::insertTab(child->parentWidget(), label); + TQTabWidget::insertTab(child->tqparentWidget(), label); toolbarList.insert(id, child); } } @@ -78,7 +78,7 @@ TQWidget* ToolbarTabWidget::page(int index) for (TQMap<TQString, TQWidget*>::Iterator it = toolbarList.begin(); it != toolbarList.end(); ++it) { - if (it.data()->parentWidget() == w) + if (it.data()->tqparentWidget() == w) { w = *it; break; @@ -92,7 +92,7 @@ TQString ToolbarTabWidget::id(TQWidget *w) const TQString idStr; for (TQMap<TQString, TQWidget*>::ConstIterator it = toolbarList.constBegin(); it != toolbarList.constEnd(); ++it) { - if (it.data()->parentWidget() == w) + if (it.data()->tqparentWidget() == w) { idStr = it.key(); break; @@ -107,7 +107,7 @@ TQString ToolbarTabWidget::id(int index) const TQString idStr; for (TQMap<TQString, TQWidget*>::ConstIterator it = toolbarList.constBegin(); it != toolbarList.constEnd(); ++it) { - if (it.data()->parentWidget() == w) + if (it.data()->tqparentWidget() == w) { idStr = it.key(); break; @@ -118,16 +118,16 @@ TQString ToolbarTabWidget::id(int index) const TQWidget* ToolbarTabWidget::page(const TQString& id) { - TQWidget *w = toolbarList.find(id).data(); + TQWidget *w = toolbarList.tqfind(id).data(); return w; } void ToolbarTabWidget::removePage(TQWidget * w) { - TQWidget *parent = w->parentWidget(); - if (w->inherits("KToolBar") && parent) + TQWidget *tqparent = w->tqparentWidget(); + if (w->inherits("KToolBar") && tqparent) { - TQTabWidget::removePage(parent); + TQTabWidget::removePage(tqparent); for (TQMap<TQString, TQWidget*>::ConstIterator it = toolbarList.constBegin(); it != toolbarList.constEnd(); ++it) { if (it.data() == w) @@ -136,7 +136,7 @@ void ToolbarTabWidget::removePage(TQWidget * w) break; } } - delete parent; + delete tqparent; } } @@ -169,7 +169,7 @@ void ToolbarTabWidget::mousePressEvent ( TQMouseEvent * e ) TQRect r = tab->rect(); TQPoint p1 = mapToGlobal(r.topLeft()); TQPoint p2 = mapToGlobal(r.bottomRight()); - if (TQRect(p1, p2).contains(p)) + if (TQRect(p1, p2).tqcontains(p)) break; else tab = 0L; @@ -179,7 +179,7 @@ void ToolbarTabWidget::mousePressEvent ( TQMouseEvent * e ) pageW = currentPage(); for (TQMap<TQString, TQWidget*>::Iterator it = toolbarList.begin(); it != toolbarList.end(); ++it) { - if (it.data()->parentWidget() == pageW) + if (it.data()->tqparentWidget() == pageW) { tabUnderMouse = it.key(); break; @@ -223,11 +223,11 @@ int ToolbarTabWidget::tabHeight() const } -QuantaToolBar::QuantaToolBar(TQWidget *parent, const char *name, bool honor_style, bool readConfig) -:KToolBar (parent, name=0, honor_style, readConfig) +QuantaToolBar::QuantaToolBar(TQWidget *tqparent, const char *name, bool honor_style, bool readConfig) +:KToolBar (tqparent, name=0, honor_style, readConfig) { m_popupMenu = new KPopupMenu(this); - m_toolbarTab = dynamic_cast<ToolbarTabWidget*>(parent->parentWidget()); + m_toolbarTab = dynamic_cast<ToolbarTabWidget*>(tqparent->tqparentWidget()); currentActionName = ""; m_iconTextMenu = new KPopupMenu(this); m_iconTextMenu->setCheckable(true); @@ -307,18 +307,18 @@ void QuantaToolBar::mousePressEvent(TQMouseEvent *e) m_popupMenu->insertTitle(i18n("Toolbar Menu") + " - " + i18n(m_toolbarTab->tabUnderMouseLabel.utf8())); m_popupMenu->insertItem(i18n("New Action..."), m_toolbarTab, TQT_SIGNAL(newAction())); - TQObjectList* childrenList = queryList("KToolBarButton"); - for (uint i = 0; i < childrenList->count(); i++) + TQObjectList* tqchildrenList = queryList("KToolBarButton"); + for (uint i = 0; i < tqchildrenList->count(); i++) { - KToolBarButton *w = static_cast<KToolBarButton*>(childrenList->at(i)); - TQPoint p1 = w->parentWidget()->mapToGlobal(w->pos()); + KToolBarButton *w = static_cast<KToolBarButton*>(TQT_TQWIDGET(tqchildrenList->at(i))); + TQPoint p1 = w->tqparentWidget()->mapToGlobal(w->pos()); TQPoint p2 = TQPoint(p1.x() + w->width(), p1.y()+w->height()); - if (TQRect(p1, p2).contains(p)) + if (TQRect(p1, p2).tqcontains(p)) { currentActionName = w->textLabel(); TQString actionName = currentActionName; - m_popupMenu->insertItem(i18n("Remove Action - %1").arg(actionName.replace('&',"&&")), this, TQT_SLOT(slotRemoveAction())); - m_popupMenu->insertItem(i18n("Edit Action - %1").arg(actionName), this, TQT_SLOT(slotEditAction())); + m_popupMenu->insertItem(i18n("Remove Action - %1").tqarg(actionName.tqreplace('&',"&&")), this, TQT_SLOT(slotRemoveAction())); + m_popupMenu->insertItem(i18n("Edit Action - %1").tqarg(actionName), this, TQT_SLOT(slotEditAction())); break; } } @@ -341,7 +341,7 @@ void QuantaToolBar::slotEditAction() void QuantaToolBar::slotRemoveAction() { - if ( KMessageBox::warningContinueCancel(this, i18n("<qt>Are you sure you want to remove the <b>%1</b> action?</qt>").arg(currentActionName),TQString::null,KStdGuiItem::del()) == KMessageBox::Continue ) + if ( KMessageBox::warningContinueCancel(this, i18n("<qt>Are you sure you want to remove the <b>%1</b> action?</qt>").tqarg(currentActionName),TQString(),KStdGuiItem::del()) == KMessageBox::Continue ) { emit removeAction(m_toolbarTab->tabUnderMouse, currentActionName); } diff --git a/quanta/utility/toolbartabwidget.h b/quanta/utility/toolbartabwidget.h index 6be17eda..11318394 100644 --- a/quanta/utility/toolbartabwidget.h +++ b/quanta/utility/toolbartabwidget.h @@ -24,16 +24,17 @@ class TQWidgetStack; class TQTabBar; class KToolBar; -class ToolbarTabWidget: public QTabWidget +class ToolbarTabWidget: public TQTabWidget { Q_OBJECT + TQ_OBJECT public: TQWidgetStack *m_widgetStack; - static ToolbarTabWidget* const ref(TQWidget *parent = 0L, const char *name = 0L) + static ToolbarTabWidget* const ref(TQWidget *tqparent = 0L, const char *name = 0L) { static ToolbarTabWidget *m_ref; - if (!m_ref) m_ref = new ToolbarTabWidget (parent, name); + if (!m_ref) m_ref = new ToolbarTabWidget (tqparent, name); return m_ref; } virtual ~ToolbarTabWidget(){}; @@ -76,7 +77,7 @@ protected: TQMap<TQString, TQWidget*> toolbarList; private: - ToolbarTabWidget(TQWidget * parent = 0, const char * name = 0, WFlags f = 0); + ToolbarTabWidget(TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0); KToolBar::IconText m_iconText; }; @@ -84,9 +85,10 @@ private: class QuantaToolBar: public KToolBar { Q_OBJECT + TQ_OBJECT public: - QuantaToolBar (TQWidget *parent, const char *name=0, bool honor_style=FALSE, bool readConfig=TRUE); + QuantaToolBar (TQWidget *tqparent, const char *name=0, bool honor_style=FALSE, bool readConfig=TRUE); virtual ~QuantaToolBar() {}; private slots: |